summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitattributes4
-rw-r--r--.gitignore8
-rw-r--r--.travis.yml1
-rw-r--r--INSTALL1917
-rw-r--r--Makefile.global4
-rw-r--r--NEWS711
-rw-r--r--README.GIT-RULES2
-rw-r--r--README.RELEASE_PROCESS22
-rw-r--r--TSRM/TODO2
-rw-r--r--TSRM/TSRM.c46
-rw-r--r--TSRM/TSRM.h13
-rw-r--r--TSRM/threads.m481
-rw-r--r--TSRM/tsrm.m418
-rw-r--r--UPGRADING333
-rw-r--r--UPGRADING.INTERNALS51
-rw-r--r--Zend/bench.php2
-rw-r--r--Zend/tests/gc_032.phpt28
-rw-r--r--Zend/zend.c46
-rw-r--r--Zend/zend.h6
-rw-r--r--Zend/zend_API.c19
-rw-r--r--Zend/zend_API.h11
-rw-r--r--Zend/zend_ast.c170
-rw-r--r--Zend/zend_ast.h13
-rw-r--r--Zend/zend_builtin_functions.c10
-rw-r--r--Zend/zend_closures.c3
-rw-r--r--Zend/zend_compile.c82
-rw-r--r--Zend/zend_compile.h65
-rw-r--r--Zend/zend_constants.c2
-rw-r--r--Zend/zend_exceptions.c8
-rw-r--r--Zend/zend_execute.c83
-rw-r--r--Zend/zend_execute.h3
-rw-r--r--Zend/zend_execute_API.c124
-rw-r--r--Zend/zend_hash.c140
-rw-r--r--Zend/zend_hash.h40
-rw-r--r--Zend/zend_inheritance.c23
-rw-r--r--Zend/zend_ini.c4
-rw-r--r--Zend/zend_ini.h14
-rw-r--r--Zend/zend_object_handlers.c206
-rw-r--r--Zend/zend_object_handlers.h5
-rw-r--r--Zend/zend_objects.c3
-rw-r--r--Zend/zend_opcode.c27
-rw-r--r--Zend/zend_operators.c16
-rw-r--r--Zend/zend_operators.h8
-rw-r--r--Zend/zend_smart_string.h4
-rw-r--r--Zend/zend_ts_hash.c14
-rw-r--r--Zend/zend_ts_hash.h7
-rw-r--r--Zend/zend_types.h144
-rw-r--r--Zend/zend_variables.c15
-rw-r--r--Zend/zend_virtual_cwd.c122
-rw-r--r--Zend/zend_virtual_cwd.h4
-rw-r--r--Zend/zend_vm_def.h202
-rw-r--r--Zend/zend_vm_execute.h2115
-rw-r--r--Zend/zend_vm_gen.php28
-rw-r--r--configure.ac15
-rw-r--r--ext/bcmath/bcmath.c78
-rw-r--r--ext/bcmath/config.m42
-rw-r--r--ext/bcmath/config.w322
-rw-r--r--ext/bcmath/libbcmath/src/bcmath.h6
-rw-r--r--ext/bcmath/libbcmath/src/init.c12
-rw-r--r--ext/bcmath/libbcmath/src/num2str.c13
-rw-r--r--ext/bcmath/libbcmath/src/raise.c4
-rw-r--r--ext/bcmath/libbcmath/src/raisemod.c30
-rw-r--r--ext/bcmath/libbcmath/src/rt.c65
-rw-r--r--ext/bcmath/package.xml94
-rw-r--r--ext/bcmath/tests/bcpow.phpt2
-rw-r--r--ext/bcmath/tests/bcpow_error1.phpt15
-rw-r--r--ext/bcmath/tests/bcpow_error2.phpt15
-rw-r--r--ext/bcmath/tests/bcscale_variation003.phpt18
-rw-r--r--ext/bcmath/tests/bug.66364.phpt14
-rw-r--r--ext/bcmath/tests/bug72093-win32.phpt18
-rw-r--r--ext/bcmath/tests/bug72093.phpt6
-rw-r--r--ext/bcmath/tests/bug75178-win32.phpt21
-rw-r--r--ext/bcmath/tests/bug75178.phpt10
-rw-r--r--ext/bcmath/tests/scale.phpt27
-rw-r--r--ext/bcmath/tests/scale_ini.phpt29
-rw-r--r--ext/bz2/package.xml37
-rw-r--r--ext/calendar/package.xml73
-rw-r--r--ext/com_dotnet/README71
-rw-r--r--ext/com_dotnet/com_olechar.c2
-rw-r--r--ext/com_dotnet/com_variant.c1
-rw-r--r--ext/com_dotnet/package.xml52
-rw-r--r--ext/ctype/package.xml45
-rw-r--r--ext/curl/interface.c2
-rw-r--r--ext/curl/package.xml52
-rw-r--r--ext/curl/tests/curl_multi_close_basic001.phpt25
-rw-r--r--ext/curl/tests/curl_share_close_basic001.phpt19
-rw-r--r--ext/date/TODO5
-rw-r--r--ext/date/php_date.c45
-rw-r--r--ext/date/php_date.h1
-rw-r--r--ext/date/tests/DateTime_createFromImmutable.phpt32
-rw-r--r--ext/date/tests/DateTime_verify.phpt37
-rw-r--r--ext/date/tests/date_default_timezone_get_error.phpt6
-rw-r--r--ext/date/tests/time_error.phpt6
-rw-r--r--ext/dom/examples/dom1.inc43
-rw-r--r--ext/dom/examples/dom1.php94
-rw-r--r--ext/dom/examples/note-invalid.xml9
-rw-r--r--ext/dom/examples/note.dtd6
-rw-r--r--ext/dom/examples/note.php19
-rw-r--r--ext/dom/examples/note.xml8
-rw-r--r--ext/dom/examples/relaxNG.php11
-rw-r--r--ext/dom/examples/relaxNG.rng11
-rw-r--r--ext/dom/examples/relaxNG.xml1
-rw-r--r--ext/dom/examples/relaxNG2.rng23
-rw-r--r--ext/dom/examples/relaxNG3.rng8
-rw-r--r--ext/dom/examples/shipping.php11
-rw-r--r--ext/dom/examples/shipping.xml21
-rw-r--r--ext/dom/examples/shipping.xsd36
-rw-r--r--ext/dom/php_dom.c3
-rw-r--r--ext/dom/xpath.c3
-rw-r--r--ext/enchant/docs/examples/example1.php25
-rwxr-xr-xext/enchant/package.xml162
-rw-r--r--ext/enchant/tests/broker_describe.phpt23
-rw-r--r--ext/enchant/tests/broker_list_dicts.phpt21
-rw-r--r--ext/enchant/tests/bug13181.phpt21
-rw-r--r--ext/exif/example.php23
-rw-r--r--ext/exif/package.xml61
-rw-r--r--ext/exif/test.php3
-rw-r--r--ext/exif/test.txt365
-rw-r--r--ext/exif/tests/bug64739.jpgbin0 -> 4812 bytes
-rw-r--r--ext/exif/tests/bug64739.phpt42
-rwxr-xr-xext/ext_skel332
-rw-r--r--ext/ext_skel.php365
-rw-r--r--ext/ext_skel_win32.php52
-rw-r--r--ext/fileinfo/EXPERIMENTAL0
-rw-r--r--ext/fileinfo/package.xml44
-rw-r--r--ext/filter/filter.c6
-rw-r--r--ext/filter/logical_filters.c13
-rw-r--r--ext/ftp/package.xml55
-rw-r--r--ext/ftp/php_ftp.c74
-rw-r--r--ext/ftp/tests/004.phpt20
-rw-r--r--ext/ftp/tests/006.phpt18
-rw-r--r--ext/ftp/tests/007.phpt148
-rw-r--r--ext/ftp/tests/ftp_append.phpt24
-rw-r--r--ext/gd/gd.c95
-rw-r--r--ext/gd/php_gd.h11
-rw-r--r--ext/gd/tests/createfromstring.phpt4
-rw-r--r--ext/gd/tests/gd_info_error.phpt6
-rw-r--r--ext/gd/tests/imagecreatefromstring.bmpbin0 -> 374 bytes
-rw-r--r--ext/gd/tests/imagecreatefromstring.gifbin0 -> 46 bytes
-rw-r--r--ext/gd/tests/imagecreatefromstring.webpbin0 -> 82 bytes
-rw-r--r--ext/gd/tests/imagecreatefromstring_gif.phpt20
-rw-r--r--ext/gd/tests/imagecreatefromstring_png.phpt20
-rw-r--r--ext/gd/tests/imagecreatefromstring_webp.phpt20
-rw-r--r--ext/gmp/README5
-rw-r--r--ext/gmp/config.m41
-rw-r--r--ext/gmp/config.w321
-rw-r--r--ext/gmp/gmp.c16
-rw-r--r--ext/gmp/php_gmp.h17
-rw-r--r--ext/gmp/php_gmp_int.h31
-rw-r--r--ext/gmp/tests/bug67917.phpt (renamed from ext/gmp/bug67917.phpt)0
-rw-r--r--ext/gmp/tests/bug70284.phpt19
-rw-r--r--ext/hash/hash_gost.c4
-rw-r--r--ext/hash/hash_snefru.c4
-rw-r--r--ext/hash/package.xml94
-rw-r--r--ext/interbase/interbase.c3
-rw-r--r--ext/intl/breakiterator/breakiterator_class.cpp3
-rw-r--r--ext/intl/calendar/calendar_class.cpp16
-rw-r--r--ext/intl/dateformat/dateformat_class.c7
-rw-r--r--ext/intl/formatter/formatter_class.c7
-rw-r--r--ext/intl/msgformat/msgformat_class.c8
-rw-r--r--ext/intl/msgformat/msgformat_format.c3
-rw-r--r--ext/intl/resourcebundle/resourcebundle_class.c6
-rw-r--r--ext/intl/spoofchecker/spoofchecker_class.c7
-rw-r--r--ext/intl/timezone/timezone_class.cpp3
-rw-r--r--ext/json/json_encoder.c32
-rw-r--r--ext/json/json_parser.tab.c6
-rw-r--r--ext/json/json_parser.y6
-rw-r--r--ext/ldap/config.m42
-rw-r--r--ext/ldap/config.w323
-rw-r--r--ext/ldap/ldap.c1355
-rw-r--r--ext/ldap/tests/connect.inc8
-rw-r--r--ext/ldap/tests/ldap_add_error.phpt10
-rw-r--r--ext/ldap/tests/ldap_add_ext.phpt94
-rw-r--r--ext/ldap/tests/ldap_bind_ext.phpt72
-rw-r--r--ext/ldap/tests/ldap_compare_error.phpt10
-rw-r--r--ext/ldap/tests/ldap_controls.phpt162
-rw-r--r--ext/ldap/tests/ldap_delete_error.phpt8
-rw-r--r--ext/ldap/tests/ldap_delete_ext.phpt71
-rw-r--r--ext/ldap/tests/ldap_exop.phpt4
-rw-r--r--ext/ldap/tests/ldap_exop_passwd.phpt5
-rw-r--r--ext/ldap/tests/ldap_exop_passwd_error.phpt7
-rw-r--r--ext/ldap/tests/ldap_exop_refresh.phpt43
-rw-r--r--ext/ldap/tests/ldap_first_reference_basic.phpt3
-rw-r--r--ext/ldap/tests/ldap_get_option_controls.phpt58
-rw-r--r--ext/ldap/tests/ldap_get_option_variation.phpt16
-rw-r--r--ext/ldap/tests/ldap_list_basic.phpt4
-rw-r--r--ext/ldap/tests/ldap_list_error.phpt4
-rw-r--r--ext/ldap/tests/ldap_mod_add_error.phpt10
-rw-r--r--ext/ldap/tests/ldap_mod_del_error.phpt10
-rw-r--r--ext/ldap/tests/ldap_mod_ext.phpt172
-rw-r--r--ext/ldap/tests/ldap_mod_replace_error.phpt10
-rw-r--r--ext/ldap/tests/ldap_modify_batch_basic.phpt2
-rw-r--r--ext/ldap/tests/ldap_modify_batch_error.phpt10
-rw-r--r--ext/ldap/tests/ldap_modify_error.phpt10
-rw-r--r--ext/ldap/tests/ldap_next_reference_basic.phpt5
-rw-r--r--ext/ldap/tests/ldap_parse_result_basic.phpt3
-rw-r--r--ext/ldap/tests/ldap_parse_result_controls.phpt47
-rw-r--r--ext/ldap/tests/ldap_read_error.phpt4
-rw-r--r--ext/ldap/tests/ldap_rename_error.phpt2
-rw-r--r--ext/ldap/tests/ldap_rename_ext.phpt80
-rw-r--r--ext/ldap/tests/ldap_search_basic.phpt6
-rw-r--r--ext/ldap/tests/ldap_search_overrides.phpt6
-rw-r--r--ext/ldap/tests/ldap_search_paged_result_controls.phpt99
-rw-r--r--ext/ldap/tests/ldap_search_sort_controls.phpt207
-rw-r--r--ext/ldap/tests/ldap_search_variation6.phpt10
-rw-r--r--ext/ldap/tests/ldap_set_option_error.phpt5
-rw-r--r--ext/ldap/tests/ldap_set_option_variation.phpt16
-rw-r--r--ext/ldap/tests/skipifcontrol.inc13
-rw-r--r--ext/libxml/libxml.c4
-rw-r--r--ext/mbstring/.gitignore1
-rw-r--r--ext/mbstring/README17
-rw-r--r--ext/mbstring/README.libmbfl16
-rw-r--r--ext/mbstring/README_PHP3-i18n-ja774
-rw-r--r--ext/mbstring/libmbfl/README15
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_7bit.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_armscii8.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_ascii.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_base64.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_big5.c8
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_byte2.c8
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_byte4.c8
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_cp1251.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_cp1252.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_cp1254.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_cp5022x.c20
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_cp51932.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_cp850.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_cp866.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_cp932.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_cp936.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_euc_cn.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_euc_jp.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_euc_jp_2004.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_euc_kr.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_gb18030.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_htmlent.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_hz.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_iso2022_jp_ms.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_iso2022_kr.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_2004.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_iso8859_1.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_iso8859_10.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_iso8859_13.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_iso8859_14.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_iso8859_15.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_iso8859_16.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_iso8859_2.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_iso8859_3.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_iso8859_4.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_iso8859_5.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_iso8859_6.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_iso8859_7.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_iso8859_8.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_iso8859_9.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_jis.c8
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_koi8r.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_koi8u.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_qprint.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_sjis.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c12
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_sjis_open.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_ucs2.c12
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_ucs4.c12
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_uhc.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_utf16.c12
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_utf32.c12
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_utf7.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_utf8.c4
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c16
-rw-r--r--ext/mbstring/libmbfl/filters/mbfilter_uuencode.c4
-rw-r--r--ext/mbstring/libmbfl/mbfl/mbfilter.c729
-rw-r--r--ext/mbstring/libmbfl/mbfl/mbfilter.h75
-rw-r--r--ext/mbstring/libmbfl/mbfl/mbfilter_8bit.c4
-rw-r--r--ext/mbstring/libmbfl/mbfl/mbfilter_pass.c4
-rw-r--r--ext/mbstring/libmbfl/mbfl/mbfilter_wchar.c4
-rw-r--r--ext/mbstring/libmbfl/mbfl/mbfl_allocators.c12
-rw-r--r--ext/mbstring/libmbfl/mbfl/mbfl_allocators.h11
-rw-r--r--ext/mbstring/libmbfl/mbfl/mbfl_convert.c238
-rw-r--r--ext/mbstring/libmbfl/mbfl/mbfl_convert.h23
-rw-r--r--ext/mbstring/libmbfl/mbfl/mbfl_defs.h4
-rw-r--r--ext/mbstring/libmbfl/mbfl/mbfl_encoding.c4
-rw-r--r--ext/mbstring/libmbfl/mbfl/mbfl_encoding.h13
-rw-r--r--ext/mbstring/libmbfl/mbfl/mbfl_memory_device.c153
-rw-r--r--ext/mbstring/libmbfl/mbfl/mbfl_memory_device.h24
-rw-r--r--ext/mbstring/libmbfl/mbfl/mbfl_string.c7
-rw-r--r--ext/mbstring/libmbfl/mbfl/mbfl_string.h7
-rw-r--r--ext/mbstring/mb_gpc.c20
-rw-r--r--ext/mbstring/mbstring.c1498
-rw-r--r--ext/mbstring/mbstring.h49
-rw-r--r--ext/mbstring/php_unicode.c485
-rw-r--r--ext/mbstring/php_unicode.h281
-rw-r--r--ext/mbstring/tests/bug65544.phpt8
-rw-r--r--ext/mbstring/tests/bug66964.phpt15
-rw-r--r--ext/mbstring/tests/bug69267.phpt4
-rw-r--r--ext/mbstring/tests/bug71298.phpt8
-rw-r--r--ext/mbstring/tests/casefolding.phpt38
-rw-r--r--ext/mbstring/tests/casemapping.phpt109
-rw-r--r--ext/mbstring/tests/mb_convert_case_invalid_mode.phpt11
-rw-r--r--ext/mbstring/tests/mb_strtolower_variation2.phpt18
-rw-r--r--ext/mbstring/tests/mb_strtoupper_variation2.phpt18
-rw-r--r--ext/mbstring/ucgendat/README2
-rw-r--r--ext/mbstring/ucgendat/ucgendat.c1999
-rw-r--r--ext/mbstring/ucgendat/ucgendat.php641
-rw-r--r--ext/mbstring/ucgendat/uctest.php131
-rw-r--r--ext/mbstring/unicode_data.h6965
-rw-r--r--ext/mysqli/TODO2
-rw-r--r--ext/mysqli/mysqli.c13
-rw-r--r--ext/mysqli/mysqli_api.c2
-rw-r--r--ext/mysqli/mysqli_priv.h2
-rw-r--r--ext/mysqli/package.xml116
-rw-r--r--ext/mysqlnd/mysqlnd_wireprotocol.c2
-rw-r--r--ext/odbc/birdstep.c709
-rw-r--r--ext/odbc/config.m473
-rw-r--r--ext/odbc/php_birdstep.h95
-rw-r--r--ext/odbc/php_odbc.c56
-rw-r--r--ext/odbc/php_odbc.h4
-rw-r--r--ext/odbc/php_odbc_includes.h37
-rw-r--r--ext/opcache/Optimizer/block_pass.c2
-rw-r--r--ext/opcache/Optimizer/compact_literals.c1
-rw-r--r--ext/opcache/Optimizer/compact_vars.c113
-rw-r--r--ext/opcache/Optimizer/dce.c178
-rw-r--r--ext/opcache/Optimizer/dfa_pass.c400
-rw-r--r--ext/opcache/Optimizer/escape_analysis.c566
-rw-r--r--ext/opcache/Optimizer/optimize_func_calls.c4
-rw-r--r--ext/opcache/Optimizer/pass1_5.c11
-rw-r--r--ext/opcache/Optimizer/pass3.c2
-rw-r--r--ext/opcache/Optimizer/sccp.c1228
-rw-r--r--ext/opcache/Optimizer/zend_cfg.c2
-rw-r--r--ext/opcache/Optimizer/zend_cfg.h6
-rw-r--r--ext/opcache/Optimizer/zend_dfg.c4
-rw-r--r--ext/opcache/Optimizer/zend_dump.c41
-rw-r--r--ext/opcache/Optimizer/zend_dump.h3
-rw-r--r--ext/opcache/Optimizer/zend_func_info.c606
-rw-r--r--ext/opcache/Optimizer/zend_inference.c84
-rw-r--r--ext/opcache/Optimizer/zend_inference.h16
-rw-r--r--ext/opcache/Optimizer/zend_optimizer.c131
-rw-r--r--ext/opcache/Optimizer/zend_optimizer.h1
-rw-r--r--ext/opcache/Optimizer/zend_optimizer_internal.h1
-rw-r--r--ext/opcache/Optimizer/zend_ssa.c29
-rw-r--r--ext/opcache/Optimizer/zend_ssa.h8
-rw-r--r--ext/opcache/ZendAccelerator.c12
-rw-r--r--ext/opcache/ZendAccelerator.h4
-rw-r--r--ext/opcache/config.m41
-rw-r--r--ext/opcache/config.w322
-rw-r--r--ext/opcache/tests/jmp_elim_002.phpt38
-rw-r--r--ext/opcache/tests/jmp_elim_003.phpt27
-rw-r--r--ext/opcache/tests/opt/dce_001.phpt31
-rw-r--r--ext/opcache/tests/opt/dce_002.phpt34
-rw-r--r--ext/opcache/tests/opt/dce_003.phpt28
-rw-r--r--ext/opcache/tests/opt/dce_004.phpt30
-rw-r--r--ext/opcache/tests/opt/dce_005.phpt28
-rw-r--r--ext/opcache/tests/opt/dce_006.phpt39
-rw-r--r--ext/opcache/tests/opt/dce_007.phpt28
-rw-r--r--ext/opcache/tests/opt/dce_008.phpt29
-rw-r--r--ext/opcache/tests/opt/sccp_001.phpt28
-rw-r--r--ext/opcache/tests/opt/sccp_002.phpt36
-rw-r--r--ext/opcache/tests/opt/sccp_003.phpt35
-rw-r--r--ext/opcache/tests/opt/sccp_004.phpt39
-rw-r--r--ext/opcache/tests/opt/sccp_005.phpt28
-rw-r--r--ext/opcache/tests/opt/sccp_006.phpt35
-rw-r--r--ext/opcache/tests/opt/sccp_007.phpt32
-rw-r--r--ext/opcache/tests/opt/sccp_008.phpt37
-rw-r--r--ext/opcache/tests/opt/sccp_009.phpt29
-rw-r--r--ext/opcache/tests/opt/sccp_010.phpt36
-rw-r--r--ext/opcache/tests/opt/sccp_011.phpt35
-rw-r--r--ext/opcache/tests/opt/sccp_012.phpt38
-rw-r--r--ext/opcache/tests/opt/sccp_013.phpt22
-rw-r--r--ext/opcache/tests/opt/sccp_014.phpt23
-rw-r--r--ext/opcache/tests/opt/sccp_015.phpt26
-rw-r--r--ext/opcache/tests/opt/sccp_016.phpt21
-rw-r--r--ext/opcache/tests/opt/sccp_017.phpt30
-rw-r--r--ext/opcache/tests/opt/sccp_018.phpt23
-rw-r--r--ext/opcache/tests/opt/sccp_019.phpt29
-rw-r--r--ext/opcache/tests/opt/sccp_020.phpt22
-rw-r--r--ext/opcache/tests/opt/sccp_021.phpt30
-rw-r--r--ext/opcache/tests/opt/sccp_022.phpt39
-rw-r--r--ext/opcache/tests/opt/skipif.inc3
-rw-r--r--ext/opcache/zend_accelerator_util_funcs.c3
-rw-r--r--ext/opcache/zend_file_cache.c87
-rw-r--r--ext/opcache/zend_persist.c43
-rw-r--r--ext/opcache/zend_persist_calc.c5
-rw-r--r--ext/openssl/tests/openssl_get_cert_locations_basic.phpt28
-rw-r--r--ext/openssl/xp_ssl.c4
-rw-r--r--ext/pcntl/package.xml46
-rw-r--r--ext/pcntl/pcntl.c2
-rw-r--r--ext/pdo/package2.xml134
-rw-r--r--ext/pdo/pdo_stmt.c3
-rw-r--r--ext/pdo_dblib/package2.xml76
-rw-r--r--ext/pdo_firebird/firebird_driver.c3
-rw-r--r--ext/pdo_firebird/package2.xml68
-rw-r--r--ext/pdo_mysql/mysql_driver.c34
-rw-r--r--ext/pdo_mysql/package2.xml93
-rw-r--r--ext/pdo_odbc/EXPERIMENTAL2
-rw-r--r--ext/pdo_odbc/package2.xml71
-rw-r--r--ext/pdo_pgsql/package2.xml87
-rw-r--r--ext/pdo_sqlite/package2.xml203
-rw-r--r--ext/pdo_sqlite/pdo_sqlite.c5
-rw-r--r--ext/pdo_sqlite/php_pdo_sqlite_int.h5
-rw-r--r--ext/pdo_sqlite/sqlite_driver.c9
-rw-r--r--ext/pdo_sqlite/tests/pdo_sqlite_open_flags.phpt33
-rw-r--r--ext/pgsql/pgsql.c18
-rw-r--r--ext/pgsql/pgsql.mak170
-rw-r--r--ext/phar/dirstream.c58
-rw-r--r--ext/phar/package.xml1452
-rw-r--r--ext/phar/phar.c12
-rw-r--r--ext/phar/phar_object.c14
-rw-r--r--ext/phar/stream.c102
-rw-r--r--ext/phar/zip.c4
-rw-r--r--ext/posix/package.xml49
-rw-r--r--ext/readline/tests/readline_read_history_open_basedir_001.phpt17
-rw-r--r--ext/readline/tests/readline_write_history_open_basedir_001.phpt17
-rw-r--r--ext/reflection/php_reflection.c31
-rw-r--r--ext/session/package.xml83
-rw-r--r--ext/session/session.c7
-rw-r--r--ext/session/tests/session_id_error2.phpt15
-rw-r--r--ext/session/tests/session_id_error3.phpt40
-rw-r--r--ext/shmop/package.xml46
-rw-r--r--ext/shmop/package2.xml56
-rw-r--r--ext/simplexml/examples/book.php8
-rw-r--r--ext/simplexml/examples/book.xml10
-rw-r--r--ext/simplexml/examples/interop.php27
-rw-r--r--ext/simplexml/examples/security.php6
-rw-r--r--ext/simplexml/examples/security.xml4
-rw-r--r--ext/simplexml/examples/xpath.php9
-rw-r--r--ext/simplexml/simplexml.c6
-rw-r--r--ext/skeleton/CREDITS1
-rw-r--r--ext/skeleton/EXPERIMENTAL0
-rw-r--r--ext/skeleton/config.m4.in7
-rw-r--r--ext/skeleton/config.w32.in7
-rwxr-xr-xext/skeleton/create_stubs289
-rw-r--r--ext/skeleton/php_skeleton.h49
-rw-r--r--ext/skeleton/skeleton.c173
-rw-r--r--ext/skeleton/skeleton.php21
-rw-r--r--ext/skeleton/tests/001.phpt23
-rw-r--r--ext/skeleton/tests/002.phpt17
-rw-r--r--ext/skeleton/tests/003.phpt16
-rw-r--r--ext/soap/package.xml63
-rw-r--r--ext/soap/php_encoding.c7
-rw-r--r--ext/soap/php_http.c90
-rw-r--r--ext/soap/soap.c28
-rw-r--r--ext/soap/tests/bug70211.phpt2
-rw-r--r--ext/soap/tests/fault001.phpt13
-rw-r--r--ext/sockets/package.xml65
-rwxr-xr-xext/spl/package.xml75
-rw-r--r--ext/spl/spl_array.c3
-rw-r--r--ext/spl/spl_directory.c8
-rw-r--r--ext/spl/spl_dllist.c3
-rw-r--r--ext/spl/spl_heap.c3
-rw-r--r--ext/spl/spl_observer.c14
-rw-r--r--ext/sqlite3/tests/sqlite3_busyTimeout.phpt20
-rw-r--r--ext/standard/array.c112
-rw-r--r--ext/standard/basic_functions.c27
-rw-r--r--ext/standard/browscap.c12
-rw-r--r--ext/standard/credits.c2
-rw-r--r--ext/standard/dir.c2
-rw-r--r--ext/standard/dns.c4
-rw-r--r--ext/standard/file.c2
-rw-r--r--ext/standard/file.h2
-rw-r--r--ext/standard/filestat.c2
-rw-r--r--ext/standard/ftp_fopen_wrapper.c52
-rw-r--r--ext/standard/http.c10
-rw-r--r--ext/standard/http_fopen_wrapper.c61
-rw-r--r--ext/standard/image.c2
-rw-r--r--ext/standard/iptc.c2
-rw-r--r--ext/standard/lcg.c3
-rw-r--r--ext/standard/link.c2
-rw-r--r--ext/standard/link_win32.c5
-rw-r--r--ext/standard/math.c2
-rw-r--r--ext/standard/microtime.c2
-rw-r--r--ext/standard/password.c3
-rw-r--r--ext/standard/php_array.h2
-rw-r--r--ext/standard/php_dns.h4
-rw-r--r--ext/standard/php_fopen_wrapper.c15
-rw-r--r--ext/standard/streamsfuncs.c8
-rw-r--r--ext/standard/string.c32
-rw-r--r--ext/standard/tests/array/array_change_key_case_variation1.phpt2
-rw-r--r--ext/standard/tests/array/array_change_key_case_variation2.phpt2
-rw-r--r--ext/standard/tests/array/array_change_key_case_variation3.phpt2
-rw-r--r--ext/standard/tests/array/array_change_key_case_variation4.phpt2
-rw-r--r--ext/standard/tests/array/array_change_key_case_variation5.phpt2
-rw-r--r--ext/standard/tests/array/array_change_key_case_variation6.phpt2
-rw-r--r--ext/standard/tests/array/array_change_key_case_variation7.phpt2
-rw-r--r--ext/standard/tests/array/compact_variation1.phpt4
-rw-r--r--ext/standard/tests/array/count_variation3.phpt2
-rw-r--r--ext/standard/tests/file/file.inc2
-rw-r--r--ext/standard/tests/general_functions/debug_zval_dump_o.phpt492
-rw-r--r--ext/standard/tests/general_functions/strval.phpt2
-rw-r--r--ext/standard/tests/image/getimagesize.phpt6
-rw-r--r--ext/standard/tests/image/getimagesize_basic.phpt2
-rw-r--r--ext/standard/tests/image/image_type_to_mime_type.phpt6
-rw-r--r--ext/standard/tests/image/image_type_to_mime_type_basic.phpt2
-rw-r--r--ext/standard/tests/image/image_type_to_mime_type_variation3.phpt2
-rw-r--r--ext/standard/tests/math/lcg_value_basic.phpt24
-rw-r--r--ext/standard/tests/math/rand_inverted_order.phpt20
-rw-r--r--ext/standard/tests/serialize/bug70172.phpt2
-rw-r--r--ext/standard/tests/serialize/bug70963.phpt22
-rw-r--r--ext/standard/tests/serialize/unserialize_mem_leak.phpt5
-rw-r--r--ext/standard/tests/setrawcookie_basic_001.phpt10
-rw-r--r--ext/standard/tests/setrawcookie_basic_002.phpt12
-rw-r--r--ext/standard/tests/streams/bug75031.phpt25
-rw-r--r--ext/standard/tests/strings/bug72433.phpt40
-rw-r--r--ext/standard/url.c105
-rw-r--r--ext/standard/url.h14
-rw-r--r--ext/standard/url_scanner_ex.c138
-rw-r--r--ext/standard/url_scanner_ex.re48
-rw-r--r--ext/standard/var.c87
-rw-r--r--ext/standard/var_unserializer.c871
-rw-r--r--ext/standard/var_unserializer.re5
-rw-r--r--ext/sysvmsg/package.xml40
-rw-r--r--ext/sysvsem/package.xml39
-rw-r--r--ext/sysvshm/package.xml40
-rw-r--r--ext/tidy/README7
-rw-r--r--ext/tidy/package.xml65
-rw-r--r--ext/tokenizer/package.xml45
-rw-r--r--ext/wddx/package.xml43
-rw-r--r--ext/wddx/wddx.c44
-rw-r--r--ext/xml/package.xml74
-rw-r--r--ext/xml/xml.c2
-rw-r--r--ext/xml/xml.mak172
-rw-r--r--ext/xmlreader/package.xml75
-rw-r--r--ext/xmlrpc/xmlrpc-epi-php.c22
-rw-r--r--ext/xmlwriter/package.xml107
-rw-r--r--ext/xmlwriter/package2.xml94
-rw-r--r--ext/xsl/php_xsl.c6
-rw-r--r--ext/xsl/xsltprocessor.c3
-rw-r--r--ext/zend_test/test.c2
-rw-r--r--ext/zip/config.m42
-rw-r--r--ext/zip/config.w3233
-rw-r--r--ext/zip/php_zip.c8
-rw-r--r--ext/zlib/package.xml69
-rw-r--r--ext/zlib/tests/zlib_get_coding_type_basic.phpt19
-rw-r--r--ext/zlib/tests/zlib_get_coding_type_br.phpt21
-rw-r--r--ext/zlib/tests/zlib_get_coding_type_deflate.phpt21
-rw-r--r--ext/zlib/tests/zlib_get_coding_type_gzip.phpt21
-rw-r--r--main/build-defs.h.in2
-rw-r--r--main/fastcgi.c4
-rw-r--r--main/fopen_wrappers.c32
-rw-r--r--main/fopen_wrappers.h2
-rw-r--r--main/main.c159
-rw-r--r--main/network.c14
-rw-r--r--main/php.h2
-rw-r--r--main/php_main.h2
-rw-r--r--main/php_memory_streams.h12
-rw-r--r--main/php_open_temporary_file.c11
-rw-r--r--main/php_reentrancy.h2
-rw-r--r--main/php_syslog.c92
-rw-r--r--main/php_syslog.h22
-rw-r--r--main/php_version.h6
-rw-r--r--main/reentrancy.c12
-rw-r--r--main/streams/memory.c33
-rw-r--r--main/streams/streams.c2
-rw-r--r--php.ini-development2
-rw-r--r--php.ini-production2
-rwxr-xr-xrun-tests.php155
-rw-r--r--sapi/apache2handler/config.m47
-rw-r--r--sapi/cli/TODO2
-rw-r--r--sapi/cli/tests/012-2.phpt52
-rw-r--r--sapi/cli/tests/cli_get_process_title_basic.phpt18
-rw-r--r--sapi/cli/tests/cli_get_process_title_error.phpt16
-rw-r--r--sapi/cli/tests/cli_set_process_title_basic.phpt19
-rw-r--r--sapi/cli/tests/cli_set_process_title_error.phpt19
-rw-r--r--sapi/fpm/.gitignore4
-rw-r--r--sapi/fpm/fpm/fpm_sockets.c2
-rw-r--r--sapi/phpdbg/.gitignore6
-rw-r--r--sapi/phpdbg/.travis.yml11
-rw-r--r--sapi/phpdbg/README.md2
-rw-r--r--sapi/phpdbg/phpdbg_opcode.c8
-rw-r--r--sapi/phpdbg/phpdbg_utils.c36
-rwxr-xr-xsapi/phpdbg/travis/ci.sh11
-rw-r--r--tests/lang/operators/operator_identical_recusion-01.phpt10
-rwxr-xr-xtravis/compile.sh1
-rw-r--r--win32/build/config.w3238
-rw-r--r--win32/build/confutils.js26
-rw-r--r--win32/build/mkdist.php10
-rw-r--r--win32/install.txt1797
-rw-r--r--win32/ioutil.c2
-rw-r--r--win32/select.c2
-rw-r--r--win32/syslog.h1
-rw-r--r--win32/wsyslog.c34
583 files changed, 17764 insertions, 26345 deletions
diff --git a/.gitattributes b/.gitattributes
index f60bcf700c..5175cd3e82 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -3,7 +3,7 @@ ext/simplexml/simplexml.c ident
ext/iconv/php_iconv.h ident
ext/posix/posix.c ident
ext/recode/recode.c ident
-ext/skeleton/create_stubs ident
+ext/ext_skel.php ident
ext/phar/phar/pharcommand.inc ident
ext/phar/phar.c ident
ext/sysvmsg/sysvmsg.c ident
@@ -17,8 +17,6 @@ ext/dba/libcdb/cdb.c ident
ext/filter/filter.c ident
README.input_filter ident
run-tests.php ident
-Zend/RFCs/002.txt ident
-Zend/RFCs/003.txt ident
ext/exif/exif.c ident
ext/ldap/ldap.c ident
ext/pdo_pgsql/pdo_pgsql.c ident
diff --git a/.gitignore b/.gitignore
index f3f79b2ea1..1499729868 100644
--- a/.gitignore
+++ b/.gitignore
@@ -141,6 +141,7 @@ ext/mbstring/libmbfl/filters/Makefile.in
ext/mbstring/libmbfl/mbfl/Makefile.in
ext/mbstring/libmbfl/mbfl/EastAsianWidth.txt
ext/mbstring/libmbfl/nls/Makefile.in
+ext/mbstring/oniguruma/oniguruma.h
ext/mssql/#*#
ext/mssql/Makefile.global
ext/mssql/acinclude.m4
@@ -188,9 +189,15 @@ sapi/fpm/php-fpm.1
sapi/fpm/init.d.php-fpm
sapi/fpm/php-fpm.conf
sapi/fpm/fpm/php-cgi
+sapi/fpm/php-fpm.8
+sapi/fpm/php-fpm.service
+sapi/fpm/status.html
+sapi/fpm/www.conf
sapi/phpdbg/phpdbg_parser.c
sapi/phpdbg/phpdbg_parser.h
sapi/phpdbg/phpdbg
+sapi/phpdbg/build
+sapi/phpdbg/*.output
scripts/php-config
scripts/phpize
scripts/man1/*.1
@@ -231,4 +238,3 @@ win32/wsyslog.h
# special cases to invert previous ignore rules
!ext/fileinfo/libmagic.patch
!ext/mbstring/oniguruma.patch
-
diff --git a/.travis.yml b/.travis.yml
index 2ea2baf70c..27d36be5a7 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -16,6 +16,7 @@ addons:
- libsasl2-dev
- libxpm-dev
- libt1-dev
+ - libzip-dev
notifications:
email:
diff --git a/INSTALL b/INSTALL
index 958035fd60..d2f4f42a99 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,1916 +1,3 @@
- __________________________________________________________________
+For installation of PHP, please refer to the online documentation available at:
-Installing PHP
- __________________________________________________________________
-
- * General Installation Considerations
- * Installation on Unix systems
- + Apache 2.x on Unix systems
- + Lighttpd 1.4 on Unix systems
- + Sun, iPlanet and Netscape servers on Sun Solaris
- + CGI and command line setups
- + HP-UX specific installation notes
- + OpenBSD installation notes
- + Solaris specific installation tips
- + Debian GNU/Linux installation notes
- * Installation on Mac OS X
- + Using Packages
- + Using the bundled PHP
- + Compiling PHP on Mac OS X
- * Installation of PECL extensions
- + Introduction to PECL Installations
- + Downloading PECL extensions
- + Installing a PHP extension on Windows
- + Compiling shared PECL extensions with the pecl command
- + Compiling shared PECL extensions with phpize
- + php-config
- + Compiling PECL extensions statically into PHP
- * Problems?
- + Read the FAQ
- + Other problems
- + Bug reports
- * Runtime Configuration
- + The configuration file
- + .user.ini files
- + Where a configuration setting may be set
- + How to change configuration settings
- * Installation
- __________________________________________________________________
-
- __________________________________________________________________
-
-Preface
-
- These installation instructions were generated from the HTML version of
- the PHP Manual so formatting and linking have been altered. See the
- online and updated version at: http://php.net/install.unix
- __________________________________________________________________
-
-General Installation Considerations
-
- Before starting the installation, first you need to know what do you
- want to use PHP for. There are three main fields you can use PHP, as
- described in the What can PHP do? section:
- * Websites and web applications (server-side scripting)
- * Command line scripting
- * Desktop (GUI) applications
-
- For the first and most common form, you need three things: PHP itself,
- a web server and a web browser. You probably already have a web
- browser, and depending on your operating system setup, you may also
- have a web server (e.g. Apache on Linux and MacOS X; IIS on Windows).
- You may also rent webspace at a company. This way, you don't need to
- set up anything on your own, only write your PHP scripts, upload it to
- the server you rent, and see the results in your browser.
-
- In case of setting up the server and PHP on your own, you have two
- choices for the method of connecting PHP to the server. For many
- servers PHP has a direct module interface (also called SAPI). These
- servers include Apache, Microsoft Internet Information Server, Netscape
- and iPlanet servers. Many other servers have support for ISAPI, the
- Microsoft module interface (OmniHTTPd for example). If PHP has no
- module support for your web server, you can always use it as a CGI or
- FastCGI processor. This means you set up your server to use the CGI
- executable of PHP to process all PHP file requests on the server.
-
- If you are also interested to use PHP for command line scripting (e.g.
- write scripts autogenerating some images for you offline, or processing
- text files depending on some arguments you pass to them), you always
- need the command line executable. For more information, read the
- section about writing command line PHP applications. In this case, you
- need no server and no browser.
-
- With PHP you can also write desktop GUI applications using the PHP-GTK
- extension. This is a completely different approach than writing web
- pages, as you do not output any HTML, but manage windows and objects
- within them. For more information about PHP-GTK, please » visit the
- site dedicated to this extension. PHP-GTK is not included in the
- official PHP distribution.
-
- From now on, this section deals with setting up PHP for web servers on
- Unix and Windows with server module interfaces and CGI executables. You
- will also find information on the command line executable in the
- following sections.
-
- PHP source code and binary distributions for Windows can be found at
- » http://www.php.net/downloads.php. We recommend you to choose a
- » mirror nearest to you for downloading the distributions.
- __________________________________________________________________
- __________________________________________________________________
-
-Installation on Unix systems
-
-Table of Contents
-
- * Apache 2.x on Unix systems
- * Lighttpd 1.4 on Unix systems
- * Sun, iPlanet and Netscape servers on Sun Solaris
- * CGI and command line setups
- * HP-UX specific installation notes
- * OpenBSD installation notes
- * Solaris specific installation tips
- * Debian GNU/Linux installation notes
-
- This section will guide you through the general configuration and
- installation of PHP on Unix systems. Be sure to investigate any
- sections specific to your platform or web server before you begin the
- process.
-
- As our manual outlines in the General Installation Considerations
- section, we are mainly dealing with web centric setups of PHP in this
- section, although we will cover setting up PHP for command line usage
- as well.
-
- There are several ways to install PHP for the Unix platform, either
- with a compile and configure process, or through various pre-packaged
- methods. This documentation is mainly focused around the process of
- compiling and configuring PHP. Many Unix like systems have some sort of
- package installation system. This can assist in setting up a standard
- configuration, but if you need to have a different set of features
- (such as a secure server, or a different database driver), you may need
- to build PHP and/or your web server. If you are unfamiliar with
- building and compiling your own software, it is worth checking to see
- whether somebody has already built a packaged version of PHP with the
- features you need.
-
- Prerequisite knowledge and software for compiling:
- * Basic Unix skills (being able to operate "make" and a C compiler)
- * An ANSI C compiler
- * A web server
- * Any module specific components (such as GD, PDF libs, etc.)
-
- When building directly from Git sources or after custom modifications
- you might also need:
- * autoconf: 2.13+ (for PHP < 5.4.0), 2.59+ (for PHP >= 5.4.0)
- * automake: 1.4+
- * libtool: 1.4.x+ (except 1.4.2)
- * re2c: Version 0.13.4 or newer
- * flex: Version 2.5.4 (for PHP <= 5.2)
- * bison: Version 1.28 (preferred), 1.35, or 1.75
-
- The initial PHP setup and configuration process is controlled by the
- use of the command line options of the configure script. You could get
- a list of all available options along with short explanations running
- ./configure --help. Our manual documents the different options
- separately. You will find the core options in the appendix, while the
- different extension specific options are described on the reference
- pages.
-
- When PHP is configured, you are ready to build the module and/or
- executables. The command make should take care of this. If it fails and
- you can't figure out why, see the Problems section.
- __________________________________________________________________
-
-Apache 2.x on Unix systems
-
- This section contains notes and hints specific to Apache 2.x installs
- of PHP on Unix systems.
- Warning
-
- We do not recommend using a threaded MPM in production with Apache 2.
- Use the prefork MPM, which is the default MPM with Apache 2.0 and 2.2.
- For information on why, read the related FAQ entry on using Apache2
- with a threaded MPM
-
- The » Apache Documentation is the most authoritative source of
- information on the Apache 2.x server. More information about
- installation options for Apache may be found there.
-
- The most recent version of Apache HTTP Server may be obtained from
- » Apache download site, and a fitting PHP version from the above
- mentioned places. This quick guide covers only the basics to get
- started with Apache 2.x and PHP. For more information read the » Apache
- Documentation. The version numbers have been omitted here, to ensure
- the instructions are not incorrect. In the examples below, 'NN' should
- be replaced with the specific version of Apache being used.
-
- There are currently two versions of Apache 2.x - there's 2.0 and 2.2.
- While there are various reasons for choosing each, 2.2 is the current
- latest version, and the one that is recommended, if that option is
- available to you. However, the instructions here will work for either
- 2.0 or 2.2.
- 1. Obtain the Apache HTTP server from the location listed above, and
- unpack it:
-gzip -d httpd-2_x_NN.tar.gz
-tar -xf httpd-2_x_NN.tar
-
- 2. Likewise, obtain and unpack the PHP source:
-gunzip php-NN.tar.gz
-tar -xf php-NN.tar
-
- 3. Build and install Apache. Consult the Apache install documentation
- for more details on building Apache.
-cd httpd-2_x_NN
-./configure --enable-so
-make
-make install
-
- 4. Now you have Apache 2.x.NN available under /usr/local/apache2,
- configured with loadable module support and the standard MPM
- prefork. To test the installation use your normal procedure for
- starting the Apache server, e.g.:
-/usr/local/apache2/bin/apachectl start
-
- and stop the server to go on with the configuration for PHP:
-/usr/local/apache2/bin/apachectl stop
-
- 5. Now, configure and build PHP. This is where you customize PHP with
- various options, like which extensions will be enabled. Run
- ./configure --help for a list of available options. In our example
- we'll do a simple configure with Apache 2 and MySQL support.
- If you built Apache from source, as described above, the below
- example will match your path for apxs, but if you installed Apache
- some other way, you'll need to adjust the path to apxs accordingly.
- Note that some distros may rename apxs to apxs2.
-cd ../php-NN
-./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql
-make
-make install
-
- If you decide to change your configure options after installation,
- you'll need to re-run the configure, make, and make install steps.
- You only need to restart apache for the new module to take effect.
- A recompile of Apache is not needed.
- Note that unless told otherwise, 'make install' will also install
- PEAR, various PHP tools such as phpize, install the PHP CLI, and
- more.
- 6. Setup your php.ini
-cp php.ini-development /usr/local/lib/php.ini
-
- You may edit your .ini file to set PHP options. If you prefer
- having php.ini in another location, use
- --with-config-file-path=/some/path in step 5.
- If you instead choose php.ini-production, be certain to read the
- list of changes within, as they affect how PHP behaves.
- 7. Edit your httpd.conf to load the PHP module. The path on the right
- hand side of the LoadModule statement must point to the path of the
- PHP module on your system. The make install from above may have
- already added this for you, but be sure to check.
-LoadModule php7_module modules/libphp7.so
- 8. Tell Apache to parse certain extensions as PHP. For example, let's
- have Apache parse .php files as PHP. Instead of only using the
- Apache AddType directive, we want to avoid potentially dangerous
- uploads and created files such as exploit.php.jpg from being
- executed as PHP. Using this example, you could have any
- extension(s) parse as PHP by simply adding them. We'll add .php to
- demonstrate.
-<FilesMatch \.php$>
- SetHandler application/x-httpd-php
-</FilesMatch>
- Or, if we wanted to allow .php, .php2, .php3, .php4, .php5, .php7,
- and .phtml files to be executed as PHP, but nothing else, we'd use
- this:
-<FilesMatch "\.ph(p[2-7]?|tml)$">
- SetHandler application/x-httpd-php
-</FilesMatch>
- And to allow .phps files to be handled by the php source filter,
- and displayed as syntax-highlighted source code, use this:
-<FilesMatch "\.phps$">
- SetHandler application/x-httpd-php-source
-</FilesMatch>
- mod_rewrite may be used To allow any arbitrary .php file to be
- displayed as syntax-highlighted source code, without having to
- rename or copy it to a .phps file:
-RewriteEngine On
-RewriteRule (.*\.php)s$ $1 [H=application/x-httpd-php-source]
- The php source filter should not be enabled on production systems,
- where it may expose confidential or otherwise sensitive information
- embedded in source code.
- 9. Use your normal procedure for starting the Apache server, e.g.:
-/usr/local/apache2/bin/apachectl start
-
- OR
-service httpd restart
-
- Following the steps above you will have a running Apache2 web server
- with support for PHP as a SAPI module. Of course there are many more
- configuration options available Apache and PHP. For more information
- type ./configure --help in the corresponding source tree.
-
- Apache may be built multithreaded by selecting the worker MPM, rather
- than the standard prefork MPM, when Apache is built. This is done by
- adding the following option to the argument passed to ./configure, in
- step 3 above:
- --with-mpm=worker
-
- This should not be undertaken without being aware of the consequences
- of this decision, and having at least a fair understanding of the
- implications. The Apache documentation regarding » MPM-Modules
- discusses MPMs in a great deal more detail.
-
- Note:
-
- The Apache MultiViews FAQ discusses using multiviews with PHP.
-
- Note:
-
- To build a multithreaded version of Apache, the target system must
- support threads. In this case, PHP should also be built with
- experimental Zend Thread Safety (ZTS). Under this configuration, not
- all extensions will be available. The recommended setup is to build
- Apache with the default prefork MPM-Module.
- __________________________________________________________________
- __________________________________________________________________
-
-Lighttpd 1.4 on Unix systems
-
- This section contains notes and hints specific to Lighttpd 1.4 installs
- of PHP on Unix systems.
-
- Please use the » Lighttpd trac to learn how to install Lighttpd
- properly before continuing.
-
- Fastcgi is the preferred SAPI to connect PHP and Lighttpd. Fastcgi is
- automagically enabled in php-cgi in PHP 5.3, but for older versions
- configure PHP with --enable-fastcgi. To confirm that PHP has fastcgi
- enabled, php -v should contain PHP 5.2.5 (cgi-fcgi) Before PHP 5.2.3,
- fastcgi was enabled on the php binary (there was no php-cgi).
-
-Letting Lighttpd spawn php processes
-
- To configure Lighttpd to connect to php and spawn fastcgi processes,
- edit lighttpd.conf. Sockets are preferred to connect to fastcgi
- processes on the local system.
-
- Example #1 Partial lighttpd.conf
-server.modules += ( "mod_fastcgi" )
-
-fastcgi.server = ( ".php" =>
- ((
- "socket" => "/tmp/php.socket",
- "bin-path" => "/usr/local/bin/php-cgi",
- "bin-environment" => (
- "PHP_FCGI_CHILDREN" => "16",
- "PHP_FCGI_MAX_REQUESTS" => "10000"
- ),
- "min-procs" => 1,
- "max-procs" => 1,
- "idle-timeout" => 20
- ))
-)
-
- The bin-path directive allows lighttpd to spawn fastcgi processes
- dynamically. PHP will spawn children according to the PHP_FCGI_CHILDREN
- environment variable. The "bin-environment" directive sets the
- environment for the spawned processes. PHP will kill a child process
- after the number of requests specified by PHP_FCGI_MAX_REQUESTS is
- reached. The directives "min-procs" and "max-procs" should generally be
- avoided with PHP. PHP manages its own children and opcode caches like
- APC will only share among children managed by PHP. If "min-procs" is
- set to something greater than 1, the total number of php responders
- will be multiplied PHP_FCGI_CHILDREN (2 min-procs * 16 children gives
- 32 responders).
-
-Spawning with spawn-fcgi
-
- Lighttpd provides a program called spawn-fcgi to ease the process of
- spawning fastcgi processes easier.
-
-Spawning php-cgi
-
- It is possible to spawn processes without spawn-fcgi, though a bit of
- heavy-lifting is required. Setting the PHP_FCGI_CHILDREN environment
- var controls how many children PHP will spawn to handle incoming
- requests. Setting PHP_FCGI_MAX_REQUESTS will determine how long (in
- requests) each child will live. Here's a simple bash script to help
- spawn php responders.
-
- Example #2 Spawning FastCGI Responders
-#!/bin/sh
-
-# Location of the php-cgi binary
-PHP=/usr/local/bin/php-cgi
-
-# PID File location
-PHP_PID=/tmp/php.pid
-
-# Binding to an address
-#FCGI_BIND_ADDRESS=10.0.1.1:10000
-# Binding to a domain socket
-FCGI_BIND_ADDRESS=/tmp/php.sock
-
-PHP_FCGI_CHILDREN=16
-PHP_FCGI_MAX_REQUESTS=10000
-
-env -i PHP_FCGI_CHILDREN=$PHP_FCGI_CHILDREN \
- PHP_FCGI_MAX_REQUESTS=$PHP_FCGI_MAX_REQUESTS \
- $PHP -b $FCGI_BIND_ADDRESS &
-
-echo $! > "$PHP_PID"
-
-
-Connecting to remote FCGI instances
-
- Fastcgi instances can be spawned on multiple remote machines in order
- to scale applications.
-
- Example #3 Connecting to remote php-fastcgi instances
-fastcgi.server = ( ".php" =>
- (( "host" => "10.0.0.2", "port" => 1030 ),
- ( "host" => "10.0.0.3", "port" => 1030 ))
-)
- __________________________________________________________________
- __________________________________________________________________
-
-Sun, iPlanet and Netscape servers on Sun Solaris
-
- This section contains notes and hints specific to Sun Java System Web
- Server, Sun ONE Web Server, iPlanet and Netscape server installs of PHP
- on Sun Solaris.
-
- From PHP 4.3.3 on you can use PHP scripts with the NSAPI module to
- generate custom directory listings and error pages. Additional
- functions for Apache compatibility are also available. For support in
- current web servers read the note about subrequests.
-
- You can find more information about setting up PHP for the Netscape
- Enterprise Server (NES) here:
- » http://benoit.noss.free.fr/php/install-php4.html
-
- To build PHP with Sun JSWS/Sun ONE WS/iPlanet/Netscape web servers,
- enter the proper install directory for the --with-nsapi=[DIR] option.
- The default directory is usually /opt/netscape/suitespot/. Please also
- read /php-xxx-version/sapi/nsapi/nsapi-readme.txt.
-
- 1. Install the following packages from » http://www.sunfreeware.com/
- or another download site:
- + autoconf-2.13
- + automake-1.4
- + bison-1_25-sol26-sparc-local
- + flex-2_5_4a-sol26-sparc-local
- + gcc-2_95_2-sol26-sparc-local
- + gzip-1.2.4-sol26-sparc-local
- + m4-1_4-sol26-sparc-local
- + make-3_76_1-sol26-sparc-local
- + mysql-3.23.24-beta (if you want mysql support)
- + perl-5_005_03-sol26-sparc-local
- + tar-1.13 (GNU tar)
- 2. Make sure your path includes the proper directories
- PATH=.:/usr/local/bin:/usr/sbin:/usr/bin:/usr/ccs/bin and make it
- available to your system export PATH.
- 3. gunzip php-x.x.x.tar.gz (if you have a .gz dist, otherwise go to
- 4).
- 4. tar xvf php-x.x.x.tar
- 5. Change to your extracted PHP directory: cd ../php-x.x.x
- 6. For the following step, make sure /opt/netscape/suitespot/ is where
- your netscape server is installed. Otherwise, change to the correct
- path and run:
-./configure --with-mysql=/usr/local/mysql \
---with-nsapi=/opt/netscape/suitespot/ \
---enable-libgcc
- 7. Run make followed by make install.
-
- After performing the base install and reading the appropriate readme
- file, you may need to perform some additional configuration steps.
-
-Configuration Instructions for Sun/iPlanet/Netscape
-
- Firstly you may need to add some paths to the LD_LIBRARY_PATH
- environment for the server to find all the shared libs. This can best
- done in the start script for your web server. The start script is often
- located in: /path/to/server/https-servername/start. You may also need
- to edit the configuration files that are located in:
- /path/to/server/https-servername/config/.
- 1. Add the following line to mime.types (you can do that by the
- administration server):
-type=magnus-internal/x-httpd-php exts=php
-
- 2. Edit magnus.conf (for servers >= 6) or obj.conf (for servers < 6)
- and add the following, shlib will vary depending on your system, it
- will be something like /opt/netscape/suitespot/bin/libphp4.so. You
- should place the following lines after mime types init.
-Init fn="load-modules" funcs="php4_init,php4_execute,php4_auth_trans" shlib="/op
-t/netscape/suitespot/bin/libphp4.so"
-Init fn="php4_init" LateInit="yes" errorString="Failed to initialize PHP!" [php_
-ini="/path/to/php.ini"]
-
- (PHP >= 4.3.3) The php_ini parameter is optional but with it you
- can place your php.ini in your web server config directory.
- 3. Configure the default object in obj.conf (for virtual server
- classes [version 6.0+] in their vserver.obj.conf):
-<Object name="default">
-.
-.
-.
-.#NOTE this next line should happen after all 'ObjectType' and before all 'AddLo
-g' lines
-Service fn="php4_execute" type="magnus-internal/x-httpd-php" [inikey=value inike
-y=value ...]
-.
-.
-</Object>
-
- (PHP >= 4.3.3) As additional parameters you can add some special
- php.ini-values, for example you can set a
- docroot="/path/to/docroot" specific to the context php4_execute is
- called. For boolean ini-keys please use 0/1 as value, not
- "On","Off",... (this will not work correctly), e.g.
- zlib.output_compression=1 instead of zlib.output_compression="On"
- 4. This is only needed if you want to configure a directory that only
- consists of PHP scripts (same like a cgi-bin directory):
-<Object name="x-httpd-php">
-ObjectType fn="force-type" type="magnus-internal/x-httpd-php"
-Service fn=php4_execute [inikey=value inikey=value ...]
-</Object>
-
- After that you can configure a directory in the Administration
- server and assign it the style x-httpd-php. All files in it will
- get executed as PHP. This is nice to hide PHP usage by renaming
- files to .html.
- 5. Setup of authentication: PHP authentication cannot be used with any
- other authentication. ALL AUTHENTICATION IS PASSED TO YOUR PHP
- SCRIPT. To configure PHP Authentication for the entire server, add
- the following line to your default object:
-<Object name="default">
-AuthTrans fn=php4_auth_trans
-.
-.
-.
-</Object>
-
- 6. To use PHP Authentication on a single directory, add the following:
-<Object ppath="d:\path\to\authenticated\dir\*">
-AuthTrans fn=php4_auth_trans
-</Object>
-
- Note:
-
- The stacksize that PHP uses depends on the configuration of the web
- server. If you get crashes with very large PHP scripts, it is
- recommended to raise it with the Admin Server (in the section
- "MAGNUS EDITOR").
-
-CGI environment and recommended modifications in php.ini
-
- Important when writing PHP scripts is the fact that Sun JSWS/Sun ONE
- WS/iPlanet/Netscape is a multithreaded web server. Because of that all
- requests are running in the same process space (the space of the web
- server itself) and this space has only one environment. If you want to
- get CGI variables like PATH_INFO, HTTP_HOST etc. it is not the correct
- way to try this in the old PHP way with getenv() or a similar way
- (register globals to environment, $_ENV). You would only get the
- environment of the running web server without any valid CGI variables!
-
- Note:
-
- Why are there (invalid) CGI variables in the environment?
-
- Answer: This is because you started the web server process from the
- admin server which runs the startup script of the web server, you
- wanted to start, as a CGI script (a CGI script inside of the admin
- server!). This is why the environment of the started web server has
- some CGI environment variables in it. You can test this by starting
- the web server not from the administration server. Use the command
- line as root user and start it manually - you will see there are no
- CGI-like environment variables.
-
- Simply change your scripts to get CGI variables in the correct way for
- PHP 4.x by using the superglobal $_SERVER. If you have older scripts
- which use $HTTP_HOST, etc., you should turn on register_globals in
- php.ini and change the variable order too (important: remove "E" from
- it, because you do not need the environment here):
-variables_order = "GPCS"
-register_globals = On
-
-Special use for error pages or self-made directory listings (PHP >= 4.3.3)
-
- You can use PHP to generate the error pages for "404 Not Found" or
- similar. Add the following line to the object in obj.conf for every
- error page you want to overwrite:
-Error fn="php4_execute" code=XXX script="/path/to/script.php" [inikey=value inik
-ey=value...]
-
- where XXX is the HTTP error code. Please delete any other Error
- directives which could interfere with yours. If you want to place a
- page for all errors that could exist, leave the code parameter out.
- Your script can get the HTTP status code with $_SERVER['ERROR_TYPE'].
-
- Another possibility is to generate self-made directory listings. Just
- create a PHP script which displays a directory listing and replace the
- corresponding default Service line for type="magnus-internal/directory"
- in obj.conf with the following:
-Service fn="php4_execute" type="magnus-internal/directory" script="/path/to/scri
-pt.php" [inikey=value inikey=value...]
-
- For both error and directory listing pages the original URI and
- translated URI are in the variables $_SERVER['PATH_INFO'] and
- $_SERVER['PATH_TRANSLATED'].
-
-Note about nsapi_virtual() and subrequests (PHP >= 4.3.3)
-
- The NSAPI module now supports the nsapi_virtual() function (alias:
- virtual()) to make subrequests on the web server and insert the result
- in the web page. This function uses some undocumented features from the
- NSAPI library. On Unix the module automatically looks for the needed
- functions and uses them if available. If not, nsapi_virtual() is
- disabled.
-
- Note:
-
- But be warned: Support for nsapi_virtual() is EXPERIMENTAL!!!
- __________________________________________________________________
- __________________________________________________________________
-
-CGI and command line setups
-
- By default, PHP is built as both a CLI and CGI program, which can be
- used for CGI processing. If you are running a web server that PHP has
- module support for, you should generally go for that solution for
- performance reasons. However, the CGI version enables users to run
- different PHP-enabled pages under different user-ids.
- Warning
-
- A server deployed in CGI mode is open to several possible
- vulnerabilities. Please read our CGI security section to learn how to
- defend yourself from such attacks.
-
-Testing
-
- If you have built PHP as a CGI program, you may test your build by
- typing make test. It is always a good idea to test your build. This way
- you may catch a problem with PHP on your platform early instead of
- having to struggle with it later.
-
-Using Variables
-
- Some server supplied environment variables are not defined in the
- current » CGI/1.1 specification. Only the following variables are
- defined there: AUTH_TYPE, CONTENT_LENGTH, CONTENT_TYPE,
- GATEWAY_INTERFACE, PATH_INFO, PATH_TRANSLATED, QUERY_STRING,
- REMOTE_ADDR, REMOTE_HOST, REMOTE_IDENT, REMOTE_USER, REQUEST_METHOD,
- SCRIPT_NAME, SERVER_NAME, SERVER_PORT, SERVER_PROTOCOL, and
- SERVER_SOFTWARE. Everything else should be treated as 'vendor
- extensions'.
- __________________________________________________________________
- __________________________________________________________________
-
-HP-UX specific installation notes
-
- This section contains notes and hints specific to installing PHP on
- HP-UX systems.
-
- There are two main options for installing PHP on HP-UX systems. Either
- compile it, or install a pre-compiled binary.
-
- Official pre-compiled packages are located here:
- » http://software.hp.com/
-
- Until this manual section is rewritten, the documentation about
- compiling PHP (and related extensions) on HP-UX systems has been
- removed. For now, consider reading the following external resource:
- » Building Apache and PHP on HP-UX 11.11
- __________________________________________________________________
- __________________________________________________________________
-
-OpenBSD installation notes
-
- This section contains notes and hints specific to installing PHP on
- » OpenBSD 3.6.
-
-Using Binary Packages
-
- Using binary packages to install PHP on OpenBSD is the recommended and
- simplest method. The core package has been separated from the various
- modules, and each can be installed and removed independently from the
- others. The files you need can be found on your OpenBSD CD or on the
- FTP site.
-
- The main package you need to install is php4-core-4.3.8.tgz, which
- contains the basic engine (plus gettext and iconv). Next, take a look
- at the module packages, such as php4-mysql-4.3.8.tgz or
- php4-imap-4.3.8.tgz. You need to use the phpxs command to activate and
- deactivate these modules in your php.ini.
-
- Example #1 OpenBSD Package Install Example
-# pkg_add php4-core-4.3.8.tgz
-# /usr/local/sbin/phpxs -s
-# cp /usr/local/share/doc/php4/php.ini-recommended /var/www/conf/php.ini
- (add in mysql)
-# pkg_add php4-mysql-4.3.8.tgz
-# /usr/local/sbin/phpxs -a mysql
- (add in imap)
-# pkg_add php4-imap-4.3.8.tgz
-# /usr/local/sbin/phpxs -a imap
- (remove mysql as a test)
-# pkg_delete php4-mysql-4.3.8
-# /usr/local/sbin/phpxs -r mysql
- (install the PEAR libraries)
-# pkg_add php4-pear-4.3.8.tgz
-
- Read the » packages(7) manual page for more information about binary
- packages on OpenBSD.
-
-Using Ports
-
- You can also compile up PHP from source using the » ports tree.
- However, this is only recommended for users familiar with OpenBSD. The
- PHP 4 port is split into two sub-directories: core and extensions. The
- extensions directory generates sub-packages for all of the supported
- PHP modules. If you find you do not want to create some of these
- modules, use the no_* FLAVOR. For example, to skip building the imap
- module, set the FLAVOR to no_imap.
-
-Common Problems
-
- * The default install of Apache runs inside a » chroot(2) jail, which
- will restrict PHP scripts to accessing files under /var/www. You
- will therefore need to create a /var/www/tmp directory for PHP
- session files to be stored, or use an alternative session backend.
- In addition, database sockets need to be placed inside the jail or
- listen on the localhost interface. If you use network functions,
- some files from /etc such as /etc/resolv.conf and /etc/services
- will need to be moved into /var/www/etc. The OpenBSD PEAR package
- automatically installs into the correct chroot directories, so no
- special modification is needed there. More information on the
- OpenBSD Apache is available in the » OpenBSD FAQ.
- * The OpenBSD 3.6 package for the » gd extension requires XFree86 to
- be installed. If you do not wish to use some of the font features
- that require X11, install the php4-gd-4.3.8-no_x11.tgz package
- instead.
-
-Older Releases
-
- Older releases of OpenBSD used the FLAVORS system to compile up a
- statically linked PHP. Since it is hard to generate binary packages
- using this method, it is now deprecated. You can still use the old
- stable ports trees if you wish, but they are unsupported by the OpenBSD
- team. If you have any comments about this, the current maintainer for
- the port is Anil Madhavapeddy (avsm at openbsd dot org).
- __________________________________________________________________
- __________________________________________________________________
-
-Solaris specific installation tips
-
- This section contains notes and hints specific to installing PHP on
- Solaris systems.
-
-Required software
-
- Solaris installs often lack C compilers and their related tools. Read
- this FAQ for information on why using GNU versions for some of these
- tools is necessary.
-
- For unpacking the PHP distribution you need
- * tar
- * gzip or
- * bzip2
-
- For compiling PHP you need
- * gcc (recommended, other C compilers may work)
- * make
- * GNU sed
-
- For building extra extensions or hacking the code of PHP you might also
- need
- * flex (up to PHP 5.2)
- * re2c
- * bison
- * m4
- * autoconf
- * automake
-
- In addition, you will need to install (and possibly compile) any
- additional software specific to your configuration, such as Oracle or
- MySQL.
-
-Using Packages
-
- You can simplify the Solaris install process by using pkgadd to install
- most of your needed components. The Image Packaging System (IPS) for
- Solaris 11 Express also contains most of the required components for
- installation using the pkg command.
- __________________________________________________________________
- __________________________________________________________________
-
-Debian GNU/Linux installation notes
-
- This section contains notes and hints specific to installing PHP on
- » Debian GNU/Linux.
- Warning
-
- Unofficial builds from third-parties are not supported here. Any bugs
- should be reported to the Debian team unless they can be reproduced
- using the latest builds from our » download area.
-
- While the instructions for building PHP on Unix apply to Debian as
- well, this manual page contains specific information for other options,
- such as using either the apt-get or aptitude commands. This manual page
- uses these two commands interchangeably.
-
-Using APT
-
- First, note that other related packages may be desired like
- libapache2-mod-php7 to integrate with Apache 2, and php-pear for PEAR.
-
- Second, before installing a package, it's wise to ensure the package
- list is up to date. Typically, this is done by running the command
- apt-get update.
-
- Example #1 Debian Install Example with Apache 2
-# apt-get install php7-common libapache2-mod-php7 php7-cli
-
- APT will automatically install the PHP 7 module for Apache 2 and all of
- its dependencies, and then activate it. Apache should be restarted in
- order for the changes take place. For example:
-
- Example #2 Stopping and starting Apache once PHP is installed
-# /etc/init.d/apache2 stop
-# /etc/init.d/apache2 start
-
-Better control of configuration
-
- In the last section, PHP was installed with only core modules. It's
- very likely that additional modules will be desired, such as MySQL,
- cURL, GD, etc. These may also be installed via the apt-get command.
-
- Example #3 Methods for listing additional PHP 7 packages
-# apt-cache search php7
-# aptitude search php7
-# aptitude search php7 |grep -i mysql
-
- The examples will show a lot of packages including several PHP specific
- ones like php7-cgi, php7-cli and php7-dev. Determine which are needed
- and install them like any other with either apt-get or aptitude. And
- because Debian performs dependency checks, it'll prompt for those so
- for example to install MySQL and cURL:
-
- Example #4 Install PHP with MySQL, cURL
-# apt-get install php7-mysql php7-curl
-
- APT will automatically add the appropriate lines to the different
- php.ini related files like /etc/php7/apache2/php.ini,
- /etc/php7/conf.d/pdo.ini, etc. and depending on the extension will add
- entries similar to extension=foo.so. However, restarting the web server
- (like Apache) is required before these changes take affect.
-
-Common Problems
-
- * If the PHP scripts are not parsing via the web server, then it's
- likely that PHP was not added to the web server's configuration
- file, which on Debian may be /etc/apache2/apache2.conf or similar.
- See the Debian manual for further details.
- * If an extension was seemingly installed yet the functions are
- undefined, be sure that the appropriate ini file is being loaded
- and/or the web server was restarted after installation.
- * There are two basic commands for installing packages on Debian (and
- other linux variants): apt-get and aptitude. However, explaining
- the subtle differences between these commands goes beyond the scope
- of this manual.
- __________________________________________________________________
- __________________________________________________________________
- __________________________________________________________________
-
-Installation on Mac OS X
-
-Table of Contents
-
- * Using Packages
- * Using the bundled PHP
- * Compiling PHP on Mac OS X
-
- This section contains notes and hints specific to installing PHP on Mac
- OS X. PHP is bundled with Macs, and compiling is similar to the Unix
- installation guide.
- __________________________________________________________________
-
-Using Packages
-
- There are a few pre-packaged and pre-compiled versions of PHP for Mac
- OS X. This can help in setting up a standard configuration, but if you
- need to have a different set of features (such as a secure server, or a
- different database driver), you may need to build PHP and/or your web
- server yourself. If you are unfamiliar with building and compiling your
- own software, it's worth checking whether somebody has already built a
- packaged version of PHP with the features you need.
-
- The following resources offer easy to install packages and precompiled
- binaries for PHP on Mac OS:
-
- * MacPorts: » http://www.macports.org/
- * Entropy: » http://www.entropy.ch/software/macosx/php/
- * Fink: » http://www.finkproject.org/
- * Homebrew: » http://github.com/mxcl/homebrew
- __________________________________________________________________
- __________________________________________________________________
-
-Using the bundled PHP
-
- PHP has come standard with Macs since OS X version 10.0.0. Enabling PHP
- with the default web server requires uncommenting a few lines in the
- Apache configuration file httpd.conf whereas the CGI and/or CLI are
- enabled by default (easily accessible via the Terminal program).
-
- Enabling PHP using the instructions below is meant for quickly setting
- up a local development environment. It's highly recommended to always
- upgrade PHP to the newest version. Like most live software, newer
- versions are created to fix bugs and add features and PHP being is no
- different. See the appropriate MAC OS X installation documentation for
- further details. The following instructions are geared towards a
- beginner with details provided for getting a default setup to work. All
- users are encouraged to compile, or install a new packaged version.
-
- The standard installation type is using mod_php, and enabling the
- bundled mod_php on Mac OS X for the Apache web server (the default web
- server, that is accessible via System Preferences) involves the
- following steps:
-
- 1. Locate and open the Apache configuration file. By default, the
- location is as follows: /private/etc/apache2/httpd.conf Using
- Finder or Spotlight to find this file may prove difficult as by
- default it's private and owned by the root user.
-
- Note: One way to open this is by using a Unix based text editor in
- the Terminal, for example nano, and because the file is owned by
- root we'll use the sudo command to open it (as root) so for example
- type the following into the Terminal Application (after, it will
- prompt for a password): sudo nano /private/etc/apache2/httpd.conf
- Noteworthy nano commands: ^w (search), ^o (save), and ^x (exit)
- where ^ represents the Ctrl key.
-
- Note: Versions of Mac OS X prior to 10.5 were bundled with older
- versions of PHP and Apache. As such, the Apache configuration file
- on legacy machines may be /etc/httpd/httpd.conf.
- 2. With a text editor, uncomment the lines (by removing the #) that
- look similar to the following (these two lines are often not
- together, locate them both in the file):
-# LoadModule php7_module libexec/httpd/libphp7.so
-
-# AddModule mod_php7.c
-
- Notice the location/path. When building PHP in the future, the
- above files should be replaced or commented out.
- 3. Be sure the desired extensions will parse as PHP (examples: .php
- .html and .inc)
- Due to the following statement already existing in httpd.conf (as
- of Mac Panther), once PHP is enabled the .php files will
- automatically parse as PHP.
-<IfModule mod_php7.c>
- # If php is turned on, we respect .php and .phps files.
- AddType application/x-httpd-php .php
- AddType application/x-httpd-php-source .phps
-
- # Since most users will want index.php to work we
- # also automatically enable index.php
- <IfModule mod_dir.c>
- DirectoryIndex index.html index.php
- </IfModule>
-</IfModule>
-
- Note:
- Before OS X 10.5 (Leopard), PHP 4 was bundled instead of PHP 5 in
- which case the above instructions will differ slightly by changing
- 5's to 4's.
- 4. Be sure the DirectoryIndex loads the desired default index file
- This is also set in httpd.conf. Typically index.php and index.html
- are used. By default index.php is enabled because it's also in the
- PHP check shown above. Adjust accordingly.
- 5. Set the php.ini location or use the default A typical default
- location on Mac OS X is /usr/local/php/php.ini and a call to
- phpinfo() will reveal this information. If a php.ini is not used,
- PHP will use all default values. See also the related FAQ on
- finding php.ini.
- 6. Locate or set the DocumentRoot This is the root directory for all
- the web files. Files in this directory are served from the web
- server so the PHP files will parse as PHP before outputting them to
- the browser. A typical default path is /Library/WebServer/Documents
- but this can be set to anything in httpd.conf. Alternatively, the
- default DocumentRoot for individual users is
- /Users/yourusername/Sites
- 7. Create a phpinfo() file
- The phpinfo() function will display information about PHP. Consider
- creating a file in the DocumentRoot with the following PHP code:
- <?php phpinfo(); ?>
- 8. Restart Apache, and load the PHP file created above To restart,
- either execute sudo apachectl graceful in the shell or stop/start
- the "Personal Web Server" option in the OS X System Preferences. By
- default, loading local files in the browser will have an URL like
- so: http://localhost/info.php Or using the DocumentRoot in the user
- directory is another option and would end up looking like:
- http://localhost/~yourusername/info.php
-
- The CLI (or CGI in older versions) is appropriately named php and
- likely exists as /usr/bin/php. Open up the terminal, read the command
- line section of the PHP manual, and execute php -v to check the PHP
- version of this PHP binary. A call to phpinfo() will also reveal this
- information.
- __________________________________________________________________
- __________________________________________________________________
-
-Compiling PHP on Mac OS X
-
- Use the Unix installation guide to compile PHP on Mac OS X.
- __________________________________________________________________
- __________________________________________________________________
- __________________________________________________________________
-
-Installation of PECL extensions
-
-Table of Contents
-
- * Introduction to PECL Installations
- * Downloading PECL extensions
- * Installing a PHP extension on Windows
- * Compiling shared PECL extensions with the pecl command
- * Compiling shared PECL extensions with phpize
- * php-config
- * Compiling PECL extensions statically into PHP
- __________________________________________________________________
-
-Introduction to PECL Installations
-
- » PECL is a repository of PHP extensions that are made available to you
- via the » PEAR packaging system. This section of the manual is intended
- to demonstrate how to obtain and install PECL extensions.
-
- These instructions assume /your/phpsrcdir/ is the path to the PHP
- source distribution, and that extname is the name of the PECL
- extension. Adjust accordingly. These instructions also assume a
- familiarity with the » pear command. The information in the PEAR manual
- for the pear command also applies to the pecl command.
-
- To be useful, a shared extension must be built, installed, and loaded.
- The methods described below provide you with various instructions on
- how to build and install the extensions, but they do not automatically
- load them. Extensions can be loaded by adding an extension directive.
- To this php.ini file, or through the use of the dl() function.
-
- When building PHP modules, it's important to have known-good versions
- of the required tools (autoconf, automake, libtool, etc.) See the
- » Anonymous Git Instructions for details on the required tools, and
- required versions.
- __________________________________________________________________
- __________________________________________________________________
-
-Downloading PECL extensions
-
- There are several options for downloading PECL extensions, such as:
- * The pecl install extname command downloads the extensions code
- automatically, so in this case there is no need for a separate
- download.
- * » http://pecl.php.net/ The PECL web site contains information about
- the different extensions that are offered by the PHP Development
- Team. The information available here includes: ChangeLog, release
- notes, requirements and other similar details.
- * pecl download extname PECL extensions that have releases listed on
- the PECL web site are available for download and installation using
- the » pecl command. Specific revisions may also be specified.
- * SVN Most PECL extensions also reside in SVN. A web-based view may
- be seen at » http://svn.php.net/viewvc/pecl/. To download straight
- from SVN, the following sequence of commands may be used:
- $ svn checkout http://svn.php.net/repository/pecl/extname/trunk
- extname
- * Windows downloads At this time the PHP project does not compile
- Windows binaries for PECL extensions. However, to compile PHP under
- Windows see the chapter titled building PHP for Windows.
- __________________________________________________________________
- __________________________________________________________________
-
-Installing a PHP extension on Windows
-
- On Windows, you have two ways to load a PHP extension: either compile
- it into PHP, or load the DLL. Loading a pre-compiled extension is the
- easiest and preferred way.
-
- To load an extension, you need to have it available as a ".dll" file on
- your system. All the extensions are automatically and periodically
- compiled by the PHP Group (see next section for the download).
-
- To compile an extension into PHP, please refer to building from source
- documentation.
-
- To compile a standalone extension (aka a DLL file), please refer to
- building from source documentation. If the DLL file is available
- neither with your PHP distribution nor in PECL, you may have to compile
- it before you can start using the extension.
-
-Where to find an extension?
-
- PHP extensions are usually called "php_*.dll" (where the star
- represents the name of the extension) and they are located under the
- "PHP\ext" ("PHP\extensions" in PHP 4) folder.
-
- PHP ships with the extensions most useful to the majority of
- developers. They are called "core" extensions.
-
- However, if you need functionality not provided by any core extension,
- you may still be able to find one in PECL. The PHP Extension Community
- Library (PECL) is a repository for PHP Extensions, providing a
- directory of all known extensions and hosting facilities for
- downloading and development of PHP extensions.
-
- If you have developed an extension for your own uses, you might want to
- think about hosting it on PECL so that others with the same needs can
- benefit from your time. A nice side effect is that you give them a good
- chance to give you feedback, (hopefully) thanks, bug reports and even
- fixes/patches. Before you submit your extension for hosting on PECL,
- please read http://pecl.php.net/package-new.php.
-
-Which extension to download?
-
- Many times, you will find several versions of each DLL:
- * Different version numbers (at least the first two numbers should
- match)
- * Different thread safety settings
- * Different processor architecture (x86, x64, ...)
- * Different debugging settings
- * etc.
-
- You should keep in mind that your extension settings should match all
- the settings of the PHP executable you are using. The following PHP
- script will tell you all about your PHP settings:
-
- Example #1 phpinfo() call
- <?php
- phpinfo();
- ?>
-
- Or from the command line, run:
-drive:\\path\to\php\executable\php.exe -i
-
-Loading an extension
-
- The most common way to load a PHP extension is to include it in your
- php.ini configuration file. Please note that many extensions are
- already present in your php.ini and that you only need to remove the
- semicolon to activate them.
-;extension=php_extname.dll
-
-extension=php_extname.dll
-
- However, some web servers are confusing because they do not use the
- php.ini located alongside your PHP executable. To find out where your
- actual php.ini resides, look for its path in phpinfo():
-Configuration File (php.ini) Path C:\WINDOWS
-
-Loaded Configuration File C:\Program Files\PHP\5.2\php.ini
-
- After activating an extension, save php.ini, restart the web server and
- check phpinfo() again. The new extension should now have its own
- section.
-
-Resolving problems
-
- If the extension does not appear in phpinfo(), you should check your
- logs to learn where the problem comes from.
-
- If you are using PHP from the command line (CLI), the extension loading
- error can be read directly on screen.
-
- If you are using PHP with a web server, the location and format of the
- logs vary depending on your software. Please read your web server
- documentation to locate the logs, as it does not have anything to do
- with PHP itself.
-
- Common problems are the location of the DLL, the value of the "
- extension_dir" setting inside php.ini and compile-time setting
- mismatches.
-
- If the problem lies in a compile-time setting mismatch, you probably
- didn't download the right DLL. Try downloading again the extension with
- the right settings. Again, phpinfo() can be of great help.
- __________________________________________________________________
- __________________________________________________________________
-
-Compiling shared PECL extensions with the pecl command
-
- PECL makes it easy to create shared PHP extensions. Using the » pecl
- command, do the following:
-
- $ pecl install extname
-
- This will download the source for extname, compile, and install
- extname.so into your extension_dir. extname.so may then be loaded via
- php.ini
-
- By default, the pecl command will not install packages that are marked
- with the alpha or beta state. If no stable packages are available, you
- may install a beta package using the following command:
-
- $ pecl install extname-beta
-
- You may also install a specific version using this variant:
-
- $ pecl install extname-0.1
-
- Note:
-
- After enabling the extension in php.ini, restarting the web service
- is required for the changes to be picked up.
- __________________________________________________________________
- __________________________________________________________________
-
-Compiling shared PECL extensions with phpize
-
- Sometimes, using the pecl installer is not an option. This could be
- because you're behind a firewall, or it could be because the extension
- you want to install is not available as a PECL compatible package, such
- as unreleased extensions from SVN. If you need to build such an
- extension, you can use the lower-level build tools to perform the build
- manually.
-
- The phpize command is used to prepare the build environment for a PHP
- extension. In the following sample, the sources for an extension are in
- a directory named extname:
-
-$ cd extname
-$ phpize
-$ ./configure
-$ make
-# make install
-
- A successful install will have created extname.so and put it into the
- PHP extensions directory. You'll need to and adjust php.ini and add an
- extension=extname.so line before you can use the extension.
-
- If the system is missing the phpize command, and precompiled packages
- (like RPM's) are used, be sure to also install the appropriate devel
- version of the PHP package as they often include the phpize command
- along with the appropriate header files to build PHP and its
- extensions.
-
- Execute phpize --help to display additional usage information.
- __________________________________________________________________
- __________________________________________________________________
-
-php-config
-
- php-config is a simple shell script for obtaining information about the
- installed PHP configuration.
-
- When compiling extensions, if you have multiple PHP versions installed,
- you may specify for which installation you'd like to build by using the
- --with-php-config option during configuration, specifying the path of
- the respective php-config script.
-
- The list of command line options provided by the php-config script can
- be queried anytime by running php-config with the -h switch:
-Usage: /usr/local/bin/php-config [OPTION]
-Options:
- --prefix [...]
- --includes [...]
- --ldflags [...]
- --libs [...]
- --extension-dir [...]
- --include-dir [...]
- --php-binary [...]
- --php-sapis [...]
- --configure-options [...]
- --version [...]
- --vernum [...]
-
- CAPTION: Command line options
-
- Option Description
- --prefix Directory prefix where PHP is installed, e.g. /usr/local
- --includes List of -I options with all include files
- --ldflags LD Flags which PHP was compiled with
- --libs Extra libraries which PHP was compiled with
- --extension-dir Directory where extensions are searched by default
- --include-dir Directory prefix where header files are installed by
- default
- --php-binary Full path to php CLI or CGI binary
- --php-sapis Show all SAPI modules available
- --configure-options Configure options to recreate configuration of
- current PHP installation
- --version PHP version
- --vernum PHP version as integer
- __________________________________________________________________
- __________________________________________________________________
-
-Compiling PECL extensions statically into PHP
-
- You might find that you need to build a PECL extension statically into
- your PHP binary. To do this, you'll need to place the extension source
- under the php-src/ext/ directory and tell the PHP build system to
- regenerate its configure script.
-
-$ cd /your/phpsrcdir/ext
-$ pecl download extname
-$ gzip -d < extname.tgz | tar -xvf -
-$ mv extname-x.x.x extname
-
- This will result in the following directory:
-
- /your/phpsrcdir/ext/extname
-
- From here, force PHP to rebuild the configure script, and then build
- PHP as normal:
-
- $ cd /your/phpsrcdir
- $ rm configure
- $ ./buildconf --force
- $ ./configure --help
- $ ./configure --with-extname --enable-someotherext --with-foobar
- $ make
- $ make install
-
- Note: To run the 'buildconf' script you need autoconf 2.13 and
- automake 1.4+ (newer versions of autoconf may work, but are not
- supported).
-
- Whether --enable-extname or --with-extname is used depends on the
- extension. Typically an extension that does not require external
- libraries uses --enable. To be sure, run the following after buildconf:
-
- $ ./configure --help | grep extname
- __________________________________________________________________
- __________________________________________________________________
- __________________________________________________________________
-
-Problems?
-
-Table of Contents
-
- * Read the FAQ
- * Other problems
- * Bug reports
- __________________________________________________________________
-
-Read the FAQ
-
- Some problems are more common than others. The most common ones are
- listed in the PHP FAQ, part of this manual.
- __________________________________________________________________
- __________________________________________________________________
-
-Other problems
-
- If you are still stuck, someone on the PHP installation mailing list
- may be able to help you. You should check out the archive first, in
- case someone already answered someone else who had the same problem as
- you. The archives are available from the support page on
- » http://www.php.net/support.php. To subscribe to the PHP installation
- mailing list, send an empty mail to
- » php-install-subscribe@lists.php.net. The mailing list address is
- » php-install@lists.php.net.
-
- If you want to get help on the mailing list, please try to be precise
- and give the necessary details about your environment (which operating
- system, what PHP version, what web server, if you are running PHP as
- CGI or a server module, safe mode, etc.), and preferably enough code to
- make others able to reproduce and test your problem.
- __________________________________________________________________
- __________________________________________________________________
-
-Bug reports
-
- If you think you have found a bug in PHP, please report it. The PHP
- developers probably don't know about it, and unless you report it,
- chances are it won't be fixed. You can report bugs using the
- bug-tracking system at » http://bugs.php.net/. Please do not send bug
- reports in mailing list or personal letters. The bug system is also
- suitable to submit feature requests.
-
- Read the » How to report a bug document before submitting any bug
- reports!
- __________________________________________________________________
- __________________________________________________________________
- __________________________________________________________________
-
-Runtime Configuration
-
-Table of Contents
-
- * The configuration file
- * .user.ini files
- * Where a configuration setting may be set
- * How to change configuration settings
- __________________________________________________________________
-
-The configuration file
-
- The configuration file (php.ini) is read when PHP starts up. For the
- server module versions of PHP, this happens only once when the web
- server is started. For the CGI and CLI versions, it happens on every
- invocation.
-
- php.ini is searched for in these locations (in order):
- * SAPI module specific location (PHPIniDir directive in Apache 2, -c
- command line option in CGI and CLI, php_ini parameter in NSAPI,
- PHP_INI_PATH environment variable in THTTPD)
- * The PHPRC environment variable. Before PHP 5.2.0, this was checked
- after the registry key mentioned below.
- * As of PHP 5.2.0, the location of the php.ini file can be set for
- different versions of PHP. The following registry keys are examined
- in order: [HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x.y.z],
- [HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x.y] and
- [HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x], where x, y and z mean the PHP
- major, minor and release versions. If there is a value for
- IniFilePath in any of these keys, the first one found will be used
- as the location of the php.ini (Windows only).
- * [HKEY_LOCAL_MACHINE\SOFTWARE\PHP], value of IniFilePath (Windows
- only).
- * Current working directory (except CLI).
- * The web server's directory (for SAPI modules), or directory of PHP
- (otherwise in Windows).
- * Windows directory (C:\windows or C:\winnt) (for Windows), or
- --with-config-file-path compile time option.
-
- If php-SAPI.ini exists (where SAPI is the SAPI in use, so, for example,
- php-cli.ini or php-apache.ini), it is used instead of php.ini. The SAPI
- name can be determined with php_sapi_name().
-
- Note:
-
- The Apache web server changes the directory to root at startup,
- causing PHP to attempt to read php.ini from the root filesystem if
- it exists.
-
- The php.ini directives handled by extensions are documented on the
- respective pages of the extensions themselves. A list of the core
- directives is available in the appendix. Not all PHP directives are
- necessarily documented in this manual: for a complete list of
- directives available in your PHP version, please read your well
- commented php.ini file. Alternatively, you may find » the latest
- php.ini from Git helpful too.
-
- Example #1 php.ini example
-; any text on a line after an unquoted semicolon (;) is ignored
-[php] ; section markers (text within square brackets) are also ignored
-; Boolean values can be set to either:
-; true, on, yes
-; or false, off, no, none
-register_globals = off
-track_errors = yes
-
-; you can enclose strings in double-quotes
-include_path = ".:/usr/local/lib/php"
-
-; backslashes are treated the same as any other character
-include_path = ".;c:\php\lib"
-
- Since PHP 5.1.0, it is possible to refer to existing .ini variables
- from within .ini files. Example: open_basedir = ${open_basedir}
- ":/new/dir".
- __________________________________________________________________
- __________________________________________________________________
-
-.user.ini files
-
- Since PHP 5.3.0, PHP includes support for .htaccess-style INI files on
- a per-directory basis. These files are processed only by the
- CGI/FastCGI SAPI. This functionality obsoletes the PECL htscanner
- extension. If you are using Apache, use .htaccess files for the same
- effect.
-
- In addition to the main php.ini file, PHP scans for INI files in each
- directory, starting with the directory of the requested PHP file, and
- working its way up to the current document root (as set in
- $_SERVER['DOCUMENT_ROOT']). In case the PHP file is outside the
- document root, only its directory is scanned.
-
- Only INI settings with the modes PHP_INI_PERDIR and PHP_INI_USER will
- be recognized in .user.ini-style INI files.
-
- Two new INI directives, user_ini.filename and user_ini.cache_ttl
- control the use of user INI files.
-
- user_ini.filename sets the name of the file PHP looks for in each
- directory; if set to an empty string, PHP doesn't scan at all. The
- default is .user.ini.
-
- user_ini.cache_ttl controls how often user INI files are re-read. The
- default is 300 seconds (5 minutes).
- __________________________________________________________________
- __________________________________________________________________
-
-Where a configuration setting may be set
-
- These modes determine when and where a PHP directive may or may not be
- set, and each directive within the manual refers to one of these modes.
- For example, some settings may be set within a PHP script using
- ini_set(), whereas others may require php.ini or httpd.conf.
-
- For example, the output_buffering setting is PHP_INI_PERDIR therefore
- it may not be set using ini_set(). However, the display_errors
- directive is PHP_INI_ALL therefore it may be set anywhere, including
- with ini_set().
-
- CAPTION: Definition of PHP_INI_* modes
-
- Mode Meaning
- PHP_INI_USER Entry can be set in user scripts (like with ini_set()) or
- in the Windows registry. Since PHP 5.3, entry can be set in .user.ini
- PHP_INI_PERDIR Entry can be set in php.ini, .htaccess, httpd.conf or
- .user.ini (since PHP 5.3)
- PHP_INI_SYSTEM Entry can be set in php.ini or httpd.conf
- PHP_INI_ALL Entry can be set anywhere
- __________________________________________________________________
- __________________________________________________________________
-
-How to change configuration settings
-
-Running PHP as an Apache module
-
- When using PHP as an Apache module, you can also change the
- configuration settings using directives in Apache configuration files
- (e.g. httpd.conf) and .htaccess files. You will need "AllowOverride
- Options" or "AllowOverride All" privileges to do so.
-
- There are several Apache directives that allow you to change the PHP
- configuration from within the Apache configuration files. For a listing
- of which directives are PHP_INI_ALL, PHP_INI_PERDIR, or PHP_INI_SYSTEM,
- have a look at the List of php.ini directives appendix.
-
- php_value name value
- Sets the value of the specified directive. Can be used only with
- PHP_INI_ALL and PHP_INI_PERDIR type directives. To clear a
- previously set value use none as the value.
-
- Note: Don't use php_value to set boolean values. php_flag (see
- below) should be used instead.
-
- php_flag name on|off
- Used to set a boolean configuration directive. Can be used only
- with PHP_INI_ALL and PHP_INI_PERDIR type directives.
-
- php_admin_value name value
- Sets the value of the specified directive. This can not be used
- in .htaccess files. Any directive type set with php_admin_value
- can not be overridden by .htaccess or ini_set(). To clear a
- previously set value use none as the value.
-
- php_admin_flag name on|off
- Used to set a boolean configuration directive. This can not be
- used in .htaccess files. Any directive type set with
- php_admin_flag can not be overridden by .htaccess or ini_set().
-
- Example #1 Apache configuration example
-<IfModule mod_php7.c>
- php_value include_path ".:/usr/local/lib/php"
- php_admin_flag engine on
-</IfModule>
-<IfModule mod_php4.c>
- php_value include_path ".:/usr/local/lib/php"
- php_admin_flag engine on
-</IfModule>
-
- Caution
-
- PHP constants do not exist outside of PHP. For example, in httpd.conf
- you can not use PHP constants such as E_ALL or E_NOTICE to set the
- error_reporting directive as they will have no meaning and will
- evaluate to 0. Use the associated bitmask values instead. These
- constants can be used in php.ini
-
-Changing PHP configuration via the Windows registry
-
- When running PHP on Windows, the configuration values can be modified
- on a per-directory basis using the Windows registry. The configuration
- values are stored in the registry key HKLM\SOFTWARE\PHP\Per Directory
- Values, in the sub-keys corresponding to the path names. For example,
- configuration values for the directory c:\inetpub\wwwroot would be
- stored in the key HKLM\SOFTWARE\PHP\Per Directory
- Values\c\inetpub\wwwroot. The settings for the directory would be
- active for any script running from this directory or any subdirectory
- of it. The values under the key should have the name of the PHP
- configuration directive and the string value. PHP constants in the
- values are not parsed. However, only configuration values changeable in
- PHP_INI_USER can be set this way, PHP_INI_PERDIR values can not.
-
-Other interfaces to PHP
-
- Regardless of how you run PHP, you can change certain values at runtime
- of your scripts through ini_set(). See the documentation on the
- ini_set() page for more information.
-
- If you are interested in a complete list of configuration settings on
- your system with their current values, you can execute the phpinfo()
- function, and review the resulting page. You can also access the values
- of individual configuration directives at runtime using ini_get() or
- get_cfg_var().
- __________________________________________________________________
- __________________________________________________________________
- __________________________________________________________________
-
-Installation
-
- This section holds common questions about the way to install PHP. PHP
- is available for almost any OS (except maybe for MacOS before OSX), and
- almost any web server.
-
- To install PHP, follow the instructions in Installing PHP.
- 1. Why shouldn't I use Apache2 with a threaded MPM in a production
- environment?
- 2. Unix/Windows: Where should my php.ini file be located?
- 3. Unix: I installed PHP, but every time I load a document, I get the
- message 'Document Contains No Data'! What's going on here?
- 4. Unix: I installed PHP using RPMS, but Apache isn't processing the
- PHP pages! What's going on here?
- 5. Unix: I patched Apache with the FrontPage extensions patch, and
- suddenly PHP stopped working. Is PHP incompatible with the Apache
- FrontPage extensions?
- 6. Unix/Windows: I have installed PHP, but when I try to access a PHP
- script file via my browser, I get a blank screen.
- 7. Unix/Windows: I have installed PHP, but when try to access a PHP
- script file via my browser, I get a server 500 error.
- 8. Some operating systems: I have installed PHP without errors, but
- when I try to start Apache I get undefined symbol errors:
- [mybox:user /src/php7] root# apachectl configtest apachectl:
- /usr/local/apache/bin/httpd Undefined symbols: _compress
- _uncompress
- 9. Windows: I have installed PHP, but when I try to access a PHP
- script file via my browser, I get the error: cgi error: The
- specified CGI application misbehaved by not returning a complete
- set of HTTP headers. The headers it did return are:
- 10. Windows: I've followed all the instructions, but still can't get
- PHP and IIS to work together!
- 11. When running PHP as CGI with IIS, OmniHTTPD or Xitami, I get
- the following error: Security Alert! PHP CGI cannot be accessed
- directly..
- 12. How do I know if my php.ini is being found and read? It seems like
- it isn't as my changes aren't being implemented.
- 13. How do I add my PHP directory to the PATH on Windows?
- 14. How do I make the php.ini file available to PHP on windows?
- 15. Is it possible to use Apache content negotiation (MultiViews
- option) with PHP?
- 16. Is PHP limited to process GET and POST request methods only?
-
- Why shouldn't I use Apache2 with a threaded MPM in a production
- environment?
- PHP is glue. It is the glue used to build cool web applications
- by sticking dozens of 3rd-party libraries together and making it
- all appear as one coherent entity through an intuitive and easy
- to learn language interface. The flexibility and power of PHP
- relies on the stability and robustness of the underlying
- platform. It needs a working OS, a working web server and
- working 3rd-party libraries to glue together. When any of these
- stop working PHP needs ways to identify the problems and fix
- them quickly. When you make the underlying framework more
- complex by not having completely separate execution threads,
- completely separate memory segments and a strong sandbox for
- each request to play in, further weaknesses are introduced into
- PHP's system.
-
- If you want to use a threaded MPM, look at a FastCGI
- configuration where PHP is running in its own memory space.
-
- Unix/Windows: Where should my php.ini file be located?
- By default on Unix it should be in /usr/local/lib which is
- <install-path>/lib. Most people will want to change this at
- compile-time with the --with-config-file-path flag. You would,
- for example, set it with something like:
-
---with-config-file-path=/etc
-
- And then you would copy php.ini-development from the
- distribution to /etc/php.ini and edit it to make any local
- changes you want.
-
---with-config-file-scan-dir=PATH
-
- On Windows the default path for the php.ini file is the Windows
- directory. If you're using the Apache webserver, php.ini is
- first searched in the Apaches install directory, e.g. c:\program
- files\apache group\apache. This way you can have different
- php.ini files for different versions of Apache on the same
- machine.
-
- See also the chapter about the configuration file.
-
- Unix: I installed PHP, but every time I load a document, I get the
- message 'Document Contains No Data'! What's going on here?
- This probably means that PHP is having some sort of problem and
- is core-dumping. Look in your server error log to see if this is
- the case, and then try to reproduce the problem with a small
- test case. If you know how to use 'gdb', it is very helpful when
- you can provide a backtrace with your bug report to help the
- developers pinpoint the problem. If you are using PHP as an
- Apache module try something like:
-
- + Stop your httpd processes
- + gdb httpd
- + Stop your httpd processes
- + > run -X -f /path/to/httpd.conf
- + Then fetch the URL causing the problem with your browser
- + > run -X -f /path/to/httpd.conf
- + If you are getting a core dump, gdb should inform you of this
- now
- + type: bt
- + You should include your backtrace in your bug report. This
- should be submitted to » http://bugs.php.net/
-
- If your script uses the regular expression functions
- (preg_match() and friends), you should make sure that you
- compiled PHP and Apache with the same regular expression
- package. This should happen automatically with PHP and Apache
- 1.3.x
-
- Unix: I installed PHP using RPMS, but Apache isn't processing the PHP
- pages! What's going on here?
- Assuming you installed both Apache and PHP from RPM packages,
- you need to uncomment or add some or all of the following lines
- in your httpd.conf file:
-
-# Extra Modules
-AddModule mod_php.c
-AddModule mod_perl.c
-
-# Extra Modules
-LoadModule php_module modules/mod_php.so
-LoadModule php7_module modules/libphp7.so
-LoadModule perl_module modules/libperl.so
-
- And add:
-
-AddType application/x-httpd-php .php
-
- ... to the global properties, or to the properties of the
- VirtualDomain you want to have PHP support added to.
-
- Unix: I patched Apache with the FrontPage extensions patch, and
- suddenly PHP stopped working. Is PHP incompatible with the
- Apache FrontPage extensions?
- No, PHP works fine with the FrontPage extensions. The problem is
- that the FrontPage patch modifies several Apache structures,
- that PHP relies on. Recompiling PHP (using 'make clean ; make')
- after the FP patch is applied would solve the problem.
-
- Unix/Windows: I have installed PHP, but when I try to access a PHP
- script file via my browser, I get a blank screen.
- Do a 'view source' in the web browser and you will probably find
- that you can see the source code of your PHP script. This means
- that the web server did not send the script to PHP for
- interpretation. Something is wrong with the server configuration
- - double check the server configuration against the PHP
- installation instructions.
-
- Unix/Windows: I have installed PHP, but when try to access a PHP script
- file via my browser, I get a server 500 error.
- Something went wrong when the server tried to run PHP. To get to
- see a sensible error message, from the command line, change to
- the directory containing the PHP executable (php.exe on Windows)
- and run php -i. If PHP has any problems running, then a suitable
- error message will be displayed which will give you a clue as to
- what needs to be done next. If you get a screen full of HTML
- codes (the output of the phpinfo() function) then PHP is
- working, and your problem may be related to your server
- configuration which you should double check.
-
- Some operating systems: I have installed PHP without errors, but when I
- try to start Apache I get undefined symbol errors:
-
-[mybox:user /src/php7] root# apachectl configtest
- apachectl: /usr/local/apache/bin/httpd Undefined symbols:
- _compress
- _uncompress
-
- This has actually nothing to do with PHP, but with the MySQL
- client libraries. Some need --with-zlib , others do not. This is
- also covered in the MySQL FAQ.
-
- Windows: I have installed PHP, but when I try to access a PHP script
- file via my browser, I get the error:
-
-cgi error:
- The specified CGI application misbehaved by not
- returning a complete set of HTTP headers.
- The headers it did return are:
-
- This error message means that PHP failed to output anything at
- all. To get to see a sensible error message, from the command
- line, change to the directory containing the PHP executable
- (php.exe on Windows) and run php -i. If PHP has any problems
- running, then a suitable error message will be displayed which
- will give you a clue as to what needs to be done next. If you
- get a screen full of HTML codes (the output of the phpinfo()
- function) then PHP is working.
-
- Once PHP is working at the command line, try accessing the
- script via the browser again. If it still fails then it could be
- one of the following:
-
- + File permissions on your PHP script, php.exe, php7ts.dll,
- php.ini or any PHP extensions you are trying to load are such
- that the anonymous internet user ISUR_<machinename> cannot
- access them.
- + The script file does not exist (or possibly isn't where you
- think it is relative to your web root directory). Note that
- for IIS you can trap this error by ticking the 'check file
- exists' box when setting up the script mappings in the
- Internet Services Manager. If a script file does not exist
- then the server will return a 404 error instead. There is also
- the additional benefit that IIS will do any authentication
- required for you based on the NTLanMan permissions on your
- script file.
-
- Windows: I've followed all the instructions, but still can't get PHP
- and IIS to work together!
- Make sure any user who needs to run a PHP script has the rights
- to run php.exe! IIS uses an anonymous user which is added at the
- time IIS is installed. This user needs rights to php.exe. Also,
- any authenticated user will also need rights to execute php.exe.
- And for IIS4 you need to tell it that PHP is a script engine.
- Also, you will want to read this faq.
-
- When running PHP as CGI with IIS, OmniHTTPD or Xitami, I get the
- following error: Security Alert! PHP CGI cannot be accessed
- directly..
- You must set the cgi.force_redirect directive to 0. It defaults
- to 1 so be sure the directive isn't commented out (with a ;).
- Like all directives, this is set in php.ini
-
- Because the default is 1, it's critical that you're 100% sure
- that the correct php.ini file is being read. Read this faq for
- details.
-
- How do I know if my php.ini is being found and read? It seems like it
- isn't as my changes aren't being implemented.
- To be sure your php.ini is being read by PHP, make a call to
- phpinfo(). Near the top, there will be a listing called
- Configuration File (php.ini). This will tell you where PHP is
- looking for php.ini and whether or not it's being read. If just
- a directory PATH exists, then it's not being read, and you
- should put your php.ini in that directory. If php.ini is
- included within the PATH, it is being read.
-
- If php.ini is being read and you're running PHP as a module,
- then be sure to restart your web server after making changes to
- php.ini
-
- See also php_ini_loaded_file().
-
- How do I add my PHP directory to the PATH on Windows?
- On Windows NT+ and Windows Server 2000+:
-
- + Go to Control Panel and open the System icon (Start ->
- Settings -> Control Panel -> System, or just Start -> Control
- Panel -> System for Windows XP/2003+)
- + Go to the Advanced tab
- + Click on the 'Environment Variables' button
- + Look into the 'System Variables' pane
- + Find the Path entry (you may need to scroll to find it)
- + Double click on the Path entry
- + Enter your PHP directory at the end, including ';' before
- (e.g. ;C:\php)
- + Press OK
-
- On Windows 98/Me you need to edit the autoexec.bat file:
-
- + Open the Notepad (Start -> Run and enter notepad)
- + Open the C:\autoexec.bat file
- + Locate the line with PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;.....
- and add: ;C:\php to the end of the line
- + Save the file and restart your computer
-
- Note: Be sure to reboot after following the steps above to ensure
- that the PATH changes are applied.
-
- The PHP manual used to promote the copying of files into the
- Windows system directory, this is because this directory
- (C:\Windows, C:\WINNT, etc.) is by default in the systems PATH.
- Copying files into the Windows system directory has long since
- been deprecated and may cause problems.
-
- How do I make the php.ini file available to PHP on windows?
- There are several ways of doing this. If you are using Apache,
- read their installation specific instructions (Apache 1, Apache
- 2), otherwise you must set the PHPRC environment variable:
-
- On Windows NT, 2000, XP and 2003:
-
- + Go to Control Panel and open the System icon (Start ->
- Settings -> Control Panel -> System, or just Start -> Control
- Panel -> System for Windows XP/2003)
- + Go to the Advanced tab
- + Click on the 'Environment Variables' button
- + Look into the 'System variables' pane
- + Click on 'New' and enter 'PHPRC' as the variable name and the
- directory where php.ini is located as the variable value (e.g.
- C:\php)
- + Press OK and restart your computer
-
- On Windows 98/Me you need to edit the autoexec.bat file:
-
- + Open the Notepad (Start -> Run and enter notepad)
- + Open the C:\autoexec.bat file
- + Add a new line to the end of the file: set PHPRC=C:\php
- (replace C:\php with the directory where php.ini is located).
- Please note that the path cannot contain spaces. For instance,
- if you have installed PHP in C:\Program Files\PHP, you would
- enter C:\PROGRA~1\PHP instead.
- + Save the file and restart your computer
-
- Is it possible to use Apache content negotiation (MultiViews option)
- with PHP?
- If links to PHP files include extension, everything works
- perfect. This FAQ is only for the case when links to PHP files
- don't include extension and you want to use content negotiation
- to choose PHP files from URL with no extension. In this case,
- replace the line AddType application/x-httpd-php .php with:
-
-AddHandler php7-script php
-AddType text/html php
-
- This solution doesn't work for Apache 1 as PHP module doesn't
- catch php-script.
-
- Is PHP limited to process GET and POST request methods only?
- No, it is possible to handle any request method, e.g. CONNECT.
- Proper response status can be sent with header(). If only GET
- and POST methods should be handled, it can be achieved with this
- Apache configuration:
-
-<LimitExcept GET POST>
-Deny from all
-</LimitExcept>
+ http://php.net/install
diff --git a/Makefile.global b/Makefile.global
index 6b49f3844f..096edb619d 100644
--- a/Makefile.global
+++ b/Makefile.global
@@ -115,7 +115,7 @@ clean:
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.so | xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
- rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(SAPI_CGI_PATH) $(SAPI_MILTER_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/*
+ rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(SAPI_CGI_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/*
distclean: clean
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h main/internal_functions_cli.c main/internal_functions.c stamp-h buildmk.stamp Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak Zend/zend_config.h TSRM/tsrm_config.h
@@ -137,7 +137,7 @@ prof-clean:
find . -name \*.lo -o -name \*.o | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.so | xargs rm -f
- rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(SAPI_CGI_PATH) $(SAPI_MILTER_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/*
+ rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(SAPI_CGI_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/*
prof-use:
CCACHE_DISABLE=1 $(MAKE) PROF_FLAGS=-fprofile-use all
diff --git a/NEWS b/NEWS
index 35f52fc16c..3f9cff1e5f 100644
--- a/NEWS
+++ b/NEWS
@@ -1,698 +1,97 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-?? ??? ????, PHP 7.2.0RC5
-
-- Fileinfo:
- . Upgrade bundled libmagic to 5.31. (Anatol)
+?? ??? ????, PHP 7.3.0alpha1
- Core:
- . Fixed bug #75368 (mmap/munmap trashing on unlucky allocations). (Nikita,
- Dmitry)
-
-- Exif:
- . Fixed bug #75301 (Exif extension has built in revision version). (Peter
- Kokot)
-
-- Opcache:
- . Fixed bug #75370 (Webserver hangs on valid PHP text). (Laruence)
- . Fixed bug #75357 (segfault loading WordPress wp-admin). (Laruence)
-
-- Openssl:
- . Fixed bug #75363 (openssl_x509_parse leaks memory). (Bob)
-
-- Standard:
- . Fixed bug #75221 (Argon2i always throws NUL at the end). (cmb)
-
-- Zlib:
- . Fixed bug #75299 (Wrong reflection on inflate_init and inflate_add). (Fabien
- Villepinte)
-
-12 Oct 2017, PHP 7.2.0RC4
-
-- Core
+ . Redesigned the old ext_skel program written in PHP, run:
+ 'php ext_skel.php' for all options. This means there is no dependencies
+ thrus making it work on Windows out of the box. (Kalle)
+ . Removed support for BeOS. (Kalle)
+ . Fixed bug #75031 (support append mode in temp/memory streams). (adsr)
+ . Fixed bug #74860 (Uncaught exceptions not being formatted properly when
+ error_log set to "syslog"). (Philip Prindeville)
. Fixed bug #75220 (Segfault when calling is_callable on parent).
(andrewnester)
- . Fixed bug #75290 (debug info of Closures of internal functions contain
- garbage argument names). (Andrea)
-- Apache2Handler:
- . Fixed bug #75311 (error: 'zend_hash_key' has no member named 'arKey' in
- apache2handler). (mcarbonneaux)
+- BCMath:
+ . Fixed bug #66364 (BCMath bcmul ignores scale parameter). (cmb)
+ . Implemented request #67855 (No way to get current scale in use). (Chris
+ Wright, cmb)
+ . Fixed bug #75164 (split_bc_num() is pointless). (cmb)
+ . Fixed bug #75169 (BCMath errors/warnings bypass PHP's error handling). (cmb)
- Date:
+ . Implemented FR #74668: Add DateTime::createFromImmutable() method.
+ (majkl578, Rican7)
. Fixed bug #75222 (DateInterval microseconds property always 0). (jhdxr)
-- Hash:
- . Fixed Bug #75284 (sha3 is not supported on bigendian machine). (Remi)
+- cURL:
+ . Fixed bug #74125 (Fixed finding CURL on systems with multiarch support).
+ (cebe)
+
+- GD:
+ . Added support for WebP in imagecreatefromstring() (Andreas Treichel, cmb).
+
+- GMP:
+ . Export internal structures and accessor helpers for GMP object. (Sara)
-- Intl:
- . Fixed bug #75318 (The parameter of UConverter::getAliases() is not
- optional). (cmb)
+- LDAP:
+ . Added ldap_exop_refresh helper for EXOP REFRESH operation with dds overlay.
+ (Come)
+ . Added full support for sending and parsing ldap controls (Come)
- litespeed:
. Fixed bug #75248 (Binary directory doesn't get created when building
only litespeed SAPI). (petk)
. Fixed bug #75251 (Missing program prefix and suffix). (petk)
-- OCI8:
- . Fixed incorrect reference counting. (Dmitry, Tianfang Yang)
-
-- Opcache
- . Fixed bug #75255 (Request hangs and not finish). (Dmitry)
-
-- PCRE:
- . Fixed bug #75285 (Broken build when system libpcre don't have jit support).
- (Remi)
-
-- Sodium:
- . Added missing bindings for libsodium > 1.0.13. (Frank)
-
-28 Sep 2017, PHP 7.2.0RC3
-
-- Core
- . Fixed bug #75241 (Null pointer dereference in zend_mm_alloc_small()).
- (Laruence)
- . Fixed bug #74878 (Data race in ZTS builds). (Nikita, Dmitry)
- . Fixed bug #75236 (infinite loop when printing an error-message). (Andrea)
- . Fixed bug #75252 (Incorrect token formatting on two parse errors in one
- request). (Nikita)
-
-- FPM:
- . Fixed bug #75212 (php_value acts like php_admin_value). (Remi)
-
-- MySQLi:
- . Fixed bug #75018 (Data corruption when reading fields of bit type). (Anatol)
-
-- Opcache:
- . Fixed bug #75230 (Invalid opcode 49/1/8 using opcache). (Laruence)
-
-- PCRE:
- . Fixed bug ##75223 (PCRE JIT broken in 7.2). (Dmitry)
-
-- PDO_mysql:
- . Fixed bug #75177 (Type 'bit' is fetched as unexpected string). (Anatol)
-
-- SPL:
- . Fixed bug #73629 (SplDoublyLinkedList::setIteratorMode masks intern flags).
- (J. Jeising, cmb)
-
-14 Sep 2017, PHP 7.2.0RC2
-
-- Core:
- . Fixed Bug #75142 (buildcheck.sh check for autoconf version needs to be updated
- for v2.64). (zizzy at zizzy dot net, Remi)
-
-- BCMath:
- . Fixed bug #44995 (bcpowmod() fails if scale != 0). (cmb)
- . Fixed bug #46781 (BC math handles minus zero incorrectly). (cmb)
- . Fixed bug #54598 (bcpowmod() may return 1 if modulus is 1). (okano1220, cmb)
- . Fixed bug #75178 (bcpowmod() misbehaves for non-integer base or modulus). (cmb)
-
-- CLI server:
- . Fixed bug #70470 (Built-in server truncates headers spanning over TCP
- packets). (bouk)
-
-- Date:
- . Fixed bug #75149 (redefinition of typedefs ttinfo and t1info). (Remi)
-
-- GD:
- . Fixed bug #75139 (libgd/gd_interpolation.c:1786: suspicious if ?). (cmb)
-
-- Intl:
- . Fixed bug #75193 (segfault in collator_convert_object_to_string). (Remi)
-
-- Gettext:
- . Fixed bug #73730 (textdomain(null) throws in strict mode). (cmb)
-
-- Opcache
- . Fixed incorect constant conditional jump elimination. (Dmitry)
-
-- OpenSSL
- . Automatically load OpenSSL configuration file. (Jakub Zelenka)
-
-- SPL:
- . Fixed bug #75155 (AppendIterator::append() is broken when appending another
- AppendIterator). (Nikita)
- . Fixed bug #75173 (incorrect behavior of AppendIterator::append in foreach loop).
- (jhdxr)
-
-- Standard:
- . Fixed bug #75152 (signed integer overflow in parse_iv). (Laruence)
- . Fixed bug #75170 (mt_rand() bias on 64-bit machines). (Nikita)
-
-- ZIP:
- . Fixed bug #75143 (new method setEncryptionName() seems not to exist
- in ZipArchive). (Anatol)
-
-31 Aug 2017, PHP 7.2.0RC1
-
-- Core:
- . Fixed bug #75042 (run-tests.php issues with EXTENSION block). (John Boehr)
-
-- CURL:
- . Fixed bug #75093 (OpenSSL support not detected). (Remi)
- . Better fix for #74125 (use pkg-config instead of curl-config). (Remi)
-
-- GD:
- . Fixed bug #75111 (Memory disclosure or DoS via crafted .bmp image). (cmb)
- . Fixed bug #75124 (gdImageGrayScale() may produce colors). (cmb)
-
-- Intl:
- . Fixed bug #75090 (IntlGregorianCalendar doesn't have constants from parent
- class). (tpunt)
+- Mbstring:
+ . Fixed bug #65544 (mb title case conversion-first word in quotation isn't
+ capitalized). (Nikita)
+ . Fixed bug #71298 (MB_CASE_TITLE misbehaves with curled apostrophe/quote.
+ (Nikita)
+ . Fixed bug #73528 (Crash in zif_mb_send_mail). (Nikita)
+ . Fixed bug #74929 (mbstring functions version 7.1.1 are slow compared to 5.3
+ on Windows). (Nikita)
-- PCRE:
- . Fixed bug #75089 (preg_grep() is not reporting PREG_BAD_UTF8_ERROR after
- first input string). (Dmitry)
+- ODBC:
+ . Removed support for ODBCRouter. (Kalle)
+ . Removed support for Birdstep. (Kalle)
- PDO_OCI:
. Fixed bug #74631 (PDO_PCO with PHP-FPM: OCI environment initialized
before PHP-FPM sets it up). (Ingmar Runge)
-- SQLite3:
- . Update to Sqlite 3.20.1. (cmb)
-
-- Standard:
- . Fixed bug #75097 (gethostname fails if your host name is 64 chars long). (Andrea)
-
-17 Aug 2017, PHP 7.2.0beta3
-
-- Core:
- . Fixed bug #75063 (Main CWD initialized with wrong codepage). (Anatol)
- . Fixed bug #74725 (html_errors=1 breaks unhandled exceptions). (Andrea)
-
-- Date:
- . Fixed bug #75002 (Null Pointer Dereference in timelib_time_clone). (Derick)
-
-- FTP:
- . Added ftp_append() function. (blar)
-
-- JSON:
- . Fixed bug #75185 (Buffer overflow in json_decode() with
- JSON_INVALID_UTF8_IGNORE or JSON_INVALID). (Jakub Zelenka)
-
-- Mbstring:
- . Fixed bug #75001 (Wrong reflection on mb_eregi_replace). (Fabien
- Villepinte)
-
-- SQLite3:
- . Updated to SQLite 3.20.0. (cmb)
-
-- SPL:
- . Fixed bug #75049 (spl_autoload_unregister can't handle
- spl_autoload_functions results). (Laruence)
- . Added spl_object_id(). (Tyson Andre)
-
-- Standard:
- . Fixed bug #75075 (unpack with X* causes infinity loop). (Laruence)
- . Fixed bug #74103 (heap-use-after-free when unserializing invalid array
- size). (Nikita)
- . Fixed bug #75054 (A Denial of Service Vulnerability was found when
- performing deserialization). (Nikita)
-
-- WDDX:
- . Fixed bug #73793 (WDDX uses wrong decimal seperator). (cmb)
-
-- XMLRPC:
- . Fixed bug #74975 (Incorrect xmlrpc serialization for classes with declared
- properties). (blar)
-
-03 Aug 2017, PHP 7.2.0beta2
-
-- Core:
- . Implemented FR #74963 (Improved error message on fetching property of
- non-object). (Laruence)
- . Fixed bug #74947 (Segfault in scanner on INF number). (Laruence)
- . Fixed bug #74954 (null deref and segfault in zend_generator_resume()). (Bob)
- . Fixed bug #75349 (NAN comparison). (Sara)
-
-- CLI:
- . Fixed bug #74979 (Interactive shell opening instead of script execution
- with -f flag). (Anatol)
-
-- cURL:
- . Fixed bug #74125 (Fixed finding CURL on systems with multiarch support).
- (cebe)
-
-- Intl:
- . Fixed bug #74993 (Wrong reflection on some locale_* functions). (Sara)
-
-- Mbstring:
- . Fixed bug #69267 (mb_strtolower fails on titlecase characters). (Nikita)
- . Fixed bug #71606 (Segmentation fault mb_strcut with HTML-ENTITIES encoding).
- (cmb)
- . Fixed bug #62934 (mb_convert_kana() does not convert iteration marks).
- (Nikita)
-
-- MySQLi:
- . Fixed bug #74968 (PHP crashes when calling mysqli_result::fetch_object with
- an abstract class). (Anatol)
-
-- OCI8:
- . Expose oci_unregister_taf_callback() (Tianfang Yang)
-
-- Opcache:
- . Fixed bug #74980 (Narrowing occurred during type inference). (Laruence)
-
-- OpenSSL:
- . Fixed bug #74903 (openssl_pkcs7_encrypt() uses different EOL than before).
- (Anatol)
+- PDO SQLite
+ . Add support for additional open flags
- phar:
. Fixed bug #74991 (include_path has a 4096 char limit in some cases).
(bwbroersma)
-- Reflection:
- . Fixed bug #74949 (null pointer dereference in _function_string). (Laruence)
+- pgsql:
+ . Added new error constants for pg_result_error(): (Kalle)
+ - Requires Postgres 9.3
+ - PGSQL_DIAG_SCHEMA_NAME
+ - PGSQL_DIAG_TABLE_NAME
+ - PGSQL_DIAG_COLUMN_NAME
+ - PGSQL_DIAG_DATATYPE_NAME
+ - PGSQL_DIAG_CONSTRAINT_NAME
+ - Requires Postgres 9.6
+ - PGSQL_DIAG_SEVERITY_NONLOCALIZED
- Session:
- . Fixed bug #74892 (Url Rewriting (trans_sid) not working on urls that start
- with "#"). (Andrew Nester)
- . Fixed bug #74936 (session_cache_expire/cache_limiter/save_path() trigger a
- warning in read mode). (morozov)
. Fixed bug #74941 (session fails to start after having headers sent).
(morozov)
- . Fixed bug #74833 (SID constant created with wrong module number). (Anatol)
-
-- SimpleXML:
- . Fixed bug #74950 (nullpointer deref in simplexml_element_getDocNamespaces).
- (Laruence)
- SPL:
- . Fixed bug #74669 (Unserialize ArrayIterator broken). (Andrew Nester)
. Fixed bug #74977 (Appending AppendIterator leads to segfault).
(Andrew Nester)
- . Fixed bug #75015 (Crash in recursive iterator destructors). (Julien)
-
-- Standard:
- . Fixed bug #74851 (uniqid() without more_entropy performs badly).
- (Emmanuel Dreyfus)
-
-20 Jul 2017, PHP 7.2.0beta1
-
-- Core:
- . Added new VM instuctions ISSET_ISEMPTY_CV and UNSET_CV. Previously they
- were implemented as ISSET_ISEMPTY_VAR and UNSET_VAR variants with
- ZEND_QUICK_SET flag. (Nikita, Dmitry)
- . Fixed bug #74603 (PHP INI Parsing Stack Buffer Overflow Vulnerability).
- (Stas)
- . Fixed bug #74111 (Heap buffer overread (READ: 1) finish_nested_data from
- unserialize). (Nikita)
- . Fixed bug #74819 (wddx_deserialize() heap out-of-bound read via
- php_parse_date()). (Derick)
- . Fixed bug #49649 (unserialize() doesn't handle changes in property
- visibility). (pmmaga)
- . Fixed #74866 (extension_dir = "./ext" now use current directory for base).
- (Francois Laupretre)
- . Fixed bug #74923 (Crash when crawling through network share). (Anatol)
- . Fixed bug #74913 (fixed incorrect poll.h include). (petk)
- . Fixed bug #74906 (fixed incorrect errno.h include). (petk)
-
-- Date:
- . Fixed bug #74852 (property_exists returns true on unknown DateInterval
- property). (jhdxr)
-
-- DOM:
- . Implement #74837 (Implement Countable for DomNodeList and DOMNamedNodeMap).
- (Andreas Treichel)
-
-- EXIF:
- . Implemented #65187 (exif_read_data/thumbnail: add support for stream
- resource). (Kalle)
- . Deprecated the read_exif_data() alias. (Kalle)
- . Fixed bug #74428 (exif_read_data(): "Illegal IFD size" warning occurs with
- correct exif format). (bradpiccho at gmail dot com, Kalle)
- . Fixed bug #72819 (EXIF thumbnails not read anymore). (Kalle)
- . Fixed bug #62523 (php crashes with segfault when exif_read_data called).
- (Kalle)
- . Fixed bug #50660 (exif_read_data(): Illegal IFD offset (works fine with
- other exif readers). (skinny dot bravo at gmail dot com, Kalle)
-
-- GD:
- . Fixed bug #74435 (Buffer over-read into uninitialized memory). (cmb)
-
-- IMAP:
- . Fixed bug #72324 (imap_mailboxmsginfo() return wrong size).
- (ronaldpoon at udomain dot com dot hk, Kalle)
-
-- JSON:
- . Add JSON_INVALID_UTF8_IGNORE and JSON_INVALID_UTF8_SUBSTITUTE options for
- json_encode and json_decode to ignore or replace invalid UTF-8 byte
- sequences - it addresses request #65082. (Jakub Zelenka)
-
-- LDAP:
- . Fixed passing an empty array to ldap_set_option for client or server controls.
-
-- Opcache:
- . Added global optimisation passes based on data flow analysis using Single
- Static Assignment (SSA) form: Sparse Conditional Constant Propagation (SCCP),
- Dead Code Elimination (DCE), and removal of unused local variables
- (Nikita, Dmitry)
-
-- OpenSSL:
- . Add ssl security_level stream option to support OpenSSL security levels.
- (Jakub Zelenka).
- . Allow setting SNI cert and private key in separate files. (Jakub Zelenka)
- . Fixed bug #74651 (negative-size-param (-1) in memcpy in zif_openssl_seal()).
- (Stas)
-
-- PCRE:
- . Fixed bug #74873 (Minor BC break: PCRE_JIT changes output of preg_match()).
- (Dmitry)
-
-- Sodium:
- . New cryptographic extension
-
-- SQLite3:
- . Fixed bug #74883 (SQLite3::__construct() produces "out of memory" exception
- with invalid flags). (Anatol)
-
-- ZIP:
- . ZipArchive implements countable, added ZipArchive::count() method. (Remi)
- . Fix segfault in php_stream_context_get_option call. (Remi)
-
-06 Jul 2017, PHP 7.2.0alpha3
-
-- Core:
- . Fixed bug #74780 (parse_url() broken when query string contains colon).
+ . Fixed bug #75173 (incorrect behavior of AppendIterator::append in foreach loop).
(jhdxr)
- . Fixed bug #74761 (Unary operator expected error on some systems). (petk)
- . Allow loading PHP/Zend extensions by name in ini files (extension=<name>).
- (francois at tekwire dot net)
- . Added object type annotation. (brzuchal)
- . Fixed bug #74815 (crash with a combination of INI entries at startup).
- (Anatol)
- . Fixed bug #74836 (isset on zero-prefixed numeric indexes in array broken).
- (Dmitry)
- . Fixed bug #74101, bug #74614 (Unserialize Heap Use-After-Free (READ: 1) in
- zval_get_type). (Nikita)
-
-- CLI:
- . Fixed bug #74849 (Process is started as interactive shell in PhpStorm).
- (Anatol)
-
-- LDAP:
- . Implemented FR #69445 (Support for LDAP EXOP operations)
- . Fixed support for LDAP_OPT_SERVER_CONTROLS and LDAP_OPT_CLIENT_CONTROLS in ldap_get_option
-
-- OpenSSL:
- . Fixed bug #74798 (pkcs7_en/decrypt does not work if \x0a is used in content).
- (Anatol)
-
-- SPL:
- . Fixed bug #73471 (PHP freezes with AppendIterator). (jhdxr)
- . Fixed bug #71412 (Incorrect arginfo for ArrayIterator::__construct).
- (tysonandre775 at hotmail dot com)
-
-- Session:
- . Fixed bug #74514 (5 session functions incorrectly warn when calling in
- read-only/getter mode). (Yasuo)
-
-- Standard:
- . Add support for extension name as argument to dl().
- (francois at tekwire dot net)
-
-- zlib:
- . Fixed bug #73944 (dictionary option of inflate_init() does not work).
- (wapmorgan)
- . Expose inflate_get_status() and inflate_get_read_len() functions.
- (Matthew Trescott)
-
-22 Jun 2017, PHP 7.2.0alpha2
-
-- Core:
- . Change PHP_OS_FAMILY value from "OSX" to "Darwin". (Sebastian, Kalle)
-
-- GD:
- . Fixed bug #74744 (gd.h: stdarg.h include missing for va_list use in
- gdErrorMethod). (rainer dot jung at kippdata dot de, cmb)
-
-- OCI8:
- . Add TAF callback (PR #2459). (KoenigsKind)
- . Fixed bug #74625 (Integer overflow in oci_bind_array_by_name). (Ingmar Runge)
-
-- OpenSSL:
- . Fixed bug #74720 (pkcs7_en/decrypt does not work if \x1a is used in
- content). (Anatol)
- . Use TLS_ANY for default ssl:// and tls:// negotiation. (kelunik)
- . Fix leak in openssl_spki_new(). (jelle at vdwaa dot nl)
- . Added openssl_pkcs7_read() and pk7 parameter to openssl_pkcs7_verify().
- (jelle at vdwaa dot nl)
-
-- PDO_OCI:
- . Fixed Bug #74537 (Align --with-pdo-oci configure option with --with-oci8 syntax).
- (Tianfang Yang)
- Standard:
- . Compatibility with libargon2 versions 20161029 and 20160821.
- (charlesportwoodii at erianna dot com)
- . Fixed Bug #74737 (mysqli_get_client_info reflection info).
- (mhagstrand at gmail dot com)
-
-- Streams:
- . Default ssl/single_dh_use and ssl/honor_cipher_order to true. (kelunik)
-
-- SQLite3:
- . Update to Sqlite 3.19.3. (cmb)
- . Implement writing to blobs. (bohwaz at github dot com)
-
-08 Jun 2017, PHP 7.2.0alpha1
-
-- Core:
- . Added ZEND_COUNT, ZEND_GET_CLASS, ZEND_GET_CALLED_CLASS, ZEND_GET_TYPE,
- ZEND_FUNC_NUM_ARGS, ZEND_FUNC_GET_ARGS instructions, to implement
- corresponding builtin functions. (Dmitry)
- . "Countable" interface is moved from SPL to Core. (Dmitry)
- . Added ZEND_IN_ARRAY instruction, implementing optimized in_array() builtin
- function, through hash lookup in flipped array. (Dmitry)
- . Removed IS_TYPE_IMMUTABLE (it's the same as COPYABLE & !REFCOUNTED). (Dmitry)
- . Removed the sql.safe_mode directive. (Kalle)
- . Removed support for Netware. (Kalle)
- . Renamed ReflectionClass::isIterateable() to ReflectionClass::isIterable()
- (alias original name for BC). (Sara)
- . Fixed bug #54535 (WSA cleanup executes before MSHUTDOWN). (Kalle)
- . Implemented FR #69791 (Disallow mail header injections by extra headers)
- (Yasuo)
- . Implemented FR #49806 (proc_nice() for Windows). (Kalle)
- . Fix pthreads detection when cross-compiling (ffontaine)
- . Fixed memory leaks caused by exceptions thrown from destructors. (Bob,
- Dmitry).
- . Fixed bug #73215 (uniqid() should use better random source). (Yasuo)
- . Fixed bug #73337 (try/catch not working with two exceptions inside a same
- operation). (Dmitry)
- . Implemented FR #72768 (Add ENABLE_VIRTUAL_TERMINAL_PROCESSING flag for
- php.exe). (Michele Locati)
- . Implemented "Convert numeric keys in object/array casts" RFC, fixes
- bugs #53838, #61655, #66173, #70925, #72254, etc. (Andrea)
- . Implemented "Deprecate and Remove Bareword (Unquoted) Strings" RFC.
- (Rowan Collins)
- . Raised minimum supported Windows versions to Windows 7/Server 2008 R2.
- (Anatol)
- . Implemented minor optimization in array_keys/array_values(). (Sara)
- . Fixed bug #73969 (segfault in debug_print_backtrace). (andrewnester)
- . Added PHP_OS_FAMILY constant to determine on which OS we are. (Jan Altensen)
- . Fixed bug #73994 (arginfo incorrect for unpack). (krakjoe)
- . Fixed bug #73973 (assertion error in debug_zval_dump). (andrewnester)
- . Fixed bug #73987 (Method compatibility check looks to original
- definition and not parent). (pmmaga)
- . Fixed bug #73991 (JSON_OBJECT_AS_ARRAY not respected). (Sara)
- . Fixed bug #74053 (Corrupted class entries on shutdown when a destructor
- spawns another object). (jim at commercebyte dot com)
- . Fixed bug #73971 (Filename got limited to MAX_PATH on Win32 when scan
- directory). (Anatol)
- . Fixed bug #74149 (static embed SAPI linkage error). (krakjoe)
- . Fixed bug #72359, bug #72451, bug #73706, bug #71115 and others related
- to interned strings handling in TS builds. (Anatol, Dmitry)
- . Implemented "Trailing Commas In List Syntax" RFC for group use lists only.
- (Sammy Kaye Powers)
- . Fixed bug #74269 (It's possible to override trait property with different
- loosely-equal value). (pmmaga)
- . Fixed bug #61970 (Restraining __construct() access level in subclass gives
- a fatal error). (pmmaga)
- . Fixed bug #63384 (Cannot override an abstract method with an abstract
- method). (pmmaga, wes)
- . Fixed bug #74607 (Traits enforce different inheritance rules). (pmmaga)
- . Fixed misparsing of abstract unix domain socket names. (Sara)
-
-- BCMath:
- . Fixed bug #46564 (bcmod truncates fractionals). (liborm85)
-
-- Calendar:
- . Fix integer overflows (Joshua Rogers)
-
-- CLI server:
- . Fixed bug #60471 (Random "Invalid request (unexpected EOF)" using a router
- script). (SammyK)
-
-- Date:
- . Fixed bug #55407 (Impossible to prototype DateTime::createFromFormat).
- (kelunik)
- . Fixed bug #69587 (DateInterval properties and isset). (jhdxr)
- . Fixed bug #74404 (Wrong reflection on DateTimeZone::getTransitions).
- (krakjoe)
- . Fixed bug #74080 (add constant for RFC7231 format datetime). (duncan3dc)
- . Fixed bug #74639 (implement clone for DatePeriod and DateInterval).
- (andrewnester)
- . Implemented FR #71520 (Adding the DateTime constants to the
- DateTimeInterface interface). (Majkl578)
-
-- Dba:
- . Fixed bug #72885 (flatfile: dba_fetch() fails to read replaced entry).
- (Anatol)
-
-- DOM:
- . Fixed bug #67474 (getElementsByTagNameNS filter on default ns). (aboks)
- . Fixed bug #54382 (getAttributeNodeNS doesn't get xmlns* attributes).
- (aboks)
- . Fixed bug #74004 (LIBXML_NOWARNING (etc) ignored by DOMDocument::loadHTML).
- (somedaysummer)
-
-- EXIF:
- . Added support for vendor specific tags for the following formats:
- Samsung, DJI, Panasonic, Sony, Pentax, Minolta, Sigma/Foveon, AGFA,
- Kyocera, Ricoh & Epson. (Kalle)
- . Fixed bug #72682 (exif_read_data() fails to read all data for some
- images). (Kalle)
- . Fixed bug #71534 (Type confusion in exif_read_data() leading to heap
- overflow in debug mode). (hlt99 at blinkenshell dot org, Kalle)
- . Fixed bug #68547 (Exif Header component value check error).
- (sjh21a at gmail dot com, Kalle)
- . Fixed bug #66443 (Corrupt EXIF header: maximum directory nesting level
- reached for some cameras). (Kalle)
- . Fixed Redhat bug #1362571 (PHP not returning full results for
- exif_read_data function). (Kalle)
-
-- FPM:
- . Configuration to limit fpm slow log trace callers. (Sannis)
- . Fixed bug #69865 (php-fpm does not close stderr when using syslog).
- (Mike)
-
-- FTP:
- . Fixed bug #74598 (ftp:// wrapper ignores context arg). (Sara)
- . Implement MLSD for structured listing of directories. (blar)
-
-- GD:
- . Implemented imageresolution as getter and setter (Christoph)
- . Fixed bug #74343 (compile fails on solaris 11 with system gd2 library).
- (krakjoe)
-
-- GMP:
- . Fixed bug #70896 (gmp_fact() silently ignores non-integer input). (Sara)
-
-- hash:
- . Fixed bug #73961 (environmental build dependency in hash sha3 source).
- (krakjoe)
- . Changed HashContext from resource to object. (Rouven Weßling, Sara)
- . Disallowed usage of non-cryptographic hash functions with HMAC and PBKDF2.
- (Andrey Andreev, Nikita)
-
-- intl:
- . Fixed bug #74433 (wrong reflection for Normalizer methods). (villfa)
- . Fixed bug #74439 (wrong reflection for Locale methods). (villfa)
- . Fixed bug #74468 (wrong reflection on Collator::sortWithSortKeys). (villfa)
- . Fixed bug #63790 (test using Spoofchecker which may be unavailable). (Sara)
-
-- Mbstring:
- . Implemented request #66024 (mb_chr() and mb_ord()). (Masakielastic, Yasuo)
- . Implemented request #65081 (mb_scrub()). (Masakielastic, Yasuo)
- . Implemented request #69086 (enhancement for mb_convert_encoding() that
- handles multibyte replacement char nicely). (Masakielastic, Yasuo)
- . Added array input support to mb_convert_encoding(). (Yasuo)
- . Added array input support to mb_check_encoding(). (Yasuo)
- . Fixed bug #69079 (enhancement for mb_substitute_character). (masakielastic)
- . Update to oniguruma version 6.3.0. (Remi)
-
-- Mcrypt:
- . The deprecated mcrypt extension has been moved to PECL. (leigh)
-
-- MySQLi:
- . Fixed bug #73949 (leak in mysqli_fetch_object). (krakjoe)
-
-- mysqlnd:
- . Fixed bug #73800 (sporadic segfault with MYSQLI_OPT_INT_AND_FLOAT_NATIVE).
- (vanviegen)
-
-- OpenSSL:
- . Fixed bug #71519 (add serial hex to return value array). (xrobau)
-
-- PCRE:
- . Added support for PCRE JIT fast path API. (dmitry)
- . Fixed bug #61780 (Inconsistent PCRE captures in match results). (cmb)
-
-- PDO:
- . Add "Sent SQL" to debug dump for emulated prepares. (Adam Baratz)
- . Add parameter types for national character set strings. (Adam Baratz)
-
-- PDO_DBlib:
- . Fixed bug #73234 (Emulated statements let value dictate parameter type).
- (Adam Baratz)
- . Fixed bug #73396 (bigint columns are returned as strings). (Adam Baratz)
- . Expose DB-Library version as \PDO::DBLIB_ATTR_VERSION attribute on \PDO
- instance. (Adam Baratz)
- . Add test coverage for bug #72969. (Jeff Farr)
-
-- PDO_OCI:
- . Fixed bug #54379 (PDO_OCI: UTF-8 output gets truncated). (gureedo / Oracle)
-
-- PDO_PgSQL:
- . Fixed bug #73959 (lastInsertId fails to throw an exception for wrong
- sequence name). (andrewnester)
-
-- PDO_Sqlite
- . Switch to sqlite3_prepare_v2() and sqlite3_close_v2() functions (rasmus)
-
-- phar:
- . Fixed bug #74383 (phar method parameters reflection correction).
- (mhagstrand)
- . Fixed bug #74196 (phar does not correctly handle names containing dots).
- (mhagstrand)
- . Fixed bug #74386 (Phar::__construct reflection incorrect). (villfa)
-
-- PHPDBG
- . Added extended_value to opcode dump output. (Sara)
-
-- posix:
- . Fixed bug #71219 (configure script incorrectly checks for ttyname_r). (atoh)
-
-- Session:
- . Fixed bug #73461 (Prohibit session save handler recursion). (Yasuo)
- . PR #2233 Removed register_globals related code and "!" can be used as $_SESSION key name. (Yasuo)
- . Improved bug #73100 fix. 'user' save handler can only be set by session_set_save_handler()
- . Fixed bug #69582 (session not readable by root in CLI). (EvgeniySpinov)
-
-- SOAP:
- . Fixed bug #69137 (Peer verification fails when using a proxy with SoapClient)
- (Keith Smiley)
-
-- SQLite3:
- . Update to Sqlite 3.18.0. (cmb)
- . Fixed bug #74413 (incorrect reflection for SQLite3::enableExceptions).
- (krakjoe)
-
-- Standard:
- . Add subject to mail log. (tomsommer)
- . Fixed bug #31875 (get_defined_functions additional param to exclude
- disabled functions). (willianveiga)
- . Fixed bug #69442 (closing of fd incorrect when PTS enabled). (jaytaph)
- . Fixed bug #72974 (imap is undefined service on AIX). (matthieu.sarter)
- . Fixed bug #72979 (money_format stores wrong length AIX). (matthieu.sarter)
- . Fixed bug #74300 (unserialize accepts two plus/minus signs for float number exponent part).
- (xKerman)
- . Fixed bug #74556 (stream_socket_get_name() returns '\0'). (Sara)
-
-- XML:
- . Moved utf8_encode() and utf8_decode() to the Standard extension. (Andrea)
- . Fixed bug #72135 (malformed XML causes fault) (edgarsandi)
-
-- xmlreader:
- . Fixed bug #74457 (Wrong reflection on XMLReader::expand). (villfa)
-
-- XMLRPC:
- . Use Zend MM for allocation in bundled libxmlrpc (Joe)
-
-- ZIP:
- . Add support for encrypted archives. (Remi)
- . Use of bundled libzip is deprecated, --with-libzip option is recommended. (Remi)
- . Fixed Bug #73803 (Reflection of ZipArchive does not show public properties). (Remi)
+ . Fixed unzserialize(), to disable creation of unsupported data structures
+ through manually crafted strings. (Dmitry)
<<< NOTE: Insert NEWS from last stable release here prior to actual release! >>>
diff --git a/README.GIT-RULES b/README.GIT-RULES
index d7143e6b9d..6ee3585931 100644
--- a/README.GIT-RULES
+++ b/README.GIT-RULES
@@ -74,7 +74,7 @@ The next few rules are more of a technical nature::
1. All changes should first go to the lowest branch (i.e. 5.6) and then
get merged up to all other branches. If a change is not needed for
- later branches (i.e. fixes for features which where dropped from later
+ later branches (i.e. fixes for features which were dropped from later
branches) an empty merge should be done.
2. All news updates intended for public viewing, such as new features,
diff --git a/README.RELEASE_PROCESS b/README.RELEASE_PROCESS
index 112d5036c2..c735d5e263 100644
--- a/README.RELEASE_PROCESS
+++ b/README.RELEASE_PROCESS
@@ -327,6 +327,28 @@ Please make sure that the mail to php-announce@ is its own completely separate e
This is to make sure that replies to the announcement on php-general@ or internals@
will not accidentally hit the php-announce@ mailinglist.
+Forking a new release branch
+----------------------------
+
+1. One week prior to cutting X.Y.0beta1, warn internals@ that your version's branch
+ is about to be cut, and that PHP-X.Y will be moving into feature freeze.
+ Try to be specific about when the branch will be cut.
+ Example: http://news.php.net/php.internals/99864
+
+2. Just prior to cutting X.Y.0beta1, create the new branch locally.
+ Add a commit on master after the branch point clearing the NEWS file, and updating
+ main/php_versions.h and Zend/zend.h to update versions.
+ Example: https://github.com/php/php-src/commit/5230541ef59e0637d5522293a7d099bf18ce6af3
+ Push the new branch and the commit just added to master.
+
+3. Immediately notify internals@ of the branch cut and advise the new merging order:
+ Example: http://news.php.net/php.internals/99903
+
+4. Update php-web:git.php and wiki.php.net/vcs/gitworkflow to reflect the new branch:
+ Example: https://github.com/php/web-php/commit/74bcad4c770d95f21b7fbeeedbd76d943bb83f23
+
+5. Notify nlopess@ to add PHP_X_Y tag to gcov.php.net
+
New Release Manager Checklist
-----------------------------
diff --git a/TSRM/TODO b/TSRM/TODO
deleted file mode 100644
index 82b4fedfde..0000000000
--- a/TSRM/TODO
+++ /dev/null
@@ -1,2 +0,0 @@
-- Improve the lock in ts_resource_ex() in order to cover less code.
- This can probably be done by more careful hash table access
diff --git a/TSRM/TSRM.c b/TSRM/TSRM.c
index cde8437790..aff1cef84e 100644
--- a/TSRM/TSRM.c
+++ b/TSRM/TSRM.c
@@ -110,11 +110,6 @@ static DWORD tls_key;
# define tsrm_tls_set(what) TlsSetValue(tls_key, (void*)(what))
# define tsrm_tls_get() TlsGetValue(tls_key)
-#elif defined(BETHREADS)
-static int32 tls_key;
-# define tsrm_tls_set(what) tls_set(tls_key, (void*)(what))
-# define tsrm_tls_get() (tsrm_tls_entry*)tls_get(tls_key)
-
#else
# define tsrm_tls_set(what)
# define tsrm_tls_get() NULL
@@ -135,8 +130,6 @@ TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debu
st_key_create(&tls_key, 0);
#elif defined(TSRM_WIN32)
tls_key = TlsAlloc();
-#elif defined(BETHREADS)
- tls_key = tls_allocate();
#endif
/* ensure singleton */
@@ -585,14 +578,8 @@ TSRM_API THREAD_T tsrm_thread_id(void)
return pth_self();
#elif defined(PTHREADS)
return pthread_self();
-#elif defined(NSAPI)
- return systhread_current();
-#elif defined(PI3WEB)
- return PIThread_getCurrent();
#elif defined(TSRM_ST)
return st_thread_self();
-#elif defined(BETHREADS)
- return find_thread(NULL);
#endif
}/*}}}*/
@@ -610,16 +597,8 @@ TSRM_API MUTEX_T tsrm_mutex_alloc(void)
#elif defined(PTHREADS)
mutexp = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t));
pthread_mutex_init(mutexp,NULL);
-#elif defined(NSAPI)
- mutexp = crit_init();
-#elif defined(PI3WEB)
- mutexp = PIPlatform_allocLocalMutex();
#elif defined(TSRM_ST)
mutexp = st_mutex_new();
-#elif defined(BETHREADS)
- mutexp = (beos_ben*)malloc(sizeof(beos_ben));
- mutexp->ben = 0;
- mutexp->sem = create_sem(1, "PHP sempahore");
#endif
#ifdef THR_DEBUG
printf("Mutex created thread: %d\n",mythreadid());
@@ -640,15 +619,8 @@ TSRM_API void tsrm_mutex_free(MUTEX_T mutexp)
#elif defined(PTHREADS)
pthread_mutex_destroy(mutexp);
free(mutexp);
-#elif defined(NSAPI)
- crit_terminate(mutexp);
-#elif defined(PI3WEB)
- PISync_delete(mutexp);
#elif defined(TSRM_ST)
st_mutex_destroy(mutexp);
-#elif defined(BETHREADS)
- delete_sem(mutexp->sem);
- free(mutexp);
#endif
}
#ifdef THR_DEBUG
@@ -674,17 +646,8 @@ TSRM_API int tsrm_mutex_lock(MUTEX_T mutexp)
return -1;
#elif defined(PTHREADS)
return pthread_mutex_lock(mutexp);
-#elif defined(NSAPI)
- crit_enter(mutexp);
- return 0;
-#elif defined(PI3WEB)
- return PISync_lock(mutexp);
#elif defined(TSRM_ST)
return st_mutex_lock(mutexp);
-#elif defined(BETHREADS)
- if (atomic_add(&mutexp->ben, 1) != 0)
- return acquire_sem(mutexp->sem);
- return 0;
#endif
}/*}}}*/
@@ -706,17 +669,8 @@ TSRM_API int tsrm_mutex_unlock(MUTEX_T mutexp)
return -1;
#elif defined(PTHREADS)
return pthread_mutex_unlock(mutexp);
-#elif defined(NSAPI)
- crit_exit(mutexp);
- return 0;
-#elif defined(PI3WEB)
- return PISync_unlock(mutexp);
#elif defined(TSRM_ST)
return st_mutex_unlock(mutexp);
-#elif defined(BETHREADS)
- if (atomic_add(&mutexp->ben, -1) != 1)
- return release_sem(mutexp->sem);
- return 0;
#endif
}/*}}}*/
diff --git a/TSRM/TSRM.h b/TSRM/TSRM.h
index 39d4bcc752..15ebcd7949 100644
--- a/TSRM/TSRM.h
+++ b/TSRM/TSRM.h
@@ -69,22 +69,9 @@ typedef int ts_rsrc_id;
#elif defined(PTHREADS)
# define THREAD_T pthread_t
# define MUTEX_T pthread_mutex_t *
-#elif defined(NSAPI)
-# define THREAD_T SYS_THREAD
-# define MUTEX_T CRITICAL
-#elif defined(PI3WEB)
-# define THREAD_T PIThread *
-# define MUTEX_T PISync *
#elif defined(TSRM_ST)
# define THREAD_T st_thread_t
# define MUTEX_T st_mutex_t
-#elif defined(BETHREADS)
-# define THREAD_T thread_id
-typedef struct {
- sem_id sem;
- int32 ben;
-} beos_ben;
-# define MUTEX_T beos_ben *
#endif
#ifdef HAVE_SIGNAL_H
diff --git a/TSRM/threads.m4 b/TSRM/threads.m4
index 57b46f251a..efd8ee4e64 100644
--- a/TSRM/threads.m4
+++ b/TSRM/threads.m4
@@ -103,52 +103,47 @@ dnl -threads gcc (HP-UX)
dnl
AC_DEFUN([PTHREADS_CHECK],[
-if test "$beos_threads" = "1"; then
- pthreads_working="yes"
- ac_cv_pthreads_cflags=""
-else
- save_CFLAGS=$CFLAGS
- save_LIBS=$LIBS
- PTHREADS_ASSIGN_VARS
- PTHREADS_CHECK_COMPILE
- LIBS=$save_LIBS
- CFLAGS=$save_CFLAGS
+save_CFLAGS=$CFLAGS
+save_LIBS=$LIBS
+PTHREADS_ASSIGN_VARS
+PTHREADS_CHECK_COMPILE
+LIBS=$save_LIBS
+CFLAGS=$save_CFLAGS
- AC_CACHE_CHECK(for pthreads_cflags,ac_cv_pthreads_cflags,[
- ac_cv_pthreads_cflags=
- if test "$pthreads_working" != "yes"; then
- for flag in -kthread -pthread -pthreads -mthreads -Kthread -threads -mt -qthreaded; do
- ac_save=$CFLAGS
- CFLAGS="$CFLAGS $flag"
- PTHREADS_CHECK_COMPILE
- CFLAGS=$ac_save
- if test "$pthreads_checked" = "yes"; then
- ac_cv_pthreads_cflags=$flag
- break
- fi
- done
- fi
- ])
+AC_CACHE_CHECK(for pthreads_cflags,ac_cv_pthreads_cflags,[
+ac_cv_pthreads_cflags=
+if test "$pthreads_working" != "yes"; then
+ for flag in -kthread -pthread -pthreads -mthreads -Kthread -threads -mt -qthreaded; do
+ ac_save=$CFLAGS
+ CFLAGS="$CFLAGS $flag"
+ PTHREADS_CHECK_COMPILE
+ CFLAGS=$ac_save
+ if test "$pthreads_checked" = "yes"; then
+ ac_cv_pthreads_cflags=$flag
+ break
+ fi
+ done
+fi
+])
- AC_CACHE_CHECK(for pthreads_lib, ac_cv_pthreads_lib,[
- ac_cv_pthreads_lib=
- if test "$pthreads_working" != "yes"; then
- for lib in pthread pthreads c_r; do
- ac_save=$LIBS
- LIBS="$LIBS -l$lib"
- PTHREADS_CHECK_COMPILE
- LIBS=$ac_save
- if test "$pthreads_checked" = "yes"; then
- ac_cv_pthreads_lib=$lib
- break
- fi
- done
- fi
- ])
+AC_CACHE_CHECK(for pthreads_lib, ac_cv_pthreads_lib,[
+ac_cv_pthreads_lib=
+if test "$pthreads_working" != "yes"; then
+ for lib in pthread pthreads c_r; do
+ ac_save=$LIBS
+ LIBS="$LIBS -l$lib"
+ PTHREADS_CHECK_COMPILE
+ LIBS=$ac_save
+ if test "$pthreads_checked" = "yes"; then
+ ac_cv_pthreads_lib=$lib
+ break
+ fi
+ done
+fi
+])
- if test "x$ac_cv_pthreads_cflags" != "x" -o "x$ac_cv_pthreads_lib" != "x"; then
- pthreads_working="yes"
- fi
+if test "x$ac_cv_pthreads_cflags" != "x" -o "x$ac_cv_pthreads_lib" != "x"; then
+ pthreads_working="yes"
fi
if test "$pthreads_working" = "yes"; then
diff --git a/TSRM/tsrm.m4 b/TSRM/tsrm.m4
index 98aa2b8c91..ea9f9a0da1 100644
--- a/TSRM/tsrm.m4
+++ b/TSRM/tsrm.m4
@@ -77,19 +77,15 @@ sinclude(threads.m4)
AC_DEFUN([TSRM_CHECK_PTHREADS],[
PTHREADS_CHECK
+
+if test "$pthreads_working" != "yes"; then
+ AC_MSG_ERROR(Your system seems to lack POSIX threads.)
+fi
-if test "$beos_threads" = "1"; then
- AC_DEFINE(BETHREADS, 1, Whether to use native BeOS threads)
-else
- if test "$pthreads_working" != "yes"; then
- AC_MSG_ERROR(Your system seems to lack POSIX threads.)
- fi
-
- AC_DEFINE(PTHREADS, 1, Whether to use Pthreads)
+AC_DEFINE(PTHREADS, 1, Whether to use Pthreads)
- AC_MSG_CHECKING(for POSIX threads)
- AC_MSG_RESULT(yes)
-fi
+AC_MSG_CHECKING(for POSIX threads)
+AC_MSG_RESULT(yes)
])
AC_DEFUN([TSRM_THREADS_CHECKS],[
diff --git a/UPGRADING b/UPGRADING
index d8d887f569..f9d5916705 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -1,4 +1,4 @@
-PHP 7.2 UPGRADE NOTES
+PHP 7.3 UPGRADE NOTES
1. Backward Incompatible Changes
2. New Features
@@ -19,144 +19,29 @@ PHP 7.2 UPGRADE NOTES
1. Backward Incompatible Changes
========================================
-- Core:
- . gettype() will now return "resource (closed)" instead of "unknown type" for
- closed resources.
- . is_object() will now return true for objects of class
- __PHP_Incomplete_Class.
- . Support for Netware operating systems has been removed.
- . Casting arrays to objects (with (object) or settype()) will now convert
- integer keys to string property names. This fixes the behaviour of previous
- versions, where integer keys would become inaccessible properties with
- integer names.
- . Casting objects to arrays (with (array) or settype()), and retrieving
- object properties in an array with get_object_vars(), will now convert
- numeric string property names (that is, property names of the format
- /^(0|(-?[1-9][0-9]*))$/ where PHP_INT_MIN <= n <= PHP_INT_MAX) to integer
- keys. This fixes the behaviour of previous versions, where numeric string
- property names would become inaccessible string keys.
- . Unqualified references to undefined constants now generate a Warning instead
- of a notice. They will generate an Error in a future version of PHP.
- (https://wiki.php.net/rfc/deprecate-bareword-strings)
- . Minimum supported Windows versions are Windows 7/Server 2008 R2.
- . Initial trait property value compatibility check will no longer perform
- any casts. (Bug #74269)
- . "object" (in any case) can no longer be used as a class name.
+Core:
+ . The ext_skel utility has been completely redesigned with new options and
+ some old options removed. This is now written in PHP and has no external
+ dependencies.
+ . Support for BeOS has been dropped.
-- BCMath:
- . The bcmod() function no longer truncates fractional numbers to integers. As
- such, its behavior now follows fmod() rather than the `%` operator. For
- example `bcmod('4', '3.5')` now returns '0.5' instead of '1'.
+BCMath:
+ . All warnings thrown by BCMath functions are now using PHP's error handling.
+ Formerly some warnings have directly been written to stderr.
+ . bcmul() and bcpow() now return numbers with the requested scale. Formerly,
+ the returned numbers may have omitted trailing decimal zeroes.
-- Hash:
- . The hash_hmac(), hash_hmac_file(), hash_pbkdf2() and hash_init() (with
- HASH_HMAC) functions no longer accept non-cryptographic hashes.
-
-- JSON
- . The json_decode() option JSON_OBJECT_AS_ARRAY is used if the second
- parameter (assoc) is null. Previously JSON_OBJECT_AS_ARRAY was always
- ignored.
-
-- Session:
- . Removed register_globals related code and "!" can be used as $_SESSION key name.
- . Session is made to manage session status correctly and prevents invalid operations.
- Only inappropriate codes are affected by this change. If you have problems with this,
- it means you have problem in your code.
- . Functions are made to set or return correct session status.
- session_start(), session_status(), session_regenerate_id()
- . Functions are made to return bool from null. These functions have void parameter
- and void parameter is checked.
- session_unset(), session_write_close()/session_commit(), session_abort(),
- session_reset()
- . Functions prohibit invalid operations with regard to session status and
- HTTP header status, returns correct bool return value.
- session_start(), session_set_cookie_params(), session_name(), session_module_name(),
- session_set_save_handler(), session_regenerate_id(), session_cache_limiter(),
- session_cache_expire(), session_unset(), session_destroy(),
- session_write_close()/session_commit(), session_reset()
- . INI value change by ini_set() returns update status correctly. Invalid INI modifications
- are checked and made to fail.
- session.name, session.save_path, session.cookie_lifetime, session.cookie_path,
- session.cookie_domain, session.cookie_httponly, session.cookie_secure,
- session.use_cookies, session.use_only_cookies, session.use_strict_mode,
- session.referer_check, session.cache_limiter, session.cache_expire,
- session.lazy_write, session.save_handler, session.serialize_handler,
- session.gc_probability, session.gc_divior, session.gc_maxlifetime,
- . Some E_ERRORs are changed to E_WARNING since session status is managed correctly.
- session_start()
- . Session no longer initialize $_SESSION for invalid and useless session.
- session_start()
- . When headers are already sent and try to set new INI values, session_name(),
- session_module_name(), session_save_path(), session_cache_limiter() and
- session_cache_expire() are no longer works. Older PHPs accepts new values even
- if new values will not be effective.
- This new corrected behavior may affect command line mode CLI scripts that manage
- sessions. Use output buffer just like web applications to resolve problems on
- CLI scripts.
-
-- Standard:
- . Sequences generated by mt_rand() and rand() for a specific seed may differ
- from PHP 7.1 on 64-bit machines. This change was necessary to resolve a
- modulo bias bug in the implementation.
+Standard:
+ . getimagesize() and related functions now report the mime type of BMP images
+ as image/bmp instead of image/x-ms-bmp, since the former has been registered
+ with the IANA (see RFC 7903).
========================================
2. New Features
========================================
-- Core:
- . It is now possible to remove argument type annotations when overriding an
- inherited method. This complies with contravariance of method argument types
- under the Liskov Substitution Principle.
- (https://wiki.php.net/rfc/parameter-no-type-variance)
- . It is now allowed to override an abstract method with another abstract
- method in a child class.
- (https://wiki.php.net/rfc/allow-abstract-function-override)
- . A trailing comma in group use statements is now allowed.
- (https://wiki.php.net/rfc/list-syntax-trailing-commas)
- . The "object" type annotation is now supported.
- (https://wiki.php.net/rfc/object-typehint)
-
-- DBA:
- . Implemented support for the LMDB backend.
-
-- JSON:
- . Added JSON_INVALID_UTF8_IGNORE and JSON_INVALID_UTF8_SUBSTITUTE options for
- json_encode() and json_decode() to ignore and replace invalid UTF-8 byte
- sequences, respectively.
-
-- OCI8:
- . Added Oracle Database Transparent Application Failover (TAF) callback support.
-
-- PCRE:
- . Added `J` modifier for setting PCRE_DUPNAMES.
- . Added `PREG_UNMATCHED_AS_NULL` flag to allow distinguish between unmatched
- subpatterns and empty matches by reporting NULL and "" (empty string),
- respectively.
-
-- Sodium
- . New cryptographic extension
-
-- SQLite3:
- . Implemented writing to BLOBs.
-
-- Standard:
- . Simplified password hashing API updated to support Argon2i hashes when PHP is compiled with libargon2
- (https://wiki.php.net/rfc/argon2_password_hash).
- . proc_nice() is now supported on Windows platforms.
-
-- Zip:
- . read/write encrypted archive, relying on libzip 1.2.0,
- using new methods:
- ZipArchive::setEncryptionName($name, $method [, $password]);
- ZipArchive::setEncryptionIndex($index, $method [, $password]);
- and new constants:
- ZipArchive::EM_NONE
- ZipArchive::EM_AES_128
- ZipArchive::EM_AES_192
- ZipArchive::EM_AES_256
- . accept 'password' from zip stream context
- . ZipArchive implements countable, added ZipArchive::count() method.
-
+BCMath:
+ . bcscale() can now also be used as getter to retrieve the current scale in use.
========================================
3. Changes in SAPI modules
@@ -166,107 +51,20 @@ PHP 7.2 UPGRADE NOTES
4. Deprecated Functionality
========================================
-All the deprecated functionality listed in the following will be removed in
-PHP 8.0.
-
-- Core:
- . The track_errors ini directive has been deprecated.
- . The __autoload() mechanism has been deprecated, use spl_autoload_register()
- instead.
- . The (unset) cast has been deprecated. This does not affect the unset($var)
- language construct.
- . The create_function() function has been deprecated, use anonymous functions
- instead.
- . The each() function has been deprecated, use a foreach loop instead.
- . The $errcontext error handler argument has been deprecated. However, using
- it does not trigger a deprecation warning for technical reasons.
-
-- EXIF:
- . The read_exif_data() alias has been deprecated, use exif_read_data() instead.
-
-- GD:
- . png2wbmp() and jpeg2wbmp() have been deprecated.
-
-- GMP:
- . The gmp_random() function has been deprecated, use gmp_random_bits() or
- gmp_random_range() instead.
-
-- Intl:
- . INTL_IDNA_VARIANT_2003 has been deprecated; use INTL_IDNA_VARIANT_UTS46
- instead.
-
-- Mbstring:
- . The mbstring.func_overload ini directive has been deprecated.
-
-- Standard:
- . Calling parse_str() without the result argument has been deprecated.
- . Calling assert() with a string argument has been deprecated, use an ordinary
- expression instead.
-
-See also: https://wiki.php.net/rfc/deprecations_php_7_2
-
========================================
5. Changed Functions
========================================
-- Standard:
- . password_hash() can generate Argon2i hashes when the algorithm is set to PASSWORD_ARGON2I.
- When using PASSWORD_ARGON2I, the following cost factors may be set: 'memory_cost', 'time_cost',
- and 'threads'. These cost factors will default to 'PASSWORD_ARGON2_DEFAULT_MEMORY_COST',
- 'PASSWORD_ARGON2_DEFAULT_TIME_COST', and 'PASSWORD_ARGON2_DEFAULT_THREADS' respectively if not set.
- . password_verify() can verify Argon2i hashes.
- . password_get_info() and password_needs_rehash() can accept Argon2i hashes.
- . mail()/mb_send_mail() accept array $extra_header. Array parameter is checked against RFC 2822.
- Array format is
- $extra_headers = [
- 'Header-Name' => 'Header value',
- 'Multiple' => ['One header', 'Another header'],
- 'Multiline' = "FirstLine\r\n SecondLine",
- ];
- . count() now raises a warning when an invalid parameter is passed.
- Only arrays and objects implementing the Countable interface should be passed.
- . pack() and unpack() now support float and double in both little and big endian.
- . number_format() ensures zero values never contain a negative sign.
-
-- XML:
- . utf8_encode() and utf8_decode() have been moved to the Standard extension
- as string functions.
+ . debug_zval_dump() was changed to display recursive arrays and objects
+ in the same way as var_dump(). Now, it doesn't display them twice.
========================================
6. New Functions
========================================
-- Core:
- . Added stream_isatty().
- . Added sapi_windows_vt100_support().
-
-- DOM:
- . DomNodeList implements Countable, added DomNodeList::count().
- . DOMNamedNodeMap implements Countable, added DOMNamedNodeMap::count().
-
-- FTP:
- . Added ftp_append().
-
-- GD:
- . Added imagesetclip() and imagegetclip().
- . Added imageopenpolygon().
- . Added imageresolution().
- . Added imagecreatefrombmp() and imagebmp().
-
-- Hash:
- . Added hash_hmac_algos().
-
-- Mbstring:
- . Added mb_chr() and mb_ord().
- . Added mb_scrub() that scrubs broken multibyte strings.
-
-- OCI8:
- . Added oci_register_taf_callback() and oci_disable_taf_callback() for
- Oracle Database TAF callback support.
-
-- Sockets:
- . Added socket_addrinfo_lookup(), socket_addrinfo_connect(),
- socket_addrinfo_bind() and socket_addrinfo_explain().
+Date:
+ . Added the DateTime::createFromImmutable() method, which mirrors
+ DateTimeImmutable::createFromMutable().
========================================
7. New Classes and Interfaces
@@ -276,98 +74,47 @@ See also: https://wiki.php.net/rfc/deprecations_php_7_2
8. Removed Extensions and SAPIs
========================================
-- Mcrypt:
- . The deprecated mcrypt extension has been moved to PECL.
- . libmcrypt has not been maintained since 2007 and the continued use of this
- extension is strongly discouraged.
- . Users are advised to use alternatives such as OpenSSL or libsodium.
-
========================================
9. Other Changes to Extensions
========================================
-- EXIF:
- . Added extended exif tag support for the following formats:
- Samsung, DJI, Panasonic, Sony, Pentax, Minolta, Sigma/Foveon,
- AGFA, Kyocera, Ricoh & Epson.
- . exif_read_data() and exif_thumbnail() now supports a passed streams as their
- first parameter.
-
-- GD:
- . Removed --enable-gd-native-ttf configuration option which was unused as
- of PHP 5.5.0 anyway.
- . imagegd() stores truecolor images as real truecolor images. Formerly, they
- have been converted to palette.
- . imageantialias() is now also available if compiled with a system libgd.
+ FTP:
+ . Set default transfer mode to binary
-- Mbstring
- . mb_check_encoding() accepts array parameter. Both key and value
- encodings are checked recursively.
- . mb_convert_encoding() accepts array parameter. Only value encodings
- are converted recursively.
+ ODBC:
+ . Support for ODBCRouter has been removed.
+ . Support for Birdstep has been removed.
-- PDO_OCI:
- . The '--with-pdo-oci' configure syntax no longer needs the vesion number of the
- Oracle Instant Client.
-
-- pdo_sqlite
- . Use sqlite3_prepare_v2() and sqlite3_close_v2() functions instead of their
- legacy counterparts.
+ ZIP:
+ . Bunled libzip has been dropped,
+ system library is now required.
========================================
10. New Global Constants
========================================
-- Core:
- . PHP_FLOAT_DIG number of decimal digits, that can be rounded into a
- float and back without precision loss
- . PHP_FLOAT_EPSILON smallest representable positive number x, so then
- x + 1.0 != 1.0
- . PHP_FLOAT_MIN min representable float number
- . PHP_FLOAT_MAX max representable float number
- . PHP_OS_FAMILY current operating system family
-
-- Fileinfo:
- . FILEINFO_EXTENSION include list of possible file extensions
-
-- GD:
- . IMG_EFFECT_MULTIPLY
- . IMG_BMP
-
-- PCRE
- . PREG_UNMATCHED_AS_NULL
-
-- Standard:
- . PASSWORD_ARGON2_DEFAULT_MEMORY_COST
- . PASSWORD_ARGON2_DEFAULT_TIME_COST
- . PASSWORD_ARGON2_DEFAULT_THREADS
- . PASSWORD_ARGON2I
+PGSQL:
+ . Requires Postgres 9.3
+ - PGSQL_DIAG_SCHEMA_NAME
+ - PGSQL_DIAG_TABLE_NAME
+ - PGSQL_DIAG_COLUMN_NAME
+ - PGSQL_DIAG_DATATYPE_NAME
+ - PGSQL_DIAG_CONSTRAINT_NAME
+ . Requires Postgres 9.6
+ - PGSQL_DIAG_SEVERITY_NONLOCALIZED
========================================
11. Changes to INI File Handling
========================================
-- sql.safe_mode
+- birdstep.max_links
. This INI directive has been removed.
-- realpath_cache_size
- . Set to 4096k by default
-
========================================
12. Windows Support
========================================
-- Support for VT100 console mode
-
- On systems starting with 10.0.10586, cmd.exe supports ANSI escape sequences.
- The corresponding console mode is enabled by default on CLI on suitable
- systems. As well, the function sapi_windows_vt100_support() is provided,
- to control and query the corresponding information in the scripts.
-
========================================
13. Other Changes
========================================
-- Build system
-
- Autoconf minimal version is now 2.64.
diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS
index 0772009bbe..ff56dfa655 100644
--- a/UPGRADING.INTERNALS
+++ b/UPGRADING.INTERNALS
@@ -9,6 +9,11 @@ PHP 7.2 INTERNALS UPGRADE NOTES
f. zend_arg_info.class_name removed
g. ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX changed
h. valid_symbol_table removed
+ i. array_init() and array_init_size()
+ j. Run-time constant operand addressing
+ k. Array/Object recursion protection
+ l. HASH_FLAG_PERSISTENT
+ m. AST and IS_CONSTANT
2. Build system changes
a. Unix build system changes
@@ -48,6 +53,52 @@ PHP 7.2 INTERNALS UPGRADE NOTES
h. valid_symbol_table is removed from executor_globals.
Use EG(active) instead of removed EG(valid_symbol_table)
+ i. array_init() and array_init_size() are not functions anymore.
+ They don't return any values.
+
+ j. In 64-bit builds PHP-7.2 and below used relative run-time constant operand
+ addressing. E.g. opline->op1.constant kept an offset from start of literals
+ table - op_array->literals. To speedup access op_array->literals was cached
+ in execute_data->literals. So the resulting address calculated as
+ EX(literals) + opline->op1.constant.
+
+ Now at run-time literals allocated close to opcodes, and addressed
+ relatively from current opline. This eliminates load of EX(literals) on
+ each constant access as well as EX(literals) initialization on each call.
+
+ As result some related macros were removed (ZEND_EX_USE_LITERALS,
+ EX_LOAD_LITERALS, EX_LITERALS, RT_CONSTANT_EX, EX_CONSTANT) or changed
+ (RT_CONSTANT, ZEND_PASS_TWO_UPDATE_CONSTANT, ZEND_PASS_TWO_UNDO_CONSTANT).
+ This change way affect only some "system" extensions. EX_LITERALS,
+ RT_CONSTANT_EX, EX_CONSTANT should be substituted by RT_CONSTANT than now
+ use "opline" (instead of "op_array") as first argument.
+
+ k. Protection from recursion during processing circular data structures was
+ refactored. HashTable.nApplyCount and IS_OBJ_APPLY_COUNT are replaced by
+ single flag GC_PROTECTED. Corresponding macros Z_OBJ_APPLY_COUNT,
+ Z_OBJ_INC_APPLY_COUNT, Z_OBJ_DEC_APPLY_COUNT, ZEND_HASH_GET_APPLY_COUNT,
+ ZEND_HASH_INC_APPLY_COUNT, ZEND_HASH_DEC_APPLY_COUNT are replaced with
+ GC_IS_RECURSIVE, GC_PROTECT_RECURSION, GC_UNPROTECT_RECURSION,
+ Z_IS_RECURSIVE, Z_PROTECT_RECURSION, Z_UNPROTECT_RECURSION.
+
+ HASH_FLAG_APPLY_PROTECTION flag and ZEND_HASH_APPLY_PROTECTION() macro
+ are removed. All mutable arrays should use recursion protection.
+ Corresponding checks should be replaced by Z_REFCOUNTED() or
+ !(GC_GLAGS(p) & GC_IMMUTABLE).
+
+ l. HASH_FLAG_PERSISTENT renamed into IS_ARRAY_PERSISTENT and moved into
+ GC_FLAGS (to be consistent with IS_STR_PERSISTENT).
+
+ m. zend_ast_ref structure is changed to use only one allocation.
+ zend_ast_copy() now returns zend_ast_ref (instead of zend_asr).
+ zend_ast_destroy_and_free() is removed. ZVAL_NEW_AST() is replaced
+ by ZVAL_AST().
+
+ IS_CONSTANT type and Z_CONST_FLAGS() are removed. Now constants are always
+ represented using IS_CONSTANT_AST (ZEND_AST_CONSTANT kind). AST node
+ attributes are used instead of constant flags. IS_TYPE_CONSTANT flag is
+ removed, but Z_CONSTANT() macro is kept for compatibility.
+
========================
2. Build system changes
========================
diff --git a/Zend/bench.php b/Zend/bench.php
index 5f771803cc..818ce5fbaf 100644
--- a/Zend/bench.php
+++ b/Zend/bench.php
@@ -418,5 +418,5 @@ sieve(30);
$t = end_test($t, "sieve(30)");
strcat(200000);
$t = end_test($t, "strcat(200000)");
-total($t0, "Total");
+total();
?>
diff --git a/Zend/tests/gc_032.phpt b/Zend/tests/gc_032.phpt
index cd30ed7cb6..90c30f7c16 100644
--- a/Zend/tests/gc_032.phpt
+++ b/Zend/tests/gc_032.phpt
@@ -7,35 +7,25 @@ zend.enable_gc=1
$a = array();
$b =& $a;
$a[0] = $a;
-debug_zval_dump($a);
+var_dump($a);
$a = array(array());
$b =& $a;
$a[0][0] = $a;
-debug_zval_dump($a);
+var_dump($a);
?>
---EXPECTF--
-array(1) refcount(%d){
+--EXPECT--
+array(1) {
[0]=>
- array(1) refcount(%d){
- [0]=>
- array(1) refcount(%d){
- [0]=>
- *RECURSION*
- }
+ array(0) {
}
}
-array(1) refcount(%d){
+array(1) {
[0]=>
- array(1) refcount(%d){
+ array(1) {
[0]=>
- array(1) refcount(%d){
+ array(1) {
[0]=>
- array(1) refcount(%d){
- [0]=>
- array(1) refcount(%d){
- [0]=>
- *RECURSION*
- }
+ array(0) {
}
}
}
diff --git a/Zend/zend.c b/Zend/zend.c
index d7e00e46b2..2621851941 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -75,7 +75,7 @@ ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint3
void (*zend_printf_to_smart_string)(smart_string *buf, const char *format, va_list ap);
void (*zend_printf_to_smart_str)(smart_str *buf, const char *format, va_list ap);
ZEND_API char *(*zend_getenv)(char *name, size_t name_len);
-ZEND_API zend_string *(*zend_resolve_path)(const char *filename, int filename_len);
+ZEND_API zend_string *(*zend_resolve_path)(const char *filename, size_t filename_len);
void (*zend_on_timeout)(int seconds);
@@ -130,7 +130,7 @@ static ZEND_INI_MH(OnUpdateAssertions) /* {{{ */
p = (zend_long *) (base+(size_t) mh_arg1);
- val = zend_atol(ZSTR_VAL(new_value), (int)ZSTR_LEN(new_value));
+ val = zend_atol(ZSTR_VAL(new_value), ZSTR_LEN(new_value));
if (stage != ZEND_INI_STAGE_STARTUP &&
stage != ZEND_INI_STAGE_SHUTDOWN &&
@@ -334,16 +334,17 @@ ZEND_API void zend_print_flat_zval_r(zval *expr) /* {{{ */
switch (Z_TYPE_P(expr)) {
case IS_ARRAY:
ZEND_PUTS("Array (");
- if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(expr)) &&
- ++Z_ARRVAL_P(expr)->u.v.nApplyCount>1) {
- ZEND_PUTS(" *RECURSION*");
- Z_ARRVAL_P(expr)->u.v.nApplyCount--;
- return;
+ if (Z_REFCOUNTED_P(expr)) {
+ if (Z_IS_RECURSIVE_P(expr)) {
+ ZEND_PUTS(" *RECURSION*");
+ return;
+ }
+ Z_PROTECT_RECURSION_P(expr);
}
print_flat_hash(Z_ARRVAL_P(expr));
ZEND_PUTS(")");
- if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(expr))) {
- Z_ARRVAL_P(expr)->u.v.nApplyCount--;
+ if (Z_REFCOUNTED_P(expr)) {
+ Z_UNPROTECT_RECURSION_P(expr);
}
break;
case IS_OBJECT:
@@ -353,7 +354,7 @@ ZEND_API void zend_print_flat_zval_r(zval *expr) /* {{{ */
zend_printf("%s Object (", ZSTR_VAL(class_name));
zend_string_release(class_name);
- if (Z_OBJ_APPLY_COUNT_P(expr) > 0) {
+ if (Z_IS_RECURSIVE_P(expr)) {
ZEND_PUTS(" *RECURSION*");
return;
}
@@ -362,9 +363,9 @@ ZEND_API void zend_print_flat_zval_r(zval *expr) /* {{{ */
properties = Z_OBJPROP_P(expr);
}
if (properties) {
- Z_OBJ_INC_APPLY_COUNT_P(expr);
+ Z_PROTECT_RECURSION_P(expr);
print_flat_hash(properties);
- Z_OBJ_DEC_APPLY_COUNT_P(expr);
+ Z_UNPROTECT_RECURSION_P(expr);
}
ZEND_PUTS(")");
break;
@@ -384,15 +385,16 @@ static void zend_print_zval_r_to_buf(smart_str *buf, zval *expr, int indent) /*
switch (Z_TYPE_P(expr)) {
case IS_ARRAY:
smart_str_appends(buf, "Array\n");
- if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(expr)) &&
- ++Z_ARRVAL_P(expr)->u.v.nApplyCount>1) {
- smart_str_appends(buf, " *RECURSION*");
- Z_ARRVAL_P(expr)->u.v.nApplyCount--;
- return;
+ if (Z_REFCOUNTED_P(expr)) {
+ if (Z_IS_RECURSIVE_P(expr)) {
+ smart_str_appends(buf, " *RECURSION*");
+ return;
+ }
+ Z_PROTECT_RECURSION_P(expr);
}
print_hash(buf, Z_ARRVAL_P(expr), indent, 0);
- if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(expr))) {
- Z_ARRVAL_P(expr)->u.v.nApplyCount--;
+ if (Z_REFCOUNTED_P(expr)) {
+ Z_UNPROTECT_RECURSION_P(expr);
}
break;
case IS_OBJECT:
@@ -405,7 +407,7 @@ static void zend_print_zval_r_to_buf(smart_str *buf, zval *expr, int indent) /*
zend_string_release(class_name);
smart_str_appends(buf, " Object\n");
- if (Z_OBJ_APPLY_COUNT_P(expr) > 0) {
+ if (Z_IS_RECURSIVE_P(expr)) {
smart_str_appends(buf, " *RECURSION*");
return;
}
@@ -413,9 +415,9 @@ static void zend_print_zval_r_to_buf(smart_str *buf, zval *expr, int indent) /*
break;
}
- Z_OBJ_INC_APPLY_COUNT_P(expr);
+ Z_PROTECT_RECURSION_P(expr);
print_hash(buf, properties, indent, 1);
- Z_OBJ_DEC_APPLY_COUNT_P(expr);
+ Z_UNPROTECT_RECURSION_P(expr);
if (is_temp) {
zend_hash_destroy(properties);
diff --git a/Zend/zend.h b/Zend/zend.h
index 502eae760d..8ec3ec2c04 100644
--- a/Zend/zend.h
+++ b/Zend/zend.h
@@ -22,7 +22,7 @@
#ifndef ZEND_H
#define ZEND_H
-#define ZEND_VERSION "3.2.0-dev"
+#define ZEND_VERSION "3.3.0-dev"
#define ZEND_ENGINE_3
@@ -189,7 +189,7 @@ typedef struct _zend_utility_functions {
void (*printf_to_smart_string_function)(smart_string *buf, const char *format, va_list ap);
void (*printf_to_smart_str_function)(smart_str *buf, const char *format, va_list ap);
char *(*getenv_function)(char *name, size_t name_len);
- zend_string *(*resolve_path_function)(const char *filename, int filename_len);
+ zend_string *(*resolve_path_function)(const char *filename, size_t filename_len);
} zend_utility_functions;
typedef struct _zend_utility_values {
@@ -269,7 +269,7 @@ extern ZEND_API int (*zend_stream_open_function)(const char *filename, zend_file
extern void (*zend_printf_to_smart_string)(smart_string *buf, const char *format, va_list ap);
extern void (*zend_printf_to_smart_str)(smart_str *buf, const char *format, va_list ap);
extern ZEND_API char *(*zend_getenv)(char *name, size_t name_len);
-extern ZEND_API zend_string *(*zend_resolve_path)(const char *filename, int filename_len);
+extern ZEND_API zend_string *(*zend_resolve_path)(const char *filename, size_t filename_len);
ZEND_API ZEND_COLD void zend_error(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 6ec350ebf2..b9467da710 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -1084,15 +1084,6 @@ ZEND_API int zend_parse_method_parameters_ex(int flags, int num_args, zval *this
}
/* }}} */
-/* Argument parsing API -- andrei */
-ZEND_API int _array_init(zval *arg, uint32_t size ZEND_FILE_LINE_DC) /* {{{ */
-{
- ZVAL_NEW_ARR(arg);
- _zend_hash_init(Z_ARRVAL_P(arg), size, ZVAL_PTR_DTOR, 0 ZEND_FILE_LINE_RELAY_CC);
- return SUCCESS;
-}
-/* }}} */
-
/* This function should be called after the constructor has been called
* because it may call __set from the uninitialized object otherwise. */
ZEND_API void zend_merge_properties(zval *obj, HashTable *properties) /* {{{ */
@@ -1159,7 +1150,7 @@ ZEND_API int zend_update_class_constants(zend_class_entry *class_type) /* {{{ */
ZEND_HASH_FOREACH_PTR(&class_type->constants_table, c) {
val = &c->value;
- if (Z_CONSTANT_P(val)) {
+ if (Z_TYPE_P(val) == IS_CONSTANT_AST) {
if (UNEXPECTED(zval_update_constant_ex(val, c->ce) != SUCCESS)) {
return FAILURE;
}
@@ -1176,7 +1167,7 @@ ZEND_API int zend_update_class_constants(zend_class_entry *class_type) /* {{{ */
val = (zval*)((char*)class_type->default_properties_table + prop_info->offset - OBJ_PROP_TO_OFFSET(0));
}
ZVAL_DEREF(val);
- if (Z_CONSTANT_P(val)) {
+ if (Z_TYPE_P(val) == IS_CONSTANT_AST) {
if (UNEXPECTED(zval_update_constant_ex(val, ce) != SUCCESS)) {
return FAILURE;
}
@@ -3694,12 +3685,12 @@ ZEND_API int zend_declare_property_ex(zend_class_entry *ce, zend_string *name, z
if (ce->type == ZEND_INTERNAL_CLASS) {
property_info = pemalloc(sizeof(zend_property_info), 1);
- if ((access_type & ZEND_ACC_STATIC) || Z_CONSTANT_P(property)) {
+ if ((access_type & ZEND_ACC_STATIC) || Z_TYPE_P(property) == IS_CONSTANT_AST) {
ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED;
}
} else {
property_info = zend_arena_alloc(&CG(arena), sizeof(zend_property_info));
- if (Z_CONSTANT_P(property)) {
+ if (Z_TYPE_P(property) == IS_CONSTANT_AST) {
ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED;
}
}
@@ -3855,7 +3846,7 @@ ZEND_API int zend_declare_class_constant_ex(zend_class_entry *ce, zend_string *n
Z_ACCESS_FLAGS(c->value) = access_type;
c->doc_comment = doc_comment;
c->ce = ce;
- if (Z_CONSTANT_P(value)) {
+ if (Z_TYPE_P(value) == IS_CONSTANT_AST) {
ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED;
}
diff --git a/Zend/zend_API.h b/Zend/zend_API.h
index 865f5dd291..c3220d2685 100644
--- a/Zend/zend_API.h
+++ b/Zend/zend_API.h
@@ -390,12 +390,11 @@ ZEND_API char *zend_get_type_by_const(int type);
#define DLEXPORT
#endif
-#define array_init(arg) _array_init((arg), 0 ZEND_FILE_LINE_CC)
-#define array_init_size(arg, size) _array_init((arg), (size) ZEND_FILE_LINE_CC)
+#define array_init(arg) ZVAL_ARR((arg), zend_new_array(0))
+#define array_init_size(arg, size) ZVAL_ARR((arg), zend_new_array(size))
#define object_init(arg) _object_init((arg) ZEND_FILE_LINE_CC)
#define object_init_ex(arg, ce) _object_init_ex((arg), (ce) ZEND_FILE_LINE_CC)
#define object_and_properties_init(arg, ce, properties) _object_and_properties_init((arg), (ce), (properties) ZEND_FILE_LINE_CC)
-ZEND_API int _array_init(zval *arg, uint32_t size ZEND_FILE_LINE_DC);
ZEND_API int _object_init(zval *arg ZEND_FILE_LINE_DC);
ZEND_API int _object_init_ex(zval *arg, zend_class_entry *ce ZEND_FILE_LINE_DC);
ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *ce, HashTable *properties ZEND_FILE_LINE_DC);
@@ -762,6 +761,10 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(zend_bool throw_
#define ZEND_PARSE_PARAMETERS_START(min_num_args, max_num_args) \
ZEND_PARSE_PARAMETERS_START_EX(0, min_num_args, max_num_args)
+#define ZEND_PARSE_PARAMETERS_NONE() \
+ ZEND_PARSE_PARAMETERS_START(0, 0) \
+ ZEND_PARSE_PARAMETERS_END()
+
#define ZEND_PARSE_PARAMETERS_END_EX(failure) \
} while (0); \
if (UNEXPECTED(error_code != ZPP_ERROR_OK)) { \
@@ -828,7 +831,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(zend_bool throw_
#define Z_PARAM_ARRAY_OR_OBJECT_EX(dest, check_null, separate) \
Z_PARAM_ARRAY_OR_OBJECT_EX2(dest, check_null, separate, separate)
-#define Z_PARAM_ARRAY_OR_OBJECT(dest, check_null, separate) \
+#define Z_PARAM_ARRAY_OR_OBJECT(dest) \
Z_PARAM_ARRAY_OR_OBJECT_EX(dest, 0, 0)
/* old "b" */
diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c
index 772ba04e63..96bedb7b42 100644
--- a/Zend/zend_ast.c
+++ b/Zend/zend_ast.c
@@ -25,6 +25,7 @@
#include "zend_language_parser.h"
#include "zend_smart_str.h"
#include "zend_exceptions.h"
+#include "zend_constants.h"
ZEND_API zend_ast_process_t zend_ast_process = NULL;
@@ -72,6 +73,17 @@ ZEND_API zend_ast *zend_ast_create_zval_ex(zval *zv, zend_ast_attr attr) {
return zend_ast_create_zval_with_lineno(zv, attr, CG(zend_lineno));
}
+ZEND_API zend_ast *zend_ast_create_constant(zend_string *name, zend_ast_attr attr) {
+ zend_ast_zval *ast;
+
+ ast = zend_ast_alloc(sizeof(zend_ast_zval));
+ ast->kind = ZEND_AST_CONSTANT;
+ ast->attr = attr;
+ ZVAL_STR(&ast->val, name);
+ ast->val.u2.lineno = CG(zend_lineno);
+ return (zend_ast *) ast;
+}
+
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 *child3
@@ -276,25 +288,30 @@ ZEND_API int zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *sc
{
zval *zv = zend_ast_get_zval(ast);
- if (Z_OPT_CONSTANT_P(zv)) {
- if (Z_TYPE_FLAGS_P(zv) & IS_TYPE_REFCOUNTED) {
- if (UNEXPECTED(zval_update_constant_ex(zv, scope) != SUCCESS)) {
- ret = FAILURE;
- break;
- }
- ZVAL_COPY(result, zv);
- } else {
- ZVAL_COPY_VALUE(result, zv);
- if (UNEXPECTED(zval_update_constant_ex(result, scope) != SUCCESS)) {
- ret = FAILURE;
- break;
- }
- }
- } else {
- ZVAL_COPY(result, zv);
+ ZVAL_COPY(result, zv);
+ break;
+ }
+ case ZEND_AST_CONSTANT:
+ {
+ zend_string *name = zend_ast_get_constant_name(ast);
+ zval *zv = zend_get_constant_ex(name, scope, ast->attr);
+
+ if (UNEXPECTED(zv == NULL)) {
+ ZVAL_UNDEF(result);
+ ret = zend_use_undefined_constant(name, ast->attr, result);
+ break;
}
+ ZVAL_DUP(result, zv);
break;
}
+ case ZEND_AST_CONSTANT_CLASS:
+ ZEND_ASSERT(EG(current_execute_data));
+ if (scope && scope->name) {
+ ZVAL_STR_COPY(result, scope->name);
+ } else {
+ ZVAL_EMPTY_STRING(result);
+ }
+ break;
case ZEND_AST_AND:
if (UNEXPECTED(zend_ast_evaluate(&op1, ast->child[0], scope) != SUCCESS)) {
ret = FAILURE;
@@ -451,40 +468,98 @@ ZEND_API int zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *sc
return ret;
}
-ZEND_API zend_ast *zend_ast_copy(zend_ast *ast)
+static size_t zend_ast_tree_size(zend_ast *ast)
{
- if (ast == NULL) {
- return NULL;
- } else if (ast->kind == ZEND_AST_ZVAL) {
- zend_ast_zval *new = emalloc(sizeof(zend_ast_zval));
+ size_t size;
+
+ if (ast->kind == ZEND_AST_ZVAL || ast->kind == ZEND_AST_CONSTANT) {
+ size = sizeof(zend_ast_zval);
+ } else if (zend_ast_is_list(ast)) {
+ uint32_t i;
+ zend_ast_list *list = zend_ast_get_list(ast);
+
+ size = zend_ast_list_size(list->children);
+ for (i = 0; i < list->children; i++) {
+ if (list->child[i]) {
+ size += zend_ast_tree_size(list->child[i]);
+ }
+ }
+ } else {
+ uint32_t i, children = zend_ast_get_num_children(ast);
+
+ size = zend_ast_size(children);
+ for (i = 0; i < children; i++) {
+ if (ast->child[i]) {
+ size += zend_ast_tree_size(ast->child[i]);
+ }
+ }
+ }
+ return size;
+}
+
+static void* zend_ast_tree_copy(zend_ast *ast, void *buf)
+{
+ if (ast->kind == ZEND_AST_ZVAL) {
+ zend_ast_zval *new = (zend_ast_zval*)buf;
new->kind = ZEND_AST_ZVAL;
new->attr = ast->attr;
ZVAL_COPY(&new->val, zend_ast_get_zval(ast));
- return (zend_ast *) new;
+ buf = (void*)((char*)buf + sizeof(zend_ast_zval));
+ } else if (ast->kind == ZEND_AST_CONSTANT) {
+ zend_ast_zval *new = (zend_ast_zval*)buf;
+ new->kind = ZEND_AST_CONSTANT;
+ new->attr = ast->attr;
+ ZVAL_STR_COPY(&new->val, zend_ast_get_constant_name(ast));
+ buf = (void*)((char*)buf + sizeof(zend_ast_zval));
} else if (zend_ast_is_list(ast)) {
zend_ast_list *list = zend_ast_get_list(ast);
- zend_ast_list *new = emalloc(zend_ast_list_size(list->children));
+ zend_ast_list *new = (zend_ast_list*)buf;
uint32_t i;
new->kind = list->kind;
new->attr = list->attr;
new->children = list->children;
+ buf = (void*)((char*)buf + zend_ast_list_size(list->children));
for (i = 0; i < list->children; i++) {
- new->child[i] = zend_ast_copy(list->child[i]);
+ if (list->child[i]) {
+ new->child[i] = (zend_ast*)buf;
+ buf = zend_ast_tree_copy(list->child[i], buf);
+ } else {
+ new->child[i] = NULL;
+ }
}
- return (zend_ast *) new;
} else {
uint32_t i, children = zend_ast_get_num_children(ast);
- zend_ast *new = emalloc(zend_ast_size(children));
+ zend_ast *new = (zend_ast*)buf;
new->kind = ast->kind;
new->attr = ast->attr;
+ buf = (void*)((char*)buf + zend_ast_size(children));
for (i = 0; i < children; i++) {
- new->child[i] = zend_ast_copy(ast->child[i]);
+ if (ast->child[i]) {
+ new->child[i] = (zend_ast*)buf;
+ buf = zend_ast_tree_copy(ast->child[i], buf);
+ } else {
+ new->child[i] = NULL;
+ }
}
- return new;
}
+ return buf;
}
-static void zend_ast_destroy_ex(zend_ast *ast, zend_bool free) {
+ZEND_API zend_ast_ref *zend_ast_copy(zend_ast *ast)
+{
+ size_t tree_size;
+ zend_ast_ref *ref;
+
+ ZEND_ASSERT(ast != NULL);
+ tree_size = zend_ast_tree_size(ast) + sizeof(zend_ast_ref);
+ ref = emalloc(tree_size);
+ zend_ast_tree_copy(ast, GC_AST(ref));
+ GC_REFCOUNT(ref) = 1;
+ GC_TYPE_INFO(ref) = IS_CONSTANT_AST;
+ return ref;
+}
+
+ZEND_API void zend_ast_destroy(zend_ast *ast) {
if (!ast) {
return;
}
@@ -496,6 +571,9 @@ static void zend_ast_destroy_ex(zend_ast *ast, zend_bool free) {
* become invalid. GC would cause such a reference in the root buffer. */
zval_ptr_dtor_nogc(zend_ast_get_zval(ast));
break;
+ case ZEND_AST_CONSTANT:
+ zend_string_release(zend_ast_get_constant_name(ast));
+ break;
case ZEND_AST_FUNC_DECL:
case ZEND_AST_CLOSURE:
case ZEND_AST_METHOD:
@@ -508,10 +586,10 @@ static void zend_ast_destroy_ex(zend_ast *ast, zend_bool free) {
if (decl->doc_comment) {
zend_string_release(decl->doc_comment);
}
- zend_ast_destroy_ex(decl->child[0], free);
- zend_ast_destroy_ex(decl->child[1], free);
- zend_ast_destroy_ex(decl->child[2], free);
- zend_ast_destroy_ex(decl->child[3], free);
+ zend_ast_destroy(decl->child[0]);
+ zend_ast_destroy(decl->child[1]);
+ zend_ast_destroy(decl->child[2]);
+ zend_ast_destroy(decl->child[3]);
break;
}
default:
@@ -519,26 +597,15 @@ static void zend_ast_destroy_ex(zend_ast *ast, zend_bool free) {
zend_ast_list *list = zend_ast_get_list(ast);
uint32_t i;
for (i = 0; i < list->children; i++) {
- zend_ast_destroy_ex(list->child[i], free);
+ zend_ast_destroy(list->child[i]);
}
} else {
uint32_t i, children = zend_ast_get_num_children(ast);
for (i = 0; i < children; i++) {
- zend_ast_destroy_ex(ast->child[i], free);
+ zend_ast_destroy(ast->child[i]);
}
}
}
-
- if (free) {
- efree(ast);
- }
-}
-
-ZEND_API void zend_ast_destroy(zend_ast *ast) {
- zend_ast_destroy_ex(ast, 0);
-}
-ZEND_API void zend_ast_destroy_and_free(zend_ast *ast) {
- zend_ast_destroy_ex(ast, 1);
}
ZEND_API void zend_ast_apply(zend_ast *ast, zend_ast_apply_func fn) {
@@ -955,9 +1022,6 @@ static void zend_ast_export_zval(smart_str *str, zval *zv, int priority, int ind
} ZEND_HASH_FOREACH_END();
smart_str_appendc(str, ']');
break;
- case IS_CONSTANT:
- smart_str_appendl(str, Z_STRVAL_P(zv), Z_STRLEN_P(zv));
- break;
case IS_CONSTANT_AST:
zend_ast_export_ex(str, Z_ASTVAL_P(zv), priority, indent);
break;
@@ -1037,6 +1101,14 @@ tail_call:
case ZEND_AST_ZVAL:
zend_ast_export_zval(str, zend_ast_get_zval(ast), priority, indent);
break;
+ case ZEND_AST_CONSTANT: {
+ zend_string *name = zend_ast_get_constant_name(ast);
+ smart_str_appendl(str, ZSTR_VAL(name), ZSTR_LEN(name));
+ break;
+ }
+ case ZEND_AST_CONSTANT_CLASS:
+ smart_str_appendl(str, "__CLASS__", sizeof("__CLASS__")-1);
+ break;
case ZEND_AST_ZNODE:
/* This AST kind is only used for temporary nodes during compilation */
ZEND_ASSERT(0);
diff --git a/Zend/zend_ast.h b/Zend/zend_ast.h
index a0aff31d70..99ad920ad6 100644
--- a/Zend/zend_ast.h
+++ b/Zend/zend_ast.h
@@ -32,6 +32,7 @@
enum _zend_ast_kind {
/* special nodes */
ZEND_AST_ZVAL = 1 << ZEND_AST_SPECIAL_SHIFT,
+ ZEND_AST_CONSTANT,
ZEND_AST_ZNODE,
/* declaration nodes */
@@ -61,6 +62,7 @@ enum _zend_ast_kind {
/* 0 child nodes */
ZEND_AST_MAGIC_CONST = 0 << ZEND_AST_NUM_CHILDREN_SHIFT,
ZEND_AST_TYPE,
+ ZEND_AST_CONSTANT_CLASS,
/* 1 child node */
ZEND_AST_VAR = 1 << ZEND_AST_NUM_CHILDREN_SHIFT,
@@ -192,6 +194,8 @@ extern ZEND_API zend_ast_process_t zend_ast_process;
ZEND_API zend_ast *zend_ast_create_zval_with_lineno(zval *zv, zend_ast_attr attr, uint32_t lineno);
ZEND_API zend_ast *zend_ast_create_zval_ex(zval *zv, zend_ast_attr attr);
+ZEND_API zend_ast *zend_ast_create_constant(zend_string *name, zend_ast_attr attr);
+
ZEND_API zend_ast *zend_ast_create_ex(zend_ast_kind kind, zend_ast_attr attr, ...);
ZEND_API zend_ast *zend_ast_create(zend_ast_kind kind, ...);
@@ -206,9 +210,8 @@ ZEND_API zend_ast *zend_ast_list_add(zend_ast *list, zend_ast *op);
ZEND_API int zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *scope);
ZEND_API zend_string *zend_ast_export(const char *prefix, zend_ast *ast, const char *suffix);
-ZEND_API zend_ast *zend_ast_copy(zend_ast *ast);
+ZEND_API zend_ast_ref *zend_ast_copy(zend_ast *ast);
ZEND_API void zend_ast_destroy(zend_ast *ast);
-ZEND_API void zend_ast_destroy_and_free(zend_ast *ast);
typedef void (*zend_ast_apply_func)(zend_ast **ast_ptr);
ZEND_API void zend_ast_apply(zend_ast *ast, zend_ast_apply_func fn);
@@ -231,6 +234,12 @@ static zend_always_inline zend_string *zend_ast_get_str(zend_ast *ast) {
return Z_STR_P(zv);
}
+static zend_always_inline zend_string *zend_ast_get_constant_name(zend_ast *ast) {
+ ZEND_ASSERT(ast->kind == ZEND_AST_CONSTANT);
+ ZEND_ASSERT(Z_TYPE(((zend_ast_zval *) ast)->val) == IS_STRING);
+ return Z_STR(((zend_ast_zval *) ast)->val);
+}
+
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;
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index d0f0b7cf69..5793ea3308 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -727,13 +727,13 @@ static int validate_constant_array(HashTable *ht) /* {{{ */
int ret = 1;
zval *val;
- ht->u.v.nApplyCount++;
+ GC_PROTECT_RECURSION(ht);
ZEND_HASH_FOREACH_VAL_IND(ht, val) {
ZVAL_DEREF(val);
if (Z_REFCOUNTED_P(val)) {
if (Z_TYPE_P(val) == IS_ARRAY) {
if (Z_REFCOUNTED_P(val)) {
- if (Z_ARRVAL_P(val)->u.v.nApplyCount > 0) {
+ if (Z_IS_RECURSIVE_P(val)) {
zend_error(E_WARNING, "Constants cannot be recursive arrays");
ret = 0;
break;
@@ -749,7 +749,7 @@ static int validate_constant_array(HashTable *ht) /* {{{ */
}
}
} ZEND_HASH_FOREACH_END();
- ht->u.v.nApplyCount--;
+ GC_UNPROTECT_RECURSION(ht);
return ret;
}
/* }}} */
@@ -1071,7 +1071,7 @@ static void add_class_vars(zend_class_entry *scope, zend_class_entry *ce, int st
/* this is necessary to make it able to work with default array
* properties, returned to user */
- if (Z_OPT_CONSTANT_P(prop)) {
+ if (Z_OPT_TYPE_P(prop) == IS_CONSTANT_AST) {
if (UNEXPECTED(zval_update_constant_ex(prop, NULL) != SUCCESS)) {
return;
}
@@ -1137,7 +1137,7 @@ ZEND_FUNCTION(get_object_vars)
zobj = Z_OBJ_P(obj);
- if (!zobj->ce->default_properties_count && properties == zobj->properties && !ZEND_HASH_GET_APPLY_COUNT(properties)) {
+ if (!zobj->ce->default_properties_count && properties == zobj->properties && !GC_IS_RECURSIVE(properties)) {
/* fast copy */
if (EXPECTED(zobj->handlers == &std_object_handlers)) {
RETURN_ARR(zend_proptable_to_symtable(properties, 0));
diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c
index 1a1eb7349d..eacd06ac4a 100644
--- a/Zend/zend_closures.c
+++ b/Zend/zend_closures.c
@@ -504,8 +504,7 @@ static HashTable *zend_closure_get_debug_info(zval *object, int *is_temp) /* {{{
*is_temp = 1;
- ALLOC_HASHTABLE(debug_info);
- zend_hash_init(debug_info, 8, NULL, ZVAL_PTR_DTOR, 0);
+ debug_info = zend_new_array(8);
if (closure->func.type == ZEND_USER_FUNCTION && closure->func.op_array.static_variables) {
HashTable *static_variables = closure->func.op_array.static_variables;
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 0772bc4f1e..5e85a26957 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -460,7 +460,7 @@ void zend_del_literal(zend_op_array *op_array, int n) /* {{{ */
/* Common part of zend_add_literal and zend_append_individual_literal */
static inline void zend_insert_literal(zend_op_array *op_array, zval *zv, int literal_position) /* {{{ */
{
- if (Z_TYPE_P(zv) == IS_STRING || Z_TYPE_P(zv) == IS_CONSTANT) {
+ if (Z_TYPE_P(zv) == IS_STRING) {
zend_string_hash_val(Z_STR_P(zv));
Z_STR_P(zv) = zend_new_interned_string(Z_STR_P(zv));
if (ZSTR_IS_INTERNED(Z_STR_P(zv))) {
@@ -1082,7 +1082,7 @@ ZEND_API int do_bind_function(const zend_op_array *op_array, const zend_op *opli
lcname = CT_CONSTANT_EX(op_array, opline->op1.constant);
rtd_key = lcname + 1;
} else {
- lcname = RT_CONSTANT(op_array, opline->op1);
+ lcname = RT_CONSTANT(opline, opline->op1);
rtd_key = lcname + 1;
}
@@ -1123,7 +1123,7 @@ ZEND_API zend_class_entry *do_bind_class(const zend_op_array* op_array, const ze
lcname = CT_CONSTANT_EX(op_array, opline->op1.constant);
rtd_key = lcname + 1;
} else {
- lcname = RT_CONSTANT(op_array, opline->op1);
+ lcname = RT_CONSTANT(opline, opline->op1);
rtd_key = lcname + 1;
}
ce = zend_hash_find_ptr(class_table, Z_STR_P(rtd_key));
@@ -1158,7 +1158,7 @@ ZEND_API zend_class_entry *do_bind_inherited_class(const zend_op_array *op_array
lcname = CT_CONSTANT_EX(op_array, opline->op1.constant);
rtd_key = lcname + 1;
} else {
- lcname = RT_CONSTANT(op_array, opline->op1);
+ lcname = RT_CONSTANT(opline, opline->op1);
rtd_key = lcname + 1;
}
@@ -1304,7 +1304,8 @@ ZEND_API void zend_do_delayed_early_binding(const zend_op_array *op_array) /* {{
CG(in_compilation) = 1;
while (opline_num != (uint32_t)-1) {
- zval *parent_name = RT_CONSTANT(op_array, op_array->opcodes[opline_num-1].op2);
+ const zend_op *opline = &op_array->opcodes[opline_num-1];
+ zval *parent_name = RT_CONSTANT(opline, opline->op2);
if ((ce = zend_lookup_class_ex(Z_STR_P(parent_name), parent_name + 1, 0)) != NULL) {
do_bind_inherited_class(op_array, &op_array->opcodes[opline_num], EG(class_table), ce, 0);
}
@@ -2999,7 +3000,13 @@ void zend_compile_assign(znode *result, zend_ast *ast) /* {{{ */
if (zend_is_assign_to_self(var_ast, expr_ast)
&& !is_this_fetch(expr_ast)) {
/* $a[0] = $a should evaluate the right $a first */
- zend_compile_simple_var_no_cv(&expr_node, expr_ast, BP_VAR_R, 0);
+ znode cv_node;
+
+ if (zend_try_compile_cv(&cv_node, expr_ast) == FAILURE) {
+ zend_compile_simple_var_no_cv(&expr_node, expr_ast, BP_VAR_R, 0);
+ } else {
+ zend_emit_op(&expr_node, ZEND_QM_ASSIGN, &cv_node, NULL);
+ }
} else {
zend_compile_expr(&expr_node, expr_ast);
}
@@ -3022,7 +3029,13 @@ void zend_compile_assign(znode *result, zend_ast *ast) /* {{{ */
case ZEND_AST_ARRAY:
if (zend_list_has_assign_to_self(var_ast, expr_ast)) {
/* list($a, $b) = $a should evaluate the right $a first */
- zend_compile_simple_var_no_cv(&expr_node, expr_ast, BP_VAR_R, 0);
+ znode cv_node;
+
+ if (zend_try_compile_cv(&cv_node, expr_ast) == FAILURE) {
+ zend_compile_simple_var_no_cv(&expr_node, expr_ast, BP_VAR_R, 0);
+ } else {
+ zend_emit_op(&expr_node, ZEND_QM_ASSIGN, &cv_node, NULL);
+ }
} else {
zend_compile_expr(&expr_node, expr_ast);
}
@@ -3711,9 +3724,8 @@ static int zend_compile_func_in_array(znode *result, zend_ast_list *args) /* {{{
zend_bool ok = 1;
zval *val, tmp;
HashTable *src = Z_ARRVAL(array.u.constant);
- HashTable *dst = emalloc(sizeof(HashTable));
+ HashTable *dst = zend_new_array(zend_hash_num_elements(src));
- zend_hash_init(dst, zend_hash_num_elements(src), NULL, ZVAL_PTR_DTOR, 0);
ZVAL_TRUE(&tmp);
if (strict) {
@@ -4239,8 +4251,7 @@ static void zend_compile_static_var_common(zend_ast *var_ast, zval *value, zend_
if (CG(active_op_array)->scope) {
CG(active_op_array)->scope->ce_flags |= ZEND_HAS_STATIC_IN_METHODS;
}
- ALLOC_HASHTABLE(CG(active_op_array)->static_variables);
- zend_hash_init(CG(active_op_array)->static_variables, 8, NULL, ZVAL_PTR_DTOR, 0);
+ CG(active_op_array)->static_variables = zend_new_array(8);
}
if (GC_REFCOUNT(CG(active_op_array)->static_variables) > 1) {
@@ -5519,8 +5530,9 @@ void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast) /* {{{ */
zend_bool allow_null;
zend_bool has_null_default = default_ast
&& (Z_TYPE(default_node.u.constant) == IS_NULL
- || (Z_TYPE(default_node.u.constant) == IS_CONSTANT
- && strcasecmp(Z_STRVAL(default_node.u.constant), "NULL") == 0));
+ || (Z_TYPE(default_node.u.constant) == IS_CONSTANT_AST
+ && Z_ASTVAL(default_node.u.constant)->kind == ZEND_AST_CONSTANT
+ && strcasecmp(ZSTR_VAL(zend_ast_get_constant_name(Z_ASTVAL(default_node.u.constant))), "NULL") == 0));
zend_bool is_explicitly_nullable = (type_ast->attr & ZEND_TYPE_NULLABLE) == ZEND_TYPE_NULLABLE;
op_array->fn_flags |= ZEND_ACC_HAS_TYPE_HINTS;
@@ -5537,19 +5549,19 @@ void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast) /* {{{ */
if (ZEND_TYPE_CODE(arg_info->type) == IS_ARRAY) {
if (default_ast && !has_null_default
&& Z_TYPE(default_node.u.constant) != IS_ARRAY
- && !Z_CONSTANT(default_node.u.constant)
+ && Z_TYPE(default_node.u.constant) != IS_CONSTANT_AST
) {
zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters "
"with array type can only be an array or NULL");
}
} else if (ZEND_TYPE_CODE(arg_info->type) == IS_CALLABLE && default_ast) {
- if (!has_null_default && !Z_CONSTANT(default_node.u.constant)) {
+ if (!has_null_default && Z_TYPE(default_node.u.constant) != IS_CONSTANT_AST) {
zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters "
"with callable type can only be NULL");
}
}
} else {
- if (default_ast && !has_null_default && !Z_CONSTANT(default_node.u.constant)) {
+ if (default_ast && !has_null_default && Z_TYPE(default_node.u.constant) != IS_CONSTANT_AST) {
if (ZEND_TYPE_IS_CLASS(arg_info->type)) {
zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters "
"with a class type can only be NULL");
@@ -7917,6 +7929,7 @@ void zend_compile_const_expr_class_const(zend_ast **ast_ptr) /* {{{ */
zend_ast *const_ast = ast->child[1];
zend_string *class_name;
zend_string *const_name = zend_ast_get_str(const_ast);
+ zend_string *name;
zval result;
int fetch_type;
@@ -7944,16 +7957,13 @@ void zend_compile_const_expr_class_const(zend_ast **ast_ptr) /* {{{ */
zend_string_addref(class_name);
}
- Z_STR(result) = zend_concat3(
+ name = zend_concat3(
ZSTR_VAL(class_name), ZSTR_LEN(class_name), "::", 2, ZSTR_VAL(const_name), ZSTR_LEN(const_name));
- Z_TYPE_INFO(result) = IS_CONSTANT_EX;
- Z_CONST_FLAGS(result) = fetch_type;
-
zend_ast_destroy(ast);
zend_string_release(class_name);
- *ast_ptr = zend_ast_create_zval(&result);
+ *ast_ptr = zend_ast_create_constant(name, fetch_type);
}
/* }}} */
@@ -7963,25 +7973,21 @@ void zend_compile_const_expr_const(zend_ast **ast_ptr) /* {{{ */
zend_ast *name_ast = ast->child[0];
zend_string *orig_name = zend_ast_get_str(name_ast);
zend_bool is_fully_qualified;
+ zval result;
+ zend_string *resolved_name;
- zval result, resolved_name;
- ZVAL_STR(&resolved_name, zend_resolve_const_name(
- orig_name, name_ast->attr, &is_fully_qualified));
+ resolved_name = zend_resolve_const_name(
+ orig_name, name_ast->attr, &is_fully_qualified);
- if (zend_try_ct_eval_const(&result, Z_STR(resolved_name), is_fully_qualified)) {
- zend_string_release(Z_STR(resolved_name));
+ if (zend_try_ct_eval_const(&result, resolved_name, is_fully_qualified)) {
+ zend_string_release(resolved_name);
zend_ast_destroy(ast);
*ast_ptr = zend_ast_create_zval(&result);
return;
}
- Z_TYPE_INFO(resolved_name) = IS_CONSTANT_EX;
- if (!is_fully_qualified) {
- Z_CONST_FLAGS(resolved_name) = IS_CONSTANT_UNQUALIFIED;
- }
-
zend_ast_destroy(ast);
- *ast_ptr = zend_ast_create_zval(&resolved_name);
+ *ast_ptr = zend_ast_create_constant(resolved_name, !is_fully_qualified ? IS_CONSTANT_UNQUALIFIED : 0);
}
/* }}} */
@@ -7994,14 +8000,8 @@ void zend_compile_const_expr_magic_const(zend_ast **ast_ptr) /* {{{ */
CG(active_class_entry) &&
(CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT) != 0);
- {
- zval const_zv;
- Z_STR(const_zv) = zend_string_init("__CLASS__", sizeof("__CLASS__")-1, 0);
- Z_TYPE_INFO(const_zv) = IS_CONSTANT_EX | (IS_CONSTANT_CLASS << Z_CONST_FLAGS_SHIFT);
-
- zend_ast_destroy(ast);
- *ast_ptr = zend_ast_create_zval(&const_zv);
- }
+ zend_ast_destroy(ast);
+ *ast_ptr = zend_ast_create_ex(ZEND_AST_CONSTANT_CLASS, 0);
}
/* }}} */
@@ -8041,7 +8041,7 @@ void zend_const_expr_to_zval(zval *result, zend_ast *ast) /* {{{ */
if (ast->kind == ZEND_AST_ZVAL) {
ZVAL_COPY_VALUE(result, zend_ast_get_zval(ast));
} else {
- ZVAL_NEW_AST(result, zend_ast_copy(ast));
+ ZVAL_AST(result, zend_ast_copy(ast));
/* destroy the ast here, it might have been replaced */
zend_ast_destroy(ast);
}
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index 55526d6739..62fcdc9d8d 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -59,12 +59,10 @@ typedef struct _zend_op zend_op;
#if SIZEOF_SIZE_T == 4
# define ZEND_USE_ABS_JMP_ADDR 1
# define ZEND_USE_ABS_CONST_ADDR 1
-# define ZEND_EX_USE_LITERALS 0
# define ZEND_EX_USE_RUN_TIME_CACHE 1
#else
# define ZEND_USE_ABS_JMP_ADDR 0
# define ZEND_USE_ABS_CONST_ADDR 0
-# define ZEND_EX_USE_LITERALS 1
# define ZEND_EX_USE_RUN_TIME_CACHE 1
#endif
@@ -470,9 +468,6 @@ struct _zend_execute_data {
#if ZEND_EX_USE_RUN_TIME_CACHE
void **run_time_cache; /* cache op_array->run_time_cache */
#endif
-#if ZEND_EX_USE_LITERALS
- zval *literals; /* cache op_array->literals */
-#endif
};
#define ZEND_CALL_FUNCTION (0 << 0)
@@ -616,64 +611,38 @@ struct _zend_execute_data {
#if ZEND_USE_ABS_CONST_ADDR
/* run-time constant */
-# define RT_CONSTANT_EX(base, node) \
+# define RT_CONSTANT(opline, node) \
(node).zv
/* convert constant from compile-time to run-time */
-# define ZEND_PASS_TWO_UPDATE_CONSTANT(op_array, node) do { \
+# define ZEND_PASS_TWO_UPDATE_CONSTANT(op_array, opline, node) do { \
(node).zv = CT_CONSTANT_EX(op_array, (node).constant); \
} while (0)
-/* convert constant back from run-time to compile-time */
-# define ZEND_PASS_TWO_UNDO_CONSTANT(op_array, node) do { \
- (node).constant = (node).zv - (op_array)->literals; \
- } while (0)
-
#else
+/* At run-time, constants are allocated together with op_array->opcodes
+ * and addressed relatively to current opline.
+ */
+
/* run-time constant */
-# define RT_CONSTANT_EX(base, node) \
- ((zval*)(((char*)(base)) + (node).constant))
+# define RT_CONSTANT(opline, node) \
+ ((zval*)(((char*)(opline)) + (int32_t)(node).constant))
/* convert constant from compile-time to run-time */
-# define ZEND_PASS_TWO_UPDATE_CONSTANT(op_array, node) do { \
- (node).constant *= sizeof(zval); \
- } while (0)
-
-/* convert constant back from run-time to compile-time (do nothing) */
-# define ZEND_PASS_TWO_UNDO_CONSTANT(op_array, node) do { \
- (node).constant /= sizeof(zval); \
+# define ZEND_PASS_TWO_UPDATE_CONSTANT(op_array, opline, node) do { \
+ (node).constant = \
+ (((char*)CT_CONSTANT_EX(op_array, (node).constant)) - \
+ ((char*)opline)); \
} while (0)
#endif
-#if ZEND_EX_USE_LITERALS
-
-# define EX_LITERALS() \
- EX(literals)
-
-# define EX_LOAD_LITERALS(op_array) do { \
- EX(literals) = (op_array)->literals; \
- } while (0)
-
-#else
-
-# define EX_LITERALS() \
- EX(func)->op_array.literals
-
-# define EX_LOAD_LITERALS(op_array) do { \
+/* convert constant back from run-time to compile-time */
+#define ZEND_PASS_TWO_UNDO_CONSTANT(op_array, opline, node) do { \
+ (node).constant = RT_CONSTANT(opline, node) - (op_array)->literals; \
} while (0)
-#endif
-
-/* run-time constant */
-#define RT_CONSTANT(op_array, node) \
- RT_CONSTANT_EX((op_array)->literals, node)
-
-/* constant in currently executed function */
-#define EX_CONSTANT(node) \
- RT_CONSTANT_EX(EX_LITERALS(), node)
-
#if ZEND_EX_USE_RUN_TIME_CACHE
# define EX_RUN_TIME_CACHE() \
@@ -917,6 +886,10 @@ void zend_assert_valid_class_name(const zend_string *const_name);
#define ZEND_DIM_IS 1
+#define IS_CONSTANT_UNQUALIFIED 0x010
+#define IS_CONSTANT_CLASS 0x080 /* __CLASS__ in trait */
+#define IS_CONSTANT_IN_NAMESPACE 0x100
+
static zend_always_inline int zend_check_arg_send_type(const zend_function *zf, uint32_t arg_num, uint32_t mask)
{
arg_num--;
diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c
index f5a71ac6cc..100d0a263b 100644
--- a/Zend/zend_constants.c
+++ b/Zend/zend_constants.c
@@ -348,7 +348,7 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
}
}
- if (ret_constant && Z_CONSTANT_P(ret_constant)) {
+ if (ret_constant && Z_TYPE_P(ret_constant) == IS_CONSTANT_AST) {
if (Z_TYPE_P(ret_constant) == IS_CONSTANT_AST) {
if (IS_CONSTANT_VISITED(ret_constant)) {
zend_throw_error(NULL, "Cannot declare self-referencing constant '%s::%s'", ZSTR_VAL(class_name), ZSTR_VAL(constant_name));
diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c
index 4bf2b746cb..d9ea885a62 100644
--- a/Zend/zend_exceptions.c
+++ b/Zend/zend_exceptions.c
@@ -711,9 +711,9 @@ ZEND_METHOD(exception, __toString)
zend_string_release(file);
zval_ptr_dtor(&trace);
- Z_OBJPROP_P(exception)->u.v.nApplyCount++;
+ Z_PROTECT_RECURSION_P(exception);
exception = GET_PROPERTY(exception, ZEND_STR_PREVIOUS);
- if (exception && Z_TYPE_P(exception) == IS_OBJECT && Z_OBJPROP_P(exception)->u.v.nApplyCount > 0) {
+ if (exception && Z_TYPE_P(exception) == IS_OBJECT && Z_IS_RECURSIVE_P(exception)) {
break;
}
}
@@ -722,8 +722,8 @@ ZEND_METHOD(exception, __toString)
exception = getThis();
/* Reset apply counts */
while (exception && Z_TYPE_P(exception) == IS_OBJECT && (base_ce = i_get_exception_base(exception)) && instanceof_function(Z_OBJCE_P(exception), base_ce)) {
- if (Z_OBJPROP_P(exception)->u.v.nApplyCount) {
- Z_OBJPROP_P(exception)->u.v.nApplyCount--;
+ if (Z_IS_RECURSIVE_P(exception)) {
+ Z_UNPROTECT_RECURSION_P(exception);
} else {
break;
}
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index ae9d00684d..b80e7f0af6 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -70,12 +70,20 @@
# define EXECUTE_DATA_DC
# define EXECUTE_DATA_CC
# define NO_EXECUTE_DATA_CC
+# define OPLINE_D void
+# define OPLINE_C
+# define OPLINE_DC
+# define OPLINE_CC
#else
# define EXECUTE_DATA_D zend_execute_data* execute_data
# define EXECUTE_DATA_C execute_data
# define EXECUTE_DATA_DC , EXECUTE_DATA_D
# define EXECUTE_DATA_CC , EXECUTE_DATA_C
# define NO_EXECUTE_DATA_CC , NULL
+# define OPLINE_D const zend_op* opline
+# define OPLINE_C opline
+# define OPLINE_DC , OPLINE_D
+# define OPLINE_CC , OPLINE_C
#endif
#if defined(ZEND_VM_IP_GLOBAL_REG) && ((ZEND_VM_KIND == ZEND_VM_KIND_CALL) || (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID))
@@ -93,15 +101,14 @@
typedef int (ZEND_FASTCALL *incdec_t)(zval *);
-#define get_zval_ptr(op_type, node, should_free, type) _get_zval_ptr(op_type, node, should_free, type EXECUTE_DATA_CC)
-#define get_zval_ptr_deref(op_type, node, should_free, type) _get_zval_ptr_deref(op_type, node, should_free, type EXECUTE_DATA_CC)
-#define get_zval_ptr_r(op_type, node, should_free) _get_zval_ptr_r(op_type, node, should_free EXECUTE_DATA_CC)
-#define get_zval_ptr_r_deref(op_type, node, should_free) _get_zval_ptr_r_deref(op_type, node, should_free EXECUTE_DATA_CC)
-#define get_zval_ptr_undef(op_type, node, should_free, type) _get_zval_ptr_undef(op_type, node, should_free, type EXECUTE_DATA_CC)
+#define get_zval_ptr(op_type, node, should_free, type) _get_zval_ptr(op_type, node, should_free, type EXECUTE_DATA_CC OPLINE_CC)
+#define get_zval_ptr_deref(op_type, node, should_free, type) _get_zval_ptr_deref(op_type, node, should_free, type EXECUTE_DATA_CC OPLINE_CC)
+#define get_zval_ptr_undef(op_type, node, should_free, type) _get_zval_ptr_undef(op_type, node, should_free, type EXECUTE_DATA_CC OPLINE_CC)
+#define get_op_data_zval_ptr_r(op_type, node, should_free) _get_op_data_zval_ptr_r(op_type, node, should_free EXECUTE_DATA_CC OPLINE_CC)
#define get_zval_ptr_ptr(op_type, node, should_free, type) _get_zval_ptr_ptr(op_type, node, should_free, type EXECUTE_DATA_CC)
#define get_zval_ptr_ptr_undef(op_type, node, should_free, type) _get_zval_ptr_ptr(op_type, node, should_free, type EXECUTE_DATA_CC)
-#define get_obj_zval_ptr(op_type, node, should_free, type) _get_obj_zval_ptr(op_type, node, should_free, type EXECUTE_DATA_CC)
-#define get_obj_zval_ptr_undef(op_type, node, should_free, type) _get_obj_zval_ptr_undef(op_type, node, should_free, type EXECUTE_DATA_CC)
+#define get_obj_zval_ptr(op_type, node, should_free, type) _get_obj_zval_ptr(op_type, node, should_free, type EXECUTE_DATA_CC OPLINE_CC)
+#define get_obj_zval_ptr_undef(op_type, node, should_free, type) _get_obj_zval_ptr_undef(op_type, node, should_free, type EXECUTE_DATA_CC OPLINE_CC)
#define get_obj_zval_ptr_ptr(op_type, node, should_free, type) _get_obj_zval_ptr_ptr(op_type, node, should_free, type EXECUTE_DATA_CC)
#define RETURN_VALUE_USED(opline) ((opline)->result_type != IS_UNUSED)
@@ -435,7 +442,7 @@ static zend_always_inline zval *_get_zval_ptr_cv_deref_BP_VAR_W(uint32_t var EXE
return ret;
}
-static zend_always_inline zval *_get_zval_ptr(int op_type, znode_op node, zend_free_op *should_free, int type EXECUTE_DATA_DC)
+static zend_always_inline zval *_get_zval_ptr(int op_type, znode_op node, zend_free_op *should_free, int type EXECUTE_DATA_DC OPLINE_DC)
{
if (op_type & (IS_TMP_VAR|IS_VAR)) {
if (op_type == IS_TMP_VAR) {
@@ -447,7 +454,7 @@ static zend_always_inline zval *_get_zval_ptr(int op_type, znode_op node, zend_f
} else {
*should_free = NULL;
if (op_type == IS_CONST) {
- return EX_CONSTANT(node);
+ return RT_CONSTANT(opline, node);
} else if (op_type == IS_CV) {
return _get_zval_ptr_cv(node.var, type EXECUTE_DATA_CC);
} else {
@@ -456,7 +463,7 @@ static zend_always_inline zval *_get_zval_ptr(int op_type, znode_op node, zend_f
}
}
-static zend_always_inline zval *_get_zval_ptr_r(int op_type, znode_op node, zend_free_op *should_free EXECUTE_DATA_DC)
+static zend_always_inline zval *_get_op_data_zval_ptr_r(int op_type, znode_op node, zend_free_op *should_free EXECUTE_DATA_DC OPLINE_DC)
{
if (op_type & (IS_TMP_VAR|IS_VAR)) {
if (op_type == IS_TMP_VAR) {
@@ -468,7 +475,7 @@ static zend_always_inline zval *_get_zval_ptr_r(int op_type, znode_op node, zend
} else {
*should_free = NULL;
if (op_type == IS_CONST) {
- return EX_CONSTANT(node);
+ return RT_CONSTANT(opline + 1, node);
} else if (op_type == IS_CV) {
return _get_zval_ptr_cv_BP_VAR_R(node.var EXECUTE_DATA_CC);
} else {
@@ -477,7 +484,7 @@ static zend_always_inline zval *_get_zval_ptr_r(int op_type, znode_op node, zend
}
}
-static zend_always_inline zval *_get_zval_ptr_deref(int op_type, znode_op node, zend_free_op *should_free, int type EXECUTE_DATA_DC)
+static zend_always_inline zval *_get_zval_ptr_deref(int op_type, znode_op node, zend_free_op *should_free, int type EXECUTE_DATA_DC OPLINE_DC)
{
if (op_type & (IS_TMP_VAR|IS_VAR)) {
if (op_type == IS_TMP_VAR) {
@@ -489,7 +496,7 @@ static zend_always_inline zval *_get_zval_ptr_deref(int op_type, znode_op node,
} else {
*should_free = NULL;
if (op_type == IS_CONST) {
- return EX_CONSTANT(node);
+ return RT_CONSTANT(opline, node);
} else if (op_type == IS_CV) {
return _get_zval_ptr_cv_deref(node.var, type EXECUTE_DATA_CC);
} else {
@@ -498,28 +505,7 @@ static zend_always_inline zval *_get_zval_ptr_deref(int op_type, znode_op node,
}
}
-static zend_always_inline zval *_get_zval_ptr_r_deref(int op_type, znode_op node, zend_free_op *should_free EXECUTE_DATA_DC)
-{
- if (op_type & (IS_TMP_VAR|IS_VAR)) {
- if (op_type == IS_TMP_VAR) {
- return _get_zval_ptr_tmp(node.var, should_free EXECUTE_DATA_CC);
- } else {
- ZEND_ASSERT(op_type == IS_VAR);
- return _get_zval_ptr_var_deref(node.var, should_free EXECUTE_DATA_CC);
- }
- } else {
- *should_free = NULL;
- if (op_type == IS_CONST) {
- return EX_CONSTANT(node);
- } else if (op_type == IS_CV) {
- return _get_zval_ptr_cv_deref_BP_VAR_R(node.var EXECUTE_DATA_CC);
- } else {
- return NULL;
- }
- }
-}
-
-static zend_always_inline zval *_get_zval_ptr_undef(int op_type, znode_op node, zend_free_op *should_free, int type EXECUTE_DATA_DC)
+static zend_always_inline zval *_get_zval_ptr_undef(int op_type, znode_op node, zend_free_op *should_free, int type EXECUTE_DATA_DC OPLINE_DC)
{
if (op_type & (IS_TMP_VAR|IS_VAR)) {
if (op_type == IS_TMP_VAR) {
@@ -531,7 +517,7 @@ static zend_always_inline zval *_get_zval_ptr_undef(int op_type, znode_op node,
} else {
*should_free = NULL;
if (op_type == IS_CONST) {
- return EX_CONSTANT(node);
+ return RT_CONSTANT(opline, node);
} else if (op_type == IS_CV) {
return _get_zval_ptr_cv_undef(node.var EXECUTE_DATA_CC);
} else {
@@ -569,7 +555,7 @@ static zend_always_inline zval *_get_obj_zval_ptr_unused(EXECUTE_DATA_D)
return &EX(This);
}
-static inline zval *_get_obj_zval_ptr(int op_type, znode_op op, zend_free_op *should_free, int type EXECUTE_DATA_DC)
+static inline zval *_get_obj_zval_ptr(int op_type, znode_op op, zend_free_op *should_free, int type EXECUTE_DATA_DC OPLINE_DC)
{
if (op_type == IS_UNUSED) {
*should_free = NULL;
@@ -578,7 +564,7 @@ static inline zval *_get_obj_zval_ptr(int op_type, znode_op op, zend_free_op *sh
return get_zval_ptr(op_type, op, should_free, type);
}
-static inline zval *_get_obj_zval_ptr_undef(int op_type, znode_op op, zend_free_op *should_free, int type EXECUTE_DATA_DC)
+static inline zval *_get_obj_zval_ptr_undef(int op_type, znode_op op, zend_free_op *should_free, int type EXECUTE_DATA_DC OPLINE_DC)
{
if (op_type == IS_UNUSED) {
*should_free = NULL;
@@ -743,7 +729,7 @@ static ZEND_COLD void zend_verify_arg_error(
static int is_null_constant(zend_class_entry *scope, zval *default_value)
{
- if (Z_CONSTANT_P(default_value)) {
+ if (Z_TYPE_P(default_value) == IS_CONSTANT_AST) {
zval constant;
ZVAL_COPY(&constant, default_value);
@@ -753,7 +739,7 @@ static int is_null_constant(zend_class_entry *scope, zval *default_value)
if (Z_TYPE(constant) == IS_NULL) {
return 1;
}
- zval_ptr_dtor(&constant);
+ zval_ptr_dtor_nogc(&constant);
}
return 0;
}
@@ -1698,8 +1684,7 @@ fetch_from_array:
}
if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
if (type != BP_VAR_UNSET) {
- ZVAL_NEW_ARR(container);
- zend_hash_init(Z_ARRVAL_P(container), 8, NULL, ZVAL_PTR_DTOR, 0);
+ array_init(container);
goto fetch_from_array;
} else {
/* for read-mode only */
@@ -1902,7 +1887,7 @@ static zend_always_inline void zend_fetch_property_address(zval *result, zval *c
zend_object *zobj = Z_OBJ_P(container);
zval *retval;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
retval = OBJ_PROP(zobj, prop_offset);
if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) {
ZVAL_INDIRECT(result, retval);
@@ -1948,7 +1933,7 @@ use_read_property:
}
}
-static zend_always_inline zval* zend_fetch_static_property_address(zval *varname, zend_uchar varname_type, znode_op op2, zend_uchar op2_type, int type EXECUTE_DATA_DC)
+static zend_always_inline zval* zend_fetch_static_property_address(zval *varname, zend_uchar varname_type, znode_op op2, zend_uchar op2_type, int type EXECUTE_DATA_DC OPLINE_DC)
{
zval *retval;
zend_string *name;
@@ -1980,7 +1965,7 @@ static zend_always_inline zval* zend_fetch_static_property_address(zval *varname
return retval;
} else {
- zval *class_name = EX_CONSTANT(op2);
+ zval *class_name = RT_CONSTANT(opline, op2);
if (UNEXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(class_name))) == NULL)) {
ce = zend_fetch_class_by_name(Z_STR_P(class_name), class_name + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
@@ -2206,7 +2191,6 @@ static zend_always_inline void i_init_func_execute_data(zend_execute_data *execu
}
EX_LOAD_RUN_TIME_CACHE(op_array);
- EX_LOAD_LITERALS(op_array);
EG(current_execute_data) = execute_data;
}
@@ -2235,7 +2219,6 @@ static zend_always_inline void i_init_code_execute_data(zend_execute_data *execu
memset(op_array->run_time_cache, 0, op_array->cache_size);
}
EX_LOAD_RUN_TIME_CACHE(op_array);
- EX_LOAD_LITERALS(op_array);
EG(current_execute_data) = execute_data;
}
@@ -2783,7 +2766,7 @@ static zend_never_inline zend_op_array* ZEND_FASTCALL zend_include_or_eval(zval
zend_file_handle file_handle;
zend_string *resolved_path;
- resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), (int)Z_STRLEN_P(inc_filename));
+ resolved_path = zend_resolve_path(Z_STRVAL_P(inc_filename), Z_STRLEN_P(inc_filename));
if (resolved_path) {
if (zend_hash_exists(&EG(included_files), resolved_path)) {
goto already_compiled;
@@ -3019,13 +3002,13 @@ ZEND_API user_opcode_handler_t zend_get_user_opcode_handler(zend_uchar opcode)
return zend_user_opcode_handlers[opcode];
}
-ZEND_API zval *zend_get_zval_ptr(int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type)
+ZEND_API zval *zend_get_zval_ptr(const zend_op *opline, int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type)
{
zval *ret;
switch (op_type) {
case IS_CONST:
- ret = EX_CONSTANT(*node);
+ ret = RT_CONSTANT(opline, *node);
*should_free = NULL;
break;
case IS_TMP_VAR:
diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h
index 7edba6f2a5..39fce43ccc 100644
--- a/Zend/zend_execute.h
+++ b/Zend/zend_execute.h
@@ -131,6 +131,7 @@ static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval
ZEND_API int zval_update_constant(zval *pp);
ZEND_API int zval_update_constant_ex(zval *pp, zend_class_entry *scope);
+ZEND_API int zend_use_undefined_constant(zend_string *name, zend_ast_attr attr, zval *result);
/* dedicated Zend executor functions - do not use! */
struct _zend_vm_stack {
@@ -318,7 +319,7 @@ ZEND_API user_opcode_handler_t zend_get_user_opcode_handler(zend_uchar opcode);
/* former zend_execute_locks.h */
typedef zval* zend_free_op;
-ZEND_API zval *zend_get_zval_ptr(int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type);
+ZEND_API zval *zend_get_zval_ptr(const zend_op *opline, int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type);
ZEND_API void zend_clean_and_cache_symbol_table(zend_array *symbol_table);
void zend_free_compiled_variables(zend_execute_data *execute_data);
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index a619b3ccf3..e69a84ba6b 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -333,7 +333,7 @@ void shutdown_executor(void) /* {{{ */
if (c->flags & CONST_PERSISTENT) {
break;
}
- zval_ptr_dtor(&c->value);
+ zval_ptr_dtor_nogc(&c->value);
if (c->name) {
zend_string_release(c->name);
}
@@ -542,90 +542,63 @@ ZEND_API void _zval_internal_ptr_dtor(zval *zval_ptr ZEND_FILE_LINE_DC) /* {{{ *
}
/* }}} */
-ZEND_API int zval_update_constant_ex(zval *p, zend_class_entry *scope) /* {{{ */
+ZEND_API int zend_use_undefined_constant(zend_string *name, zend_ast_attr attr, zval *result) /* {{{ */
{
- zval *const_value;
char *colon;
- zend_bool inline_change;
- if (Z_TYPE_P(p) == IS_CONSTANT) {
- if (IS_CONSTANT_VISITED(p)) {
- zend_throw_error(NULL, "Cannot declare self-referencing constant '%s'", Z_STRVAL_P(p));
+ if (UNEXPECTED(EG(exception))) {
+ return FAILURE;
+ } else if ((colon = (char*)zend_memrchr(ZSTR_VAL(name), ':', ZSTR_LEN(name)))) {
+ zend_throw_error(NULL, "Undefined class constant '%s'", ZSTR_VAL(name));
+ return FAILURE;
+ } else if ((attr & IS_CONSTANT_UNQUALIFIED) == 0) {
+ zend_throw_error(NULL, "Undefined constant '%s'", ZSTR_VAL(name));
+ return FAILURE;
+ } else {
+ char *actual = ZSTR_VAL(name);
+ size_t actual_len = ZSTR_LEN(name);
+ char *slash = (char *) zend_memrchr(actual, '\\', actual_len);
+
+ if (slash) {
+ actual = slash + 1;
+ actual_len -= (actual - ZSTR_VAL(name));
+ }
+
+ zend_error(E_WARNING, "Use of undefined constant %s - assumed '%s' (this will throw an Error in a future version of PHP)", actual, actual);
+ if (EG(exception)) {
return FAILURE;
+ } else {
+ zval_ptr_dtor_nogc(result);
+ ZVAL_STRINGL(result, actual, actual_len);
}
- inline_change = (Z_TYPE_FLAGS_P(p) & IS_TYPE_REFCOUNTED) != 0;
- SEPARATE_ZVAL_NOREF(p);
- MARK_CONSTANT_VISITED(p);
- if (Z_CONST_FLAGS_P(p) & IS_CONSTANT_CLASS) {
- ZEND_ASSERT(EG(current_execute_data));
- if (inline_change) {
- zend_string_release(Z_STR_P(p));
- }
- if (scope && scope->name) {
- ZVAL_STR_COPY(p, scope->name);
- } else {
- ZVAL_EMPTY_STRING(p);
- }
- } else if (UNEXPECTED((const_value = zend_get_constant_ex(Z_STR_P(p), scope, Z_CONST_FLAGS_P(p))) == NULL)) {
- if (UNEXPECTED(EG(exception))) {
- RESET_CONSTANT_VISITED(p);
- return FAILURE;
- } else if ((colon = (char*)zend_memrchr(Z_STRVAL_P(p), ':', Z_STRLEN_P(p)))) {
- zend_throw_error(NULL, "Undefined class constant '%s'", Z_STRVAL_P(p));
- RESET_CONSTANT_VISITED(p);
- return FAILURE;
- } else {
- if ((Z_CONST_FLAGS_P(p) & IS_CONSTANT_UNQUALIFIED) == 0) {
- zend_throw_error(NULL, "Undefined constant '%s'", Z_STRVAL_P(p));
- RESET_CONSTANT_VISITED(p);
- return FAILURE;
- } else {
- zend_string *save = Z_STR_P(p);
- char *actual = Z_STRVAL_P(p);
- size_t actual_len = Z_STRLEN_P(p);
- char *slash = (char *) zend_memrchr(actual, '\\', actual_len);
- if (slash) {
- actual = slash + 1;
- actual_len -= (actual - Z_STRVAL_P(p));
- }
+ }
+ return SUCCESS;
+}
+/* }}} */
- zend_error(E_WARNING, "Use of undefined constant %s - assumed '%s' (this will throw an Error in a future version of PHP)", actual, actual);
- if (EG(exception)) {
- RESET_CONSTANT_VISITED(p);
- return FAILURE;
- }
+ZEND_API int zval_update_constant_ex(zval *p, zend_class_entry *scope) /* {{{ */
+{
+ if (Z_TYPE_P(p) == IS_CONSTANT_AST) {
+ zend_ast *ast = Z_ASTVAL_P(p);
- if (!inline_change) {
- ZVAL_STRINGL(p, actual, actual_len);
- } else {
- if (slash) {
- ZVAL_STRINGL(p, actual, actual_len);
- zend_string_release(save);
- } else {
- Z_TYPE_INFO_P(p) = Z_REFCOUNTED_P(p) ?
- IS_STRING_EX : IS_INTERNED_STRING_EX;
- }
- }
- }
+ if (ast->kind == ZEND_AST_CONSTANT) {
+ zend_string *name = zend_ast_get_constant_name(ast);
+ zval *zv = zend_get_constant_ex(name, scope, ast->attr);
+
+ if (UNEXPECTED(zv == NULL)) {
+ return zend_use_undefined_constant(name, ast->attr, p);
}
+ zval_ptr_dtor_nogc(p);
+ ZVAL_DUP(p, zv);
} else {
- if (inline_change) {
- zend_string_release(Z_STR_P(p));
- }
- ZVAL_COPY_VALUE(p, const_value);
- zval_opt_copy_ctor(p);
- }
- } else if (Z_TYPE_P(p) == IS_CONSTANT_AST) {
- zval tmp;
+ zval tmp;
- inline_change = (Z_TYPE_FLAGS_P(p) & IS_TYPE_REFCOUNTED) != 0;
- if (UNEXPECTED(zend_ast_evaluate(&tmp, Z_ASTVAL_P(p), scope) != SUCCESS)) {
- return FAILURE;
- }
- if (inline_change) {
- zval_ptr_dtor(p);
+ if (UNEXPECTED(zend_ast_evaluate(&tmp, ast, scope) != SUCCESS)) {
+ return FAILURE;
+ }
+ zval_ptr_dtor_nogc(p);
+ ZVAL_COPY_VALUE(p, &tmp);
}
- ZVAL_COPY_VALUE(p, &tmp);
}
return SUCCESS;
}
@@ -1527,8 +1500,7 @@ ZEND_API zend_array *zend_rebuild_symbol_table(void) /* {{{ */
}
zend_hash_extend(symbol_table, ex->func->op_array.last_var, 0);
} else {
- symbol_table = ex->symbol_table = emalloc(sizeof(zend_array));
- zend_hash_init(symbol_table, ex->func->op_array.last_var, NULL, ZVAL_PTR_DTOR, 0);
+ symbol_table = ex->symbol_table = zend_new_array(ex->func->op_array.last_var);
if (!ex->func->op_array.last_var) {
return symbol_table;
}
diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c
index c1ac05cc3d..d629c098dc 100644
--- a/Zend/zend_hash.c
+++ b/Zend/zend_hash.c
@@ -72,19 +72,6 @@ static void _zend_is_inconsistent(const HashTable *ht, const char *file, int lin
#define SET_INCONSISTENT(n)
#endif
-#define HASH_PROTECT_RECURSION(ht) \
- if ((ht)->u.flags & HASH_FLAG_APPLY_PROTECTION) { \
- if (((ht)->u.flags & ZEND_HASH_APPLY_COUNT_MASK) >= (3 << 8)) { \
- zend_error_noreturn(E_ERROR, "Nesting level too deep - recursive dependency?");\
- } \
- ZEND_HASH_INC_APPLY_COUNT(ht); \
- }
-
-#define HASH_UNPROTECT_RECURSION(ht) \
- if ((ht)->u.flags & HASH_FLAG_APPLY_PROTECTION) { \
- ZEND_HASH_DEC_APPLY_COUNT(ht); \
- }
-
#define ZEND_HASH_IF_FULL_DO_RESIZE(ht) \
if ((ht)->nNumUsed >= (ht)->nTableSize) { \
zend_hash_do_resize(ht); \
@@ -132,12 +119,12 @@ static zend_always_inline void zend_hash_real_init_ex(HashTable *ht, int packed)
HT_ASSERT_RC1(ht);
ZEND_ASSERT(!((ht)->u.flags & HASH_FLAG_INITIALIZED));
if (packed) {
- HT_SET_DATA_ADDR(ht, pemalloc(HT_SIZE(ht), (ht)->u.flags & HASH_FLAG_PERSISTENT));
+ HT_SET_DATA_ADDR(ht, pemalloc(HT_SIZE(ht), GC_FLAGS(ht) & IS_ARRAY_PERSISTENT));
(ht)->u.flags |= HASH_FLAG_INITIALIZED | HASH_FLAG_PACKED;
HT_HASH_RESET_PACKED(ht);
} else {
(ht)->nTableMask = -(ht)->nTableSize;
- HT_SET_DATA_ADDR(ht, pemalloc(HT_SIZE(ht), (ht)->u.flags & HASH_FLAG_PERSISTENT));
+ HT_SET_DATA_ADDR(ht, pemalloc(HT_SIZE(ht), GC_FLAGS(ht) & IS_ARRAY_PERSISTENT));
(ht)->u.flags |= HASH_FLAG_INITIALIZED;
if (EXPECTED(ht->nTableMask == (uint32_t)-8)) {
Bucket *arData = ht->arData;
@@ -170,11 +157,11 @@ static zend_always_inline void zend_hash_check_init(HashTable *ht, int packed)
static const uint32_t uninitialized_bucket[-HT_MIN_MASK] =
{HT_INVALID_IDX, HT_INVALID_IDX};
-ZEND_API void ZEND_FASTCALL _zend_hash_init(HashTable *ht, uint32_t nSize, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC)
+static zend_always_inline void _zend_hash_init_int(HashTable *ht, uint32_t nSize, dtor_func_t pDestructor, zend_bool persistent)
{
GC_REFCOUNT(ht) = 1;
- GC_TYPE_INFO(ht) = IS_ARRAY | (persistent ? 0 : (GC_COLLECTABLE << GC_FLAGS_SHIFT));
- ht->u.flags = (persistent ? HASH_FLAG_PERSISTENT : 0) | HASH_FLAG_APPLY_PROTECTION | HASH_FLAG_STATIC_KEYS;
+ GC_TYPE_INFO(ht) = IS_ARRAY | (persistent ? (GC_PERSISTENT << GC_FLAGS_SHIFT) : (GC_COLLECTABLE << GC_FLAGS_SHIFT));
+ ht->u.flags = HASH_FLAG_STATIC_KEYS;
ht->nTableMask = HT_MIN_MASK;
HT_SET_DATA_ADDR(ht, &uninitialized_bucket);
ht->nNumUsed = 0;
@@ -185,6 +172,18 @@ ZEND_API void ZEND_FASTCALL _zend_hash_init(HashTable *ht, uint32_t nSize, dtor_
ht->nTableSize = zend_hash_check_size(nSize);
}
+ZEND_API void ZEND_FASTCALL _zend_hash_init(HashTable *ht, uint32_t nSize, dtor_func_t pDestructor, zend_bool persistent)
+{
+ _zend_hash_init_int(ht, nSize, pDestructor, persistent);
+}
+
+ZEND_API HashTable* ZEND_FASTCALL _zend_new_array(uint32_t nSize ZEND_FILE_LINE_DC)
+{
+ HashTable *ht = emalloc(sizeof(HashTable));
+ _zend_hash_init_int(ht, nSize, ZVAL_PTR_DTOR, 0);
+ return ht;
+}
+
static void ZEND_FASTCALL zend_hash_packed_grow(HashTable *ht)
{
HT_ASSERT_RC1(ht);
@@ -192,7 +191,7 @@ static void ZEND_FASTCALL zend_hash_packed_grow(HashTable *ht)
zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%u * %zu + %zu)", ht->nTableSize * 2, sizeof(Bucket), sizeof(Bucket));
}
ht->nTableSize += ht->nTableSize;
- HT_SET_DATA_ADDR(ht, perealloc2(HT_GET_DATA_ADDR(ht), HT_SIZE(ht), HT_USED_SIZE(ht), ht->u.flags & HASH_FLAG_PERSISTENT));
+ HT_SET_DATA_ADDR(ht, perealloc2(HT_GET_DATA_ADDR(ht), HT_SIZE(ht), HT_USED_SIZE(ht), GC_FLAGS(ht) & IS_ARRAY_PERSISTENT));
}
ZEND_API void ZEND_FASTCALL zend_hash_real_init(HashTable *ht, zend_bool packed)
@@ -210,11 +209,11 @@ ZEND_API void ZEND_FASTCALL zend_hash_packed_to_hash(HashTable *ht)
HT_ASSERT_RC1(ht);
ht->u.flags &= ~HASH_FLAG_PACKED;
- new_data = pemalloc(HT_SIZE_EX(ht->nTableSize, -ht->nTableSize), (ht)->u.flags & HASH_FLAG_PERSISTENT);
+ new_data = pemalloc(HT_SIZE_EX(ht->nTableSize, -ht->nTableSize), GC_FLAGS(ht) & IS_ARRAY_PERSISTENT);
ht->nTableMask = -ht->nTableSize;
HT_SET_DATA_ADDR(ht, new_data);
memcpy(ht->arData, old_buckets, sizeof(Bucket) * ht->nNumUsed);
- pefree(old_data, (ht)->u.flags & HASH_FLAG_PERSISTENT);
+ pefree(old_data, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT);
zend_hash_rehash(ht);
}
@@ -224,21 +223,13 @@ ZEND_API void ZEND_FASTCALL zend_hash_to_packed(HashTable *ht)
Bucket *old_buckets = ht->arData;
HT_ASSERT_RC1(ht);
- new_data = pemalloc(HT_SIZE_EX(ht->nTableSize, HT_MIN_MASK), (ht)->u.flags & HASH_FLAG_PERSISTENT);
+ new_data = pemalloc(HT_SIZE_EX(ht->nTableSize, HT_MIN_MASK), GC_FLAGS(ht) & IS_ARRAY_PERSISTENT);
ht->u.flags |= HASH_FLAG_PACKED | HASH_FLAG_STATIC_KEYS;
ht->nTableMask = HT_MIN_MASK;
HT_SET_DATA_ADDR(ht, new_data);
HT_HASH_RESET_PACKED(ht);
memcpy(ht->arData, old_buckets, sizeof(Bucket) * ht->nNumUsed);
- pefree(old_data, (ht)->u.flags & HASH_FLAG_PERSISTENT);
-}
-
-ZEND_API void ZEND_FASTCALL _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_RELAY_CC);
- if (!bApplyProtection) {
- ht->u.flags &= ~HASH_FLAG_APPLY_PROTECTION;
- }
+ pefree(old_data, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT);
}
ZEND_API void ZEND_FASTCALL zend_hash_extend(HashTable *ht, uint32_t nSize, zend_bool packed)
@@ -255,7 +246,7 @@ ZEND_API void ZEND_FASTCALL zend_hash_extend(HashTable *ht, uint32_t nSize, zend
ZEND_ASSERT(ht->u.flags & HASH_FLAG_PACKED);
if (nSize > ht->nTableSize) {
ht->nTableSize = zend_hash_check_size(nSize);
- HT_SET_DATA_ADDR(ht, perealloc2(HT_GET_DATA_ADDR(ht), HT_SIZE(ht), HT_USED_SIZE(ht), ht->u.flags & HASH_FLAG_PERSISTENT));
+ HT_SET_DATA_ADDR(ht, perealloc2(HT_GET_DATA_ADDR(ht), HT_SIZE(ht), HT_USED_SIZE(ht), GC_FLAGS(ht) & IS_ARRAY_PERSISTENT));
}
} else {
ZEND_ASSERT(!(ht->u.flags & HASH_FLAG_PACKED));
@@ -263,12 +254,12 @@ ZEND_API void ZEND_FASTCALL zend_hash_extend(HashTable *ht, uint32_t nSize, zend
void *new_data, *old_data = HT_GET_DATA_ADDR(ht);
Bucket *old_buckets = ht->arData;
nSize = zend_hash_check_size(nSize);
- new_data = pemalloc(HT_SIZE_EX(nSize, -nSize), ht->u.flags & HASH_FLAG_PERSISTENT);
+ new_data = pemalloc(HT_SIZE_EX(nSize, -nSize), GC_FLAGS(ht) & IS_ARRAY_PERSISTENT);
ht->nTableSize = nSize;
ht->nTableMask = -ht->nTableSize;
HT_SET_DATA_ADDR(ht, new_data);
memcpy(ht->arData, old_buckets, sizeof(Bucket) * ht->nNumUsed);
- pefree(old_data, ht->u.flags & HASH_FLAG_PERSISTENT);
+ pefree(old_data, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT);
zend_hash_rehash(ht);
}
}
@@ -308,15 +299,6 @@ ZEND_API uint32_t zend_array_count(HashTable *ht)
}
/* }}} */
-ZEND_API void ZEND_FASTCALL zend_hash_set_apply_protection(HashTable *ht, zend_bool bApplyProtection)
-{
- if (bApplyProtection) {
- ht->u.flags |= HASH_FLAG_APPLY_PROTECTION;
- } else {
- ht->u.flags &= ~HASH_FLAG_APPLY_PROTECTION;
- }
-}
-
ZEND_API uint32_t ZEND_FASTCALL zend_hash_iterator_add(HashTable *ht, HashPosition pos)
{
HashTableIterator *iter = EG(ht_iterators);
@@ -640,7 +622,7 @@ ZEND_API zval* ZEND_FASTCALL _zend_hash_add_new(HashTable *ht, zend_string *key,
ZEND_API zval* ZEND_FASTCALL _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);
+ zend_string *key = zend_string_init(str, len, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT);
zval *ret = _zend_hash_add_or_update_i(ht, key, pData, flag ZEND_FILE_LINE_RELAY_CC);
zend_string_release(key);
return ret;
@@ -648,7 +630,7 @@ ZEND_API zval* ZEND_FASTCALL _zend_hash_str_add_or_update(HashTable *ht, const c
ZEND_API zval* ZEND_FASTCALL _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);
+ zend_string *key = zend_string_init(str, len, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT);
zval *ret = _zend_hash_add_or_update_i(ht, key, pData, HASH_UPDATE ZEND_FILE_LINE_RELAY_CC);
zend_string_release(key);
return ret;
@@ -656,7 +638,7 @@ ZEND_API zval* ZEND_FASTCALL _zend_hash_str_update(HashTable *ht, const char *st
ZEND_API zval* ZEND_FASTCALL _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);
+ zend_string *key = zend_string_init(str, len, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT);
zval *ret = _zend_hash_add_or_update_i(ht, key, pData, HASH_UPDATE | HASH_UPDATE_INDIRECT ZEND_FILE_LINE_RELAY_CC);
zend_string_release(key);
return ret;
@@ -664,7 +646,7 @@ ZEND_API zval* ZEND_FASTCALL _zend_hash_str_update_ind(HashTable *ht, const char
ZEND_API zval* ZEND_FASTCALL _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);
+ zend_string *key = zend_string_init(str, len, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT);
zval *ret = _zend_hash_add_or_update_i(ht, key, pData, HASH_ADD ZEND_FILE_LINE_RELAY_CC);
zend_string_release(key);
return ret;
@@ -672,7 +654,7 @@ ZEND_API zval* ZEND_FASTCALL _zend_hash_str_add(HashTable *ht, const char *str,
ZEND_API zval* ZEND_FASTCALL _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);
+ zend_string *key = zend_string_init(str, len, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT);
zval *ret = _zend_hash_add_or_update_i(ht, key, pData, HASH_ADD_NEW ZEND_FILE_LINE_RELAY_CC);
zend_string_delref(key);
return ret;
@@ -857,12 +839,12 @@ static void ZEND_FASTCALL zend_hash_do_resize(HashTable *ht)
uint32_t nSize = ht->nTableSize + ht->nTableSize;
Bucket *old_buckets = ht->arData;
- new_data = pemalloc(HT_SIZE_EX(nSize, -nSize), ht->u.flags & HASH_FLAG_PERSISTENT);
+ new_data = pemalloc(HT_SIZE_EX(nSize, -nSize), GC_FLAGS(ht) & IS_ARRAY_PERSISTENT);
ht->nTableSize = nSize;
ht->nTableMask = -ht->nTableSize;
HT_SET_DATA_ADDR(ht, new_data);
memcpy(ht->arData, old_buckets, sizeof(Bucket) * ht->nNumUsed);
- pefree(old_data, ht->u.flags & HASH_FLAG_PERSISTENT);
+ pefree(old_data, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT);
zend_hash_rehash(ht);
} else {
zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%u * %zu + %zu)", ht->nTableSize * 2, sizeof(Bucket) + sizeof(uint32_t), sizeof(Bucket));
@@ -1274,7 +1256,7 @@ ZEND_API void ZEND_FASTCALL zend_hash_destroy(HashTable *ht)
} else if (EXPECTED(!(ht->u.flags & HASH_FLAG_INITIALIZED))) {
return;
}
- pefree(HT_GET_DATA_ADDR(ht), ht->u.flags & HASH_FLAG_PERSISTENT);
+ pefree(HT_GET_DATA_ADDR(ht), GC_FLAGS(ht) & IS_ARRAY_PERSISTENT);
}
ZEND_API void ZEND_FASTCALL zend_array_destroy(HashTable *ht)
@@ -1452,7 +1434,7 @@ ZEND_API void ZEND_FASTCALL zend_hash_graceful_destroy(HashTable *ht)
_zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p);
}
if (ht->u.flags & HASH_FLAG_INITIALIZED) {
- pefree(HT_GET_DATA_ADDR(ht), ht->u.flags & HASH_FLAG_PERSISTENT);
+ pefree(HT_GET_DATA_ADDR(ht), GC_FLAGS(ht) & IS_ARRAY_PERSISTENT);
}
SET_INCONSISTENT(HT_DESTROYED);
@@ -1476,7 +1458,7 @@ ZEND_API void ZEND_FASTCALL zend_hash_graceful_reverse_destroy(HashTable *ht)
}
if (ht->u.flags & HASH_FLAG_INITIALIZED) {
- pefree(HT_GET_DATA_ADDR(ht), ht->u.flags & HASH_FLAG_PERSISTENT);
+ pefree(HT_GET_DATA_ADDR(ht), GC_FLAGS(ht) & IS_ARRAY_PERSISTENT);
}
SET_INCONSISTENT(HT_DESTROYED);
@@ -1499,7 +1481,6 @@ ZEND_API void ZEND_FASTCALL zend_hash_apply(HashTable *ht, apply_func_t apply_fu
IS_CONSISTENT(ht);
- HASH_PROTECT_RECURSION(ht);
for (idx = 0; idx < ht->nNumUsed; idx++) {
p = ht->arData + idx;
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
@@ -1513,7 +1494,6 @@ ZEND_API void ZEND_FASTCALL zend_hash_apply(HashTable *ht, apply_func_t apply_fu
break;
}
}
- HASH_UNPROTECT_RECURSION(ht);
}
@@ -1525,7 +1505,6 @@ ZEND_API void ZEND_FASTCALL zend_hash_apply_with_argument(HashTable *ht, apply_f
IS_CONSISTENT(ht);
- HASH_PROTECT_RECURSION(ht);
for (idx = 0; idx < ht->nNumUsed; idx++) {
p = ht->arData + idx;
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
@@ -1539,7 +1518,6 @@ ZEND_API void ZEND_FASTCALL zend_hash_apply_with_argument(HashTable *ht, apply_f
break;
}
}
- HASH_UNPROTECT_RECURSION(ht);
}
@@ -1553,8 +1531,6 @@ ZEND_API void ZEND_FASTCALL zend_hash_apply_with_arguments(HashTable *ht, apply_
IS_CONSISTENT(ht);
- HASH_PROTECT_RECURSION(ht);
-
for (idx = 0; idx < ht->nNumUsed; idx++) {
p = ht->arData + idx;
if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue;
@@ -1574,8 +1550,6 @@ ZEND_API void ZEND_FASTCALL zend_hash_apply_with_arguments(HashTable *ht, apply_
}
va_end(args);
}
-
- HASH_UNPROTECT_RECURSION(ht);
}
@@ -1587,7 +1561,6 @@ ZEND_API void ZEND_FASTCALL zend_hash_reverse_apply(HashTable *ht, apply_func_t
IS_CONSISTENT(ht);
- HASH_PROTECT_RECURSION(ht);
idx = ht->nNumUsed;
while (idx > 0) {
idx--;
@@ -1604,7 +1577,6 @@ ZEND_API void ZEND_FASTCALL zend_hash_reverse_apply(HashTable *ht, apply_func_t
break;
}
}
- HASH_UNPROTECT_RECURSION(ht);
}
@@ -1767,7 +1739,7 @@ ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source)
target->pDestructor = source->pDestructor;
if (source->nNumUsed == 0) {
- target->u.flags = (source->u.flags & ~(HASH_FLAG_INITIALIZED|HASH_FLAG_PACKED|HASH_FLAG_PERSISTENT|ZEND_HASH_APPLY_COUNT_MASK)) | HASH_FLAG_APPLY_PROTECTION | HASH_FLAG_STATIC_KEYS;
+ target->u.flags = (source->u.flags & ~(HASH_FLAG_INITIALIZED|HASH_FLAG_PACKED)) | HASH_FLAG_STATIC_KEYS;
target->nTableMask = HT_MIN_MASK;
target->nNumUsed = 0;
target->nNumOfElements = 0;
@@ -1775,7 +1747,7 @@ ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source)
target->nInternalPointer = HT_INVALID_IDX;
HT_SET_DATA_ADDR(target, &uninitialized_bucket);
} else if (GC_FLAGS(source) & IS_ARRAY_IMMUTABLE) {
- target->u.flags = (source->u.flags & ~HASH_FLAG_PERSISTENT) | HASH_FLAG_APPLY_PROTECTION;
+ target->u.flags = source->u.flags;
target->nTableMask = source->nTableMask;
target->nNumUsed = source->nNumUsed;
target->nNumOfElements = source->nNumOfElements;
@@ -1792,7 +1764,7 @@ ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source)
target->nInternalPointer = idx;
}
} else if (source->u.flags & HASH_FLAG_PACKED) {
- target->u.flags = (source->u.flags & ~(HASH_FLAG_PERSISTENT|ZEND_HASH_APPLY_COUNT_MASK)) | HASH_FLAG_APPLY_PROTECTION;
+ target->u.flags = source->u.flags;
target->nTableMask = source->nTableMask;
target->nNumUsed = source->nNumUsed;
target->nNumOfElements = source->nNumOfElements;
@@ -1815,7 +1787,7 @@ ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source)
target->nInternalPointer = idx;
}
} else {
- target->u.flags = (source->u.flags & ~(HASH_FLAG_PERSISTENT|ZEND_HASH_APPLY_COUNT_MASK)) | HASH_FLAG_APPLY_PROTECTION;
+ target->u.flags = source->u.flags;
target->nTableMask = source->nTableMask;
target->nNextFreeElement = source->nNextFreeElement;
target->nInternalPointer = source->nInternalPointer;
@@ -2294,12 +2266,12 @@ ZEND_API int ZEND_FASTCALL zend_hash_sort_ex(HashTable *ht, sort_func_t sort, co
void *new_data, *old_data = HT_GET_DATA_ADDR(ht);
Bucket *old_buckets = ht->arData;
- new_data = pemalloc(HT_SIZE_EX(ht->nTableSize, HT_MIN_MASK), (ht->u.flags & HASH_FLAG_PERSISTENT));
+ new_data = pemalloc(HT_SIZE_EX(ht->nTableSize, HT_MIN_MASK), (GC_FLAGS(ht) & IS_ARRAY_PERSISTENT));
ht->u.flags |= HASH_FLAG_PACKED | HASH_FLAG_STATIC_KEYS;
ht->nTableMask = HT_MIN_MASK;
HT_SET_DATA_ADDR(ht, new_data);
memcpy(ht->arData, old_buckets, sizeof(Bucket) * ht->nNumUsed);
- pefree(old_data, ht->u.flags & HASH_FLAG_PERSISTENT & HASH_FLAG_PERSISTENT);
+ pefree(old_data, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT);
HT_HASH_RESET_PACKED(ht);
} else {
zend_hash_rehash(ht);
@@ -2393,11 +2365,25 @@ ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t co
IS_CONSISTENT(ht1);
IS_CONSISTENT(ht2);
- HASH_PROTECT_RECURSION(ht1);
- HASH_PROTECT_RECURSION(ht2);
+ if (ht1 == ht2) {
+ return 0;
+ }
+
+ /* It's enough to protect only one of the arrays.
+ * The second one may be referenced from the first and this may cause
+ * false recursion detection.
+ */
+ if (UNEXPECTED(GC_IS_RECURSIVE(ht1))) {
+ zend_error_noreturn(E_ERROR, "Nesting level too deep - recursive dependency?");
+ }
+
+ if (!(GC_FLAGS(ht1) & GC_IMMUTABLE)) {
+ GC_PROTECT_RECURSION(ht1);
+ }
result = zend_hash_compare_impl(ht1, ht2, compar, ordered);
- HASH_UNPROTECT_RECURSION(ht1);
- HASH_UNPROTECT_RECURSION(ht2);
+ if (!(GC_FLAGS(ht1) & GC_IMMUTABLE)) {
+ GC_UNPROTECT_RECURSION(ht1);
+ }
return result;
}
@@ -2507,9 +2493,7 @@ ZEND_API HashTable* ZEND_FASTCALL zend_symtable_to_proptable(HashTable *ht)
convert:
{
- HashTable *new_ht = emalloc(sizeof(HashTable));
-
- zend_hash_init(new_ht, zend_hash_num_elements(ht), NULL, ZVAL_PTR_DTOR, 0);
+ HashTable *new_ht = zend_new_array(zend_hash_num_elements(ht));
ZEND_HASH_FOREACH_KEY_VAL(ht, num_key, str_key, zv) {
if (!str_key) {
@@ -2567,9 +2551,7 @@ ZEND_API HashTable* ZEND_FASTCALL zend_proptable_to_symtable(HashTable *ht, zend
convert:
{
- HashTable *new_ht = emalloc(sizeof(HashTable));
-
- zend_hash_init(new_ht, zend_hash_num_elements(ht), NULL, ZVAL_PTR_DTOR, 0);
+ HashTable *new_ht = zend_new_array(zend_hash_num_elements(ht));
ZEND_HASH_FOREACH_KEY_VAL(ht, num_key, str_key, zv) {
do {
diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h
index fc91dfb8c9..e9518b8840 100644
--- a/Zend/zend_hash.h
+++ b/Zend/zend_hash.h
@@ -35,8 +35,6 @@
#define HASH_ADD_NEW (1<<3)
#define HASH_ADD_NEXT (1<<4)
-#define HASH_FLAG_PERSISTENT (1<<0)
-#define HASH_FLAG_APPLY_PROTECTION (1<<1)
#define HASH_FLAG_PACKED (1<<2)
#define HASH_FLAG_INITIALIZED (1<<3)
#define HASH_FLAG_STATIC_KEYS (1<<4) /* long and interned strings */
@@ -68,12 +66,14 @@ typedef zend_bool (*merge_checker_func_t)(HashTable *target_ht, zval *source_dat
BEGIN_EXTERN_C()
/* startup/shutdown */
-ZEND_API void ZEND_FASTCALL _zend_hash_init(HashTable *ht, uint32_t nSize, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC);
-ZEND_API void ZEND_FASTCALL _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_FASTCALL _zend_hash_init(HashTable *ht, uint32_t nSize, dtor_func_t pDestructor, zend_bool persistent);
ZEND_API void ZEND_FASTCALL zend_hash_destroy(HashTable *ht);
ZEND_API void ZEND_FASTCALL 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)
+
+#define zend_hash_init(ht, nSize, pHashFunction, pDestructor, persistent) \
+ _zend_hash_init((ht), (nSize), (pDestructor), (persistent))
+#define zend_hash_init_ex(ht, nSize, pHashFunction, pDestructor, persistent, bApplyProtection) \
+ _zend_hash_init((ht), (nSize), (pDestructor), (persistent))
ZEND_API void ZEND_FASTCALL zend_hash_real_init(HashTable *ht, zend_bool packed);
ZEND_API void ZEND_FASTCALL zend_hash_packed_to_hash(HashTable *ht);
@@ -250,6 +250,10 @@ ZEND_API zval* ZEND_FASTCALL zend_hash_minmax(const HashTable *ht, compare_func_
ZEND_API int ZEND_FASTCALL zend_hash_rehash(HashTable *ht);
+#define zend_new_array(size) \
+ _zend_new_array(size ZEND_FILE_LINE_CC)
+
+ZEND_API HashTable* ZEND_FASTCALL _zend_new_array(uint32_t size ZEND_FILE_LINE_DC);
ZEND_API uint32_t zend_array_count(HashTable *ht);
ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source);
ZEND_API void ZEND_FASTCALL zend_array_destroy(HashTable *ht);
@@ -614,7 +618,7 @@ static zend_always_inline void *zend_hash_add_mem(HashTable *ht, zend_string *ke
ZVAL_PTR(&tmp, NULL);
if ((zv = zend_hash_add(ht, key, &tmp))) {
- Z_PTR_P(zv) = pemalloc(size, ht->u.flags & HASH_FLAG_PERSISTENT);
+ Z_PTR_P(zv) = pemalloc(size, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT);
memcpy(Z_PTR_P(zv), pData, size);
return Z_PTR_P(zv);
}
@@ -627,7 +631,7 @@ static zend_always_inline void *zend_hash_str_add_mem(HashTable *ht, const char
ZVAL_PTR(&tmp, NULL);
if ((zv = zend_hash_str_add(ht, str, len, &tmp))) {
- Z_PTR_P(zv) = pemalloc(size, ht->u.flags & HASH_FLAG_PERSISTENT);
+ Z_PTR_P(zv) = pemalloc(size, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT);
memcpy(Z_PTR_P(zv), pData, size);
return Z_PTR_P(zv);
}
@@ -638,7 +642,7 @@ static zend_always_inline void *zend_hash_update_mem(HashTable *ht, zend_string
{
void *p;
- p = pemalloc(size, ht->u.flags & HASH_FLAG_PERSISTENT);
+ p = pemalloc(size, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT);
memcpy(p, pData, size);
return zend_hash_update_ptr(ht, key, p);
}
@@ -647,7 +651,7 @@ static zend_always_inline void *zend_hash_str_update_mem(HashTable *ht, const ch
{
void *p;
- p = pemalloc(size, ht->u.flags & HASH_FLAG_PERSISTENT);
+ p = pemalloc(size, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT);
memcpy(p, pData, size);
return zend_hash_str_update_ptr(ht, str, len, p);
}
@@ -690,7 +694,7 @@ static zend_always_inline void *zend_hash_index_add_mem(HashTable *ht, zend_ulon
ZVAL_PTR(&tmp, NULL);
if ((zv = zend_hash_index_add(ht, h, &tmp))) {
- Z_PTR_P(zv) = pemalloc(size, ht->u.flags & HASH_FLAG_PERSISTENT);
+ Z_PTR_P(zv) = pemalloc(size, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT);
memcpy(Z_PTR_P(zv), pData, size);
return Z_PTR_P(zv);
}
@@ -715,7 +719,7 @@ static zend_always_inline void *zend_hash_index_update_mem(HashTable *ht, zend_u
{
void *p;
- p = pemalloc(size, ht->u.flags & HASH_FLAG_PERSISTENT);
+ p = pemalloc(size, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT);
memcpy(p, pData, size);
return zend_hash_index_update_ptr(ht, h, p);
}
@@ -726,7 +730,7 @@ static zend_always_inline void *zend_hash_next_index_insert_mem(HashTable *ht, v
ZVAL_PTR(&tmp, NULL);
if ((zv = zend_hash_next_index_insert(ht, &tmp))) {
- Z_PTR_P(zv) = pemalloc(size, ht->u.flags & HASH_FLAG_PERSISTENT);
+ Z_PTR_P(zv) = pemalloc(size, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT);
memcpy(Z_PTR_P(zv), pData, size);
return Z_PTR_P(zv);
}
@@ -978,16 +982,6 @@ static zend_always_inline void *zend_hash_get_current_data_ptr_ex(HashTable *ht,
_key = _p->key; \
_val = _z;
-#define ZEND_HASH_APPLY_PROTECTION(ht) \
- ((ht)->u.flags & HASH_FLAG_APPLY_PROTECTION)
-
-#define ZEND_HASH_APPLY_SHIFT 8
-#define ZEND_HASH_APPLY_COUNT_MASK 0xff00
-#define ZEND_HASH_GET_APPLY_COUNT(ht) (((ht)->u.flags & ZEND_HASH_APPLY_COUNT_MASK) >> ZEND_HASH_APPLY_SHIFT)
-#define ZEND_HASH_INC_APPLY_COUNT(ht) ((ht)->u.flags += (1 << ZEND_HASH_APPLY_SHIFT))
-#define ZEND_HASH_DEC_APPLY_COUNT(ht) ((ht)->u.flags -= (1 << ZEND_HASH_APPLY_SHIFT))
-
-
/* The following macros are useful to insert a sequence of new elements
* of packed array. They may be use insted of series of
* zend_hash_next_index_insert_new()
diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c
index 7689a7c963..b607efa5c9 100644
--- a/Zend/zend_inheritance.c
+++ b/Zend/zend_inheritance.c
@@ -495,11 +495,9 @@ static ZEND_COLD zend_string *zend_get_function_declaration(const zend_function
}
}
if (precv && precv->opcode == ZEND_RECV_INIT && precv->op2_type != IS_UNUSED) {
- zval *zv = RT_CONSTANT(&fptr->op_array, precv->op2);
+ zval *zv = RT_CONSTANT(precv, precv->op2);
- if (Z_TYPE_P(zv) == IS_CONSTANT) {
- smart_str_append(&str, Z_STR_P(zv));
- } else if (Z_TYPE_P(zv) == IS_FALSE) {
+ if (Z_TYPE_P(zv) == IS_FALSE) {
smart_str_appends(&str, "false");
} else if (Z_TYPE_P(zv) == IS_TRUE) {
smart_str_appends(&str, "true");
@@ -515,7 +513,12 @@ static ZEND_COLD zend_string *zend_get_function_declaration(const zend_function
} else if (Z_TYPE_P(zv) == IS_ARRAY) {
smart_str_appends(&str, "Array");
} else if (Z_TYPE_P(zv) == IS_CONSTANT_AST) {
- smart_str_appends(&str, "<expression>");
+ zend_ast *ast = Z_ASTVAL_P(zv);
+ if (ast->kind == ZEND_AST_CONSTANT) {
+ smart_str_append(&str, zend_ast_get_constant_name(ast));
+ } else {
+ smart_str_appends(&str, "<expression>");
+ }
} else {
zend_string *zv_str = zval_get_string(zv);
smart_str_append(&str, zv_str);
@@ -769,7 +772,7 @@ static void do_inherit_class_constant(zend_string *name, zend_class_constant *pa
ZSTR_VAL(ce->name), ZSTR_VAL(name), zend_visibility_string(Z_ACCESS_FLAGS(parent_const->value)), ZSTR_VAL(ce->parent->name), (Z_ACCESS_FLAGS(parent_const->value) & ZEND_ACC_PUBLIC) ? "" : " or weaker");
}
} else if (!(Z_ACCESS_FLAGS(parent_const->value) & ZEND_ACC_PRIVATE)) {
- if (Z_CONSTANT(parent_const->value)) {
+ if (Z_TYPE(parent_const->value) == IS_CONSTANT_AST) {
ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED;
}
if (ce->type & ZEND_INTERNAL_CLASS) {
@@ -845,7 +848,7 @@ ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent
#ifdef ZTS
if (parent_ce->type != ce->type) {
ZVAL_DUP(dst, src);
- if (Z_OPT_CONSTANT_P(dst)) {
+ if (Z_OPT_TYPE_P(dst) == IS_CONSTANT_AST) {
ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED;
}
continue;
@@ -853,7 +856,7 @@ ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent
#endif
ZVAL_COPY(dst, src);
- if (Z_OPT_CONSTANT_P(dst)) {
+ if (Z_OPT_TYPE_P(dst) == IS_CONSTANT_AST) {
ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED;
}
} while (dst != end);
@@ -894,7 +897,7 @@ ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent
}
ZVAL_COPY_VALUE(dst, src);
Z_ADDREF_P(dst);
- if (Z_CONSTANT_P(Z_REFVAL_P(dst))) {
+ if (Z_TYPE_P(Z_REFVAL_P(dst)) == IS_CONSTANT_AST) {
ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED;
}
} while (dst != end);
@@ -982,7 +985,7 @@ static void do_inherit_iface_constant(zend_string *name, zend_class_constant *c,
{
if (do_inherit_constant_check(&ce->constants_table, c, name, iface)) {
zend_class_constant *ct;
- if (Z_CONSTANT(c->value)) {
+ if (Z_TYPE(c->value) == IS_CONSTANT_AST) {
ce->ce_flags &= ~ZEND_ACC_CONSTANTS_UPDATED;
}
if (ce->type & ZEND_INTERNAL_CLASS) {
diff --git a/Zend/zend_ini.c b/Zend/zend_ini.c
index 54ee149222..b9212d6d8b 100644
--- a/Zend/zend_ini.c
+++ b/Zend/zend_ini.c
@@ -658,7 +658,7 @@ ZEND_API ZEND_INI_MH(OnUpdateLong) /* {{{ */
p = (zend_long *) (base+(size_t) mh_arg1);
- *p = zend_atol(ZSTR_VAL(new_value), (int)ZSTR_LEN(new_value));
+ *p = zend_atol(ZSTR_VAL(new_value), ZSTR_LEN(new_value));
return SUCCESS;
}
/* }}} */
@@ -674,7 +674,7 @@ ZEND_API ZEND_INI_MH(OnUpdateLongGEZero) /* {{{ */
base = (char *) ts_resource(*((int *) mh_arg2));
#endif
- tmp = zend_atol(ZSTR_VAL(new_value), (int)ZSTR_LEN(new_value));
+ tmp = zend_atol(ZSTR_VAL(new_value), ZSTR_LEN(new_value));
if (tmp < 0) {
return FAILURE;
}
diff --git a/Zend/zend_ini.h b/Zend/zend_ini.h
index 41d38adcef..7c4fa39025 100644
--- a/Zend/zend_ini.h
+++ b/Zend/zend_ini.h
@@ -38,10 +38,10 @@ typedef struct _zend_ini_entry_def {
void *mh_arg3;
const char *value;
void (*displayer)(zend_ini_entry *ini_entry, int type);
- int modifiable;
- uint32_t name_length;
uint32_t value_length;
+ uint16_t name_length;
+ uint8_t modifiable;
} zend_ini_entry_def;
struct _zend_ini_entry {
@@ -53,11 +53,13 @@ struct _zend_ini_entry {
zend_string *value;
zend_string *orig_value;
void (*displayer)(zend_ini_entry *ini_entry, int type);
- int modifiable;
- int orig_modifiable;
- int modified;
int module_number;
+
+ uint8_t modifiable;
+ uint8_t orig_modifiable;
+ uint8_t modified;
+
};
BEGIN_EXTERN_C()
@@ -97,7 +99,7 @@ END_EXTERN_C()
#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) \
- { name, on_modify, arg1, arg2, arg3, default_value, displayer, modifiable, sizeof(name)-1, sizeof(default_value)-1 },
+ { name, on_modify, arg1, arg2, arg3, default_value, displayer, sizeof(default_value)-1, sizeof(name)-1, modifiable },
#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_object_handlers.c b/Zend/zend_object_handlers.c
index df675a987d..6e709cdfaa 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -35,24 +35,15 @@
#define DEBUG_OBJECT_HANDLERS 0
+#define ZEND_WRONG_PROPERTY_OFFSET 0
+#define ZEND_DYNAMIC_PROPERTY_OFFSET ((uint32_t)(-1))
+
/* guard flags */
#define IN_GET (1<<0)
#define IN_SET (1<<1)
#define IN_UNSET (1<<2)
#define IN_ISSET (1<<3)
-#define Z_OBJ_PROTECT_RECURSION(zval_p) \
- do { \
- if (Z_OBJ_APPLY_COUNT_P(zval_p) >= 3) { \
- zend_error_noreturn(E_ERROR, "Nesting level too deep - recursive dependency?"); \
- } \
- Z_OBJ_INC_APPLY_COUNT_P(zval_p); \
- } while (0)
-
-
-#define Z_OBJ_UNPROTECT_RECURSION(zval_p) \
- Z_OBJ_DEC_APPLY_COUNT_P(zval_p)
-
/*
__X accessors explanation:
@@ -76,8 +67,7 @@ ZEND_API void rebuild_object_properties(zend_object *zobj) /* {{{ */
zend_property_info *prop_info;
zend_class_entry *ce = zobj->ce;
- ALLOC_HASHTABLE(zobj->properties);
- zend_hash_init(zobj->properties, ce->default_properties_count, NULL, ZVAL_PTR_DTOR, 0);
+ zobj->properties = zend_new_array(ce->default_properties_count);
if (ce->default_properties_count) {
zend_hash_real_init(zobj->properties, 0);
zobj->properties->nInternalPointer = 0;
@@ -177,8 +167,7 @@ ZEND_API HashTable *zend_std_get_debug_info(zval *object, int *is_temp) /* {{{ *
}
} else if (Z_TYPE(retval) == IS_NULL) {
*is_temp = 1;
- ALLOC_HASHTABLE(ht);
- zend_hash_init(ht, 0, NULL, ZVAL_PTR_DTOR, 0);
+ ht = zend_new_array(0);
return ht;
}
@@ -582,13 +571,13 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_
/* make zend_get_property_info silent if we have getter - we may want to use it */
property_offset = zend_get_property_offset(zobj->ce, Z_STR_P(member), (type == BP_VAR_IS) || (zobj->ce->__get != NULL), cache_slot);
- if (EXPECTED(property_offset != ZEND_WRONG_PROPERTY_OFFSET)) {
- if (EXPECTED(property_offset != ZEND_DYNAMIC_PROPERTY_OFFSET)) {
- retval = OBJ_PROP(zobj, property_offset);
- if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) {
- goto exit;
- }
- } else if (EXPECTED(zobj->properties != NULL)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(property_offset))) {
+ retval = OBJ_PROP(zobj, property_offset);
+ if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) {
+ goto exit;
+ }
+ } else if (EXPECTED(IS_DYNAMIC_PROPERTY_OFFSET(property_offset))) {
+ if (EXPECTED(zobj->properties != NULL)) {
retval = zend_hash_find(zobj->properties, Z_STR_P(member));
if (EXPECTED(retval)) goto exit;
}
@@ -688,13 +677,13 @@ ZEND_API void zend_std_write_property(zval *object, zval *member, zval *value, v
property_offset = zend_get_property_offset(zobj->ce, Z_STR_P(member), (zobj->ce->__set != NULL), cache_slot);
- if (EXPECTED(property_offset != ZEND_WRONG_PROPERTY_OFFSET)) {
- if (EXPECTED(property_offset != ZEND_DYNAMIC_PROPERTY_OFFSET)) {
- variable_ptr = OBJ_PROP(zobj, property_offset);
- if (Z_TYPE_P(variable_ptr) != IS_UNDEF) {
- goto found;
- }
- } else if (EXPECTED(zobj->properties != NULL)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(property_offset))) {
+ variable_ptr = OBJ_PROP(zobj, property_offset);
+ if (Z_TYPE_P(variable_ptr) != IS_UNDEF) {
+ goto found;
+ }
+ } else if (EXPECTED(IS_DYNAMIC_PROPERTY_OFFSET(property_offset))) {
+ if (EXPECTED(zobj->properties != NULL)) {
if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) {
if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) {
GC_REFCOUNT(zobj->properties)--;
@@ -723,7 +712,7 @@ found:
zend_std_call_setter(&tmp_object, member, value);
(*guard) &= ~IN_SET;
zval_ptr_dtor(&tmp_object);
- } else if (EXPECTED(property_offset != ZEND_WRONG_PROPERTY_OFFSET)) {
+ } else if (EXPECTED(!IS_WRONG_PROPERTY_OFFSET(property_offset))) {
goto write_std_property;
} else {
if (Z_STRVAL_P(member)[0] == '\0' && Z_STRLEN_P(member) != 0) {
@@ -731,7 +720,7 @@ found:
goto exit;
}
}
- } else if (EXPECTED(property_offset != ZEND_WRONG_PROPERTY_OFFSET)) {
+ } else if (EXPECTED(!IS_WRONG_PROPERTY_OFFSET(property_offset))) {
zval tmp;
write_std_property:
@@ -744,7 +733,7 @@ write_std_property:
Z_ADDREF_P(value);
}
}
- if (EXPECTED(property_offset != ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(property_offset))) {
ZVAL_COPY_VALUE(OBJ_PROP(zobj, property_offset), value);
} else {
if (!zobj->properties) {
@@ -878,49 +867,47 @@ static zval *zend_std_get_property_ptr_ptr(zval *object, zval *member, int type,
property_offset = zend_get_property_offset(zobj->ce, name, (zobj->ce->__get != NULL), cache_slot);
- if (EXPECTED(property_offset != ZEND_WRONG_PROPERTY_OFFSET)) {
- if (EXPECTED(property_offset != ZEND_DYNAMIC_PROPERTY_OFFSET)) {
- retval = OBJ_PROP(zobj, property_offset);
- if (UNEXPECTED(Z_TYPE_P(retval) == IS_UNDEF)) {
- if (EXPECTED(!zobj->ce->__get) ||
- UNEXPECTED((*zend_get_property_guard(zobj, name)) & IN_GET)) {
- ZVAL_NULL(retval);
- /* Notice is thrown after creation of the property, to avoid EG(std_property_info)
- * being overwritten in an error handler. */
- if (UNEXPECTED(type == BP_VAR_RW || type == BP_VAR_R)) {
- zend_error(E_NOTICE, "Undefined property: %s::$%s", ZSTR_VAL(zobj->ce->name), ZSTR_VAL(name));
- }
- } else {
- /* we do have getter - fail and let it try again with usual get/set */
- retval = NULL;
- }
- }
- } else {
- if (EXPECTED(zobj->properties)) {
- if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) {
- if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) {
- GC_REFCOUNT(zobj->properties)--;
- }
- zobj->properties = zend_array_dup(zobj->properties);
- }
- if (EXPECTED((retval = zend_hash_find(zobj->properties, name)) != NULL)) {
- if (UNEXPECTED(Z_TYPE_P(member) != IS_STRING)) {
- zend_string_release(name);
- }
- return retval;
- }
- }
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(property_offset))) {
+ retval = OBJ_PROP(zobj, property_offset);
+ if (UNEXPECTED(Z_TYPE_P(retval) == IS_UNDEF)) {
if (EXPECTED(!zobj->ce->__get) ||
UNEXPECTED((*zend_get_property_guard(zobj, name)) & IN_GET)) {
- if (UNEXPECTED(!zobj->properties)) {
- rebuild_object_properties(zobj);
- }
- retval = zend_hash_update(zobj->properties, name, &EG(uninitialized_zval));
+ ZVAL_NULL(retval);
/* Notice is thrown after creation of the property, to avoid EG(std_property_info)
* being overwritten in an error handler. */
if (UNEXPECTED(type == BP_VAR_RW || type == BP_VAR_R)) {
zend_error(E_NOTICE, "Undefined property: %s::$%s", ZSTR_VAL(zobj->ce->name), ZSTR_VAL(name));
}
+ } else {
+ /* we do have getter - fail and let it try again with usual get/set */
+ retval = NULL;
+ }
+ }
+ } else if (EXPECTED(IS_DYNAMIC_PROPERTY_OFFSET(property_offset))) {
+ if (EXPECTED(zobj->properties)) {
+ if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) {
+ if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) {
+ GC_REFCOUNT(zobj->properties)--;
+ }
+ zobj->properties = zend_array_dup(zobj->properties);
+ }
+ if (EXPECTED((retval = zend_hash_find(zobj->properties, name)) != NULL)) {
+ if (UNEXPECTED(Z_TYPE_P(member) != IS_STRING)) {
+ zend_string_release(name);
+ }
+ return retval;
+ }
+ }
+ if (EXPECTED(!zobj->ce->__get) ||
+ UNEXPECTED((*zend_get_property_guard(zobj, name)) & IN_GET)) {
+ if (UNEXPECTED(!zobj->properties)) {
+ rebuild_object_properties(zobj);
+ }
+ retval = zend_hash_update(zobj->properties, name, &EG(uninitialized_zval));
+ /* Notice is thrown after creation of the property, to avoid EG(std_property_info)
+ * being overwritten in an error handler. */
+ if (UNEXPECTED(type == BP_VAR_RW || type == BP_VAR_R)) {
+ zend_error(E_NOTICE, "Undefined property: %s::$%s", ZSTR_VAL(zobj->ce->name), ZSTR_VAL(name));
}
}
}
@@ -949,28 +936,27 @@ static void zend_std_unset_property(zval *object, zval *member, void **cache_slo
property_offset = zend_get_property_offset(zobj->ce, Z_STR_P(member), (zobj->ce->__unset != NULL), cache_slot);
- if (EXPECTED(property_offset != ZEND_WRONG_PROPERTY_OFFSET)) {
- if (EXPECTED(property_offset != ZEND_DYNAMIC_PROPERTY_OFFSET)) {
- zval *slot = OBJ_PROP(zobj, property_offset);
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(property_offset))) {
+ zval *slot = OBJ_PROP(zobj, property_offset);
- if (Z_TYPE_P(slot) != IS_UNDEF) {
- zval_ptr_dtor(slot);
- ZVAL_UNDEF(slot);
- if (zobj->properties) {
- zobj->properties->u.v.flags |= HASH_FLAG_HAS_EMPTY_IND;
- }
- goto exit;
- }
- } else if (EXPECTED(zobj->properties != NULL)) {
- if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) {
- if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) {
- GC_REFCOUNT(zobj->properties)--;
- }
- zobj->properties = zend_array_dup(zobj->properties);
+ if (Z_TYPE_P(slot) != IS_UNDEF) {
+ zval_ptr_dtor(slot);
+ ZVAL_UNDEF(slot);
+ if (zobj->properties) {
+ zobj->properties->u.v.flags |= HASH_FLAG_HAS_EMPTY_IND;
}
- if (EXPECTED(zend_hash_del(zobj->properties, Z_STR_P(member)) != FAILURE)) {
- goto exit;
+ goto exit;
+ }
+ } else if (EXPECTED(IS_DYNAMIC_PROPERTY_OFFSET(property_offset))
+ && EXPECTED(zobj->properties != NULL)) {
+ if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) {
+ if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) {
+ GC_REFCOUNT(zobj->properties)--;
}
+ zobj->properties = zend_array_dup(zobj->properties);
+ }
+ if (EXPECTED(zend_hash_del(zobj->properties, Z_STR_P(member)) != FAILURE)) {
+ goto exit;
}
} else if (UNEXPECTED(EG(exception))) {
goto exit;
@@ -1446,6 +1432,9 @@ static int zend_std_compare_objects(zval *o1, zval *o2) /* {{{ */
zobj1 = Z_OBJ_P(o1);
zobj2 = Z_OBJ_P(o2);
+ if (zobj1 == zobj2) {
+ return 0; /* the same object */
+ }
if (zobj1->ce != zobj2->ce) {
return 1; /* different classes */
}
@@ -1458,40 +1447,43 @@ static int zend_std_compare_objects(zval *o1, zval *o2) /* {{{ */
p1 = zobj1->properties_table;
p2 = zobj2->properties_table;
end = p1 + zobj1->ce->default_properties_count;
- Z_OBJ_PROTECT_RECURSION(o1);
- Z_OBJ_PROTECT_RECURSION(o2);
+
+ /* It's enough to protect only one of the objects.
+ * The second one may be referenced from the first and this may cause
+ * false recursion detection.
+ */
+ /* use bitwise OR to make only one conditional jump */
+ if (UNEXPECTED(Z_IS_RECURSIVE_P(o1))) {
+ zend_error_noreturn(E_ERROR, "Nesting level too deep - recursive dependency?");
+ }
+ Z_PROTECT_RECURSION_P(o1);
do {
if (Z_TYPE_P(p1) != IS_UNDEF) {
if (Z_TYPE_P(p2) != IS_UNDEF) {
zval result;
if (compare_function(&result, p1, p2)==FAILURE) {
- Z_OBJ_UNPROTECT_RECURSION(o1);
- Z_OBJ_UNPROTECT_RECURSION(o2);
+ Z_UNPROTECT_RECURSION_P(o1);
return 1;
}
if (Z_LVAL(result) != 0) {
- Z_OBJ_UNPROTECT_RECURSION(o1);
- Z_OBJ_UNPROTECT_RECURSION(o2);
+ Z_UNPROTECT_RECURSION_P(o1);
return Z_LVAL(result);
}
} else {
- Z_OBJ_UNPROTECT_RECURSION(o1);
- Z_OBJ_UNPROTECT_RECURSION(o2);
+ Z_UNPROTECT_RECURSION_P(o1);
return 1;
}
} else {
if (Z_TYPE_P(p2) != IS_UNDEF) {
- Z_OBJ_UNPROTECT_RECURSION(o1);
- Z_OBJ_UNPROTECT_RECURSION(o2);
+ Z_UNPROTECT_RECURSION_P(o1);
return 1;
}
}
p1++;
p2++;
} while (p1 != end);
- Z_OBJ_UNPROTECT_RECURSION(o1);
- Z_OBJ_UNPROTECT_RECURSION(o2);
+ Z_UNPROTECT_RECURSION_P(o1);
return 0;
} else {
if (!zobj1->properties) {
@@ -1524,13 +1516,13 @@ static int zend_std_has_property(zval *object, zval *member, int has_set_exists,
property_offset = zend_get_property_offset(zobj->ce, Z_STR_P(member), 1, cache_slot);
- if (EXPECTED(property_offset != ZEND_WRONG_PROPERTY_OFFSET)) {
- if (EXPECTED(property_offset != ZEND_DYNAMIC_PROPERTY_OFFSET)) {
- value = OBJ_PROP(zobj, property_offset);
- if (Z_TYPE_P(value) != IS_UNDEF) {
- goto found;
- }
- } else if (EXPECTED(zobj->properties != NULL) &&
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(property_offset))) {
+ value = OBJ_PROP(zobj, property_offset);
+ if (Z_TYPE_P(value) != IS_UNDEF) {
+ goto found;
+ }
+ } else if (EXPECTED(IS_DYNAMIC_PROPERTY_OFFSET(property_offset))) {
+ if (EXPECTED(zobj->properties != NULL) &&
(value = zend_hash_find(zobj->properties, Z_STR_P(member))) != NULL) {
found:
switch (has_set_exists) {
diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h
index 819185320f..656ff4881c 100644
--- a/Zend/zend_object_handlers.h
+++ b/Zend/zend_object_handlers.h
@@ -27,8 +27,9 @@ struct _zend_property_info;
#define ZEND_WRONG_PROPERTY_INFO \
((struct _zend_property_info*)((zend_intptr_t)-1))
-#define ZEND_DYNAMIC_PROPERTY_OFFSET ((uint32_t)(-1))
-#define ZEND_WRONG_PROPERTY_OFFSET ((uint32_t)(-2))
+#define IS_VALID_PROPERTY_OFFSET(offset) ((int32_t)(offset) > 0)
+#define IS_WRONG_PROPERTY_OFFSET(offset) ((int32_t)(offset) == 0)
+#define IS_DYNAMIC_PROPERTY_OFFSET(offset) ((int32_t)(offset) < 0)
/* The following rule applies to read_property() and read_dimension() implementations:
If you return a zval which is not otherwise referenced by the extension or the engine's
diff --git a/Zend/zend_objects.c b/Zend/zend_objects.c
index d5c375f6ed..123e5db238 100644
--- a/Zend/zend_objects.c
+++ b/Zend/zend_objects.c
@@ -197,8 +197,7 @@ ZEND_API void zend_objects_clone_members(zend_object *new_object, zend_object *o
zend_string *key;
if (!new_object->properties) {
- ALLOC_HASHTABLE(new_object->properties);
- zend_hash_init(new_object->properties, zend_hash_num_elements(old_object->properties), NULL, ZVAL_PTR_DTOR, 0);
+ new_object->properties = zend_new_array(zend_hash_num_elements(old_object->properties));
zend_hash_real_init(new_object->properties, 0);
} else {
zend_hash_extend(new_object->properties, new_object->properties->nNumUsed + zend_hash_num_elements(old_object->properties), 0);
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c
index e89a388037..8a29807412 100644
--- a/Zend/zend_opcode.c
+++ b/Zend/zend_opcode.c
@@ -291,7 +291,7 @@ ZEND_API void destroy_zend_class(zval *zv)
ZEND_HASH_FOREACH_PTR(&ce->constants_table, c) {
if (c->ce == ce) {
- zval_ptr_dtor(&c->value);
+ zval_ptr_dtor_nogc(&c->value);
if (c->doc_comment) {
zend_string_release(c->doc_comment);
}
@@ -407,7 +407,10 @@ ZEND_API void destroy_op_array(zend_op_array *op_array)
zval_ptr_dtor_nogc(literal);
literal++;
}
- efree(op_array->literals);
+ if (ZEND_USE_ABS_CONST_ADDR
+ || !(op_array->fn_flags & ZEND_ACC_DONE_PASS_TWO)) {
+ efree(op_array->literals);
+ }
}
efree(op_array->opcodes);
@@ -576,6 +579,8 @@ ZEND_API int pass_two(zend_op_array *op_array)
op_array->vars = (zend_string**) erealloc(op_array->vars, sizeof(zend_string*)*op_array->last_var);
CG(context).vars_size = op_array->last_var;
}
+
+#if ZEND_USE_ABS_CONST_ADDR
if (CG(context).opcodes_size != op_array->last) {
op_array->opcodes = (zend_op *) erealloc(op_array->opcodes, sizeof(zend_op)*op_array->last);
CG(context).opcodes_size = op_array->last;
@@ -584,6 +589,20 @@ ZEND_API int pass_two(zend_op_array *op_array)
op_array->literals = (zval*)erealloc(op_array->literals, sizeof(zval) * op_array->last_literal);
CG(context).literals_size = op_array->last_literal;
}
+#else
+ op_array->opcodes = (zend_op *) erealloc(op_array->opcodes,
+ ZEND_MM_ALIGNED_SIZE_EX(sizeof(zend_op) * op_array->last, 16) +
+ sizeof(zval) * op_array->last_literal);
+ if (op_array->literals) {
+ memcpy(((char*)op_array->opcodes) + ZEND_MM_ALIGNED_SIZE_EX(sizeof(zend_op) * op_array->last, 16),
+ op_array->literals, sizeof(zval) * op_array->last_literal);
+ efree(op_array->literals);
+ op_array->literals = (zval*)(((char*)op_array->opcodes) + ZEND_MM_ALIGNED_SIZE_EX(sizeof(zend_op) * op_array->last, 16));
+ }
+ CG(context).opcodes_size = op_array->last;
+ CG(context).literals_size = op_array->last_literal;
+#endif
+
opline = op_array->opcodes;
end = opline + op_array->last;
while (opline < end) {
@@ -671,12 +690,12 @@ ZEND_API int pass_two(zend_op_array *op_array)
}
}
if (opline->op1_type == IS_CONST) {
- ZEND_PASS_TWO_UPDATE_CONSTANT(op_array, opline->op1);
+ ZEND_PASS_TWO_UPDATE_CONSTANT(op_array, opline, opline->op1);
} else if (opline->op1_type & (IS_VAR|IS_TMP_VAR)) {
opline->op1.var = (uint32_t)(zend_intptr_t)ZEND_CALL_VAR_NUM(NULL, op_array->last_var + opline->op1.var);
}
if (opline->op2_type == IS_CONST) {
- ZEND_PASS_TWO_UPDATE_CONSTANT(op_array, opline->op2);
+ ZEND_PASS_TWO_UPDATE_CONSTANT(op_array, opline, opline->op2);
} else if (opline->op2_type & (IS_VAR|IS_TMP_VAR)) {
opline->op2.var = (uint32_t)(zend_intptr_t)ZEND_CALL_VAR_NUM(NULL, op_array->last_var + opline->op2.var);
}
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
index 2054bbcee7..8a20d1ca28 100644
--- a/Zend/zend_operators.c
+++ b/Zend/zend_operators.c
@@ -80,12 +80,12 @@ static const unsigned char tolower_map[256] = {
zend_binary_strncasecmp
*/
-ZEND_API int ZEND_FASTCALL zend_atoi(const char *str, int str_len) /* {{{ */
+ZEND_API int ZEND_FASTCALL zend_atoi(const char *str, size_t str_len) /* {{{ */
{
int retval;
if (!str_len) {
- str_len = (int)strlen(str);
+ str_len = strlen(str);
}
retval = ZEND_STRTOL(str, NULL, 0);
if (str_len>0) {
@@ -108,12 +108,12 @@ ZEND_API int ZEND_FASTCALL zend_atoi(const char *str, int str_len) /* {{{ */
}
/* }}} */
-ZEND_API zend_long ZEND_FASTCALL zend_atol(const char *str, int str_len) /* {{{ */
+ZEND_API zend_long ZEND_FASTCALL zend_atol(const char *str, size_t str_len) /* {{{ */
{
zend_long retval;
if (!str_len) {
- str_len = (int)strlen(str);
+ str_len = strlen(str);
}
retval = ZEND_STRTOL(str, NULL, 0);
if (str_len>0) {
@@ -583,8 +583,7 @@ static void convert_scalar_to_array(zval *op) /* {{{ */
ZVAL_COPY_VALUE(&entry, op);
- ZVAL_NEW_ARR(op);
- zend_hash_init(Z_ARRVAL_P(op), 8, NULL, ZVAL_PTR_DTOR, 0);
+ array_init_size(op, 1);
zend_hash_index_add_new(Z_ARRVAL_P(op), 0, &entry);
}
/* }}} */
@@ -608,7 +607,7 @@ try_again:
/* fast copy */
if (!Z_OBJCE_P(op)->default_properties_count &&
obj_ht == Z_OBJ_P(op)->properties &&
- !ZEND_HASH_GET_APPLY_COUNT(Z_OBJ_P(op)->properties) &&
+ !GC_IS_RECURSIVE(obj_ht) &&
EXPECTED(Z_OBJ_P(op)->handlers == &std_object_handlers)) {
arr = zend_proptable_to_symtable(obj_ht, 0);
} else {
@@ -634,8 +633,7 @@ try_again:
}
break;
case IS_NULL:
- ZVAL_NEW_ARR(op);
- zend_hash_init(Z_ARRVAL_P(op), 8, NULL, ZVAL_PTR_DTOR, 0);
+ array_init(op);
break;
case IS_REFERENCE:
zend_unwrap_reference(op);
diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h
index 9c2df28479..b6e16c3430 100644
--- a/Zend/zend_operators.h
+++ b/Zend/zend_operators.h
@@ -172,7 +172,7 @@ zend_memnstr(const char *haystack, const char *needle, size_t needle_len, const
while (p <= end) {
if ((p = (const char *)memchr(p, *needle, (end-p+1))) && ne == p[needle_len-1]) {
- if (!memcmp(needle, p, needle_len-1)) {
+ if (!memcmp(needle+1, p+1, needle_len-2)) {
return p;
}
}
@@ -230,7 +230,7 @@ zend_memnrstr(const char *haystack, const char *needle, size_t needle_len, char
do {
if ((p = (const char *)zend_memrchr(haystack, *needle, (p - haystack) + 1)) && ne == p[needle_len-1]) {
- if (!memcmp(needle, p, needle_len - 1)) {
+ if (!memcmp(needle + 1, p + 1, needle_len - 2)) {
return p;
}
}
@@ -366,8 +366,8 @@ ZEND_API int ZEND_FASTCALL zend_compare_symbol_tables(HashTable *ht1, HashTable
ZEND_API int ZEND_FASTCALL zend_compare_arrays(zval *a1, zval *a2);
ZEND_API int ZEND_FASTCALL zend_compare_objects(zval *o1, zval *o2);
-ZEND_API int ZEND_FASTCALL zend_atoi(const char *str, int str_len);
-ZEND_API zend_long ZEND_FASTCALL zend_atol(const char *str, int str_len);
+ZEND_API int ZEND_FASTCALL zend_atoi(const char *str, size_t str_len);
+ZEND_API zend_long ZEND_FASTCALL zend_atol(const char *str, size_t str_len);
ZEND_API void ZEND_FASTCALL zend_locale_sprintf_double(zval *op ZEND_FILE_LINE_DC);
diff --git a/Zend/zend_smart_string.h b/Zend/zend_smart_string.h
index 2282202792..12d755ee41 100644
--- a/Zend/zend_smart_string.h
+++ b/Zend/zend_smart_string.h
@@ -136,6 +136,10 @@ static zend_always_inline void smart_string_setl(smart_string *dest, char *src,
dest->c = src;
}
+static zend_always_inline void smart_string_reset(smart_string *str) {
+ str->len = 0;
+}
+
#endif
/*
diff --git a/Zend/zend_ts_hash.c b/Zend/zend_ts_hash.c
index fab54672fc..931236936d 100644
--- a/Zend/zend_ts_hash.c
+++ b/Zend/zend_ts_hash.c
@@ -59,24 +59,14 @@ static void end_write(TsHashTable *ht)
}
/* delegates */
-ZEND_API void _zend_ts_hash_init(TsHashTable *ht, uint32_t nSize, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC)
+ZEND_API void _zend_ts_hash_init(TsHashTable *ht, uint32_t nSize, dtor_func_t pDestructor, zend_bool persistent)
{
#ifdef ZTS
ht->mx_reader = tsrm_mutex_alloc();
ht->mx_writer = tsrm_mutex_alloc();
ht->reader = 0;
#endif
- _zend_hash_init(TS_HASH(ht), nSize, pDestructor, persistent ZEND_FILE_LINE_RELAY_CC);
-}
-
-ZEND_API void _zend_ts_hash_init_ex(TsHashTable *ht, uint32_t nSize, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC)
-{
-#ifdef ZTS
- ht->mx_reader = tsrm_mutex_alloc();
- ht->mx_writer = tsrm_mutex_alloc();
- ht->reader = 0;
-#endif
- _zend_hash_init_ex(TS_HASH(ht), nSize, pDestructor, persistent, bApplyProtection ZEND_FILE_LINE_RELAY_CC);
+ _zend_hash_init(TS_HASH(ht), nSize, pDestructor, persistent);
}
ZEND_API void zend_ts_hash_destroy(TsHashTable *ht)
diff --git a/Zend/zend_ts_hash.h b/Zend/zend_ts_hash.h
index 18421e58f6..20e66d3890 100644
--- a/Zend/zend_ts_hash.h
+++ b/Zend/zend_ts_hash.h
@@ -37,15 +37,14 @@ BEGIN_EXTERN_C()
#define TS_HASH(table) (&(table->hash))
/* startup/shutdown */
-ZEND_API void _zend_ts_hash_init(TsHashTable *ht, uint32_t nSize, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC);
-ZEND_API void _zend_ts_hash_init_ex(TsHashTable *ht, uint32_t nSize, dtor_func_t pDestructor, zend_bool persistent, zend_bool bApplyProtection ZEND_FILE_LINE_DC);
+ZEND_API void _zend_ts_hash_init(TsHashTable *ht, uint32_t nSize, dtor_func_t pDestructor, zend_bool persistent);
ZEND_API void zend_ts_hash_destroy(TsHashTable *ht);
ZEND_API void zend_ts_hash_clean(TsHashTable *ht);
#define zend_ts_hash_init(ht, nSize, pHashFunction, pDestructor, persistent) \
- _zend_ts_hash_init(ht, nSize, pDestructor, persistent ZEND_FILE_LINE_CC)
+ _zend_ts_hash_init(ht, nSize, pDestructor, persistent)
#define zend_ts_hash_init_ex(ht, nSize, pHashFunction, pDestructor, persistent, bApplyProtection) \
- _zend_ts_hash_init_ex(ht, nSize, pDestructor, persistent, bApplyProtection ZEND_FILE_LINE_CC)
+ _zend_ts_hash_init(ht, nSize, pDestructor, persistent)
/* additions/updates/changes */
diff --git a/Zend/zend_types.h b/Zend/zend_types.h
index b78ed0c45a..4f073d4719 100644
--- a/Zend/zend_types.h
+++ b/Zend/zend_types.h
@@ -180,11 +180,13 @@ struct _zval_struct {
zend_value value; /* value */
union {
struct {
- ZEND_ENDIAN_LOHI_4(
+ ZEND_ENDIAN_LOHI_3(
zend_uchar type, /* active type */
zend_uchar type_flags,
- zend_uchar const_flags,
- zend_uchar reserved) /* call info for EX(This) */
+ union {
+ uint16_t call_info; /* call info for EX(This) */
+ uint16_t extra; /* not further specified */
+ } u)
} v;
uint32_t type_info;
} u1;
@@ -239,7 +241,7 @@ struct _zend_array {
struct {
ZEND_ENDIAN_LOHI_4(
zend_uchar flags,
- zend_uchar nApplyCount,
+ zend_uchar _unused,
zend_uchar nIteratorsCount,
zend_uchar consistency)
} v;
@@ -355,7 +357,7 @@ struct _zend_reference {
struct _zend_ast_ref {
zend_refcounted_h gc;
- zend_ast *ast;
+ /*zend_ast ast; zend_ast follows the zend_ast_ref structure */
};
/* regular data types */
@@ -372,19 +374,18 @@ struct _zend_ast_ref {
#define IS_REFERENCE 10
/* constant expressions */
-#define IS_CONSTANT 11
#define IS_CONSTANT_AST 12
-/* fake types */
-#define _IS_BOOL 13
-#define IS_CALLABLE 14
-#define IS_ITERABLE 19
-#define IS_VOID 18
-
/* internal types */
-#define IS_INDIRECT 15
-#define IS_PTR 17
-#define _IS_ERROR 20
+#define IS_INDIRECT 13
+#define IS_PTR 14
+#define _IS_ERROR 15
+
+/* fake types used only for type hinting (Z_TYPE(zv) can not use them) */
+#define _IS_BOOL 16
+#define IS_CALLABLE 17
+#define IS_ITERABLE 18
+#define IS_VOID 19
static zend_always_inline zend_uchar zval_get_type(const zval* pz) {
return pz->u1.v.type;
@@ -402,9 +403,6 @@ static zend_always_inline zend_uchar zval_get_type(const zval* pz) {
#define Z_TYPE_FLAGS(zval) (zval).u1.v.type_flags
#define Z_TYPE_FLAGS_P(zval_p) Z_TYPE_FLAGS(*(zval_p))
-#define Z_CONST_FLAGS(zval) (zval).u1.v.const_flags
-#define Z_CONST_FLAGS_P(zval_p) Z_CONST_FLAGS(*(zval_p))
-
#define Z_TYPE_INFO(zval) (zval).u1.type_info
#define Z_TYPE_INFO_P(zval_p) Z_TYPE_INFO(*(zval_p))
@@ -432,7 +430,6 @@ static zend_always_inline zend_uchar zval_get_type(const zval* pz) {
#define Z_TYPE_MASK 0xff
#define Z_TYPE_FLAGS_SHIFT 8
-#define Z_CONST_FLAGS_SHIFT 16
#define GC_REFCOUNT(p) (p)->gc.refcount
#define GC_TYPE(p) (p)->gc.u.v.type
@@ -455,78 +452,71 @@ static zend_always_inline zend_uchar zval_get_type(const zval* pz) {
#define GC_INFO_SHIFT 16
#define GC_INFO_MASK 0xffff0000
-/* zval.value->gc.u.v.flags */
-#define GC_COLLECTABLE (1<<7)
+/* zval.value->gc.u.v.flags (common flags) */
+#define GC_COLLECTABLE (1<<0)
+#define GC_PROTECTED (1<<1) /* used for recursion detection */
+#define GC_IMMUTABLE (1<<2) /* can't be canged in place */
+#define GC_PERSISTENT (1<<3) /* allocated using malloc */
#define GC_ARRAY (IS_ARRAY | (GC_COLLECTABLE << GC_FLAGS_SHIFT))
#define GC_OBJECT (IS_OBJECT | (GC_COLLECTABLE << GC_FLAGS_SHIFT))
/* zval.u1.v.type_flags */
-#define IS_TYPE_CONSTANT (1<<0)
-#define IS_TYPE_REFCOUNTED (1<<2)
-#define IS_TYPE_COPYABLE (1<<4)
+#define IS_CONSTANT_VISITED_MARK (1<<0)
+#define IS_TYPE_COPYABLE (1<<1)
+#define IS_TYPE_REFCOUNTED (1<<2) /* equal to ZEND_CALL_FREE_EXTRA_ARGS */
/* extended types */
#define IS_INTERNED_STRING_EX IS_STRING
-#define IS_STRING_EX (IS_STRING | (( IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE) << Z_TYPE_FLAGS_SHIFT))
-#define IS_ARRAY_EX (IS_ARRAY | (( IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE) << Z_TYPE_FLAGS_SHIFT))
-#define IS_OBJECT_EX (IS_OBJECT | (( IS_TYPE_REFCOUNTED ) << Z_TYPE_FLAGS_SHIFT))
-#define IS_RESOURCE_EX (IS_RESOURCE | (( IS_TYPE_REFCOUNTED ) << Z_TYPE_FLAGS_SHIFT))
-#define IS_REFERENCE_EX (IS_REFERENCE | (( IS_TYPE_REFCOUNTED ) << Z_TYPE_FLAGS_SHIFT))
+#define IS_STRING_EX (IS_STRING | ((IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE) << Z_TYPE_FLAGS_SHIFT))
+#define IS_ARRAY_EX (IS_ARRAY | ((IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE) << Z_TYPE_FLAGS_SHIFT))
+#define IS_OBJECT_EX (IS_OBJECT | ((IS_TYPE_REFCOUNTED ) << Z_TYPE_FLAGS_SHIFT))
+#define IS_RESOURCE_EX (IS_RESOURCE | ((IS_TYPE_REFCOUNTED ) << Z_TYPE_FLAGS_SHIFT))
+#define IS_REFERENCE_EX (IS_REFERENCE | ((IS_TYPE_REFCOUNTED ) << Z_TYPE_FLAGS_SHIFT))
-#define IS_CONSTANT_EX (IS_CONSTANT | ((IS_TYPE_CONSTANT | IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE) << Z_TYPE_FLAGS_SHIFT))
-#define IS_CONSTANT_AST_EX (IS_CONSTANT_AST | ((IS_TYPE_CONSTANT | IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE) << Z_TYPE_FLAGS_SHIFT))
+#define IS_CONSTANT_AST_EX (IS_CONSTANT_AST | ((IS_TYPE_REFCOUNTED ) << Z_TYPE_FLAGS_SHIFT))
-/* zval.u1.v.const_flags */
-#define IS_CONSTANT_UNQUALIFIED 0x010
-#define IS_CONSTANT_VISITED_MARK 0x020
-#define IS_CONSTANT_CLASS 0x080 /* __CLASS__ in trait */
-#define IS_CONSTANT_IN_NAMESPACE 0x100 /* used only in opline->extended_value */
-
-#define IS_CONSTANT_VISITED(p) (Z_CONST_FLAGS_P(p) & IS_CONSTANT_VISITED_MARK)
-#define MARK_CONSTANT_VISITED(p) Z_CONST_FLAGS_P(p) |= IS_CONSTANT_VISITED_MARK
-#define RESET_CONSTANT_VISITED(p) Z_CONST_FLAGS_P(p) &= ~IS_CONSTANT_VISITED_MARK
+#define IS_CONSTANT_VISITED(p) (Z_TYPE_FLAGS_P(p) & IS_CONSTANT_VISITED_MARK)
+#define MARK_CONSTANT_VISITED(p) Z_TYPE_FLAGS_P(p) |= IS_CONSTANT_VISITED_MARK
+#define RESET_CONSTANT_VISITED(p) Z_TYPE_FLAGS_P(p) &= ~IS_CONSTANT_VISITED_MARK
/* string flags (zval.value->gc.u.flags) */
-#define IS_STR_PERSISTENT (1<<0) /* allocated using malloc */
-#define IS_STR_INTERNED (1<<1) /* interned string */
-#define IS_STR_PERMANENT (1<<2) /* relives request boundary */
-
-#define IS_STR_CONSTANT (1<<3) /* constant index */
-#define IS_STR_CONSTANT_UNQUALIFIED (1<<4) /* the same as IS_CONSTANT_UNQUALIFIED */
+#define IS_STR_INTERNED GC_IMMUTABLE /* interned string */
+#define IS_STR_PERSISTENT GC_PERSISTENT /* allocated using malloc */
+#define IS_STR_PERMANENT (1<<4) /* relives request boundary */
/* array flags */
-#define IS_ARRAY_IMMUTABLE (1<<1)
+#define IS_ARRAY_IMMUTABLE GC_IMMUTABLE
+#define IS_ARRAY_PERSISTENT GC_PERSISTENT
/* object flags (zval.value->gc.u.flags) */
-#define IS_OBJ_APPLY_COUNT 0x07
-#define IS_OBJ_DESTRUCTOR_CALLED (1<<3)
-#define IS_OBJ_FREE_CALLED (1<<4)
-#define IS_OBJ_USE_GUARDS (1<<5)
-#define IS_OBJ_HAS_GUARDS (1<<6)
-
-#define Z_OBJ_APPLY_COUNT(zval) \
- (Z_GC_FLAGS(zval) & IS_OBJ_APPLY_COUNT)
-
-#define Z_OBJ_INC_APPLY_COUNT(zval) do { \
- Z_GC_FLAGS(zval) = \
- (Z_GC_FLAGS(zval) & ~IS_OBJ_APPLY_COUNT) | \
- ((Z_GC_FLAGS(zval) & IS_OBJ_APPLY_COUNT) + 1); \
+#define IS_OBJ_DESTRUCTOR_CALLED (1<<4)
+#define IS_OBJ_FREE_CALLED (1<<5)
+#define IS_OBJ_USE_GUARDS (1<<6)
+#define IS_OBJ_HAS_GUARDS (1<<7)
+
+/* Recursion protection macros must be used only for arrays and objects */
+#define GC_IS_RECURSIVE(p) \
+ (GC_FLAGS(p) & GC_PROTECTED)
+
+#define GC_PROTECT_RECURSION(p) do { \
+ GC_FLAGS(p) |= GC_PROTECTED; \
} while (0)
-#define Z_OBJ_DEC_APPLY_COUNT(zval) do { \
- Z_GC_FLAGS(zval) = \
- (Z_GC_FLAGS(zval) & ~IS_OBJ_APPLY_COUNT) | \
- ((Z_GC_FLAGS(zval) & IS_OBJ_APPLY_COUNT) - 1); \
+#define GC_UNPROTECT_RECURSION(p) do { \
+ GC_FLAGS(p) &= ~GC_PROTECTED; \
} while (0)
-#define Z_OBJ_APPLY_COUNT_P(zv) Z_OBJ_APPLY_COUNT(*(zv))
-#define Z_OBJ_INC_APPLY_COUNT_P(zv) Z_OBJ_INC_APPLY_COUNT(*(zv))
-#define Z_OBJ_DEC_APPLY_COUNT_P(zv) Z_OBJ_DEC_APPLY_COUNT(*(zv))
+#define Z_IS_RECURSIVE(zval) GC_IS_RECURSIVE(Z_COUNTED(zval))
+#define Z_PROTECT_RECURSION(zval) GC_PROTECT_RECURSION(Z_COUNTED(zval))
+#define Z_UNPROTECT_RECURSION(zval) GC_UNPROTECT_RECURSION(Z_COUNTED(zval))
+#define Z_IS_RECURSIVE_P(zv) Z_IS_RECURSIVE(*(zv))
+#define Z_PROTECT_RECURSION_P(zv) Z_PROTECT_RECURSION(*(zv))
+#define Z_UNPROTECT_RECURSION_P(zv) Z_UNPROTECT_RECURSION(*(zv))
/* All data types < IS_STRING have their constructor/destructors skipped */
-#define Z_CONSTANT(zval) ((Z_TYPE_FLAGS(zval) & IS_TYPE_CONSTANT) != 0)
+#define Z_CONSTANT(zval) (Z_TYPE(zval) == IS_CONSTANT_AST)
#define Z_CONSTANT_P(zval_p) Z_CONSTANT(*(zval_p))
#define Z_REFCOUNTED(zval) ((Z_TYPE_FLAGS(zval) & IS_TYPE_REFCOUNTED) != 0)
@@ -545,7 +535,7 @@ static zend_always_inline zend_uchar zval_get_type(const zval* pz) {
#define Z_OPT_TYPE(zval) (Z_TYPE_INFO(zval) & Z_TYPE_MASK)
#define Z_OPT_TYPE_P(zval_p) Z_OPT_TYPE(*(zval_p))
-#define Z_OPT_CONSTANT(zval) ((Z_TYPE_INFO(zval) & (IS_TYPE_CONSTANT << Z_TYPE_FLAGS_SHIFT)) != 0)
+#define Z_OPT_CONSTANT(zval) (Z_OPT_TYPE(zval) == IS_CONSTANT_AST)
#define Z_OPT_CONSTANT_P(zval_p) Z_OPT_CONSTANT(*(zval_p))
#define Z_OPT_REFCOUNTED(zval) ((Z_TYPE_INFO(zval) & (IS_TYPE_REFCOUNTED << Z_TYPE_FLAGS_SHIFT)) != 0)
@@ -635,7 +625,9 @@ static zend_always_inline zend_uchar zval_get_type(const zval* pz) {
#define Z_AST(zval) (zval).value.ast
#define Z_AST_P(zval_p) Z_AST(*(zval_p))
-#define Z_ASTVAL(zval) (zval).value.ast->ast
+#define GC_AST(p) ((zend_ast*)(((char*)p) + sizeof(zend_ast_ref)))
+
+#define Z_ASTVAL(zval) GC_AST(Z_AST(zval))
#define Z_ASTVAL_P(zval_p) Z_ASTVAL(*(zval_p))
#define Z_INDIRECT(zval) (zval).value.zv
@@ -721,8 +713,9 @@ static zend_always_inline zend_uchar zval_get_type(const zval* pz) {
} while (0)
#define ZVAL_ARR(z, a) do { \
+ zend_array *__arr = (a); \
zval *__z = (z); \
- Z_ARR_P(__z) = (a); \
+ Z_ARR_P(__z) = __arr; \
Z_TYPE_INFO_P(__z) = IS_ARRAY_EX; \
} while (0)
@@ -817,14 +810,9 @@ static zend_always_inline zend_uchar zval_get_type(const zval* pz) {
Z_TYPE_INFO_P(z) = IS_REFERENCE_EX; \
} while (0)
-#define ZVAL_NEW_AST(z, a) do { \
+#define ZVAL_AST(z, ast) do { \
zval *__z = (z); \
- zend_ast_ref *_ast = \
- (zend_ast_ref *) emalloc(sizeof(zend_ast_ref)); \
- GC_REFCOUNT(_ast) = 1; \
- GC_TYPE_INFO(_ast) = IS_CONSTANT_AST; \
- _ast->ast = (a); \
- Z_AST_P(__z) = _ast; \
+ Z_AST_P(__z) = ast; \
Z_TYPE_INFO_P(__z) = IS_CONSTANT_AST_EX; \
} while (0)
diff --git a/Zend/zend_variables.c b/Zend/zend_variables.c
index 6c1e235eb6..97a2ea474c 100644
--- a/Zend/zend_variables.c
+++ b/Zend/zend_variables.c
@@ -31,8 +31,7 @@
ZEND_API void ZEND_FASTCALL _zval_dtor_func(zend_refcounted *p ZEND_FILE_LINE_DC)
{
switch (GC_TYPE(p)) {
- case IS_STRING:
- case IS_CONSTANT: {
+ case IS_STRING: {
zend_string *str = (zend_string*)p;
CHECK_ZVAL_STRING_REL(str);
zend_string_free(str);
@@ -46,8 +45,8 @@ ZEND_API void ZEND_FASTCALL _zval_dtor_func(zend_refcounted *p ZEND_FILE_LINE_DC
case IS_CONSTANT_AST: {
zend_ast_ref *ast = (zend_ast_ref*)p;
- zend_ast_destroy_and_free(ast->ast);
- efree_size(ast, sizeof(zend_ast_ref));
+ zend_ast_destroy(GC_AST(ast));
+ efree(ast);
break;
}
case IS_OBJECT: {
@@ -79,7 +78,6 @@ ZEND_API void _zval_internal_dtor(zval *zvalue ZEND_FILE_LINE_DC)
{
switch (Z_TYPE_P(zvalue)) {
case IS_STRING:
- case IS_CONSTANT:
CHECK_ZVAL_STRING_REL(Z_STR_P(zvalue));
zend_string_release(Z_STR_P(zvalue));
break;
@@ -110,7 +108,6 @@ ZEND_API void _zval_internal_dtor_for_ptr(zval *zvalue ZEND_FILE_LINE_DC)
{
switch (Z_TYPE_P(zvalue)) {
case IS_STRING:
- case IS_CONSTANT:
CHECK_ZVAL_STRING_REL(Z_STR_P(zvalue));
zend_string_free(Z_STR_P(zvalue));
break;
@@ -170,12 +167,6 @@ ZEND_API void ZEND_FASTCALL _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC)
} else if (EXPECTED(Z_TYPE_P(zvalue) == IS_STRING)) {
CHECK_ZVAL_STRING_REL(Z_STR_P(zvalue));
ZVAL_NEW_STR(zvalue, zend_string_dup(Z_STR_P(zvalue), 0));
- } else if (EXPECTED(Z_TYPE_P(zvalue) == IS_CONSTANT)) {
- CHECK_ZVAL_STRING_REL(Z_STR_P(zvalue));
- Z_STR_P(zvalue) = zend_string_dup(Z_STR_P(zvalue), 0);
- } else if (EXPECTED(Z_TYPE_P(zvalue) == IS_CONSTANT_AST)) {
- zend_ast *copy = zend_ast_copy(Z_ASTVAL_P(zvalue));
- ZVAL_NEW_AST(zvalue, copy);
}
}
diff --git a/Zend/zend_virtual_cwd.c b/Zend/zend_virtual_cwd.c
index 73f63a14c5..475613daa9 100644
--- a/Zend/zend_virtual_cwd.c
+++ b/Zend/zend_virtual_cwd.c
@@ -163,7 +163,7 @@ static inline time_t FileTimeToUnixTime(const FILETIME *FileTime)
return (time_t)UnixTime;
}
-CWD_API int php_sys_readlink(const char *link, char *target, size_t target_len){ /* {{{ */
+CWD_API ssize_t php_sys_readlink(const char *link, char *target, size_t target_len){ /* {{{ */
HANDLE hFile;
wchar_t *linkw = php_win32_ioutil_any_to_w(link), targetw[MAXPATHLEN];
size_t ret_len, targetw_len, offset = 0;
@@ -229,7 +229,7 @@ CWD_API int php_sys_readlink(const char *link, char *target, size_t target_len){
CloseHandle(hFile);
free(linkw);
- return ret_len;
+ return (ssize_t)ret_len;
}
/* }}} */
@@ -409,7 +409,7 @@ void virtual_cwd_main_cwd_init(uint8_t reinit) /* {{{ */
cwd[0] = '\0';
}
- main_cwd_state.cwd_length = (int)strlen(cwd);
+ main_cwd_state.cwd_length = strlen(cwd);
#ifdef ZEND_WIN32
if (main_cwd_state.cwd_length >= 2 && cwd[1] == ':') {
cwd[0] = toupper(cwd[0]);
@@ -716,10 +716,10 @@ CWD_API realpath_cache_bucket** realpath_cache_get_buckets(void)
#undef LINK_MAX
#define LINK_MAX 32
-static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, int use_realpath, int is_dir, int *link_is_dir) /* {{{ */
+static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, time_t *t, int use_realpath, int is_dir, int *link_is_dir) /* {{{ */
{
- int i, j, save;
- int directory = 0;
+ size_t i, j;
+ int directory = 0, save;
#ifdef ZEND_WIN32
WIN32_FIND_DATAW dataw;
HANDLE hFind = INVALID_HANDLE_VALUE;
@@ -747,28 +747,31 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
while (i > start && !IS_SLASH(path[i-1])) {
i--;
}
+ assert(i < MAXPATHLEN);
if (i == len ||
- (i == len - 1 && path[i] == '.')) {
+ (i + 1 == len && path[i] == '.')) {
/* remove double slashes and '.' */
len = i - 1;
is_dir = 1;
continue;
- } else if (i == len - 2 && path[i] == '.' && path[i+1] == '.') {
+ } else if (i + 2 == len && path[i] == '.' && path[i+1] == '.') {
/* remove '..' and previous directory */
is_dir = 1;
if (link_is_dir) {
*link_is_dir = 1;
}
- if (i - 1 <= start) {
+ if (i <= start + 1) {
return start ? start : len;
}
j = tsrm_realpath_r(path, start, i-1, ll, t, use_realpath, 1, NULL);
- if (j > start) {
+ if (j > start && j != (size_t)-1) {
j--;
+ assert(i < MAXPATHLEN);
while (j > start && !IS_SLASH(path[j])) {
j--;
}
+ assert(i < MAXPATHLEN);
if (!start) {
/* leading '..' must not be removed in case of relative path */
if (j == 0 && path[0] == '.' && path[1] == '.' &&
@@ -808,7 +811,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
if ((bucket = realpath_cache_find(path, len, *t)) != NULL) {
if (is_dir && !bucket->is_dir) {
/* not a directory */
- return -1;
+ return (size_t)-1;
} else {
if (link_is_dir) {
*link_is_dir = bucket->is_dir;
@@ -823,14 +826,14 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
if (save) {
pathw = php_win32_ioutil_any_to_w(path);
if (!pathw) {
- return -1;
+ return (size_t)-1;
}
hFind = FindFirstFileExW(pathw, FindExInfoBasic, &dataw, FindExSearchNameMatch, NULL, 0);
if (INVALID_HANDLE_VALUE == hFind) {
if (use_realpath == CWD_REALPATH) {
/* file not found */
FREE_PATHW()
- return -1;
+ return (size_t)-1;
}
/* continue resolution anyway but don't save result in the cache */
save = 0;
@@ -850,7 +853,8 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
HANDLE hLink = NULL;
REPARSE_DATA_BUFFER * pbuffer;
DWORD retlength = 0;
- int bufindex = 0, isabsolute = 0;
+ size_t bufindex = 0;
+ uint8_t isabsolute = 0;
wchar_t * reparsetarget;
BOOL isVolume = FALSE;
#if VIRTUAL_CWD_DEBUG
@@ -858,20 +862,20 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
#endif
char *substitutename = NULL;
size_t substitutename_len;
- int substitutename_off = 0;
+ size_t substitutename_off = 0;
wchar_t tmpsubstname[MAXPATHLEN];
if(++(*ll) > LINK_MAX) {
free_alloca(tmp, use_heap);
FREE_PATHW()
- return -1;
+ return (size_t)-1;
}
hLink = CreateFileW(pathw, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT|FILE_FLAG_BACKUP_SEMANTICS, NULL);
if(hLink == INVALID_HANDLE_VALUE) {
free_alloca(tmp, use_heap);
FREE_PATHW()
- return -1;
+ return (size_t)-1;
}
pbuffer = (REPARSE_DATA_BUFFER *)do_alloca(MAXIMUM_REPARSE_DATA_BUFFER_SIZE, use_heap_large);
@@ -879,14 +883,14 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
CloseHandle(hLink);
free_alloca(tmp, use_heap);
FREE_PATHW()
- return -1;
+ return (size_t)-1;
}
if(!DeviceIoControl(hLink, FSCTL_GET_REPARSE_POINT, NULL, 0, pbuffer, MAXIMUM_REPARSE_DATA_BUFFER_SIZE, &retlength, NULL)) {
free_alloca(pbuffer, use_heap_large);
free_alloca(tmp, use_heap);
CloseHandle(hLink);
FREE_PATHW()
- return -1;
+ return (size_t)-1;
}
CloseHandle(hLink);
@@ -900,7 +904,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
free_alloca(pbuffer, use_heap_large);
free_alloca(tmp, use_heap);
FREE_PATHW()
- return -1;
+ return (size_t)-1;
}
#endif
@@ -909,7 +913,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
free_alloca(pbuffer, use_heap_large);
free_alloca(tmp, use_heap);
FREE_PATHW()
- return -1;
+ return (size_t)-1;
}
memmove(tmpsubstname, reparsetarget + pbuffer->MountPointReparseBuffer.SubstituteNameOffset / sizeof(WCHAR), pbuffer->MountPointReparseBuffer.SubstituteNameLength);
tmpsubstname[substitutename_len] = L'\0';
@@ -922,7 +926,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
free(printname);
#endif
FREE_PATHW()
- return -1;
+ return (size_t)-1;
}
}
else if(pbuffer->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT) {
@@ -934,7 +938,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
free_alloca(pbuffer, use_heap_large);
free_alloca(tmp, use_heap);
FREE_PATHW()
- return -1;
+ return (size_t)-1;
}
#endif
@@ -944,7 +948,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
free_alloca(pbuffer, use_heap_large);
free_alloca(tmp, use_heap);
FREE_PATHW()
- return -1;
+ return (size_t)-1;
}
memmove(tmpsubstname, reparsetarget + pbuffer->MountPointReparseBuffer.SubstituteNameOffset / sizeof(WCHAR), pbuffer->MountPointReparseBuffer.SubstituteNameLength);
tmpsubstname[substitutename_len] = L'\0';
@@ -957,7 +961,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
free(printname);
#endif
FREE_PATHW()
- return -1;
+ return (size_t)-1;
}
}
else if (pbuffer->ReparseTag == IO_REPARSE_TAG_DEDUP) {
@@ -967,7 +971,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
free_alloca(pbuffer, use_heap_large);
free_alloca(tmp, use_heap);
FREE_PATHW()
- return -1;
+ return (size_t)-1;
}
memcpy(substitutename, path, len + 1);
substitutename_len = len;
@@ -976,7 +980,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
free_alloca(pbuffer, use_heap_large);
free_alloca(tmp, use_heap);
FREE_PATHW()
- return -1;
+ return (size_t)-1;
}
if(isabsolute && substitutename_len > 4) {
@@ -1003,7 +1007,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
if (!isVolume) {
char * tmp2 = substitutename + substitutename_off;
- for(bufindex = 0; bufindex < (substitutename_len - substitutename_off); bufindex++) {
+ for (bufindex = 0; bufindex + substitutename_off < substitutename_len; bufindex++) {
*(path + bufindex) = *(tmp2 + bufindex);
}
@@ -1027,10 +1031,10 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
if (!((j == 3) && (path[1] == ':') && (path[2] == '\\'))) {
/* use_realpath is 0 in the call below coz path is absolute*/
j = tsrm_realpath_r(path, 0, j, ll, t, 0, is_dir, &directory);
- if(j < 0) {
+ if(j == (size_t)-1) {
free_alloca(tmp, use_heap);
FREE_PATHW()
- return -1;
+ return (size_t)-1;
}
}
}
@@ -1038,17 +1042,17 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
if(i + j >= MAXPATHLEN - 1) {
free_alloca(tmp, use_heap);
FREE_PATHW()
- return -1;
+ return (size_t)-1;
}
memmove(path+i, path, j+1);
memcpy(path, tmp, i-1);
path[i-1] = DEFAULT_SLASH;
j = tsrm_realpath_r(path, start, i + j, ll, t, use_realpath, is_dir, &directory);
- if(j < 0) {
+ if(j == (size_t)-1) {
free_alloca(tmp, use_heap);
FREE_PATHW()
- return -1;
+ return (size_t)-1;
}
}
directory = (dataw.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
@@ -1064,14 +1068,14 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
/* not a directory */
free_alloca(tmp, use_heap);
FREE_PATHW()
- return -1;
+ return (size_t)-1;
}
}
#else
if (save && php_sys_lstat(path, &st) < 0) {
if (use_realpath == CWD_REALPATH) {
/* file not found */
- return -1;
+ return (size_t)-1;
}
/* continue resolution anyway but don't save result in the cache */
save = 0;
@@ -1081,30 +1085,30 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
memcpy(tmp, path, len+1);
if (save && S_ISLNK(st.st_mode)) {
- if (++(*ll) > LINK_MAX || (j = php_sys_readlink(tmp, path, MAXPATHLEN)) < 0) {
+ if (++(*ll) > LINK_MAX || (j = (size_t)php_sys_readlink(tmp, path, MAXPATHLEN)) == (size_t)-1) {
/* too many links or broken symlinks */
free_alloca(tmp, use_heap);
- return -1;
+ return (size_t)-1;
}
path[j] = 0;
if (IS_ABSOLUTE_PATH(path, j)) {
j = tsrm_realpath_r(path, 1, j, ll, t, use_realpath, is_dir, &directory);
- if (j < 0) {
+ if (j == (size_t)-1) {
free_alloca(tmp, use_heap);
- return -1;
+ return (size_t)-1;
}
} else {
if (i + j >= MAXPATHLEN-1) {
free_alloca(tmp, use_heap);
- return -1; /* buffer overflow */
+ return (size_t)-1; /* buffer overflow */
}
memmove(path+i, path, j+1);
memcpy(path, tmp, i-1);
path[i-1] = DEFAULT_SLASH;
j = tsrm_realpath_r(path, start, i + j, ll, t, use_realpath, is_dir, &directory);
- if (j < 0) {
+ if (j == (size_t)-1) {
free_alloca(tmp, use_heap);
- return -1;
+ return (size_t)-1;
}
}
if (link_is_dir) {
@@ -1119,24 +1123,24 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
if (is_dir && !directory) {
/* not a directory */
free_alloca(tmp, use_heap);
- return -1;
+ return (size_t)-1;
}
}
#endif
- if (i - 1 <= start) {
+ if (i <= start + 1) {
j = start;
} else {
/* some leading directories may be unaccessable */
j = tsrm_realpath_r(path, start, i-1, ll, t, save ? CWD_FILEPATH : use_realpath, 1, NULL);
- if (j > start) {
+ if (j > start && j != (size_t)-1) {
path[j++] = DEFAULT_SLASH;
}
}
#ifdef ZEND_WIN32
- if (j < 0 || j + len - i >= MAXPATHLEN-1) {
+ if (j == (size_t)-1 || j + len >= MAXPATHLEN - 1 + i) {
free_alloca(tmp, use_heap);
FREE_PATHW()
- return -1;
+ return (size_t)-1;
}
if (save) {
size_t sz;
@@ -1144,9 +1148,9 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
if (!tmp_path) {
free_alloca(tmp, use_heap);
FREE_PATHW()
- return -1;
+ return (size_t)-1;
}
- i = (int)sz;
+ i = sz;
memcpy(path+j, tmp_path, i+1);
free(tmp_path);
j += i;
@@ -1157,9 +1161,9 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
}
}
#else
- if (j < 0 || j + len - i >= MAXPATHLEN-1) {
+ if (j == (size_t)-1 || j + len >= MAXPATHLEN - 1 + i) {
free_alloca(tmp, use_heap);
- return -1;
+ return (size_t)-1;
}
memcpy(path+j, tmp+i, len-i+1);
j += (len-i);
@@ -1185,16 +1189,16 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
/* returns 0 for ok, 1 for error */
CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path, int use_realpath) /* {{{ */
{
- int path_length = (int)strlen(path);
+ size_t path_length = strlen(path);
char resolved_path[MAXPATHLEN];
- int start = 1;
+ size_t start = 1;
int ll = 0;
time_t t;
int ret;
int add_slash;
void *tmp;
- if (path_length <= 0 || path_length >= MAXPATHLEN-1) {
+ if (!path_length || path_length >= MAXPATHLEN-1) {
#ifdef ZEND_WIN32
_set_errno(EINVAL);
#else
@@ -1216,7 +1220,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
start = 0;
memcpy(resolved_path , path, path_length + 1);
} else {
- int state_cwd_length = state->cwd_length;
+ size_t state_cwd_length = state->cwd_length;
#ifdef ZEND_WIN32
if (IS_SLASH(path[0])) {
@@ -1310,7 +1314,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
t = CWDG(realpath_cache_ttl) ? 0 : -1;
path_length = tsrm_realpath_r(resolved_path, start, path_length, &ll, &t, use_realpath, 0, NULL);
- if (path_length < 0) {
+ if (path_length == (size_t)-1) {
errno = ENOENT;
return 1;
}
@@ -1426,7 +1430,7 @@ CWD_API char *virtual_realpath(const char *path, char *real_path) /* {{{ */
}
if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)==0) {
- int len = new_state.cwd_length>MAXPATHLEN-1?MAXPATHLEN-1:new_state.cwd_length;
+ size_t len = new_state.cwd_length>MAXPATHLEN-1?MAXPATHLEN-1:new_state.cwd_length;
memcpy(real_path, new_state.cwd, len);
real_path[len] = '\0';
@@ -1890,7 +1894,7 @@ CWD_API char *tsrm_realpath(const char *path, char *real_path) /* {{{ */
} else if (!IS_ABSOLUTE_PATH(path, strlen(path)) &&
VCWD_GETCWD(cwd, MAXPATHLEN)) {
new_state.cwd = estrdup(cwd);
- new_state.cwd_length = (int)strlen(cwd);
+ new_state.cwd_length = strlen(cwd);
} else {
new_state.cwd = (char*)emalloc(1);
new_state.cwd[0] = '\0';
@@ -1903,7 +1907,7 @@ CWD_API char *tsrm_realpath(const char *path, char *real_path) /* {{{ */
}
if (real_path) {
- int copy_len = new_state.cwd_length>MAXPATHLEN-1 ? MAXPATHLEN-1 : new_state.cwd_length;
+ size_t copy_len = new_state.cwd_length>MAXPATHLEN-1 ? MAXPATHLEN-1 : new_state.cwd_length;
memcpy(real_path, new_state.cwd, copy_len);
real_path[copy_len] = '\0';
efree(new_state.cwd);
diff --git a/Zend/zend_virtual_cwd.h b/Zend/zend_virtual_cwd.h
index dee87c0a36..5e41fe2742 100644
--- a/Zend/zend_virtual_cwd.h
+++ b/Zend/zend_virtual_cwd.h
@@ -121,7 +121,7 @@ typedef unsigned short mode_t;
CWD_API int php_sys_stat_ex(const char *path, zend_stat_t *buf, int lstat);
# define php_sys_stat(path, buf) php_sys_stat_ex(path, buf, 0)
# define php_sys_lstat(path, buf) php_sys_stat_ex(path, buf, 1)
-CWD_API int php_sys_readlink(const char *link, char *target, size_t target_len);
+CWD_API ssize_t php_sys_readlink(const char *link, char *target, size_t target_len);
#else
# define php_sys_stat stat
# define php_sys_lstat lstat
@@ -132,7 +132,7 @@ CWD_API int php_sys_readlink(const char *link, char *target, size_t target_len);
typedef struct _cwd_state {
char *cwd;
- int cwd_length;
+ size_t cwd_length;
} cwd_state;
typedef int (*verify_path_func)(const cwd_state *);
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 1c3668088e..b8f0aa1f34 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -806,7 +806,7 @@ ZEND_VM_HELPER(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMPVAR|CV,
property = GET_OP2_ZVAL_PTR(BP_VAR_R);
do {
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
if (OP1_TYPE != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
ZVAL_DEREF(object);
@@ -884,7 +884,7 @@ ZEND_VM_C_LABEL(assign_dim_op_new_array):
SEPARATE_ZVAL_NOREF(var_ptr);
}
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
binary_op(var_ptr, var_ptr, value);
@@ -900,15 +900,14 @@ ZEND_VM_C_LABEL(assign_dim_op_new_array):
} else if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
container = GET_OP1_UNDEF_CV(container, BP_VAR_RW);
ZEND_VM_C_LABEL(assign_dim_op_convert_to_array):
- ZVAL_NEW_ARR(container);
- zend_hash_init(Z_ARRVAL_P(container), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(container, zend_new_array(8));
ZEND_VM_C_GOTO(assign_dim_op_new_array);
}
dim = GET_OP2_ZVAL_PTR(BP_VAR_R);
if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op EXECUTE_DATA_CC);
} else {
if (UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) {
@@ -930,7 +929,7 @@ ZEND_VM_C_LABEL(assign_dim_op_ret_null):
ZVAL_NULL(EX_VAR(opline->result.var));
}
}
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
}
}
@@ -1552,7 +1551,7 @@ ZEND_VM_HELPER(zend_fetch_static_prop_helper, CONST|TMPVAR|CV, UNUSED|CONST|VAR,
SAVE_OPLINE();
varname = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
- retval = zend_fetch_static_property_address(varname, OP1_TYPE, opline->op2, OP2_TYPE, type EXECUTE_DATA_CC);
+ retval = zend_fetch_static_property_address(varname, OP1_TYPE, opline->op2, OP2_TYPE, type EXECUTE_DATA_CC OPLINE_CC);
if (UNEXPECTED(retval == NULL)) {
if (EG(exception)) {
@@ -1792,7 +1791,7 @@ ZEND_VM_HANDLER(82, ZEND_FETCH_OBJ_R, CONST|TMP|VAR|UNUSED|THIS|CV, CONST|TMPVAR
EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
retval = OBJ_PROP(zobj, prop_offset);
if (EXPECTED(Z_TYPE_INFO_P(retval) != IS_UNDEF)) {
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
@@ -1913,7 +1912,7 @@ ZEND_VM_HANDLER(91, ZEND_FETCH_OBJ_IS, CONST|TMPVAR|UNUSED|THIS|CV, CONST|TMPVAR
EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
retval = OBJ_PROP(zobj, prop_offset);
if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -2047,7 +2046,7 @@ ZEND_VM_HANDLER(136, ZEND_ASSIGN_OBJ, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, SPEC(
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -2083,7 +2082,7 @@ ZEND_VM_HANDLER(136, ZEND_ASSIGN_OBJ, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, SPEC(
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
ZEND_VM_C_LABEL(fast_assign_obj):
@@ -2247,8 +2246,7 @@ ZEND_VM_C_LABEL(try_assign_dim_array):
FREE_OP_DATA();
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
ZEND_VM_C_GOTO(try_assign_dim_array);
} else {
if (OP1_TYPE != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
@@ -2919,7 +2917,7 @@ ZEND_VM_C_LABEL(try_class_name):
zend_class_entry *ce = CACHED_PTR(Z_CACHE_SLOT_P(class_name));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(class_name), EX_CONSTANT(opline->op2) + 1, opline->extended_value);
+ ce = zend_fetch_class_by_name(Z_STR_P(class_name), RT_CONSTANT(opline, opline->op2) + 1, opline->extended_value);
CACHE_PTR(Z_CACHE_SLOT_P(class_name), ce);
}
Z_CE_P(EX_VAR(opline->result.var)) = ce;
@@ -3030,7 +3028,7 @@ ZEND_VM_HANDLER(112, ZEND_INIT_METHOD_CALL, CONST|TMPVAR|UNUSED|THIS|CV, CONST|T
}
/* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((OP2_TYPE == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((OP2_TYPE == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL));
if (UNEXPECTED(fbc == NULL)) {
if (EXPECTED(!EG(exception))) {
zend_throw_error(NULL, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name));
@@ -3087,14 +3085,14 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, UNUSED|CLASS_FETCH|CONST|VAR,
if (OP1_TYPE == IS_CONST) {
/* no function found. try a static method in class */
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), ce);
}
} else if (OP1_TYPE == IS_UNUSED) {
ce = zend_fetch_class(NULL, opline->op1.num);
@@ -3109,12 +3107,12 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, UNUSED|CLASS_FETCH|CONST|VAR,
if (OP1_TYPE == IS_CONST &&
OP2_TYPE == IS_CONST &&
- EXPECTED((fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) != NULL)) {
+ EXPECTED((fbc = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)))) != NULL)) {
/* nothing to do */
} else if (OP1_TYPE != IS_CONST &&
OP2_TYPE == IS_CONST &&
- EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2))) == ce)) {
- fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)) + sizeof(void*));
+ EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2))) == ce)) {
+ fbc = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)) + sizeof(void*));
} else if (OP2_TYPE != IS_UNUSED) {
zend_free_op free_op2;
@@ -3143,7 +3141,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, UNUSED|CLASS_FETCH|CONST|VAR,
if (ce->get_static_method) {
fbc = ce->get_static_method(ce, Z_STR_P(function_name));
} else {
- fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((OP2_TYPE == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
+ fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((OP2_TYPE == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL));
}
if (UNEXPECTED(fbc == NULL)) {
if (EXPECTED(!EG(exception))) {
@@ -3236,7 +3234,7 @@ ZEND_VM_HOT_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST, NUM)
zval *function_name, *func;
zend_execute_data *call;
- function_name = (zval*)EX_CONSTANT(opline->op2);
+ function_name = (zval*)RT_CONSTANT(opline, opline->op2);
fbc = CACHED_PTR(Z_CACHE_SLOT_P(function_name));
if (UNEXPECTED(fbc == NULL)) {
func = zend_hash_find(EG(function_table), Z_STR_P(function_name+1));
@@ -3374,7 +3372,7 @@ ZEND_VM_HANDLER(118, ZEND_INIT_USER_CALL, CONST, CONST|TMPVAR|CV, NUM)
init_func_run_time_cache(&func->op_array);
}
} else {
- zend_internal_type_error(EX_USES_STRICT_TYPES(), "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(EX_CONSTANT(opline->op1)), error);
+ zend_internal_type_error(EX_USES_STRICT_TYPES(), "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error);
efree(error);
FREE_OP2();
if (UNEXPECTED(EG(exception))) {
@@ -3401,8 +3399,8 @@ ZEND_VM_HANDLER(69, ZEND_INIT_NS_FCALL_BY_NAME, ANY, CONST, NUM)
zend_function *fbc;
zend_execute_data *call;
- func_name = EX_CONSTANT(opline->op2) + 1;
- fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
+ func_name = RT_CONSTANT(opline, opline->op2) + 1;
+ fbc = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)));
if (UNEXPECTED(fbc == NULL)) {
func = zend_hash_find(EG(function_table), Z_STR_P(func_name));
if (func == NULL) {
@@ -3410,12 +3408,12 @@ ZEND_VM_HANDLER(69, ZEND_INIT_NS_FCALL_BY_NAME, ANY, CONST, NUM)
func = zend_hash_find(EG(function_table), Z_STR_P(func_name));
if (UNEXPECTED(func == NULL)) {
SAVE_OPLINE();
- zend_throw_error(NULL, "Call to undefined function %s()", Z_STRVAL_P(EX_CONSTANT(opline->op2)));
+ zend_throw_error(NULL, "Call to undefined function %s()", Z_STRVAL_P(RT_CONSTANT(opline, opline->op2)));
HANDLE_EXCEPTION();
}
}
fbc = Z_FUNC_P(func);
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), fbc);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), fbc);
if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!fbc->op_array.run_time_cache)) {
init_func_run_time_cache(&fbc->op_array);
}
@@ -4079,11 +4077,11 @@ ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, CV, JMP_ADDR)
ZEND_VM_SET_RELATIVE_OPCODE(opline, opline->extended_value);
ZEND_VM_CONTINUE();
}
- catch_ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
+ catch_ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)));
if (UNEXPECTED(catch_ce == NULL)) {
- catch_ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD);
+ catch_ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD);
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), catch_ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), catch_ce);
}
ce = EG(exception)->ce;
@@ -4677,11 +4675,11 @@ ZEND_VM_HOT_HANDLER(64, ZEND_RECV_INIT, NUM, CONST)
arg_num = opline->op1.num;
param = _get_zval_ptr_cv_undef_BP_VAR_W(opline->result.var EXECUTE_DATA_CC);
if (arg_num > EX_NUM_ARGS()) {
- ZVAL_COPY(param, EX_CONSTANT(opline->op2));
- if (Z_OPT_CONSTANT_P(param)) {
+ ZVAL_COPY(param, RT_CONSTANT(opline, opline->op2));
+ if (Z_OPT_TYPE_P(param) == IS_CONSTANT_AST) {
SAVE_OPLINE();
if (UNEXPECTED(zval_update_constant_ex(param, EX(func)->op_array.scope) != SUCCESS)) {
- zval_ptr_dtor(param);
+ zval_ptr_dtor_nogc(param);
ZVAL_UNDEF(param);
HANDLE_EXCEPTION();
}
@@ -4689,7 +4687,7 @@ ZEND_VM_HOT_HANDLER(64, ZEND_RECV_INIT, NUM, CONST)
}
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
- zval *default_value = EX_CONSTANT(opline->op2);
+ zval *default_value = RT_CONSTANT(opline, opline->op2);
SAVE_OPLINE();
if (UNEXPECTED(!zend_verify_arg_type(EX(func), arg_num, param, default_value, CACHE_ADDR(Z_CACHE_SLOT_P(default_value))) || EG(exception))) {
@@ -4842,15 +4840,15 @@ ZEND_VM_HANDLER(68, ZEND_NEW, UNUSED|CLASS_FETCH|CONST|VAR, ANY, NUM)
SAVE_OPLINE();
if (OP1_TYPE == IS_CONST) {
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), ce);
}
} else if (OP1_TYPE == IS_UNUSED) {
ce = zend_fetch_class(NULL, opline->op1.num);
@@ -4987,31 +4985,31 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, UNUSED, CONST, CONST_FETCH)
USE_OPLINE
zend_constant *c;
- if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2))))) {
- c = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
- } else if ((c = zend_quick_get_constant(EX_CONSTANT(opline->op2) + 1, opline->extended_value)) == NULL) {
+ if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2))))) {
+ c = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)));
+ } else if ((c = zend_quick_get_constant(RT_CONSTANT(opline, opline->op2) + 1, opline->extended_value)) == NULL) {
SAVE_OPLINE();
if ((opline->extended_value & IS_CONSTANT_UNQUALIFIED) != 0) {
- char *actual = (char *)zend_memrchr(Z_STRVAL_P(EX_CONSTANT(opline->op2)), '\\', Z_STRLEN_P(EX_CONSTANT(opline->op2)));
+ char *actual = (char *)zend_memrchr(Z_STRVAL_P(RT_CONSTANT(opline, opline->op2)), '\\', Z_STRLEN_P(RT_CONSTANT(opline, opline->op2)));
if (!actual) {
- ZVAL_STR_COPY(EX_VAR(opline->result.var), Z_STR_P(EX_CONSTANT(opline->op2)));
+ ZVAL_STR_COPY(EX_VAR(opline->result.var), Z_STR_P(RT_CONSTANT(opline, opline->op2)));
} else {
actual++;
ZVAL_STRINGL(EX_VAR(opline->result.var),
- actual, Z_STRLEN_P(EX_CONSTANT(opline->op2)) - (actual - Z_STRVAL_P(EX_CONSTANT(opline->op2))));
+ actual, Z_STRLEN_P(RT_CONSTANT(opline, opline->op2)) - (actual - Z_STRVAL_P(RT_CONSTANT(opline, opline->op2))));
}
/* non-qualified constant - allow text substitution */
zend_error(E_WARNING, "Use of undefined constant %s - assumed '%s' (this will throw an Error in a future version of PHP)",
Z_STRVAL_P(EX_VAR(opline->result.var)), Z_STRVAL_P(EX_VAR(opline->result.var)));
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
} else {
- zend_throw_error(NULL, "Undefined constant '%s'", Z_STRVAL_P(EX_CONSTANT(opline->op2)));
+ zend_throw_error(NULL, "Undefined constant '%s'", Z_STRVAL_P(RT_CONSTANT(opline, opline->op2)));
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
} else {
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), c);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), c);
}
#ifdef ZTS
@@ -5038,22 +5036,22 @@ ZEND_VM_HANDLER(181, ZEND_FETCH_CLASS_CONSTANT, VAR|CONST|UNUSED|CLASS_FETCH, CO
do {
if (OP1_TYPE == IS_CONST) {
- if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2))))) {
- value = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
+ if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2))))) {
+ value = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)));
#ifdef ZTS
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)));
#endif
break;
- } else if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1))))) {
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
+ } else if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1))))) {
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), ce);
}
} else {
if (OP1_TYPE == IS_UNUSED) {
@@ -5066,21 +5064,21 @@ ZEND_VM_HANDLER(181, ZEND_FETCH_CLASS_CONSTANT, VAR|CONST|UNUSED|CLASS_FETCH, CO
} else {
ce = Z_CE_P(EX_VAR(opline->op1.var));
}
- if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2))) == ce)) {
- value = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)) + sizeof(void*));
+ if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2))) == ce)) {
+ value = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)) + sizeof(void*));
break;
}
}
- if (EXPECTED((c = zend_hash_find_ptr(&ce->constants_table, Z_STR_P(EX_CONSTANT(opline->op2)))) != NULL)) {
+ if (EXPECTED((c = zend_hash_find_ptr(&ce->constants_table, Z_STR_P(RT_CONSTANT(opline, opline->op2)))) != NULL)) {
scope = EX(func)->op_array.scope;
if (!zend_verify_const_access(c, scope)) {
- zend_throw_error(NULL, "Cannot access %s const %s::%s", zend_visibility_string(Z_ACCESS_FLAGS(c->value)), ZSTR_VAL(ce->name), Z_STRVAL_P(EX_CONSTANT(opline->op2)));
+ zend_throw_error(NULL, "Cannot access %s const %s::%s", zend_visibility_string(Z_ACCESS_FLAGS(c->value)), ZSTR_VAL(ce->name), Z_STRVAL_P(RT_CONSTANT(opline, opline->op2)));
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
value = &c->value;
- if (Z_CONSTANT_P(value)) {
+ if (Z_TYPE_P(value) == IS_CONSTANT_AST) {
zval_update_constant_ex(value, c->ce);
if (UNEXPECTED(EG(exception) != NULL)) {
ZVAL_UNDEF(EX_VAR(opline->result.var));
@@ -5088,12 +5086,12 @@ ZEND_VM_HANDLER(181, ZEND_FETCH_CLASS_CONSTANT, VAR|CONST|UNUSED|CLASS_FETCH, CO
}
}
if (OP1_TYPE == IS_CONST) {
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), value);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), value);
} else {
- CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce, value);
+ CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), ce, value);
}
} else {
- zend_throw_error(NULL, "Undefined class constant '%s'", Z_STRVAL_P(EX_CONSTANT(opline->op2)));
+ zend_throw_error(NULL, "Undefined class constant '%s'", Z_STRVAL_P(RT_CONSTANT(opline, opline->op2)));
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
@@ -5195,13 +5193,13 @@ ZEND_VM_C_LABEL(num_index):
ZEND_VM_C_GOTO(str_index);
} else {
zend_error(E_WARNING, "Illegal offset type");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
FREE_OP2();
} else {
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -5219,8 +5217,7 @@ ZEND_VM_HANDLER(71, ZEND_INIT_ARRAY, CONST|TMP|VAR|CV, CONST|TMPVAR|UNUSED|NEXT|
} else {
size = 0;
}
- ZVAL_NEW_ARR(array);
- zend_hash_init(Z_ARRVAL_P(array), size, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(array, zend_new_array(size));
if (OP1_TYPE != IS_UNUSED) {
/* Explicitly initialize array as not-packed if flag is set */
@@ -5277,8 +5274,7 @@ ZEND_VM_HANDLER(21, ZEND_CAST, CONST|TMP|VAR|CV, ANY, TYPE)
if (opline->extended_value == IS_ARRAY) {
if (Z_TYPE_P(expr) != IS_OBJECT) {
- ZVAL_NEW_ARR(result);
- zend_hash_init(Z_ARRVAL_P(result), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(result, zend_new_array(8));
if (Z_TYPE_P(expr) != IS_NULL) {
expr = zend_hash_index_add_new(Z_ARRVAL_P(result), 0, expr);
if (OP1_TYPE == IS_CONST) {
@@ -5455,9 +5451,9 @@ ZEND_VM_HANDLER(179, ZEND_UNSET_STATIC_PROP, CONST|TMPVAR|CV, UNUSED|CLASS_FETCH
}
if (OP2_TYPE == IS_CONST) {
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)), RT_CONSTANT(opline, opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
if (OP1_TYPE != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
@@ -5466,7 +5462,7 @@ ZEND_VM_HANDLER(179, ZEND_UNSET_STATIC_PROP, CONST|TMPVAR|CV, UNUSED|CLASS_FETCH
FREE_OP1();
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), ce);
}
} else if (OP2_TYPE == IS_UNUSED) {
ce = zend_fetch_class(NULL, opline->op2.num);
@@ -6272,8 +6268,8 @@ ZEND_VM_HANDLER(180, ZEND_ISSET_ISEMPTY_STATIC_PROP, CONST|TMPVAR|CV, UNUSED|CLA
}
if (OP2_TYPE == IS_CONST) {
- if (OP1_TYPE == IS_CONST && EXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) != NULL)) {
- value = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)) + sizeof(void*));
+ if (OP1_TYPE == IS_CONST && EXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)))) != NULL)) {
+ value = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)) + sizeof(void*));
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
@@ -6281,14 +6277,14 @@ ZEND_VM_HANDLER(180, ZEND_ISSET_ISEMPTY_STATIC_PROP, CONST|TMPVAR|CV, UNUSED|CLA
}
ZEND_VM_C_GOTO(is_static_prop_return);
- } else if (UNEXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ } else if (UNEXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)))) == NULL)) {
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)), RT_CONSTANT(opline, opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), ce);
}
} else {
if (OP2_TYPE == IS_UNUSED) {
@@ -6306,9 +6302,9 @@ ZEND_VM_HANDLER(180, ZEND_ISSET_ISEMPTY_STATIC_PROP, CONST|TMPVAR|CV, UNUSED|CLA
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
if (OP1_TYPE == IS_CONST &&
- EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1))) == ce)) {
+ EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1))) == ce)) {
- value = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)) + sizeof(void*));
+ value = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)) + sizeof(void*));
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
@@ -6322,7 +6318,7 @@ ZEND_VM_HANDLER(180, ZEND_ISSET_ISEMPTY_STATIC_PROP, CONST|TMPVAR|CV, UNUSED|CLA
value = zend_std_get_static_property(ce, Z_STR_P(varname), 1);
if (OP1_TYPE == IS_CONST && value) {
- CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, value);
+ CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), ce, value);
}
if (OP1_TYPE != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
@@ -6786,8 +6782,8 @@ ZEND_VM_HANDLER(145, ZEND_DECLARE_INHERITED_CLASS_DELAYED, ANY, VAR)
zval *zce, *orig_zce;
SAVE_OPLINE();
- if ((zce = zend_hash_find(EG(class_table), Z_STR_P(EX_CONSTANT(opline->op1)))) == NULL ||
- ((orig_zce = zend_hash_find(EG(class_table), Z_STR_P(EX_CONSTANT(opline->op1)+1))) != NULL &&
+ if ((zce = zend_hash_find(EG(class_table), Z_STR_P(RT_CONSTANT(opline, opline->op1)))) == NULL ||
+ ((orig_zce = zend_hash_find(EG(class_table), Z_STR_P(RT_CONSTANT(opline, opline->op1)+1))) != NULL &&
Z_CE_P(zce) != Z_CE_P(orig_zce))) {
do_bind_inherited_class(&EX(func)->op_array, opline, EG(class_table), Z_CE_P(EX_VAR(opline->op2.var)), 0);
}
@@ -6800,7 +6796,7 @@ ZEND_VM_HANDLER(171, ZEND_DECLARE_ANON_CLASS, ANY, ANY, JMP_ADDR)
USE_OPLINE
SAVE_OPLINE();
- ce = zend_hash_find_ptr(EG(class_table), Z_STR_P(EX_CONSTANT(opline->op1)));
+ ce = zend_hash_find_ptr(EG(class_table), Z_STR_P(RT_CONSTANT(opline, opline->op1)));
Z_CE_P(EX_VAR(opline->result.var)) = ce;
ZEND_ASSERT(ce != NULL);
@@ -6822,7 +6818,7 @@ ZEND_VM_HANDLER(172, ZEND_DECLARE_ANON_INHERITED_CLASS, ANY, VAR, JMP_ADDR)
USE_OPLINE
SAVE_OPLINE();
- ce = zend_hash_find_ptr(EG(class_table), Z_STR_P(EX_CONSTANT(opline->op1)));
+ ce = zend_hash_find_ptr(EG(class_table), Z_STR_P(RT_CONSTANT(opline, opline->op1)));
Z_CE_P(EX_VAR(opline->result.var)) = ce;
ZEND_ASSERT(ce != NULL);
@@ -6875,11 +6871,11 @@ ZEND_VM_C_LABEL(try_instanceof):
zend_class_entry *ce;
if (OP2_TYPE == IS_CONST) {
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)), RT_CONSTANT(opline, opline->op2) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD);
if (EXPECTED(ce)) {
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), ce);
}
}
} else if (OP2_TYPE == IS_UNUSED) {
@@ -6930,13 +6926,13 @@ ZEND_VM_HANDLER(144, ZEND_ADD_INTERFACE, ANY, CONST)
zend_class_entry *iface;
SAVE_OPLINE();
- iface = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
+ iface = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)));
if (UNEXPECTED(iface == NULL)) {
- iface = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_INTERFACE);
+ iface = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)), RT_CONSTANT(opline, opline->op2) + 1, ZEND_FETCH_CLASS_INTERFACE);
if (UNEXPECTED(iface == NULL)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), iface);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), iface);
}
if (UNEXPECTED((iface->ce_flags & ZEND_ACC_INTERFACE) == 0)) {
@@ -6954,10 +6950,10 @@ ZEND_VM_HANDLER(154, ZEND_ADD_TRAIT, ANY, ANY)
zend_class_entry *trait;
SAVE_OPLINE();
- trait = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
+ trait = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)));
if (UNEXPECTED(trait == NULL)) {
- trait = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)),
- EX_CONSTANT(opline->op2) + 1,
+ trait = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)),
+ RT_CONSTANT(opline, opline->op2) + 1,
ZEND_FETCH_CLASS_TRAIT);
if (UNEXPECTED(trait == NULL)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -6965,7 +6961,7 @@ ZEND_VM_HANDLER(154, ZEND_ADD_TRAIT, ANY, ANY)
if (!(trait->ce_flags & ZEND_ACC_TRAIT)) {
zend_error_noreturn(E_ERROR, "%s cannot use %s - it is not a trait", ZSTR_VAL(ce->name), ZSTR_VAL(trait->name));
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), trait);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), trait);
}
zend_do_implement_trait(ce, trait);
@@ -7154,7 +7150,7 @@ ZEND_VM_HANDLER(143, ZEND_DECLARE_CONST, CONST, CONST)
ZVAL_COPY(&c.value, val);
if (Z_OPT_CONSTANT(c.value)) {
if (UNEXPECTED(zval_update_constant_ex(&c.value, EX(func)->op_array.scope) != SUCCESS)) {
- zval_ptr_dtor(&c.value);
+ zval_ptr_dtor_nogc(&c.value);
FREE_OP1();
FREE_OP2();
HANDLE_EXCEPTION();
@@ -7179,7 +7175,7 @@ ZEND_VM_HANDLER(153, ZEND_DECLARE_LAMBDA_FUNCTION, CONST, UNUSED)
zval *object;
zend_class_entry *called_scope;
- zfunc = zend_hash_find(EG(function_table), Z_STR_P(EX_CONSTANT(opline->op1)));
+ zfunc = zend_hash_find(EG(function_table), Z_STR_P(RT_CONSTANT(opline, opline->op1)));
ZEND_ASSERT(zfunc != NULL && Z_FUNC_P(zfunc)->type == ZEND_USER_FUNCTION);
if (Z_TYPE(EX(This)) == IS_OBJECT) {
@@ -7688,12 +7684,12 @@ ZEND_VM_HANDLER(122, ZEND_DEFINED, CONST, ANY)
zend_constant *c;
int result;
- if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1))))) {
+ if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1))))) {
result = 1;
- } else if ((c = zend_quick_get_constant(EX_CONSTANT(opline->op1), 0)) == NULL) {
+ } else if ((c = zend_quick_get_constant(RT_CONSTANT(opline, opline->op1), 0)) == NULL) {
result = 0;
} else {
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), c);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), c);
result = 1;
}
ZEND_VM_SMART_BRANCH(result, 0);
@@ -7774,8 +7770,7 @@ ZEND_VM_HANDLER(158, ZEND_CALL_TRAMPOLINE, ANY, ANY)
SAVE_OPLINE();
- args = emalloc(sizeof(zend_array));
- zend_hash_init(args, num_args, NULL, ZVAL_PTR_DTOR, 0);
+ args = zend_new_array(num_args);
if (num_args) {
zval *p = ZEND_CALL_ARG(execute_data, 1);
zval *end = p + num_args;
@@ -7937,7 +7932,7 @@ ZEND_VM_HANDLER(183, ZEND_BIND_STATIC, CV, CONST, REF)
value = zend_hash_find(ht, Z_STR_P(varname));
if (opline->extended_value) {
- if (Z_CONSTANT_P(value)) {
+ if (Z_TYPE_P(value) == IS_CONSTANT_AST) {
SAVE_OPLINE();
if (UNEXPECTED(zval_update_constant_ex(value, EX(func)->op_array.scope) != SUCCESS)) {
ZVAL_NULL(variable_ptr);
@@ -8093,7 +8088,7 @@ ZEND_VM_HANDLER(189, ZEND_IN_ARRAY, CONST|TMP|VAR|CV, CONST, NUM)
USE_OPLINE
zend_free_op free_op1;
zval *op1;
- HashTable *ht = Z_ARRVAL_P(EX_CONSTANT(opline->op2));
+ HashTable *ht = Z_ARRVAL_P(RT_CONSTANT(opline, opline->op2));
int result;
SAVE_OPLINE();
@@ -8259,7 +8254,7 @@ ZEND_VM_HANDLER(195, ZEND_FUNC_GET_ARGS, UNUSED|CONST, UNUSED)
arg_count = EX_NUM_ARGS();
if (OP1_TYPE == IS_CONST) {
- skip = Z_LVAL_P(EX_CONSTANT(opline->op1));
+ skip = Z_LVAL_P(RT_CONSTANT(opline, opline->op1));
if (arg_count < skip) {
result_size = 0;
} else {
@@ -8270,8 +8265,7 @@ ZEND_VM_HANDLER(195, ZEND_FUNC_GET_ARGS, UNUSED|CONST, UNUSED)
result_size = arg_count;
}
- ht = (zend_array *) emalloc(sizeof(zend_array));
- zend_hash_init(ht, result_size, NULL, ZVAL_PTR_DTOR, 0);
+ ht = zend_new_array(result_size);
ZVAL_ARR(EX_VAR(opline->result.var), ht);
if (result_size) {
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 6b83684b7f..9d99daf986 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -1589,7 +1589,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DECLARE_ANON_CLASS_SPEC_HANDLE
USE_OPLINE
SAVE_OPLINE();
- ce = zend_hash_find_ptr(EG(class_table), Z_STR_P(EX_CONSTANT(opline->op1)));
+ ce = zend_hash_find_ptr(EG(class_table), Z_STR_P(RT_CONSTANT(opline, opline->op1)));
Z_CE_P(EX_VAR(opline->result.var)) = ce;
ZEND_ASSERT(ce != NULL);
@@ -1650,10 +1650,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_TRAIT_SPEC_HANDLER(ZEND_OP
zend_class_entry *trait;
SAVE_OPLINE();
- trait = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
+ trait = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)));
if (UNEXPECTED(trait == NULL)) {
- trait = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)),
- EX_CONSTANT(opline->op2) + 1,
+ trait = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)),
+ RT_CONSTANT(opline, opline->op2) + 1,
ZEND_FETCH_CLASS_TRAIT);
if (UNEXPECTED(trait == NULL)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -1661,7 +1661,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_TRAIT_SPEC_HANDLER(ZEND_OP
if (!(trait->ce_flags & ZEND_ACC_TRAIT)) {
zend_error_noreturn(E_ERROR, "%s cannot use %s - it is not a trait", ZSTR_VAL(ce->name), ZSTR_VAL(trait->name));
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), trait);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), trait);
}
zend_do_implement_trait(ce, trait);
@@ -1965,8 +1965,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CALL_TRAMPOLINE_SPEC_HANDLER(Z
SAVE_OPLINE();
- args = emalloc(sizeof(zend_array));
- zend_hash_init(args, num_args, NULL, ZVAL_PTR_DTOR, 0);
+ args = zend_new_array(num_args);
if (num_args) {
zval *p = ZEND_CALL_ARG(execute_data, 1);
zval *end = p + num_args;
@@ -2094,14 +2093,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_SPEC_CONST_HANDLER
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
} else {
- zval *class_name = EX_CONSTANT(opline->op2);
+ zval *class_name = RT_CONSTANT(opline, opline->op2);
try_class_name:
if (IS_CONST == IS_CONST) {
zend_class_entry *ce = CACHED_PTR(Z_CACHE_SLOT_P(class_name));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(class_name), EX_CONSTANT(opline->op2) + 1, opline->extended_value);
+ ce = zend_fetch_class_by_name(Z_STR_P(class_name), RT_CONSTANT(opline, opline->op2) + 1, opline->extended_value);
CACHE_PTR(Z_CACHE_SLOT_P(class_name), ce);
}
Z_CE_P(EX_VAR(opline->result.var)) = ce;
@@ -2133,7 +2132,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME
zval *function_name, *func;
zend_execute_data *call;
- function_name = (zval*)EX_CONSTANT(opline->op2);
+ function_name = (zval*)RT_CONSTANT(opline, opline->op2);
fbc = CACHED_PTR(Z_CACHE_SLOT_P(function_name));
if (UNEXPECTED(fbc == NULL)) {
func = zend_hash_find(EG(function_table), Z_STR_P(function_name+1));
@@ -2164,7 +2163,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_DYNAMIC_CALL_SPEC_CONST_H
zend_execute_data *call;
SAVE_OPLINE();
- function_name = EX_CONSTANT(opline->op2);
+ function_name = RT_CONSTANT(opline, opline->op2);
try_function_name:
if (IS_CONST != IS_CONST && EXPECTED(Z_TYPE_P(function_name) == IS_STRING)) {
@@ -2220,8 +2219,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_NS_FCALL_BY_NAME_SPEC_CON
zend_function *fbc;
zend_execute_data *call;
- func_name = EX_CONSTANT(opline->op2) + 1;
- fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
+ func_name = RT_CONSTANT(opline, opline->op2) + 1;
+ fbc = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)));
if (UNEXPECTED(fbc == NULL)) {
func = zend_hash_find(EG(function_table), Z_STR_P(func_name));
if (func == NULL) {
@@ -2229,12 +2228,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_NS_FCALL_BY_NAME_SPEC_CON
func = zend_hash_find(EG(function_table), Z_STR_P(func_name));
if (UNEXPECTED(func == NULL)) {
SAVE_OPLINE();
- zend_throw_error(NULL, "Call to undefined function %s()", Z_STRVAL_P(EX_CONSTANT(opline->op2)));
+ zend_throw_error(NULL, "Call to undefined function %s()", Z_STRVAL_P(RT_CONSTANT(opline, opline->op2)));
HANDLE_EXCEPTION();
}
}
fbc = Z_FUNC_P(func);
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), fbc);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), fbc);
if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!fbc->op_array.run_time_cache)) {
init_func_run_time_cache(&fbc->op_array);
}
@@ -2252,7 +2251,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_FCALL_SPEC_CO
{
USE_OPLINE
- zval *fname = EX_CONSTANT(opline->op2);
+ zval *fname = RT_CONSTANT(opline, opline->op2);
zval *func;
zend_function *fbc;
zend_execute_data *call;
@@ -2292,11 +2291,11 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RECV_INIT_SPEC_CON
arg_num = opline->op1.num;
param = _get_zval_ptr_cv_undef_BP_VAR_W(opline->result.var EXECUTE_DATA_CC);
if (arg_num > EX_NUM_ARGS()) {
- ZVAL_COPY(param, EX_CONSTANT(opline->op2));
- if (Z_OPT_CONSTANT_P(param)) {
+ ZVAL_COPY(param, RT_CONSTANT(opline, opline->op2));
+ if (Z_OPT_TYPE_P(param) == IS_CONSTANT_AST) {
SAVE_OPLINE();
if (UNEXPECTED(zval_update_constant_ex(param, EX(func)->op_array.scope) != SUCCESS)) {
- zval_ptr_dtor(param);
+ zval_ptr_dtor_nogc(param);
ZVAL_UNDEF(param);
HANDLE_EXCEPTION();
}
@@ -2304,7 +2303,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RECV_INIT_SPEC_CON
}
if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
- zval *default_value = EX_CONSTANT(opline->op2);
+ zval *default_value = RT_CONSTANT(opline, opline->op2);
SAVE_OPLINE();
if (UNEXPECTED(!zend_verify_arg_type(EX(func), arg_num, param, default_value, CACHE_ADDR(Z_CACHE_SLOT_P(default_value))) || EG(exception))) {
@@ -2323,13 +2322,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_INTERFACE_SPEC_CONST_HANDL
zend_class_entry *iface;
SAVE_OPLINE();
- iface = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
+ iface = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)));
if (UNEXPECTED(iface == NULL)) {
- iface = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_INTERFACE);
+ iface = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)), RT_CONSTANT(opline, opline->op2) + 1, ZEND_FETCH_CLASS_INTERFACE);
if (UNEXPECTED(iface == NULL)) {
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), iface);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), iface);
}
if (UNEXPECTED((iface->ce_flags & ZEND_ACC_INTERFACE) == 0)) {
@@ -2355,8 +2354,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DECLARE_INHERITED_CLASS_DELAYE
zval *zce, *orig_zce;
SAVE_OPLINE();
- if ((zce = zend_hash_find(EG(class_table), Z_STR_P(EX_CONSTANT(opline->op1)))) == NULL ||
- ((orig_zce = zend_hash_find(EG(class_table), Z_STR_P(EX_CONSTANT(opline->op1)+1))) != NULL &&
+ if ((zce = zend_hash_find(EG(class_table), Z_STR_P(RT_CONSTANT(opline, opline->op1)))) == NULL ||
+ ((orig_zce = zend_hash_find(EG(class_table), Z_STR_P(RT_CONSTANT(opline, opline->op1)+1))) != NULL &&
Z_CE_P(zce) != Z_CE_P(orig_zce))) {
do_bind_inherited_class(&EX(func)->op_array, opline, EG(class_table), Z_CE_P(EX_VAR(opline->op2.var)), 0);
}
@@ -2369,7 +2368,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DECLARE_ANON_INHERITED_CLASS_S
USE_OPLINE
SAVE_OPLINE();
- ce = zend_hash_find_ptr(EG(class_table), Z_STR_P(EX_CONSTANT(opline->op1)));
+ ce = zend_hash_find_ptr(EG(class_table), Z_STR_P(RT_CONSTANT(opline, opline->op1)));
Z_CE_P(EX_VAR(opline->result.var)) = ce;
ZEND_ASSERT(ce != NULL);
@@ -2400,7 +2399,7 @@ try_class_name:
zend_class_entry *ce = CACHED_PTR(Z_CACHE_SLOT_P(class_name));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(class_name), EX_CONSTANT(opline->op2) + 1, opline->extended_value);
+ ce = zend_fetch_class_by_name(Z_STR_P(class_name), RT_CONSTANT(opline, opline->op2) + 1, opline->extended_value);
CACHE_PTR(Z_CACHE_SLOT_P(class_name), ce);
}
Z_CE_P(EX_VAR(opline->result.var)) = ce;
@@ -2442,7 +2441,7 @@ try_class_name:
zend_class_entry *ce = CACHED_PTR(Z_CACHE_SLOT_P(class_name));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(class_name), EX_CONSTANT(opline->op2) + 1, opline->extended_value);
+ ce = zend_fetch_class_by_name(Z_STR_P(class_name), RT_CONSTANT(opline, opline->op2) + 1, opline->extended_value);
CACHE_PTR(Z_CACHE_SLOT_P(class_name), ce);
}
Z_CE_P(EX_VAR(opline->result.var)) = ce;
@@ -2540,7 +2539,7 @@ try_class_name:
zend_class_entry *ce = CACHED_PTR(Z_CACHE_SLOT_P(class_name));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(class_name), EX_CONSTANT(opline->op2) + 1, opline->extended_value);
+ ce = zend_fetch_class_by_name(Z_STR_P(class_name), RT_CONSTANT(opline, opline->op2) + 1, opline->extended_value);
CACHE_PTR(Z_CACHE_SLOT_P(class_name), ce);
}
Z_CE_P(EX_VAR(opline->result.var)) = ce;
@@ -2629,7 +2628,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_NOT_SPEC_CONST_HANDLER(ZEND
zval *op1;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
ZVAL_LONG(EX_VAR(opline->result.var), ~Z_LVAL_P(op1));
ZEND_VM_NEXT_OPCODE();
@@ -2637,7 +2636,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_NOT_SPEC_CONST_HANDLER(ZEND
SAVE_OPLINE();
bitwise_not_function(EX_VAR(opline->result.var),
- EX_CONSTANT(opline->op1));
+ RT_CONSTANT(opline, opline->op1));
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
@@ -2648,7 +2647,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_NOT_SPEC_CONST_HANDLER(ZE
zval *val;
- val = EX_CONSTANT(opline->op1);
+ val = RT_CONSTANT(opline, opline->op1);
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
ZVAL_FALSE(EX_VAR(opline->result.var));
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
@@ -2674,7 +2673,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ECHO_SPEC_CONST_HANDLER(ZEND_O
zval *z;
SAVE_OPLINE();
- z = EX_CONSTANT(opline->op1);
+ z = RT_CONSTANT(opline, opline->op1);
if (Z_TYPE_P(z) == IS_STRING) {
zend_string *str = Z_STR_P(z);
@@ -2702,7 +2701,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMPZ_SPEC_CONST_HA
zval *val;
- val = EX_CONSTANT(opline->op1);
+ val = RT_CONSTANT(opline, opline->op1);
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
ZEND_VM_SET_NEXT_OPCODE(opline + 1);
@@ -2734,7 +2733,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMPNZ_SPEC_CONST_H
zval *val;
- val = EX_CONSTANT(opline->op1);
+ val = RT_CONSTANT(opline, opline->op1);
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
ZEND_VM_SET_OPCODE(OP_JMP_ADDR(opline, opline->op2));
@@ -2765,7 +2764,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMPZNZ_SPEC_CONST_
zval *val;
- val = EX_CONSTANT(opline->op1);
+ val = RT_CONSTANT(opline, opline->op1);
if (EXPECTED(Z_TYPE_INFO_P(val) == IS_TRUE)) {
ZEND_VM_SET_RELATIVE_OPCODE(opline, opline->extended_value);
@@ -2798,7 +2797,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_CONST_HANDLER(ZEN
zval *val;
int ret;
- val = EX_CONSTANT(opline->op1);
+ val = RT_CONSTANT(opline, opline->op1);
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
ZVAL_TRUE(EX_VAR(opline->result.var));
@@ -2835,7 +2834,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_CONST_HANDLER(ZE
zval *val;
int ret;
- val = EX_CONSTANT(opline->op1);
+ val = RT_CONSTANT(opline, opline->op1);
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
ZVAL_TRUE(EX_VAR(opline->result.var));
@@ -2872,7 +2871,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_SPEC_CONST_
zval *return_value;
zend_free_op free_op1;
- retval_ptr = EX_CONSTANT(opline->op1);
+ retval_ptr = RT_CONSTANT(opline, opline->op1);
return_value = EX(return_value);
if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(retval_ptr) == IS_UNDEF)) {
SAVE_OPLINE();
@@ -2944,7 +2943,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_RETURN_BY_REF_SPEC_CONST_HANDL
/* Not supposed to happen, but we'll allow it */
zend_error(E_NOTICE, "Only variable references should be returned by reference");
- retval_ptr = EX_CONSTANT(opline->op1);
+ retval_ptr = RT_CONSTANT(opline, opline->op1);
if (!EX(return_value)) {
} else {
@@ -2996,7 +2995,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_RETURN_SPEC_CONST_HA
zend_generator *generator = zend_get_running_generator(EXECUTE_DATA_C);
SAVE_OPLINE();
- retval = EX_CONSTANT(opline->op1);
+ retval = RT_CONSTANT(opline, opline->op1);
/* Copy return value into generator->retval */
if ((IS_CONST & (IS_CONST|IS_TMP_VAR))) {
@@ -3039,7 +3038,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_THROW_SPEC_CONST_HANDLER(ZEND_
SAVE_OPLINE();
- value = EX_CONSTANT(opline->op1);
+ value = RT_CONSTANT(opline, opline->op1);
do {
if (IS_CONST == IS_CONST || UNEXPECTED(Z_TYPE_P(value) != IS_OBJECT)) {
@@ -3078,7 +3077,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_VAL_SPEC_CONS
zval *value, *arg;
- value = EX_CONSTANT(opline->op1);
+ value = RT_CONSTANT(opline, opline->op1);
arg = ZEND_CALL_VAR(EX(call), opline->result.var);
ZVAL_COPY_VALUE(arg, value);
if (IS_CONST == IS_CONST) {
@@ -3109,7 +3108,7 @@ send_val_by_ref:
ZVAL_UNDEF(arg);
HANDLE_EXCEPTION();
}
- value = EX_CONSTANT(opline->op1);
+ value = RT_CONSTANT(opline, opline->op1);
arg = ZEND_CALL_VAR(EX(call), opline->result.var);
ZVAL_COPY_VALUE(arg, value);
if (IS_CONST == IS_CONST) {
@@ -3140,7 +3139,7 @@ send_val_by_ref:
ZVAL_UNDEF(arg);
HANDLE_EXCEPTION();
}
- value = EX_CONSTANT(opline->op1);
+ value = RT_CONSTANT(opline, opline->op1);
arg = ZEND_CALL_VAR(EX(call), opline->result.var);
ZVAL_COPY_VALUE(arg, value);
if (IS_CONST == IS_CONST) {
@@ -3158,7 +3157,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_USER_SPEC_CONST_HANDLER(Z
SAVE_OPLINE();
- arg = EX_CONSTANT(opline->op1);
+ arg = RT_CONSTANT(opline, opline->op1);
param = ZEND_CALL_VAR(EX(call), opline->result.var);
if (UNEXPECTED(ARG_MUST_BE_SENT_BY_REF(EX(call)->func, opline->op2.num))) {
@@ -3180,7 +3179,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_SPEC_CONST_HANDLER(ZEND_O
zval *val;
- val = EX_CONSTANT(opline->op1);
+ val = RT_CONSTANT(opline, opline->op1);
if (Z_TYPE_INFO_P(val) == IS_TRUE) {
ZVAL_TRUE(EX_VAR(opline->result.var));
} else if (EXPECTED(Z_TYPE_INFO_P(val) <= IS_TRUE)) {
@@ -3209,15 +3208,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_NEW_SPEC_CONST_HANDLER(ZEND_OP
SAVE_OPLINE();
if (IS_CONST == IS_CONST) {
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), ce);
}
} else if (IS_CONST == IS_UNUSED) {
ce = zend_fetch_class(NULL, opline->op1.num);
@@ -3281,7 +3280,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CLONE_SPEC_CONST_HANDLER(ZEND_
zend_object_clone_obj_t clone_call;
SAVE_OPLINE();
- obj = EX_CONSTANT(opline->op1);
+ obj = RT_CONSTANT(opline, opline->op1);
if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_TYPE_P(obj) == IS_UNDEF)) {
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
@@ -3356,7 +3355,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CAST_SPEC_CONST_HANDLER(ZEND_O
zval *result = EX_VAR(opline->result.var);
SAVE_OPLINE();
- expr = EX_CONSTANT(opline->op1);
+ expr = RT_CONSTANT(opline, opline->op1);
switch (opline->extended_value) {
case IS_NULL:
@@ -3392,8 +3391,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CAST_SPEC_CONST_HANDLER(ZEND_O
if (opline->extended_value == IS_ARRAY) {
if (Z_TYPE_P(expr) != IS_OBJECT) {
- ZVAL_NEW_ARR(result);
- zend_hash_init(Z_ARRVAL_P(result), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(result, zend_new_array(8));
if (Z_TYPE_P(expr) != IS_NULL) {
expr = zend_hash_index_add_new(Z_ARRVAL_P(result), 0, expr);
if (IS_CONST == IS_CONST) {
@@ -3436,7 +3434,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HAN
zval *inc_filename;
SAVE_OPLINE();
- inc_filename = EX_CONSTANT(opline->op1);
+ inc_filename = RT_CONSTANT(opline, opline->op1);
new_op_array = zend_include_or_eval(inc_filename, opline->extended_value);
if (UNEXPECTED(EG(exception) != NULL)) {
@@ -3504,7 +3502,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_CONST_HANDLER(
SAVE_OPLINE();
- array_ptr = EX_CONSTANT(opline->op1);
+ array_ptr = RT_CONSTANT(opline, opline->op1);
if (EXPECTED(Z_TYPE_P(array_ptr) == IS_ARRAY)) {
result = EX_VAR(opline->result.var);
ZVAL_COPY_VALUE(result, array_ptr);
@@ -3604,7 +3602,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_CONST_HANDLER
array_ptr = Z_REFVAL_P(array_ref);
}
} else {
- array_ref = array_ptr = EX_CONSTANT(opline->op1);
+ array_ref = array_ptr = RT_CONSTANT(opline, opline->op1);
}
if (EXPECTED(Z_TYPE_P(array_ptr) == IS_ARRAY)) {
@@ -3735,7 +3733,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_EXIT_SPEC_CONST_HANDLER(ZEND_O
SAVE_OPLINE();
if (IS_CONST != IS_UNUSED) {
- zval *ptr = EX_CONSTANT(opline->op1);
+ zval *ptr = RT_CONSTANT(opline, opline->op1);
do {
if (Z_TYPE_P(ptr) == IS_LONG) {
@@ -3766,7 +3764,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_JMP_SET_SPEC_CONST_HANDLER(ZEN
int ret;
SAVE_OPLINE();
- value = EX_CONSTANT(opline->op1);
+ value = RT_CONSTANT(opline, opline->op1);
if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && Z_ISREF_P(value)) {
if (IS_CONST == IS_VAR) {
@@ -3815,7 +3813,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COALESCE_SPEC_CONST_HANDLER(ZE
zval *ref = NULL;
SAVE_OPLINE();
- value = EX_CONSTANT(opline->op1);
+ value = RT_CONSTANT(opline, opline->op1);
if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && Z_ISREF_P(value)) {
if (IS_CONST == IS_VAR) {
@@ -3854,7 +3852,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_QM_ASSIGN_SPEC_CON
zval *value;
zval *result = EX_VAR(opline->result.var);
- value = EX_CONSTANT(opline->op1);
+ value = RT_CONSTANT(opline, opline->op1);
if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(value) == IS_UNDEF)) {
SAVE_OPLINE();
GET_OP1_UNDEF_CV(value, BP_VAR_R);
@@ -3897,7 +3895,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_FROM_SPEC_CONST_HANDLER(
SAVE_OPLINE();
- val = EX_CONSTANT(opline->op1);
+ val = RT_CONSTANT(opline, opline->op1);
if (UNEXPECTED(generator->flags & ZEND_GENERATOR_FORCED_CLOSE)) {
zend_throw_error(NULL, "Cannot use \"yield from\" in a force-closed generator");
@@ -3997,7 +3995,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_STRLEN_SPEC_CONST_HANDLER(ZEND
zval *value;
- value = EX_CONSTANT(opline->op1);
+ value = RT_CONSTANT(opline, opline->op1);
if (EXPECTED(Z_TYPE_P(value) == IS_STRING)) {
ZVAL_LONG(EX_VAR(opline->result.var), Z_STRLEN_P(value));
@@ -4048,7 +4046,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_TYPE_CHECK_SPEC_CONST_HANDLER(
SAVE_OPLINE();
- value = EX_CONSTANT(opline->op1);
+ value = RT_CONSTANT(opline, opline->op1);
if (EXPECTED(Z_TYPE_P(value) == opline->extended_value)) {
if (UNEXPECTED(Z_TYPE_P(value) == IS_RESOURCE)) {
const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(value));
@@ -4075,12 +4073,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DEFINED_SPEC_CONST_HANDLER(ZEN
zend_constant *c;
int result;
- if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1))))) {
+ if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1))))) {
result = 1;
- } else if ((c = zend_quick_get_constant(EX_CONSTANT(opline->op1), 0)) == NULL) {
+ } else if ((c = zend_quick_get_constant(RT_CONSTANT(opline, opline->op1), 0)) == NULL) {
result = 0;
} else {
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), c);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), c);
result = 1;
}
ZEND_VM_SMART_BRANCH(result, 0);
@@ -4094,7 +4092,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_QM_ASSIGN_DOUBLE_S
zval *value;
- value = EX_CONSTANT(opline->op1);
+ value = RT_CONSTANT(opline, opline->op1);
ZVAL_DOUBLE(EX_VAR(opline->result.var), Z_DVAL_P(value));
ZEND_VM_NEXT_OPCODE();
}
@@ -4105,7 +4103,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_QM_ASSIGN_NOREF_SP
zval *value;
- value = EX_CONSTANT(opline->op1);
+ value = RT_CONSTANT(opline, opline->op1);
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
ZEND_VM_NEXT_OPCODE();
}
@@ -4116,8 +4114,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_SPEC_CONST_CONST_HANDLER(Z
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
- op2 = EX_CONSTANT(opline->op2);
+ op1 = RT_CONSTANT(opline, opline->op1);
+ op2 = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
result = EX_VAR(opline->result.var);
@@ -4159,8 +4157,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_SPEC_CONST_CONST_HANDLER(Z
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
- op2 = EX_CONSTANT(opline->op2);
+ op1 = RT_CONSTANT(opline, opline->op1);
+ op2 = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
result = EX_VAR(opline->result.var);
@@ -4202,8 +4200,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MUL_SPEC_CONST_CONST_HANDLER(Z
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
- op2 = EX_CONSTANT(opline->op2);
+ op1 = RT_CONSTANT(opline, opline->op1);
+ op2 = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
zend_long overflow;
@@ -4249,8 +4247,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DIV_SPEC_CONST_CONST_HANDLER(Z
zval *op1, *op2;
SAVE_OPLINE();
- op1 = EX_CONSTANT(opline->op1);
- op2 = EX_CONSTANT(opline->op2);
+ op1 = RT_CONSTANT(opline, opline->op1);
+ op2 = RT_CONSTANT(opline, opline->op2);
fast_div_function(EX_VAR(opline->result.var), op1, op2);
@@ -4263,8 +4261,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_CONST_CONST_HANDLER(Z
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
- op2 = EX_CONSTANT(opline->op2);
+ op1 = RT_CONSTANT(opline, opline->op1);
+ op2 = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
result = EX_VAR(opline->result.var);
@@ -4302,8 +4300,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SL_SPEC_CONST_CONST_HANDLER(ZE
zval *op1, *op2;
- op1 = EX_CONSTANT(opline->op1);
- op2 = EX_CONSTANT(opline->op2);
+ op1 = RT_CONSTANT(opline, opline->op1);
+ op2 = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)
&& EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)
&& EXPECTED((zend_ulong)Z_LVAL_P(op2) < SIZEOF_ZEND_LONG * 8)) {
@@ -4330,8 +4328,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SR_SPEC_CONST_CONST_HANDLER(ZE
zval *op1, *op2;
- op1 = EX_CONSTANT(opline->op1);
- op2 = EX_CONSTANT(opline->op2);
+ op1 = RT_CONSTANT(opline, opline->op1);
+ op2 = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)
&& EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)
&& EXPECTED((zend_ulong)Z_LVAL_P(op2) < SIZEOF_ZEND_LONG * 8)) {
@@ -4359,8 +4357,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POW_SPEC_CONST_CONST_HANDLER(Z
zval *op1, *op2;
SAVE_OPLINE();
- op1 = EX_CONSTANT(opline->op1);
- op2 = EX_CONSTANT(opline->op2);
+ op1 = RT_CONSTANT(opline, opline->op1);
+ op2 = RT_CONSTANT(opline, opline->op2);
pow_function(EX_VAR(opline->result.var), op1, op2);
@@ -4373,8 +4371,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CONCAT_SPEC_CONST_CONST_HANDLE
zval *op1, *op2;
- op1 = EX_CONSTANT(opline->op1);
- op2 = EX_CONSTANT(opline->op2);
+ op1 = RT_CONSTANT(opline, opline->op1);
+ op2 = RT_CONSTANT(opline, opline->op2);
if ((IS_CONST == IS_CONST || EXPECTED(Z_TYPE_P(op1) == IS_STRING)) &&
(IS_CONST == IS_CONST || EXPECTED(Z_TYPE_P(op2) == IS_STRING))) {
@@ -4439,8 +4437,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_CONST_
int result;
SAVE_OPLINE();
- op1 = EX_CONSTANT(opline->op1);
- op2 = EX_CONSTANT(opline->op2);
+ op1 = RT_CONSTANT(opline, opline->op1);
+ op2 = RT_CONSTANT(opline, opline->op2);
result = fast_is_identical_function(op1, op2);
@@ -4457,8 +4455,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CO
int result;
SAVE_OPLINE();
- op1 = EX_CONSTANT(opline->op1);
- op2 = EX_CONSTANT(opline->op2);
+ op1 = RT_CONSTANT(opline, opline->op1);
+ op2 = RT_CONSTANT(opline, opline->op2);
result = fast_is_not_identical_function(op1, op2);
@@ -4473,8 +4471,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_CONST_HAND
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
- op2 = EX_CONSTANT(opline->op2);
+ op1 = RT_CONSTANT(opline, opline->op1);
+ op2 = RT_CONSTANT(opline, opline->op2);
do {
int result;
@@ -4541,8 +4539,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
- op2 = EX_CONSTANT(opline->op2);
+ op1 = RT_CONSTANT(opline, opline->op1);
+ op2 = RT_CONSTANT(opline, opline->op2);
do {
int result;
@@ -4609,8 +4607,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_CONST_HA
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
- op2 = EX_CONSTANT(opline->op2);
+ op1 = RT_CONSTANT(opline, opline->op1);
+ op2 = RT_CONSTANT(opline, opline->op2);
do {
int result;
@@ -4659,8 +4657,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
- op2 = EX_CONSTANT(opline->op2);
+ op1 = RT_CONSTANT(opline, opline->op1);
+ op2 = RT_CONSTANT(opline, opline->op2);
do {
int result;
@@ -4710,8 +4708,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SPACESHIP_SPEC_CONST_CONST_HAN
zval *op1, *op2;
SAVE_OPLINE();
- op1 = EX_CONSTANT(opline->op1);
- op2 = EX_CONSTANT(opline->op2);
+ op1 = RT_CONSTANT(opline, opline->op1);
+ op2 = RT_CONSTANT(opline, opline->op2);
compare_function(EX_VAR(opline->result.var), op1, op2);
@@ -4724,8 +4722,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_OR_SPEC_CONST_CONST_HANDLER
zval *op1, *op2;
- op1 = EX_CONSTANT(opline->op1);
- op2 = EX_CONSTANT(opline->op2);
+ op1 = RT_CONSTANT(opline, opline->op1);
+ op2 = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)
&& EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(op1) | Z_LVAL_P(op2));
@@ -4751,8 +4749,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_AND_SPEC_CONST_CONST_HANDLE
zval *op1, *op2;
- op1 = EX_CONSTANT(opline->op1);
- op2 = EX_CONSTANT(opline->op2);
+ op1 = RT_CONSTANT(opline, opline->op1);
+ op2 = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)
&& EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(op1) & Z_LVAL_P(op2));
@@ -4778,8 +4776,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_XOR_SPEC_CONST_CONST_HANDLE
zval *op1, *op2;
- op1 = EX_CONSTANT(opline->op1);
- op2 = EX_CONSTANT(opline->op2);
+ op1 = RT_CONSTANT(opline, opline->op1);
+ op2 = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)
&& EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(op1) ^ Z_LVAL_P(op2));
@@ -4806,8 +4804,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CONST_CONST_HAND
zval *op1, *op2;
SAVE_OPLINE();
- op1 = EX_CONSTANT(opline->op1);
- op2 = EX_CONSTANT(opline->op2);
+ op1 = RT_CONSTANT(opline, opline->op1);
+ op2 = RT_CONSTANT(opline, opline->op2);
boolean_xor_function(EX_VAR(opline->result.var), op1, op2);
@@ -4822,9 +4820,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
zval *retval;
SAVE_OPLINE();
- varname = EX_CONSTANT(opline->op1);
+ varname = RT_CONSTANT(opline, opline->op1);
- retval = zend_fetch_static_property_address(varname, IS_CONST, opline->op2, IS_CONST, type EXECUTE_DATA_CC);
+ retval = zend_fetch_static_property_address(varname, IS_CONST, opline->op2, IS_CONST, type EXECUTE_DATA_CC OPLINE_CC);
if (UNEXPECTED(retval == NULL)) {
if (EG(exception)) {
@@ -4888,8 +4886,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CONST_CONST_H
zval *container, *dim, *value, *result;
SAVE_OPLINE();
- container = EX_CONSTANT(opline->op1);
- dim = EX_CONSTANT(opline->op2);
+ container = RT_CONSTANT(opline, opline->op1);
+ dim = RT_CONSTANT(opline, opline->op2);
if (IS_CONST != IS_CONST) {
if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
fetch_dim_r_array:
@@ -4924,8 +4922,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CONST_CONST_
zval *container;
SAVE_OPLINE();
- container = EX_CONSTANT(opline->op1);
- zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST EXECUTE_DATA_CC);
+ container = RT_CONSTANT(opline, opline->op1);
+ zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, RT_CONSTANT(opline, opline->op2), IS_CONST EXECUTE_DATA_CC);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -4948,7 +4946,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_
HANDLE_EXCEPTION();
}
container = NULL;
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST EXECUTE_DATA_CC);
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, RT_CONSTANT(opline, opline->op2), IS_CONST EXECUTE_DATA_CC);
if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -4962,8 +4960,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
- container = EX_CONSTANT(opline->op1);
- zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST EXECUTE_DATA_CC);
+ container = RT_CONSTANT(opline, opline->op1);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, RT_CONSTANT(opline, opline->op2), IS_CONST EXECUTE_DATA_CC);
}
@@ -4979,13 +4977,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_CONST_H
zval *offset;
SAVE_OPLINE();
- container = EX_CONSTANT(opline->op1);
+ container = RT_CONSTANT(opline, opline->op1);
if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) {
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- offset = EX_CONSTANT(opline->op2);
+ offset = RT_CONSTANT(opline, opline->op2);
if (IS_CONST == IS_CONST ||
(IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) {
@@ -5008,7 +5006,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_CONST_H
EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
retval = OBJ_PROP(zobj, prop_offset);
if (EXPECTED(Z_TYPE_INFO_P(retval) != IS_UNDEF)) {
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
@@ -5052,13 +5050,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_CONST_
zval *offset;
SAVE_OPLINE();
- container = EX_CONSTANT(opline->op1);
+ container = RT_CONSTANT(opline, opline->op1);
if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) {
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- offset = EX_CONSTANT(opline->op2);
+ offset = RT_CONSTANT(opline, opline->op2);
if (IS_CONST == IS_CONST ||
(IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) {
@@ -5081,7 +5079,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_CONST_
EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
retval = OBJ_PROP(zobj, prop_offset);
if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -5136,7 +5134,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CONST_
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
- property = EX_CONSTANT(opline->op2);
+ property = RT_CONSTANT(opline, opline->op2);
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CONST, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1)) {
@@ -5156,8 +5154,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_LIST_SPEC_CONST_CONST_HA
zval *container;
SAVE_OPLINE();
- container = EX_CONSTANT(opline->op1);
- zend_fetch_dimension_address_read_LIST(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2) EXECUTE_DATA_CC);
+ container = RT_CONSTANT(opline, opline->op1);
+ zend_fetch_dimension_address_read_LIST(EX_VAR(opline->result.var), container, RT_CONSTANT(opline, opline->op2) EXECUTE_DATA_CC);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
@@ -5170,8 +5168,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FAST_CONCAT_SPEC_CONST_CONST_H
zend_string *op1_str, *op2_str, *str;
- op1 = EX_CONSTANT(opline->op1);
- op2 = EX_CONSTANT(opline->op2);
+ op1 = RT_CONSTANT(opline, opline->op1);
+ op2 = RT_CONSTANT(opline, opline->op2);
if ((IS_CONST == IS_CONST || EXPECTED(Z_TYPE_P(op1) == IS_STRING)) &&
(IS_CONST == IS_CONST || EXPECTED(Z_TYPE_P(op2) == IS_STRING))) {
zend_string *op1_str = Z_STR_P(op1);
@@ -5285,13 +5283,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CONST_CO
SAVE_OPLINE();
- object = EX_CONSTANT(opline->op1);
+ object = RT_CONSTANT(opline, opline->op1);
if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- function_name = EX_CONSTANT(opline->op2);
+ function_name = RT_CONSTANT(opline, opline->op2);
if (IS_CONST != IS_CONST &&
UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
@@ -5356,7 +5354,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CONST_CO
}
/* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL));
if (UNEXPECTED(fbc == NULL)) {
if (EXPECTED(!EG(exception))) {
zend_throw_error(NULL, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name));
@@ -5411,14 +5409,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
if (IS_CONST == IS_CONST) {
/* no function found. try a static method in class */
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), ce);
}
} else if (IS_CONST == IS_UNUSED) {
ce = zend_fetch_class(NULL, opline->op1.num);
@@ -5433,16 +5431,16 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
if (IS_CONST == IS_CONST &&
IS_CONST == IS_CONST &&
- EXPECTED((fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) != NULL)) {
+ EXPECTED((fbc = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)))) != NULL)) {
/* nothing to do */
} else if (IS_CONST != IS_CONST &&
IS_CONST == IS_CONST &&
- EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2))) == ce)) {
- fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)) + sizeof(void*));
+ EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2))) == ce)) {
+ fbc = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)) + sizeof(void*));
} else if (IS_CONST != IS_UNUSED) {
- function_name = EX_CONSTANT(opline->op2);
+ function_name = RT_CONSTANT(opline, opline->op2);
if (IS_CONST != IS_CONST) {
if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
do {
@@ -5467,7 +5465,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
if (ce->get_static_method) {
fbc = ce->get_static_method(ce, Z_STR_P(function_name));
} else {
- fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
+ fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL));
}
if (UNEXPECTED(fbc == NULL)) {
if (EXPECTED(!EG(exception))) {
@@ -5567,7 +5565,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CONS
uint32_t call_info = ZEND_CALL_NESTED_FUNCTION | ZEND_CALL_DYNAMIC;
SAVE_OPLINE();
- function_name = EX_CONSTANT(opline->op2);
+ function_name = RT_CONSTANT(opline, opline->op2);
if (zend_is_callable_ex(function_name, NULL, 0, NULL, &fcc, &error)) {
func = fcc.function_handler;
called_scope = fcc.called_scope;
@@ -5610,7 +5608,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CONS
init_func_run_time_cache(&func->op_array);
}
} else {
- zend_internal_type_error(EX_USES_STRICT_TYPES(), "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(EX_CONSTANT(opline->op1)), error);
+ zend_internal_type_error(EX_USES_STRICT_TYPES(), "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error);
efree(error);
if (UNEXPECTED(EG(exception))) {
@@ -5635,8 +5633,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_SPEC_CONST_CONST_HANDLER(
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
- op2 = EX_CONSTANT(opline->op2);
+ op1 = RT_CONSTANT(opline, opline->op1);
+ op2 = RT_CONSTANT(opline, opline->op2);
do {
int result;
@@ -5706,22 +5704,22 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_CONSTANT_SPEC_CONS
do {
if (IS_CONST == IS_CONST) {
- if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2))))) {
- value = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
+ if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2))))) {
+ value = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)));
#ifdef ZTS
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)));
#endif
break;
- } else if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1))))) {
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
+ } else if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1))))) {
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), ce);
}
} else {
if (IS_CONST == IS_UNUSED) {
@@ -5734,21 +5732,21 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_CONSTANT_SPEC_CONS
} else {
ce = Z_CE_P(EX_VAR(opline->op1.var));
}
- if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2))) == ce)) {
- value = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)) + sizeof(void*));
+ if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2))) == ce)) {
+ value = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)) + sizeof(void*));
break;
}
}
- if (EXPECTED((c = zend_hash_find_ptr(&ce->constants_table, Z_STR_P(EX_CONSTANT(opline->op2)))) != NULL)) {
+ if (EXPECTED((c = zend_hash_find_ptr(&ce->constants_table, Z_STR_P(RT_CONSTANT(opline, opline->op2)))) != NULL)) {
scope = EX(func)->op_array.scope;
if (!zend_verify_const_access(c, scope)) {
- zend_throw_error(NULL, "Cannot access %s const %s::%s", zend_visibility_string(Z_ACCESS_FLAGS(c->value)), ZSTR_VAL(ce->name), Z_STRVAL_P(EX_CONSTANT(opline->op2)));
+ zend_throw_error(NULL, "Cannot access %s const %s::%s", zend_visibility_string(Z_ACCESS_FLAGS(c->value)), ZSTR_VAL(ce->name), Z_STRVAL_P(RT_CONSTANT(opline, opline->op2)));
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
value = &c->value;
- if (Z_CONSTANT_P(value)) {
+ if (Z_TYPE_P(value) == IS_CONSTANT_AST) {
zval_update_constant_ex(value, c->ce);
if (UNEXPECTED(EG(exception) != NULL)) {
ZVAL_UNDEF(EX_VAR(opline->result.var));
@@ -5756,12 +5754,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_CONSTANT_SPEC_CONS
}
}
if (IS_CONST == IS_CONST) {
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), value);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), value);
} else {
- CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce, value);
+ CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), ce, value);
}
} else {
- zend_throw_error(NULL, "Undefined class constant '%s'", Z_STRVAL_P(EX_CONSTANT(opline->op2)));
+ zend_throw_error(NULL, "Undefined class constant '%s'", Z_STRVAL_P(RT_CONSTANT(opline, opline->op2)));
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
@@ -5794,7 +5792,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_C
Z_ADDREF_P(expr_ptr);
} else {
- expr_ptr = EX_CONSTANT(opline->op1);
+ expr_ptr = RT_CONSTANT(opline, opline->op1);
if (IS_CONST == IS_TMP_VAR) {
/* pass */
} else if (IS_CONST == IS_CONST) {
@@ -5824,7 +5822,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_C
if (IS_CONST != IS_UNUSED) {
- zval *offset = EX_CONSTANT(opline->op2);
+ zval *offset = RT_CONSTANT(opline, opline->op2);
zend_string *str;
zend_ulong hval;
@@ -5863,13 +5861,13 @@ num_index:
goto str_index;
} else {
zend_error(E_WARNING, "Illegal offset type");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
} else {
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -5887,8 +5885,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_CONST_HA
} else {
size = 0;
}
- ZVAL_NEW_ARR(array);
- zend_hash_init(Z_ARRVAL_P(array), size, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(array, zend_new_array(size));
if (IS_CONST != IS_UNUSED) {
/* Explicitly initialize array as not-packed if flag is set */
@@ -5909,7 +5906,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_STATIC_PROP_SPEC_CONST_C
SAVE_OPLINE();
- varname = EX_CONSTANT(opline->op1);
+ varname = RT_CONSTANT(opline, opline->op1);
ZVAL_UNDEF(&tmp);
if (IS_CONST != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
@@ -5921,9 +5918,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_STATIC_PROP_SPEC_CONST_C
}
if (IS_CONST == IS_CONST) {
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)), RT_CONSTANT(opline, opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
@@ -5932,7 +5929,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_STATIC_PROP_SPEC_CONST_C
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), ce);
}
} else if (IS_CONST == IS_UNUSED) {
ce = zend_fetch_class(NULL, opline->op2.num);
@@ -5966,7 +5963,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
zend_class_entry *ce;
SAVE_OPLINE();
- varname = EX_CONSTANT(opline->op1);
+ varname = RT_CONSTANT(opline, opline->op1);
ZVAL_UNDEF(&tmp);
if (IS_CONST != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
ZVAL_STR(&tmp, zval_get_string(varname));
@@ -5974,8 +5971,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
}
if (IS_CONST == IS_CONST) {
- if (IS_CONST == IS_CONST && EXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) != NULL)) {
- value = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)) + sizeof(void*));
+ if (IS_CONST == IS_CONST && EXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)))) != NULL)) {
+ value = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)) + sizeof(void*));
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
@@ -5983,14 +5980,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
}
goto is_static_prop_return;
- } else if (UNEXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ } else if (UNEXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)))) == NULL)) {
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)), RT_CONSTANT(opline, opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), ce);
}
} else {
if (IS_CONST == IS_UNUSED) {
@@ -6008,9 +6005,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
if (IS_CONST == IS_CONST &&
- EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1))) == ce)) {
+ EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1))) == ce)) {
- value = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)) + sizeof(void*));
+ value = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)) + sizeof(void*));
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
@@ -6024,7 +6021,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
value = zend_std_get_static_property(ce, Z_STR_P(varname), 1);
if (IS_CONST == IS_CONST && value) {
- CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, value);
+ CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), ce, value);
}
if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
@@ -6054,8 +6051,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CON
zval *offset;
SAVE_OPLINE();
- container = EX_CONSTANT(opline->op1);
- offset = EX_CONSTANT(opline->op2);
+ container = RT_CONSTANT(opline, opline->op1);
+ offset = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
HashTable *ht;
@@ -6185,13 +6182,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CO
zval *offset;
SAVE_OPLINE();
- container = EX_CONSTANT(opline->op1);
+ container = RT_CONSTANT(opline, opline->op1);
if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) {
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- offset = EX_CONSTANT(opline->op2);
+ offset = RT_CONSTANT(opline, opline->op2);
if (IS_CONST == IS_CONST ||
(IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) {
@@ -6231,13 +6228,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DECLARE_CONST_SPEC_CONST_CONST
zend_constant c;
SAVE_OPLINE();
- name = EX_CONSTANT(opline->op1);
- val = EX_CONSTANT(opline->op2);
+ name = RT_CONSTANT(opline, opline->op1);
+ val = RT_CONSTANT(opline, opline->op2);
ZVAL_COPY(&c.value, val);
if (Z_OPT_CONSTANT(c.value)) {
if (UNEXPECTED(zval_update_constant_ex(&c.value, EX(func)->op_array.scope) != SUCCESS)) {
- zval_ptr_dtor(&c.value);
+ zval_ptr_dtor_nogc(&c.value);
HANDLE_EXCEPTION();
@@ -6287,7 +6284,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CONST_HANDLER
zend_error(E_NOTICE, "Only variable references should be yielded by reference");
- value = EX_CONSTANT(opline->op1);
+ value = RT_CONSTANT(opline, opline->op1);
ZVAL_COPY_VALUE(&generator->value, value);
if (IS_CONST == IS_CONST) {
if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) {
@@ -6311,7 +6308,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CONST_HANDLER
}
} else {
- zval *value = EX_CONSTANT(opline->op1);
+ zval *value = RT_CONSTANT(opline, opline->op1);
/* Consts, temporary variables and references need copying */
if (IS_CONST == IS_CONST) {
@@ -6339,7 +6336,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CONST_HANDLER
/* Set the new yielded key */
if (IS_CONST != IS_UNUSED) {
- zval *key = EX_CONSTANT(opline->op2);
+ zval *key = RT_CONSTANT(opline, opline->op2);
/* Consts, temporary variables and references need copying */
if (IS_CONST == IS_CONST) {
@@ -6397,8 +6394,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SWITCH_LONG_SPEC_CONST_CONST_H
zval *op, *jump_zv;
HashTable *jumptable;
- op = EX_CONSTANT(opline->op1);
- jumptable = Z_ARRVAL_P(EX_CONSTANT(opline->op2));
+ op = RT_CONSTANT(opline, opline->op1);
+ jumptable = Z_ARRVAL_P(RT_CONSTANT(opline, opline->op2));
if (Z_TYPE_P(op) != IS_LONG) {
ZVAL_DEREF(op);
@@ -6426,8 +6423,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SWITCH_STRING_SPEC_CONST_CONST
zval *op, *jump_zv;
HashTable *jumptable;
- op = EX_CONSTANT(opline->op1);
- jumptable = Z_ARRVAL_P(EX_CONSTANT(opline->op2));
+ op = RT_CONSTANT(opline, opline->op1);
+ jumptable = Z_ARRVAL_P(RT_CONSTANT(opline, opline->op2));
if (Z_TYPE_P(op) != IS_STRING) {
ZVAL_DEREF(op);
@@ -6453,11 +6450,11 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IN_ARRAY_SPEC_CONST_CONST_HAND
USE_OPLINE
zval *op1;
- HashTable *ht = Z_ARRVAL_P(EX_CONSTANT(opline->op2));
+ HashTable *ht = Z_ARRVAL_P(RT_CONSTANT(opline, opline->op2));
int result;
SAVE_OPLINE();
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) {
result = zend_hash_exists(ht, Z_STR_P(op1));
} else if (opline->extended_value) {
@@ -6495,8 +6492,8 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_R_INDEX_
zval *container, *dim, *value;
zend_long offset;
- container = EX_CONSTANT(opline->op1);
- dim = EX_CONSTANT(opline->op2);
+ container = RT_CONSTANT(opline, opline->op1);
+ dim = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
fetch_dim_r_index_array:
if (EXPECTED(Z_TYPE_P(dim) == IS_LONG)) {
@@ -6544,7 +6541,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_TMP_HA
int result;
SAVE_OPLINE();
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_tmp(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
result = fast_is_identical_function(op1, op2);
@@ -6562,7 +6559,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_TM
int result;
SAVE_OPLINE();
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_tmp(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
result = fast_is_not_identical_function(op1, op2);
@@ -6605,7 +6602,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMP_HANDLER(Z
zend_error(E_NOTICE, "Only variable references should be yielded by reference");
- value = EX_CONSTANT(opline->op1);
+ value = RT_CONSTANT(opline, opline->op1);
ZVAL_COPY_VALUE(&generator->value, value);
if (IS_CONST == IS_CONST) {
if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) {
@@ -6629,7 +6626,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_TMP_HANDLER(Z
}
} else {
- zval *value = EX_CONSTANT(opline->op1);
+ zval *value = RT_CONSTANT(opline, opline->op1);
/* Consts, temporary variables and references need copying */
if (IS_CONST == IS_CONST) {
@@ -6716,7 +6713,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_VAR_HA
int result;
SAVE_OPLINE();
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_var_deref(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
result = fast_is_identical_function(op1, op2);
@@ -6734,7 +6731,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_VA
int result;
SAVE_OPLINE();
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_var_deref(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
result = fast_is_not_identical_function(op1, op2);
@@ -6752,9 +6749,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
zval *retval;
SAVE_OPLINE();
- varname = EX_CONSTANT(opline->op1);
+ varname = RT_CONSTANT(opline, opline->op1);
- retval = zend_fetch_static_property_address(varname, IS_CONST, opline->op2, IS_VAR, type EXECUTE_DATA_CC);
+ retval = zend_fetch_static_property_address(varname, IS_CONST, opline->op2, IS_VAR, type EXECUTE_DATA_CC OPLINE_CC);
if (UNEXPECTED(retval == NULL)) {
if (EG(exception)) {
@@ -6820,7 +6817,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_STATIC_PROP_SPEC_CONST_V
SAVE_OPLINE();
- varname = EX_CONSTANT(opline->op1);
+ varname = RT_CONSTANT(opline, opline->op1);
ZVAL_UNDEF(&tmp);
if (IS_CONST != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
@@ -6832,9 +6829,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_STATIC_PROP_SPEC_CONST_V
}
if (IS_VAR == IS_CONST) {
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)), RT_CONSTANT(opline, opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
@@ -6843,7 +6840,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_STATIC_PROP_SPEC_CONST_V
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), ce);
}
} else if (IS_VAR == IS_UNUSED) {
ce = zend_fetch_class(NULL, opline->op2.num);
@@ -6877,7 +6874,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
zend_class_entry *ce;
SAVE_OPLINE();
- varname = EX_CONSTANT(opline->op1);
+ varname = RT_CONSTANT(opline, opline->op1);
ZVAL_UNDEF(&tmp);
if (IS_CONST != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
ZVAL_STR(&tmp, zval_get_string(varname));
@@ -6885,8 +6882,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
}
if (IS_VAR == IS_CONST) {
- if (IS_CONST == IS_CONST && EXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) != NULL)) {
- value = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)) + sizeof(void*));
+ if (IS_CONST == IS_CONST && EXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)))) != NULL)) {
+ value = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)) + sizeof(void*));
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
@@ -6894,14 +6891,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
}
goto is_static_prop_return;
- } else if (UNEXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ } else if (UNEXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)))) == NULL)) {
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)), RT_CONSTANT(opline, opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), ce);
}
} else {
if (IS_VAR == IS_UNUSED) {
@@ -6919,9 +6916,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
if (IS_CONST == IS_CONST &&
- EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1))) == ce)) {
+ EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1))) == ce)) {
- value = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)) + sizeof(void*));
+ value = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)) + sizeof(void*));
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
@@ -6935,7 +6932,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
value = zend_std_get_static_property(ce, Z_STR_P(varname), 1);
if (IS_CONST == IS_CONST && value) {
- CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, value);
+ CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), ce, value);
}
if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
@@ -6988,7 +6985,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_VAR_HANDLER(Z
zend_error(E_NOTICE, "Only variable references should be yielded by reference");
- value = EX_CONSTANT(opline->op1);
+ value = RT_CONSTANT(opline, opline->op1);
ZVAL_COPY_VALUE(&generator->value, value);
if (IS_CONST == IS_CONST) {
if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) {
@@ -7012,7 +7009,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_VAR_HANDLER(Z
}
} else {
- zval *value = EX_CONSTANT(opline->op1);
+ zval *value = RT_CONSTANT(opline, opline->op1);
/* Consts, temporary variables and references need copying */
if (IS_CONST == IS_CONST) {
@@ -7101,7 +7098,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
HashTable *target_symbol_table;
SAVE_OPLINE();
- varname = EX_CONSTANT(opline->op1);
+ varname = RT_CONSTANT(opline, opline->op1);
if (IS_CONST == IS_CONST) {
name = Z_STR_P(varname);
@@ -7261,9 +7258,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
zval *retval;
SAVE_OPLINE();
- varname = EX_CONSTANT(opline->op1);
+ varname = RT_CONSTANT(opline, opline->op1);
- retval = zend_fetch_static_property_address(varname, IS_CONST, opline->op2, IS_UNUSED, type EXECUTE_DATA_CC);
+ retval = zend_fetch_static_property_address(varname, IS_CONST, opline->op2, IS_UNUSED, type EXECUTE_DATA_CC OPLINE_CC);
if (UNEXPECTED(retval == NULL)) {
if (EG(exception)) {
@@ -7351,7 +7348,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
- container = EX_CONSTANT(opline->op1);
+ container = RT_CONSTANT(opline, opline->op1);
zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, NULL, IS_UNUSED EXECUTE_DATA_CC);
@@ -7372,14 +7369,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
if (IS_CONST == IS_CONST) {
/* no function found. try a static method in class */
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), ce);
}
} else if (IS_CONST == IS_UNUSED) {
ce = zend_fetch_class(NULL, opline->op1.num);
@@ -7394,12 +7391,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
if (IS_CONST == IS_CONST &&
IS_UNUSED == IS_CONST &&
- EXPECTED((fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) != NULL)) {
+ EXPECTED((fbc = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)))) != NULL)) {
/* nothing to do */
} else if (IS_CONST != IS_CONST &&
IS_UNUSED == IS_CONST &&
- EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2))) == ce)) {
- fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)) + sizeof(void*));
+ EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2))) == ce)) {
+ fbc = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)) + sizeof(void*));
} else if (IS_UNUSED != IS_UNUSED) {
@@ -7428,7 +7425,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
if (ce->get_static_method) {
fbc = ce->get_static_method(ce, Z_STR_P(function_name));
} else {
- fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_UNUSED == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
+ fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_UNUSED == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL));
}
if (UNEXPECTED(fbc == NULL)) {
if (EXPECTED(!EG(exception))) {
@@ -7528,7 +7525,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_VERIFY_RETURN_TYPE_SPEC_CONST_
zend_arg_info *ret_info = EX(func)->common.arg_info - 1;
- retval_ref = retval_ptr = EX_CONSTANT(opline->op1);
+ retval_ref = retval_ptr = RT_CONSTANT(opline, opline->op1);
if (IS_CONST == IS_CONST) {
ZVAL_COPY(EX_VAR(opline->result.var), retval_ptr);
@@ -7578,7 +7575,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_U
Z_ADDREF_P(expr_ptr);
} else {
- expr_ptr = EX_CONSTANT(opline->op1);
+ expr_ptr = RT_CONSTANT(opline, opline->op1);
if (IS_CONST == IS_TMP_VAR) {
/* pass */
} else if (IS_CONST == IS_CONST) {
@@ -7647,13 +7644,13 @@ num_index:
goto str_index;
} else {
zend_error(E_WARNING, "Illegal offset type");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
} else {
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -7671,8 +7668,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_UNUSED_H
} else {
size = 0;
}
- ZVAL_NEW_ARR(array);
- zend_hash_init(Z_ARRVAL_P(array), size, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(array, zend_new_array(size));
if (IS_CONST != IS_UNUSED) {
/* Explicitly initialize array as not-packed if flag is set */
@@ -7693,7 +7689,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_UNUSED_HA
SAVE_OPLINE();
- varname = EX_CONSTANT(opline->op1);
+ varname = RT_CONSTANT(opline, opline->op1);
ZVAL_UNDEF(&tmp);
if (IS_CONST != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
@@ -7723,7 +7719,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_STATIC_PROP_SPEC_CONST_U
SAVE_OPLINE();
- varname = EX_CONSTANT(opline->op1);
+ varname = RT_CONSTANT(opline, opline->op1);
ZVAL_UNDEF(&tmp);
if (IS_CONST != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
@@ -7735,9 +7731,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_STATIC_PROP_SPEC_CONST_U
}
if (IS_UNUSED == IS_CONST) {
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)), RT_CONSTANT(opline, opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
@@ -7746,7 +7742,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_STATIC_PROP_SPEC_CONST_U
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), ce);
}
} else if (IS_UNUSED == IS_UNUSED) {
ce = zend_fetch_class(NULL, opline->op2.num);
@@ -7780,7 +7776,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_U
HashTable *target_symbol_table;
SAVE_OPLINE();
- varname = EX_CONSTANT(opline->op1);
+ varname = RT_CONSTANT(opline, opline->op1);
ZVAL_UNDEF(&tmp);
if (IS_CONST != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
ZVAL_STR(&tmp, zval_get_string(varname));
@@ -7816,7 +7812,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
zend_class_entry *ce;
SAVE_OPLINE();
- varname = EX_CONSTANT(opline->op1);
+ varname = RT_CONSTANT(opline, opline->op1);
ZVAL_UNDEF(&tmp);
if (IS_CONST != IS_CONST && Z_TYPE_P(varname) != IS_STRING) {
ZVAL_STR(&tmp, zval_get_string(varname));
@@ -7824,8 +7820,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
}
if (IS_UNUSED == IS_CONST) {
- if (IS_CONST == IS_CONST && EXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) != NULL)) {
- value = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)) + sizeof(void*));
+ if (IS_CONST == IS_CONST && EXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)))) != NULL)) {
+ value = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)) + sizeof(void*));
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
@@ -7833,14 +7829,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
}
goto is_static_prop_return;
- } else if (UNEXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ } else if (UNEXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)))) == NULL)) {
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)), RT_CONSTANT(opline, opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), ce);
}
} else {
if (IS_UNUSED == IS_UNUSED) {
@@ -7858,9 +7854,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
if (IS_CONST == IS_CONST &&
- EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1))) == ce)) {
+ EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1))) == ce)) {
- value = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)) + sizeof(void*));
+ value = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)) + sizeof(void*));
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
@@ -7874,7 +7870,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
value = zend_std_get_static_property(ce, Z_STR_P(varname), 1);
if (IS_CONST == IS_CONST && value) {
- CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, value);
+ CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), ce, value);
}
if (IS_CONST != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
@@ -7901,7 +7897,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DECLARE_LAMBDA_FUNCTION_SPEC_C
zval *object;
zend_class_entry *called_scope;
- zfunc = zend_hash_find(EG(function_table), Z_STR_P(EX_CONSTANT(opline->op1)));
+ zfunc = zend_hash_find(EG(function_table), Z_STR_P(RT_CONSTANT(opline, opline->op1)));
ZEND_ASSERT(zfunc != NULL && Z_FUNC_P(zfunc)->type == ZEND_USER_FUNCTION);
if (Z_TYPE(EX(This)) == IS_OBJECT) {
@@ -7955,7 +7951,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_UNUSED_HANDLE
zend_error(E_NOTICE, "Only variable references should be yielded by reference");
- value = EX_CONSTANT(opline->op1);
+ value = RT_CONSTANT(opline, opline->op1);
ZVAL_COPY_VALUE(&generator->value, value);
if (IS_CONST == IS_CONST) {
if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) {
@@ -7979,7 +7975,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_UNUSED_HANDLE
}
} else {
- zval *value = EX_CONSTANT(opline->op1);
+ zval *value = RT_CONSTANT(opline, opline->op1);
/* Consts, temporary variables and references need copying */
if (IS_CONST == IS_CONST) {
@@ -8066,7 +8062,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_CONST_UNUSED_HANDLE
zend_long count;
SAVE_OPLINE();
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
do {
if (Z_TYPE_P(op1) == IS_ARRAY) {
count = zend_array_count(Z_ARRVAL_P(op1));
@@ -8123,7 +8119,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GET_CLASS_SPEC_CONST_UNUSED_HA
zval *op1;
SAVE_OPLINE();
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
if (Z_TYPE_P(op1) == IS_OBJECT) {
ZVAL_STR_COPY(EX_VAR(opline->result.var), Z_OBJCE_P(op1)->name);
} else {
@@ -8143,7 +8139,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GET_TYPE_SPEC_CONST_UNUSED_HAN
zend_string *type;
SAVE_OPLINE();
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
type = zend_zval_get_type(op1);
if (EXPECTED(type)) {
ZVAL_INTERNED_STR(EX_VAR(opline->result.var), type);
@@ -8162,7 +8158,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FUNC_GET_ARGS_SPEC_CONST_UNUSE
arg_count = EX_NUM_ARGS();
if (IS_CONST == IS_CONST) {
- skip = Z_LVAL_P(EX_CONSTANT(opline->op1));
+ skip = Z_LVAL_P(RT_CONSTANT(opline, opline->op1));
if (arg_count < skip) {
result_size = 0;
} else {
@@ -8173,8 +8169,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FUNC_GET_ARGS_SPEC_CONST_UNUSE
result_size = arg_count;
}
- ht = (zend_array *) emalloc(sizeof(zend_array));
- zend_hash_init(ht, result_size, NULL, ZVAL_PTR_DTOR, 0);
+ ht = zend_new_array(result_size);
ZVAL_ARR(EX_VAR(opline->result.var), ht);
if (result_size) {
@@ -8232,7 +8227,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_SPEC_CONST_CV_HANDLER(ZEND
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_cv_undef(opline->op2.var EXECUTE_DATA_CC);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
@@ -8275,7 +8270,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_SPEC_CONST_CV_HANDLER(ZEND
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_cv_undef(opline->op2.var EXECUTE_DATA_CC);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
@@ -8318,7 +8313,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MUL_SPEC_CONST_CV_HANDLER(ZEND
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_cv_undef(opline->op2.var EXECUTE_DATA_CC);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
@@ -8365,7 +8360,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DIV_SPEC_CONST_CV_HANDLER(ZEND
zval *op1, *op2;
SAVE_OPLINE();
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
fast_div_function(EX_VAR(opline->result.var), op1, op2);
@@ -8379,7 +8374,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_CONST_CV_HANDLER(ZEND
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_cv_undef(opline->op2.var EXECUTE_DATA_CC);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
@@ -8418,7 +8413,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SL_SPEC_CONST_CV_HANDLER(ZEND_
zval *op1, *op2;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_cv_undef(opline->op2.var EXECUTE_DATA_CC);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)
&& EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)
@@ -8446,7 +8441,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SR_SPEC_CONST_CV_HANDLER(ZEND_
zval *op1, *op2;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_cv_undef(opline->op2.var EXECUTE_DATA_CC);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)
&& EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)
@@ -8475,7 +8470,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POW_SPEC_CONST_CV_HANDLER(ZEND
zval *op1, *op2;
SAVE_OPLINE();
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
pow_function(EX_VAR(opline->result.var), op1, op2);
@@ -8489,7 +8484,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CONCAT_SPEC_CONST_CV_HANDLER(Z
zval *op1, *op2;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_cv_undef(opline->op2.var EXECUTE_DATA_CC);
if ((IS_CONST == IS_CONST || EXPECTED(Z_TYPE_P(op1) == IS_STRING)) &&
@@ -8555,7 +8550,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CONST_CV_HAN
int result;
SAVE_OPLINE();
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_cv_deref_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
result = fast_is_identical_function(op1, op2);
@@ -8573,7 +8568,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CONST_CV
int result;
SAVE_OPLINE();
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_cv_deref_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
result = fast_is_not_identical_function(op1, op2);
@@ -8589,7 +8584,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_CV_HANDLER
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_cv_undef(opline->op2.var EXECUTE_DATA_CC);
do {
int result;
@@ -8657,7 +8652,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CONST_CV_HAN
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_cv_undef(opline->op2.var EXECUTE_DATA_CC);
do {
int result;
@@ -8725,7 +8720,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_CV_HANDL
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_cv_undef(opline->op2.var EXECUTE_DATA_CC);
do {
int result;
@@ -8775,7 +8770,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_cv_undef(opline->op2.var EXECUTE_DATA_CC);
do {
int result;
@@ -8826,7 +8821,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SPACESHIP_SPEC_CONST_CV_HANDLE
zval *op1, *op2;
SAVE_OPLINE();
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
compare_function(EX_VAR(opline->result.var), op1, op2);
@@ -8840,7 +8835,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_OR_SPEC_CONST_CV_HANDLER(ZE
zval *op1, *op2;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_cv_undef(opline->op2.var EXECUTE_DATA_CC);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)
&& EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
@@ -8867,7 +8862,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_AND_SPEC_CONST_CV_HANDLER(Z
zval *op1, *op2;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_cv_undef(opline->op2.var EXECUTE_DATA_CC);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)
&& EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
@@ -8894,7 +8889,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_XOR_SPEC_CONST_CV_HANDLER(Z
zval *op1, *op2;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_cv_undef(opline->op2.var EXECUTE_DATA_CC);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)
&& EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
@@ -8922,7 +8917,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CONST_CV_HANDLER
zval *op1, *op2;
SAVE_OPLINE();
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
boolean_xor_function(EX_VAR(opline->result.var), op1, op2);
@@ -8937,7 +8932,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CONST_CV_HAND
zval *container, *dim, *value, *result;
SAVE_OPLINE();
- container = EX_CONSTANT(opline->op1);
+ container = RT_CONSTANT(opline, opline->op1);
dim = _get_zval_ptr_cv_undef(opline->op2.var EXECUTE_DATA_CC);
if (IS_CONST != IS_CONST) {
if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
@@ -8973,7 +8968,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CONST_CV_HAN
zval *container;
SAVE_OPLINE();
- container = EX_CONSTANT(opline->op1);
+ container = RT_CONSTANT(opline, opline->op1);
zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_undef(opline->op2.var EXECUTE_DATA_CC), IS_CV EXECUTE_DATA_CC);
@@ -9011,7 +9006,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
- container = EX_CONSTANT(opline->op1);
+ container = RT_CONSTANT(opline, opline->op1);
zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_undef(opline->op2.var EXECUTE_DATA_CC), IS_CV EXECUTE_DATA_CC);
@@ -9028,7 +9023,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_CV_HAND
zval *offset;
SAVE_OPLINE();
- container = EX_CONSTANT(opline->op1);
+ container = RT_CONSTANT(opline, opline->op1);
if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) {
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
@@ -9057,7 +9052,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_CV_HAND
EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
retval = OBJ_PROP(zobj, prop_offset);
if (EXPECTED(Z_TYPE_INFO_P(retval) != IS_UNDEF)) {
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
@@ -9101,7 +9096,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_CV_HAN
zval *offset;
SAVE_OPLINE();
- container = EX_CONSTANT(opline->op1);
+ container = RT_CONSTANT(opline, opline->op1);
if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) {
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
@@ -9130,7 +9125,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_CV_HAN
EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
retval = OBJ_PROP(zobj, prop_offset);
if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -9205,7 +9200,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_LIST_SPEC_CONST_CV_HANDL
zval *container;
SAVE_OPLINE();
- container = EX_CONSTANT(opline->op1);
+ container = RT_CONSTANT(opline, opline->op1);
zend_fetch_dimension_address_read_LIST(EX_VAR(opline->result.var), container, _get_zval_ptr_cv_undef(opline->op2.var EXECUTE_DATA_CC) EXECUTE_DATA_CC);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -9219,7 +9214,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FAST_CONCAT_SPEC_CONST_CV_HAND
zend_string *op1_str, *op2_str, *str;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_cv_undef(opline->op2.var EXECUTE_DATA_CC);
if ((IS_CONST == IS_CONST || EXPECTED(Z_TYPE_P(op1) == IS_STRING)) &&
(IS_CV == IS_CONST || EXPECTED(Z_TYPE_P(op2) == IS_STRING))) {
@@ -9334,7 +9329,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CONST_CV
SAVE_OPLINE();
- object = EX_CONSTANT(opline->op1);
+ object = RT_CONSTANT(opline, opline->op1);
if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
@@ -9405,7 +9400,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CONST_CV
}
/* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL));
if (UNEXPECTED(fbc == NULL)) {
if (EXPECTED(!EG(exception))) {
zend_throw_error(NULL, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name));
@@ -9460,14 +9455,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
if (IS_CONST == IS_CONST) {
/* no function found. try a static method in class */
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), ce);
}
} else if (IS_CONST == IS_UNUSED) {
ce = zend_fetch_class(NULL, opline->op1.num);
@@ -9482,12 +9477,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
if (IS_CONST == IS_CONST &&
IS_CV == IS_CONST &&
- EXPECTED((fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) != NULL)) {
+ EXPECTED((fbc = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)))) != NULL)) {
/* nothing to do */
} else if (IS_CONST != IS_CONST &&
IS_CV == IS_CONST &&
- EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2))) == ce)) {
- fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)) + sizeof(void*));
+ EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2))) == ce)) {
+ fbc = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)) + sizeof(void*));
} else if (IS_CV != IS_UNUSED) {
@@ -9516,7 +9511,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
if (ce->get_static_method) {
fbc = ce->get_static_method(ce, Z_STR_P(function_name));
} else {
- fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
+ fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL));
}
if (UNEXPECTED(fbc == NULL)) {
if (EXPECTED(!EG(exception))) {
@@ -9659,7 +9654,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CV_H
init_func_run_time_cache(&func->op_array);
}
} else {
- zend_internal_type_error(EX_USES_STRICT_TYPES(), "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(EX_CONSTANT(opline->op1)), error);
+ zend_internal_type_error(EX_USES_STRICT_TYPES(), "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error);
efree(error);
if (UNEXPECTED(EG(exception))) {
@@ -9692,11 +9687,11 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CATCH_SPEC_CONST_CV_HANDLER(ZE
ZEND_VM_SET_RELATIVE_OPCODE(opline, opline->extended_value);
ZEND_VM_CONTINUE();
}
- catch_ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
+ catch_ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)));
if (UNEXPECTED(catch_ce == NULL)) {
- catch_ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD);
+ catch_ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD);
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), catch_ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), catch_ce);
}
ce = EG(exception)->ce;
@@ -9739,7 +9734,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_SPEC_CONST_CV_HANDLER(ZEN
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_cv_undef(opline->op2.var EXECUTE_DATA_CC);
do {
int result;
@@ -9813,7 +9808,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_C
Z_ADDREF_P(expr_ptr);
} else {
- expr_ptr = EX_CONSTANT(opline->op1);
+ expr_ptr = RT_CONSTANT(opline, opline->op1);
if (IS_CONST == IS_TMP_VAR) {
/* pass */
} else if (IS_CONST == IS_CONST) {
@@ -9882,13 +9877,13 @@ num_index:
goto str_index;
} else {
zend_error(E_WARNING, "Illegal offset type");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
} else {
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -9906,8 +9901,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_CV_HANDL
} else {
size = 0;
}
- ZVAL_NEW_ARR(array);
- zend_hash_init(Z_ARRVAL_P(array), size, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(array, zend_new_array(size));
if (IS_CONST != IS_UNUSED) {
/* Explicitly initialize array as not-packed if flag is set */
@@ -9929,7 +9923,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CON
zval *offset;
SAVE_OPLINE();
- container = EX_CONSTANT(opline->op1);
+ container = RT_CONSTANT(opline, opline->op1);
offset = _get_zval_ptr_cv_undef(opline->op2.var EXECUTE_DATA_CC);
if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
@@ -10060,7 +10054,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CO
zval *offset;
SAVE_OPLINE();
- container = EX_CONSTANT(opline->op1);
+ container = RT_CONSTANT(opline, opline->op1);
if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) {
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
@@ -10130,7 +10124,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CV_HANDLER(ZE
zend_error(E_NOTICE, "Only variable references should be yielded by reference");
- value = EX_CONSTANT(opline->op1);
+ value = RT_CONSTANT(opline, opline->op1);
ZVAL_COPY_VALUE(&generator->value, value);
if (IS_CONST == IS_CONST) {
if (UNEXPECTED(Z_OPT_REFCOUNTED(generator->value))) {
@@ -10154,7 +10148,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CONST_CV_HANDLER(ZE
}
} else {
- zval *value = EX_CONSTANT(opline->op1);
+ zval *value = RT_CONSTANT(opline, opline->op1);
/* Consts, temporary variables and references need copying */
if (IS_CONST == IS_CONST) {
@@ -10240,7 +10234,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_R_INDEX_
zval *container, *dim, *value;
zend_long offset;
- container = EX_CONSTANT(opline->op1);
+ container = RT_CONSTANT(opline, opline->op1);
dim = _get_zval_ptr_cv_undef(opline->op2.var EXECUTE_DATA_CC);
if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
fetch_dim_r_index_array:
@@ -10287,7 +10281,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_SPEC_CONST_TMPVAR_HANDLER(
zend_free_op free_op2;
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
@@ -10330,7 +10324,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_SPEC_CONST_TMPVAR_HANDLER(
zend_free_op free_op2;
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
@@ -10373,7 +10367,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MUL_SPEC_CONST_TMPVAR_HANDLER(
zend_free_op free_op2;
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
@@ -10420,7 +10414,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DIV_SPEC_CONST_TMPVAR_HANDLER(
zval *op1, *op2;
SAVE_OPLINE();
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
fast_div_function(EX_VAR(opline->result.var), op1, op2);
@@ -10434,7 +10428,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_CONST_TMPVAR_HANDLER(
zend_free_op free_op2;
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
@@ -10473,7 +10467,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SL_SPEC_CONST_TMPVAR_HANDLER(Z
zend_free_op free_op2;
zval *op1, *op2;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)
&& EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)
@@ -10501,7 +10495,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SR_SPEC_CONST_TMPVAR_HANDLER(Z
zend_free_op free_op2;
zval *op1, *op2;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)
&& EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)
@@ -10530,7 +10524,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POW_SPEC_CONST_TMPVAR_HANDLER(
zval *op1, *op2;
SAVE_OPLINE();
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
pow_function(EX_VAR(opline->result.var), op1, op2);
@@ -10544,7 +10538,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CONCAT_SPEC_CONST_TMPVAR_HANDL
zend_free_op free_op2;
zval *op1, *op2;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
if ((IS_CONST == IS_CONST || EXPECTED(Z_TYPE_P(op1) == IS_STRING)) &&
@@ -10608,7 +10602,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_TMPVAR_HAN
zend_free_op free_op2;
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
do {
int result;
@@ -10676,7 +10670,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CONST_TMPVAR
zend_free_op free_op2;
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
do {
int result;
@@ -10744,7 +10738,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_TMPVAR_H
zend_free_op free_op2;
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
do {
int result;
@@ -10794,7 +10788,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST
zend_free_op free_op2;
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
do {
int result;
@@ -10845,7 +10839,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SPACESHIP_SPEC_CONST_TMPVAR_HA
zval *op1, *op2;
SAVE_OPLINE();
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
compare_function(EX_VAR(opline->result.var), op1, op2);
@@ -10859,7 +10853,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_OR_SPEC_CONST_TMPVAR_HANDLE
zend_free_op free_op2;
zval *op1, *op2;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)
&& EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
@@ -10886,7 +10880,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_AND_SPEC_CONST_TMPVAR_HANDL
zend_free_op free_op2;
zval *op1, *op2;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)
&& EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
@@ -10913,7 +10907,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_XOR_SPEC_CONST_TMPVAR_HANDL
zend_free_op free_op2;
zval *op1, *op2;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)
&& EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
@@ -10941,7 +10935,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CONST_TMPVAR_HAN
zval *op1, *op2;
SAVE_OPLINE();
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
boolean_xor_function(EX_VAR(opline->result.var), op1, op2);
@@ -10956,7 +10950,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CONST_TMPVAR_
zval *container, *dim, *value, *result;
SAVE_OPLINE();
- container = EX_CONSTANT(opline->op1);
+ container = RT_CONSTANT(opline, opline->op1);
dim = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
if (IS_CONST != IS_CONST) {
if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
@@ -10992,7 +10986,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CONST_TMPVAR
zval *container;
SAVE_OPLINE();
- container = EX_CONSTANT(opline->op1);
+ container = RT_CONSTANT(opline, opline->op1);
zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC), (IS_TMP_VAR|IS_VAR) EXECUTE_DATA_CC);
zval_ptr_dtor_nogc(free_op2);
@@ -11030,7 +11024,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CONST_
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
- container = EX_CONSTANT(opline->op1);
+ container = RT_CONSTANT(opline, opline->op1);
zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC), (IS_TMP_VAR|IS_VAR) EXECUTE_DATA_CC);
zval_ptr_dtor_nogc(free_op2);
@@ -11047,7 +11041,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_TMPVAR_
zval *offset;
SAVE_OPLINE();
- container = EX_CONSTANT(opline->op1);
+ container = RT_CONSTANT(opline, opline->op1);
if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) {
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
@@ -11076,7 +11070,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_TMPVAR_
EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
retval = OBJ_PROP(zobj, prop_offset);
if (EXPECTED(Z_TYPE_INFO_P(retval) != IS_UNDEF)) {
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
@@ -11121,7 +11115,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_TMPVAR
zval *offset;
SAVE_OPLINE();
- container = EX_CONSTANT(opline->op1);
+ container = RT_CONSTANT(opline, opline->op1);
if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) {
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
@@ -11150,7 +11144,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_TMPVAR
EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
retval = OBJ_PROP(zobj, prop_offset);
if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -11226,7 +11220,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_LIST_SPEC_CONST_TMPVAR_H
zval *container;
SAVE_OPLINE();
- container = EX_CONSTANT(opline->op1);
+ container = RT_CONSTANT(opline, opline->op1);
zend_fetch_dimension_address_read_LIST(EX_VAR(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC) EXECUTE_DATA_CC);
zval_ptr_dtor_nogc(free_op2);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -11240,7 +11234,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FAST_CONCAT_SPEC_CONST_TMPVAR_
zend_string *op1_str, *op2_str, *str;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
if ((IS_CONST == IS_CONST || EXPECTED(Z_TYPE_P(op1) == IS_STRING)) &&
((IS_TMP_VAR|IS_VAR) == IS_CONST || EXPECTED(Z_TYPE_P(op2) == IS_STRING))) {
@@ -11355,7 +11349,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CONST_TM
SAVE_OPLINE();
- object = EX_CONSTANT(opline->op1);
+ object = RT_CONSTANT(opline, opline->op1);
if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) == IS_UNDEF)) {
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
@@ -11426,7 +11420,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CONST_TM
}
/* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL));
if (UNEXPECTED(fbc == NULL)) {
if (EXPECTED(!EG(exception))) {
zend_throw_error(NULL, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name));
@@ -11482,14 +11476,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
if (IS_CONST == IS_CONST) {
/* no function found. try a static method in class */
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), ce);
}
} else if (IS_CONST == IS_UNUSED) {
ce = zend_fetch_class(NULL, opline->op1.num);
@@ -11504,12 +11498,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
if (IS_CONST == IS_CONST &&
(IS_TMP_VAR|IS_VAR) == IS_CONST &&
- EXPECTED((fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) != NULL)) {
+ EXPECTED((fbc = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)))) != NULL)) {
/* nothing to do */
} else if (IS_CONST != IS_CONST &&
(IS_TMP_VAR|IS_VAR) == IS_CONST &&
- EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2))) == ce)) {
- fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)) + sizeof(void*));
+ EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2))) == ce)) {
+ fbc = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)) + sizeof(void*));
} else if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED) {
zend_free_op free_op2;
@@ -11538,7 +11532,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C
if (ce->get_static_method) {
fbc = ce->get_static_method(ce, Z_STR_P(function_name));
} else {
- fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
+ fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL));
}
if (UNEXPECTED(fbc == NULL)) {
if (EXPECTED(!EG(exception))) {
@@ -11682,7 +11676,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_TMPV
init_func_run_time_cache(&func->op_array);
}
} else {
- zend_internal_type_error(EX_USES_STRICT_TYPES(), "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(EX_CONSTANT(opline->op1)), error);
+ zend_internal_type_error(EX_USES_STRICT_TYPES(), "%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error);
efree(error);
zval_ptr_dtor_nogc(free_op2);
if (UNEXPECTED(EG(exception))) {
@@ -11707,7 +11701,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_SPEC_CONST_TMPVAR_HANDLER
zend_free_op free_op2;
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
do {
int result;
@@ -11781,7 +11775,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_T
Z_ADDREF_P(expr_ptr);
} else {
- expr_ptr = EX_CONSTANT(opline->op1);
+ expr_ptr = RT_CONSTANT(opline, opline->op1);
if (IS_CONST == IS_TMP_VAR) {
/* pass */
} else if (IS_CONST == IS_CONST) {
@@ -11850,13 +11844,13 @@ num_index:
goto str_index;
} else {
zend_error(E_WARNING, "Illegal offset type");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
zval_ptr_dtor_nogc(free_op2);
} else {
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -11874,8 +11868,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_TMPVAR_H
} else {
size = 0;
}
- ZVAL_NEW_ARR(array);
- zend_hash_init(Z_ARRVAL_P(array), size, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(array, zend_new_array(size));
if (IS_CONST != IS_UNUSED) {
/* Explicitly initialize array as not-packed if flag is set */
@@ -11897,7 +11890,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CON
zval *offset;
SAVE_OPLINE();
- container = EX_CONSTANT(opline->op1);
+ container = RT_CONSTANT(opline, opline->op1);
offset = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
@@ -12028,7 +12021,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CO
zval *offset;
SAVE_OPLINE();
- container = EX_CONSTANT(opline->op1);
+ container = RT_CONSTANT(opline, opline->op1);
if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) {
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
@@ -12073,7 +12066,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_R_INDEX_
zval *container, *dim, *value;
zend_long offset;
- container = EX_CONSTANT(opline->op1);
+ container = RT_CONSTANT(opline, opline->op1);
dim = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
fetch_dim_r_index_array:
@@ -12119,7 +12112,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_LONG_NO_OVERFL
USE_OPLINE
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = EX_VAR(opline->result.var);
ZVAL_LONG(result, Z_LVAL_P(op1) + Z_LVAL_P(op2));
@@ -12131,7 +12124,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_LONG_SPEC_CONS
USE_OPLINE
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = EX_VAR(opline->result.var);
fast_long_add_function(result, op1, op2);
@@ -12143,7 +12136,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_DOUBLE_SPEC_CO
USE_OPLINE
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = EX_VAR(opline->result.var);
ZVAL_DOUBLE(result, Z_DVAL_P(op1) + Z_DVAL_P(op2));
@@ -12155,7 +12148,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_LONG_NO_OVERFL
USE_OPLINE
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = EX_VAR(opline->result.var);
ZVAL_LONG(result, Z_LVAL_P(op1) - Z_LVAL_P(op2));
@@ -12167,7 +12160,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_LONG_SPEC_CONS
USE_OPLINE
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = EX_VAR(opline->result.var);
fast_long_sub_function(result, op1, op2);
@@ -12179,7 +12172,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_DOUBLE_SPEC_CO
USE_OPLINE
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = EX_VAR(opline->result.var);
ZVAL_DOUBLE(result, Z_DVAL_P(op1) - Z_DVAL_P(op2));
@@ -12191,7 +12184,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MUL_LONG_NO_OVERFL
USE_OPLINE
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = EX_VAR(opline->result.var);
ZVAL_LONG(result, Z_LVAL_P(op1) * Z_LVAL_P(op2));
@@ -12204,7 +12197,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MUL_LONG_SPEC_CONS
zval *op1, *op2, *result;
zend_long overflow;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = EX_VAR(opline->result.var);
ZEND_SIGNED_MULTIPLY_LONG(Z_LVAL_P(op1), Z_LVAL_P(op2), Z_LVAL_P(result), Z_DVAL_P(result), overflow);
@@ -12217,7 +12210,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MUL_DOUBLE_SPEC_CO
USE_OPLINE
zval *op1, *op2, *result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = EX_VAR(opline->result.var);
ZVAL_DOUBLE(result, Z_DVAL_P(op1) * Z_DVAL_P(op2));
@@ -12230,7 +12223,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_LONG_SPEC
zval *op1, *op2;
int result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = (Z_LVAL_P(op1) == Z_LVAL_P(op2));
@@ -12244,7 +12237,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_LONG_SPEC
zval *op1, *op2;
int result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = (Z_LVAL_P(op1) == Z_LVAL_P(op2));
ZEND_VM_SMART_BRANCH_JMPZ(result, 0);
@@ -12258,7 +12251,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_LONG_SPEC
zval *op1, *op2;
int result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = (Z_LVAL_P(op1) == Z_LVAL_P(op2));
ZEND_VM_SMART_BRANCH_JMPNZ(result, 0);
@@ -12272,7 +12265,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_DOUBLE_SP
zval *op1, *op2;
int result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = (Z_DVAL_P(op1) == Z_DVAL_P(op2));
@@ -12286,7 +12279,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_DOUBLE_SP
zval *op1, *op2;
int result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = (Z_DVAL_P(op1) == Z_DVAL_P(op2));
ZEND_VM_SMART_BRANCH_JMPZ(result, 0);
@@ -12300,7 +12293,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_DOUBLE_SP
zval *op1, *op2;
int result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = (Z_DVAL_P(op1) == Z_DVAL_P(op2));
ZEND_VM_SMART_BRANCH_JMPNZ(result, 0);
@@ -12314,7 +12307,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_LONG_
zval *op1, *op2;
int result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = (Z_LVAL_P(op1) != Z_LVAL_P(op2));
@@ -12328,7 +12321,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_LONG_
zval *op1, *op2;
int result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = (Z_LVAL_P(op1) != Z_LVAL_P(op2));
ZEND_VM_SMART_BRANCH_JMPZ(result, 0);
@@ -12342,7 +12335,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_LONG_
zval *op1, *op2;
int result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = (Z_LVAL_P(op1) != Z_LVAL_P(op2));
ZEND_VM_SMART_BRANCH_JMPNZ(result, 0);
@@ -12356,7 +12349,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_DOUBL
zval *op1, *op2;
int result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = (Z_DVAL_P(op1) != Z_DVAL_P(op2));
@@ -12370,7 +12363,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_DOUBL
zval *op1, *op2;
int result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = (Z_DVAL_P(op1) != Z_DVAL_P(op2));
ZEND_VM_SMART_BRANCH_JMPZ(result, 0);
@@ -12384,7 +12377,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_DOUBL
zval *op1, *op2;
int result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = (Z_DVAL_P(op1) != Z_DVAL_P(op2));
ZEND_VM_SMART_BRANCH_JMPNZ(result, 0);
@@ -12398,7 +12391,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_LONG_SP
zval *op1, *op2;
int result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = (Z_LVAL_P(op1) < Z_LVAL_P(op2));
@@ -12412,7 +12405,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_LONG_SP
zval *op1, *op2;
int result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = (Z_LVAL_P(op1) < Z_LVAL_P(op2));
ZEND_VM_SMART_BRANCH_JMPZ(result, 0);
@@ -12426,7 +12419,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_LONG_SP
zval *op1, *op2;
int result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = (Z_LVAL_P(op1) < Z_LVAL_P(op2));
ZEND_VM_SMART_BRANCH_JMPNZ(result, 0);
@@ -12440,7 +12433,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_DOUBLE_
zval *op1, *op2;
int result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = (Z_DVAL_P(op1) < Z_DVAL_P(op2));
@@ -12454,7 +12447,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_DOUBLE_
zval *op1, *op2;
int result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = (Z_DVAL_P(op1) < Z_DVAL_P(op2));
ZEND_VM_SMART_BRANCH_JMPZ(result, 0);
@@ -12468,7 +12461,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_DOUBLE_
zval *op1, *op2;
int result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = (Z_DVAL_P(op1) < Z_DVAL_P(op2));
ZEND_VM_SMART_BRANCH_JMPNZ(result, 0);
@@ -12482,7 +12475,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUA
zval *op1, *op2;
int result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = (Z_LVAL_P(op1) <= Z_LVAL_P(op2));
@@ -12496,7 +12489,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUA
zval *op1, *op2;
int result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = (Z_LVAL_P(op1) <= Z_LVAL_P(op2));
ZEND_VM_SMART_BRANCH_JMPZ(result, 0);
@@ -12510,7 +12503,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUA
zval *op1, *op2;
int result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = (Z_LVAL_P(op1) <= Z_LVAL_P(op2));
ZEND_VM_SMART_BRANCH_JMPNZ(result, 0);
@@ -12524,7 +12517,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUA
zval *op1, *op2;
int result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = (Z_DVAL_P(op1) <= Z_DVAL_P(op2));
@@ -12538,7 +12531,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUA
zval *op1, *op2;
int result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = (Z_DVAL_P(op1) <= Z_DVAL_P(op2));
ZEND_VM_SMART_BRANCH_JMPZ(result, 0);
@@ -12552,7 +12545,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUA
zval *op1, *op2;
int result;
- op1 = EX_CONSTANT(opline->op1);
+ op1 = RT_CONSTANT(opline, opline->op1);
op2 = EX_VAR(opline->op2.var);
result = (Z_DVAL_P(op1) <= Z_DVAL_P(op2));
ZEND_VM_SMART_BRANCH_JMPNZ(result, 0);
@@ -12897,8 +12890,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CAST_SPEC_TMP_HANDLER(ZEND_OPC
if (opline->extended_value == IS_ARRAY) {
if (Z_TYPE_P(expr) != IS_OBJECT) {
- ZVAL_NEW_ARR(result);
- zend_hash_init(Z_ARRVAL_P(result), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(result, zend_new_array(8));
if (Z_TYPE_P(expr) != IS_NULL) {
expr = zend_hash_index_add_new(Z_ARRVAL_P(result), 0, expr);
if (IS_TMP_VAR == IS_CONST) {
@@ -13452,7 +13444,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_TMP_CONST_HA
SAVE_OPLINE();
op1 = _get_zval_ptr_tmp(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
result = fast_is_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
@@ -13470,7 +13462,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_TMP_CONS
SAVE_OPLINE();
op1 = _get_zval_ptr_tmp(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
result = fast_is_not_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
@@ -13496,7 +13488,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CO
HANDLE_EXCEPTION();
}
container = NULL;
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST EXECUTE_DATA_CC);
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, RT_CONSTANT(opline, opline->op2), IS_CONST EXECUTE_DATA_CC);
if (IS_TMP_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -13511,7 +13503,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_TMP_CO
HANDLE_EXCEPTION();
}
container = _get_zval_ptr_tmp(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST EXECUTE_DATA_CC);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, RT_CONSTANT(opline, opline->op2), IS_CONST EXECUTE_DATA_CC);
zval_ptr_dtor_nogc(free_op1);
}
@@ -13533,7 +13525,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_CONST_HAN
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- offset = EX_CONSTANT(opline->op2);
+ offset = RT_CONSTANT(opline, opline->op2);
if (IS_TMP_VAR == IS_CONST ||
(IS_TMP_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) {
@@ -13556,7 +13548,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_CONST_HAN
EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
retval = OBJ_PROP(zobj, prop_offset);
if (EXPECTED(Z_TYPE_INFO_P(retval) != IS_UNDEF)) {
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
@@ -13614,7 +13606,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_TMP_CO
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
- property = EX_CONSTANT(opline->op2);
+ property = RT_CONSTANT(opline, opline->op2);
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_TMP_VAR, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
if (IS_TMP_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
@@ -13637,10 +13629,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ROPE_ADD_SPEC_TMP_CONST_HANDLE
/* op1 and result are the same */
rope = (zend_string**)EX_VAR(opline->op1.var);
if (IS_CONST == IS_CONST) {
- var = EX_CONSTANT(opline->op2);
+ var = RT_CONSTANT(opline, opline->op2);
rope[opline->extended_value] = zend_string_copy(Z_STR_P(var));
} else {
- var = EX_CONSTANT(opline->op2);
+ var = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_P(var) == IS_STRING)) {
if (IS_CONST == IS_CV) {
rope[opline->extended_value] = zend_string_copy(Z_STR_P(var));
@@ -13672,10 +13664,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ROPE_END_SPEC_TMP_CONST_HANDLE
rope = (zend_string**)EX_VAR(opline->op1.var);
if (IS_CONST == IS_CONST) {
- var = EX_CONSTANT(opline->op2);
+ var = RT_CONSTANT(opline, opline->op2);
rope[opline->extended_value] = zend_string_copy(Z_STR_P(var));
} else {
- var = EX_CONSTANT(opline->op2);
+ var = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_P(var) == IS_STRING)) {
if (IS_CONST == IS_CV) {
rope[opline->extended_value] = zend_string_copy(Z_STR_P(var));
@@ -13758,7 +13750,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_TMP_CON
if (IS_CONST != IS_UNUSED) {
- zval *offset = EX_CONSTANT(opline->op2);
+ zval *offset = RT_CONSTANT(opline, opline->op2);
zend_string *str;
zend_ulong hval;
@@ -13797,13 +13789,13 @@ num_index:
goto str_index;
} else {
zend_error(E_WARNING, "Illegal offset type");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
} else {
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -13821,8 +13813,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_CONST_HAND
} else {
size = 0;
}
- ZVAL_NEW_ARR(array);
- zend_hash_init(Z_ARRVAL_P(array), size, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(array, zend_new_array(size));
if (IS_TMP_VAR != IS_UNUSED) {
/* Explicitly initialize array as not-packed if flag is set */
@@ -13919,7 +13910,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_TMP_CONST_HANDLER(Z
/* Set the new yielded key */
if (IS_CONST != IS_UNUSED) {
- zval *key = EX_CONSTANT(opline->op2);
+ zval *key = RT_CONSTANT(opline, opline->op2);
/* Consts, temporary variables and references need copying */
if (IS_CONST == IS_CONST) {
@@ -13975,7 +13966,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IN_ARRAY_SPEC_TMP_CONST_HANDLE
USE_OPLINE
zend_free_op free_op1;
zval *op1;
- HashTable *ht = Z_ARRVAL_P(EX_CONSTANT(opline->op2));
+ HashTable *ht = Z_ARRVAL_P(RT_CONSTANT(opline, opline->op2));
int result;
SAVE_OPLINE();
@@ -14526,13 +14517,13 @@ num_index:
goto str_index;
} else {
zend_error(E_WARNING, "Illegal offset type");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
} else {
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -14550,8 +14541,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_UNUSED_HAN
} else {
size = 0;
}
- ZVAL_NEW_ARR(array);
- zend_hash_init(Z_ARRVAL_P(array), size, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(array, zend_new_array(size));
if (IS_TMP_VAR != IS_UNUSED) {
/* Explicitly initialize array as not-packed if flag is set */
@@ -14908,7 +14898,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_CV_HANDLE
EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
retval = OBJ_PROP(zobj, prop_offset);
if (EXPECTED(Z_TYPE_INFO_P(retval) != IS_UNDEF)) {
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
@@ -15149,13 +15139,13 @@ num_index:
goto str_index;
} else {
zend_error(E_WARNING, "Illegal offset type");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
} else {
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -15173,8 +15163,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_CV_HANDLER
} else {
size = 0;
}
- ZVAL_NEW_ARR(array);
- zend_hash_init(Z_ARRVAL_P(array), size, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(array, zend_new_array(size));
if (IS_TMP_VAR != IS_UNUSED) {
/* Explicitly initialize array as not-packed if flag is set */
@@ -15430,7 +15419,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_TMPVAR_HA
EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
retval = OBJ_PROP(zobj, prop_offset);
if (EXPECTED(Z_TYPE_INFO_P(retval) != IS_UNDEF)) {
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
@@ -15672,13 +15661,13 @@ num_index:
goto str_index;
} else {
zend_error(E_WARNING, "Illegal offset type");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
zval_ptr_dtor_nogc(free_op2);
} else {
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -15696,8 +15685,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_TMPVAR_HAN
} else {
size = 0;
}
- ZVAL_NEW_ARR(array);
- zend_hash_init(Z_ARRVAL_P(array), size, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(array, zend_new_array(size));
if (IS_TMP_VAR != IS_UNUSED) {
/* Explicitly initialize array as not-packed if flag is set */
@@ -16442,15 +16430,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_NEW_SPEC_VAR_HANDLER(ZEND_OPCO
SAVE_OPLINE();
if (IS_VAR == IS_CONST) {
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), ce);
}
} else if (IS_VAR == IS_UNUSED) {
ce = zend_fetch_class(NULL, opline->op1.num);
@@ -16549,8 +16537,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CAST_SPEC_VAR_HANDLER(ZEND_OPC
if (opline->extended_value == IS_ARRAY) {
if (Z_TYPE_P(expr) != IS_OBJECT) {
- ZVAL_NEW_ARR(result);
- zend_hash_init(Z_ARRVAL_P(result), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(result, zend_new_array(8));
if (Z_TYPE_P(expr) != IS_NULL) {
expr = zend_hash_index_add_new(Z_ARRVAL_P(result), 0, expr);
if (IS_VAR == IS_CONST) {
@@ -17508,7 +17495,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_VAR_CONST_HA
SAVE_OPLINE();
op1 = _get_zval_ptr_var_deref(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
result = fast_is_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
@@ -17526,7 +17513,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_VAR_CONS
SAVE_OPLINE();
op1 = _get_zval_ptr_var_deref(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
result = fast_is_not_identical_function(op1, op2);
zval_ptr_dtor_nogc(free_op1);
@@ -17551,10 +17538,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- property = EX_CONSTANT(opline->op2);
+ property = RT_CONSTANT(opline, opline->op2);
do {
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
ZVAL_DEREF(object);
@@ -17618,7 +17605,7 @@ assign_dim_op_new_array:
goto assign_dim_op_ret_null;
}
} else {
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
if (IS_CONST == IS_CONST) {
var_ptr = zend_fetch_dimension_address_inner_RW_CONST(Z_ARRVAL_P(container), dim EXECUTE_DATA_CC);
@@ -17632,7 +17619,7 @@ assign_dim_op_new_array:
SEPARATE_ZVAL_NOREF(var_ptr);
}
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
binary_op(var_ptr, var_ptr, value);
@@ -17648,15 +17635,14 @@ assign_dim_op_new_array:
} else if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
container = GET_OP1_UNDEF_CV(container, BP_VAR_RW);
assign_dim_op_convert_to_array:
- ZVAL_NEW_ARR(container);
- zend_hash_init(Z_ARRVAL_P(container), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(container, zend_new_array(8));
goto assign_dim_op_new_array;
}
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op EXECUTE_DATA_CC);
} else {
if (UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) {
@@ -17678,7 +17664,7 @@ assign_dim_op_ret_null:
ZVAL_NULL(EX_VAR(opline->result.var));
}
}
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
}
}
@@ -17695,7 +17681,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_simple_helper
zval *value;
SAVE_OPLINE();
- value = EX_CONSTANT(opline->op2);
+ value = RT_CONSTANT(opline, opline->op2);
var_ptr = _get_zval_ptr_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
if (IS_VAR == IS_VAR && UNEXPECTED(Z_ISERROR_P(var_ptr))) {
@@ -17972,7 +17958,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- property = EX_CONSTANT(opline->op2);
+ property = RT_CONSTANT(opline, opline->op2);
do {
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
@@ -18050,7 +18036,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- property = EX_CONSTANT(opline->op2);
+ property = RT_CONSTANT(opline, opline->op2);
do {
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
@@ -18117,7 +18103,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_VAR_CONST_HAN
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST EXECUTE_DATA_CC);
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, RT_CONSTANT(opline, opline->op2), IS_CONST EXECUTE_DATA_CC);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -18135,7 +18121,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_VAR_CONST_HA
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST EXECUTE_DATA_CC);
+ zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, RT_CONSTANT(opline, opline->op2), IS_CONST EXECUTE_DATA_CC);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -18161,7 +18147,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CO
HANDLE_EXCEPTION();
}
container = _get_zval_ptr_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST EXECUTE_DATA_CC);
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, RT_CONSTANT(opline, opline->op2), IS_CONST EXECUTE_DATA_CC);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -18176,7 +18162,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CO
HANDLE_EXCEPTION();
}
container = _get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST EXECUTE_DATA_CC);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, RT_CONSTANT(opline, opline->op2), IS_CONST EXECUTE_DATA_CC);
zval_ptr_dtor_nogc(free_op1);
}
@@ -18192,7 +18178,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_VAR_CONST
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST EXECUTE_DATA_CC);
+ zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, RT_CONSTANT(opline, opline->op2), IS_CONST EXECUTE_DATA_CC);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -18216,7 +18202,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_CONST_HAN
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- offset = EX_CONSTANT(opline->op2);
+ offset = RT_CONSTANT(opline, opline->op2);
if (IS_VAR == IS_CONST ||
(IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) {
@@ -18239,7 +18225,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_CONST_HAN
EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
retval = OBJ_PROP(zobj, prop_offset);
if (EXPECTED(Z_TYPE_INFO_P(retval) != IS_UNDEF)) {
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
@@ -18288,7 +18274,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_VAR_CONST_HAN
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- property = EX_CONSTANT(opline->op2);
+ property = RT_CONSTANT(opline, opline->op2);
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
@@ -18311,7 +18297,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_VAR_CONST_HA
if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) {
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- property = EX_CONSTANT(opline->op2);
+ property = RT_CONSTANT(opline, opline->op2);
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
@@ -18344,7 +18330,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_VAR_CO
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
- property = EX_CONSTANT(opline->op2);
+ property = RT_CONSTANT(opline, opline->op2);
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1)) {
@@ -18370,7 +18356,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- property = EX_CONSTANT(opline->op2);
+ property = RT_CONSTANT(opline, opline->op2);
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET);
@@ -18394,8 +18380,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_D
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- property = EX_CONSTANT(opline->op2);
- value = EX_CONSTANT((opline+1)->op1);
+ property = RT_CONSTANT(opline, opline->op2);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
do {
@@ -18409,7 +18395,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_D
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -18445,7 +18431,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_D
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -18552,7 +18538,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_D
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- property = EX_CONSTANT(opline->op2);
+ property = RT_CONSTANT(opline, opline->op2);
value = _get_zval_ptr_tmp((opline+1)->op1.var, &free_op_data EXECUTE_DATA_CC);
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
@@ -18567,7 +18553,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_D
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -18603,7 +18589,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_D
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -18710,7 +18696,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_D
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- property = EX_CONSTANT(opline->op2);
+ property = RT_CONSTANT(opline, opline->op2);
value = _get_zval_ptr_var((opline+1)->op1.var, &free_op_data EXECUTE_DATA_CC);
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
@@ -18725,7 +18711,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_D
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -18761,7 +18747,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_D
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -18868,7 +18854,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_D
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- property = EX_CONSTANT(opline->op2);
+ property = RT_CONSTANT(opline, opline->op2);
value = _get_zval_ptr_cv_BP_VAR_R((opline+1)->op1.var EXECUTE_DATA_CC);
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
@@ -18883,7 +18869,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_D
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -18919,7 +18905,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_OP_D
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -19036,7 +19022,7 @@ try_assign_dim_array:
goto assign_dim_error;
}
} else {
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
if (IS_CONST == IS_CONST) {
variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC);
} else {
@@ -19046,7 +19032,7 @@ try_assign_dim_array:
goto assign_dim_error;
}
}
- value = EX_CONSTANT((opline+1)->op1);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
value = zend_assign_to_variable(variable_ptr, value, IS_CONST);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
@@ -19059,8 +19045,8 @@ try_assign_dim_array:
}
}
if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) {
- dim = EX_CONSTANT(opline->op2);
- value = EX_CONSTANT((opline+1)->op1);
+ dim = RT_CONSTANT(opline, opline->op2);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
zend_assign_to_object_dim(object_ptr, dim, value);
@@ -19076,20 +19062,19 @@ try_assign_dim_array:
UNDEF_RESULT();
HANDLE_EXCEPTION();
} else {
- dim = EX_CONSTANT(opline->op2);
- value = EX_CONSTANT((opline+1)->op1);
+ dim = RT_CONSTANT(opline, opline->op2);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
zend_assign_to_string_offset(object_ptr, dim, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL) EXECUTE_DATA_CC);
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
goto try_assign_dim_array;
} else {
if (IS_VAR != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
zend_error(E_WARNING, "Cannot use a scalar value as an array");
}
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
assign_dim_error:
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
@@ -19128,7 +19113,7 @@ try_assign_dim_array:
goto assign_dim_error;
}
} else {
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
if (IS_CONST == IS_CONST) {
variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC);
} else {
@@ -19151,7 +19136,7 @@ try_assign_dim_array:
}
}
if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) {
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
value = _get_zval_ptr_tmp((opline+1)->op1.var, &free_op_data EXECUTE_DATA_CC);
zend_assign_to_object_dim(object_ptr, dim, value);
@@ -19169,20 +19154,19 @@ try_assign_dim_array:
UNDEF_RESULT();
HANDLE_EXCEPTION();
} else {
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
value = _get_zval_ptr_tmp((opline+1)->op1.var, &free_op_data EXECUTE_DATA_CC);
zend_assign_to_string_offset(object_ptr, dim, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL) EXECUTE_DATA_CC);
zval_ptr_dtor_nogc(free_op_data);
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
goto try_assign_dim_array;
} else {
if (IS_VAR != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
zend_error(E_WARNING, "Cannot use a scalar value as an array");
}
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
assign_dim_error:
zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var));
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
@@ -19221,7 +19205,7 @@ try_assign_dim_array:
goto assign_dim_error;
}
} else {
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
if (IS_CONST == IS_CONST) {
variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC);
} else {
@@ -19244,7 +19228,7 @@ try_assign_dim_array:
}
}
if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) {
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
value = _get_zval_ptr_var_deref((opline+1)->op1.var, &free_op_data EXECUTE_DATA_CC);
zend_assign_to_object_dim(object_ptr, dim, value);
@@ -19262,20 +19246,19 @@ try_assign_dim_array:
UNDEF_RESULT();
HANDLE_EXCEPTION();
} else {
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
value = _get_zval_ptr_var_deref((opline+1)->op1.var, &free_op_data EXECUTE_DATA_CC);
zend_assign_to_string_offset(object_ptr, dim, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL) EXECUTE_DATA_CC);
zval_ptr_dtor_nogc(free_op_data);
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
goto try_assign_dim_array;
} else {
if (IS_VAR != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
zend_error(E_WARNING, "Cannot use a scalar value as an array");
}
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
assign_dim_error:
zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var));
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
@@ -19314,7 +19297,7 @@ try_assign_dim_array:
goto assign_dim_error;
}
} else {
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
if (IS_CONST == IS_CONST) {
variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC);
} else {
@@ -19337,7 +19320,7 @@ try_assign_dim_array:
}
}
if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) {
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
value = _get_zval_ptr_cv_deref_BP_VAR_R((opline+1)->op1.var EXECUTE_DATA_CC);
zend_assign_to_object_dim(object_ptr, dim, value);
@@ -19354,20 +19337,19 @@ try_assign_dim_array:
UNDEF_RESULT();
HANDLE_EXCEPTION();
} else {
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
value = _get_zval_ptr_cv_deref_BP_VAR_R((opline+1)->op1.var EXECUTE_DATA_CC);
zend_assign_to_string_offset(object_ptr, dim, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL) EXECUTE_DATA_CC);
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
goto try_assign_dim_array;
} else {
if (IS_VAR != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
zend_error(E_WARNING, "Cannot use a scalar value as an array");
}
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
assign_dim_error:
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
@@ -19391,7 +19373,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CONST_RETVAL_U
zval *variable_ptr;
SAVE_OPLINE();
- value = EX_CONSTANT(opline->op2);
+ value = RT_CONSTANT(opline, opline->op2);
variable_ptr = _get_zval_ptr_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
if (IS_VAR == IS_VAR && UNEXPECTED(Z_ISERROR_P(variable_ptr))) {
@@ -19419,7 +19401,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_SPEC_VAR_CONST_RETVAL_U
zval *variable_ptr;
SAVE_OPLINE();
- value = EX_CONSTANT(opline->op2);
+ value = RT_CONSTANT(opline, opline->op2);
variable_ptr = _get_zval_ptr_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
if (IS_VAR == IS_VAR && UNEXPECTED(Z_ISERROR_P(variable_ptr))) {
@@ -19452,14 +19434,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
if (IS_VAR == IS_CONST) {
/* no function found. try a static method in class */
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), ce);
}
} else if (IS_VAR == IS_UNUSED) {
ce = zend_fetch_class(NULL, opline->op1.num);
@@ -19474,16 +19456,16 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
if (IS_VAR == IS_CONST &&
IS_CONST == IS_CONST &&
- EXPECTED((fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) != NULL)) {
+ EXPECTED((fbc = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)))) != NULL)) {
/* nothing to do */
} else if (IS_VAR != IS_CONST &&
IS_CONST == IS_CONST &&
- EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2))) == ce)) {
- fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)) + sizeof(void*));
+ EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2))) == ce)) {
+ fbc = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)) + sizeof(void*));
} else if (IS_CONST != IS_UNUSED) {
- function_name = EX_CONSTANT(opline->op2);
+ function_name = RT_CONSTANT(opline, opline->op2);
if (IS_CONST != IS_CONST) {
if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
do {
@@ -19508,7 +19490,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
if (ce->get_static_method) {
fbc = ce->get_static_method(ce, Z_STR_P(function_name));
} else {
- fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
+ fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL));
}
if (UNEXPECTED(fbc == NULL)) {
if (EXPECTED(!EG(exception))) {
@@ -19605,22 +19587,22 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_CONSTANT_SPEC_VAR_
do {
if (IS_VAR == IS_CONST) {
- if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2))))) {
- value = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
+ if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2))))) {
+ value = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)));
#ifdef ZTS
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)));
#endif
break;
- } else if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1))))) {
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
+ } else if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1))))) {
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), ce);
}
} else {
if (IS_VAR == IS_UNUSED) {
@@ -19633,21 +19615,21 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_CONSTANT_SPEC_VAR_
} else {
ce = Z_CE_P(EX_VAR(opline->op1.var));
}
- if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2))) == ce)) {
- value = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)) + sizeof(void*));
+ if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2))) == ce)) {
+ value = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)) + sizeof(void*));
break;
}
}
- if (EXPECTED((c = zend_hash_find_ptr(&ce->constants_table, Z_STR_P(EX_CONSTANT(opline->op2)))) != NULL)) {
+ if (EXPECTED((c = zend_hash_find_ptr(&ce->constants_table, Z_STR_P(RT_CONSTANT(opline, opline->op2)))) != NULL)) {
scope = EX(func)->op_array.scope;
if (!zend_verify_const_access(c, scope)) {
- zend_throw_error(NULL, "Cannot access %s const %s::%s", zend_visibility_string(Z_ACCESS_FLAGS(c->value)), ZSTR_VAL(ce->name), Z_STRVAL_P(EX_CONSTANT(opline->op2)));
+ zend_throw_error(NULL, "Cannot access %s const %s::%s", zend_visibility_string(Z_ACCESS_FLAGS(c->value)), ZSTR_VAL(ce->name), Z_STRVAL_P(RT_CONSTANT(opline, opline->op2)));
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
value = &c->value;
- if (Z_CONSTANT_P(value)) {
+ if (Z_TYPE_P(value) == IS_CONSTANT_AST) {
zval_update_constant_ex(value, c->ce);
if (UNEXPECTED(EG(exception) != NULL)) {
ZVAL_UNDEF(EX_VAR(opline->result.var));
@@ -19655,12 +19637,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_CONSTANT_SPEC_VAR_
}
}
if (IS_VAR == IS_CONST) {
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), value);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), value);
} else {
- CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce, value);
+ CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), ce, value);
}
} else {
- zend_throw_error(NULL, "Undefined class constant '%s'", Z_STRVAL_P(EX_CONSTANT(opline->op2)));
+ zend_throw_error(NULL, "Undefined class constant '%s'", Z_STRVAL_P(RT_CONSTANT(opline, opline->op2)));
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
@@ -19723,7 +19705,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CON
if (IS_CONST != IS_UNUSED) {
- zval *offset = EX_CONSTANT(opline->op2);
+ zval *offset = RT_CONSTANT(opline, opline->op2);
zend_string *str;
zend_ulong hval;
@@ -19762,13 +19744,13 @@ num_index:
goto str_index;
} else {
zend_error(E_WARNING, "Illegal offset type");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
} else {
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -19786,8 +19768,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_VAR_CONST_HAND
} else {
size = 0;
}
- ZVAL_NEW_ARR(array);
- zend_hash_init(Z_ARRVAL_P(array), size, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(array, zend_new_array(size));
if (IS_VAR != IS_UNUSED) {
/* Explicitly initialize array as not-packed if flag is set */
@@ -19810,7 +19791,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CONST_HANDL
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- offset = EX_CONSTANT(opline->op2);
+ offset = RT_CONSTANT(opline, opline->op2);
do {
if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
@@ -19902,7 +19883,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDL
if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) {
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- offset = EX_CONSTANT(opline->op2);
+ offset = RT_CONSTANT(opline, opline->op2);
do {
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
@@ -20014,7 +19995,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_VAR_CONST_HANDLER(Z
/* Set the new yielded key */
if (IS_CONST != IS_UNUSED) {
- zval *key = EX_CONSTANT(opline->op2);
+ zval *key = RT_CONSTANT(opline, opline->op2);
/* Consts, temporary variables and references need copying */
if (IS_CONST == IS_CONST) {
@@ -20070,7 +20051,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IN_ARRAY_SPEC_VAR_CONST_HANDLE
USE_OPLINE
zend_free_op free_op1;
zval *op1;
- HashTable *ht = Z_ARRVAL_P(EX_CONSTANT(opline->op2));
+ HashTable *ht = Z_ARRVAL_P(RT_CONSTANT(opline, opline->op2));
int result;
SAVE_OPLINE();
@@ -20656,7 +20637,7 @@ assign_dim_op_new_array:
SEPARATE_ZVAL_NOREF(var_ptr);
}
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
binary_op(var_ptr, var_ptr, value);
@@ -20672,15 +20653,14 @@ assign_dim_op_new_array:
} else if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
container = GET_OP1_UNDEF_CV(container, BP_VAR_RW);
assign_dim_op_convert_to_array:
- ZVAL_NEW_ARR(container);
- zend_hash_init(Z_ARRVAL_P(container), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(container, zend_new_array(8));
goto assign_dim_op_new_array;
}
dim = NULL;
if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op EXECUTE_DATA_CC);
} else {
if (UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) {
@@ -20702,7 +20682,7 @@ assign_dim_op_ret_null:
ZVAL_NULL(EX_VAR(opline->result.var));
}
}
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
}
}
@@ -20899,7 +20879,7 @@ try_assign_dim_array:
goto assign_dim_error;
}
}
- value = EX_CONSTANT((opline+1)->op1);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
value = zend_assign_to_variable(variable_ptr, value, IS_CONST);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
@@ -20913,7 +20893,7 @@ try_assign_dim_array:
}
if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) {
dim = NULL;
- value = EX_CONSTANT((opline+1)->op1);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
zend_assign_to_object_dim(object_ptr, dim, value);
@@ -20930,13 +20910,12 @@ try_assign_dim_array:
HANDLE_EXCEPTION();
} else {
dim = NULL;
- value = EX_CONSTANT((opline+1)->op1);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
zend_assign_to_string_offset(object_ptr, dim, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL) EXECUTE_DATA_CC);
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
goto try_assign_dim_array;
} else {
if (IS_VAR != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
@@ -21028,8 +21007,7 @@ try_assign_dim_array:
zval_ptr_dtor_nogc(free_op_data);
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
goto try_assign_dim_array;
} else {
if (IS_VAR != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
@@ -21121,8 +21099,7 @@ try_assign_dim_array:
zval_ptr_dtor_nogc(free_op_data);
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
goto try_assign_dim_array;
} else {
if (IS_VAR != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
@@ -21213,8 +21190,7 @@ try_assign_dim_array:
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
goto try_assign_dim_array;
} else {
if (IS_VAR != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
@@ -21249,14 +21225,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
if (IS_VAR == IS_CONST) {
/* no function found. try a static method in class */
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), ce);
}
} else if (IS_VAR == IS_UNUSED) {
ce = zend_fetch_class(NULL, opline->op1.num);
@@ -21271,12 +21247,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
if (IS_VAR == IS_CONST &&
IS_UNUSED == IS_CONST &&
- EXPECTED((fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) != NULL)) {
+ EXPECTED((fbc = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)))) != NULL)) {
/* nothing to do */
} else if (IS_VAR != IS_CONST &&
IS_UNUSED == IS_CONST &&
- EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2))) == ce)) {
- fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)) + sizeof(void*));
+ EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2))) == ce)) {
+ fbc = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)) + sizeof(void*));
} else if (IS_UNUSED != IS_UNUSED) {
@@ -21305,7 +21281,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
if (ce->get_static_method) {
fbc = ce->get_static_method(ce, Z_STR_P(function_name));
} else {
- fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_UNUSED == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
+ fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_UNUSED == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL));
}
if (UNEXPECTED(fbc == NULL)) {
if (EXPECTED(!EG(exception))) {
@@ -21524,13 +21500,13 @@ num_index:
goto str_index;
} else {
zend_error(E_WARNING, "Illegal offset type");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
} else {
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -21548,8 +21524,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_VAR_UNUSED_HAN
} else {
size = 0;
}
- ZVAL_NEW_ARR(array);
- zend_hash_init(Z_ARRVAL_P(array), size, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(array, zend_new_array(size));
if (IS_VAR != IS_UNUSED) {
/* Explicitly initialize array as not-packed if flag is set */
@@ -21892,7 +21867,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP
property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
do {
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
ZVAL_DEREF(object);
@@ -21970,7 +21945,7 @@ assign_dim_op_new_array:
SEPARATE_ZVAL_NOREF(var_ptr);
}
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
binary_op(var_ptr, var_ptr, value);
@@ -21986,15 +21961,14 @@ assign_dim_op_new_array:
} else if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
container = GET_OP1_UNDEF_CV(container, BP_VAR_RW);
assign_dim_op_convert_to_array:
- ZVAL_NEW_ARR(container);
- zend_hash_init(Z_ARRVAL_P(container), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(container, zend_new_array(8));
goto assign_dim_op_new_array;
}
dim = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op EXECUTE_DATA_CC);
} else {
if (UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) {
@@ -22016,7 +21990,7 @@ assign_dim_op_ret_null:
ZVAL_NULL(EX_VAR(opline->result.var));
}
}
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
}
}
@@ -22577,7 +22551,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_CV_HANDLE
EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
retval = OBJ_PROP(zobj, prop_offset);
if (EXPECTED(Z_TYPE_INFO_P(retval) != IS_UNDEF)) {
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
@@ -22733,7 +22707,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA
}
property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
- value = EX_CONSTANT((opline+1)->op1);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
do {
@@ -22747,7 +22721,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -22783,7 +22757,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -22905,7 +22879,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -22941,7 +22915,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -23063,7 +23037,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -23099,7 +23073,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -23221,7 +23195,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -23257,7 +23231,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CV_OP_DATA
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -23384,7 +23358,7 @@ try_assign_dim_array:
goto assign_dim_error;
}
}
- value = EX_CONSTANT((opline+1)->op1);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
value = zend_assign_to_variable(variable_ptr, value, IS_CONST);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
@@ -23398,7 +23372,7 @@ try_assign_dim_array:
}
if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) {
dim = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
- value = EX_CONSTANT((opline+1)->op1);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
zend_assign_to_object_dim(object_ptr, dim, value);
@@ -23415,13 +23389,12 @@ try_assign_dim_array:
HANDLE_EXCEPTION();
} else {
dim = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
- value = EX_CONSTANT((opline+1)->op1);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
zend_assign_to_string_offset(object_ptr, dim, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL) EXECUTE_DATA_CC);
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
goto try_assign_dim_array;
} else {
if (IS_VAR != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
@@ -23513,8 +23486,7 @@ try_assign_dim_array:
zval_ptr_dtor_nogc(free_op_data);
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
goto try_assign_dim_array;
} else {
if (IS_VAR != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
@@ -23606,8 +23578,7 @@ try_assign_dim_array:
zval_ptr_dtor_nogc(free_op_data);
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
goto try_assign_dim_array;
} else {
if (IS_VAR != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
@@ -23698,8 +23669,7 @@ try_assign_dim_array:
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
goto try_assign_dim_array;
} else {
if (IS_VAR != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
@@ -23847,14 +23817,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
if (IS_VAR == IS_CONST) {
/* no function found. try a static method in class */
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), ce);
}
} else if (IS_VAR == IS_UNUSED) {
ce = zend_fetch_class(NULL, opline->op1.num);
@@ -23869,12 +23839,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
if (IS_VAR == IS_CONST &&
IS_CV == IS_CONST &&
- EXPECTED((fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) != NULL)) {
+ EXPECTED((fbc = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)))) != NULL)) {
/* nothing to do */
} else if (IS_VAR != IS_CONST &&
IS_CV == IS_CONST &&
- EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2))) == ce)) {
- fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)) + sizeof(void*));
+ EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2))) == ce)) {
+ fbc = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)) + sizeof(void*));
} else if (IS_CV != IS_UNUSED) {
@@ -23903,7 +23873,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
if (ce->get_static_method) {
fbc = ce->get_static_method(ce, Z_STR_P(function_name));
} else {
- fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
+ fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL));
}
if (UNEXPECTED(fbc == NULL)) {
if (EXPECTED(!EG(exception))) {
@@ -24072,13 +24042,13 @@ num_index:
goto str_index;
} else {
zend_error(E_WARNING, "Illegal offset type");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
} else {
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -24096,8 +24066,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_VAR_CV_HANDLER
} else {
size = 0;
}
- ZVAL_NEW_ARR(array);
- zend_hash_init(Z_ARRVAL_P(array), size, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(array, zend_new_array(size));
if (IS_VAR != IS_UNUSED) {
/* Explicitly initialize array as not-packed if flag is set */
@@ -24498,7 +24467,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP
property = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
do {
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
ZVAL_DEREF(object);
@@ -24576,7 +24545,7 @@ assign_dim_op_new_array:
SEPARATE_ZVAL_NOREF(var_ptr);
}
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
binary_op(var_ptr, var_ptr, value);
@@ -24592,15 +24561,14 @@ assign_dim_op_new_array:
} else if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
container = GET_OP1_UNDEF_CV(container, BP_VAR_RW);
assign_dim_op_convert_to_array:
- ZVAL_NEW_ARR(container);
- zend_hash_init(Z_ARRVAL_P(container), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(container, zend_new_array(8));
goto assign_dim_op_new_array;
}
dim = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op EXECUTE_DATA_CC);
} else {
if (UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) {
@@ -24622,7 +24590,7 @@ assign_dim_op_ret_null:
ZVAL_NULL(EX_VAR(opline->result.var));
}
}
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
}
}
@@ -25187,7 +25155,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_TMPVAR_HA
EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
retval = OBJ_PROP(zobj, prop_offset);
if (EXPECTED(Z_TYPE_INFO_P(retval) != IS_UNDEF)) {
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
@@ -25344,7 +25312,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_
}
property = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
- value = EX_CONSTANT((opline+1)->op1);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
do {
@@ -25358,7 +25326,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -25394,7 +25362,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -25516,7 +25484,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -25552,7 +25520,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -25674,7 +25642,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -25710,7 +25678,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -25832,7 +25800,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -25868,7 +25836,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_OP_
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -25995,7 +25963,7 @@ try_assign_dim_array:
goto assign_dim_error;
}
}
- value = EX_CONSTANT((opline+1)->op1);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
value = zend_assign_to_variable(variable_ptr, value, IS_CONST);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
@@ -26009,7 +25977,7 @@ try_assign_dim_array:
}
if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) {
dim = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
- value = EX_CONSTANT((opline+1)->op1);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
zend_assign_to_object_dim(object_ptr, dim, value);
@@ -26026,13 +25994,12 @@ try_assign_dim_array:
HANDLE_EXCEPTION();
} else {
dim = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
- value = EX_CONSTANT((opline+1)->op1);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
zend_assign_to_string_offset(object_ptr, dim, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL) EXECUTE_DATA_CC);
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
goto try_assign_dim_array;
} else {
if (IS_VAR != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
@@ -26124,8 +26091,7 @@ try_assign_dim_array:
zval_ptr_dtor_nogc(free_op_data);
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
goto try_assign_dim_array;
} else {
if (IS_VAR != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
@@ -26217,8 +26183,7 @@ try_assign_dim_array:
zval_ptr_dtor_nogc(free_op_data);
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
goto try_assign_dim_array;
} else {
if (IS_VAR != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
@@ -26309,8 +26274,7 @@ try_assign_dim_array:
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
goto try_assign_dim_array;
} else {
if (IS_VAR != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
@@ -26345,14 +26309,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
if (IS_VAR == IS_CONST) {
/* no function found. try a static method in class */
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), ce);
}
} else if (IS_VAR == IS_UNUSED) {
ce = zend_fetch_class(NULL, opline->op1.num);
@@ -26367,12 +26331,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
if (IS_VAR == IS_CONST &&
(IS_TMP_VAR|IS_VAR) == IS_CONST &&
- EXPECTED((fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) != NULL)) {
+ EXPECTED((fbc = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)))) != NULL)) {
/* nothing to do */
} else if (IS_VAR != IS_CONST &&
(IS_TMP_VAR|IS_VAR) == IS_CONST &&
- EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2))) == ce)) {
- fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)) + sizeof(void*));
+ EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2))) == ce)) {
+ fbc = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)) + sizeof(void*));
} else if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED) {
zend_free_op free_op2;
@@ -26401,7 +26365,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V
if (ce->get_static_method) {
fbc = ce->get_static_method(ce, Z_STR_P(function_name));
} else {
- fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
+ fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL));
}
if (UNEXPECTED(fbc == NULL)) {
if (EXPECTED(!EG(exception))) {
@@ -26570,13 +26534,13 @@ num_index:
goto str_index;
} else {
zend_error(E_WARNING, "Illegal offset type");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
zval_ptr_dtor_nogc(free_op2);
} else {
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -26594,8 +26558,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_VAR_TMPVAR_HAN
} else {
size = 0;
}
- ZVAL_NEW_ARR(array);
- zend_hash_init(Z_ARRVAL_P(array), size, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(array, zend_new_array(size));
if (IS_VAR != IS_UNUSED) {
/* Explicitly initialize array as not-packed if flag is set */
@@ -26748,15 +26711,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_NEW_SPEC_UNUSED_HANDLER(ZEND_O
SAVE_OPLINE();
if (IS_UNUSED == IS_CONST) {
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), ce);
}
} else if (IS_UNUSED == IS_UNUSED) {
ce = zend_fetch_class(NULL, opline->op1.num);
@@ -26932,10 +26895,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- property = EX_CONSTANT(opline->op2);
+ property = RT_CONSTANT(opline, opline->op2);
do {
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
ZVAL_DEREF(object);
@@ -27073,7 +27036,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- property = EX_CONSTANT(opline->op2);
+ property = RT_CONSTANT(opline, opline->op2);
do {
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
@@ -27151,7 +27114,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- property = EX_CONSTANT(opline->op2);
+ property = RT_CONSTANT(opline, opline->op2);
do {
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
@@ -27224,7 +27187,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_CONST_
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- offset = EX_CONSTANT(opline->op2);
+ offset = RT_CONSTANT(opline, opline->op2);
if (IS_UNUSED == IS_CONST ||
(IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) {
@@ -27247,7 +27210,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_CONST_
EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
retval = OBJ_PROP(zobj, prop_offset);
if (EXPECTED(Z_TYPE_INFO_P(retval) != IS_UNDEF)) {
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
@@ -27296,7 +27259,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST_
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- property = EX_CONSTANT(opline->op2);
+ property = RT_CONSTANT(opline, opline->op2);
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1)) {
@@ -27319,7 +27282,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CONST
if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) {
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- property = EX_CONSTANT(opline->op2);
+ property = RT_CONSTANT(opline, opline->op2);
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW);
if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1)) {
@@ -27344,7 +27307,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CONST
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- offset = EX_CONSTANT(opline->op2);
+ offset = RT_CONSTANT(opline, opline->op2);
if (IS_UNUSED == IS_CONST ||
(IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) {
@@ -27367,7 +27330,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CONST
EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
retval = OBJ_PROP(zobj, prop_offset);
if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -27422,7 +27385,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
- property = EX_CONSTANT(opline->op2);
+ property = RT_CONSTANT(opline, opline->op2);
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1)) {
@@ -27448,7 +27411,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CO
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- property = EX_CONSTANT(opline->op2);
+ property = RT_CONSTANT(opline, opline->op2);
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET);
@@ -27472,8 +27435,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_O
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- property = EX_CONSTANT(opline->op2);
- value = EX_CONSTANT((opline+1)->op1);
+ property = RT_CONSTANT(opline, opline->op2);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
do {
@@ -27487,7 +27450,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_O
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -27523,7 +27486,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_O
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -27630,7 +27593,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_O
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- property = EX_CONSTANT(opline->op2);
+ property = RT_CONSTANT(opline, opline->op2);
value = _get_zval_ptr_tmp((opline+1)->op1.var, &free_op_data EXECUTE_DATA_CC);
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
@@ -27645,7 +27608,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_O
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -27681,7 +27644,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_O
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -27788,7 +27751,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_O
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- property = EX_CONSTANT(opline->op2);
+ property = RT_CONSTANT(opline, opline->op2);
value = _get_zval_ptr_var((opline+1)->op1.var, &free_op_data EXECUTE_DATA_CC);
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
@@ -27803,7 +27766,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_O
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -27839,7 +27802,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_O
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -27946,7 +27909,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_O
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- property = EX_CONSTANT(opline->op2);
+ property = RT_CONSTANT(opline, opline->op2);
value = _get_zval_ptr_cv_BP_VAR_R((opline+1)->op1.var EXECUTE_DATA_CC);
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
@@ -27961,7 +27924,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_O
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -27997,7 +27960,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_O
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -28101,10 +28064,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ROPE_INIT_SPEC_UNUSED_CONST_HA
/* Compiler allocates the necessary number of zval slots to keep the rope */
rope = (zend_string**)EX_VAR(opline->result.var);
if (IS_CONST == IS_CONST) {
- var = EX_CONSTANT(opline->op2);
+ var = RT_CONSTANT(opline, opline->op2);
rope[0] = zend_string_copy(Z_STR_P(var));
} else {
- var = EX_CONSTANT(opline->op2);
+ var = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_P(var) == IS_STRING)) {
if (IS_CONST == IS_CV) {
rope[0] = zend_string_copy(Z_STR_P(var));
@@ -28144,7 +28107,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_C
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- function_name = EX_CONSTANT(opline->op2);
+ function_name = RT_CONSTANT(opline, opline->op2);
if (IS_CONST != IS_CONST &&
UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
@@ -28209,7 +28172,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_C
}
/* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL));
if (UNEXPECTED(fbc == NULL)) {
if (EXPECTED(!EG(exception))) {
zend_throw_error(NULL, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name));
@@ -28264,14 +28227,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_U
if (IS_UNUSED == IS_CONST) {
/* no function found. try a static method in class */
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), ce);
}
} else if (IS_UNUSED == IS_UNUSED) {
ce = zend_fetch_class(NULL, opline->op1.num);
@@ -28286,16 +28249,16 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_U
if (IS_UNUSED == IS_CONST &&
IS_CONST == IS_CONST &&
- EXPECTED((fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) != NULL)) {
+ EXPECTED((fbc = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)))) != NULL)) {
/* nothing to do */
} else if (IS_UNUSED != IS_CONST &&
IS_CONST == IS_CONST &&
- EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2))) == ce)) {
- fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)) + sizeof(void*));
+ EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2))) == ce)) {
+ fbc = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)) + sizeof(void*));
} else if (IS_CONST != IS_UNUSED) {
- function_name = EX_CONSTANT(opline->op2);
+ function_name = RT_CONSTANT(opline, opline->op2);
if (IS_CONST != IS_CONST) {
if (UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
do {
@@ -28320,7 +28283,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_U
if (ce->get_static_method) {
fbc = ce->get_static_method(ce, Z_STR_P(function_name));
} else {
- fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
+ fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL));
}
if (UNEXPECTED(fbc == NULL)) {
if (EXPECTED(!EG(exception))) {
@@ -28411,31 +28374,31 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CON
USE_OPLINE
zend_constant *c;
- if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2))))) {
- c = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
- } else if ((c = zend_quick_get_constant(EX_CONSTANT(opline->op2) + 1, opline->extended_value)) == NULL) {
+ if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2))))) {
+ c = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)));
+ } else if ((c = zend_quick_get_constant(RT_CONSTANT(opline, opline->op2) + 1, opline->extended_value)) == NULL) {
SAVE_OPLINE();
if ((opline->extended_value & IS_CONSTANT_UNQUALIFIED) != 0) {
- char *actual = (char *)zend_memrchr(Z_STRVAL_P(EX_CONSTANT(opline->op2)), '\\', Z_STRLEN_P(EX_CONSTANT(opline->op2)));
+ char *actual = (char *)zend_memrchr(Z_STRVAL_P(RT_CONSTANT(opline, opline->op2)), '\\', Z_STRLEN_P(RT_CONSTANT(opline, opline->op2)));
if (!actual) {
- ZVAL_STR_COPY(EX_VAR(opline->result.var), Z_STR_P(EX_CONSTANT(opline->op2)));
+ ZVAL_STR_COPY(EX_VAR(opline->result.var), Z_STR_P(RT_CONSTANT(opline, opline->op2)));
} else {
actual++;
ZVAL_STRINGL(EX_VAR(opline->result.var),
- actual, Z_STRLEN_P(EX_CONSTANT(opline->op2)) - (actual - Z_STRVAL_P(EX_CONSTANT(opline->op2))));
+ actual, Z_STRLEN_P(RT_CONSTANT(opline, opline->op2)) - (actual - Z_STRVAL_P(RT_CONSTANT(opline, opline->op2))));
}
/* non-qualified constant - allow text substitution */
zend_error(E_WARNING, "Use of undefined constant %s - assumed '%s' (this will throw an Error in a future version of PHP)",
Z_STRVAL_P(EX_VAR(opline->result.var)), Z_STRVAL_P(EX_VAR(opline->result.var)));
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
} else {
- zend_throw_error(NULL, "Undefined constant '%s'", Z_STRVAL_P(EX_CONSTANT(opline->op2)));
+ zend_throw_error(NULL, "Undefined constant '%s'", Z_STRVAL_P(RT_CONSTANT(opline, opline->op2)));
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
} else {
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), c);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), c);
}
#ifdef ZTS
@@ -28462,22 +28425,22 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_CONSTANT_SPEC_UNUS
do {
if (IS_UNUSED == IS_CONST) {
- if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2))))) {
- value = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
+ if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2))))) {
+ value = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)));
#ifdef ZTS
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)));
#endif
break;
- } else if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1))))) {
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
+ } else if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1))))) {
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)));
} else {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), ce);
}
} else {
if (IS_UNUSED == IS_UNUSED) {
@@ -28490,21 +28453,21 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_CONSTANT_SPEC_UNUS
} else {
ce = Z_CE_P(EX_VAR(opline->op1.var));
}
- if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2))) == ce)) {
- value = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)) + sizeof(void*));
+ if (EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2))) == ce)) {
+ value = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)) + sizeof(void*));
break;
}
}
- if (EXPECTED((c = zend_hash_find_ptr(&ce->constants_table, Z_STR_P(EX_CONSTANT(opline->op2)))) != NULL)) {
+ if (EXPECTED((c = zend_hash_find_ptr(&ce->constants_table, Z_STR_P(RT_CONSTANT(opline, opline->op2)))) != NULL)) {
scope = EX(func)->op_array.scope;
if (!zend_verify_const_access(c, scope)) {
- zend_throw_error(NULL, "Cannot access %s const %s::%s", zend_visibility_string(Z_ACCESS_FLAGS(c->value)), ZSTR_VAL(ce->name), Z_STRVAL_P(EX_CONSTANT(opline->op2)));
+ zend_throw_error(NULL, "Cannot access %s const %s::%s", zend_visibility_string(Z_ACCESS_FLAGS(c->value)), ZSTR_VAL(ce->name), Z_STRVAL_P(RT_CONSTANT(opline, opline->op2)));
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
value = &c->value;
- if (Z_CONSTANT_P(value)) {
+ if (Z_TYPE_P(value) == IS_CONSTANT_AST) {
zval_update_constant_ex(value, c->ce);
if (UNEXPECTED(EG(exception) != NULL)) {
ZVAL_UNDEF(EX_VAR(opline->result.var));
@@ -28512,12 +28475,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_CONSTANT_SPEC_UNUS
}
}
if (IS_UNUSED == IS_CONST) {
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), value);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), value);
} else {
- CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce, value);
+ CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), ce, value);
}
} else {
- zend_throw_error(NULL, "Undefined class constant '%s'", Z_STRVAL_P(EX_CONSTANT(opline->op2)));
+ zend_throw_error(NULL, "Undefined class constant '%s'", Z_STRVAL_P(RT_CONSTANT(opline, opline->op2)));
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
@@ -28548,7 +28511,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CONST_HA
if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) {
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- offset = EX_CONSTANT(opline->op2);
+ offset = RT_CONSTANT(opline, opline->op2);
do {
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
@@ -28589,7 +28552,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UN
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- offset = EX_CONSTANT(opline->op2);
+ offset = RT_CONSTANT(opline, opline->op2);
if (IS_UNUSED == IS_CONST ||
(IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) {
@@ -28705,7 +28668,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_UNUSED_CONST_HANDLE
/* Set the new yielded key */
if (IS_CONST != IS_UNUSED) {
- zval *key = EX_CONSTANT(opline->op2);
+ zval *key = RT_CONSTANT(opline, opline->op2);
/* Consts, temporary variables and references need copying */
if (IS_CONST == IS_CONST) {
@@ -29041,14 +29004,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_U
if (IS_UNUSED == IS_CONST) {
/* no function found. try a static method in class */
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), ce);
}
} else if (IS_UNUSED == IS_UNUSED) {
ce = zend_fetch_class(NULL, opline->op1.num);
@@ -29063,12 +29026,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_U
if (IS_UNUSED == IS_CONST &&
IS_UNUSED == IS_CONST &&
- EXPECTED((fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) != NULL)) {
+ EXPECTED((fbc = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)))) != NULL)) {
/* nothing to do */
} else if (IS_UNUSED != IS_CONST &&
IS_UNUSED == IS_CONST &&
- EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2))) == ce)) {
- fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)) + sizeof(void*));
+ EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2))) == ce)) {
+ fbc = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)) + sizeof(void*));
} else if (IS_UNUSED != IS_UNUSED) {
@@ -29097,7 +29060,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_U
if (ce->get_static_method) {
fbc = ce->get_static_method(ce, Z_STR_P(function_name));
} else {
- fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_UNUSED == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
+ fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_UNUSED == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL));
}
if (UNEXPECTED(fbc == NULL)) {
if (EXPECTED(!EG(exception))) {
@@ -29461,7 +29424,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FUNC_GET_ARGS_SPEC_UNUSED_UNUS
arg_count = EX_NUM_ARGS();
if (IS_UNUSED == IS_CONST) {
- skip = Z_LVAL_P(EX_CONSTANT(opline->op1));
+ skip = Z_LVAL_P(RT_CONSTANT(opline, opline->op1));
if (arg_count < skip) {
result_size = 0;
} else {
@@ -29472,8 +29435,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FUNC_GET_ARGS_SPEC_UNUSED_UNUS
result_size = arg_count;
}
- ht = (zend_array *) emalloc(sizeof(zend_array));
- zend_hash_init(ht, result_size, NULL, ZVAL_PTR_DTOR, 0);
+ ht = zend_new_array(result_size);
ZVAL_ARR(EX_VAR(opline->result.var), ht);
if (result_size) {
@@ -29544,7 +29506,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP
property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
do {
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
ZVAL_DEREF(object);
@@ -29856,7 +29818,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV_HAN
EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
retval = OBJ_PROP(zobj, prop_offset);
if (EXPECTED(Z_TYPE_INFO_P(retval) != IS_UNDEF)) {
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
@@ -29976,7 +29938,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV_HA
EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
retval = OBJ_PROP(zobj, prop_offset);
if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -30082,7 +30044,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_D
}
property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
- value = EX_CONSTANT((opline+1)->op1);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
do {
@@ -30096,7 +30058,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_D
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -30132,7 +30094,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_D
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -30254,7 +30216,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_D
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -30290,7 +30252,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_D
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -30412,7 +30374,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_D
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -30448,7 +30410,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_D
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -30570,7 +30532,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_D
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -30606,7 +30568,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_OP_D
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -30818,7 +30780,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_C
}
/* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL));
if (UNEXPECTED(fbc == NULL)) {
if (EXPECTED(!EG(exception))) {
zend_throw_error(NULL, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name));
@@ -30873,14 +30835,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_U
if (IS_UNUSED == IS_CONST) {
/* no function found. try a static method in class */
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), ce);
}
} else if (IS_UNUSED == IS_UNUSED) {
ce = zend_fetch_class(NULL, opline->op1.num);
@@ -30895,12 +30857,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_U
if (IS_UNUSED == IS_CONST &&
IS_CV == IS_CONST &&
- EXPECTED((fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) != NULL)) {
+ EXPECTED((fbc = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)))) != NULL)) {
/* nothing to do */
} else if (IS_UNUSED != IS_CONST &&
IS_CV == IS_CONST &&
- EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2))) == ce)) {
- fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)) + sizeof(void*));
+ EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2))) == ce)) {
+ fbc = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)) + sizeof(void*));
} else if (IS_CV != IS_UNUSED) {
@@ -30929,7 +30891,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_U
if (ce->get_static_method) {
fbc = ce->get_static_method(ce, Z_STR_P(function_name));
} else {
- fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
+ fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL));
}
if (UNEXPECTED(fbc == NULL)) {
if (EXPECTED(!EG(exception))) {
@@ -31254,7 +31216,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP
property = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
do {
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
ZVAL_DEREF(object);
@@ -31568,7 +31530,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMPVAR
EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
retval = OBJ_PROP(zobj, prop_offset);
if (EXPECTED(Z_TYPE_INFO_P(retval) != IS_UNDEF)) {
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
@@ -31689,7 +31651,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMPVA
EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
retval = OBJ_PROP(zobj, prop_offset);
if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -31796,7 +31758,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_
}
property = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
- value = EX_CONSTANT((opline+1)->op1);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
do {
@@ -31810,7 +31772,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -31846,7 +31808,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -31968,7 +31930,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -32004,7 +31966,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -32126,7 +32088,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -32162,7 +32124,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -32284,7 +32246,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -32320,7 +32282,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -32532,7 +32494,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_T
}
/* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL));
if (UNEXPECTED(fbc == NULL)) {
if (EXPECTED(!EG(exception))) {
zend_throw_error(NULL, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name));
@@ -32588,14 +32550,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_U
if (IS_UNUSED == IS_CONST) {
/* no function found. try a static method in class */
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op1)), RT_CONSTANT(opline, opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), ce);
}
} else if (IS_UNUSED == IS_UNUSED) {
ce = zend_fetch_class(NULL, opline->op1.num);
@@ -32610,12 +32572,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_U
if (IS_UNUSED == IS_CONST &&
(IS_TMP_VAR|IS_VAR) == IS_CONST &&
- EXPECTED((fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) != NULL)) {
+ EXPECTED((fbc = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)))) != NULL)) {
/* nothing to do */
} else if (IS_UNUSED != IS_CONST &&
(IS_TMP_VAR|IS_VAR) == IS_CONST &&
- EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2))) == ce)) {
- fbc = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)) + sizeof(void*));
+ EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2))) == ce)) {
+ fbc = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)) + sizeof(void*));
} else if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED) {
zend_free_op free_op2;
@@ -32644,7 +32606,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_U
if (ce->get_static_method) {
fbc = ce->get_static_method(ce, Z_STR_P(function_name));
} else {
- fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
+ fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL));
}
if (UNEXPECTED(fbc == NULL)) {
if (EXPECTED(!EG(exception))) {
@@ -33819,8 +33781,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CAST_SPEC_CV_HANDLER(ZEND_OPCO
if (opline->extended_value == IS_ARRAY) {
if (Z_TYPE_P(expr) != IS_OBJECT) {
- ZVAL_NEW_ARR(result);
- zend_hash_init(Z_ARRVAL_P(result), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(result, zend_new_array(8));
if (Z_TYPE_P(expr) != IS_NULL) {
expr = zend_hash_index_add_new(Z_ARRVAL_P(result), 0, expr);
if (IS_CV == IS_CONST) {
@@ -34577,7 +34538,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_SPEC_CV_CONST_HANDLER(ZEND
zval *op1, *op2, *result;
op1 = _get_zval_ptr_cv_undef(opline->op1.var EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
result = EX_VAR(opline->result.var);
@@ -34620,7 +34581,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_SPEC_CV_CONST_HANDLER(ZEND
zval *op1, *op2, *result;
op1 = _get_zval_ptr_cv_undef(opline->op1.var EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
result = EX_VAR(opline->result.var);
@@ -34663,7 +34624,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MUL_SPEC_CV_CONST_HANDLER(ZEND
zval *op1, *op2, *result;
op1 = _get_zval_ptr_cv_undef(opline->op1.var EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
zend_long overflow;
@@ -34710,7 +34671,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DIV_SPEC_CV_CONST_HANDLER(ZEND
SAVE_OPLINE();
op1 = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
fast_div_function(EX_VAR(opline->result.var), op1, op2);
@@ -34724,7 +34685,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_CV_CONST_HANDLER(ZEND
zval *op1, *op2, *result;
op1 = _get_zval_ptr_cv_undef(opline->op1.var EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
result = EX_VAR(opline->result.var);
@@ -34763,7 +34724,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SL_SPEC_CV_CONST_HANDLER(ZEND_
zval *op1, *op2;
op1 = _get_zval_ptr_cv_undef(opline->op1.var EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)
&& EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)
&& EXPECTED((zend_ulong)Z_LVAL_P(op2) < SIZEOF_ZEND_LONG * 8)) {
@@ -34791,7 +34752,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SR_SPEC_CV_CONST_HANDLER(ZEND_
zval *op1, *op2;
op1 = _get_zval_ptr_cv_undef(opline->op1.var EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)
&& EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)
&& EXPECTED((zend_ulong)Z_LVAL_P(op2) < SIZEOF_ZEND_LONG * 8)) {
@@ -34820,7 +34781,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POW_SPEC_CV_CONST_HANDLER(ZEND
SAVE_OPLINE();
op1 = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
pow_function(EX_VAR(opline->result.var), op1, op2);
@@ -34834,7 +34795,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CONCAT_SPEC_CV_CONST_HANDLER(Z
zval *op1, *op2;
op1 = _get_zval_ptr_cv_undef(opline->op1.var EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
if ((IS_CV == IS_CONST || EXPECTED(Z_TYPE_P(op1) == IS_STRING)) &&
(IS_CONST == IS_CONST || EXPECTED(Z_TYPE_P(op2) == IS_STRING))) {
@@ -34900,7 +34861,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_IDENTICAL_SPEC_CV_CONST_HAN
SAVE_OPLINE();
op1 = _get_zval_ptr_cv_deref_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
result = fast_is_identical_function(op1, op2);
@@ -34918,7 +34879,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_IDENTICAL_SPEC_CV_CONST
SAVE_OPLINE();
op1 = _get_zval_ptr_cv_deref_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
result = fast_is_not_identical_function(op1, op2);
@@ -34934,7 +34895,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CV_CONST_HANDLER
zval *op1, *op2, *result;
op1 = _get_zval_ptr_cv_undef(opline->op1.var EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
do {
int result;
@@ -35002,7 +34963,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CV_CONST_HAN
zval *op1, *op2, *result;
op1 = _get_zval_ptr_cv_undef(opline->op1.var EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
do {
int result;
@@ -35070,7 +35031,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CV_CONST_HANDL
zval *op1, *op2, *result;
op1 = _get_zval_ptr_cv_undef(opline->op1.var EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
do {
int result;
@@ -35120,7 +35081,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CV_CO
zval *op1, *op2, *result;
op1 = _get_zval_ptr_cv_undef(opline->op1.var EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
do {
int result;
@@ -35171,7 +35132,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SPACESHIP_SPEC_CV_CONST_HANDLE
SAVE_OPLINE();
op1 = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
compare_function(EX_VAR(opline->result.var), op1, op2);
@@ -35185,7 +35146,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_OR_SPEC_CV_CONST_HANDLER(ZE
zval *op1, *op2;
op1 = _get_zval_ptr_cv_undef(opline->op1.var EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)
&& EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(op1) | Z_LVAL_P(op2));
@@ -35212,7 +35173,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_AND_SPEC_CV_CONST_HANDLER(Z
zval *op1, *op2;
op1 = _get_zval_ptr_cv_undef(opline->op1.var EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)
&& EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(op1) & Z_LVAL_P(op2));
@@ -35239,7 +35200,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_XOR_SPEC_CV_CONST_HANDLER(Z
zval *op1, *op2;
op1 = _get_zval_ptr_cv_undef(opline->op1.var EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)
&& EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(op1) ^ Z_LVAL_P(op2));
@@ -35267,7 +35228,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_CV_CONST_HANDLER
SAVE_OPLINE();
op1 = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
boolean_xor_function(EX_VAR(opline->result.var), op1, op2);
@@ -35290,10 +35251,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- property = EX_CONSTANT(opline->op2);
+ property = RT_CONSTANT(opline, opline->op2);
do {
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
ZVAL_DEREF(object);
@@ -35357,7 +35318,7 @@ assign_dim_op_new_array:
goto assign_dim_op_ret_null;
}
} else {
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
if (IS_CONST == IS_CONST) {
var_ptr = zend_fetch_dimension_address_inner_RW_CONST(Z_ARRVAL_P(container), dim EXECUTE_DATA_CC);
@@ -35371,7 +35332,7 @@ assign_dim_op_new_array:
SEPARATE_ZVAL_NOREF(var_ptr);
}
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
binary_op(var_ptr, var_ptr, value);
@@ -35387,15 +35348,14 @@ assign_dim_op_new_array:
} else if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
container = GET_OP1_UNDEF_CV(container, BP_VAR_RW);
assign_dim_op_convert_to_array:
- ZVAL_NEW_ARR(container);
- zend_hash_init(Z_ARRVAL_P(container), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(container, zend_new_array(8));
goto assign_dim_op_new_array;
}
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op EXECUTE_DATA_CC);
} else {
if (UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) {
@@ -35417,7 +35377,7 @@ assign_dim_op_ret_null:
ZVAL_NULL(EX_VAR(opline->result.var));
}
}
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
}
}
@@ -35434,7 +35394,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_simple_helper
zval *value;
SAVE_OPLINE();
- value = EX_CONSTANT(opline->op2);
+ value = RT_CONSTANT(opline, opline->op2);
var_ptr = _get_zval_ptr_cv_BP_VAR_RW(opline->op1.var EXECUTE_DATA_CC);
if (IS_CV == IS_VAR && UNEXPECTED(Z_ISERROR_P(var_ptr))) {
@@ -35711,7 +35671,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- property = EX_CONSTANT(opline->op2);
+ property = RT_CONSTANT(opline, opline->op2);
do {
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
@@ -35789,7 +35749,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- property = EX_CONSTANT(opline->op2);
+ property = RT_CONSTANT(opline, opline->op2);
do {
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
@@ -35857,7 +35817,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
SAVE_OPLINE();
varname = _get_zval_ptr_cv_undef(opline->op1.var EXECUTE_DATA_CC);
- retval = zend_fetch_static_property_address(varname, IS_CV, opline->op2, IS_CONST, type EXECUTE_DATA_CC);
+ retval = zend_fetch_static_property_address(varname, IS_CV, opline->op2, IS_CONST, type EXECUTE_DATA_CC OPLINE_CC);
if (UNEXPECTED(retval == NULL)) {
if (EG(exception)) {
@@ -35922,7 +35882,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_CONST_HAND
SAVE_OPLINE();
container = _get_zval_ptr_cv_undef(opline->op1.var EXECUTE_DATA_CC);
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
if (IS_CV != IS_CONST) {
if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
fetch_dim_r_array:
@@ -35959,7 +35919,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_W_SPEC_CV_CONST_HAND
SAVE_OPLINE();
container = _get_zval_ptr_cv_undef_BP_VAR_W(opline->op1.var EXECUTE_DATA_CC);
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST EXECUTE_DATA_CC);
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, RT_CONSTANT(opline, opline->op2), IS_CONST EXECUTE_DATA_CC);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -35977,7 +35937,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_RW_SPEC_CV_CONST_HAN
SAVE_OPLINE();
container = _get_zval_ptr_cv_undef_BP_VAR_RW(opline->op1.var EXECUTE_DATA_CC);
- zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST EXECUTE_DATA_CC);
+ zend_fetch_dimension_address_RW(EX_VAR(opline->result.var), container, RT_CONSTANT(opline, opline->op2), IS_CONST EXECUTE_DATA_CC);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -35994,7 +35954,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CV_CONST_HAN
SAVE_OPLINE();
container = _get_zval_ptr_cv_undef(opline->op1.var EXECUTE_DATA_CC);
- zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST EXECUTE_DATA_CC);
+ zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, RT_CONSTANT(opline, opline->op2), IS_CONST EXECUTE_DATA_CC);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -36017,7 +35977,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CON
HANDLE_EXCEPTION();
}
container = _get_zval_ptr_cv_undef_BP_VAR_W(opline->op1.var EXECUTE_DATA_CC);
- zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST EXECUTE_DATA_CC);
+ zend_fetch_dimension_address_W(EX_VAR(opline->result.var), container, RT_CONSTANT(opline, opline->op2), IS_CONST EXECUTE_DATA_CC);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
}
@@ -36032,7 +35992,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CON
HANDLE_EXCEPTION();
}
container = _get_zval_ptr_cv_undef(opline->op1.var EXECUTE_DATA_CC);
- zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST EXECUTE_DATA_CC);
+ zend_fetch_dimension_address_read_R(EX_VAR(opline->result.var), container, RT_CONSTANT(opline, opline->op2), IS_CONST EXECUTE_DATA_CC);
}
@@ -36048,7 +36008,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_UNSET_SPEC_CV_CONST_
SAVE_OPLINE();
container = _get_zval_ptr_cv_undef_BP_VAR_UNSET(opline->op1.var EXECUTE_DATA_CC);
- zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST EXECUTE_DATA_CC);
+ zend_fetch_dimension_address_UNSET(EX_VAR(opline->result.var), container, RT_CONSTANT(opline, opline->op2), IS_CONST EXECUTE_DATA_CC);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
@@ -36072,7 +36032,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_CONST_HAND
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- offset = EX_CONSTANT(opline->op2);
+ offset = RT_CONSTANT(opline, opline->op2);
if (IS_CV == IS_CONST ||
(IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) {
@@ -36095,7 +36055,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_CONST_HAND
EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
retval = OBJ_PROP(zobj, prop_offset);
if (EXPECTED(Z_TYPE_INFO_P(retval) != IS_UNDEF)) {
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
@@ -36144,7 +36104,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_W_SPEC_CV_CONST_HAND
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- property = EX_CONSTANT(opline->op2);
+ property = RT_CONSTANT(opline, opline->op2);
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
@@ -36167,7 +36127,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_RW_SPEC_CV_CONST_HAN
if (IS_CV == IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) {
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- property = EX_CONSTANT(opline->op2);
+ property = RT_CONSTANT(opline, opline->op2);
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
@@ -36192,7 +36152,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CONST_HAN
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- offset = EX_CONSTANT(opline->op2);
+ offset = RT_CONSTANT(opline, opline->op2);
if (IS_CV == IS_CONST ||
(IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) {
@@ -36215,7 +36175,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CONST_HAN
EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
retval = OBJ_PROP(zobj, prop_offset);
if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -36270,7 +36230,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_FUNC_ARG_SPEC_CV_CON
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
- property = EX_CONSTANT(opline->op2);
+ property = RT_CONSTANT(opline, opline->op2);
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1)) {
@@ -36296,7 +36256,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_CONST_
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- property = EX_CONSTANT(opline->op2);
+ property = RT_CONSTANT(opline, opline->op2);
zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, IS_CONST, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET);
@@ -36315,7 +36275,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_LIST_SPEC_CV_CONST_HANDL
SAVE_OPLINE();
container = _get_zval_ptr_cv_undef(opline->op1.var EXECUTE_DATA_CC);
- zend_fetch_dimension_address_read_LIST(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2) EXECUTE_DATA_CC);
+ zend_fetch_dimension_address_read_LIST(EX_VAR(opline->result.var), container, RT_CONSTANT(opline, opline->op2) EXECUTE_DATA_CC);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
@@ -36333,8 +36293,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DA
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- property = EX_CONSTANT(opline->op2);
- value = EX_CONSTANT((opline+1)->op1);
+ property = RT_CONSTANT(opline, opline->op2);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
do {
@@ -36348,7 +36308,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DA
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -36384,7 +36344,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DA
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -36491,7 +36451,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DA
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- property = EX_CONSTANT(opline->op2);
+ property = RT_CONSTANT(opline, opline->op2);
value = _get_zval_ptr_tmp((opline+1)->op1.var, &free_op_data EXECUTE_DATA_CC);
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
@@ -36506,7 +36466,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DA
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -36542,7 +36502,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DA
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -36649,7 +36609,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DA
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- property = EX_CONSTANT(opline->op2);
+ property = RT_CONSTANT(opline, opline->op2);
value = _get_zval_ptr_var((opline+1)->op1.var, &free_op_data EXECUTE_DATA_CC);
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
@@ -36664,7 +36624,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DA
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -36700,7 +36660,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DA
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -36807,7 +36767,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DA
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- property = EX_CONSTANT(opline->op2);
+ property = RT_CONSTANT(opline, opline->op2);
value = _get_zval_ptr_cv_BP_VAR_R((opline+1)->op1.var EXECUTE_DATA_CC);
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
@@ -36822,7 +36782,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DA
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -36858,7 +36818,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CONST_OP_DA
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -36975,7 +36935,7 @@ try_assign_dim_array:
goto assign_dim_error;
}
} else {
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
if (IS_CONST == IS_CONST) {
variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC);
} else {
@@ -36985,7 +36945,7 @@ try_assign_dim_array:
goto assign_dim_error;
}
}
- value = EX_CONSTANT((opline+1)->op1);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
value = zend_assign_to_variable(variable_ptr, value, IS_CONST);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
@@ -36998,8 +36958,8 @@ try_assign_dim_array:
}
}
if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) {
- dim = EX_CONSTANT(opline->op2);
- value = EX_CONSTANT((opline+1)->op1);
+ dim = RT_CONSTANT(opline, opline->op2);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
zend_assign_to_object_dim(object_ptr, dim, value);
@@ -37015,20 +36975,19 @@ try_assign_dim_array:
UNDEF_RESULT();
HANDLE_EXCEPTION();
} else {
- dim = EX_CONSTANT(opline->op2);
- value = EX_CONSTANT((opline+1)->op1);
+ dim = RT_CONSTANT(opline, opline->op2);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
zend_assign_to_string_offset(object_ptr, dim, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL) EXECUTE_DATA_CC);
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
goto try_assign_dim_array;
} else {
if (IS_CV != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
zend_error(E_WARNING, "Cannot use a scalar value as an array");
}
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
assign_dim_error:
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
@@ -37067,7 +37026,7 @@ try_assign_dim_array:
goto assign_dim_error;
}
} else {
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
if (IS_CONST == IS_CONST) {
variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC);
} else {
@@ -37090,7 +37049,7 @@ try_assign_dim_array:
}
}
if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) {
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
value = _get_zval_ptr_tmp((opline+1)->op1.var, &free_op_data EXECUTE_DATA_CC);
zend_assign_to_object_dim(object_ptr, dim, value);
@@ -37108,20 +37067,19 @@ try_assign_dim_array:
UNDEF_RESULT();
HANDLE_EXCEPTION();
} else {
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
value = _get_zval_ptr_tmp((opline+1)->op1.var, &free_op_data EXECUTE_DATA_CC);
zend_assign_to_string_offset(object_ptr, dim, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL) EXECUTE_DATA_CC);
zval_ptr_dtor_nogc(free_op_data);
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
goto try_assign_dim_array;
} else {
if (IS_CV != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
zend_error(E_WARNING, "Cannot use a scalar value as an array");
}
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
assign_dim_error:
zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var));
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
@@ -37160,7 +37118,7 @@ try_assign_dim_array:
goto assign_dim_error;
}
} else {
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
if (IS_CONST == IS_CONST) {
variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC);
} else {
@@ -37183,7 +37141,7 @@ try_assign_dim_array:
}
}
if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) {
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
value = _get_zval_ptr_var_deref((opline+1)->op1.var, &free_op_data EXECUTE_DATA_CC);
zend_assign_to_object_dim(object_ptr, dim, value);
@@ -37201,20 +37159,19 @@ try_assign_dim_array:
UNDEF_RESULT();
HANDLE_EXCEPTION();
} else {
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
value = _get_zval_ptr_var_deref((opline+1)->op1.var, &free_op_data EXECUTE_DATA_CC);
zend_assign_to_string_offset(object_ptr, dim, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL) EXECUTE_DATA_CC);
zval_ptr_dtor_nogc(free_op_data);
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
goto try_assign_dim_array;
} else {
if (IS_CV != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
zend_error(E_WARNING, "Cannot use a scalar value as an array");
}
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
assign_dim_error:
zval_ptr_dtor_nogc(EX_VAR((opline+1)->op1.var));
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
@@ -37253,7 +37210,7 @@ try_assign_dim_array:
goto assign_dim_error;
}
} else {
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
if (IS_CONST == IS_CONST) {
variable_ptr = zend_fetch_dimension_address_inner_W_CONST(Z_ARRVAL_P(object_ptr), dim EXECUTE_DATA_CC);
} else {
@@ -37276,7 +37233,7 @@ try_assign_dim_array:
}
}
if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) {
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
value = _get_zval_ptr_cv_deref_BP_VAR_R((opline+1)->op1.var EXECUTE_DATA_CC);
zend_assign_to_object_dim(object_ptr, dim, value);
@@ -37293,20 +37250,19 @@ try_assign_dim_array:
UNDEF_RESULT();
HANDLE_EXCEPTION();
} else {
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
value = _get_zval_ptr_cv_deref_BP_VAR_R((opline+1)->op1.var EXECUTE_DATA_CC);
zend_assign_to_string_offset(object_ptr, dim, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL) EXECUTE_DATA_CC);
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
goto try_assign_dim_array;
} else {
if (IS_CV != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
zend_error(E_WARNING, "Cannot use a scalar value as an array");
}
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
assign_dim_error:
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
@@ -37330,7 +37286,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CONST_RETVAL_UN
zval *variable_ptr;
SAVE_OPLINE();
- value = EX_CONSTANT(opline->op2);
+ value = RT_CONSTANT(opline, opline->op2);
variable_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(opline->op1.var EXECUTE_DATA_CC);
if (IS_CV == IS_VAR && UNEXPECTED(Z_ISERROR_P(variable_ptr))) {
@@ -37358,7 +37314,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_SPEC_CV_CONST_RETVAL_US
zval *variable_ptr;
SAVE_OPLINE();
- value = EX_CONSTANT(opline->op2);
+ value = RT_CONSTANT(opline, opline->op2);
variable_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(opline->op1.var EXECUTE_DATA_CC);
if (IS_CV == IS_VAR && UNEXPECTED(Z_ISERROR_P(variable_ptr))) {
@@ -37387,7 +37343,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FAST_CONCAT_SPEC_CV_CONST_HAND
op1 = _get_zval_ptr_cv_undef(opline->op1.var EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
if ((IS_CV == IS_CONST || EXPECTED(Z_TYPE_P(op1) == IS_STRING)) &&
(IS_CONST == IS_CONST || EXPECTED(Z_TYPE_P(op2) == IS_STRING))) {
zend_string *op1_str = Z_STR_P(op1);
@@ -37507,7 +37463,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CONST
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- function_name = EX_CONSTANT(opline->op2);
+ function_name = RT_CONSTANT(opline, opline->op2);
if (IS_CONST != IS_CONST &&
UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
@@ -37572,7 +37528,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CONST
}
/* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL));
if (UNEXPECTED(fbc == NULL)) {
if (EXPECTED(!EG(exception))) {
zend_throw_error(NULL, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name));
@@ -37621,7 +37577,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_SPEC_CV_CONST_HANDLER(ZEN
zval *op1, *op2, *result;
op1 = _get_zval_ptr_cv_undef(opline->op1.var EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
do {
int result;
@@ -37724,7 +37680,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CV_CONS
if (IS_CONST != IS_UNUSED) {
- zval *offset = EX_CONSTANT(opline->op2);
+ zval *offset = RT_CONSTANT(opline, opline->op2);
zend_string *str;
zend_ulong hval;
@@ -37763,13 +37719,13 @@ num_index:
goto str_index;
} else {
zend_error(E_WARNING, "Illegal offset type");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
} else {
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -37787,8 +37743,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CV_CONST_HANDL
} else {
size = 0;
}
- ZVAL_NEW_ARR(array);
- zend_hash_init(Z_ARRVAL_P(array), size, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(array, zend_new_array(size));
if (IS_CV != IS_UNUSED) {
/* Explicitly initialize array as not-packed if flag is set */
@@ -37821,9 +37776,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_STATIC_PROP_SPEC_CV_CONS
}
if (IS_CONST == IS_CONST) {
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)), RT_CONSTANT(opline, opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
if (IS_CV != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
@@ -37832,7 +37787,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_STATIC_PROP_SPEC_CV_CONS
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), ce);
}
} else if (IS_CONST == IS_UNUSED) {
ce = zend_fetch_class(NULL, opline->op2.num);
@@ -37867,7 +37822,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLE
SAVE_OPLINE();
container = _get_zval_ptr_cv_undef_BP_VAR_UNSET(opline->op1.var EXECUTE_DATA_CC);
- offset = EX_CONSTANT(opline->op2);
+ offset = RT_CONSTANT(opline, opline->op2);
do {
if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
@@ -37959,7 +37914,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_CONST_HANDLE
if (IS_CV == IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) {
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- offset = EX_CONSTANT(opline->op2);
+ offset = RT_CONSTANT(opline, opline->op2);
do {
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
@@ -38003,8 +37958,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
}
if (IS_CONST == IS_CONST) {
- if (IS_CV == IS_CONST && EXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) != NULL)) {
- value = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)) + sizeof(void*));
+ if (IS_CV == IS_CONST && EXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)))) != NULL)) {
+ value = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)) + sizeof(void*));
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
@@ -38012,14 +37967,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
}
goto is_static_prop_return;
- } else if (UNEXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ } else if (UNEXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)))) == NULL)) {
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)), RT_CONSTANT(opline, opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), ce);
}
} else {
if (IS_CONST == IS_UNUSED) {
@@ -38037,9 +37992,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
if (IS_CV == IS_CONST &&
- EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1))) == ce)) {
+ EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1))) == ce)) {
- value = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)) + sizeof(void*));
+ value = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)) + sizeof(void*));
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
@@ -38053,7 +38008,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
value = zend_std_get_static_property(ce, Z_STR_P(varname), 1);
if (IS_CV == IS_CONST && value) {
- CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, value);
+ CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), ce, value);
}
if (IS_CV != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
@@ -38084,7 +38039,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_
SAVE_OPLINE();
container = _get_zval_ptr_cv_undef(opline->op1.var EXECUTE_DATA_CC);
- offset = EX_CONSTANT(opline->op2);
+ offset = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
HashTable *ht;
@@ -38220,7 +38175,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- offset = EX_CONSTANT(opline->op2);
+ offset = RT_CONSTANT(opline, opline->op2);
if (IS_CV == IS_CONST ||
(IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) {
@@ -38266,11 +38221,11 @@ try_instanceof:
zend_class_entry *ce;
if (IS_CONST == IS_CONST) {
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)), RT_CONSTANT(opline, opline->op2) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD);
if (EXPECTED(ce)) {
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), ce);
}
}
} else if (IS_CONST == IS_UNUSED) {
@@ -38385,7 +38340,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_YIELD_SPEC_CV_CONST_HANDLER(ZE
/* Set the new yielded key */
if (IS_CONST != IS_UNUSED) {
- zval *key = EX_CONSTANT(opline->op2);
+ zval *key = RT_CONSTANT(opline, opline->op2);
/* Consts, temporary variables and references need copying */
if (IS_CONST == IS_CONST) {
@@ -38448,7 +38403,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BIND_GLOBAL_SPEC_C
ZEND_VM_REPEATABLE_OPCODE
- varname = EX_CONSTANT(opline->op2);
+ varname = RT_CONSTANT(opline, opline->op2);
/* We store "hash slot index" + 1 (NULL is a mark of uninitialized cache slot) */
idx = (uint32_t)(uintptr_t)CACHED_PTR(Z_CACHE_SLOT_P(varname)) - 1;
@@ -38545,11 +38500,11 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BIND_STATIC_SPEC_CV_CONST_HAND
EX(func)->op_array.static_variables = ht = zend_array_dup(ht);
}
- varname = EX_CONSTANT(opline->op2);
+ varname = RT_CONSTANT(opline, opline->op2);
value = zend_hash_find(ht, Z_STR_P(varname));
if (opline->extended_value) {
- if (Z_CONSTANT_P(value)) {
+ if (Z_TYPE_P(value) == IS_CONSTANT_AST) {
SAVE_OPLINE();
if (UNEXPECTED(zval_update_constant_ex(value, EX(func)->op_array.scope) != SUCCESS)) {
ZVAL_NULL(variable_ptr);
@@ -38583,7 +38538,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SWITCH_LONG_SPEC_CV_CONST_HAND
HashTable *jumptable;
op = _get_zval_ptr_cv_undef(opline->op1.var EXECUTE_DATA_CC);
- jumptable = Z_ARRVAL_P(EX_CONSTANT(opline->op2));
+ jumptable = Z_ARRVAL_P(RT_CONSTANT(opline, opline->op2));
if (Z_TYPE_P(op) != IS_LONG) {
ZVAL_DEREF(op);
@@ -38612,7 +38567,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SWITCH_STRING_SPEC_CV_CONST_HA
HashTable *jumptable;
op = _get_zval_ptr_cv_undef(opline->op1.var EXECUTE_DATA_CC);
- jumptable = Z_ARRVAL_P(EX_CONSTANT(opline->op2));
+ jumptable = Z_ARRVAL_P(RT_CONSTANT(opline, opline->op2));
if (Z_TYPE_P(op) != IS_STRING) {
ZVAL_DEREF(op);
@@ -38638,7 +38593,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IN_ARRAY_SPEC_CV_CONST_HANDLER
USE_OPLINE
zval *op1;
- HashTable *ht = Z_ARRVAL_P(EX_CONSTANT(opline->op2));
+ HashTable *ht = Z_ARRVAL_P(RT_CONSTANT(opline, opline->op2));
int result;
SAVE_OPLINE();
@@ -38681,7 +38636,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_R_INDEX_
zend_long offset;
container = _get_zval_ptr_cv_undef(opline->op1.var EXECUTE_DATA_CC);
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
fetch_dim_r_index_array:
if (EXPECTED(Z_TYPE_P(dim) == IS_LONG)) {
@@ -38995,7 +38950,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
SAVE_OPLINE();
varname = _get_zval_ptr_cv_undef(opline->op1.var EXECUTE_DATA_CC);
- retval = zend_fetch_static_property_address(varname, IS_CV, opline->op2, IS_VAR, type EXECUTE_DATA_CC);
+ retval = zend_fetch_static_property_address(varname, IS_CV, opline->op2, IS_VAR, type EXECUTE_DATA_CC OPLINE_CC);
if (UNEXPECTED(retval == NULL)) {
if (EG(exception)) {
@@ -39186,9 +39141,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_STATIC_PROP_SPEC_CV_VAR_
}
if (IS_VAR == IS_CONST) {
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)), RT_CONSTANT(opline, opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
if (IS_CV != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
@@ -39197,7 +39152,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_STATIC_PROP_SPEC_CV_VAR_
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), ce);
}
} else if (IS_VAR == IS_UNUSED) {
ce = zend_fetch_class(NULL, opline->op2.num);
@@ -39239,8 +39194,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
}
if (IS_VAR == IS_CONST) {
- if (IS_CV == IS_CONST && EXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) != NULL)) {
- value = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)) + sizeof(void*));
+ if (IS_CV == IS_CONST && EXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)))) != NULL)) {
+ value = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)) + sizeof(void*));
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
@@ -39248,14 +39203,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
}
goto is_static_prop_return;
- } else if (UNEXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ } else if (UNEXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)))) == NULL)) {
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)), RT_CONSTANT(opline, opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), ce);
}
} else {
if (IS_VAR == IS_UNUSED) {
@@ -39273,9 +39228,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
if (IS_CV == IS_CONST &&
- EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1))) == ce)) {
+ EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1))) == ce)) {
- value = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)) + sizeof(void*));
+ value = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)) + sizeof(void*));
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
@@ -39289,7 +39244,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
value = zend_std_get_static_property(ce, Z_STR_P(varname), 1);
if (IS_CV == IS_CONST && value) {
- CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, value);
+ CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), ce, value);
}
if (IS_CV != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
@@ -39324,11 +39279,11 @@ try_instanceof:
zend_class_entry *ce;
if (IS_VAR == IS_CONST) {
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)), RT_CONSTANT(opline, opline->op2) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD);
if (EXPECTED(ce)) {
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), ce);
}
}
} else if (IS_VAR == IS_UNUSED) {
@@ -39529,7 +39484,7 @@ assign_dim_op_new_array:
SEPARATE_ZVAL_NOREF(var_ptr);
}
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
binary_op(var_ptr, var_ptr, value);
@@ -39545,15 +39500,14 @@ assign_dim_op_new_array:
} else if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
container = GET_OP1_UNDEF_CV(container, BP_VAR_RW);
assign_dim_op_convert_to_array:
- ZVAL_NEW_ARR(container);
- zend_hash_init(Z_ARRVAL_P(container), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(container, zend_new_array(8));
goto assign_dim_op_new_array;
}
dim = NULL;
if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op EXECUTE_DATA_CC);
} else {
if (UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) {
@@ -39575,7 +39529,7 @@ assign_dim_op_ret_null:
ZVAL_NULL(EX_VAR(opline->result.var));
}
}
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
}
}
@@ -39836,7 +39790,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
SAVE_OPLINE();
varname = _get_zval_ptr_cv_undef(opline->op1.var EXECUTE_DATA_CC);
- retval = zend_fetch_static_property_address(varname, IS_CV, opline->op2, IS_UNUSED, type EXECUTE_DATA_CC);
+ retval = zend_fetch_static_property_address(varname, IS_CV, opline->op2, IS_UNUSED, type EXECUTE_DATA_CC OPLINE_CC);
if (UNEXPECTED(retval == NULL)) {
if (EG(exception)) {
@@ -40001,7 +39955,7 @@ try_assign_dim_array:
goto assign_dim_error;
}
}
- value = EX_CONSTANT((opline+1)->op1);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
value = zend_assign_to_variable(variable_ptr, value, IS_CONST);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
@@ -40015,7 +39969,7 @@ try_assign_dim_array:
}
if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) {
dim = NULL;
- value = EX_CONSTANT((opline+1)->op1);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
zend_assign_to_object_dim(object_ptr, dim, value);
@@ -40032,13 +39986,12 @@ try_assign_dim_array:
HANDLE_EXCEPTION();
} else {
dim = NULL;
- value = EX_CONSTANT((opline+1)->op1);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
zend_assign_to_string_offset(object_ptr, dim, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL) EXECUTE_DATA_CC);
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
goto try_assign_dim_array;
} else {
if (IS_CV != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
@@ -40130,8 +40083,7 @@ try_assign_dim_array:
zval_ptr_dtor_nogc(free_op_data);
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
goto try_assign_dim_array;
} else {
if (IS_CV != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
@@ -40223,8 +40175,7 @@ try_assign_dim_array:
zval_ptr_dtor_nogc(free_op_data);
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
goto try_assign_dim_array;
} else {
if (IS_CV != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
@@ -40315,8 +40266,7 @@ try_assign_dim_array:
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
goto try_assign_dim_array;
} else {
if (IS_CV != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
@@ -40471,13 +40421,13 @@ num_index:
goto str_index;
} else {
zend_error(E_WARNING, "Illegal offset type");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
} else {
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -40495,8 +40445,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CV_UNUSED_HAND
} else {
size = 0;
}
- ZVAL_NEW_ARR(array);
- zend_hash_init(Z_ARRVAL_P(array), size, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(array, zend_new_array(size));
if (IS_CV != IS_UNUSED) {
/* Explicitly initialize array as not-packed if flag is set */
@@ -40581,9 +40530,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_STATIC_PROP_SPEC_CV_UNUS
}
if (IS_UNUSED == IS_CONST) {
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)), RT_CONSTANT(opline, opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
if (IS_CV != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
@@ -40592,7 +40541,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_STATIC_PROP_SPEC_CV_UNUS
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), ce);
}
} else if (IS_UNUSED == IS_UNUSED) {
ce = zend_fetch_class(NULL, opline->op2.num);
@@ -40695,8 +40644,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
}
if (IS_UNUSED == IS_CONST) {
- if (IS_CV == IS_CONST && EXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) != NULL)) {
- value = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)) + sizeof(void*));
+ if (IS_CV == IS_CONST && EXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)))) != NULL)) {
+ value = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)) + sizeof(void*));
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
@@ -40704,14 +40653,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
}
goto is_static_prop_return;
- } else if (UNEXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ } else if (UNEXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)))) == NULL)) {
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)), RT_CONSTANT(opline, opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), ce);
}
} else {
if (IS_UNUSED == IS_UNUSED) {
@@ -40729,9 +40678,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
if (IS_CV == IS_CONST &&
- EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1))) == ce)) {
+ EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1))) == ce)) {
- value = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)) + sizeof(void*));
+ value = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)) + sizeof(void*));
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
@@ -40745,7 +40694,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
value = zend_std_get_static_property(ce, Z_STR_P(varname), 1);
if (IS_CV == IS_CONST && value) {
- CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, value);
+ CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), ce, value);
}
if (IS_CV != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
@@ -40780,11 +40729,11 @@ try_instanceof:
zend_class_entry *ce;
if (IS_UNUSED == IS_CONST) {
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)), RT_CONSTANT(opline, opline->op2) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD);
if (EXPECTED(ce)) {
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), ce);
}
}
} else if (IS_UNUSED == IS_UNUSED) {
@@ -41810,7 +41759,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP
property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
do {
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
ZVAL_DEREF(object);
@@ -41888,7 +41837,7 @@ assign_dim_op_new_array:
SEPARATE_ZVAL_NOREF(var_ptr);
}
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
binary_op(var_ptr, var_ptr, value);
@@ -41904,15 +41853,14 @@ assign_dim_op_new_array:
} else if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
container = GET_OP1_UNDEF_CV(container, BP_VAR_RW);
assign_dim_op_convert_to_array:
- ZVAL_NEW_ARR(container);
- zend_hash_init(Z_ARRVAL_P(container), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(container, zend_new_array(8));
goto assign_dim_op_new_array;
}
dim = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op EXECUTE_DATA_CC);
} else {
if (UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) {
@@ -41934,7 +41882,7 @@ assign_dim_op_ret_null:
ZVAL_NULL(EX_VAR(opline->result.var));
}
}
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
}
}
@@ -42545,7 +42493,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_CV_HANDLER
EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
retval = OBJ_PROP(zobj, prop_offset);
if (EXPECTED(Z_TYPE_INFO_P(retval) != IS_UNDEF)) {
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
@@ -42665,7 +42613,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CV_HANDLE
EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
retval = OBJ_PROP(zobj, prop_offset);
if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -42784,7 +42732,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_
}
property = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
- value = EX_CONSTANT((opline+1)->op1);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
do {
@@ -42798,7 +42746,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -42834,7 +42782,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -42956,7 +42904,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -42992,7 +42940,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -43114,7 +43062,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -43150,7 +43098,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -43272,7 +43220,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -43308,7 +43256,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CV_OP_DATA_
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -43435,7 +43383,7 @@ try_assign_dim_array:
goto assign_dim_error;
}
}
- value = EX_CONSTANT((opline+1)->op1);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
value = zend_assign_to_variable(variable_ptr, value, IS_CONST);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
@@ -43449,7 +43397,7 @@ try_assign_dim_array:
}
if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) {
dim = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
- value = EX_CONSTANT((opline+1)->op1);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
zend_assign_to_object_dim(object_ptr, dim, value);
@@ -43466,13 +43414,12 @@ try_assign_dim_array:
HANDLE_EXCEPTION();
} else {
dim = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
- value = EX_CONSTANT((opline+1)->op1);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
zend_assign_to_string_offset(object_ptr, dim, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL) EXECUTE_DATA_CC);
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
goto try_assign_dim_array;
} else {
if (IS_CV != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
@@ -43564,8 +43511,7 @@ try_assign_dim_array:
zval_ptr_dtor_nogc(free_op_data);
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
goto try_assign_dim_array;
} else {
if (IS_CV != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
@@ -43657,8 +43603,7 @@ try_assign_dim_array:
zval_ptr_dtor_nogc(free_op_data);
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
goto try_assign_dim_array;
} else {
if (IS_CV != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
@@ -43749,8 +43694,7 @@ try_assign_dim_array:
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
goto try_assign_dim_array;
} else {
if (IS_CV != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
@@ -44078,7 +44022,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HA
}
/* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL));
if (UNEXPECTED(fbc == NULL)) {
if (EXPECTED(!EG(exception))) {
zend_throw_error(NULL, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name));
@@ -44269,13 +44213,13 @@ num_index:
goto str_index;
} else {
zend_error(E_WARNING, "Illegal offset type");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
} else {
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -44293,8 +44237,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CV_CV_HANDLER(
} else {
size = 0;
}
- ZVAL_NEW_ARR(array);
- zend_hash_init(Z_ARRVAL_P(array), size, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(array, zend_new_array(size));
if (IS_CV != IS_UNUSED) {
/* Explicitly initialize array as not-packed if flag is set */
@@ -45484,7 +45427,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP
property = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
do {
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
ZVAL_DEREF(object);
@@ -45562,7 +45505,7 @@ assign_dim_op_new_array:
SEPARATE_ZVAL_NOREF(var_ptr);
}
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
binary_op(var_ptr, var_ptr, value);
@@ -45578,15 +45521,14 @@ assign_dim_op_new_array:
} else if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
container = GET_OP1_UNDEF_CV(container, BP_VAR_RW);
assign_dim_op_convert_to_array:
- ZVAL_NEW_ARR(container);
- zend_hash_init(Z_ARRVAL_P(container), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(container, zend_new_array(8));
goto assign_dim_op_new_array;
}
dim = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
zend_binary_assign_op_obj_dim(container, dim, value, UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL, binary_op EXECUTE_DATA_CC);
} else {
if (UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) {
@@ -45608,7 +45550,7 @@ assign_dim_op_ret_null:
ZVAL_NULL(EX_VAR(opline->result.var));
}
}
- value = get_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
+ value = get_op_data_zval_ptr_r((opline+1)->op1_type, (opline+1)->op1, &free_op_data1);
}
}
@@ -46223,7 +46165,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_TMPVAR_HAN
EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
retval = OBJ_PROP(zobj, prop_offset);
if (EXPECTED(Z_TYPE_INFO_P(retval) != IS_UNDEF)) {
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
@@ -46344,7 +46286,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_TMPVAR_HA
EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
retval = OBJ_PROP(zobj, prop_offset);
if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -46464,7 +46406,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_D
}
property = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
- value = EX_CONSTANT((opline+1)->op1);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
do {
@@ -46478,7 +46420,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_D
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -46514,7 +46456,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_D
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -46636,7 +46578,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_D
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -46672,7 +46614,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_D
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -46794,7 +46736,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_D
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -46830,7 +46772,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_D
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -46952,7 +46894,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_D
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
zend_object *obj;
- zval_ptr_dtor(object);
+ zval_ptr_dtor_nogc(object);
object_init(object);
Z_ADDREF_P(object);
obj = Z_OBJ_P(object);
@@ -46988,7 +46930,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_OP_D
zend_object *zobj = Z_OBJ_P(object);
zval *property_val;
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
property_val = OBJ_PROP(zobj, prop_offset);
if (Z_TYPE_P(property_val) != IS_UNDEF) {
fast_assign_obj:
@@ -47115,7 +47057,7 @@ try_assign_dim_array:
goto assign_dim_error;
}
}
- value = EX_CONSTANT((opline+1)->op1);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
value = zend_assign_to_variable(variable_ptr, value, IS_CONST);
if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
ZVAL_COPY(EX_VAR(opline->result.var), value);
@@ -47129,7 +47071,7 @@ try_assign_dim_array:
}
if (EXPECTED(Z_TYPE_P(object_ptr) == IS_OBJECT)) {
dim = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
- value = EX_CONSTANT((opline+1)->op1);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
zend_assign_to_object_dim(object_ptr, dim, value);
@@ -47146,13 +47088,12 @@ try_assign_dim_array:
HANDLE_EXCEPTION();
} else {
dim = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
- value = EX_CONSTANT((opline+1)->op1);
+ value = RT_CONSTANT((opline+1), (opline+1)->op1);
zend_assign_to_string_offset(object_ptr, dim, value, (UNEXPECTED(RETURN_VALUE_USED(opline)) ? EX_VAR(opline->result.var) : NULL) EXECUTE_DATA_CC);
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
goto try_assign_dim_array;
} else {
if (IS_CV != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
@@ -47244,8 +47185,7 @@ try_assign_dim_array:
zval_ptr_dtor_nogc(free_op_data);
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
goto try_assign_dim_array;
} else {
if (IS_CV != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
@@ -47337,8 +47277,7 @@ try_assign_dim_array:
zval_ptr_dtor_nogc(free_op_data);
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
goto try_assign_dim_array;
} else {
if (IS_CV != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
@@ -47429,8 +47368,7 @@ try_assign_dim_array:
}
} else if (EXPECTED(Z_TYPE_P(object_ptr) <= IS_FALSE)) {
- ZVAL_NEW_ARR(object_ptr);
- zend_hash_init(Z_ARRVAL_P(object_ptr), 8, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(object_ptr, zend_new_array(8));
goto try_assign_dim_array;
} else {
if (IS_CV != IS_VAR || EXPECTED(!Z_ISERROR_P(object_ptr))) {
@@ -47646,7 +47584,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_TMPVA
}
/* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL));
if (UNEXPECTED(fbc == NULL)) {
if (EXPECTED(!EG(exception))) {
zend_throw_error(NULL, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name));
@@ -47838,13 +47776,13 @@ num_index:
goto str_index;
} else {
zend_error(E_WARNING, "Illegal offset type");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
zval_ptr_dtor_nogc(free_op2);
} else {
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
- zval_ptr_dtor(expr_ptr);
+ zval_ptr_dtor_nogc(expr_ptr);
}
}
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -47862,8 +47800,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CV_TMPVAR_HAND
} else {
size = 0;
}
- ZVAL_NEW_ARR(array);
- zend_hash_init(Z_ARRVAL_P(array), size, NULL, ZVAL_PTR_DTOR, 0);
+ ZVAL_ARR(array, zend_new_array(size));
if (IS_CV != IS_UNUSED) {
/* Explicitly initialize array as not-packed if flag is set */
@@ -48772,7 +48709,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ADD_SPEC_TMPVAR_CONST_HANDLER(
zval *op1, *op2, *result;
op1 = _get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
result = EX_VAR(opline->result.var);
@@ -48815,7 +48752,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_SPEC_TMPVAR_CONST_HANDLER(
zval *op1, *op2, *result;
op1 = _get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
result = EX_VAR(opline->result.var);
@@ -48858,7 +48795,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MUL_SPEC_TMPVAR_CONST_HANDLER(
zval *op1, *op2, *result;
op1 = _get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
zend_long overflow;
@@ -48905,7 +48842,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DIV_SPEC_TMPVAR_CONST_HANDLER(
SAVE_OPLINE();
op1 = _get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
fast_div_function(EX_VAR(opline->result.var), op1, op2);
zval_ptr_dtor_nogc(free_op1);
@@ -48919,7 +48856,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_MOD_SPEC_TMPVAR_CONST_HANDLER(
zval *op1, *op2, *result;
op1 = _get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
result = EX_VAR(opline->result.var);
@@ -48958,7 +48895,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SL_SPEC_TMPVAR_CONST_HANDLER(Z
zval *op1, *op2;
op1 = _get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)
&& EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)
&& EXPECTED((zend_ulong)Z_LVAL_P(op2) < SIZEOF_ZEND_LONG * 8)) {
@@ -48986,7 +48923,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SR_SPEC_TMPVAR_CONST_HANDLER(Z
zval *op1, *op2;
op1 = _get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)
&& EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)
&& EXPECTED((zend_ulong)Z_LVAL_P(op2) < SIZEOF_ZEND_LONG * 8)) {
@@ -49015,7 +48952,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_POW_SPEC_TMPVAR_CONST_HANDLER(
SAVE_OPLINE();
op1 = _get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
pow_function(EX_VAR(opline->result.var), op1, op2);
zval_ptr_dtor_nogc(free_op1);
@@ -49029,7 +48966,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CONCAT_SPEC_TMPVAR_CONST_HANDL
zval *op1, *op2;
op1 = _get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
if (((IS_TMP_VAR|IS_VAR) == IS_CONST || EXPECTED(Z_TYPE_P(op1) == IS_STRING)) &&
(IS_CONST == IS_CONST || EXPECTED(Z_TYPE_P(op2) == IS_STRING))) {
@@ -49093,7 +49030,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_HAN
zval *op1, *op2, *result;
op1 = _get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
do {
int result;
@@ -49161,7 +49098,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST
zval *op1, *op2, *result;
op1 = _get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
do {
int result;
@@ -49229,7 +49166,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_TMPVAR_CONST_H
zval *op1, *op2, *result;
op1 = _get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
do {
int result;
@@ -49279,7 +49216,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_TMPVA
zval *op1, *op2, *result;
op1 = _get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
do {
int result;
@@ -49330,7 +49267,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SPACESHIP_SPEC_TMPVAR_CONST_HA
SAVE_OPLINE();
op1 = _get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
compare_function(EX_VAR(opline->result.var), op1, op2);
zval_ptr_dtor_nogc(free_op1);
@@ -49344,7 +49281,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_OR_SPEC_TMPVAR_CONST_HANDLE
zval *op1, *op2;
op1 = _get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)
&& EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(op1) | Z_LVAL_P(op2));
@@ -49371,7 +49308,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_AND_SPEC_TMPVAR_CONST_HANDL
zval *op1, *op2;
op1 = _get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)
&& EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(op1) & Z_LVAL_P(op2));
@@ -49398,7 +49335,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BW_XOR_SPEC_TMPVAR_CONST_HANDL
zval *op1, *op2;
op1 = _get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)
&& EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(op1) ^ Z_LVAL_P(op2));
@@ -49426,7 +49363,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BOOL_XOR_SPEC_TMPVAR_CONST_HAN
SAVE_OPLINE();
op1 = _get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
boolean_xor_function(EX_VAR(opline->result.var), op1, op2);
zval_ptr_dtor_nogc(free_op1);
@@ -49443,7 +49380,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
SAVE_OPLINE();
varname = _get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- retval = zend_fetch_static_property_address(varname, (IS_TMP_VAR|IS_VAR), opline->op2, IS_CONST, type EXECUTE_DATA_CC);
+ retval = zend_fetch_static_property_address(varname, (IS_TMP_VAR|IS_VAR), opline->op2, IS_CONST, type EXECUTE_DATA_CC OPLINE_CC);
if (UNEXPECTED(retval == NULL)) {
if (EG(exception)) {
@@ -49510,7 +49447,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_TMPVAR_CONST_
SAVE_OPLINE();
container = _get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
fetch_dim_r_array:
@@ -49546,7 +49483,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_TMPVAR_CONST
SAVE_OPLINE();
container = _get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2), IS_CONST EXECUTE_DATA_CC);
+ zend_fetch_dimension_address_read_IS(EX_VAR(opline->result.var), container, RT_CONSTANT(opline, opline->op2), IS_CONST EXECUTE_DATA_CC);
zval_ptr_dtor_nogc(free_op1);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -49567,7 +49504,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CONST
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- offset = EX_CONSTANT(opline->op2);
+ offset = RT_CONSTANT(opline, opline->op2);
if ((IS_TMP_VAR|IS_VAR) == IS_CONST ||
((IS_TMP_VAR|IS_VAR) != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) {
@@ -49590,7 +49527,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CONST
EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
retval = OBJ_PROP(zobj, prop_offset);
if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -49630,7 +49567,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_LIST_SPEC_TMPVAR_CONST_H
SAVE_OPLINE();
container = _get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- zend_fetch_dimension_address_read_LIST(EX_VAR(opline->result.var), container, EX_CONSTANT(opline->op2) EXECUTE_DATA_CC);
+ zend_fetch_dimension_address_read_LIST(EX_VAR(opline->result.var), container, RT_CONSTANT(opline, opline->op2) EXECUTE_DATA_CC);
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
}
@@ -49644,7 +49581,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FAST_CONCAT_SPEC_TMPVAR_CONST_
op1 = _get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
if (((IS_TMP_VAR|IS_VAR) == IS_CONST || EXPECTED(Z_TYPE_P(op1) == IS_STRING)) &&
(IS_CONST == IS_CONST || EXPECTED(Z_TYPE_P(op2) == IS_STRING))) {
zend_string *op1_str = Z_STR_P(op1);
@@ -49764,7 +49701,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_C
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- function_name = EX_CONSTANT(opline->op2);
+ function_name = RT_CONSTANT(opline, opline->op2);
if (IS_CONST != IS_CONST &&
UNEXPECTED(Z_TYPE_P(function_name) != IS_STRING)) {
@@ -49829,7 +49766,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_C
}
/* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL));
if (UNEXPECTED(fbc == NULL)) {
if (EXPECTED(!EG(exception))) {
zend_throw_error(NULL, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name));
@@ -49879,7 +49816,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CASE_SPEC_TMPVAR_CONST_HANDLER
zval *op1, *op2, *result;
op1 = _get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
do {
int result;
@@ -49959,9 +49896,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_STATIC_PROP_SPEC_TMPVAR_
}
if (IS_CONST == IS_CONST) {
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)), RT_CONSTANT(opline, opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
if ((IS_TMP_VAR|IS_VAR) != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
@@ -49970,7 +49907,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_STATIC_PROP_SPEC_TMPVAR_
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), ce);
}
} else if (IS_CONST == IS_UNUSED) {
ce = zend_fetch_class(NULL, opline->op2.num);
@@ -50012,8 +49949,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
}
if (IS_CONST == IS_CONST) {
- if ((IS_TMP_VAR|IS_VAR) == IS_CONST && EXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) != NULL)) {
- value = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)) + sizeof(void*));
+ if ((IS_TMP_VAR|IS_VAR) == IS_CONST && EXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)))) != NULL)) {
+ value = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)) + sizeof(void*));
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
@@ -50021,14 +49958,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
}
goto is_static_prop_return;
- } else if (UNEXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ } else if (UNEXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)))) == NULL)) {
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)), RT_CONSTANT(opline, opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), ce);
}
} else {
if (IS_CONST == IS_UNUSED) {
@@ -50046,9 +49983,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
if ((IS_TMP_VAR|IS_VAR) == IS_CONST &&
- EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1))) == ce)) {
+ EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1))) == ce)) {
- value = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)) + sizeof(void*));
+ value = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)) + sizeof(void*));
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
@@ -50062,7 +49999,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
value = zend_std_get_static_property(ce, Z_STR_P(varname), 1);
if ((IS_TMP_VAR|IS_VAR) == IS_CONST && value) {
- CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, value);
+ CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), ce, value);
}
if ((IS_TMP_VAR|IS_VAR) != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
@@ -50094,7 +50031,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMP
SAVE_OPLINE();
container = _get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- offset = EX_CONSTANT(opline->op2);
+ offset = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
HashTable *ht;
@@ -50230,7 +50167,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TM
ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
}
- offset = EX_CONSTANT(opline->op2);
+ offset = RT_CONSTANT(opline, opline->op2);
if ((IS_TMP_VAR|IS_VAR) == IS_CONST ||
((IS_TMP_VAR|IS_VAR) != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT))) {
@@ -50276,11 +50213,11 @@ try_instanceof:
zend_class_entry *ce;
if (IS_CONST == IS_CONST) {
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)), RT_CONSTANT(opline, opline->op2) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD);
if (EXPECTED(ce)) {
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), ce);
}
}
} else if (IS_CONST == IS_UNUSED) {
@@ -50318,7 +50255,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SWITCH_LONG_SPEC_TMPVAR_CONST_
HashTable *jumptable;
op = _get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- jumptable = Z_ARRVAL_P(EX_CONSTANT(opline->op2));
+ jumptable = Z_ARRVAL_P(RT_CONSTANT(opline, opline->op2));
if (Z_TYPE_P(op) != IS_LONG) {
ZVAL_DEREF(op);
@@ -50347,7 +50284,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SWITCH_STRING_SPEC_TMPVAR_CONS
HashTable *jumptable;
op = _get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- jumptable = Z_ARRVAL_P(EX_CONSTANT(opline->op2));
+ jumptable = Z_ARRVAL_P(RT_CONSTANT(opline, opline->op2));
if (Z_TYPE_P(op) != IS_STRING) {
ZVAL_DEREF(op);
@@ -50376,7 +50313,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_DIM_R_INDEX_
zend_long offset;
container = _get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- dim = EX_CONSTANT(opline->op2);
+ dim = RT_CONSTANT(opline, opline->op2);
if (EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
fetch_dim_r_index_array:
if (EXPECTED(Z_TYPE_P(dim) == IS_LONG)) {
@@ -50426,7 +50363,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
SAVE_OPLINE();
varname = _get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- retval = zend_fetch_static_property_address(varname, (IS_TMP_VAR|IS_VAR), opline->op2, IS_VAR, type EXECUTE_DATA_CC);
+ retval = zend_fetch_static_property_address(varname, (IS_TMP_VAR|IS_VAR), opline->op2, IS_VAR, type EXECUTE_DATA_CC OPLINE_CC);
if (UNEXPECTED(retval == NULL)) {
if (EG(exception)) {
@@ -50506,9 +50443,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_STATIC_PROP_SPEC_TMPVAR_
}
if (IS_VAR == IS_CONST) {
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)), RT_CONSTANT(opline, opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
if ((IS_TMP_VAR|IS_VAR) != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
@@ -50517,7 +50454,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_STATIC_PROP_SPEC_TMPVAR_
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), ce);
}
} else if (IS_VAR == IS_UNUSED) {
ce = zend_fetch_class(NULL, opline->op2.num);
@@ -50559,8 +50496,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
}
if (IS_VAR == IS_CONST) {
- if ((IS_TMP_VAR|IS_VAR) == IS_CONST && EXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) != NULL)) {
- value = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)) + sizeof(void*));
+ if ((IS_TMP_VAR|IS_VAR) == IS_CONST && EXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)))) != NULL)) {
+ value = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)) + sizeof(void*));
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
@@ -50568,14 +50505,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
}
goto is_static_prop_return;
- } else if (UNEXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ } else if (UNEXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)))) == NULL)) {
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)), RT_CONSTANT(opline, opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), ce);
}
} else {
if (IS_VAR == IS_UNUSED) {
@@ -50593,9 +50530,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
if ((IS_TMP_VAR|IS_VAR) == IS_CONST &&
- EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1))) == ce)) {
+ EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1))) == ce)) {
- value = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)) + sizeof(void*));
+ value = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)) + sizeof(void*));
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
@@ -50609,7 +50546,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
value = zend_std_get_static_property(ce, Z_STR_P(varname), 1);
if ((IS_TMP_VAR|IS_VAR) == IS_CONST && value) {
- CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, value);
+ CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), ce, value);
}
if ((IS_TMP_VAR|IS_VAR) != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
@@ -50645,11 +50582,11 @@ try_instanceof:
zend_class_entry *ce;
if (IS_VAR == IS_CONST) {
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)), RT_CONSTANT(opline, opline->op2) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD);
if (EXPECTED(ce)) {
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), ce);
}
}
} else if (IS_VAR == IS_UNUSED) {
@@ -50851,7 +50788,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
SAVE_OPLINE();
varname = _get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC);
- retval = zend_fetch_static_property_address(varname, (IS_TMP_VAR|IS_VAR), opline->op2, IS_UNUSED, type EXECUTE_DATA_CC);
+ retval = zend_fetch_static_property_address(varname, (IS_TMP_VAR|IS_VAR), opline->op2, IS_UNUSED, type EXECUTE_DATA_CC OPLINE_CC);
if (UNEXPECTED(retval == NULL)) {
if (EG(exception)) {
@@ -50961,9 +50898,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_STATIC_PROP_SPEC_TMPVAR_
}
if (IS_UNUSED == IS_CONST) {
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)), RT_CONSTANT(opline, opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
if ((IS_TMP_VAR|IS_VAR) != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
@@ -50972,7 +50909,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_STATIC_PROP_SPEC_TMPVAR_
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), ce);
}
} else if (IS_UNUSED == IS_UNUSED) {
ce = zend_fetch_class(NULL, opline->op2.num);
@@ -51051,8 +50988,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
}
if (IS_UNUSED == IS_CONST) {
- if ((IS_TMP_VAR|IS_VAR) == IS_CONST && EXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)))) != NULL)) {
- value = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)) + sizeof(void*));
+ if ((IS_TMP_VAR|IS_VAR) == IS_CONST && EXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)))) != NULL)) {
+ value = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)) + sizeof(void*));
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
@@ -51060,14 +50997,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
}
goto is_static_prop_return;
- } else if (UNEXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)))) == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
+ } else if (UNEXPECTED((ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)))) == NULL)) {
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)), RT_CONSTANT(opline, opline->op2) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION);
if (UNEXPECTED(ce == NULL)) {
ZEND_ASSERT(EG(exception));
ZVAL_UNDEF(EX_VAR(opline->result.var));
HANDLE_EXCEPTION();
}
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), ce);
}
} else {
if (IS_UNUSED == IS_UNUSED) {
@@ -51085,9 +51022,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
ce = Z_CE_P(EX_VAR(opline->op2.var));
}
if ((IS_TMP_VAR|IS_VAR) == IS_CONST &&
- EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1))) == ce)) {
+ EXPECTED(CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1))) == ce)) {
- value = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)) + sizeof(void*));
+ value = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)) + sizeof(void*));
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
@@ -51101,7 +51038,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_STATIC_PROP_SPEC
value = zend_std_get_static_property(ce, Z_STR_P(varname), 1);
if ((IS_TMP_VAR|IS_VAR) == IS_CONST && value) {
- CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, value);
+ CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op1)), ce, value);
}
if ((IS_TMP_VAR|IS_VAR) != IS_CONST && Z_TYPE(tmp) != IS_UNDEF) {
@@ -51137,11 +51074,11 @@ try_instanceof:
zend_class_entry *ce;
if (IS_UNUSED == IS_CONST) {
- ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)));
+ ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)));
if (UNEXPECTED(ce == NULL)) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op2)), EX_CONSTANT(opline->op2) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD);
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(opline, opline->op2)), RT_CONSTANT(opline, opline->op2) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD);
if (EXPECTED(ce)) {
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op2)), ce);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(opline, opline->op2)), ce);
}
}
} else if (IS_UNUSED == IS_UNUSED) {
@@ -51927,7 +51864,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CV_HA
EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
retval = OBJ_PROP(zobj, prop_offset);
if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -52166,7 +52103,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_C
}
/* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL));
if (UNEXPECTED(fbc == NULL)) {
if (EXPECTED(!EG(exception))) {
zend_throw_error(NULL, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name));
@@ -53257,7 +53194,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_TMPVA
EXPECTED(zobj->ce == CACHED_PTR(Z_CACHE_SLOT_P(offset)))) {
uint32_t prop_offset = (uint32_t)(intptr_t)CACHED_PTR(Z_CACHE_SLOT_P(offset) + sizeof(void*));
- if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
+ if (EXPECTED(IS_VALID_PROPERTY_OFFSET(prop_offset))) {
retval = OBJ_PROP(zobj, prop_offset);
if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) {
ZVAL_COPY(EX_VAR(opline->result.var), retval);
@@ -53497,7 +53434,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_T
}
/* First, locate the function. */
- fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL));
+ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (RT_CONSTANT(opline, opline->op2) + 1) : NULL));
if (UNEXPECTED(fbc == NULL)) {
if (EXPECTED(!EG(exception))) {
zend_throw_error(NULL, "Call to undefined method %s::%s()", ZSTR_VAL(obj->ce->name), Z_STRVAL_P(function_name));
@@ -54108,7 +54045,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_LONG_NO_OVERFL
zval *op1, *op2, *result;
op1 = EX_VAR(opline->op1.var);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
result = EX_VAR(opline->result.var);
ZVAL_LONG(result, Z_LVAL_P(op1) - Z_LVAL_P(op2));
ZEND_VM_NEXT_OPCODE();
@@ -54120,7 +54057,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_LONG_SPEC_TMPV
zval *op1, *op2, *result;
op1 = EX_VAR(opline->op1.var);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
result = EX_VAR(opline->result.var);
fast_long_sub_function(result, op1, op2);
ZEND_VM_NEXT_OPCODE();
@@ -54132,7 +54069,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SUB_DOUBLE_SPEC_TM
zval *op1, *op2, *result;
op1 = EX_VAR(opline->op1.var);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
result = EX_VAR(opline->result.var);
ZVAL_DOUBLE(result, Z_DVAL_P(op1) - Z_DVAL_P(op2));
ZEND_VM_NEXT_OPCODE();
@@ -54145,7 +54082,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_LONG_SP
int result;
op1 = EX_VAR(opline->op1.var);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
result = (Z_LVAL_P(op1) < Z_LVAL_P(op2));
ZVAL_BOOL(EX_VAR(opline->result.var), result);
@@ -54159,7 +54096,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_LONG_SP
int result;
op1 = EX_VAR(opline->op1.var);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
result = (Z_LVAL_P(op1) < Z_LVAL_P(op2));
ZEND_VM_SMART_BRANCH_JMPZ(result, 0);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
@@ -54173,7 +54110,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_LONG_SP
int result;
op1 = EX_VAR(opline->op1.var);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
result = (Z_LVAL_P(op1) < Z_LVAL_P(op2));
ZEND_VM_SMART_BRANCH_JMPNZ(result, 0);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
@@ -54187,7 +54124,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_DOUBLE_
int result;
op1 = EX_VAR(opline->op1.var);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
result = (Z_DVAL_P(op1) < Z_DVAL_P(op2));
ZVAL_BOOL(EX_VAR(opline->result.var), result);
@@ -54201,7 +54138,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_DOUBLE_
int result;
op1 = EX_VAR(opline->op1.var);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
result = (Z_DVAL_P(op1) < Z_DVAL_P(op2));
ZEND_VM_SMART_BRANCH_JMPZ(result, 0);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
@@ -54215,7 +54152,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_DOUBLE_
int result;
op1 = EX_VAR(opline->op1.var);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
result = (Z_DVAL_P(op1) < Z_DVAL_P(op2));
ZEND_VM_SMART_BRANCH_JMPNZ(result, 0);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
@@ -54229,7 +54166,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUA
int result;
op1 = EX_VAR(opline->op1.var);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
result = (Z_LVAL_P(op1) <= Z_LVAL_P(op2));
ZVAL_BOOL(EX_VAR(opline->result.var), result);
@@ -54243,7 +54180,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUA
int result;
op1 = EX_VAR(opline->op1.var);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
result = (Z_LVAL_P(op1) <= Z_LVAL_P(op2));
ZEND_VM_SMART_BRANCH_JMPZ(result, 0);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
@@ -54257,7 +54194,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUA
int result;
op1 = EX_VAR(opline->op1.var);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
result = (Z_LVAL_P(op1) <= Z_LVAL_P(op2));
ZEND_VM_SMART_BRANCH_JMPNZ(result, 0);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
@@ -54271,7 +54208,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUA
int result;
op1 = EX_VAR(opline->op1.var);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
result = (Z_DVAL_P(op1) <= Z_DVAL_P(op2));
ZVAL_BOOL(EX_VAR(opline->result.var), result);
@@ -54285,7 +54222,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUA
int result;
op1 = EX_VAR(opline->op1.var);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
result = (Z_DVAL_P(op1) <= Z_DVAL_P(op2));
ZEND_VM_SMART_BRANCH_JMPZ(result, 0);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
@@ -54299,7 +54236,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUA
int result;
op1 = EX_VAR(opline->op1.var);
- op2 = EX_CONSTANT(opline->op2);
+ op2 = RT_CONSTANT(opline, opline->op2);
result = (Z_DVAL_P(op1) <= Z_DVAL_P(op2));
ZEND_VM_SMART_BRANCH_JMPNZ(result, 0);
ZVAL_BOOL(EX_VAR(opline->result.var), result);
diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php
index 69c8e19c1a..ecb7401a29 100644
--- a/Zend/zend_vm_gen.php
+++ b/Zend/zend_vm_gen.php
@@ -239,7 +239,7 @@ $op1_get_zval_ptr = array(
"ANY" => "get_zval_ptr(opline->op1_type, opline->op1, &free_op1, \\1)",
"TMP" => "_get_zval_ptr_tmp(opline->op1.var, &free_op1 EXECUTE_DATA_CC)",
"VAR" => "_get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC)",
- "CONST" => "EX_CONSTANT(opline->op1)",
+ "CONST" => "RT_CONSTANT(opline, opline->op1)",
"UNUSED" => "NULL",
"CV" => "_get_zval_ptr_cv_\\1(opline->op1.var EXECUTE_DATA_CC)",
"TMPVAR" => "_get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC)",
@@ -250,7 +250,7 @@ $op2_get_zval_ptr = array(
"ANY" => "get_zval_ptr(opline->op2_type, opline->op2, &free_op2, \\1)",
"TMP" => "_get_zval_ptr_tmp(opline->op2.var, &free_op2 EXECUTE_DATA_CC)",
"VAR" => "_get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC)",
- "CONST" => "EX_CONSTANT(opline->op2)",
+ "CONST" => "RT_CONSTANT(opline, opline->op2)",
"UNUSED" => "NULL",
"CV" => "_get_zval_ptr_cv_\\1(opline->op2.var EXECUTE_DATA_CC)",
"TMPVAR" => "_get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC)",
@@ -283,7 +283,7 @@ $op1_get_zval_ptr_deref = array(
"ANY" => "get_zval_ptr_deref(opline->op1_type, opline->op1, &free_op1, \\1)",
"TMP" => "_get_zval_ptr_tmp(opline->op1.var, &free_op1 EXECUTE_DATA_CC)",
"VAR" => "_get_zval_ptr_var_deref(opline->op1.var, &free_op1 EXECUTE_DATA_CC)",
- "CONST" => "EX_CONSTANT(opline->op1)",
+ "CONST" => "RT_CONSTANT(opline, opline->op1)",
"UNUSED" => "NULL",
"CV" => "_get_zval_ptr_cv_deref_\\1(opline->op1.var EXECUTE_DATA_CC)",
"TMPVAR" => "???",
@@ -294,7 +294,7 @@ $op2_get_zval_ptr_deref = array(
"ANY" => "get_zval_ptr_deref(opline->op2_type, opline->op2, &free_op2, \\1)",
"TMP" => "_get_zval_ptr_tmp(opline->op2.var, &free_op2 EXECUTE_DATA_CC)",
"VAR" => "_get_zval_ptr_var_deref(opline->op2.var, &free_op2 EXECUTE_DATA_CC)",
- "CONST" => "EX_CONSTANT(opline->op2)",
+ "CONST" => "RT_CONSTANT(opline, opline->op2)",
"UNUSED" => "NULL",
"CV" => "_get_zval_ptr_cv_deref_\\1(opline->op2.var EXECUTE_DATA_CC)",
"TMPVAR" => "???",
@@ -305,7 +305,7 @@ $op1_get_zval_ptr_undef = array(
"ANY" => "get_zval_ptr_undef(opline->op1_type, opline->op1, &free_op1, \\1)",
"TMP" => "_get_zval_ptr_tmp(opline->op1.var, &free_op1 EXECUTE_DATA_CC)",
"VAR" => "_get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC)",
- "CONST" => "EX_CONSTANT(opline->op1)",
+ "CONST" => "RT_CONSTANT(opline, opline->op1)",
"UNUSED" => "NULL",
"CV" => "_get_zval_ptr_cv_undef(opline->op1.var EXECUTE_DATA_CC)",
"TMPVAR" => "_get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC)",
@@ -316,7 +316,7 @@ $op2_get_zval_ptr_undef = array(
"ANY" => "get_zval_ptr_undef(opline->op2_type, opline->op2, &free_op2, \\1)",
"TMP" => "_get_zval_ptr_tmp(opline->op2.var, &free_op2 EXECUTE_DATA_CC)",
"VAR" => "_get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC)",
- "CONST" => "EX_CONSTANT(opline->op2)",
+ "CONST" => "RT_CONSTANT(opline, opline->op2)",
"UNUSED" => "NULL",
"CV" => "_get_zval_ptr_cv_undef(opline->op2.var EXECUTE_DATA_CC)",
"TMPVAR" => "_get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC)",
@@ -349,7 +349,7 @@ $op1_get_obj_zval_ptr = array(
"ANY" => "get_obj_zval_ptr(opline->op1_type, opline->op1, &free_op1, \\1)",
"TMP" => "_get_zval_ptr_tmp(opline->op1.var, &free_op1 EXECUTE_DATA_CC)",
"VAR" => "_get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC)",
- "CONST" => "EX_CONSTANT(opline->op1)",
+ "CONST" => "RT_CONSTANT(opline, opline->op1)",
"UNUSED" => "_get_obj_zval_ptr_unused(EXECUTE_DATA_C)",
"CV" => "_get_zval_ptr_cv_\\1(opline->op1.var EXECUTE_DATA_CC)",
"TMPVAR" => "_get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC)",
@@ -360,7 +360,7 @@ $op2_get_obj_zval_ptr = array(
"ANY" => "get_obj_zval_ptr(opline->op2_type, opline->op2, &free_op2, \\1)",
"TMP" => "_get_zval_ptr_tmp(opline->op2.var, &free_op2 EXECUTE_DATA_CC)",
"VAR" => "_get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC)",
- "CONST" => "EX_CONSTANT(opline->op2)",
+ "CONST" => "RT_CONSTANT(opline, opline->op2)",
"UNUSED" => "_get_obj_zval_ptr_unused(EXECUTE_DATA_C)",
"CV" => "_get_zval_ptr_cv_\\1(opline->op2.var EXECUTE_DATA_CC)",
"TMPVAR" => "_get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC)",
@@ -371,7 +371,7 @@ $op1_get_obj_zval_ptr_undef = array(
"ANY" => "get_obj_zval_ptr_undef(opline->op1_type, opline->op1, &free_op1, \\1)",
"TMP" => "_get_zval_ptr_tmp(opline->op1.var, &free_op1 EXECUTE_DATA_CC)",
"VAR" => "_get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC)",
- "CONST" => "EX_CONSTANT(opline->op1)",
+ "CONST" => "RT_CONSTANT(opline, opline->op1)",
"UNUSED" => "_get_obj_zval_ptr_unused(EXECUTE_DATA_C)",
"CV" => "_get_zval_ptr_cv_undef(opline->op1.var EXECUTE_DATA_CC)",
"TMPVAR" => "_get_zval_ptr_var(opline->op1.var, &free_op1 EXECUTE_DATA_CC)",
@@ -382,7 +382,7 @@ $op2_get_obj_zval_ptr_undef = array(
"ANY" => "get_obj_zval_ptr_undef(opline->op2_type, opline->op2, &free_op2, \\1)",
"TMP" => "_get_zval_ptr_tmp(opline->op2.var, &free_op2 EXECUTE_DATA_CC)",
"VAR" => "_get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC)",
- "CONST" => "EX_CONSTANT(opline->op2)",
+ "CONST" => "RT_CONSTANT(opline, opline->op2)",
"UNUSED" => "_get_obj_zval_ptr_unused(EXECUTE_DATA_C)",
"CV" => "_get_zval_ptr_cv_undef(opline->op2.var EXECUTE_DATA_CC)",
"TMPVAR" => "_get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC)",
@@ -393,7 +393,7 @@ $op1_get_obj_zval_ptr_deref = array(
"ANY" => "get_obj_zval_ptr(opline->op1_type, opline->op1, &free_op1, \\1)",
"TMP" => "_get_zval_ptr_tmp(opline->op1.var, &free_op1 EXECUTE_DATA_CC)",
"VAR" => "_get_zval_ptr_var_deref(opline->op1.var, &free_op1 EXECUTE_DATA_CC)",
- "CONST" => "EX_CONSTANT(opline->op1)",
+ "CONST" => "RT_CONSTANT(opline, opline->op1)",
"UNUSED" => "_get_obj_zval_ptr_unused(EXECUTE_DATA_C)",
"CV" => "_get_zval_ptr_cv_deref_\\1(opline->op1.var EXECUTE_DATA_CC)",
"TMPVAR" => "???",
@@ -404,7 +404,7 @@ $op2_get_obj_zval_ptr_deref = array(
"ANY" => "get_obj_zval_ptr(opline->op2_type, opline->op2, &free_op2, \\1)",
"TMP" => "_get_zval_ptr_tmp(opline->op2.var, &free_op2 EXECUTE_DATA_CC)",
"VAR" => "_get_zval_ptr_var_deref(opline->op2.var, &free_op2 EXECUTE_DATA_CC)",
- "CONST" => "EX_CONSTANT(opline->op2)",
+ "CONST" => "RT_CONSTANT(opline, opline->op2)",
"UNUSED" => "_get_obj_zval_ptr_unused(EXECUTE_DATA_C)",
"CV" => "_get_zval_ptr_cv_deref_\\1(opline->op2.var EXECUTE_DATA_CC)",
"TMPVAR" => "???",
@@ -558,7 +558,7 @@ $op_data_get_zval_ptr = array(
"ANY" => "get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, &free_op_data, \\1)",
"TMP" => "_get_zval_ptr_tmp((opline+1)->op1.var, &free_op_data EXECUTE_DATA_CC)",
"VAR" => "_get_zval_ptr_var((opline+1)->op1.var, &free_op_data EXECUTE_DATA_CC)",
- "CONST" => "EX_CONSTANT((opline+1)->op1)",
+ "CONST" => "RT_CONSTANT((opline+1), (opline+1)->op1)",
"UNUSED" => "NULL",
"CV" => "_get_zval_ptr_cv_\\1((opline+1)->op1.var EXECUTE_DATA_CC)",
"TMPVAR" => "_get_zval_ptr_var((opline+1)->op1.var, &free_op_data EXECUTE_DATA_CC)",
@@ -569,7 +569,7 @@ $op_data_get_zval_ptr_deref = array(
"ANY" => "get_zval_ptr((opline+1)->op1_type, (opline+1)->op1, &free_op_data, \\1)",
"TMP" => "_get_zval_ptr_tmp((opline+1)->op1.var, &free_op_data EXECUTE_DATA_CC)",
"VAR" => "_get_zval_ptr_var_deref((opline+1)->op1.var, &free_op_data EXECUTE_DATA_CC)",
- "CONST" => "EX_CONSTANT((opline+1)->op1)",
+ "CONST" => "RT_CONSTANT((opline+1), (opline+1)->op1)",
"UNUSED" => "NULL",
"CV" => "_get_zval_ptr_cv_deref_\\1((opline+1)->op1.var EXECUTE_DATA_CC)",
"TMPVAR" => "???",
diff --git a/configure.ac b/configure.ac
index 80fe2a7a07..6ba8b798bf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -106,7 +106,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
])
PHP_MAJOR_VERSION=7
-PHP_MINOR_VERSION=2
+PHP_MINOR_VERSION=3
PHP_RELEASE_VERSION=0
PHP_EXTRA_VERSION="-dev"
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
@@ -1443,7 +1443,7 @@ PHP_ADD_SOURCES(main, main.c snprintf.c spprintf.c php_sprintf.c \
php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.c \
strlcat.c explicit_bzero.c mergesort.c reentrancy.c php_variables.c php_ticks.c \
network.c php_open_temporary_file.c \
- output.c getopt.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
+ output.c getopt.c php_syslog.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_ADD_SOURCES_X(main, fastcgi.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1, PHP_FASTCGI_OBJS, no)
@@ -1544,15 +1544,6 @@ dnl mv -f main/internal_functions.c main/internal_functions.c.old 2>/dev/null
cli_extensions="$EXT_CLI_STATIC"
sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in $srcdir "$EXTRA_MODULE_PTRS" $AWK \$cli_extensions > main/internal_functions_cli.c
- if test "$UNAME" = "FreeBSD" && test "$PHP_SAPI" = "apache2filter" && test "$TSRM_PTH" != "pth-config" ; then
- echo "+--------------------------------------------------------------------+"
- echo "| *** WARNING *** |"
- echo "| |"
- echo "| In order to build PHP as a Apache2 module on FreeBSD, you have to |"
- echo "| add --with-tsrm-pth to your ./configure line. Therefore you need |"
- echo "| to install gnu-pth from /usr/ports/devel/pth. |"
- fi
-
if test -n "$PHP_APXS_BROKEN"; then
echo "+--------------------------------------------------------------------+"
echo "| WARNING: Your $APXS script is most likely broken."
@@ -1578,7 +1569,7 @@ cat <<X
X
fi
- if test "$PHP_SAPI" = "apache2handler" || test "$PHP_SAPI" = "apache2filter"; then
+ if test "$PHP_SAPI" = "apache2handler"; then
if test "$APACHE_VERSION" -ge 2004001; then
if test -z "$APACHE_THREADED_MPM"; then
cat <<X
diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c
index e8b87dceff..1186241620 100644
--- a/ext/bcmath/bcmath.c
+++ b/ext/bcmath/bcmath.c
@@ -89,7 +89,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_bccomp, 0, 0, 2)
ZEND_ARG_INFO(0, scale)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO(arginfo_bcscale, 0)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_bcscale, 0, 0, 0)
ZEND_ARG_INFO(0, scale)
ZEND_END_ARG_INFO()
@@ -207,21 +207,6 @@ static void php_str2num(bc_num *num, char *str)
}
/* }}} */
-/* {{{ split_bc_num
- Convert to bc_num detecting scale */
-static bc_num split_bc_num(bc_num num) {
- bc_num newnum;
- if (num->n_refs >= 1) {
- return num;
- }
- newnum = _bc_new_num_ex(0, 0, 0);
- *newnum = *num;
- newnum->n_refs = 1;
- num->n_refs--;
- return newnum;
-}
-/* }}} */
-
/* {{{ proto string bcadd(string left_operand, string right_operand [, int scale])
Returns the sum of two arbitrary precision numbers */
PHP_FUNCTION(bcadd)
@@ -249,12 +234,7 @@ PHP_FUNCTION(bcadd)
php_str2num(&second, ZSTR_VAL(right));
bc_add (first, second, &result, scale);
- if (result->n_scale > scale) {
- result = split_bc_num(result);
- result->n_scale = scale;
- }
-
- RETVAL_STR(bc_num2str(result));
+ RETVAL_STR(bc_num2str_ex(result, scale));
bc_free_num(&first);
bc_free_num(&second);
bc_free_num(&result);
@@ -289,12 +269,7 @@ PHP_FUNCTION(bcsub)
php_str2num(&second, ZSTR_VAL(right));
bc_sub (first, second, &result, scale);
- if (result->n_scale > scale) {
- result = split_bc_num(result);
- result->n_scale = scale;
- }
-
- RETVAL_STR(bc_num2str(result));
+ RETVAL_STR(bc_num2str_ex(result, scale));
bc_free_num(&first);
bc_free_num(&second);
bc_free_num(&result);
@@ -329,12 +304,7 @@ PHP_FUNCTION(bcmul)
php_str2num(&second, ZSTR_VAL(right));
bc_multiply (first, second, &result, scale);
- if (result->n_scale > scale) {
- result = split_bc_num(result);
- result->n_scale = scale;
- }
-
- RETVAL_STR(bc_num2str(result));
+ RETVAL_STR(bc_num2str_ex(result, scale));
bc_free_num(&first);
bc_free_num(&second);
bc_free_num(&result);
@@ -370,11 +340,7 @@ PHP_FUNCTION(bcdiv)
switch (bc_divide(first, second, &result, scale)) {
case 0: /* OK */
- if (result->n_scale > scale) {
- result = split_bc_num(result);
- result->n_scale = scale;
- }
- RETVAL_STR(bc_num2str(result));
+ RETVAL_STR(bc_num2str_ex(result, scale));
break;
case -1: /* division by zero */
php_error_docref(NULL, E_WARNING, "Division by zero");
@@ -450,11 +416,7 @@ PHP_FUNCTION(bcpowmod)
scale_int = (int) ((int)scale < 0 ? 0 : scale);
if (bc_raisemod(first, second, mod, &result, scale_int) != -1) {
- if (result->n_scale > scale_int) {
- result = split_bc_num(result);
- result->n_scale = scale_int;
- }
- RETVAL_STR(bc_num2str(result));
+ RETVAL_STR(bc_num2str_ex(result, scale_int));
} else {
RETVAL_FALSE;
}
@@ -494,12 +456,7 @@ PHP_FUNCTION(bcpow)
php_str2num(&second, ZSTR_VAL(right));
bc_raise (first, second, &result, scale);
- if (result->n_scale > scale) {
- result = split_bc_num(result);
- result->n_scale = scale;
- }
-
- RETVAL_STR(bc_num2str(result));
+ RETVAL_STR(bc_num2str_ex(result, scale));
bc_free_num(&first);
bc_free_num(&second);
bc_free_num(&result);
@@ -530,11 +487,7 @@ PHP_FUNCTION(bcsqrt)
php_str2num(&result, ZSTR_VAL(left));
if (bc_sqrt (&result, scale) != 0) {
- if (result->n_scale > scale) {
- result = split_bc_num(result);
- result->n_scale = scale;
- }
- RETVAL_STR(bc_num2str(result));
+ RETVAL_STR(bc_num2str_ex(result, scale));
} else {
php_error_docref(NULL, E_WARNING, "Square root of negative number");
}
@@ -577,19 +530,24 @@ PHP_FUNCTION(bccomp)
}
/* }}} */
-/* {{{ proto bool bcscale(int scale)
+/* {{{ proto int bcscale([int scale])
Sets default scale parameter for all bc math functions */
PHP_FUNCTION(bcscale)
{
- zend_long new_scale;
+ zend_long old_scale, new_scale;
- ZEND_PARSE_PARAMETERS_START(1, 1)
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
Z_PARAM_LONG(new_scale)
ZEND_PARSE_PARAMETERS_END();
- BCG(bc_precision) = ((int)new_scale < 0) ? 0 : new_scale;
+ old_scale = BCG(bc_precision);
+
+ if (ZEND_NUM_ARGS() == 1) {
+ BCG(bc_precision) = ((int)new_scale < 0) ? 0 : new_scale;
+ }
- RETURN_TRUE;
+ RETURN_LONG(old_scale);
}
/* }}} */
diff --git a/ext/bcmath/config.m4 b/ext/bcmath/config.m4
index bc126454b4..85c535d0f5 100644
--- a/ext/bcmath/config.m4
+++ b/ext/bcmath/config.m4
@@ -7,7 +7,7 @@ PHP_ARG_ENABLE(bcmath, whether to enable bc style precision math functions,
if test "$PHP_BCMATH" != "no"; then
PHP_NEW_EXTENSION(bcmath, bcmath.c \
-libbcmath/src/add.c libbcmath/src/div.c libbcmath/src/init.c libbcmath/src/neg.c libbcmath/src/outofmem.c libbcmath/src/raisemod.c libbcmath/src/rt.c libbcmath/src/sub.c \
+libbcmath/src/add.c libbcmath/src/div.c libbcmath/src/init.c libbcmath/src/neg.c libbcmath/src/outofmem.c libbcmath/src/raisemod.c libbcmath/src/sub.c \
libbcmath/src/compare.c libbcmath/src/divmod.c libbcmath/src/int2num.c libbcmath/src/num2long.c libbcmath/src/output.c libbcmath/src/recmul.c \
libbcmath/src/sqrt.c libbcmath/src/zero.c libbcmath/src/debug.c libbcmath/src/doaddsub.c libbcmath/src/nearzero.c libbcmath/src/num2str.c libbcmath/src/raise.c \
libbcmath/src/rmzero.c libbcmath/src/str2num.c,
diff --git a/ext/bcmath/config.w32 b/ext/bcmath/config.w32
index 3973c10cbf..f79df604b8 100644
--- a/ext/bcmath/config.w32
+++ b/ext/bcmath/config.w32
@@ -6,7 +6,7 @@ ARG_ENABLE("bcmath", "bc style precision math functions", "yes");
if (PHP_BCMATH == "yes") {
EXTENSION("bcmath", "bcmath.c", null, "-Iext/bcmath/libbcmath/src /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
ADD_SOURCES("ext/bcmath/libbcmath/src", "add.c div.c init.c neg.c \
- outofmem.c raisemod.c rt.c sub.c compare.c divmod.c int2num.c \
+ outofmem.c raisemod.c sub.c compare.c divmod.c int2num.c \
num2long.c output.c recmul.c sqrt.c zero.c debug.c doaddsub.c \
nearzero.c num2str.c raise.c rmzero.c str2num.c", "bcmath");
diff --git a/ext/bcmath/libbcmath/src/bcmath.h b/ext/bcmath/libbcmath/src/bcmath.h
index 28d275d32c..78868edcb3 100644
--- a/ext/bcmath/libbcmath/src/bcmath.h
+++ b/ext/bcmath/libbcmath/src/bcmath.h
@@ -42,7 +42,6 @@ typedef struct bc_struct
int n_len; /* The number of digits before the decimal point. */
int n_scale; /* The number of digits after the decimal point. */
int n_refs; /* The number of pointers to this number. */
- bc_num n_next; /* Linked list for available list. */
char *n_ptr; /* The pointer to the actual storage.
If NULL, n_value points to the inside of
another number (bc_multiply...) and should
@@ -111,7 +110,7 @@ _PROTOTYPE(void bc_init_num, (bc_num *num));
_PROTOTYPE(void bc_str2num, (bc_num *num, char *str, int scale));
-_PROTOTYPE(zend_string *bc_num2str, (bc_num num));
+_PROTOTYPE(zend_string *bc_num2str_ex, (bc_num num, int scale));
_PROTOTYPE(void bc_int2num, (bc_num *num, int val));
@@ -152,11 +151,10 @@ _PROTOTYPE(void bc_out_num, (bc_num num, int o_base, void (* out_char)(int),
/* Prototypes needed for external utility routines. */
-_PROTOTYPE(void bc_rt_warn, (char *mesg ,...));
-_PROTOTYPE(void bc_rt_error, (char *mesg ,...));
_PROTOTYPE(void bc_out_of_memory, (void));
#define bc_new_num(length, scale) _bc_new_num_ex((length), (scale), 0)
#define bc_free_num(num) _bc_free_num_ex((num), 0)
+#define bc_num2str(num) bc_num2str_ex((num), (num->n_scale))
#endif
diff --git a/ext/bcmath/libbcmath/src/init.c b/ext/bcmath/libbcmath/src/init.c
index 229ef05002..bd73da2a9d 100644
--- a/ext/bcmath/libbcmath/src/init.c
+++ b/ext/bcmath/libbcmath/src/init.c
@@ -51,14 +51,6 @@ _bc_new_num_ex (length, scale, persistent)
}
/* PHP Change: malloc() -> pemalloc(), removed free_list code */
temp = (bc_num) safe_pemalloc (1, sizeof(bc_struct)+length, scale, persistent);
-#if 0
- if (_bc_Free_list != NULL) {
- temp = _bc_Free_list;
- _bc_Free_list = temp->n_next;
- } else {
- temp = (bc_num) pemalloc (sizeof(bc_struct), persistent);
- }
-#endif
temp->n_sign = PLUS;
temp->n_len = length;
temp->n_scale = scale;
@@ -86,10 +78,6 @@ _bc_free_num_ex (num, persistent)
/* PHP Change: free() -> pefree(), removed free_list code */
pefree ((*num)->n_ptr, persistent);
pefree(*num, persistent);
-#if 0
- (*num)->n_next = _bc_Free_list;
- _bc_Free_list = *num;
-#endif
}
*num = NULL;
}
diff --git a/ext/bcmath/libbcmath/src/num2str.c b/ext/bcmath/libbcmath/src/num2str.c
index c72a924933..7316d32a14 100644
--- a/ext/bcmath/libbcmath/src/num2str.c
+++ b/ext/bcmath/libbcmath/src/num2str.c
@@ -41,8 +41,9 @@
/* Convert a numbers to a string. Base 10 only.*/
zend_string
-*bc_num2str (num)
+*bc_num2str_ex (num, scale)
bc_num num;
+ int scale;
{
zend_string *str;
char *sptr;
@@ -51,8 +52,8 @@ zend_string
/* Allocate the string memory. */
signch = ( num->n_sign == PLUS ? 0 : 1 ); /* Number of sign chars. */
- if (num->n_scale > 0)
- str = zend_string_alloc(num->n_len + num->n_scale + signch + 1, 0);
+ if (scale > 0)
+ str = zend_string_alloc(num->n_len + scale + signch + 1, 0);
else
str = zend_string_alloc(num->n_len + signch, 0);
if (str == NULL) bc_out_of_memory();
@@ -67,11 +68,13 @@ zend_string
*sptr++ = BCD_CHAR(*nptr++);
/* Now the fraction. */
- if (num->n_scale > 0)
+ if (scale > 0)
{
*sptr++ = '.';
- for (index=0; index<num->n_scale; index++)
+ for (index=0; index<scale && index<num->n_scale; index++)
*sptr++ = BCD_CHAR(*nptr++);
+ for (index = num->n_scale; index<scale; index++)
+ *sptr++ = BCD_CHAR(0);
}
/* Terminate the string and return it! */
diff --git a/ext/bcmath/libbcmath/src/raise.c b/ext/bcmath/libbcmath/src/raise.c
index c625d4e526..c7838be597 100644
--- a/ext/bcmath/libbcmath/src/raise.c
+++ b/ext/bcmath/libbcmath/src/raise.c
@@ -55,10 +55,10 @@ bc_raise (bc_num num1, bc_num num2, bc_num *result, int scale)
/* Check the exponent for scale digits and convert to a long. */
if (num2->n_scale != 0)
- bc_rt_warn ("non-zero scale in exponent");
+ php_error_docref (NULL, E_WARNING, "non-zero scale in exponent");
exponent = bc_num2long (num2);
if (exponent == 0 && (num2->n_len > 1 || num2->n_value[0] != 0))
- bc_rt_error ("exponent too large in raise");
+ php_error_docref (NULL, E_WARNING, "exponent too large");
/* Special case if exponent is a zero. */
if (exponent == 0)
diff --git a/ext/bcmath/libbcmath/src/raisemod.c b/ext/bcmath/libbcmath/src/raisemod.c
index 84788b4770..a3154b55cd 100644
--- a/ext/bcmath/libbcmath/src/raisemod.c
+++ b/ext/bcmath/libbcmath/src/raisemod.c
@@ -38,6 +38,24 @@
#include "bcmath.h"
#include "private.h"
+
+/* Truncate a number to zero scale. To avoid sharing issues (refcount and
+ shared n_value) the number is copied, this copy is truncated, and the
+ original number is "freed". */
+
+static void
+_bc_truncate (bc_num *num)
+{
+ bc_num temp;
+
+ temp = bc_new_num ((*num)->n_len, 0);
+ temp->n_sign = (*num)->n_sign;
+ memcpy (temp->n_value, (*num)->n_value, (*num)->n_len);
+ bc_free_num (num);
+ *num = temp;
+}
+
+
/* Raise BASE to the EXPO power, reduced modulo MOD. The result is
placed in RESULT. If a EXPO is not an integer,
only the integer part is used. */
@@ -62,22 +80,22 @@ bc_raisemod (bc_num base, bc_num expo, bc_num mod, bc_num *result, int scale)
/* Check the base for scale digits. */
if (power->n_scale != 0)
{
- bc_rt_warn ("non-zero scale in base");
- bc_divide (power, BCG(_one_), &power, 0); /*truncate */
+ php_error_docref (NULL, E_WARNING, "non-zero scale in base");
+ _bc_truncate (&power);
}
/* Check the exponent for scale digits. */
if (exponent->n_scale != 0)
{
- bc_rt_warn ("non-zero scale in exponent");
- bc_divide (exponent, BCG(_one_), &exponent, 0); /*truncate */
+ php_error_docref (NULL, E_WARNING, "non-zero scale in exponent");
+ _bc_truncate (&exponent);
}
/* Check the modulus for scale digits. */
if (modulus->n_scale != 0)
{
- bc_rt_warn ("non-zero scale in modulus");
- bc_divide (modulus, BCG(_one_), &modulus, 0); /*truncate */
+ php_error_docref (NULL, E_WARNING, "non-zero scale in modulus");
+ _bc_truncate (&modulus);
}
/* Do the calculation. */
diff --git a/ext/bcmath/libbcmath/src/rt.c b/ext/bcmath/libbcmath/src/rt.c
deleted file mode 100644
index 5f4d46527c..0000000000
--- a/ext/bcmath/libbcmath/src/rt.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/* rt.c: bcmath library file. */
-/*
- Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc.
- Copyright (C) 2000 Philip A. Nelson
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details. (COPYING.LIB)
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to:
-
- The Free Software Foundation, Inc.
- 59 Temple Place, Suite 330
- Boston, MA 02111-1307 USA.
-
- You may contact the author by:
- e-mail: philnelson@acm.org
- us-mail: Philip A. Nelson
- Computer Science Department, 9062
- Western Washington University
- Bellingham, WA 98226-9062
-
-*************************************************************************/
-
-#include <config.h>
-#include <stdio.h>
-#include <assert.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <stdarg.h>
-#include "bcmath.h"
-#include "private.h"
-
-
-void bc_rt_warn (char *mesg ,...)
-{
- va_list args;
- char error_mesg [255];
-
- va_start (args, mesg);
- vsnprintf (error_mesg, sizeof(error_mesg), mesg, args);
- va_end (args);
-
- fprintf (stderr, "bc math warning: %s\n", error_mesg);
-}
-
-
-void bc_rt_error (char *mesg ,...)
-{
- va_list args;
- char error_mesg [255];
-
- va_start (args, mesg);
- vsnprintf (error_mesg, sizeof(error_mesg), mesg, args);
- va_end (args);
-
- fprintf (stderr, "bc math error: %s\n", error_mesg);
-}
diff --git a/ext/bcmath/package.xml b/ext/bcmath/package.xml
deleted file mode 100644
index 3ef9773fe7..0000000000
--- a/ext/bcmath/package.xml
+++ /dev/null
@@ -1,94 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>bcmath</name>
- <summary>Arbitrary Precision Mathematics Functions</summary>
- <maintainers>
- <maintainer>
- <user>andi</user>
- <name>Andi Gutmans</name>
- <email>andi@php.net</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <description>
-For arbitrary precision mathematics PHP offers the Binary Calculator
-which supports numbers of any size and precision, represented as strings.
- </description>
- <license>PHP</license>
- <release>
- <state>beta</state>
- <version>5.0.0rc1</version>
- <date>2004-03-19</date>
- <notes>
-package.xml added to support installation using pear installer
- </notes>
- <filelist>
- <file role="doc" name="CREDITS"/>
- <file role="src" name="config.m4"/>
- <file role="src" name="config.w32"/>
- <file role="src" name="bcmath.c"/>
- <file role="src" name="php_bcmath.h"/>
- <file role="src" name="number.c"/>
- <file role="src" name="number.h"/>
- <file role="doc" name="libbcmath/AUTHORS"/>
- <file role="doc" name="libbcmath/COPYING.LIB"/>
- <file role="doc" name="libbcmath/ChangeLog"/>
- <file role="doc" name="libbcmath/FAQ"/>
- <file role="doc" name="libbcmath/INSTALL"/>
- <file role="doc" name="libbcmath/NEWS"/>
- <file role="doc" name="libbcmath/README"/>
- <file role="src" name="libbcmath/src/Makefile.am"/>
- <file role="src" name="libbcmath/src/add.c"/>
- <file role="src" name="libbcmath/src/bcmath.h"/>
- <file role="src" name="libbcmath/src/compare.c"/>
- <file role="src" name="libbcmath/src/config.h"/>
- <file role="src" name="libbcmath/src/debug.c"/>
- <file role="src" name="libbcmath/src/div.c"/>
- <file role="src" name="libbcmath/src/divmod.c"/>
- <file role="src" name="libbcmath/src/doaddsub.c"/>
- <file role="src" name="libbcmath/src/init.c"/>
- <file role="src" name="libbcmath/src/int2num.c"/>
- <file role="src" name="libbcmath/src/nearzero.c"/>
- <file role="src" name="libbcmath/src/neg.c"/>
- <file role="src" name="libbcmath/src/num2long.c"/>
- <file role="src" name="libbcmath/src/num2str.c"/>
- <file role="src" name="libbcmath/src/outofmem.c"/>
- <file role="src" name="libbcmath/src/output.c"/>
- <file role="src" name="libbcmath/src/private.h"/>
- <file role="src" name="libbcmath/src/raise.c"/>
- <file role="src" name="libbcmath/src/raisemod.c"/>
- <file role="src" name="libbcmath/src/recmul.c"/>
- <file role="src" name="libbcmath/src/rmzero.c"/>
- <file role="src" name="libbcmath/src/rt.c"/>
- <file role="src" name="libbcmath/src/sqrt.c"/>
- <file role="src" name="libbcmath/src/str2num.c"/>
- <file role="src" name="libbcmath/src/sub.c"/>
- <file role="src" name="libbcmath/src/zero.c"/>
- <file role="src" name="libbcmath/Makefile.am"/>
- <file role="src" name="libbcmath/acconfig.h"/>
- <file role="src" name="libbcmath/aclocal.m4"/>
- <file role="src" name="libbcmath/config.h.in"/>
- <file role="src" name="libbcmath/configure"/>
- <file role="src" name="libbcmath/configure.in"/>
- <file role="src" name="libbcmath/install-sh"/>
- <file role="src" name="libbcmath/missing"/>
- <file role="src" name="libbcmath/mkinstalldirs"/>
- <file role="test" name="tests/bcadd.phpt"/>
- <file role="test" name="tests/bccomp.phpt"/>
- <file role="test" name="tests/bcdiv.phpt"/>
- <file role="test" name="tests/bcmod.phpt"/>
- <file role="test" name="tests/bcmul.phpt"/>
- <file role="test" name="tests/bcpow.phpt"/>
- <file role="test" name="tests/bcscale.phpt"/>
- <file role="test" name="tests/bcsqrt.phpt"/>
- <file role="test" name="tests/bcsub.phpt"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5" />
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/bcmath/tests/bcpow.phpt b/ext/bcmath/tests/bcpow.phpt
index 141ec61d92..ad642a57be 100644
--- a/ext/bcmath/tests/bcpow.phpt
+++ b/ext/bcmath/tests/bcpow.phpt
@@ -13,6 +13,6 @@ echo bcpow("-2.555", "5", 2),"\n";
?>
--EXPECT--
1
--32
+-32.0000
18446744073709551616
-108.88
diff --git a/ext/bcmath/tests/bcpow_error1.phpt b/ext/bcmath/tests/bcpow_error1.phpt
new file mode 100644
index 0000000000..d3189f062a
--- /dev/null
+++ b/ext/bcmath/tests/bcpow_error1.phpt
@@ -0,0 +1,15 @@
+--TEST--
+bcpow() does not support non-integral exponents
+--SKIPIF--
+<?php
+if (!extension_loaded('bcmath')) die('skip bcmath extension is not available');
+?>
+--FILE--
+<?php
+var_dump(bcpow('1', '1.1', 2));
+?>
+===DONE===
+--EXPECTF--
+Warning: bcpow(): non-zero scale in exponent in %s on line %d
+string(4) "1.00"
+===DONE===
diff --git a/ext/bcmath/tests/bcpow_error2.phpt b/ext/bcmath/tests/bcpow_error2.phpt
new file mode 100644
index 0000000000..49fd0b88d3
--- /dev/null
+++ b/ext/bcmath/tests/bcpow_error2.phpt
@@ -0,0 +1,15 @@
+--TEST--
+bcpow() does not support exponents >= 2**63
+--SKIPIF--
+<?php
+if (!extension_loaded('bcmath')) die('skip bcmath extension is not available');
+?>
+--FILE--
+<?php
+var_dump(bcpow('0', '9223372036854775808', 2));
+?>
+===DONE===
+--EXPECTF--
+Warning: bcpow(): exponent too large in %s on line %d
+string(4) "1.00"
+===DONE===
diff --git a/ext/bcmath/tests/bcscale_variation003.phpt b/ext/bcmath/tests/bcscale_variation003.phpt
new file mode 100644
index 0000000000..b1c541644c
--- /dev/null
+++ b/ext/bcmath/tests/bcscale_variation003.phpt
@@ -0,0 +1,18 @@
+--TEST--
+bcscale() return value
+--SKIPIF--
+<?php if(!extension_loaded("bcmath")) print "skip"; ?>
+--INI--
+bcmath.scale=0
+--FILE--
+<?php
+var_dump(bcscale(1));
+var_dump(bcscale(4));
+var_dump(bcscale());
+var_dump(bcscale());
+?>
+--EXPECT--
+int(0)
+int(1)
+int(4)
+int(4)
diff --git a/ext/bcmath/tests/bug.66364.phpt b/ext/bcmath/tests/bug.66364.phpt
new file mode 100644
index 0000000000..564f40e6da
--- /dev/null
+++ b/ext/bcmath/tests/bug.66364.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Bug #66364 (BCMath bcmul ignores scale parameter)
+--SKIPIF--
+<?php
+if (!extension_loaded('bcmath')) die('skip bcmath extension not available');
+?>
+--FILE--
+<?php
+var_dump(bcmul('0.3', '0.2', 4));
+?>
+===DONE===
+--EXPECT--
+string(6) "0.0600"
+===DONE===
diff --git a/ext/bcmath/tests/bug72093-win32.phpt b/ext/bcmath/tests/bug72093-win32.phpt
deleted file mode 100644
index a9b2077823..0000000000
--- a/ext/bcmath/tests/bug72093-win32.phpt
+++ /dev/null
@@ -1,18 +0,0 @@
---TEST--
-Bug 72093: bcpowmod accepts negative scale and corrupts _one_ definition
---SKIPIF--
-<?php
-if(!extension_loaded("bcmath")) print "skip";
-if (substr(PHP_OS, 0, 3) != 'WIN') {
- die('skip valid only for windows');
-}
-?>
---FILE--
-<?php
-var_dump(bcpowmod(1, "A", 128, -200));
-var_dump(bcpowmod(1, 1.2, 1, 1));
-?>
---EXPECTF--
-string(1) "1"
-string(3) "0.0"
-bc math warning: non-zero scale in exponent
diff --git a/ext/bcmath/tests/bug72093.phpt b/ext/bcmath/tests/bug72093.phpt
index 911af5698f..3aca87a39c 100644
--- a/ext/bcmath/tests/bug72093.phpt
+++ b/ext/bcmath/tests/bug72093.phpt
@@ -3,9 +3,6 @@ Bug 72093: bcpowmod accepts negative scale and corrupts _one_ definition
--SKIPIF--
<?php
if(!extension_loaded("bcmath")) print "skip";
-if (substr(PHP_OS, 0, 3) == 'WIN') {
- die('skip Not valid for windows');
-}
?>
--FILE--
<?php
@@ -14,5 +11,6 @@ var_dump(bcpowmod(1, 1.2, 1, 1));
?>
--EXPECTF--
string(1) "1"
-bc math warning: non-zero scale in exponent
+
+Warning: bcpowmod(): non-zero scale in exponent in %s on line %d
string(3) "0.0"
diff --git a/ext/bcmath/tests/bug75178-win32.phpt b/ext/bcmath/tests/bug75178-win32.phpt
deleted file mode 100644
index bae590fb5b..0000000000
--- a/ext/bcmath/tests/bug75178-win32.phpt
+++ /dev/null
@@ -1,21 +0,0 @@
---TEST--
-Bug #75178 (bcpowmod() misbehaves for non-integer base or modulus)
---SKIPIF--
-<?php
-if (!extension_loaded('bcmath')) die('skip bcmath extension is not available');
-if (substr(PHP_OS, 0, 3) != 'WIN') {
- die('skip valid only for windows');
-}
-?>
---FILE--
-<?php
-var_dump(bcpowmod('4.1', '4', '3', 3));
-var_dump(bcpowmod('4', '4', '3.1', 3));
-?>
-===DONE===
---EXPECT--
-string(5) "1.000"
-string(5) "1.000"
-===DONE===
-bc math warning: non-zero scale in base
-bc math warning: non-zero scale in modulus
diff --git a/ext/bcmath/tests/bug75178.phpt b/ext/bcmath/tests/bug75178.phpt
index bdfa25a2e1..e7661755ad 100644
--- a/ext/bcmath/tests/bug75178.phpt
+++ b/ext/bcmath/tests/bug75178.phpt
@@ -3,9 +3,6 @@ Bug #75178 (bcpowmod() misbehaves for non-integer base or modulus)
--SKIPIF--
<?php
if (!extension_loaded('bcmath')) die('skip bcmath extension is not available');
-if (substr(PHP_OS, 0, 3) == 'WIN') {
- die('skip Not valid for windows');
-}
?>
--FILE--
<?php
@@ -13,9 +10,10 @@ var_dump(bcpowmod('4.1', '4', '3', 3));
var_dump(bcpowmod('4', '4', '3.1', 3));
?>
===DONE===
---EXPECT--
-bc math warning: non-zero scale in base
+--EXPECTF--
+Warning: bcpowmod(): non-zero scale in base in %s on line %d
string(5) "1.000"
-bc math warning: non-zero scale in modulus
+
+Warning: bcpowmod(): non-zero scale in modulus in %s on line %d
string(5) "1.000"
===DONE===
diff --git a/ext/bcmath/tests/scale.phpt b/ext/bcmath/tests/scale.phpt
new file mode 100644
index 0000000000..d49e530511
--- /dev/null
+++ b/ext/bcmath/tests/scale.phpt
@@ -0,0 +1,27 @@
+--TEST--
+BCMath functions return result with requested scale
+--SKIPIF--
+<?php
+if (!extension_loaded('bcmath')) die('skip bcmath extension not available');
+?>
+--FILE--
+<?php
+echo
+ 'bcadd: ', bcadd('2', '1', 5), PHP_EOL,
+ 'bcdiv: ', bcdiv('2', '1', 5), PHP_EOL,
+ 'bcmul: ', bcmul('2', '1', 5), PHP_EOL,
+ 'bcpow: ', bcpow('2', '1', 5), PHP_EOL,
+ 'bcpowmod: ', bcpowmod('2', '1', '3', 5), PHP_EOL,
+ 'bcsqrt: ', bcsqrt('4', 5), PHP_EOL,
+ 'bcsub: ', bcsub('2', '1', 5), PHP_EOL;
+?>
+===DONE===
+--EXPECT--
+bcadd: 3.00000
+bcdiv: 2.00000
+bcmul: 2.00000
+bcpow: 2.00000
+bcpowmod: 2.00000
+bcsqrt: 2.00000
+bcsub: 1.00000
+===DONE===
diff --git a/ext/bcmath/tests/scale_ini.phpt b/ext/bcmath/tests/scale_ini.phpt
new file mode 100644
index 0000000000..66d9d482bf
--- /dev/null
+++ b/ext/bcmath/tests/scale_ini.phpt
@@ -0,0 +1,29 @@
+--TEST--
+BCMath functions return result with default scale
+--SKIPIF--
+<?php
+if (!extension_loaded('bcmath')) die('skip bcmath extension not available');
+?>
+--INI--
+bcmath.scale = 5
+--FILE--
+<?php
+echo
+ 'bcadd: ', bcadd('2', '1'), PHP_EOL,
+ 'bcdiv: ', bcdiv('2', '1'), PHP_EOL,
+ 'bcmul: ', bcmul('2', '1'), PHP_EOL,
+ 'bcpow: ', bcpow('2', '1'), PHP_EOL,
+ 'bcpowmod: ', bcpowmod('2', '1', '3'), PHP_EOL,
+ 'bcsqrt: ', bcsqrt('4'), PHP_EOL,
+ 'bcsub: ', bcsub('2', '1'), PHP_EOL;
+?>
+===DONE===
+--EXPECT--
+bcadd: 3.00000
+bcdiv: 2.00000
+bcmul: 2.00000
+bcpow: 2.00000
+bcpowmod: 2.00000
+bcsqrt: 2.00000
+bcsub: 1.00000
+===DONE===
diff --git a/ext/bz2/package.xml b/ext/bz2/package.xml
deleted file mode 100644
index b1b3688b56..0000000000
--- a/ext/bz2/package.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!-- do not use the "Type" attribute here, that one is only for
- generated package.xml files -->
-<package>
- <name>bz2</name>
- <summary>A Bzip2 management extension</summary>
- <description>
-Bz2 is an extension to create and parse bzip2 compressed data.
- </description>
- <license>PHP License</license>
- <maintainers>
- <maintainer>
- <user>sterling</user>
- <name>Sterling Hughes</name>
- <email>sterling@php.net</email>
- </maintainer>
- </maintainers>
- <release>
- <version>1.0</version>
- <date>2003-05-17</date>
- <state>stable</state>
- <notes>
- Initial Release in PECL
- </notes>
- </release>
- <configureoptions>
- <configureoption name="with-bz2" default="autodetect" prompt="path to bz2 installation?"/>
- </configureoptions>
- <filelist>
- <dir role="src" name="/">
- <file role="doc">CREDITS</file>
- <file role="src">config.m4</file>
- <file role="doc">php_bz2.h</file>
- <file role="src">bz2.c</file>
- </dir>
- </filelist>
-</package>
diff --git a/ext/calendar/package.xml b/ext/calendar/package.xml
deleted file mode 100644
index 82d0675290..0000000000
--- a/ext/calendar/package.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>calendar</name>
- <summary>Date conversion between different calendar formats</summary>
- <maintainers>
- <maintainer>
- <user>hholzgra</user>
- <name>Hartmut Holzgraefe</name>
- <email>hartmut@php.net</email>
- <role>lead</role>
- </maintainer>
- <maintainer>
- <user>shane</user>
- <name>Shane Caraveo</name>
- <role>developer</role>
- <email>shane@caraveo.com</email>
- </maintainer>
- <maintainer>
- <user>colin</user>
- <name>Colin Viebrock</name>
- <role>developer</role>
- <email>colin@easydns.com</email>
- </maintainer>
- <maintainer>
- <user>wez</user>
- <name>Wez Furlong</name>
- <role>developer</role>
- <email>wez@php.net</email>
- </maintainer>
- </maintainers>
- <description>
-The calendar extension presents a series of functions to simplify
-converting between different calendar formats. The intermediary or
-standard it is based on is the Julian Day Count. The Julian Day Count
-is a count of days starting from January 1st, 4713 B.C. To convert
-between calendar systems, you must first convert to Julian Day Count,
-then to the calendar system of your choice. Julian Day Count is very
-different from the Julian Calendar!
- </description>
- <license>PHP</license>
- <release>
- <state>beta</state>
- <version>5.0.0rc1</version>
- <date>2004-03-19</date>
- <notes>
-package.xml added to support installation using pear installer
- </notes>
- <filelist>
- <file role="doc" name="CREDITS"/>
- <file role="src" name="config.m4"/>
- <file role="src" name="config.w32"/>
- <file role="src" name="cal_unix.c"/>
- <file role="src" name="calendar.c"/>
- <file role="src" name="dow.c"/>
- <file role="src" name="easter.c"/>
- <file role="src" name="french.c"/>
- <file role="src" name="gregor.c"/>
- <file role="src" name="jewish.c"/>
- <file role="src" name="julian.c"/>
- <file role="src" name="package.xml"/>
- <file role="src" name="php_calendar.h"/>
- <file role="src" name="sdncal.h"/>
- <file role="test" name="tests/jdtojewish.phpt"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5" />
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/com_dotnet/README b/ext/com_dotnet/README
deleted file mode 100644
index 0d9db40d98..0000000000
--- a/ext/com_dotnet/README
+++ /dev/null
@@ -1,71 +0,0 @@
-This is the new php5 COM module.
-
-It is not 100% backwards compatible with PHP 4 ext/com, but you should not miss
-the "features" that have not been retained.
-
-This module exposes 3 classes: variant, com and dotnet(*).
-com and dotnet classes are descendants of the variant class; the only
-difference between the three are their constructors. Once instantiated, the
-module doesn't make a distinction between them.
-
-COM errrors are mapped to exceptions; you should protect your COM code using
-the try..catch construct if you want to be able to handle error conditions.
-
-Be warned that due to the way the ZE2 currently works, exceptions are only
-"armed" at the time they are detected, but do not "detonate" until the end of
-the statement. So, code like this:
-
- $obj->foo[43]->bar();
-
-Where the foo[43] access triggers an exception will continue to call the bar()
-method on a null object and cause a fatal php error.
-
-Default properties and array access:
-
-$obj = new COM("...");
-$obj[1]->foo();
-
-The code above will use the type information for the object to determine its
-default property and then access it. In PHP 4, it was hard-coded to use the
-"Items" member, which was wrong.
-
-The default property will also be used by the casting support to determine the
-value for the object.
-
-Variants:
-
-This implementation of COM takes a simpler approach than the PHP 4 version;
-we only map a few native types to COM and vice-versa, leaving the more complex
-things as variants. This allows greater consistency of data when passing
-parameters to and from COM objects (no data will be lost). In addition, a
-large number of the variant API has been mapped to PHP space so that you can
-use it for working with the special variant decimal, currency and date time
-types. This could be used as a replacement for the bcmath extension, for
-example.
-
-You can use the new object casting hook to for a php-native representation of
-a variant object:
-
-$a = new variant(4);
-$b = new variant(6);
-$c = variant_add($a, $b);
-echo $c; // outputs 10 as a string, instead of Object
-
-Sample Script:
-
-<?php
-$word = new COM("word.application");
-print "Loaded Word, version {$word->Version}\n";
-$word->Visible = 1;
-$word->Documents->Add();
-$word->Selection->TypeText("This is a test...");
-$word->Documents[1]->SaveAs("Useless test.doc");
-$word->Quit();
-?>
-
-TODO:
-
-- documentation
-
-* dotnet support requires that you have the mscoree.h header from the .net sdk
- when you build the module.
diff --git a/ext/com_dotnet/com_olechar.c b/ext/com_dotnet/com_olechar.c
index f155f2ed45..31115e29c5 100644
--- a/ext/com_dotnet/com_olechar.c
+++ b/ext/com_dotnet/com_olechar.c
@@ -50,7 +50,7 @@ PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string, size_t str
This should be fixed by reallocating the olestring, but as emalloc is used, that doesn't
matter much. */
ok = MultiByteToWideChar(codepage, flags, string, (int)string_len, olestring, (int)string_len);
- if (ok > 0 && ok < string_len) {
+ if (ok > 0 && (size_t)ok < string_len) {
olestring[ok] = '\0';
}
} else {
diff --git a/ext/com_dotnet/com_variant.c b/ext/com_dotnet/com_variant.c
index b74e977f0e..04c7d5f8c1 100644
--- a/ext/com_dotnet/com_variant.c
+++ b/ext/com_dotnet/com_variant.c
@@ -176,7 +176,6 @@ PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codep
break;
case IS_RESOURCE:
- case IS_CONSTANT:
case IS_CONSTANT_AST:
default:
V_VT(v) = VT_NULL;
diff --git a/ext/com_dotnet/package.xml b/ext/com_dotnet/package.xml
deleted file mode 100644
index 2839447bbd..0000000000
--- a/ext/com_dotnet/package.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>com_dotnet</name>
- <summary>Com and .NET support functions for Windows</summary>
- <maintainers>
- <maintainer>
- <user>wez</user>
- <name>Wez Furlong</name>
- <email>wez@php.net</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <description>
-...
- </description>
- <license>PHP</license>
- <release>
- <state>beta</state>
- <version>5.0.0rc1</version>
- <date>2004-03-19</date>
- <notes>
-package.xml added to support installation using pear installer
- </notes>
- <filelist>
- <file role="doc" name="CREDITS"/>
- <file role="doc" name="README"/>
- <file role="src" name="config.w32"/>
- <file role="src" name="com_com.c"/>
- <file role="src" name="com_dotnet.c"/>
- <file role="src" name="com_extension.c"/>
- <file role="src" name="com_handlers.c"/>
- <file role="src" name="com_misc.c"/>
- <file role="src" name="com_olechar.c"/>
- <file role="src" name="com_typeinfo.c"/>
- <file role="src" name="com_variant.c"/>
- <file role="src" name="com_iterator.c"/>
- <file role="src" name="com_saproxy.c"/>
- <file role="src" name="com_wrapper.c"/>
- <file role="src" name="php_com_dotnet.h"/>
- <file role="src" name="php_com_dotnet_internal.h"/>
- <file role="test" name="tests/variants.phpt"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5" />
- <!-- doesn't work yet <dep type="os" rel="has" name="windows"/> -->
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/ctype/package.xml b/ext/ctype/package.xml
deleted file mode 100644
index 62a9812be7..0000000000
--- a/ext/ctype/package.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>ctype</name>
- <summary>Character type detection</summary>
- <maintainers>
- <maintainer>
- <user>hholzgra</user>
- <name>Hartmut Holzgraefe</name>
- <email>hartmut@php.net</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <description>
-The functions provided by this extension check whether a
-character or string falls into a certain character class
-according to the current locale.
- </description>
- <license>PHP</license>
- <release>
- <state>beta</state>
- <version>5.0.0rc1</version>
- <date>2004-03-19</date>
- <notes>
-package.xml added to support installation using pear installer
- </notes>
- <filelist>
- <file role="doc" name="CREDITS"/>
- <file role="doc" name="README"/>
- <file role="src" name="config.m4"/>
- <file role="src" name="config.w32"/>
- <file role="src" name="ctype.c"/>
- <file role="src" name="php_ctype.h"/>
- <file role="test" name="tests/001.phpt"/>
- <file role="test" name="tests/002.phpt"/>
- <file role="test" name="tests/bug25745.phpt"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5" />
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index 0d1152b987..fa30e45e04 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -210,7 +210,7 @@ static int php_curl_option_url(php_curl *ch, const char *url, const size_t len)
return FAILURE;
}
- if (uri->scheme && !strncasecmp("file", uri->scheme, sizeof("file"))) {
+ if (uri->scheme && zend_string_equals_literal_ci(uri->scheme, "file")) {
php_error_docref(NULL, E_WARNING, "Protocol 'file' disabled in cURL");
php_url_free(uri);
return FAILURE;
diff --git a/ext/curl/package.xml b/ext/curl/package.xml
deleted file mode 100644
index f54abaf872..0000000000
--- a/ext/curl/package.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>curl</name>
- <summary>Clib PDF functions</summary>
- <maintainers>
- <maintainer>
- <user>sterling</user>
- <name>Sterling Hughes</name>
- <email>sterling@php.net</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <description>
-PHP supports libcurl, a library created by Daniel Stenberg,
-that allows you to connect and communicate to many different
-types of servers with many different types of protocols.
-libcurl currently supports the http, https, ftp, gopher,
-telnet, dict, file, and ldap protocols. libcurl also supports
-HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading (this
-can also be done with PHP's ftp extension), HTTP form based
-upload, proxies, cookies, and user+password authentication.
- </description>
- <license>PHP</license>
- <release>
- <state>beta</state>
- <version>5.0rc1</version>
- <date>2004-03-19</date>
- <notes>
-package.xml added to support installation using pear installer
- </notes>
- <configureoptions>
- <configureoption name="with-curl" default="autodetect" prompt="path to curl installation?"/>
- </configureoptions>
- <filelist>
- <file role="doc" name="CREDITS"/>
- <file role="src" name="config.m4"/>
- <file role="src" name="config.w32"/>
- <file role="src" name="interface.c"/>
- <file role="src" name="multi.c"/>
- <file role="src" name="share.c"/>
- <file role="src" name="streams.c"/>
- <file role="src" name="php_curl.h"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5" />
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/curl/tests/curl_multi_close_basic001.phpt b/ext/curl/tests/curl_multi_close_basic001.phpt
new file mode 100644
index 0000000000..0cabf2cbad
--- /dev/null
+++ b/ext/curl/tests/curl_multi_close_basic001.phpt
@@ -0,0 +1,25 @@
+--TEST--
+curl_multi_close return false when suplied resorce not valid cURL multi handle
+--SKIPIF--
+<?php
+if (!extension_loaded('curl')) print 'skip';
+?>
+--FILE--
+<?php
+$cmh = curl_multi_init();
+var_dump($cmh);
+$multi_close_result = curl_multi_close($cmh);
+var_dump($multi_close_result);
+var_dump($cmh);
+$bad_mh_close_result = curl_multi_close($cmh);
+var_dump($bad_mh_close_result);
+?>
+===DONE===
+--EXPECTF--
+resource(%d) of type (curl_multi)
+NULL
+resource(%d) of type (Unknown)
+
+Warning: curl_multi_close(): supplied resource is not a valid cURL Multi Handle resource in %s on line %d
+bool(false)
+===DONE===
diff --git a/ext/curl/tests/curl_share_close_basic001.phpt b/ext/curl/tests/curl_share_close_basic001.phpt
new file mode 100644
index 0000000000..8addd5de4e
--- /dev/null
+++ b/ext/curl/tests/curl_share_close_basic001.phpt
@@ -0,0 +1,19 @@
+--TEST--
+curl_share_close basic test
+--SKIPIF--
+<?php if( !extension_loaded( 'curl' ) ) print 'skip'; ?>
+--FILE--
+<?php
+
+$sh = curl_share_init();
+//Show that there's a curl_share resource
+var_dump($sh);
+
+curl_share_close($sh);
+//Show that resource is no longer a curl_share, and is therefore unusable and "closed"
+var_dump($sh);
+
+?>
+--EXPECTF--
+resource(%d) of type (curl_share)
+resource(%d) of type (Unknown) \ No newline at end of file
diff --git a/ext/date/TODO b/ext/date/TODO
deleted file mode 100644
index a585b05516..0000000000
--- a/ext/date/TODO
+++ /dev/null
@@ -1,5 +0,0 @@
-- Port over my 200 test cases to .phpt format.
-- Write an error handler for unexpected characters while parsing dates.
-- Cache lookups for timezone information.
-- Make sure that date_default_timezone_set() validates the passed timezone
- identifier.
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index ab6c288943..68235c4968 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -310,6 +310,11 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_date_method_timestamp_get, 0)
ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_date_method_create_from_immutable, 0, 0, 1)
+ ZEND_ARG_INFO(0, DateTimeImmutable)
+ZEND_END_ARG_INFO()
+
ZEND_BEGIN_ARG_INFO_EX(arginfo_date_method_create_from_mutable, 0, 0, 1)
ZEND_ARG_INFO(0, DateTime)
ZEND_END_ARG_INFO()
@@ -473,6 +478,7 @@ const zend_function_entry date_funcs_date[] = {
PHP_ME(DateTime, __construct, arginfo_date_create, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC)
PHP_ME(DateTime, __wakeup, NULL, ZEND_ACC_PUBLIC)
PHP_ME(DateTime, __set_state, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
+ PHP_ME(DateTime, createFromImmutable, arginfo_date_method_create_from_immutable, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
PHP_ME_MAPPING(createFromFormat, date_create_from_format, arginfo_date_create_from_format, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
PHP_ME_MAPPING(getLastErrors, date_get_last_errors, arginfo_date_get_last_errors, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
PHP_ME_MAPPING(format, date_format, arginfo_date_method_format, 0)
@@ -1752,6 +1758,10 @@ PHP_FUNCTION(gmstrftime)
Return current UNIX timestamp */
PHP_FUNCTION(time)
{
+ if (zend_parse_parameters_none() == FAILURE) {
+ return;
+ }
+
RETURN_LONG((zend_long)time(NULL));
}
/* }}} */
@@ -2842,7 +2852,28 @@ PHP_METHOD(DateTimeImmutable, __construct)
}
/* }}} */
-/* {{{ proto DateTimeImmutable::createFromMutable(DateTimeZone object)
+/* {{{ proto DateTime::createFromImmutable(DateTimeImmutable object)
+ Creates new DateTime object from an existing immutable DateTimeImmutable object.
+*/
+PHP_METHOD(DateTime, createFromImmutable)
+{
+ zval *datetimeimmutable_object = NULL;
+ php_date_obj *new_obj = NULL;
+ php_date_obj *old_obj = NULL;
+
+ ZEND_PARSE_PARAMETERS_START(1, 1)
+ Z_PARAM_OBJECT_OF_CLASS(datetimeimmutable_object, date_ce_immutable)
+ ZEND_PARSE_PARAMETERS_END();
+
+ php_date_instantiate(date_ce_date, return_value);
+ old_obj = Z_PHPDATE_P(datetimeimmutable_object);
+ new_obj = Z_PHPDATE_P(return_value);
+
+ new_obj->time = timelib_time_clone(old_obj->time);
+}
+/* }}} */
+
+/* {{{ proto DateTimeImmutable::createFromMutable(DateTime object)
Creates new DateTimeImmutable object from an existing mutable DateTime object.
*/
PHP_METHOD(DateTimeImmutable, createFromMutable)
@@ -2859,14 +2890,7 @@ PHP_METHOD(DateTimeImmutable, createFromMutable)
old_obj = Z_PHPDATE_P(datetime_object);
new_obj = Z_PHPDATE_P(return_value);
- new_obj->time = timelib_time_ctor();
- *new_obj->time = *old_obj->time;
- if (old_obj->time->tz_abbr) {
- new_obj->time->tz_abbr = timelib_strdup(old_obj->time->tz_abbr);
- }
- if (old_obj->time->tz_info) {
- new_obj->time->tz_info = old_obj->time->tz_info;
- }
+ new_obj->time = timelib_time_clone(old_obj->time);
}
/* }}} */
@@ -4850,6 +4874,9 @@ PHP_FUNCTION(date_default_timezone_set)
PHP_FUNCTION(date_default_timezone_get)
{
timelib_tzinfo *default_tz;
+ if (zend_parse_parameters_none() == FAILURE) {
+ return;
+ }
default_tz = get_timezone_info();
RETVAL_STRING(default_tz->name);
diff --git a/ext/date/php_date.h b/ext/date/php_date.h
index 827d0b9deb..6f39a333d9 100644
--- a/ext/date/php_date.h
+++ b/ext/date/php_date.h
@@ -53,6 +53,7 @@ PHP_FUNCTION(getdate);
PHP_METHOD(DateTime, __construct);
PHP_METHOD(DateTime, __wakeup);
PHP_METHOD(DateTime, __set_state);
+PHP_METHOD(DateTime, createFromImmutable);
PHP_FUNCTION(date_create);
PHP_FUNCTION(date_create_immutable);
PHP_FUNCTION(date_create_from_format);
diff --git a/ext/date/tests/DateTime_createFromImmutable.phpt b/ext/date/tests/DateTime_createFromImmutable.phpt
new file mode 100644
index 0000000000..ee7731855a
--- /dev/null
+++ b/ext/date/tests/DateTime_createFromImmutable.phpt
@@ -0,0 +1,32 @@
+--TEST--
+Tests for DateTime::createFromImmutable.
+--INI--
+date.timezone=Europe/London
+--FILE--
+<?php
+$current = "2014-03-02 16:24:08";
+$i = date_create_immutable( $current );
+
+$m = DateTime::createFromImmutable( $i );
+var_dump( $m );
+
+$m->modify('+ 1 hour');
+
+var_dump( $i->format('Y-m-d H:i:s') === $current );
+
+$m = DateTime::createFromImmutable( date_create( $current ) );
+var_dump( $m );
+?>
+--EXPECTF--
+object(DateTime)#%d (3) {
+ ["date"]=>
+ string(26) "2014-03-02 16:24:08.000000"
+ ["timezone_type"]=>
+ int(3)
+ ["timezone"]=>
+ string(13) "Europe/London"
+}
+bool(true)
+
+Warning: DateTime::createFromImmutable() expects parameter 1 to be DateTimeImmutable, object given in %stests%eDateTime_createFromImmutable.php on line %d
+NULL
diff --git a/ext/date/tests/DateTime_verify.phpt b/ext/date/tests/DateTime_verify.phpt
index bb3ed9909a..b8626623ef 100644
--- a/ext/date/tests/DateTime_verify.phpt
+++ b/ext/date/tests/DateTime_verify.phpt
@@ -27,7 +27,7 @@ object(ReflectionClass)#%d (1) {
string(8) "DateTime"
}
..and get names of all its methods
-array(18) {
+array(19) {
[0]=>
object(ReflectionMethod)#%d (2) {
["name"]=>
@@ -52,104 +52,111 @@ array(18) {
[3]=>
object(ReflectionMethod)#%d (2) {
["name"]=>
- string(16) "createFromFormat"
+ string(19) "createFromImmutable"
["class"]=>
string(8) "DateTime"
}
[4]=>
object(ReflectionMethod)#%d (2) {
["name"]=>
- string(13) "getLastErrors"
+ string(16) "createFromFormat"
["class"]=>
string(8) "DateTime"
}
[5]=>
object(ReflectionMethod)#%d (2) {
["name"]=>
- string(6) "format"
+ string(13) "getLastErrors"
["class"]=>
string(8) "DateTime"
}
[6]=>
object(ReflectionMethod)#%d (2) {
["name"]=>
- string(6) "modify"
+ string(6) "format"
["class"]=>
string(8) "DateTime"
}
[7]=>
object(ReflectionMethod)#%d (2) {
["name"]=>
- string(3) "add"
+ string(6) "modify"
["class"]=>
string(8) "DateTime"
}
[8]=>
object(ReflectionMethod)#%d (2) {
["name"]=>
- string(3) "sub"
+ string(3) "add"
["class"]=>
string(8) "DateTime"
}
[9]=>
object(ReflectionMethod)#%d (2) {
["name"]=>
- string(11) "getTimezone"
+ string(3) "sub"
["class"]=>
string(8) "DateTime"
}
[10]=>
object(ReflectionMethod)#%d (2) {
["name"]=>
- string(11) "setTimezone"
+ string(11) "getTimezone"
["class"]=>
string(8) "DateTime"
}
[11]=>
object(ReflectionMethod)#%d (2) {
["name"]=>
- string(9) "getOffset"
+ string(11) "setTimezone"
["class"]=>
string(8) "DateTime"
}
[12]=>
object(ReflectionMethod)#%d (2) {
["name"]=>
- string(7) "setTime"
+ string(9) "getOffset"
["class"]=>
string(8) "DateTime"
}
[13]=>
object(ReflectionMethod)#%d (2) {
["name"]=>
- string(7) "setDate"
+ string(7) "setTime"
["class"]=>
string(8) "DateTime"
}
[14]=>
object(ReflectionMethod)#%d (2) {
["name"]=>
- string(10) "setISODate"
+ string(7) "setDate"
["class"]=>
string(8) "DateTime"
}
[15]=>
object(ReflectionMethod)#%d (2) {
["name"]=>
- string(12) "setTimestamp"
+ string(10) "setISODate"
["class"]=>
string(8) "DateTime"
}
[16]=>
object(ReflectionMethod)#%d (2) {
["name"]=>
- string(12) "getTimestamp"
+ string(12) "setTimestamp"
["class"]=>
string(8) "DateTime"
}
[17]=>
object(ReflectionMethod)#%d (2) {
["name"]=>
+ string(12) "getTimestamp"
+ ["class"]=>
+ string(8) "DateTime"
+ }
+ [18]=>
+ object(ReflectionMethod)#%d (2) {
+ ["name"]=>
string(4) "diff"
["class"]=>
string(8) "DateTime"
diff --git a/ext/date/tests/date_default_timezone_get_error.phpt b/ext/date/tests/date_default_timezone_get_error.phpt
index 1d96d18cd7..e45722a06c 100644
--- a/ext/date/tests/date_default_timezone_get_error.phpt
+++ b/ext/date/tests/date_default_timezone_get_error.phpt
@@ -22,6 +22,8 @@ var_dump( date_default_timezone_get($extra_arg));
*** Testing date_default_timezone_get() : error conditions ***
-- Testing date_create() function with more than expected no. of arguments --
-string(3) "UTC"
-===Done=== \ No newline at end of file
+Warning: date_default_timezone_get() expects exactly 0 parameters, 1 given in %sdate_default_timezone_get_error.php on line %d
+NULL
+
+===Done===
diff --git a/ext/date/tests/time_error.phpt b/ext/date/tests/time_error.phpt
index 853c1babe7..b1d136feb2 100644
--- a/ext/date/tests/time_error.phpt
+++ b/ext/date/tests/time_error.phpt
@@ -15,5 +15,7 @@ var_dump (time($extra_arg));
===DONE===
--EXPECTF--
Too many arguments
-int(%d)
-===DONE=== \ No newline at end of file
+
+Warning: time() expects exactly 0 parameters, 1 given in %stime_error.php on line %d
+NULL
+===DONE===
diff --git a/ext/dom/examples/dom1.inc b/ext/dom/examples/dom1.inc
deleted file mode 100644
index 792d6f2dbc..0000000000
--- a/ext/dom/examples/dom1.inc
+++ /dev/null
@@ -1,43 +0,0 @@
-<?PHP
-$xmlstr = "<?xml version='1.0' standalone='yes'?>
-<!DOCTYPE chapter SYSTEM '/share/sgml/Norman_Walsh/db3xml10/db3xml10.dtd'
-[ <!ENTITY sp \"spanish\">
-]>
-<!-- lsfj -->
-<chapter language='en'><title language='en'>Title</title>
-<para language='ge'>
-&sp;
-<!-- comment -->
-<informaltable language='&sp;kkk'>
-<tgroup cols='3'>
-<tbody>
-<row><entry>a1</entry><entry morerows='1'>b1</entry><entry>c1</entry></row>
-<row><entry>a2</entry><entry>c2</entry></row>
-<row><entry>a3</entry><entry>b3</entry><entry>c3</entry></row>
-</tbody>
-</tgroup>
-</informaltable>
-</para>
-</chapter> ";
-
-function print_node($node)
-{
- print "Node Name: " . $node->nodeName;
- print "\nNode Type: " . $node->nodeType;
- $child_count = $node->childNodes->length;
- print "\nNum Children: " . $child_count;
- if($child_count <= 1){
- print "\nNode Content: " . $node->nodeValue;
- }
- print "\n\n";
-}
-
-function print_node_list($nodelist)
-{
- foreach($nodelist as $node)
- {
- print_node($node);
- }
-}
-
-?>
diff --git a/ext/dom/examples/dom1.php b/ext/dom/examples/dom1.php
deleted file mode 100644
index 8ea367458d..0000000000
--- a/ext/dom/examples/dom1.php
+++ /dev/null
@@ -1,94 +0,0 @@
-<?php
-require_once("dom1.inc");
-
-echo "Test 1: accessing single nodes from php\n";
-$dom = new domDocument;
-$dom->loadxml($xmlstr);
-if(!$dom) {
- echo "Error while parsing the document\n";
- exit;
-}
-
-// children() of of document would result in a memleak
-//$children = $dom->children();
-//print_node_list($children);
-
-echo "--------- root\n";
-$rootnode = $dom->documentElement;
-print_node($rootnode);
-
-echo "--------- children of root\n";
-$children = $rootnode->childNodes;
-print_node_list($children);
-
-// The last node should be identical with the last entry in the children array
-echo "--------- last\n";
-$last = $rootnode->lastChild;
-print_node($last);
-
-// The parent of this last node is the root again
-echo "--------- parent\n";
-$parent = $last->parentNode;
-print_node($parent);
-
-// The children of this parent are the same children as one above
-echo "--------- children of parent\n";
-$children = $parent->childNodes;
-print_node_list($children);
-
-echo "--------- creating a new attribute\n";
-//This is worthless
-//$attr = $dom->createAttribute("src", "picture.gif");
-//print_r($attr);
-
-//$rootnode->set_attributeNode($attr);
-$attr = $rootnode->setAttribute("src", "picture.gif");
-$attr = $rootnode->getAttribute("src");
-print_r($attr);
-print "\n";
-
-echo "--------- Get Attribute Node\n";
-$attr = $rootnode->getAttributeNode("src");
-print_node($attr);
-
-echo "--------- Remove Attribute Node\n";
-$attr = $rootnode->removeAttribute("src");
-print "Removed " . $attr . " attributes.\n";
-
-echo "--------- attributes of rootnode\n";
-$attrs = $rootnode->attributes;
-print_node_list($attrs);
-
-echo "--------- children of an attribute\n";
-$children = $attrs->item(0)->childNodes;
-print_node_list($children);
-
-echo "--------- Add child to root\n";
-$myelement = new domElement("Silly", "Symphony");
-$newchild = $rootnode->appendChild($myelement);
-print_node($newchild);
-print $dom->saveXML();
-print "\n";
-
-echo "--------- Find element by tagname\n";
-echo " Using dom\n";
-$children = $dom->getElementsByTagname("Silly");
-print_node_list($children);
-
-echo " Using elem\n";
-$children = $rootnode->getElementsByTagName("Silly");
-print_node_list($children);
-
-echo "--------- Unlink Node\n";
-print_node($children->item(0));
-$rootnode->removeChild($children->item(0));
-print_node_list($rootnode->childNodes);
-print $dom->savexml();
-
-echo "--------- Find element by id\n";
-print ("Not implemented\n");
-
-echo "--------- Check various node_name return values\n";
-print ("Not needed\n");
-
-?>
diff --git a/ext/dom/examples/note-invalid.xml b/ext/dom/examples/note-invalid.xml
deleted file mode 100644
index 58d4e65044..0000000000
--- a/ext/dom/examples/note-invalid.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE note SYSTEM "note.dtd">
-<note>
-<to>PHP User Group</to>
-<from>Shane</from>
-<heading>Reminder</heading>
-<body>Don't forget the meeting tonight!</body>
-<footer>Or I'll clobber you!</footer>
-</note>
diff --git a/ext/dom/examples/note.dtd b/ext/dom/examples/note.dtd
deleted file mode 100644
index c2d558eee4..0000000000
--- a/ext/dom/examples/note.dtd
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!ELEMENT note (to,from,heading,body)>
-<!ELEMENT to (#PCDATA)>
-<!ELEMENT from (#PCDATA)>
-<!ELEMENT heading (#PCDATA)>
-<!ELEMENT body (#PCDATA)>
diff --git a/ext/dom/examples/note.php b/ext/dom/examples/note.php
deleted file mode 100644
index a8695f3664..0000000000
--- a/ext/dom/examples/note.php
+++ /dev/null
@@ -1,19 +0,0 @@
-<?php
-
-$dom = new domDocument;
-$dom->load('note.xml');
-if (!$dom->validate('note.dtd')) {
- print "Document note.dtd is not valid\n";
-} else {
- print "Document note.dtd is valid\n";
-}
-
-$dom = new domDocument;
-$dom->load('note-invalid.xml');
-if (!$dom->validate('note.dtd')) {
- print "Document note-invalid.xml is not valid\n";
-} else {
- print "Document note-invalid.xml is valid\n";
-}
-
-?>
diff --git a/ext/dom/examples/note.xml b/ext/dom/examples/note.xml
deleted file mode 100644
index 49614a1b52..0000000000
--- a/ext/dom/examples/note.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE note SYSTEM "note.dtd">
-<note>
-<to>PHP User Group</to>
-<from>Shane</from>
-<heading>Reminder</heading>
-<body>Don't forget the meeting tonight!</body>
-</note>
diff --git a/ext/dom/examples/relaxNG.php b/ext/dom/examples/relaxNG.php
deleted file mode 100644
index d265fd988e..0000000000
--- a/ext/dom/examples/relaxNG.php
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-$dom = new domDocument;
-$dom->load('relaxNG.xml');
-if (!$dom->relaxNGValidate('relaxNG.rng')) {
- print "Document is not valid";
-} else {
- print "Document is valid";
-}
-
-?> \ No newline at end of file
diff --git a/ext/dom/examples/relaxNG.rng b/ext/dom/examples/relaxNG.rng
deleted file mode 100644
index f4357e04ef..0000000000
--- a/ext/dom/examples/relaxNG.rng
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<grammar xmlns="http://relaxng.org/ns/structure/1.0"
- datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
-
-<include href="relaxNG2.rng">
-<define name="TEI.prose"><ref name="INCLUDE"/></define>
-</include>
-</grammar>
-
-
-
diff --git a/ext/dom/examples/relaxNG.xml b/ext/dom/examples/relaxNG.xml
deleted file mode 100644
index 6b0cac1225..0000000000
--- a/ext/dom/examples/relaxNG.xml
+++ /dev/null
@@ -1 +0,0 @@
-<TEI.2>hello</TEI.2> \ No newline at end of file
diff --git a/ext/dom/examples/relaxNG2.rng b/ext/dom/examples/relaxNG2.rng
deleted file mode 100644
index 4adae7b151..0000000000
--- a/ext/dom/examples/relaxNG2.rng
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<grammar xmlns="http://relaxng.org/ns/structure/1.0" xmlns:t="http://www.thaiopensource.com/ns/annotations" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
-
- <start>
- <ref name="TEI.2"/>
- </start>
- <define name="IGNORE">
- <notAllowed/>
- </define>
- <define name="INCLUDE">
- <empty/>
- </define>
-
-
- <include href="relaxNG3.rng"/>
-
- <define name="TEI.2">
- <element name="TEI.2">
- <text/>
- </element>
- </define>
-
-</grammar> \ No newline at end of file
diff --git a/ext/dom/examples/relaxNG3.rng b/ext/dom/examples/relaxNG3.rng
deleted file mode 100644
index 73e1eb6165..0000000000
--- a/ext/dom/examples/relaxNG3.rng
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<grammar xmlns="http://relaxng.org/ns/structure/1.0" xmlns:t="http://www.thaiopensource.com/ns/annotations" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
-
- <define name="TEI.prose" combine="interleave">
- <ref name="IGNORE"/>
- </define>
-
-</grammar> \ No newline at end of file
diff --git a/ext/dom/examples/shipping.php b/ext/dom/examples/shipping.php
deleted file mode 100644
index 5205fd2014..0000000000
--- a/ext/dom/examples/shipping.php
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-$dom = new domDocument;
-$dom->load('shipping.xml');
-if (!$dom->schemaValidate('shipping.xsd')) {
- print "Document is not valid";
-} else {
- print "Document is valid";
-}
-
-?> \ No newline at end of file
diff --git a/ext/dom/examples/shipping.xml b/ext/dom/examples/shipping.xml
deleted file mode 100644
index dc8a09e301..0000000000
--- a/ext/dom/examples/shipping.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0"?>
-<shipOrder>
- <shipTo>
- <name>Tove Svendson</name>
- <street>Ragnhildvei 2</street>
- <address>4000 Stavanger</address>
- <country>Norway</country>
- </shipTo>
- <items>
- <item>
- <title>Empire Burlesque</title>
- <quantity>1</quantity>
- <price>10.90</price>
- </item>
- <item>
- <title>Hide your heart</title>
- <quantity>1</quantity>
- <price>9.90</price>
- </item>
- </items>
-</shipOrder> \ No newline at end of file
diff --git a/ext/dom/examples/shipping.xsd b/ext/dom/examples/shipping.xsd
deleted file mode 100644
index 8b16b7c03a..0000000000
--- a/ext/dom/examples/shipping.xsd
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0"?>
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-
- <xsd:element name="shipOrder" type="order"/>
-
- <xsd:complexType name="order">
- <xsd:all>
- <xsd:element name="shipTo" type="shipAddress"/>
- <xsd:element name="items" type="cdItems"/>
- </xsd:all>
- </xsd:complexType>
-
- <xsd:complexType name="shipAddress">
- <xsd:all>
- <xsd:element name="name" type="xsd:string"/>
- <xsd:element name="street" type="xsd:string"/>
- <xsd:element name="address" type="xsd:string"/>
- <xsd:element name="country" type="xsd:string"/>
- </xsd:all>
- </xsd:complexType>
-
- <xsd:complexType name="cdItems">
- <xsd:sequence>
- <xsd:element name="item" type="cdItem" maxOccurs="unbounded" minOccurs="1"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="cdItem">
- <xsd:all>
- <xsd:element name="title" type="xsd:string"/>
- <xsd:element name="quantity" type="xsd:positiveInteger"/>
- <xsd:element name="price" type="xsd:decimal"/>
- </xsd:all>
- </xsd:complexType>
-
-</xsd:schema> \ No newline at end of file
diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c
index 77f918ae9b..9892285cbb 100644
--- a/ext/dom/php_dom.c
+++ b/ext/dom/php_dom.c
@@ -1105,8 +1105,7 @@ zend_object *dom_xpath_objects_new(zend_class_entry *class_type)
{
dom_xpath_object *intern = ecalloc(1, sizeof(dom_xpath_object) + zend_object_properties_size(class_type));
- ALLOC_HASHTABLE(intern->registered_phpfunctions);
- zend_hash_init(intern->registered_phpfunctions, 0, NULL, ZVAL_PTR_DTOR, 0);
+ intern->registered_phpfunctions = zend_new_array(0);
intern->dom.prop_handler = &dom_xpath_prop_handlers;
intern->dom.std.handlers = &dom_xpath_object_handlers;
diff --git a/ext/dom/xpath.c b/ext/dom/xpath.c
index 068ca61bfe..57d1c8796a 100644
--- a/ext/dom/xpath.c
+++ b/ext/dom/xpath.c
@@ -204,8 +204,7 @@ static void dom_xpath_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs,
xmlNode *nodep;
dom_object *obj;
if (intern->node_list == NULL) {
- ALLOC_HASHTABLE(intern->node_list);
- zend_hash_init(intern->node_list, 0, NULL, ZVAL_PTR_DTOR, 0);
+ intern->node_list = zend_new_array(0);
}
Z_ADDREF(retval);
zend_hash_next_index_insert(intern->node_list, &retval);
diff --git a/ext/enchant/docs/examples/example1.php b/ext/enchant/docs/examples/example1.php
deleted file mode 100644
index 048cc83a1a..0000000000
--- a/ext/enchant/docs/examples/example1.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-$tag = 'en_US';
-$r = enchant_broker_init();
-$bprovides = enchant_broker_describe($r);
-echo "Current broker provides the following backend(s):\n";
-print_r($bprovides);
-
-
-if (enchant_broker_dict_exists($r,$tag)) {
- $d = enchant_broker_request_dict($r, $tag);
- $dprovides = enchant_dict_describe($d);
- echo "dictionary $tag provides:\n";
- $spellerrors = enchant_dict_check($d, "soong");
- print_r($dprovides);
- echo "found $spellerrors spell errors\n";
- if (spellerrors) {
- $suggs = enchant_dict_suggest($d, "soong");
- echo "Suggestions for 'soong':";
- print_r($suggs);
- }
- enchant_broker_free_dict($d);
-} else {
-}
-enchant_broker_free($r);
-?>
diff --git a/ext/enchant/package.xml b/ext/enchant/package.xml
deleted file mode 100755
index 1012839382..0000000000
--- a/ext/enchant/package.xml
+++ /dev/null
@@ -1,162 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<package xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" packagerversion="1.4.8" version="2.0" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
- <name>enchant</name>
- <channel>pecl.php.net</channel>
- <summary>libenchant binder, support near all spelling tools</summary>
- <description>Enchant is a binder for libenchant. Libenchant provides a common
-API for many spell libraries:
-- aspell/pspell (intended to replace ispell)
-- hspell (hebrew)
-- ispell
-- myspell/hunspell (OpenOffice project, mozilla)
-- uspell (primarily Yiddish, Hebrew, and Eastern European languages)
-A plugin system allows to add custom spell support.
-see www.abisource.com/enchant/
- </description>
- <lead>
- <name>Pierre-Alain Joye</name>
- <user>pajoye</user>
- <email>paj@pearfr.org</email>
- <active>yes</active>
- </lead>
- <lead>
- <name>Ilia Alshanetsky</name>
- <user>iliaa</user>
- <email>ilia@php.net</email>
- <active>yes</active>
- </lead>
- <date>2008-04-16</date>
- <version>
- <release>1.0.2</release>
- <api>1.1.0</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <license uri="http://www.php.net/license">PHP</license>
- <notes>- #13181, Leaving a context frees the dictionnary resources
-- Fix protos descriptions in the sources
-</notes>
- <contents>
- <dir name="/">
- <dir name="docs">
- <dir name="examples">
- <file name="example1.php" role="doc"/>
- </dir>
- <!-- //docs/examples -->
- </dir>
- <!-- //docs -->
- <file name="config.m4" role="src"/>
- <file name="config.w32" role="src"/>
- <file name="CREDITS" role="doc"/>
- <file name="enchant.c" role="src"/>
- <file name="php_enchant.h" role="src"/>
- <dir name="tests">
- <file name="broker_describe.phpt" role="test"/>
- <file name="broker_free.phpt" role="test"/>
- <file name="broker_init.phpt" role="test"/>
- <file name="broker_request_dict.phpt" role="test"/>
- <file name="hindi_correct.txt" role="test"/>
- <file name="hindi_incorrect.txt" role="test"/>
- <file name="bug13181.phpt" role="test"/>
- </dir>
- </dir>
- <!-- / -->
- </contents>
- <dependencies>
- <required>
- <php>
- <min>5</min>
- </php>
- <pearinstaller>
- <min>1.4.0b1</min>
- </pearinstaller>
- </required>
- </dependencies>
- <providesextension>enchant</providesextension>
- <extsrcrelease>
- <configureoption default="shared" name="with-enchant" prompt="libenchant prefix?"/>
- </extsrcrelease>
- <changelog>
- <release>
- <date>2006-03-21</date>
- <version>
- <release>1.0.1</release>
- <api>1.1.0</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <license uri="http://www.php.net/license">PHP</license>
- <notes>- add enchant_broker_list_dicts to get a list of available dictionaries
-- fix compilation warnings
-- add examples
-- add tests</notes>
- </release>
- <release>
- <date>2004-08-11</date>
- <version>
- <release>1.0</release>
- <api>1.0</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <license uri="http://www.php.net/license">PHP</license>
- <notes>- Fixed leak inside MINFO function.
-- Fixed crash inside enchant_dict_suggest() when there are no suggestions.
-- Added missing safe_mode/open_basedir check inside enchant_broker_request_pwl_dict().
-- Fixed various function prototypes.
-- Fixed possible leak in suggestions result.
- </notes>
- </release>
- <release>
- <version>
- <release>0.2.1</release>
- <api>0.2.1</api>
- </version>
- <stability>
- <release>beta</release>
- <api>beta</api>
- </stability>
- <date>2004-03-11</date>
- <license uri="http://www.php.net/license">PHP</license>
- <notes>- Fix possible leak in suggestions result
-- Move to beta status
- </notes>
- </release>
- <release>
- <version>
- <release>0.2.0</release>
- <api>0.2.0</api>
- </version>
- <stability>
- <release>alpha</release>
- <api>alpha</api>
- </stability>
- <date>2006-03-21</date>
- <license uri="http://www.php.net/license">PHP</license>
- <notes>- Add Ilia Alshanetsky as maintainer
-- Cleanup sources codes (ilia)
-- Add enchant_dict_quick_check (ilia)
- </notes>
- </release>
- <release>
- <version>
- <release>0.1</release>
- <api>0.1</api>
- </version>
- <stability>
- <release>alpha</release>
- <api>alpha</api>
- </stability>
- <date>2003-03-08</date>
- <license uri="http://www.php.net/license">PHP</license>
- <notes>Initial release
- </notes>
- </release>
- </changelog>
-</package>
diff --git a/ext/enchant/tests/broker_describe.phpt b/ext/enchant/tests/broker_describe.phpt
index 224902f579..721d618df3 100644
--- a/ext/enchant/tests/broker_describe.phpt
+++ b/ext/enchant/tests/broker_describe.phpt
@@ -4,8 +4,25 @@ enchant_broker_describe() function
marcosptf - <marcosptf@yahoo.com.br>
--SKIPIF--
<?php
-if(!extension_loaded('enchant')) die('skip, enchant not loader');
-if(!enchant_broker_init()) die("failed, broker_init failure\n");
+if (!extension_loaded('enchant')) {
+ echo "skip: Enchant extension not enabled\n";
+ exit;
+}
+
+$broker = enchant_broker_init();
+
+if (!$broker) {
+ echo "skip: Unable to init broker\n";
+ exit;
+}
+
+if (!enchant_broker_describe($broker)) {
+ enchant_broker_free($broker);
+
+ echo "skip: No broker providers found\n";
+}
+
+enchant_broker_free($broker);
?>
--FILE--
<?php
@@ -30,6 +47,8 @@ if($broker) {
echo "failed, brocker describe array \n";
}
+ enchant_broker_free($broker);
+
} else {
echo("failed, broker_init failure\n");
}
diff --git a/ext/enchant/tests/broker_list_dicts.phpt b/ext/enchant/tests/broker_list_dicts.phpt
index a634734a58..3b29a5d5e5 100644
--- a/ext/enchant/tests/broker_list_dicts.phpt
+++ b/ext/enchant/tests/broker_list_dicts.phpt
@@ -4,8 +4,25 @@ enchant_broker_list_dicts() function
marcosptf - <marcosptf@yahoo.com.br>
--SKIPIF--
<?php
-if(!extension_loaded('enchant')) die('skip, enchant not loader');
-if (!is_resource(enchant_broker_init())) {die("skip, resource dont load\n");}
+if (!extension_loaded('enchant')) {
+ echo "skip: Enchant extension not enabled\n";
+ exit;
+}
+
+$broker = enchant_broker_init();
+
+if (!$broker) {
+ echo "skip: Unable to init broker\n";
+ exit;
+}
+
+if (!enchant_broker_list_dicts($broker)) {
+ enchant_broker_free($broker);
+
+ echo "skip: No broker dicts installed\n";
+}
+
+enchant_broker_free($broker);
?>
--FILE--
<?php
diff --git a/ext/enchant/tests/bug13181.phpt b/ext/enchant/tests/bug13181.phpt
index 38aec636cf..79b28333d2 100644
--- a/ext/enchant/tests/bug13181.phpt
+++ b/ext/enchant/tests/bug13181.phpt
@@ -2,9 +2,26 @@
bug #13181, leaving a context frees the broker resources
--SKIPIF--
<?php
-if(!extension_loaded('enchant')) die('skip, enchant not loader');
+if (!extension_loaded('enchant')) {
+ echo "skip: Enchant extension not enabled\n";
+ exit;
+}
+
+$broker = enchant_broker_init();
+
+if (!$broker) {
+ echo "skip: Unable to init broker\n";
+ exit;
+}
- ?>
+if (!enchant_broker_list_dicts($broker)) {
+ enchant_broker_free($broker);
+
+ echo "skip: No broker dicts installed\n";
+}
+
+enchant_broker_free($broker);
+?>
--FILE--
<?php
function get_dictionnary() {
diff --git a/ext/exif/example.php b/ext/exif/example.php
deleted file mode 100644
index e34dc05f6d..0000000000
--- a/ext/exif/example.php
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-// (c) M.Boerger
-//
-// $Id$
-//
-?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional">
-<html>
-<head>
-<title>exif_read_data example</title>
-</head>
-<body>
-<?php
-$exif = exif_read_data ('tests/test1.jpg','IFD0');
-echo $exif===false ? "No header data found.<br>\n" : "Image contains headers<br>";
-$exif = exif_read_data ('tests/test2.jpg',0,true);
-foreach($exif as $key=>$section) {
- foreach($section as $name=>$val) {
- echo "$key.$name: $val<br>\n";
- }
-}
-?>
-</body>
-</html> \ No newline at end of file
diff --git a/ext/exif/package.xml b/ext/exif/package.xml
deleted file mode 100644
index 68ba9c1bbf..0000000000
--- a/ext/exif/package.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>exif</name>
- <summary>Read header information from JPEG and DIFF headers</summary>
- <maintainers>
- <maintainer>
- <user>rasmus</user>
- <name>Rasmus Lerdorf</name>
- <email>helly@php.net</email>
- <role>lead</role>
- </maintainer>
- <maintainer>
- <user>helly</user>
- <name>Markus Boerger</name>
- <email>helly@php.net</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <description>
-The EXIF functions provide access to information stored in headers
-of JPEG and TIFF images. This way you can read meta data generated
-by digital cameras and certain image processing applications.
- </description>
- <license>PHP</license>
- <release>
- <state>beta</state>
- <version>5.0.0rc1</version>
- <date>2004-03-19</date>
- <notes>
-package.xml added to support installation using pear installer
- </notes>
- <filelist>
- <file role="doc" name="CREDITS"/>
- <file role="doc" name="example.php"/>
- <file role="src" name="config.m4"/>
- <file role="src" name="config.w32"/>
- <file role="src" name="exif.c"/>
- <file role="src" name="php_exif.h"/>
- <file role="test" name="tests/exif000.phpt"/>
- <file role="test" name="tests/exif001.phpt"/>
- <file role="test" name="tests/test1.jpg"/>
- <file role="test" name="tests/exif002.phpt"/>
- <file role="test" name="tests/test2.jpg"/>
- <file role="test" name="tests/exif003.phpt"/>
- <file role="test" name="tests/test3.jpg"/>
- <file role="test" name="tests/exif004.phpt"/>
- <file role="test" name="tests/test4.jpg"/>
- <file role="test" name="tests/exif005.phpt"/>
- <file role="test" name="tests/test5.jpg"/>
- <file role="test" name="tests/exif006.phpt"/>
- <file role="test" name="tests/test6.jpg"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5" />
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/exif/test.php b/ext/exif/test.php
deleted file mode 100644
index 907b9ea080..0000000000
--- a/ext/exif/test.php
+++ /dev/null
@@ -1,3 +0,0 @@
-<?php
- include 'test.txt';
-?> \ No newline at end of file
diff --git a/ext/exif/test.txt b/ext/exif/test.txt
deleted file mode 100644
index 1c12b509e6..0000000000
--- a/ext/exif/test.txt
+++ /dev/null
@@ -1,365 +0,0 @@
-<?php
-
-/* Test script for PHP module ext/exif
- *
- * (c) Marcus Boerger, 2002
- *
- * $Id$
- *
- * Rename the file to test.php and read the instructions. If the
- * script cannot be executed or does not generate any output check
- * you error log. In most cases this would mean you found an error
- * if the rest of your php environment works fine.
- *
- * The original version of module exif has many errors and mostly
- * fails on executing this script.
- */
-
-$file = array_key_exists('thumbnail',$_REQUEST) ? $_REQUEST['thumbnail'] : '';
-//$file = '/t/temp/kodak-dc4800.tif';
-//$file = '/t/temp/canon-ixus.jpg';
-//$file = '/t/temp/test2.jpg';
-if ( $file) {
- $image = exif_thumbnail($file);
- if ( $image!==false) {
- @Header("content-type: image/jpeg");
- echo $image;
- } else {
- echo "<html><body><table>\n";
- echo "Thumbnail could not be extracted.\n";
- echo "</table></body></html>";
- }
- die();
-}
-
-if ( !defined('IMAGETYPE_GIF')) define('IMAGETYPE_GIF',1);
-if ( !defined('IMAGETYPE_JPEG')) define('IMAGETYPE_JPEG',2);
-if ( !defined('IMAGETYPE_TIFF_II')) define('IMAGETYPE_TIFF_II',7);
-if ( !defined('IMAGETYPE_TIFF_MM')) define('IMAGETYPE_TIFF_MM',8);
-
-$possible = array();
-
-/****************************************************************************/
-// message function is used for debugging purpose: just to se what happens
-function message($msg) {
- error_log($msg,0);
- echo "$msg\n";
-}
-
-function error_msg() {
- $ret = '<b style="color:green">O.K.</b>';
- if (array_key_exists('php_errormsg',$GLOBALS) && strlen($GLOBALS['php_errormsg'])) {
- $ret = '<b style="color:red">'.$GLOBALS['php_errormsg'].'</b>';
- $GLOBALS['php_errormsg'] = '';
- }
- return $ret;
-}
-
-/****************************************************************************/
-// private to function search_file()
-function _search_file($root,&$possible,$path='') {
- $sub = array();
- $cnt = 0;
- $type= false;
-
- //error_log("search_file($root,$path)",0);
- if ($dir = @opendir($root.$path.'/')) {
- while (($found = @readdir($dir)) !== false) {
- $type = @filetype($root.$path.'/'.$found);
- //error_log("search_file($root$path):$type=$found",0);
- switch( $type) {
- case 'file':
- $pos = strrpos($found,'.');
- if ( function_exists('exif_imagetype')) {
- $type = exif_imagetype($root.$path.'/'.$found);
- } else {
- if ( $pos!==false) {
- $type = GetImageSize($root.$path.'/'.$found);
- if ( is_array($type)) {
- $type = $type[2];
- } else {
- $type = false;
- }
- } else $type = false;
- }
- if ( $type!==false)
- {
- $possible[] = array('file'=>$root.$path.'/'.$found, 'type'=>$type);
- //error_log("search_file($root$path) add:$path/$found",0);
- if ( ($cnt=count($possible)) % 100 == 0) {
- error_log("exif test page - counting files: $cnt",0);
- }
- }
- break;
- case 'dir':
- if ( $found!='.' && $found!='..') {
- $sub[count($sub)] = $found;
- }
- break;
- }
- }
- @closedir($dir);
- foreach( $sub as $idx => $found) {
- _search_file($root,$possible,$path.'/'.$found);
- }
- }
-}
-
-/****************************************************************************/
-// function: search_file($file,$ext)
-//
-// Searches for $file in document tree. The path is ignored.
-//
-function search_file() {
- global $argc, $argv;
- $possible = array();
-
- if ( $argc > 1) {
- $path = $argv[1];
- } else if ( array_key_exists('SCRIPT_FILENAME',$_SERVER)) {
- $path = $_SERVER['SCRIPT_FILENAME'];
- //error_log("SCRIPT_FILENAME($path)",0);
- } else {
- $path = $argv[0];
- //error_log("argv($path)",0);
- }
- if ( ($p=strpos($path,'?')) !== false) $path = substr($path,0,$p);
- if ( ($p=strrpos($path,'/')) /*< strlen($path)-1*/) $path = substr($path,0,$p);
- error_log("exif test page - counting files in $path");
- _search_file($path,$possible);
- error_log("exif test page - counting files: ".count($possible)." done.",0);
- return $possible;
-}
-
-/****************************************************************************/
-// function: search_file($file,$ext)
-//
-// Searches for $file in document tree. The path is ignored.
-//
-function AddInfo($Name,$Value,$highlight=0) {
- if (is_array($Value)) $Value = 'Array: ('.join(',',$Value).')';
- $Value = nl2br($Value);
- if ( $highlight) {
- $Name = "<th>$Name</th>";
- } else {
- $Name = "<td>$Name</td>";
- }
- return "<tr>$Name<td>$Value&nbsp;</td></tr>\n";
-}
-
-$possible = search_file();
-
-$title = "PHP module exif test page";
-
-?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional">
-<html>
-<head>
-<title><?=$title ?></title>
-<style type="text/css">
-body {
- font-size: 12pt;
-}
-h1 {
- font-size: 20pt;
- font-weight:bold;
-}
-h2 {
- font-size: 16pt;
- font-weight:bold;
-}
-th {
- text-align: left;
-}
-ul {
- margin-bottom: 6pt;
-}
-</style>
-</head>
-<body>
-<h1><?=$title ?></h1>
-<h2>(c) Marcus B&ouml;rger, 2002</h2>
-</p>
-<p>
-Images taken from <a href="http://www.exif.org">www.exif.org</a>,
-<a href="http://marcus-boerger.de">marcus-boerger.de</a>
-all rights reserved by their authors and artists, see exif headers.
-The files can be downloaded <a href="http://marcus-boerger.de/php/ext/exif/test/">here</a>.
-To start the test you simple have to put all images into the same directory as this script.
-The test will work with all files in that directory and all subdirectories. To test private
-images just put them into that directory.
-</p>
-<p>
-Youmay take a look at the test <a href="http://marcus-boerger.de/php/ext/exif/test.txt">source here</a>.
-</p>
-<p>
-This test just prooves that some exif headers can be scanned.
-If all files produce a header in output the module might be o.k.
-</p>
-<p>
-What to look for in detail:
-</p>
-<ul>
-<li>kodak-dc4800-plus-acdsee.jpg
- <ul>
- <li>should provide a <b>long</b> comment 'by marcus b&ouml;rger&lt;%04i&gt;'*n</li>
- <li>this file returns an array but it also produces an errormessage because ACDSee destroys
- the integrity of IFD directory (size of directory and offsets of entries following any
- edited entry maybe wrong).
- </li>
- </ul>
-</li>
-<li>hp-photosmart.jpg
- <ul>
- <li>should provide a <b>two line</b> copyright notice</li>
- </ul>
-</li>
-<li>olympus-d320l
- <ul>
- <li>should provide an <b>APP12</b> infoset</li>
- </ul>
-</li>
-<li>unknown.jpg
- <ul>
- <li>should provide an <b>empty</b> comment, this is a comment section and not an IFD0, EXIF or GPS section</li>
- </ul>
-</li>
-<li>some images
- <ul>
- <li>have empty fields, that is the tag is present but no data is stored</li>
- </ul>
-</li>
-</ul>
-<h2>function exif_tagname</h2>
-<table border='1' cellspacing='0' cellpadding='3' summary="EXIF headernames">
-<?php
-if (function_exists('exif_tagname')) {
-?>
-<tr><td>ImageWidth</td><td><?=@exif_tagname(0x0100)?></td><td><?=error_msg()?></td></tr>
-<tr><td>JPEGProc</td><td><?=@exif_tagname(0x0200)?></td><td><?=error_msg()?></td></tr>
-<tr><td>SceneType</td><td><?=@exif_tagname(0xA301)?></td><td><?=error_msg()?></td></tr>
-<tr><td>false</td><td><?=@exif_tagname(0x0000)===false?'false':'value'?></td><td><?=error_msg()?></td></tr>
-<?php
-} else {
- echo "<tr><td>function exif_tagname is not supported</td></tr>\n";
-}
-?>
-</table>
-<br clear="all">
-<h2>function exif_read_data for <?=count($possible)?> images</h2>
-
-<?php
-$check_getimagesize = false;
-$check_exif_thumbnail = true;
-$check_exif_read_data = false;
-$fast_output = false;
-if (function_exists('exif_read_data')) {
- $num = 0;
- echo "<table border='1' cellspacing='0' cellpadding='3' summary='function results'>\n";
- $tab2 = "";//"<table border='1' cellspacing='0' cellpadding='3' summary='EXIF information'>\n";
- $types = array('','GIF','JPEG','PNG','SWF','PSD','BMP','TIFF_II','TIFF_MM','JPC','JP2','JPX','JB2');
- foreach($possible as $idx => $file) {
- $type = $file['type'];
- $file = $file['file'];
- if ( !((++$num)%100)) error_log("exif test page - checking files: $num",0);
- $error = '';
- $len = 2;
- $rows = 1
- + ($check_getimagesize ? 1 : 0)
- + ($check_exif_thumbnail ? 1 : 0)
- + ($check_exif_read_data ? 1 : 0);
- if ( !$fast_output) echo "<tr><td rowspan='$rows' valign='top'>$num</td><th colspan='2'>$file</th></tr>\n";
- if ($check_getimagesize) {
- $len++;
- $size = GetImageSize($file);
- $error = error_msg();// clear message
- if ( $size === false) {
- $error = '<b style="color:red">GetImageSize returned false</b><br>'.$error;
- $res_getimagesize = $error;
- } else {
- $res_getimagesize = '('.join($size,',').')';
- }
- if ( !$fast_output) echo AddInfo("GetImageSize",$error,1);
- }
- if ( $check_exif_thumbnail) {
- $len++;
- if ($type!=IMAGETYPE_JPEG) {// && $type!=IMAGETYPE_TIFF_II && $type!=IMAGETYPE_TIFF_MM) {
- $error = "<b style='color: green'>filetype not supported: $types[$type]</b>";
- $res_exif_thumbnail = $error;
- } else {
- $t_width = 0;
- $t_height = 0;
- $result = exif_thumbnail($file, $t_width, $t_height);
- $error = error_msg();// clear message
- if ( $result === false) {
- $error = '<b style="color:red">exif_thumbnail returned false</b><br>'.$error;
- if ( $t_width && $t_height) {
- $error = "<b style='color:green'>$t_width x $t_height</b><br>$error";
- }
- $res_exif_thumbnail = $error;
- } else {
- $res_exif_thumbnail = $t_width . " x " . $t_height;
- }
- }
- if ( !$fast_output) echo AddInfo("exif_thumbnail",$error,1);
- }
- if ($check_exif_read_data) {
- $len++;
- if ($type!=IMAGETYPE_JPEG && $type!=IMAGETYPE_TIFF_II && $type!=IMAGETYPE_TIFF_MM) {
- $res_exif_read_data = "<b style='color: green'>filetype not supported: $types[$type]</b>";
- if ( !$fast_output) echo AddInfo("exif_read_data",$res_exif_read_data);
- $res = '';
- } else {
- $image = exif_read_data($file,'COMMENT,IFD0,EXIF,APP12',true);
- $error = error_msg();// clear message
- if ( !$fast_output) echo AddInfo("exif_read_data",$error,1);
- $res = '';
- if ( $image === false) {
- $res_exif_read_data = "<b style='color:red'>exif_read_data returned false</b><br>$error";
- } else {
- $res_exif_read_data = $error;
- // ah no!$error = error_msg(); // force o.k.
- foreach($image as $Name => $Value) {
- if ( $Name!='Thumbnail') {
- if ( is_array($Value)) {
- $len++;
- $res .= AddInfo($Name,'Array('.count($Value).')');
- foreach( $Value as $idx => $Entry) {
- if ($idx==='Thumbnail') $Entry = '&lt;data&gt;';
- $len++;
- $res .= AddInfo($Name.':'.$idx,$Entry);
- }
- } else {
- $len++;
- $res .= AddInfo($Name,$Value);
- }
- }
- }
- }
- }
- }
- $tab2 .= "<tr><td rowspan='$len' valign='top'>$num</td></tr>\n";
- $tab2 .= "<tr><th colspan='2'>$file</th></tr>\n";
- if ($check_getimagesize) {
- $tab2 .= "<tr><th>GetImageSize</th><td>$res_getimagesize</td></tr>\n";
- }
- if ($check_exif_thumbnail) {
- $tab2 .= "<tr><th>exif_thumbnail</th><td>$res_exif_thumbnail</td></tr>\n";
- }
- if ($check_exif_read_data) {
- $tab2 .= "<tr><th>exif_read_data</th><td>$res_exif_read_data</td></tr>\n";
- $tab2 .= $res;
- }
- if ( $fast_output) {
- echo $tab2;
- $tab2 = '';
- }
- }
- error_log("exif test page - checking files: ".count($possible)." done.",0);
- echo $tab2;
- echo "</table>\n";
-} else {
- echo "<h1 style='color:red'>function exif_read_data is not supported</h1>\n";
-}
-?>
-</body>
-</html> \ No newline at end of file
diff --git a/ext/exif/tests/bug64739.jpg b/ext/exif/tests/bug64739.jpg
new file mode 100644
index 0000000000..65273e6127
--- /dev/null
+++ b/ext/exif/tests/bug64739.jpg
Binary files differ
diff --git a/ext/exif/tests/bug64739.phpt b/ext/exif/tests/bug64739.phpt
new file mode 100644
index 0000000000..453cc88495
--- /dev/null
+++ b/ext/exif/tests/bug64739.phpt
@@ -0,0 +1,42 @@
+--TEST--
+Bug #64739 (Invalid Title and Author data returned)
+--SKIPIF--
+<?php
+extension_loaded("exif") or die("skip need exif");
+if (!extension_loaded('mbstring')) die('skip mbstring extension not available');
+?>
+--FILE--
+<?php
+echo "Test\n";
+
+$headers1 = exif_read_data(__DIR__ . '/bug64739.jpg');
+
+if ($headers1 === false) {
+ echo 'Error, failed to read exif data';
+ exit;
+}
+
+var_dump($headers1['Title']{0} === '?');
+var_dump($headers1['Author']{0} === '?');
+
+ini_set('exif.decode_unicode_motorola', 'UCS-2LE');
+
+$headers2 = exif_read_data(__DIR__ . '/bug64739.jpg');
+
+if ($headers2 === false) {
+ echo 'Error, failed to read exif data';
+ exit;
+}
+
+var_dump($headers2['Title']);
+var_dump($headers2['Author']);
+
+?>
+Done
+--EXPECTF--
+Test
+bool(true)
+bool(true)
+string(8) "55845364"
+string(13) "100420.000000"
+Done \ No newline at end of file
diff --git a/ext/ext_skel b/ext/ext_skel
deleted file mode 100755
index d1b8a2874c..0000000000
--- a/ext/ext_skel
+++ /dev/null
@@ -1,332 +0,0 @@
-#!/bin/sh
-
-givup() {
- echo $*
- exit 1
-}
-
-usage() {
-echo "$0 --extname=module [--proto=file] [--stubs=file] [--xml[=file]]"
-echo " [--skel=dir] [--full-xml] [--no-help]"
-echo ""
-echo " --extname=module module is the name of your extension"
-echo " --proto=file file contains prototypes of functions to create"
-echo " --stubs=file generate only function stubs in file"
-echo " --xml generate xml documentation to be added to phpdoc-svn"
-echo " --skel=dir path to the skeleton directory"
-echo " --full-xml generate xml documentation for a self-contained extension"
-echo " (not yet implemented)"
-echo " --no-help don't try to be nice and create comments in the code"
-echo " and helper functions to test if the module compiled"
-exit 1
-}
-
-if test $# = 0; then
- usage
-fi
-
-while test $# -gt 0; do
- case "$1" in
- -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
- *) optarg= ;;
- esac
-
- case $1 in
- --extname=?*)
- extname=$optarg
- EXTNAME=`echo $extname | tr "[:lower:]" "[:upper:]"`
- ;;
- --proto=?*)
- proto=$optarg
- ;;
- --stubs=*)
- stubs=yes
- stubfile=$optarg
- ;;
- --xml)
- xml="yes"
- ;;
- --xml=?*)
- xml=$optarg
- ;;
- --full-xml)
- full_xml="yes"
- ;;
- --no-help)
- no_help="yes"
- ;;
- --skel=?*)
- skel_dir=$optarg
- ;;
- *)
- usage
- ;;
- esac
- shift
-done
-
-if test -d "$extname" ; then
- givup "Directory $extname already exists."
-fi
-
-if test -z "$skel_dir"; then
- skel_dir="skeleton"
-fi
-
-## convert skel_dir to full path
-skel_dir=`cd $skel_dir && pwd`
-
-test -d $skel_dir || givup "directory $skel_dir does not exist or is not directory"
-
-if echo '\c' | grep -s c >/dev/null 2>&1
-then
- ECHO_N="echo -n"
- ECHO_C=""
-else
- ECHO_N="echo"
- ECHO_C='\c'
-fi
-
-if test -z "$stubs"; then
- echo "Creating directory $extname"
- stubfile=$extname"/function_stubs"
- mkdir $extname || givup "Cannot create directory $extname"
-fi
-
-if test -n "$proto"; then
- cat $proto | awk -v extname=$extname -v stubs=$stubs -v stubfile=$stubfile -v xml=$xml -v full_xml=$full_xml -v i_know_what_to_do_shut_up_i_dont_need_your_help_mode=$no_help -f $skel_dir/create_stubs
-fi
-
-if test -z "$stubs"; then
- cd $extname
- chmod 755 .
-
-$ECHO_N "Creating basic files:$ECHO_C"
-
-$ECHO_N " config.m4$ECHO_C"
-cat >config.m4 <<eof
-dnl \$Id\$
-dnl config.m4 for extension $extname
-
-dnl Comments in this file start with the string 'dnl'.
-dnl Remove where necessary. This file will not work
-dnl without editing.
-
-dnl If your extension references something external, use with:
-
-dnl PHP_ARG_WITH($extname, for $extname support,
-dnl Make sure that the comment is aligned:
-dnl [ --with-$extname Include $extname support])
-
-dnl Otherwise use enable:
-
-dnl PHP_ARG_ENABLE($extname, whether to enable $extname support,
-dnl Make sure that the comment is aligned:
-dnl [ --enable-$extname Enable $extname support])
-
-if test "\$PHP_$EXTNAME" != "no"; then
- dnl Write more examples of tests here...
-
- dnl # --with-$extname -> check with-path
- dnl SEARCH_PATH="/usr/local /usr" # you might want to change this
- dnl SEARCH_FOR="/include/$extname.h" # you most likely want to change this
- dnl if test -r \$PHP_$EXTNAME/\$SEARCH_FOR; then # path given as parameter
- dnl ${EXTNAME}_DIR=\$PHP_$EXTNAME
- dnl else # search default path list
- dnl AC_MSG_CHECKING([for $extname files in default path])
- dnl for i in \$SEARCH_PATH ; do
- dnl if test -r \$i/\$SEARCH_FOR; then
- dnl ${EXTNAME}_DIR=\$i
- dnl AC_MSG_RESULT(found in \$i)
- dnl fi
- dnl done
- dnl fi
- dnl
- dnl if test -z "\$${EXTNAME}_DIR"; then
- dnl AC_MSG_RESULT([not found])
- dnl AC_MSG_ERROR([Please reinstall the $extname distribution])
- dnl fi
-
- dnl # --with-$extname -> add include path
- dnl PHP_ADD_INCLUDE(\$${EXTNAME}_DIR/include)
-
- dnl # --with-$extname -> check for lib and symbol presence
- dnl LIBNAME=$extname # you may want to change this
- dnl LIBSYMBOL=$extname # you most likely want to change this
-
- dnl PHP_CHECK_LIBRARY(\$LIBNAME,\$LIBSYMBOL,
- dnl [
- dnl PHP_ADD_LIBRARY_WITH_PATH(\$LIBNAME, \$${EXTNAME}_DIR/\$PHP_LIBDIR, ${EXTNAME}_SHARED_LIBADD)
- dnl AC_DEFINE(HAVE_${EXTNAME}LIB,1,[ ])
- dnl ],[
- dnl AC_MSG_ERROR([wrong $extname lib version or lib not found])
- dnl ],[
- dnl -L\$${EXTNAME}_DIR/\$PHP_LIBDIR -lm
- dnl ])
- dnl
- dnl PHP_SUBST(${EXTNAME}_SHARED_LIBADD)
-
- PHP_NEW_EXTENSION($extname, $extname.c, \$ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
-fi
-eof
-
-$ECHO_N " config.w32$ECHO_C"
-cat >config.w32 <<eof
-// \$Id\$
-// vim:ft=javascript
-
-// If your extension references something external, use ARG_WITH
-// ARG_WITH("$extname", "for $extname support", "no");
-
-// Otherwise, use ARG_ENABLE
-// ARG_ENABLE("$extname", "enable $extname support", "no");
-
-if (PHP_$EXTNAME != "no") {
- EXTENSION("$extname", "$extname.c", PHP_EXTNAME_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
-}
-
-eof
-
-$ECHO_N " .gitignore$ECHO_C"
-cat >.gitignore <<eof
-.deps
-*.lo
-*.la
-.libs
-acinclude.m4
-aclocal.m4
-autom4te.cache
-build
-config.guess
-config.h
-config.h.in
-config.log
-config.nice
-config.status
-config.sub
-configure
-configure.ac
-include
-install-sh
-libtool
-ltmain.sh
-Makefile
-Makefile.fragments
-Makefile.global
-Makefile.objects
-missing
-mkinstalldirs
-modules
-run-tests.php
-tests/*/*.diff
-tests/*/*.out
-tests/*/*.php
-tests/*/*.exp
-tests/*/*.log
-tests/*/*.sh
-eof
-
-$ECHO_N " $extname.c$ECHO_C"
-echo "s/extname/$extname/g" > sedscript
-echo "s/EXTNAME/$EXTNAME/g" >> sedscript
-echo '/__function_entries_here__/r function_entries' >> sedscript
-echo '/__function_stubs_here__/r function_stubs' >> sedscript
-echo '/__header_here__/r ../../header' >> sedscript
-echo '/__footer_here__/r ../../footer' >> sedscript
-echo '/__function_entries_here__/D' >> sedscript
-echo '/__function_stubs_here__/D' >> sedscript
-echo '/__header_here__/D' >> sedscript
-echo '/__footer_here__/D' >> sedscript
-if [ ! -z "$no_help" ]; then
- echo "/confirm_$extname_compiled/D" >> sedscript
- echo '/Remove the following/,/^\*\//D' >> sedscript
- echo 's/[[:space:]]\/\*.\+\*\///' >> sedscript
- echo 's/^\/\*.*\*\/$//' >> sedscript
- echo '/^[[:space:]]*\/\*/,/^[[:space:]]*\*\//D' >> sedscript
-fi
-
-sed -f sedscript < $skel_dir/skeleton.c > $extname.c
-
-
-$ECHO_N " php_$extname.h$ECHO_C"
-echo "s/extname/$extname/g" > sedscript
-echo "s/EXTNAME/$EXTNAME/g" >> sedscript
-echo '/__function_declarations_here__/r function_declarations' >> sedscript
-echo '/__header_here__/r ../../header' >> sedscript
-echo '/__footer_here__/r ../../footer' >> sedscript
-echo '/__function_declarations_here__/D' >> sedscript
-echo '/__header_here__/D' >> sedscript
-echo '/__footer_here__/D' >> sedscript
-if [ ! -z "$no_help" ]; then
- echo "/confirm_$extname_compiled/D" >> sedscript
- echo 's/[[:space:]]\/\*.\+\*\///' >> sedscript
- echo 's/^\/\*.*\*\/$//' >> sedscript
- echo '/^[[:space:]]*\/\*/,/^[[:space:]]*\*\//D' >> sedscript
-fi
-sed -f sedscript <$skel_dir/php_skeleton.h > php_$extname.h
-
-$ECHO_N " CREDITS$ECHO_C"
-echo "s/extname/$extname/g" > sedscript
-sed -f sedscript <$skel_dir/CREDITS > CREDITS
-
-$ECHO_N " EXPERIMENTAL$ECHO_C"
-echo "s/extname/$extname/g" > sedscript
-sed -f sedscript <$skel_dir/EXPERIMENTAL > EXPERIMENTAL
-
-$ECHO_N " tests/001.phpt$ECHO_C"
-mkdir tests || givup "Cannot create tests directory"
-chmod 755 tests
-sed -f sedscript <$skel_dir/tests/001.phpt > tests/001.phpt
-
-if test -z "$stubs" && test -z "$no_help"; then
- $ECHO_N " $extname.php$ECHO_C"
- sed \
- -e "s/extname/$extname/g" \
- <$skel_dir/skeleton.php \
- > $extname.php
-fi
-
-rm sedscript
-
-if test -n "$proto"; then
- if test -z "$stubs"; then
- rm function_entries
- rm function_declarations
- rm function_stubs
- fi
- if test -f function_warning; then
- rm function_warning
- warning="
-NOTE! Because some arguments to functions were resources, the code generated
-cannot yet be compiled without editing. Please consider this to be step 4.5
-in the instructions above.
-"
- fi
-fi
-
-find . -type f | xargs chmod 644
-find . -type d | xargs chmod 755
-fi
-
-echo " [done]."
-
-if test -z "$no_help" && test -z "$stubs"; then
- cat <<eof
-
-To use your new extension, you will have to execute the following steps:
-
-1. $ cd ..
-2. $ vi ext/$extname/config.m4
-3. $ ./buildconf
-4. $ ./configure --[with|enable]-$extname
-5. $ make
-6. $ ./sapi/cli/php -f ext/$extname/$extname.php
-7. $ vi ext/$extname/$extname.c
-8. $ make
-
-Repeat steps 3-6 until you are satisfied with ext/$extname/config.m4 and
-step 6 confirms that your module is compiled into PHP. Then, start writing
-code and repeat the last two steps as often as necessary.
-$warning
-eof
-fi
diff --git a/ext/ext_skel.php b/ext/ext_skel.php
new file mode 100644
index 0000000000..b12c1af57d
--- /dev/null
+++ b/ext/ext_skel.php
@@ -0,0 +1,365 @@
+<?php
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 7 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2017 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Kalle Sommer Nielsen <kalle@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id$ */
+
+/* {{{ error
+ */
+function error($message) {
+ printf('Error: %s%s', $message, PHP_EOL);
+ exit;
+}
+/* }}} */
+
+/* {{{ print_help
+ */
+function print_help() {
+ printf('php ext_skel.php --ext <name> [--experimental] [--author <name>]%s', PHP_EOL);
+ printf(' [--dir <path>] [--std] [--onlyunix]%s', PHP_EOL);
+ printf(' [--onlywindows] [--help]%1$s%1$s', PHP_EOL);
+ printf(' --ext <name> The name of the extension defined as <name>%s', PHP_EOL);
+ printf(' --experimental Passed if this extension is experimental, this creates%s', PHP_EOL);
+ printf(' the EXPERIMENTAL file in the root of the extension%s', PHP_EOL);
+ printf(' --author <name> Your name, this is used if --header is passed and%s', PHP_EOL);
+ printf(' for the CREDITS file%s', PHP_EOL);
+ printf(' --dir <path> Path to the directory for where extension should be%s', PHP_EOL);
+ printf(' created. Defaults to the directory of where this script%s', PHP_EOL);
+ printf(' lives%s', PHP_EOL);
+ printf(' --std If passed, the standard header and vim rules footer used%s', PHP_EOL);
+ printf(' in extensions that is included in the core, will be used%s', PHP_EOL);
+ printf(' --onlyunix Only generate configure scripts for Unix%s', PHP_EOL);
+ printf(' --onlywindows Only generate configure scripts for Windows%s', PHP_EOL);
+ printf(' --help This help%s', PHP_EOL);
+
+ exit;
+}
+/* }}} */
+
+/* {{{ task
+ */
+function task($label, $callback) {
+ printf('%s... ', $label);
+
+ $callback();
+
+ printf('done%s', PHP_EOL);
+}
+/* }}} */
+
+/* {{{ print_success
+ */
+function print_success() {
+ global $options;
+
+ if (PHP_OS_FAMILY != 'Windows') {
+ $file_prefix = './';
+ $make_prefix = '';
+ } else {
+ $file_prefix = '';
+ $make_prefix = 'n';
+ }
+
+ printf('%1$sSuccess. The extension is now ready to be compiled into PHP. To do so, use the%s', PHP_EOL);
+ printf('following steps:%1$s%1$s', PHP_EOL);
+ printf('cd /path/to/php-src%s', PHP_EOL);
+ printf('%sbuildconf%s', $file_prefix, PHP_EOL);
+ printf('%sconfigure --enable-%s%s', $file_prefix, $options['ext'], PHP_EOL);
+ printf('%smake%2$s%2$s', $make_prefix, PHP_EOL);
+ printf('Don\'t forget to run tests once the compilation is done:%s', PHP_EOL);
+ printf('%smake test TESTS=ext/%s/tests%3$s%3$s', $make_prefix, $options['ext'], PHP_EOL);
+ printf('Thank you for using PHP!%s', PHP_EOL);
+}
+/* }}} */
+
+/* {{{ process_args
+ */
+function process_args($argv, $argc) {
+ $options = [
+ 'unix' => true,
+ 'windows' => true,
+ 'ext' => '',
+ 'dir' => __DIR__ . DIRECTORY_SEPARATOR,
+ 'skel' => __DIR__ . DIRECTORY_SEPARATOR . 'skeleton' . DIRECTORY_SEPARATOR,
+ 'author' => false,
+ 'experimental' => false,
+ 'std' => false
+ ];
+
+ for($i = 1; $i < $argc; ++$i)
+ {
+ $val = $argv[$i];
+
+ if($val{0} != '-' || $val{1} != '-')
+ {
+ continue;
+ }
+
+ switch($opt = strtolower(substr($val, 2)))
+ {
+ case 'help': {
+ print_help();
+ }
+ case 'onlyunix': {
+ $options['windows'] = false;
+ }
+ break;
+ case 'onlywindows': {
+ $options['unix'] = false;
+ }
+ break;
+ case 'experimental': {
+ $options['experimental'] = true;
+ }
+ break;
+ case 'std': {
+ $options['std'] = true;
+ }
+ break;
+ case 'ext':
+ case 'dir':
+ case 'author': {
+ if (!isset($argv[$i + 1]) || ($argv[$i + 1]{0} == '-' && $argv[$i + 1]{1} == '-')) {
+ error('Argument "' . $val . '" expects a value, none passed');
+ } else if ($opt == 'dir' && empty($argv[$i + 1])) {
+ continue;
+ }
+
+ $options[$opt] = ($opt == 'dir' ? realpath($argv[$i + 1]) : $argv[$i + 1]);
+ }
+ break;
+ default: {
+ error('Unsupported argument "' . $val . '" passed');
+ }
+ }
+ }
+
+ if (empty($options['ext'])) {
+ error('No extension name passed, use "--ext <name>"');
+ } else if (!$options['unix'] && !$options['windows']) {
+ error('Cannot pass both --onlyunix and --onlywindows');
+ } else if (!is_dir($options['skel'])) {
+ error('The skeleton directory was not found');
+ }
+
+ $options['ext'] = str_replace(['\\', '/'], '', strtolower($options['ext']));
+
+ return $options;
+}
+/* }}} */
+
+/* {{{ process_source_tags
+ */
+function process_source_tags($file, $short_name) {
+ global $options;
+
+ $source = file_get_contents($file);
+
+ if ($source === false) {
+ error('Unable to open file for reading: ' . $short_name);
+ }
+
+ $source = str_replace('%EXTNAME%', $options['ext'], $source);
+ $source = str_replace('%EXTNAMECAPS%', strtoupper($options['ext']), $source);
+
+ if (strpos($short_name, '.c') !== false || strpos($short_name, '.h') !== false) {
+ static $header, $footer;
+
+ if (!$header) {
+ if ($options['std']) {
+ $year = date('Y');
+ $author_len = strlen($options['author']);
+ $credits = $options['author'] . ($author_len && $author_len <= 60 ? str_repeat(' ', 60 - $author_len) : '');
+
+ $header = <<<"HEADER"
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 7 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-$year The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: $credits |
+ +----------------------------------------------------------------------+
+*/
+HEADER;
+ $footer = <<<'FOOTER'
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ */
+FOOTER;
+ } else {
+ if ($options['author']) {
+ $header = sprintf('/* %s extension for PHP (c) %d %s */', $options['ext'], date('Y'), $options['author']);
+ } else {
+ $header = sprintf('/* %s extension for PHP */', $options['ext']);
+ }
+
+ $footer = '';
+ }
+ }
+
+ $source = str_replace(['%HEADER%', '%FOOTER%'], [$header, $footer], $source);
+ }
+
+ if (!file_put_contents($file, $source)) {
+ error('Unable to save contents to file: ' . $short_name);
+ }
+}
+/* }}} */
+
+/* {{{ copy_config_scripts
+ */
+function copy_config_scripts() {
+ global $options;
+
+ $files = [];
+
+ if ($options['unix']) {
+ $files[] = 'config.m4';
+ }
+
+ if ($options['windows']) {
+ $files[] = 'config.w32';
+ }
+
+ if (!$files) {
+ return;
+ }
+
+ foreach($files as $config_script) {
+ $new_config_script = $options['dir'] . $options['ext'] . DIRECTORY_SEPARATOR . $config_script;
+
+ if (!copy($options['skel'] . $config_script . '.in', $new_config_script)) {
+ error('Unable to copy config script: ' . $config_script);
+ }
+
+ process_source_tags($new_config_script, $config_script);
+ }
+}
+/* }}} */
+
+/* {{{ copy_sources
+ */
+function copy_sources() {
+ global $options;
+
+ $files = [
+ 'skeleton.c' => $options['ext'] . '.c',
+ 'php_skeleton.h' => 'php_' . $options['ext'] . '.h'
+ ];
+
+ foreach ($files as $src_file => $dst_file) {
+ if (!copy($options['skel'] . $src_file, $options['dir'] . $options['ext'] . DIRECTORY_SEPARATOR . $dst_file)) {
+ error('Unable to copy source file: ' . $src_file);
+ }
+
+ process_source_tags($options['dir'] . $options['ext'] . DIRECTORY_SEPARATOR . $dst_file, $dst_file);
+ }
+}
+/* }}} */
+
+/* {{{ copy_tests
+ */
+function copy_tests() {
+ global $options;
+
+ $test_files = glob($options['skel'] . 'tests/*', GLOB_MARK);
+
+ if (!$test_files) {
+ return;
+ }
+
+ foreach ($test_files as $test) {
+ if (is_dir($test)) {
+ continue;
+ }
+
+ $new_test = str_replace([$options['skel'], '/'], ['', DIRECTORY_SEPARATOR], $test);
+
+ if (!copy($test, $options['dir'] . $options['ext'] . DIRECTORY_SEPARATOR . $new_test)) {
+ error('Unable to copy file: ' . $new_test);
+ }
+
+ process_source_tags($options['dir'] . $options['ext'] . DIRECTORY_SEPARATOR . $new_test, $new_test);
+ }
+}
+/* }}} */
+
+
+if (PHP_SAPI != 'cli') {
+ error('This script is only suited for CLI');
+}
+
+if ($argc < 1) {
+ print_help();
+ exit;
+}
+
+$options = process_args($argv, $argc);
+
+if (!$options['dir'] || !is_dir($options['dir'])) {
+ error('The selected output directory does not exists');
+} else if (is_dir($options['dir'] . $options['ext'])) {
+ error('There is already a folder named "' . $options['ext'] . '" in the output directory');
+} else if (!mkdir($options['dir'] . $options['ext'])) {
+ error('Unable to create extension directory in the output directory');
+} else if (!mkdir($options['dir'] . $options['ext'] . DIRECTORY_SEPARATOR . 'tests')) {
+ error('Unable to create the tests directory');
+}
+
+if ($options['experimental']) {
+ print('Creating EXPERIMENTAL... ');
+
+ if (file_put_contents($options['dir'] . $options['ext'] . DIRECTORY_SEPARATOR . 'EXPERIMENTAL', '') === false) {
+ error('Unable to create the EXPERIMENTAL file');
+ }
+
+ printf('done%s', PHP_EOL);
+}
+
+if (!empty($options['author'])) {
+ print('Creating CREDITS... ');
+
+ if (!file_put_contents($options['dir'] . $options['ext'] . DIRECTORY_SEPARATOR . 'CREDITS', $options['ext'] . PHP_EOL . $options['author'])) {
+ error('Unable to create the CREDITS file');
+ }
+
+ printf('done%s', PHP_EOL);
+}
+
+date_default_timezone_set('UTC');
+
+task('Copying config scripts', 'copy_config_scripts');
+task('Copying sources', 'copy_sources');
+task('Copying tests', 'copy_tests');
+
+print_success();
+
+?> \ No newline at end of file
diff --git a/ext/ext_skel_win32.php b/ext/ext_skel_win32.php
deleted file mode 100644
index 770c6f48bb..0000000000
--- a/ext/ext_skel_win32.php
+++ /dev/null
@@ -1,52 +0,0 @@
-<?php
-/* $Id$ */
-
-if (php_sapi_name() != "cli") {
- echo "Please run this script using the CLI version of PHP\n";
- exit;
-}
-/*
- This script can be used on Win32 systems
-
- 1) Make sure you have CygWin installed
- 2) Adjust the $cygwin_path to match your installation
- 3) Change the environment cariable PATHEXT to include .PHP
- 4) run ext_skel --extname=...
- the first time you run this script you will be asked to
- associate it with a program. chooses the CLI version of php.
-*/
-
-$cygwin_path = 'c:\cygwin\bin';
-
-$path = getenv("PATH");
-putenv("PATH=$cygwin_path;$path");
-
-array_shift($argv);
-system("sh ext_skel " . implode(" ", $argv));
-
-$extname = "";
-$skel = "skeleton";
-foreach($argv as $arg) {
- if (strtolower(substr($arg, 0, 9)) == "--extname") {
- $extname = substr($arg, 10);
- }
- if (strtolower(substr($arg, 0, 6)) == "--skel") {
- $skel = substr($arg, 7);
- }
-}
-
-$fp = fopen("$extname/$extname.php", "rb");
-if ($fp) {
- $php_file = fread($fp, filesize("$extname/$extname.php"));
- fclose($fp);
-
- $php_file = str_replace("dl('", "dl('php_", $php_file);
- $fp = fopen("$extname/$extname.php", "wb");
- if ($fp) {
- fwrite($fp, $php_file);
- fclose($fp);
- }
-}
-
-?>
-
diff --git a/ext/fileinfo/EXPERIMENTAL b/ext/fileinfo/EXPERIMENTAL
deleted file mode 100644
index e69de29bb2..0000000000
--- a/ext/fileinfo/EXPERIMENTAL
+++ /dev/null
diff --git a/ext/fileinfo/package.xml b/ext/fileinfo/package.xml
deleted file mode 100644
index a274e47161..0000000000
--- a/ext/fileinfo/package.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>Fileinfo</name>
- <summary>libmagic bindings</summary>
- <maintainers>
- <maintainer>
- <user>iliaa</user>
- <name>Ilia Alshanetsky</name>
- <email>ilia@php.net</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <description>
-This extension allows retrieval of information regarding vast majority of file.
-This information may include dimensions, quality, length etc...
-
-Additionally it can also be used to retrieve the mime type for a particular
-file and for text files proper language encoding.
- </description>
- <license>PHP</license>
- <release>
- <state>stable</state>
- <version>1.0.4</version>
- <date>2006-11-07</date>
- <notes>
- 1) Fixed detection of magic files
- 2) Fixed build problems with older version of libmagic
- </notes>
- <filelist>
- <file role="src" name="config.m4"/>
- <file role="src" name="fileinfo.c"/>
- <file role="src" name="php_fileinfo.h"/>
- <file role="doc" name="CREDITS"/>
- <file role="doc" name="EXPERIMENTAL"/>
- <file role="doc" name="fileinfo.php"/>
- </filelist>
- <deps>
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/filter/filter.c b/ext/filter/filter.c
index cdc5e15bb6..17fc500a9d 100644
--- a/ext/filter/filter.c
+++ b/ext/filter/filter.c
@@ -503,21 +503,21 @@ static void php_zval_filter_recursive(zval *value, zend_long filter, zend_long f
if (Z_TYPE_P(value) == IS_ARRAY) {
zval *element;
- if (Z_ARRVAL_P(value)->u.v.nApplyCount > 1) {
+ if (Z_IS_RECURSIVE_P(value)) {
return;
}
+ Z_PROTECT_RECURSION_P(value);
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(value), element) {
ZVAL_DEREF(element);
SEPARATE_ZVAL_NOREF(element);
if (Z_TYPE_P(element) == IS_ARRAY) {
- Z_ARRVAL_P(element)->u.v.nApplyCount++;
php_zval_filter_recursive(element, filter, flags, options, charset, copy);
- Z_ARRVAL_P(element)->u.v.nApplyCount--;
} else {
php_zval_filter(element, filter, flags, options, charset, copy);
}
} ZEND_HASH_FOREACH_END();
+ Z_UNPROTECT_RECURSION_P(value);
} else {
php_zval_filter(value, filter, flags, options, charset, copy);
}
diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c
index c203adc910..e0a858aad2 100644
--- a/ext/filter/logical_filters.c
+++ b/ext/filter/logical_filters.c
@@ -532,7 +532,8 @@ void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
RETURN_VALIDATION_FAILED
}
- if (url->scheme != NULL && (!strcasecmp(url->scheme, "http") || !strcasecmp(url->scheme, "https"))) {
+ if (url->scheme != NULL &&
+ (zend_string_equals_literal_ci(url->scheme, "http") || zend_string_equals_literal_ci(url->scheme, "https"))) {
char *e, *s, *t;
size_t l;
@@ -540,9 +541,9 @@ void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
goto bad_url;
}
- s = url->host;
- l = strlen(s);
- e = url->host + l;
+ s = ZSTR_VAL(url->host);
+ l = ZSTR_LEN(url->host);
+ e = s + l;
t = e - 1;
/* An IPv6 enclosed by square brackets is a valid hostname */
@@ -552,7 +553,7 @@ void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
}
// Validate domain
- if (!_php_filter_validate_domain(url->host, l, FILTER_FLAG_HOSTNAME)) {
+ if (!_php_filter_validate_domain(ZSTR_VAL(url->host), l, FILTER_FLAG_HOSTNAME)) {
php_url_free(url);
RETURN_VALIDATION_FAILED
}
@@ -561,7 +562,7 @@ void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
if (
url->scheme == NULL ||
/* some schemas allow the host to be empty */
- (url->host == NULL && (strcmp(url->scheme, "mailto") && strcmp(url->scheme, "news") && strcmp(url->scheme, "file"))) ||
+ (url->host == NULL && (strcmp(ZSTR_VAL(url->scheme), "mailto") && strcmp(ZSTR_VAL(url->scheme), "news") && strcmp(ZSTR_VAL(url->scheme), "file"))) ||
((flags & FILTER_FLAG_PATH_REQUIRED) && url->path == NULL) || ((flags & FILTER_FLAG_QUERY_REQUIRED) && url->query == NULL)
) {
bad_url:
diff --git a/ext/ftp/package.xml b/ext/ftp/package.xml
deleted file mode 100644
index 9b70e33229..0000000000
--- a/ext/ftp/package.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>ftp</name>
- <summary>File Transfer Protocol functions</summary>
- <maintainers>
- <maintainer>
- <user>???</user>
- <name>Andrew Skalski</name>
- <email>askalski@chek.com</email>
- <role>lead</role>
- </maintainer>
- <maintainer>
- <user>sesser</user>
- <name>Stefan Esser</name>
- <email>sesser@php.net</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <description>
-The functions in this extension implement client access to file
-servers speaking the File Transfer Protocol (FTP) as defined in
-http://www.faqs.org/rfcs/rfc959. This extension is meant for
-detailed access to an FTP server providing a wide range of
-control to the executing script. If you only wish to read from
-or write to a file on an FTP server, consider using the ftp://
-wrapper with the filesystem functions which provide a simpler
-and more intuitive interface.
- </description>
- <license>PHP</license>
- <release>
- <state>beta</state>
- <version>5.0.0rc1</version>
- <date>2004-03-19</date>
- <notes>
-package.xml added to support installation using pear installer
- </notes>
- <filelist>
- <file role="doc" name="CREDITS"/>
- <file role="doc" name="README"/>
- <file role="src" name="config.m4"/>
- <file role="src" name="config.w32"/>
- <file role="src" name="ftp.c"/>
- <file role="src" name="ftp.h"/>
- <file role="src" name="php_ftp.c"/>
- <file role="src" name="php_ftp.h"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5" />
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c
index eb6589ebc2..403b9602e8 100644
--- a/ext/ftp/php_ftp.c
+++ b/ext/ftp/php_ftp.c
@@ -126,7 +126,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_ftp_systype, 0)
ZEND_ARG_INFO(0, ftp)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_fget, 0, 0, 4)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_fget, 0, 0, 3)
ZEND_ARG_INFO(0, ftp)
ZEND_ARG_INFO(0, fp)
ZEND_ARG_INFO(0, remote_file)
@@ -134,7 +134,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_fget, 0, 0, 4)
ZEND_ARG_INFO(0, resumepos)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_nb_fget, 0, 0, 4)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_nb_fget, 0, 0, 3)
ZEND_ARG_INFO(0, ftp)
ZEND_ARG_INFO(0, fp)
ZEND_ARG_INFO(0, remote_file)
@@ -142,12 +142,12 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_nb_fget, 0, 0, 4)
ZEND_ARG_INFO(0, resumepos)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO(arginfo_ftp_pasv, 0)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_pasv, 0, 0, 1)
ZEND_ARG_INFO(0, ftp)
ZEND_ARG_INFO(0, pasv)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_get, 0, 0, 4)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_get, 0, 0, 3)
ZEND_ARG_INFO(0, ftp)
ZEND_ARG_INFO(0, local_file)
ZEND_ARG_INFO(0, remote_file)
@@ -155,7 +155,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_get, 0, 0, 4)
ZEND_ARG_INFO(0, resume_pos)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_nb_get, 0, 0, 4)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_nb_get, 0, 0, 3)
ZEND_ARG_INFO(0, ftp)
ZEND_ARG_INFO(0, local_file)
ZEND_ARG_INFO(0, remote_file)
@@ -167,7 +167,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_ftp_nb_continue, 0)
ZEND_ARG_INFO(0, ftp)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_fput, 0, 0, 4)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_fput, 0, 0, 3)
ZEND_ARG_INFO(0, ftp)
ZEND_ARG_INFO(0, remote_file)
ZEND_ARG_INFO(0, fp)
@@ -175,7 +175,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_fput, 0, 0, 4)
ZEND_ARG_INFO(0, startpos)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_nb_fput, 0, 0, 4)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_nb_fput, 0, 0, 3)
ZEND_ARG_INFO(0, ftp)
ZEND_ARG_INFO(0, remote_file)
ZEND_ARG_INFO(0, fp)
@@ -183,7 +183,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_nb_fput, 0, 0, 4)
ZEND_ARG_INFO(0, startpos)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_put, 0, 0, 4)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_put, 0, 0, 3)
ZEND_ARG_INFO(0, ftp)
ZEND_ARG_INFO(0, remote_file)
ZEND_ARG_INFO(0, local_file)
@@ -191,14 +191,14 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_put, 0, 0, 4)
ZEND_ARG_INFO(0, startpos)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_append, 0, 0, 4)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_append, 0, 0, 3)
ZEND_ARG_INFO(0, ftp)
ZEND_ARG_INFO(0, remote_file)
ZEND_ARG_INFO(0, local_file)
ZEND_ARG_INFO(0, mode)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_nb_put, 0, 0, 4)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ftp_nb_put, 0, 0, 3)
ZEND_ARG_INFO(0, ftp)
ZEND_ARG_INFO(0, remote_file)
ZEND_ARG_INFO(0, local_file)
@@ -824,7 +824,7 @@ PHP_FUNCTION(ftp_systype)
}
/* }}} */
-/* {{{ proto bool ftp_fget(resource stream, resource fp, string remote_file, int mode[, int resumepos])
+/* {{{ proto bool ftp_fget(resource stream, resource fp, string remote_file, [, int mode [, int resumepos]])
Retrieves a file from the FTP server and writes it to an open file */
PHP_FUNCTION(ftp_fget)
{
@@ -834,9 +834,9 @@ PHP_FUNCTION(ftp_fget)
php_stream *stream;
char *file;
size_t file_len;
- zend_long mode, resumepos=0;
+ zend_long mode=FTPTYPE_IMAGE, resumepos=0;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrsl|l", &z_ftp, &z_file, &file, &file_len, &mode, &resumepos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrs|ll", &z_ftp, &z_file, &file, &file_len, &mode, &resumepos) == FAILURE) {
return;
}
@@ -870,7 +870,7 @@ PHP_FUNCTION(ftp_fget)
}
/* }}} */
-/* {{{ proto int ftp_nb_fget(resource stream, resource fp, string remote_file, int mode[, int resumepos])
+/* {{{ proto int ftp_nb_fget(resource stream, resource fp, string remote_file [, int mode [, int resumepos]])
Retrieves a file from the FTP server asynchronly and writes it to an open file */
PHP_FUNCTION(ftp_nb_fget)
{
@@ -880,9 +880,9 @@ PHP_FUNCTION(ftp_nb_fget)
php_stream *stream;
char *file;
size_t file_len;
- zend_long mode, resumepos=0, ret;
+ zend_long mode=FTPTYPE_IMAGE, resumepos=0, ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrsl|l", &z_ftp, &z_file, &file, &file_len, &mode, &resumepos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrs|ll", &z_ftp, &z_file, &file, &file_len, &mode, &resumepos) == FAILURE) {
return;
}
@@ -944,7 +944,7 @@ PHP_FUNCTION(ftp_pasv)
}
/* }}} */
-/* {{{ proto bool ftp_get(resource stream, string local_file, string remote_file, int mode[, int resume_pos])
+/* {{{ proto bool ftp_get(resource stream, string local_file, string remote_file [, int mode [, int resume_pos]])
Retrieves a file from the FTP server and writes it to a local file */
PHP_FUNCTION(ftp_get)
{
@@ -954,9 +954,9 @@ PHP_FUNCTION(ftp_get)
php_stream *outstream;
char *local, *remote;
size_t local_len, remote_len;
- zend_long mode, resumepos=0;
+ zend_long mode=FTPTYPE_IMAGE, resumepos=0;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "rppl|l", &z_ftp, &local, &local_len, &remote, &remote_len, &mode, &resumepos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rpp|ll", &z_ftp, &local, &local_len, &remote, &remote_len, &mode, &resumepos) == FAILURE) {
return;
}
@@ -1009,7 +1009,7 @@ PHP_FUNCTION(ftp_get)
}
/* }}} */
-/* {{{ proto int ftp_nb_get(resource stream, string local_file, string remote_file, int mode[, int resume_pos])
+/* {{{ proto int ftp_nb_get(resource stream, string local_file, string remote_file, [, int mode [, int resume_pos]])
Retrieves a file from the FTP server nbhronly and writes it to a local file */
PHP_FUNCTION(ftp_nb_get)
{
@@ -1020,9 +1020,9 @@ PHP_FUNCTION(ftp_nb_get)
char *local, *remote;
size_t local_len, remote_len;
int ret;
- zend_long mode, resumepos=0;
+ zend_long mode=FTPTYPE_IMAGE, resumepos=0;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "rssl|l", &z_ftp, &local, &local_len, &remote, &remote_len, &mode, &resumepos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rss|ll", &z_ftp, &local, &local_len, &remote, &remote_len, &mode, &resumepos) == FAILURE) {
return;
}
@@ -1122,7 +1122,7 @@ PHP_FUNCTION(ftp_nb_continue)
}
/* }}} */
-/* {{{ proto bool ftp_fput(resource stream, string remote_file, resource fp, int mode[, int startpos])
+/* {{{ proto bool ftp_fput(resource stream, string remote_file, resource fp [, int mode [, int startpos]])
Stores a file from an open file to the FTP server */
PHP_FUNCTION(ftp_fput)
{
@@ -1130,11 +1130,11 @@ PHP_FUNCTION(ftp_fput)
ftpbuf_t *ftp;
ftptype_t xtype;
size_t remote_len;
- zend_long mode, startpos=0;
+ zend_long mode=FTPTYPE_IMAGE, startpos=0;
php_stream *stream;
char *remote;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsrl|l", &z_ftp, &remote, &remote_len, &z_file, &mode, &startpos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsr|ll", &z_ftp, &remote, &remote_len, &z_file, &mode, &startpos) == FAILURE) {
return;
}
@@ -1171,7 +1171,7 @@ PHP_FUNCTION(ftp_fput)
}
/* }}} */
-/* {{{ proto int ftp_nb_fput(resource stream, string remote_file, resource fp, int mode[, int startpos])
+/* {{{ proto int ftp_nb_fput(resource stream, string remote_file, resource fp [, int mode [, int startpos]])
Stores a file from an open file to the FTP server nbronly */
PHP_FUNCTION(ftp_nb_fput)
{
@@ -1180,11 +1180,11 @@ PHP_FUNCTION(ftp_nb_fput)
ftptype_t xtype;
size_t remote_len;
int ret;
- zend_long mode, startpos=0;
+ zend_long mode=FTPTYPE_IMAGE, startpos=0;
php_stream *stream;
char *remote;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsrl|l", &z_ftp, &remote, &remote_len, &z_file, &mode, &startpos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsr|ll", &z_ftp, &remote, &remote_len, &z_file, &mode, &startpos) == FAILURE) {
return;
}
@@ -1226,7 +1226,7 @@ PHP_FUNCTION(ftp_nb_fput)
/* }}} */
-/* {{{ proto bool ftp_put(resource stream, string remote_file, string local_file, int mode[, int startpos])
+/* {{{ proto bool ftp_put(resource stream, string remote_file, string local_file [, int mode [, int startpos]])
Stores a file on the FTP server */
PHP_FUNCTION(ftp_put)
{
@@ -1235,10 +1235,10 @@ PHP_FUNCTION(ftp_put)
ftptype_t xtype;
char *remote, *local;
size_t remote_len, local_len;
- zend_long mode, startpos=0;
+ zend_long mode=FTPTYPE_IMAGE, startpos=0;
php_stream *instream;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "rppl|l", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rpp|ll", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) {
return;
}
@@ -1280,7 +1280,7 @@ PHP_FUNCTION(ftp_put)
}
/* }}} */
-/* {{{ proto bool ftp_append(resource stream, string remote_file, string local_file, int mode)
+/* {{{ proto bool ftp_append(resource stream, string remote_file, string local_file [, int mode])
Append content of a file a another file on the FTP server */
PHP_FUNCTION(ftp_append)
{
@@ -1289,10 +1289,10 @@ PHP_FUNCTION(ftp_append)
ftptype_t xtype;
char *remote, *local;
size_t remote_len, local_len;
- zend_long mode;
+ zend_long mode=FTPTYPE_IMAGE;
php_stream *instream;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "rppl", &z_ftp, &remote, &remote_len, &local, &local_len, &mode) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rpp|l", &z_ftp, &remote, &remote_len, &local, &local_len, &mode) == FAILURE) {
return;
}
@@ -1316,7 +1316,7 @@ PHP_FUNCTION(ftp_append)
}
/* }}} */
-/* {{{ proto int ftp_nb_put(resource stream, string remote_file, string local_file, int mode[, int startpos])
+/* {{{ proto int ftp_nb_put(resource stream, string remote_file, string local_file [, int mode [, int startpos]])
Stores a file on the FTP server */
PHP_FUNCTION(ftp_nb_put)
{
@@ -1325,10 +1325,10 @@ PHP_FUNCTION(ftp_nb_put)
ftptype_t xtype;
char *remote, *local;
size_t remote_len, local_len;
- zend_long mode, startpos=0, ret;
+ zend_long mode=FTPTYPE_IMAGE, startpos=0, ret;
php_stream *instream;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "rppl|l", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rpp|ll", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) {
return;
}
diff --git a/ext/ftp/tests/004.phpt b/ext/ftp/tests/004.phpt
index dcb6302eca..21b8aabbeb 100644
--- a/ext/ftp/tests/004.phpt
+++ b/ext/ftp/tests/004.phpt
@@ -20,7 +20,6 @@ var_dump(ftp_alloc($ftp, array()));
var_dump(ftp_cdup($ftp, 0));
var_dump(ftp_chdir($ftp, array()));
var_dump(ftp_chmod($ftp, 0666));
-var_dump(ftp_get($ftp, 1234,12));
var_dump(ftp_close());
var_dump(ftp_connect('sfjkfjaksfjkasjf'));
var_dump(ftp_delete($ftp, array()));
@@ -50,30 +49,27 @@ NULL
Warning: ftp_chmod() expects exactly 3 parameters, 2 given in %s on line %d
bool(false)
-Warning: ftp_get() expects at least 4 parameters, 3 given in %s on line %d
+Warning: ftp_close() expects exactly 1 parameter, 0 given in %s004.php on line 16
NULL
-Warning: ftp_close() expects exactly 1 parameter, 0 given in %s004.php on line 17
-NULL
-
-Warning: ftp_connect(): php_network_getaddresses: getaddrinfo failed: %s in %s004.php on line 18
+Warning: ftp_connect(): php_network_getaddresses: getaddrinfo failed: %s in %s004.php on line 17
bool(false)
-Warning: ftp_delete() expects parameter 2 to be string, array given in %s004.php on line 19
+Warning: ftp_delete() expects parameter 2 to be string, array given in %s004.php on line 18
NULL
-Warning: ftp_exec() expects parameter 2 to be string, array given in %s004.php on line 20
+Warning: ftp_exec() expects parameter 2 to be string, array given in %s004.php on line 19
NULL
-Warning: ftp_systype() expects exactly 1 parameter, 2 given in %s004.php on line 22
+Warning: ftp_systype() expects exactly 1 parameter, 2 given in %s004.php on line 21
NULL
-Warning: ftp_pwd() expects exactly 1 parameter, 2 given in %s004.php on line 23
+Warning: ftp_pwd() expects exactly 1 parameter, 2 given in %s004.php on line 22
NULL
-Warning: ftp_login() expects exactly 3 parameters, 1 given in %s004.php on line 25
+Warning: ftp_login() expects exactly 3 parameters, 1 given in %s004.php on line 24
NULL
-Warning: ftp_login(): Not logged in. in %s004.php on line 26
+Warning: ftp_login(): Not logged in. in %s004.php on line 25
bool(false)
bool(true)
diff --git a/ext/ftp/tests/006.phpt b/ext/ftp/tests/006.phpt
index 899ecbbec3..6b76a7e0ae 100644
--- a/ext/ftp/tests/006.phpt
+++ b/ext/ftp/tests/006.phpt
@@ -31,6 +31,7 @@ var_dump(ftp_site($ftp));
var_dump(ftp_set_option($ftp));
var_dump(ftp_get_option($ftp));
var_dump(ftp_mlsd($ftp));
+var_dump(ftp_append($ftp));
?>
--EXPECTF--
@@ -55,13 +56,13 @@ NULL
Warning: ftp_rawlist() expects at least 2 parameters, 1 given in %s006.php on line 10
NULL
-Warning: ftp_fget() expects at least 4 parameters, 1 given in %s006.php on line 11
+Warning: ftp_fget() expects at least 3 parameters, 1 given in %s006.php on line 11
NULL
-Warning: ftp_nb_fget() expects at least 4 parameters, 1 given in %s006.php on line 12
+Warning: ftp_nb_fget() expects at least 3 parameters, 1 given in %s006.php on line 12
NULL
-Warning: ftp_nb_get() expects at least 4 parameters, 1 given in %s006.php on line 13
+Warning: ftp_nb_get() expects at least 3 parameters, 1 given in %s006.php on line 13
NULL
Warning: ftp_pasv() expects exactly 2 parameters, 1 given in %s006.php on line 14
@@ -70,16 +71,16 @@ NULL
Warning: ftp_nb_continue() expects exactly 1 parameter, 0 given in %s006.php on line 15
NULL
-Warning: ftp_fput() expects at least 4 parameters, 0 given in %s006.php on line 16
+Warning: ftp_fput() expects at least 3 parameters, 0 given in %s006.php on line 16
NULL
-Warning: ftp_nb_fput() expects at least 4 parameters, 1 given in %s006.php on line 17
+Warning: ftp_nb_fput() expects at least 3 parameters, 1 given in %s006.php on line 17
NULL
-Warning: ftp_put() expects at least 4 parameters, 1 given in %s006.php on line 18
+Warning: ftp_put() expects at least 3 parameters, 1 given in %s006.php on line 18
NULL
-Warning: ftp_nb_put() expects at least 4 parameters, 1 given in %s006.php on line 19
+Warning: ftp_nb_put() expects at least 3 parameters, 1 given in %s006.php on line 19
NULL
Warning: ftp_size() expects exactly 2 parameters, 1 given in %s006.php on line 20
@@ -102,3 +103,6 @@ NULL
Warning: ftp_mlsd() expects exactly 2 parameters, 1 given in %s006.php on line 26
NULL
+
+Warning: ftp_append() expects at least 3 parameters, 1 given in %s006.php on line 27
+NULL \ No newline at end of file
diff --git a/ext/ftp/tests/007.phpt b/ext/ftp/tests/007.phpt
new file mode 100644
index 0000000000..6a6f0da940
--- /dev/null
+++ b/ext/ftp/tests/007.phpt
@@ -0,0 +1,148 @@
+--TEST--
+FTP with bogus resource
+--CREDITS--
+Michael Paul da Rosa <michael [at] michaelpaul [dot] com [dot] br>
+PHP TestFest Dublin 2017
+--SKIPIF--
+<?php
+require 'skipif.inc';
+?>
+--FILE--
+<?php
+$ftp = tmpfile();
+
+var_dump(ftp_login($ftp, 'user', 'pass'));
+var_dump(ftp_pwd($ftp));
+var_dump(ftp_cdup($ftp));
+var_dump(ftp_chdir($ftp, '~'));
+var_dump(ftp_exec($ftp, 'x'));
+var_dump(ftp_raw($ftp, 'x'));
+var_dump(ftp_mkdir($ftp, '/'));
+var_dump(ftp_rmdir($ftp, '/'));
+var_dump(ftp_chmod($ftp, 7777, '/'));
+var_dump(ftp_alloc($ftp, 7777));
+var_dump(ftp_nlist($ftp, '/'));
+var_dump(ftp_rawlist($ftp, '~'));
+var_dump(ftp_mlsd($ftp, '~'));
+var_dump(ftp_systype($ftp));
+var_dump(ftp_fget($ftp, $ftp, 'remote', 7777));
+var_dump(ftp_nb_fget($ftp, $ftp, 'remote', 7777));
+var_dump(ftp_pasv($ftp, false));
+var_dump(ftp_get($ftp, 'local', 'remote', 7777));
+var_dump(ftp_nb_get($ftp, 'local', 'remote', 7777));
+var_dump(ftp_nb_continue($ftp));
+var_dump(ftp_fput($ftp, 'remote', $ftp, 9999));
+var_dump(ftp_nb_fput($ftp, 'remote', $ftp, 9999));
+var_dump(ftp_put($ftp, 'remote', 'local', 9999));
+var_dump(ftp_append($ftp, 'remote', 'local', 9999));
+var_dump(ftp_nb_put($ftp, 'remote', 'local', 9999));
+var_dump(ftp_size($ftp, '~'));
+var_dump(ftp_mdtm($ftp, '~'));
+var_dump(ftp_rename($ftp, 'old', 'new'));
+var_dump(ftp_delete($ftp, 'gone'));
+var_dump(ftp_site($ftp, 'localhost'));
+var_dump(ftp_close($ftp));
+var_dump(ftp_set_option($ftp, 1, 2));
+var_dump(ftp_get_option($ftp, 1));
+
+fclose($ftp);
+?>
+--EXPECTF--
+Warning: ftp_login(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false)
+
+Warning: ftp_pwd(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false)
+
+Warning: ftp_cdup(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false)
+
+Warning: ftp_chdir(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false)
+
+Warning: ftp_exec(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false)
+
+Warning: ftp_raw(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false)
+
+Warning: ftp_mkdir(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false)
+
+Warning: ftp_rmdir(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false)
+
+Warning: ftp_chmod(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false)
+
+Warning: ftp_alloc(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false)
+
+Warning: ftp_nlist(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false)
+
+Warning: ftp_rawlist(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false)
+
+Warning: ftp_mlsd(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false)
+
+Warning: ftp_systype(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false)
+
+Warning: ftp_fget(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false)
+
+Warning: ftp_nb_fget(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false)
+
+Warning: ftp_pasv(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false)
+
+Warning: ftp_get(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false)
+
+Warning: ftp_nb_get(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false)
+
+Warning: ftp_nb_continue(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false)
+
+Warning: ftp_fput(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false)
+
+Warning: ftp_nb_fput(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false)
+
+Warning: ftp_put(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false)
+
+Warning: ftp_append(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false)
+
+Warning: ftp_nb_put(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false)
+
+Warning: ftp_size(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false)
+
+Warning: ftp_mdtm(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false)
+
+Warning: ftp_rename(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false)
+
+Warning: ftp_delete(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false)
+
+Warning: ftp_site(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false)
+
+Warning: ftp_close(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false)
+
+Warning: ftp_set_option(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false)
+
+Warning: ftp_get_option(): supplied resource is not a valid FTP Buffer resource in %s007.php on line %d
+bool(false) \ No newline at end of file
diff --git a/ext/ftp/tests/ftp_append.phpt b/ext/ftp/tests/ftp_append.phpt
index 5f52ac923c..ff695c4d5b 100644
--- a/ext/ftp/tests/ftp_append.phpt
+++ b/ext/ftp/tests/ftp_append.phpt
@@ -13,18 +13,28 @@ if (!$ftp) die("Couldn't connect to the server");
var_dump(ftp_login($ftp, 'user', 'pass'));
-@unlink(__DIR__.'/ftp_append_foobar');
+$fooPath = __DIR__ . '/ftp_append_foo';
+file_put_contents($fooPath, 'foo');
+var_dump(ftp_append($ftp, 'ftp_append_foobar', $fooPath, FTP_BINARY));
-file_put_contents(__DIR__.'/ftp_append_foo', 'foo');
-var_dump(ftp_append($ftp, 'ftp_append_foobar', __DIR__.'/ftp_append_foo', FTP_BINARY));
+$barPath = __DIR__ . '/ftp_append_bar';
+file_put_contents($barPath, 'bar');
+var_dump(ftp_append($ftp, 'ftp_append_foobar', $barPath, FTP_BINARY));
-file_put_contents(__DIR__.'/ftp_append_bar', 'bar');
-var_dump(ftp_append($ftp, 'ftp_append_foobar', __DIR__.'/ftp_append_bar', FTP_BINARY));
-
-var_dump(file_get_contents(__DIR__.'/ftp_append_foobar'));
+$fooBarPath = __DIR__ . '/ftp_append_foobar';
+var_dump(file_get_contents($fooBarPath));
ftp_close($ftp);
?>
+--CLEAN--
+<?php
+$fooPath = __DIR__ . '/ftp_append_foo';
+unlink($fooPath);
+$barPath = __DIR__ . '/ftp_append_bar';
+unlink($barPath);
+$fooBarPath = __DIR__ . '/ftp_append_foobar';
+unlink($fooBarPath);
+?>
--EXPECTF--
bool(true)
bool(true)
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index 3e7d778ba3..a530f82424 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -133,7 +133,7 @@ static void php_image_filter_pixelate(INTERNAL_FUNCTION_PARAMETERS);
static gdImagePtr _php_image_create_from_string (zval *Data, char *tn, gdImagePtr (*ioctx_func_p)());
static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, gdImagePtr (*func_p)(), gdImagePtr (*ioctx_func_p)());
static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, void (*func_p)());
-static int _php_image_type(char data[8]);
+static int _php_image_type(char data[12]);
static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type);
static void _php_image_bw_convert(gdImagePtr im_org, gdIOCtx *out, int threshold);
@@ -1101,14 +1101,14 @@ PHP_MINIT_FUNCTION(gd)
REGISTER_INI_ENTRIES();
- REGISTER_LONG_CONSTANT("IMG_GIF", 1, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("IMG_JPG", 2, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("IMG_JPEG", 2, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("IMG_PNG", 4, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("IMG_WBMP", 8, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("IMG_XPM", 16, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("IMG_WEBP", 32, CONST_CS | CONST_PERSISTENT);
- REGISTER_LONG_CONSTANT("IMG_BMP", 64, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("IMG_GIF", PHP_IMG_GIF, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("IMG_JPG", PHP_IMG_JPG, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("IMG_JPEG", PHP_IMG_JPEG, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("IMG_PNG", PHP_IMG_PNG, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("IMG_WBMP", PHP_IMG_WBMP, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("IMG_XPM", PHP_IMG_XPM, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("IMG_WEBP", PHP_IMG_WEBP, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("IMG_BMP", PHP_IMG_BMP, CONST_CS | CONST_PERSISTENT);
/* special colours for gd */
REGISTER_LONG_CONSTANT("IMG_COLOR_TILED", gdTiled, CONST_CS | CONST_PERSISTENT);
@@ -1323,7 +1323,7 @@ PHP_MINFO_FUNCTION(gd)
PHP_FUNCTION(gd_info)
{
if (zend_parse_parameters_none() == FAILURE) {
- RETURN_FALSE;
+ return;
}
array_init(return_value);
@@ -2174,23 +2174,23 @@ PHP_FUNCTION(imagecreate)
Return the types of images supported in a bitfield - 1=GIF, 2=JPEG, 4=PNG, 8=WBMP, 16=XPM */
PHP_FUNCTION(imagetypes)
{
- int ret=0;
- ret = 1;
+ int ret = 0;
+ ret = PHP_IMG_GIF;
#ifdef HAVE_GD_JPG
- ret |= 2;
+ ret |= PHP_IMG_JPG;
#endif
#ifdef HAVE_GD_PNG
- ret |= 4;
+ ret |= PHP_IMG_PNG;
#endif
- ret |= 8;
+ ret |= PHP_IMG_WBMP;
#if defined(HAVE_GD_XPM)
- ret |= 16;
+ ret |= PHP_IMG_XPM;
#endif
#ifdef HAVE_GD_WEBP
- ret |= 32;
+ ret |= PHP_IMG_WEBP;
#endif
#ifdef HAVE_GD_BMP
- ret |= 64;
+ ret |= PHP_IMG_BMP;
#endif
if (zend_parse_parameters_none() == FAILURE) {
@@ -2224,7 +2224,7 @@ static int _php_ctx_getmbi(gdIOCtx *ctx)
*/
static const char php_sig_gd2[3] = {'g', 'd', '2'};
-static int _php_image_type (char data[8])
+static int _php_image_type (char data[12])
{
/* Based on ext/standard/image.c */
@@ -2232,18 +2232,18 @@ static int _php_image_type (char data[8])
return -1;
}
- if (!memcmp(data, php_sig_gd2, 3)) {
+ if (!memcmp(data, php_sig_gd2, sizeof(php_sig_gd2))) {
return PHP_GDIMG_TYPE_GD2;
- } else if (!memcmp(data, php_sig_jpg, 3)) {
+ } else if (!memcmp(data, php_sig_jpg, sizeof(php_sig_jpg))) {
return PHP_GDIMG_TYPE_JPG;
- } else if (!memcmp(data, php_sig_png, 3)) {
- if (!memcmp(data, php_sig_png, 8)) {
- return PHP_GDIMG_TYPE_PNG;
- }
- } else if (!memcmp(data, php_sig_gif, 3)) {
+ } else if (!memcmp(data, php_sig_png, sizeof(php_sig_png))) {
+ return PHP_GDIMG_TYPE_PNG;
+ } else if (!memcmp(data, php_sig_gif, sizeof(php_sig_gif))) {
return PHP_GDIMG_TYPE_GIF;
} else if (!memcmp(data, php_sig_bmp, sizeof(php_sig_bmp))) {
return PHP_GDIMG_TYPE_BMP;
+ } else if(!memcmp(data, php_sig_riff, sizeof(php_sig_riff)) && !memcmp(data + sizeof(php_sig_riff) + sizeof(uint32_t), php_sig_webp, sizeof(php_sig_webp))) {
+ return PHP_GDIMG_TYPE_WEBP;
}
else {
gdIOCtx *io_ctx;
@@ -2294,19 +2294,19 @@ PHP_FUNCTION(imagecreatefromstring)
zval *data;
gdImagePtr im;
int imtype;
- char sig[8];
+ char sig[12];
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &data) == FAILURE) {
return;
}
convert_to_string_ex(data);
- if (Z_STRLEN_P(data) < 8) {
+ if (Z_STRLEN_P(data) < sizeof(sig)) {
php_error_docref(NULL, E_WARNING, "Empty string or invalid image");
RETURN_FALSE;
}
- memcpy(sig, Z_STRVAL_P(data), 8);
+ memcpy(sig, Z_STRVAL_P(data), sizeof(sig));
imtype = _php_image_type(sig);
@@ -2345,6 +2345,15 @@ PHP_FUNCTION(imagecreatefromstring)
im = _php_image_create_from_string(data, "BMP", gdImageCreateFromBmpCtx);
break;
+ case PHP_GDIMG_TYPE_WEBP:
+#ifdef HAVE_GD_WEBP
+ im = _php_image_create_from_string(data, "WEBP", gdImageCreateFromWebpCtx);
+ break;
+#else
+ php_error_docref(NULL, E_WARNING, "No WEBP support in this PHP build");
+ RETURN_FALSE;
+#endif
+
default:
php_error_docref(NULL, E_WARNING, "Data is not in a recognized format");
RETURN_FALSE;
@@ -3027,7 +3036,7 @@ PHP_FUNCTION(imagecolorexact)
}
/* }}} */
-/* {{{ proto void imagecolorset(resource im, int col, int red, int green, int blue)
+/* {{{ proto bool imagecolorset(resource im, int col, int red, int green, int blue)
Set the color for the specified palette index */
PHP_FUNCTION(imagecolorset)
{
@@ -4387,10 +4396,6 @@ static void php_image_filter_brightness(INTERNAL_FUNCTION_PARAMETERS)
RETURN_FALSE;
}
- if (im_src == NULL) {
- RETURN_FALSE;
- }
-
if (gdImageBrightness(im_src, (int)brightness) == 1) {
RETURN_TRUE;
}
@@ -4412,10 +4417,6 @@ static void php_image_filter_contrast(INTERNAL_FUNCTION_PARAMETERS)
RETURN_FALSE;
}
- if (im_src == NULL) {
- RETURN_FALSE;
- }
-
if (gdImageContrast(im_src, (int)contrast) == 1) {
RETURN_TRUE;
}
@@ -4438,10 +4439,6 @@ static void php_image_filter_colorize(INTERNAL_FUNCTION_PARAMETERS)
RETURN_FALSE;
}
- if (im_src == NULL) {
- RETURN_FALSE;
- }
-
if (gdImageColor(im_src, (int) r, (int) g, (int) b, (int) a) == 1) {
RETURN_TRUE;
}
@@ -4519,10 +4516,6 @@ static void php_image_filter_smooth(INTERNAL_FUNCTION_PARAMETERS)
RETURN_FALSE;
}
- if (im_src == NULL) {
- RETURN_FALSE;
- }
-
if (gdImageSmooth(im_src, (float)weight)==1) {
RETURN_TRUE;
}
@@ -4545,10 +4538,6 @@ static void php_image_filter_pixelate(INTERNAL_FUNCTION_PARAMETERS)
RETURN_FALSE;
}
- if (im == NULL) {
- RETURN_FALSE;
- }
-
if (gdImagePixelate(im, (int) blocksize, (const unsigned int) mode)) {
RETURN_TRUE;
}
@@ -4645,7 +4634,7 @@ PHP_FUNCTION(imageconvolution)
/* }}} */
/* End section: Filters */
-/* {{{ proto void imageflip(resource im, int mode)
+/* {{{ proto bool imageflip(resource im, int mode)
Flip an image (in place) horizontally, vertically or both directions. */
PHP_FUNCTION(imageflip)
{
@@ -4703,7 +4692,7 @@ PHP_FUNCTION(imageantialias)
}
/* }}} */
-/* {{{ proto void imagecrop(resource im, array rect)
+/* {{{ proto resource imagecrop(resource im, array rect)
Crop an image using the given coordinates and size, x, y, width and height. */
PHP_FUNCTION(imagecrop)
{
@@ -4760,7 +4749,7 @@ PHP_FUNCTION(imagecrop)
}
/* }}} */
-/* {{{ proto void imagecropauto(resource im [, int mode [, float threshold [, int color]]])
+/* {{{ proto resource imagecropauto(resource im [, int mode [, float threshold [, int color]]])
Crop an image automatically using one of the available modes. */
PHP_FUNCTION(imagecropauto)
{
diff --git a/ext/gd/php_gd.h b/ext/gd/php_gd.h
index a99f2e846c..253b27d920 100644
--- a/ext/gd/php_gd.h
+++ b/ext/gd/php_gd.h
@@ -50,6 +50,15 @@
#define PHP_GDIMG_TYPE_WEBP 11
#define PHP_GDIMG_TYPE_BMP 12
+#define PHP_IMG_GIF 1
+#define PHP_IMG_JPG 2
+#define PHP_IMG_JPEG 2
+#define PHP_IMG_PNG 4
+#define PHP_IMG_WBMP 8
+#define PHP_IMG_XPM 16
+#define PHP_IMG_WEBP 32
+#define PHP_IMG_BMP 64
+
#ifdef PHP_WIN32
# define PHP_GD_API __declspec(dllexport)
#elif defined(__GNUC__) && __GNUC__ >= 4
@@ -62,6 +71,8 @@ PHPAPI extern const char php_sig_gif[3];
PHPAPI extern const char php_sig_jpg[3];
PHPAPI extern const char php_sig_png[8];
PHPAPI extern const char php_sig_bmp[2];
+PHPAPI extern const char php_sig_riff[4];
+PHPAPI extern const char php_sig_webp[4];
extern zend_module_entry gd_module_entry;
#define phpext_gd_ptr &gd_module_entry
diff --git a/ext/gd/tests/createfromstring.phpt b/ext/gd/tests/createfromstring.phpt
index a3c2e977b6..7828725db5 100644
--- a/ext/gd/tests/createfromstring.phpt
+++ b/ext/gd/tests/createfromstring.phpt
@@ -52,8 +52,8 @@ unlink($dir . '/p.png');
//empty string
$im = imagecreatefromstring('');
-//random string > 8
-$im = imagecreatefromstring(' asdf jklp');
+//random string > 12
+$im = imagecreatefromstring(' asdf jklp foo');
?>
--EXPECTF--
createfromstring truecolor png: ok
diff --git a/ext/gd/tests/gd_info_error.phpt b/ext/gd/tests/gd_info_error.phpt
index 15a26e4a49..edc18fac0f 100644
--- a/ext/gd/tests/gd_info_error.phpt
+++ b/ext/gd/tests/gd_info_error.phpt
@@ -31,8 +31,8 @@ var_dump(gd_info($extra_arg_string, $extra_arg_number));
-- Testing gd_info() function with more than expected number of arguments --
Warning: gd_info() expects exactly 0 parameters, 1 given in %s on line %d
-bool(false)
+NULL
Warning: gd_info() expects exactly 0 parameters, 2 given in %s on line %d
-bool(false)
-===DONE=== \ No newline at end of file
+NULL
+===DONE===
diff --git a/ext/gd/tests/imagecreatefromstring.bmp b/ext/gd/tests/imagecreatefromstring.bmp
new file mode 100644
index 0000000000..22b5c66f9d
--- /dev/null
+++ b/ext/gd/tests/imagecreatefromstring.bmp
Binary files differ
diff --git a/ext/gd/tests/imagecreatefromstring.gif b/ext/gd/tests/imagecreatefromstring.gif
new file mode 100644
index 0000000000..a17060ad61
--- /dev/null
+++ b/ext/gd/tests/imagecreatefromstring.gif
Binary files differ
diff --git a/ext/gd/tests/imagecreatefromstring.webp b/ext/gd/tests/imagecreatefromstring.webp
new file mode 100644
index 0000000000..e3c3c175ba
--- /dev/null
+++ b/ext/gd/tests/imagecreatefromstring.webp
Binary files differ
diff --git a/ext/gd/tests/imagecreatefromstring_gif.phpt b/ext/gd/tests/imagecreatefromstring_gif.phpt
new file mode 100644
index 0000000000..c913f4ed13
--- /dev/null
+++ b/ext/gd/tests/imagecreatefromstring_gif.phpt
@@ -0,0 +1,20 @@
+--TEST--
+imagecreatefromstring() - GIF format
+--SKIPIF--
+<?php
+if (!extension_loaded('gd')) die('skip ext/gd required');
+if (!(imagetypes() & IMG_GIF)) die('skip GIF support required');
+?>
+--FILE--
+<?php
+// create an image from a GIF string representation
+$im = imagecreatefromstring(file_get_contents(__DIR__ . '/imagecreatefromstring.gif'));
+var_dump(imagesx($im));
+var_dump(imagesy($im));
+
+?>
+===DONE===
+--EXPECT--
+int(10)
+int(10)
+===DONE===
diff --git a/ext/gd/tests/imagecreatefromstring_png.phpt b/ext/gd/tests/imagecreatefromstring_png.phpt
new file mode 100644
index 0000000000..efb8cc3622
--- /dev/null
+++ b/ext/gd/tests/imagecreatefromstring_png.phpt
@@ -0,0 +1,20 @@
+--TEST--
+imagecreatefromstring() - PNG format
+--SKIPIF--
+<?php
+if (!extension_loaded('gd')) die('skip ext/gd required');
+if (!(imagetypes() & IMG_PNG)) die('skip PNG support required');
+?>
+--FILE--
+<?php
+// create an image from a PNG string representation
+$im = imagecreatefromstring(file_get_contents(__DIR__ . '/imagecreatefromstring.gif'));
+var_dump(imagesx($im));
+var_dump(imagesy($im));
+
+?>
+===DONE===
+--EXPECT--
+int(10)
+int(10)
+===DONE===
diff --git a/ext/gd/tests/imagecreatefromstring_webp.phpt b/ext/gd/tests/imagecreatefromstring_webp.phpt
new file mode 100644
index 0000000000..fbae919ab4
--- /dev/null
+++ b/ext/gd/tests/imagecreatefromstring_webp.phpt
@@ -0,0 +1,20 @@
+--TEST--
+imagecreatefromstring() - WEBP format
+--SKIPIF--
+<?php
+if (!extension_loaded('gd')) die('skip ext/gd required');
+if (!(imagetypes() & IMG_WEBP)) die('skip WEBP support required');
+?>
+--FILE--
+<?php
+// create an image from a WEBP string representation
+$im = imagecreatefromstring(file_get_contents(__DIR__ . '/imagecreatefromstring.webp'));
+var_dump(imagesx($im));
+var_dump(imagesy($im));
+
+?>
+===DONE===
+--EXPECT--
+int(10)
+int(10)
+===DONE===
diff --git a/ext/gmp/README b/ext/gmp/README
deleted file mode 100644
index e142e2e031..0000000000
--- a/ext/gmp/README
+++ /dev/null
@@ -1,5 +0,0 @@
-Arbitrary length number support with GNU MP library.
-Please see the PGP manual for more documentation.
-See also GNU MP home page at http://www.swox.com/gmp/.
-GNU MP library is available under the tems of GNU LGPL
-license. Please see http://www.swox.com/gmp/lgpl.html
diff --git a/ext/gmp/config.m4 b/ext/gmp/config.m4
index 22cca7eaf2..a1c565bf4e 100644
--- a/ext/gmp/config.m4
+++ b/ext/gmp/config.m4
@@ -23,6 +23,7 @@ if test "$PHP_GMP" != "no"; then
PHP_ADD_LIBRARY_WITH_PATH(gmp, $GMP_DIR/$PHP_LIBDIR, GMP_SHARED_LIBADD)
PHP_ADD_INCLUDE($GMP_DIR/include)
+ PHP_INSTALL_HEADERS([ext/gmp/php_gmp_int.h])
PHP_NEW_EXTENSION(gmp, gmp.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_SUBST(GMP_SHARED_LIBADD)
diff --git a/ext/gmp/config.w32 b/ext/gmp/config.w32
index 7ea36150b2..ca85a2e44b 100644
--- a/ext/gmp/config.w32
+++ b/ext/gmp/config.w32
@@ -7,6 +7,7 @@ if (PHP_GMP != "no") {
if (CHECK_LIB("mpir_a.lib", "gmp", PHP_GMP) &&
CHECK_HEADER_ADD_INCLUDE("gmp.h", "CFLAGS_GMP", PHP_GMP + ";" + PHP_PHP_BUILD + "\\include\\mpir")) {
EXTENSION("gmp", "gmp.c", null, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
+ PHP_INSTALL_HEADERS("ext/gmp", "php_gmp_int.h");
AC_DEFINE('HAVE_GMP', 1, 'GMP support');
AC_DEFINE('HAVE_MPIR', 1, 'MPIR support');
} else {
diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c
index 9fcf9c14d7..61fb37a1e2 100644
--- a/ext/gmp/gmp.c
+++ b/ext/gmp/gmp.c
@@ -23,13 +23,12 @@
#include "php.h"
#include "php_ini.h"
#include "php_gmp.h"
+#include "php_gmp_int.h"
#include "ext/standard/info.h"
#include "ext/standard/php_var.h"
#include "zend_smart_str_public.h"
#include "zend_exceptions.h"
-#if HAVE_GMP
-
#include <gmp.h>
/* Needed for gmp_random() */
@@ -220,13 +219,12 @@ ZEND_TSRMLS_CACHE_DEFINE()
ZEND_GET_MODULE(gmp)
#endif
-zend_class_entry *gmp_ce;
+static zend_class_entry *gmp_ce;
static zend_object_handlers gmp_object_handlers;
-typedef struct _gmp_object {
- mpz_t num;
- zend_object std;
-} gmp_object;
+zend_class_entry *php_gmp_class_entry() {
+ return gmp_ce;
+}
typedef struct _gmp_temp {
mpz_t num;
@@ -252,7 +250,7 @@ typedef struct _gmp_temp {
(Z_TYPE_P(zval) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zval), gmp_ce))
#define GET_GMP_OBJECT_FROM_OBJ(obj) \
- ((gmp_object *) ((char *) (obj) - XtOffsetOf(gmp_object, std)))
+ php_gmp_object_from_zend_object(obj)
#define GET_GMP_OBJECT_FROM_ZVAL(zv) \
GET_GMP_OBJECT_FROM_OBJ(Z_OBJ_P(zv))
@@ -2088,8 +2086,6 @@ ZEND_FUNCTION(gmp_scan1)
}
/* }}} */
-#endif /* HAVE_GMP */
-
/*
* Local variables:
* tab-width: 4
diff --git a/ext/gmp/php_gmp.h b/ext/gmp/php_gmp.h
index 903c68ee5e..971d6593ec 100644
--- a/ext/gmp/php_gmp.h
+++ b/ext/gmp/php_gmp.h
@@ -19,8 +19,6 @@
#ifndef PHP_GMP_H
#define PHP_GMP_H
-#if HAVE_GMP
-
#include <gmp.h>
extern zend_module_entry gmp_module_entry;
@@ -81,15 +79,6 @@ 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;
@@ -101,12 +90,6 @@ ZEND_END_MODULE_GLOBALS(gmp)
ZEND_TSRMLS_CACHE_EXTERN()
#endif
-#else
-
-#define phpext_gmp_ptr NULL
-
-#endif
-
#endif /* PHP_GMP_H */
diff --git a/ext/gmp/php_gmp_int.h b/ext/gmp/php_gmp_int.h
new file mode 100644
index 0000000000..9dd4c4d7f0
--- /dev/null
+++ b/ext/gmp/php_gmp_int.h
@@ -0,0 +1,31 @@
+#ifndef incl_PHP_GMP_INT_H
+#define incl_PHP_GMP_INT_H
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "php.h"
+#include <gmp.h>
+
+typedef struct _gmp_object {
+ mpz_t num;
+ zend_object std;
+} gmp_object;
+
+static inline gmp_object *php_gmp_object_from_zend_object(zend_object *zobj) {
+ return (gmp_object *)( ((char *)zobj) - XtOffsetOf(gmp_object, std) );
+}
+
+PHPAPI zend_class_entry *php_gmp_class_entry();
+
+/* 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
+
+#endif
diff --git a/ext/gmp/bug67917.phpt b/ext/gmp/tests/bug67917.phpt
index 93d46cbb66..93d46cbb66 100644
--- a/ext/gmp/bug67917.phpt
+++ b/ext/gmp/tests/bug67917.phpt
diff --git a/ext/gmp/tests/bug70284.phpt b/ext/gmp/tests/bug70284.phpt
index 58fc50cf2d..49df5d0359 100644
--- a/ext/gmp/tests/bug70284.phpt
+++ b/ext/gmp/tests/bug70284.phpt
@@ -34,17 +34,8 @@ $out = '';
}
?>
--EXPECTF--
-array(2) {
- [0]=>
- string(1) "1"
- [1]=>
- object(GMP)#%d (2) {
- [0]=>
- array(1) {
- [0]=>
- string(1) "1"
- }
- ["num"]=>
- string(1) "1"
- }
-}
+Fatal error: Uncaught Exception: Could not unserialize number in %sbug70284.php:6
+Stack trace:
+#0 %sbug70284.php(6): unserialize('%s')
+#1 {main}
+ thrown in %sbug70284.php on line 6
diff --git a/ext/hash/hash_gost.c b/ext/hash/hash_gost.c
index e00a55ed96..2561e6187c 100644
--- a/ext/hash/hash_gost.c
+++ b/ext/hash/hash_gost.c
@@ -265,7 +265,7 @@ PHP_HASH_API void PHP_GOSTUpdate(PHP_GOST_CTX *context, const unsigned char *inp
if (context->length + len < 32) {
memcpy(&context->buffer[context->length], input, len);
- context->length += len;
+ context->length += (unsigned char)len;
} else {
size_t i = 0, r = (context->length + len) % 32;
@@ -281,7 +281,7 @@ PHP_HASH_API void PHP_GOSTUpdate(PHP_GOST_CTX *context, const unsigned char *inp
memcpy(context->buffer, input + i, r);
ZEND_SECURE_ZERO(&context->buffer[r], 32 - r);
- context->length = r;
+ context->length = (unsigned char)r;
}
}
diff --git a/ext/hash/hash_snefru.c b/ext/hash/hash_snefru.c
index 5de2a283ff..1b44d37aea 100644
--- a/ext/hash/hash_snefru.c
+++ b/ext/hash/hash_snefru.c
@@ -151,7 +151,7 @@ PHP_HASH_API void PHP_SNEFRUUpdate(PHP_SNEFRU_CTX *context, const unsigned char
if (context->length + len < 32) {
memcpy(&context->buffer[context->length], input, len);
- context->length += len;
+ context->length += (unsigned char)len;
} else {
size_t i = 0, r = (context->length + len) % 32;
@@ -167,7 +167,7 @@ PHP_HASH_API void PHP_SNEFRUUpdate(PHP_SNEFRU_CTX *context, const unsigned char
memcpy(context->buffer, input + i, r);
ZEND_SECURE_ZERO(&context->buffer[r], 32 - r);
- context->length = r;
+ context->length = (unsigned char)r;
}
}
diff --git a/ext/hash/package.xml b/ext/hash/package.xml
deleted file mode 100644
index 25a598a4a1..0000000000
--- a/ext/hash/package.xml
+++ /dev/null
@@ -1,94 +0,0 @@
-<package version="1.0">
- <name>hash</name>
- <summary>pHASH Message Digest Framework</summary>
- <description>
- Native implementations of common message digest algorithms using a generic factory method
- </description>
- <license>PHP</license>
- <maintainers>
- <maintainer>
- <user>pollita</user>
- <name>Sara Golemon</name>
- <email>pollita@php.net</email>
- <role>lead</role>
- </maintainer>
- <maintainer>
- <user>mike</user>
- <name>Michael Wallner</name>
- <email>mike@php.net</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
-
- <release>
- <version>1.1</version>
- <state>stable</state>
- <date>2005-12-00</date>
- <notes>
-Fixed PECL bug #6183 - haval source file entries missing in package.xml
-
-Supported Algorithms:
- * md4, md5
- * sha1, sha256, sha384, sha512
- * ripemd128, ripemd160
- * tiger128, tiger160, tiger192 (3 and 4 passes)
- * haval128, haval160, haval192, haval224, haval256 (3, 4 and 5 passes)
- * crc32, crc32b, adler32, gost, snefru, whirlpool
- </notes>
- </release>
-
- <filelist>
- <file role="src" name="config.m4"/>
- <file role="src" name="config.w32"/>
- <file role="src" name="hash.c"/>
- <file role="src" name="php_hash.h"/>
- <file role="src" name="hash_md.c"/>
- <file role="src" name="php_hash_md.h"/>
- <file role="src" name="hash_sha.c"/>
- <file role="src" name="php_hash_sha.h"/>
- <file role="src" name="hash_ripemd.c"/>
- <file role="src" name="php_hash_ripemd.h"/>
- <file role="src" name="hash_whirlpool.c"/>
- <file role="src" name="php_hash_whirlpool.h"/>
- <file role="src" name="php_hash_whirlpool_tables.h"/>
- <file role="src" name="hash_tiger.c"/>
- <file role="src" name="php_hash_tiger.h"/>
- <file role="src" name="php_hash_tiger_tables.h"/>
- <file role="src" name="hash_snefru.c"/>
- <file role="src" name="php_hash_snefru.h"/>
- <file role="src" name="php_hash_snefru_tables.h"/>
- <file role="src" name="hash_gost.c"/>
- <file role="src" name="php_hash_gost.h"/>
- <file role="src" name="php_hash_gost_tables.h"/>
- <file role="src" name="hash_adler32.c"/>
- <file role="src" name="php_hash_adler32.h"/>
- <file role="src" name="hash_crc32.c"/>
- <file role="src" name="php_hash_crc32.h"/>
- <file role="src" name="php_hash_crc32_tables.h"/>
- <file role="src" name="hash_haval.c"/>
- <file role="src" name="php_hash_haval.h"/>
- <file role="doc" name="README"/>
- <dir role="test" name="tests">
- <file role="test" name="hmac-md5.phpt"/>
- <file role="test" name="md4.phpt"/>
- <file role="test" name="md5.phpt"/>
- <file role="test" name="sha1.phpt"/>
- <file role="test" name="sha256.phpt"/>
- <file role="test" name="sha384.phpt"/>
- <file role="test" name="sha512.phpt"/>
- <file role="test" name="ripemd128.phpt"/>
- <file role="test" name="ripemd160.phpt"/>
- <file role="test" name="haval.phpt"/>
- <file role="test" name="tiger.phpt"/>
- <file role="test" name="whirlpool.phpt"/>
- <file role="test" name="gost.phpt"/>
- <file role="test" name="snefru.phpt"/>
- <file role="test" name="crc32.phpt"/>
- <file role="test" name="adler32.phpt"/>
- </dir>
- </filelist>
-
-</package>
-<!--
-vim: et ts=1 sw=1
--->
diff --git a/ext/interbase/interbase.c b/ext/interbase/interbase.c
index 8986a4d32b..1b8d7acfab 100644
--- a/ext/interbase/interbase.c
+++ b/ext/interbase/interbase.c
@@ -833,6 +833,9 @@ PHP_MINFO_FUNCTION(ibase)
info_func(s = tmp);
}
php_info_print_table_row(2, "Run-time Client Library Version", s);
+#ifdef PHP_WIN32
+ FreeLibrary(l);
+#endif
} while (0);
#endif
php_info_print_table_end();
diff --git a/ext/intl/breakiterator/breakiterator_class.cpp b/ext/intl/breakiterator/breakiterator_class.cpp
index ae9e258608..355072dec5 100644
--- a/ext/intl/breakiterator/breakiterator_class.cpp
+++ b/ext/intl/breakiterator/breakiterator_class.cpp
@@ -144,8 +144,7 @@ static HashTable *BreakIterator_get_debug_info(zval *object, int *is_temp)
*is_temp = 1;
- ALLOC_HASHTABLE(debug_info);
- zend_hash_init(debug_info, 8, NULL, ZVAL_PTR_DTOR, 0);
+ debug_info = zend_new_array(8);
bio = Z_INTL_BREAKITERATOR_P(object);
biter = bio->biter;
diff --git a/ext/intl/calendar/calendar_class.cpp b/ext/intl/calendar/calendar_class.cpp
index e9c817af03..5c67051d84 100644
--- a/ext/intl/calendar/calendar_class.cpp
+++ b/ext/intl/calendar/calendar_class.cpp
@@ -154,8 +154,7 @@ static HashTable *Calendar_get_debug_info(zval *object, int *is_temp)
*is_temp = 1;
- ALLOC_HASHTABLE(debug_info);
- zend_hash_init(debug_info, 8, NULL, ZVAL_PTR_DTOR, 0);
+ debug_info = zend_new_array(8);
co = Z_INTL_CALENDAR_P(object);
cal = co->ucal;
@@ -456,12 +455,7 @@ void calendar_register_IntlCalendar_class(void)
INIT_CLASS_ENTRY(ce, "IntlCalendar", Calendar_class_functions);
ce.create_object = Calendar_object_create;
Calendar_ce_ptr = zend_register_internal_class(&ce);
- if (!Calendar_ce_ptr) {
- //can't happen now without bigger problems before
- php_error_docref0(NULL, E_ERROR,
- "IntlCalendar: class registration has failed.");
- return;
- }
+
memcpy( &Calendar_handlers, zend_get_std_object_handlers(),
sizeof Calendar_handlers);
Calendar_handlers.offset = XtOffsetOf(Calendar_object, zo);
@@ -525,11 +519,5 @@ void calendar_register_IntlCalendar_class(void)
INIT_CLASS_ENTRY(ce, "IntlGregorianCalendar", GregorianCalendar_class_functions);
GregorianCalendar_ce_ptr = zend_register_internal_class_ex(&ce,
Calendar_ce_ptr);
- if (!GregorianCalendar_ce_ptr) {
- //can't happen know without bigger problems before
- php_error_docref0(NULL, E_ERROR,
- "IntlGregorianCalendar: class registration has failed.");
- return;
- }
}
/* }}} */
diff --git a/ext/intl/dateformat/dateformat_class.c b/ext/intl/dateformat/dateformat_class.c
index 3b1345f2c9..572a3b37d5 100644
--- a/ext/intl/dateformat/dateformat_class.c
+++ b/ext/intl/dateformat/dateformat_class.c
@@ -202,12 +202,5 @@ void dateformat_register_IntlDateFormatter_class( void )
IntlDateFormatter_handlers.clone_obj = IntlDateFormatter_object_clone;
IntlDateFormatter_handlers.dtor_obj = IntlDateFormatter_object_dtor;
IntlDateFormatter_handlers.free_obj = IntlDateFormatter_object_free;
-
- /* Declare 'IntlDateFormatter' class properties. */
- if( !IntlDateFormatter_ce_ptr )
- {
- zend_error(E_ERROR, "Failed to register IntlDateFormatter class");
- return;
- }
}
/* }}} */
diff --git a/ext/intl/formatter/formatter_class.c b/ext/intl/formatter/formatter_class.c
index bf4387b3d8..ef54de9418 100644
--- a/ext/intl/formatter/formatter_class.c
+++ b/ext/intl/formatter/formatter_class.c
@@ -189,13 +189,6 @@ void formatter_register_class( void )
NumberFormatter_handlers.offset = XtOffsetOf(NumberFormatter_object, zo);
NumberFormatter_handlers.clone_obj = NumberFormatter_object_clone;
NumberFormatter_handlers.free_obj = NumberFormatter_object_free;
-
- /* Declare 'NumberFormatter' class properties. */
- if( !NumberFormatter_ce_ptr )
- {
- zend_error(E_ERROR, "Failed to register NumberFormatter class");
- return;
- }
}
/* }}} */
diff --git a/ext/intl/msgformat/msgformat_class.c b/ext/intl/msgformat/msgformat_class.c
index 90dac81252..954dcfd3fd 100644
--- a/ext/intl/msgformat/msgformat_class.c
+++ b/ext/intl/msgformat/msgformat_class.c
@@ -157,14 +157,6 @@ void msgformat_register_class( void )
MessageFormatter_handlers.offset = XtOffsetOf(MessageFormatter_object, zo);
MessageFormatter_handlers.clone_obj = MessageFormatter_object_clone;
MessageFormatter_handlers.free_obj = MessageFormatter_object_free;
-
-
- /* Declare 'MessageFormatter' class properties. */
- if( !MessageFormatter_ce_ptr )
- {
- zend_error(E_ERROR, "Failed to register MessageFormatter class");
- return;
- }
}
/* }}} */
diff --git a/ext/intl/msgformat/msgformat_format.c b/ext/intl/msgformat/msgformat_format.c
index cb74a3fb1b..bfc9dbe3ac 100644
--- a/ext/intl/msgformat/msgformat_format.c
+++ b/ext/intl/msgformat/msgformat_format.c
@@ -41,8 +41,7 @@ static void msgfmt_do_format(MessageFormatter_object *mfo, zval *args, zval *ret
count = zend_hash_num_elements(Z_ARRVAL_P(args));
- ALLOC_HASHTABLE(args_copy);
- zend_hash_init(args_copy, count, NULL, ZVAL_PTR_DTOR, 0);
+ args_copy = zend_new_array(count);
zend_hash_copy(args_copy, Z_ARRVAL_P(args), (copy_ctor_func_t)zval_add_ref);
umsg_format_helper(mfo, args_copy, &formatted, &formatted_len);
diff --git a/ext/intl/resourcebundle/resourcebundle_class.c b/ext/intl/resourcebundle/resourcebundle_class.c
index 47d9bf0403..f9d4bb16ca 100644
--- a/ext/intl/resourcebundle/resourcebundle_class.c
+++ b/ext/intl/resourcebundle/resourcebundle_class.c
@@ -446,12 +446,6 @@ void resourcebundle_register_class( void )
ResourceBundle_ce_ptr = zend_register_internal_class( &ce );
- if( !ResourceBundle_ce_ptr )
- {
- zend_error(E_ERROR, "Failed to register ResourceBundle class");
- return;
- }
-
ResourceBundle_object_handlers = std_object_handlers;
ResourceBundle_object_handlers.offset = XtOffsetOf(ResourceBundle_object, zend);
ResourceBundle_object_handlers.clone_obj = NULL; /* ICU ResourceBundle has no clone implementation */
diff --git a/ext/intl/spoofchecker/spoofchecker_class.c b/ext/intl/spoofchecker/spoofchecker_class.c
index 5cfc27dad1..3edb41e5fb 100644
--- a/ext/intl/spoofchecker/spoofchecker_class.c
+++ b/ext/intl/spoofchecker/spoofchecker_class.c
@@ -141,13 +141,6 @@ void spoofchecker_register_Spoofchecker_class(void)
Spoofchecker_handlers.offset = XtOffsetOf(Spoofchecker_object, zo);
Spoofchecker_handlers.clone_obj = spoofchecker_clone_obj;
Spoofchecker_handlers.free_obj = Spoofchecker_objects_free;
-
- if (!Spoofchecker_ce_ptr) {
- zend_error(E_ERROR,
- "Spoofchecker: attempt to create properties "
- "on a non-registered class.");
- return;
- }
}
/* }}} */
diff --git a/ext/intl/timezone/timezone_class.cpp b/ext/intl/timezone/timezone_class.cpp
index b036de81cf..c6f4dd5447 100644
--- a/ext/intl/timezone/timezone_class.cpp
+++ b/ext/intl/timezone/timezone_class.cpp
@@ -295,8 +295,7 @@ static HashTable *TimeZone_get_debug_info(zval *object, int *is_temp)
*is_temp = 1;
- ALLOC_HASHTABLE(debug_info);
- zend_hash_init(debug_info, 8, NULL, ZVAL_PTR_DTOR, 0);
+ debug_info = zend_new_array(8);
to = Z_INTL_TIMEZONE_P(object);
tz = to->utimezone;
diff --git a/ext/json/json_encoder.c b/ext/json/json_encoder.c
index 1fa2344204..2c3843fdd2 100644
--- a/ext/json/json_encoder.c
+++ b/ext/json/json_encoder.c
@@ -113,17 +113,17 @@ static inline void php_json_encode_double(smart_str *buf, double d, int options)
}
/* }}} */
-#define PHP_JSON_HASH_APPLY_PROTECTION_INC(_tmp_ht) \
+#define PHP_JSON_HASH_PROTECT_RECURSION(_tmp_ht) \
do { \
- if (_tmp_ht && ZEND_HASH_APPLY_PROTECTION(_tmp_ht)) { \
- ZEND_HASH_INC_APPLY_COUNT(_tmp_ht); \
+ if (_tmp_ht && !(GC_FLAGS(_tmp_ht) & GC_IMMUTABLE)) { \
+ GC_PROTECT_RECURSION(_tmp_ht); \
} \
} while (0)
-#define PHP_JSON_HASH_APPLY_PROTECTION_DEC(_tmp_ht) \
+#define PHP_JSON_HASH_UNPROTECT_RECURSION(_tmp_ht) \
do { \
- if (_tmp_ht && ZEND_HASH_APPLY_PROTECTION(_tmp_ht)) { \
- ZEND_HASH_DEC_APPLY_COUNT(_tmp_ht); \
+ if (_tmp_ht && !(GC_FLAGS(_tmp_ht) & GC_IMMUTABLE)) { \
+ GC_UNPROTECT_RECURSION(_tmp_ht); \
} \
} while (0)
@@ -140,13 +140,13 @@ static int php_json_encode_array(smart_str *buf, zval *val, int options, php_jso
r = PHP_JSON_OUTPUT_OBJECT;
}
- if (myht && ZEND_HASH_GET_APPLY_COUNT(myht) > 0) {
+ if (myht && GC_IS_RECURSIVE(myht)) {
encoder->error_code = PHP_JSON_ERROR_RECURSION;
smart_str_appendl(buf, "null", 4);
return FAILURE;
}
- PHP_JSON_HASH_APPLY_PROTECTION_INC(myht);
+ PHP_JSON_HASH_PROTECT_RECURSION(myht);
if (r == PHP_JSON_OUTPUT_ARRAY) {
smart_str_appendc(buf, '[');
@@ -212,13 +212,13 @@ static int php_json_encode_array(smart_str *buf, zval *val, int options, php_jso
if (php_json_encode_zval(buf, data, options, encoder) == FAILURE &&
!(options & PHP_JSON_PARTIAL_OUTPUT_ON_ERROR)) {
- PHP_JSON_HASH_APPLY_PROTECTION_DEC(myht);
+ PHP_JSON_HASH_UNPROTECT_RECURSION(myht);
return FAILURE;
}
} ZEND_HASH_FOREACH_END();
}
- PHP_JSON_HASH_APPLY_PROTECTION_DEC(myht);
+ PHP_JSON_HASH_UNPROTECT_RECURSION(myht);
if (encoder->depth > encoder->max_depth) {
encoder->error_code = PHP_JSON_ERROR_DEPTH;
@@ -445,7 +445,7 @@ static int php_json_encode_serializable_object(smart_str *buf, zval *val, int op
zval retval, fname;
int return_code;
- if (myht && ZEND_HASH_GET_APPLY_COUNT(myht) > 0) {
+ if (myht && GC_IS_RECURSIVE(myht)) {
encoder->error_code = PHP_JSON_ERROR_RECURSION;
if (options & PHP_JSON_PARTIAL_OUTPUT_ON_ERROR) {
smart_str_appendl(buf, "null", 4);
@@ -453,7 +453,7 @@ static int php_json_encode_serializable_object(smart_str *buf, zval *val, int op
return FAILURE;
}
- PHP_JSON_HASH_APPLY_PROTECTION_INC(myht);
+ PHP_JSON_HASH_PROTECT_RECURSION(myht);
ZVAL_STRING(&fname, "jsonSerialize");
@@ -466,7 +466,7 @@ static int php_json_encode_serializable_object(smart_str *buf, zval *val, int op
if (options & PHP_JSON_PARTIAL_OUTPUT_ON_ERROR) {
smart_str_appendl(buf, "null", 4);
}
- PHP_JSON_HASH_APPLY_PROTECTION_DEC(myht);
+ PHP_JSON_HASH_UNPROTECT_RECURSION(myht);
return FAILURE;
}
@@ -478,19 +478,19 @@ static int php_json_encode_serializable_object(smart_str *buf, zval *val, int op
if (options & PHP_JSON_PARTIAL_OUTPUT_ON_ERROR) {
smart_str_appendl(buf, "null", 4);
}
- PHP_JSON_HASH_APPLY_PROTECTION_DEC(myht);
+ PHP_JSON_HASH_UNPROTECT_RECURSION(myht);
return FAILURE;
}
if ((Z_TYPE(retval) == IS_OBJECT) &&
(Z_OBJ(retval) == Z_OBJ_P(val))) {
/* Handle the case where jsonSerialize does: return $this; by going straight to encode array */
- PHP_JSON_HASH_APPLY_PROTECTION_DEC(myht);
+ PHP_JSON_HASH_UNPROTECT_RECURSION(myht);
return_code = php_json_encode_array(buf, &retval, options, encoder);
} else {
/* All other types, encode as normal */
return_code = php_json_encode_zval(buf, &retval, options, encoder);
- PHP_JSON_HASH_APPLY_PROTECTION_DEC(myht);
+ PHP_JSON_HASH_UNPROTECT_RECURSION(myht);
}
zval_ptr_dtor(&retval);
diff --git a/ext/json/json_parser.tab.c b/ext/json/json_parser.tab.c
index c5247e5f04..5db1842900 100644
--- a/ext/json/json_parser.tab.c
+++ b/ext/json/json_parser.tab.c
@@ -1856,7 +1856,8 @@ yyreturn:
static int php_json_parser_array_create(php_json_parser *parser, zval *array)
{
- return array_init(array);
+ array_init(array);
+ return SUCCESS;
}
static int php_json_parser_array_append(php_json_parser *parser, zval *array, zval *zvalue)
@@ -1868,7 +1869,8 @@ static int php_json_parser_array_append(php_json_parser *parser, zval *array, zv
static int php_json_parser_object_create(php_json_parser *parser, zval *object)
{
if (parser->scanner.options & PHP_JSON_OBJECT_AS_ARRAY) {
- return array_init(object);
+ array_init(object);
+ return SUCCESS;
} else {
return object_init(object);
}
diff --git a/ext/json/json_parser.y b/ext/json/json_parser.y
index e24d42c831..9b9df983ad 100644
--- a/ext/json/json_parser.y
+++ b/ext/json/json_parser.y
@@ -248,7 +248,8 @@ errlex:
static int php_json_parser_array_create(php_json_parser *parser, zval *array)
{
- return array_init(array);
+ array_init(array);
+ return SUCCESS;
}
static int php_json_parser_array_append(php_json_parser *parser, zval *array, zval *zvalue)
@@ -260,7 +261,8 @@ static int php_json_parser_array_append(php_json_parser *parser, zval *array, zv
static int php_json_parser_object_create(php_json_parser *parser, zval *object)
{
if (parser->scanner.options & PHP_JSON_OBJECT_AS_ARRAY) {
- return array_init(object);
+ array_init(object);
+ return SUCCESS;
} else {
return object_init(object);
}
diff --git a/ext/ldap/config.m4 b/ext/ldap/config.m4
index 7ea238f5a5..59af4211f1 100644
--- a/ext/ldap/config.m4
+++ b/ext/ldap/config.m4
@@ -204,7 +204,7 @@ if test "$PHP_LDAP" != "no"; then
dnl Solaris 2.8 claims to be 2004 API, but doesn't have
dnl ldap_parse_reference() nor ldap_start_tls_s()
- AC_CHECK_FUNCS([ldap_parse_result ldap_parse_reference ldap_start_tls_s ldap_control_find ldap_parse_extended_result ldap_extended_operation ldap_extended_operation_s ldap_passwd_s ldap_whoami_s])
+ AC_CHECK_FUNCS([ldap_parse_result ldap_parse_reference ldap_start_tls_s ldap_control_find ldap_parse_extended_result ldap_extended_operation ldap_extended_operation_s ldap_passwd ldap_whoami_s ldap_refresh_s])
dnl
dnl SASL check
diff --git a/ext/ldap/config.w32 b/ext/ldap/config.w32
index 7713bdc42b..a608ff7132 100644
--- a/ext/ldap/config.w32
+++ b/ext/ldap/config.w32
@@ -23,8 +23,9 @@ if (PHP_LDAP != "no") {
AC_DEFINE('HAVE_LDAP_CONTROL_FIND', 1);
AC_DEFINE('HAVE_LDAP_PARSE_EXTENDED_RESULT', 1);
AC_DEFINE('HAVE_LDAP_EXTENDED_OPERATION_S', 1);
- AC_DEFINE('HAVE_LDAP_PASSWD_S', 1);
+ AC_DEFINE('HAVE_LDAP_PASSWD', 1);
AC_DEFINE('HAVE_LDAP_WHOAMI_S', 1);
+ AC_DEFINE('HAVE_LDAP_REFRESH_S', 1);
AC_DEFINE('HAVE_LDAP_EXTENDED_OPERATION', 1);
} else {
diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c
index a8b9923b10..1b19e0599a 100644
--- a/ext/ldap/ldap.c
+++ b/ext/ldap/ldap.c
@@ -19,6 +19,7 @@
| Jani Taskinen <sniper@iki.fi> |
| Stig Venaas <venaas@uninett.no> |
| Doug Goldstein <cardoe@cardoe.com> |
+ | Côme Chilliet <mcmic@php.net> |
| PHP 4.0 updates: Zeev Suraski <zeev@zend.com> |
+----------------------------------------------------------------------+
*/
@@ -135,6 +136,524 @@ static void _free_ldap_result_entry(zend_resource *rsrc) /* {{{ */
}
/* }}} */
+/* {{{ Parse controls from and to arrays */
+static void _php_ldap_control_to_array(LDAP *ld, LDAPControl* ctrl, zval* array, int request)
+{
+ array_init(array);
+
+ add_assoc_string(array, "oid", ctrl->ldctl_oid);
+ if (request) {
+ /* iscritical field only makes sense in request controls (which may be obtained by ldap_get_option) */
+ add_assoc_bool(array, "iscritical", (ctrl->ldctl_iscritical != 0));
+ }
+
+ // If it is a known oid, parse to values
+ if (strcmp(ctrl->ldctl_oid, LDAP_CONTROL_PASSWORDPOLICYRESPONSE) == 0) {
+ int expire = 0, grace = 0, rc;
+ LDAPPasswordPolicyError pperr;
+ zval value;
+
+ rc = ldap_parse_passwordpolicy_control(ld, ctrl, &expire, &grace, &pperr);
+ if ( rc == LDAP_SUCCESS ) {
+ array_init(&value);
+ add_assoc_long(&value, "expire", expire);
+ add_assoc_long(&value, "grace", grace);
+
+ if ( pperr != PP_noError ) {
+ add_assoc_long(&value, "error", pperr);
+ }
+ add_assoc_zval(array, "value", &value);
+ } else {
+ add_assoc_null(array, "value");
+ }
+ } else if (strcmp(ctrl->ldctl_oid, LDAP_CONTROL_PAGEDRESULTS) == 0) {
+ int lestimated, rc;
+ struct berval lcookie;
+ zval value;
+
+ if (ctrl->ldctl_value.bv_len) {
+ rc = ldap_parse_pageresponse_control(ld, ctrl, &lestimated, &lcookie);
+ } else {
+ /* ldap_parse_pageresponse_control will crash if value is empty */
+ rc = -1;
+ }
+ if ( rc == LDAP_SUCCESS ) {
+ array_init(&value);
+ add_assoc_long(&value, "size", lestimated);
+ add_assoc_stringl(&value, "cookie", lcookie.bv_val, lcookie.bv_len);
+ add_assoc_zval(array, "value", &value);
+ } else {
+ add_assoc_null(array, "value");
+ }
+ } else if ((strcmp(ctrl->ldctl_oid, LDAP_CONTROL_PRE_READ) == 0) || (strcmp(ctrl->ldctl_oid, LDAP_CONTROL_POST_READ) == 0)) {
+ BerElement *ber;
+ struct berval bv;
+
+ ber = ber_init(&ctrl->ldctl_value);
+ if (ber == NULL) {
+ add_assoc_null(array, "value");
+ } else if (ber_scanf(ber, "{m{" /*}}*/, &bv) == LBER_ERROR) {
+ add_assoc_null(array, "value");
+ } else {
+ zval value;
+
+ array_init(&value);
+ add_assoc_stringl(&value, "dn", bv.bv_val, bv.bv_len);
+
+ while (ber_scanf(ber, "{m" /*}*/, &bv) != LBER_ERROR) {
+ int i;
+ BerVarray vals = NULL;
+ zval tmp;
+
+ if (ber_scanf(ber, "[W]", &vals) == LBER_ERROR || vals == NULL)
+ {
+ break;
+ }
+
+ array_init(&tmp);
+ for (i = 0; vals[i].bv_val != NULL; i++) {
+ add_next_index_stringl(&tmp, vals[i].bv_val, vals[i].bv_len);
+ }
+ add_assoc_zval(&value, bv.bv_val, &tmp);
+
+ ber_bvarray_free(vals);
+ }
+ add_assoc_zval(array, "value", &value);
+ }
+
+ if (ber != NULL) {
+ ber_free(ber, 1);
+ }
+ } else if (strcmp(ctrl->ldctl_oid, LDAP_CONTROL_SORTRESPONSE) == 0) {
+ zval value;
+ int errcode, rc;
+ char* attribute;
+
+ if (ctrl->ldctl_value.bv_len) {
+ rc = ldap_parse_sortresponse_control(ld, ctrl, &errcode, &attribute);
+ } else {
+ rc = -1;
+ }
+ if ( rc == LDAP_SUCCESS ) {
+ array_init(&value);
+ add_assoc_long(&value, "errcode", errcode);
+ if (attribute) {
+ add_assoc_string(&value, "attribute", attribute);
+ ldap_memfree(attribute);
+ }
+ add_assoc_zval(array, "value", &value);
+ } else {
+ add_assoc_null(array, "value");
+ }
+ } else if (strcmp(ctrl->ldctl_oid, LDAP_CONTROL_VLVRESPONSE) == 0) {
+ int target, count, errcode, rc;
+ struct berval *context;
+ zval value;
+
+ if (ctrl->ldctl_value.bv_len) {
+ rc = ldap_parse_vlvresponse_control(ld, ctrl, &target, &count, &context, &errcode);
+ } else {
+ rc = -1;
+ }
+ if ( rc == LDAP_SUCCESS ) {
+ array_init(&value);
+ add_assoc_long(&value, "target", target);
+ add_assoc_long(&value, "count", count);
+ add_assoc_long(&value, "errcode", errcode);
+ add_assoc_stringl(&value, "context", context->bv_val, context->bv_len);
+ add_assoc_zval(array, "value", &value);
+ } else {
+ add_assoc_null(array, "value");
+ }
+ ber_bvfree(context);
+ } else {
+ if (ctrl->ldctl_value.bv_len) {
+ add_assoc_stringl(array, "value", ctrl->ldctl_value.bv_val, ctrl->ldctl_value.bv_len);
+ } else {
+ add_assoc_null(array, "value");
+ }
+ }
+}
+
+static int _php_ldap_control_from_array(LDAP *ld, LDAPControl** ctrl, zval* array)
+{
+ zval* val;
+ char * control_oid = NULL;
+ int control_iscritical = 0, rc = LDAP_SUCCESS;
+ char** ldap_attrs = NULL;
+ LDAPSortKey** sort_keys = NULL;
+
+ if ((val = zend_hash_str_find(Z_ARRVAL_P(array), "oid", sizeof("oid") - 1)) == NULL) {
+ php_error_docref(NULL, E_WARNING, "Control must have an oid key");
+ return -1;
+ }
+ convert_to_string_ex(val);
+ control_oid = Z_STRVAL_P(val);
+
+ if ((val = zend_hash_str_find(Z_ARRVAL_P(array), "iscritical", sizeof("iscritical") - 1)) != NULL) {
+ convert_to_boolean_ex(val);
+ control_iscritical = (Z_TYPE_P(val) == IS_TRUE);
+ } else {
+ control_iscritical = 0;
+ }
+
+ struct berval *control_value = NULL;
+
+ if ((val = zend_hash_str_find(Z_ARRVAL_P(array), "value", sizeof("value") - 1)) != NULL) {
+ if (Z_TYPE_P(val) != IS_ARRAY) {
+ convert_to_string_ex(val);
+ control_value = ber_memalloc(sizeof * control_value);
+ if (control_value == NULL) {
+ rc = -1;
+ php_error_docref(NULL, E_WARNING, "Failed to allocate control value");
+ } else {
+ control_value->bv_val = Z_STRVAL_P(val);
+ control_value->bv_len = Z_STRLEN_P(val);
+ }
+ } else if (strcmp(control_oid, LDAP_CONTROL_PAGEDRESULTS) == 0) {
+ zval* tmp;
+ int pagesize = 1;
+ struct berval cookie = { 0, NULL };
+ if ((tmp = zend_hash_str_find(Z_ARRVAL_P(val), "size", sizeof("size") - 1)) != NULL) {
+ convert_to_long_ex(tmp);
+ pagesize = Z_LVAL_P(tmp);
+ }
+ if ((tmp = zend_hash_str_find(Z_ARRVAL_P(val), "cookie", sizeof("cookie") - 1)) != NULL) {
+ convert_to_string_ex(tmp);
+ cookie.bv_val = Z_STRVAL_P(tmp);
+ cookie.bv_len = Z_STRLEN_P(tmp);
+ }
+ control_value = ber_memalloc(sizeof * control_value);
+ if (control_value == NULL) {
+ rc = -1;
+ php_error_docref(NULL, E_WARNING, "Failed to allocate control value");
+ } else {
+ rc = ldap_create_page_control_value(ld, pagesize, &cookie, control_value);
+ if (rc != LDAP_SUCCESS) {
+ php_error_docref(NULL, E_WARNING, "Failed to create paged result control value: %s (%d)", ldap_err2string(rc), rc);
+ }
+ }
+ } else if (strcmp(control_oid, LDAP_CONTROL_ASSERT) == 0) {
+ zval* tmp;
+ char* assert;
+ if ((tmp = zend_hash_str_find(Z_ARRVAL_P(val), "filter", sizeof("filter") - 1)) == NULL) {
+ rc = -1;
+ php_error_docref(NULL, E_WARNING, "Filter missing from assert control value array");
+ } else {
+ convert_to_string_ex(tmp);
+ assert = Z_STRVAL_P(tmp);
+ control_value = ber_memalloc(sizeof * control_value);
+ if (control_value == NULL) {
+ rc = -1;
+ php_error_docref(NULL, E_WARNING, "Failed to allocate control value");
+ } else {
+ // ldap_create_assertion_control_value does not reset ld_errno, we need to do it ourselves
+ // See http://www.openldap.org/its/index.cgi/Incoming?id=8674
+ int success = LDAP_SUCCESS;
+ ldap_set_option(ld, LDAP_OPT_RESULT_CODE, &success);
+ rc = ldap_create_assertion_control_value(ld, assert, control_value);
+ if (rc != LDAP_SUCCESS) {
+ php_error_docref(NULL, E_WARNING, "Failed to create assert control value: %s (%d)", ldap_err2string(rc), rc);
+ }
+ }
+ }
+ } else if (strcmp(control_oid, LDAP_CONTROL_VALUESRETURNFILTER) == 0) {
+ zval* tmp;
+ if ((tmp = zend_hash_str_find(Z_ARRVAL_P(val), "filter", sizeof("filter") - 1)) == NULL) {
+ rc = -1;
+ php_error_docref(NULL, E_WARNING, "Filter missing from control value array");
+ } else {
+ BerElement *vrber = ber_alloc_t(LBER_USE_DER);
+ control_value = ber_memalloc(sizeof * control_value);
+ if ((control_value == NULL) || (vrber == NULL)) {
+ rc = -1;
+ php_error_docref(NULL, E_WARNING, "Failed to allocate control value");
+ } else {
+ convert_to_string_ex(tmp);
+ if (ldap_put_vrFilter(vrber, Z_STRVAL_P(tmp)) == -1) {
+ ber_free(vrber, 1);
+ rc = -1;
+ php_error_docref(NULL, E_WARNING, "Failed to create control value: Bad ValuesReturnFilter: %s", Z_STRVAL_P(tmp));
+ } else {
+ if (ber_flatten2(vrber, control_value, 0) == -1) {
+ rc = -1;
+ }
+ ber_free(vrber, 1);
+ }
+ }
+ }
+ } else if ((strcmp(control_oid, LDAP_CONTROL_PRE_READ) == 0) || (strcmp(control_oid, LDAP_CONTROL_POST_READ) == 0)) {
+ zval* tmp;
+ if ((tmp = zend_hash_str_find(Z_ARRVAL_P(val), "attrs", sizeof("attrs") - 1)) == NULL) {
+ rc = -1;
+ php_error_docref(NULL, E_WARNING, "Attributes list missing from control value array");
+ } else {
+ BerElement *ber = ber_alloc_t(LBER_USE_DER);
+
+ control_value = ber_memalloc(sizeof * control_value);
+ if ((control_value == NULL) || (ber == NULL)) {
+ rc = -1;
+ php_error_docref(NULL, E_WARNING, "Failed to allocate control value");
+ } else {
+ int num_attribs, i;
+ zval* attr;
+
+ num_attribs = zend_hash_num_elements(Z_ARRVAL_P(tmp));
+ ldap_attrs = safe_emalloc((num_attribs+1), sizeof(char *), 0);
+
+ for (i = 0; i<num_attribs; i++) {
+ if ((attr = zend_hash_index_find(Z_ARRVAL_P(tmp), i)) == NULL) {
+ rc = -1;
+ php_error_docref(NULL, E_WARNING, "Failed to encode attribute list");
+ goto failure;
+ }
+
+ convert_to_string_ex(attr);
+ ldap_attrs[i] = Z_STRVAL_P(attr);
+ }
+ ldap_attrs[num_attribs] = NULL;
+
+ ber_init2( ber, NULL, LBER_USE_DER );
+
+ if (ber_printf(ber, "{v}", ldap_attrs) == -1) {
+ rc = -1;
+ php_error_docref(NULL, E_WARNING, "Failed to encode attribute list");
+ } else {
+ int err;
+ err = ber_flatten2(ber, control_value, 0);
+ if (err < 0) {
+ rc = -1;
+ php_error_docref(NULL, E_WARNING, "Failed to encode control value (%d)", err);
+ }
+ }
+ }
+ }
+ } else if (strcmp(control_oid, LDAP_CONTROL_SORTREQUEST) == 0) {
+ int num_keys, i;
+ zval *sortkey, *tmp;
+
+ num_keys = zend_hash_num_elements(Z_ARRVAL_P(val));
+ sort_keys = safe_emalloc((num_keys+1), sizeof(LDAPSortKey*), 0);
+
+ for (i = 0; i<num_keys; i++) {
+ if ((sortkey = zend_hash_index_find(Z_ARRVAL_P(val), i)) == NULL) {
+ rc = -1;
+ php_error_docref(NULL, E_WARNING, "Failed to encode sort keys list");
+ goto failure;
+ }
+
+ if ((tmp = zend_hash_str_find(Z_ARRVAL_P(sortkey), "attr", sizeof("attr") - 1)) == NULL) {
+ rc = -1;
+ php_error_docref(NULL, E_WARNING, "Sort key list missing field");
+ goto failure;
+ }
+ sort_keys[i] = emalloc(sizeof(LDAPSortKey));
+ convert_to_string_ex(tmp);
+ sort_keys[i]->attributeType = Z_STRVAL_P(tmp);
+
+ if ((tmp = zend_hash_str_find(Z_ARRVAL_P(sortkey), "oid", sizeof("oid") - 1)) != NULL) {
+ convert_to_string_ex(tmp);
+ sort_keys[i]->orderingRule = Z_STRVAL_P(tmp);
+ } else {
+ sort_keys[i]->orderingRule = NULL;
+ }
+
+ if ((tmp = zend_hash_str_find(Z_ARRVAL_P(sortkey), "reverse", sizeof("reverse") - 1)) != NULL) {
+ convert_to_boolean_ex(tmp);
+ sort_keys[i]->reverseOrder = (Z_TYPE_P(tmp) == IS_TRUE);
+ } else {
+ sort_keys[i]->reverseOrder = 0;
+ }
+ }
+ sort_keys[num_keys] = NULL;
+ control_value = ber_memalloc(sizeof * control_value);
+ if (control_value == NULL) {
+ rc = -1;
+ php_error_docref(NULL, E_WARNING, "Failed to allocate control value");
+ } else {
+ rc = ldap_create_sort_control_value(ld, sort_keys, control_value);
+ if (rc != LDAP_SUCCESS) {
+ php_error_docref(NULL, E_WARNING, "Failed to create sort control value: %s (%d)", ldap_err2string(rc), rc);
+ }
+ }
+ } else if (strcmp(control_oid, LDAP_CONTROL_VLVREQUEST) == 0) {
+ zval* tmp;
+ LDAPVLVInfo vlvInfo;
+ struct berval attrValue;
+ struct berval context;
+
+ if ((tmp = zend_hash_str_find(Z_ARRVAL_P(val), "before", sizeof("before") - 1)) != NULL) {
+ convert_to_long_ex(tmp);
+ vlvInfo.ldvlv_before_count = Z_LVAL_P(tmp);
+ } else {
+ rc = -1;
+ php_error_docref(NULL, E_WARNING, "Before key missing from array value for VLV control");
+ goto failure;
+ }
+
+ if ((tmp = zend_hash_str_find(Z_ARRVAL_P(val), "after", sizeof("after") - 1)) != NULL) {
+ convert_to_long_ex(tmp);
+ vlvInfo.ldvlv_after_count = Z_LVAL_P(tmp);
+ } else {
+ rc = -1;
+ php_error_docref(NULL, E_WARNING, "After key missing from array value for VLV control");
+ goto failure;
+ }
+
+ if ((tmp = zend_hash_str_find(Z_ARRVAL_P(val), "attrvalue", sizeof("attrvalue") - 1)) != NULL) {
+ convert_to_string_ex(tmp);
+ attrValue.bv_val = Z_STRVAL_P(tmp);
+ attrValue.bv_len = Z_STRLEN_P(tmp);
+ vlvInfo.ldvlv_attrvalue = &attrValue;
+ } else if ((tmp = zend_hash_str_find(Z_ARRVAL_P(val), "offset", sizeof("offset") - 1)) != NULL) {
+ vlvInfo.ldvlv_attrvalue = NULL;
+ convert_to_long_ex(tmp);
+ vlvInfo.ldvlv_offset = Z_LVAL_P(tmp);
+ if ((tmp = zend_hash_str_find(Z_ARRVAL_P(val), "count", sizeof("count") - 1)) != NULL) {
+ convert_to_long_ex(tmp);
+ vlvInfo.ldvlv_count = Z_LVAL_P(tmp);
+ } else {
+ rc = -1;
+ php_error_docref(NULL, E_WARNING, "Count key missing from array value for VLV control");
+ goto failure;
+ }
+ } else {
+ rc = -1;
+ php_error_docref(NULL, E_WARNING, "Missing either attrvalue or offset key from array value for VLV control");
+ goto failure;
+ }
+
+ if ((tmp = zend_hash_str_find(Z_ARRVAL_P(val), "context", sizeof("context") - 1)) != NULL) {
+ convert_to_string_ex(tmp);
+ context.bv_val = Z_STRVAL_P(tmp);
+ context.bv_len = Z_STRLEN_P(tmp);
+ vlvInfo.ldvlv_context = &context;
+ } else {
+ vlvInfo.ldvlv_context = NULL;
+ }
+
+ control_value = ber_memalloc(sizeof * control_value);
+ if (control_value == NULL) {
+ rc = -1;
+ php_error_docref(NULL, E_WARNING, "Failed to allocate control value");
+ } else {
+ rc = ldap_create_vlv_control_value(ld, &vlvInfo, control_value);
+ if (rc != LDAP_SUCCESS) {
+ php_error_docref(NULL, E_WARNING, "Failed to create VLV control value: %s (%d)", ldap_err2string(rc), rc);
+ }
+ }
+ } else {
+ php_error_docref(NULL, E_WARNING, "Control OID %s does not expect an array as value", control_oid);
+ rc = -1;
+ }
+ }
+
+ if (rc == LDAP_SUCCESS) {
+ rc = ldap_control_create(control_oid, control_iscritical, control_value, 1, ctrl);
+ }
+
+failure:
+ if (control_value != NULL) {
+ ber_memfree(control_value);
+ control_value = NULL;
+ }
+ if (ldap_attrs != NULL) {
+ efree(ldap_attrs);
+ }
+ if (sort_keys != NULL) {
+ LDAPSortKey** sortp = sort_keys;
+ while (*sortp) {
+ efree(*sortp);
+ sortp++;
+ }
+ efree(sort_keys);
+ sort_keys = NULL;
+ }
+
+ if (rc == LDAP_SUCCESS) {
+ return LDAP_SUCCESS;
+ }
+
+ // Failed
+ *ctrl = NULL;
+ return -1;
+}
+
+static void _php_ldap_controls_to_array(LDAP *ld, LDAPControl** ctrls, zval* array, int request)
+{
+ zval tmp1;
+ LDAPControl **ctrlp;
+
+ array_init(array);
+ if (ctrls == NULL) {
+ return;
+ }
+ ctrlp = ctrls;
+ while (*ctrlp != NULL) {
+ _php_ldap_control_to_array(ld, *ctrlp, &tmp1, request);
+ add_assoc_zval(array, (*ctrlp)->ldctl_oid, &tmp1);
+ ctrlp++;
+ }
+ ldap_controls_free(ctrls);
+}
+
+static LDAPControl** _php_ldap_controls_from_array(LDAP *ld, zval* array)
+{
+ int ncontrols;
+ LDAPControl** ctrlp, **ctrls = NULL;
+ zval* ctrlarray;
+ int error = 0;
+
+ ncontrols = zend_hash_num_elements(Z_ARRVAL_P(array));
+ ctrls = safe_emalloc((1 + ncontrols), sizeof(*ctrls), 0);
+ *ctrls = NULL;
+ ctrlp = ctrls;
+ ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(array), ctrlarray) {
+ if (Z_TYPE_P(ctrlarray) != IS_ARRAY) {
+ php_error_docref(NULL, E_WARNING, "The array value must contain only arrays, where each array is a control");
+ error = 1;
+ break;
+ }
+
+ if (_php_ldap_control_from_array(ld, ctrlp, ctrlarray) == LDAP_SUCCESS) {
+ ++ctrlp;
+ } else {
+ error = 1;
+ break;
+ }
+
+ *ctrlp = NULL;
+ } ZEND_HASH_FOREACH_END();
+
+ if (error) {
+ ctrlp = ctrls;
+ while (*ctrlp) {
+ ldap_control_free(*ctrlp);
+ ctrlp++;
+ }
+ efree(ctrls);
+ ctrls = NULL;
+ }
+
+ return ctrls;
+}
+
+static void _php_ldap_controls_free (LDAPControl*** ctrls)
+{
+ LDAPControl **ctrlp;
+
+ if (*ctrls) {
+ ctrlp = *ctrls;
+ while (*ctrlp) {
+ ldap_control_free(*ctrlp);
+ ctrlp++;
+ }
+ efree(*ctrls);
+ *ctrls = NULL;
+ }
+}
+/* }}} */
+
/* {{{ PHP_INI_BEGIN
*/
PHP_INI_BEGIN()
@@ -355,7 +874,7 @@ PHP_MINIT_FUNCTION(ldap)
REGISTER_STRING_CONSTANT("LDAP_CONTROL_X_TREE_DELETE", LDAP_CONTROL_X_TREE_DELETE, CONST_PERSISTENT | CONST_CS);
REGISTER_STRING_CONSTANT("LDAP_CONTROL_X_EXTENDED_DN", LDAP_CONTROL_X_EXTENDED_DN, CONST_PERSISTENT | CONST_CS);
#endif
-#ifdef LDAP_CONTROL_X_INCREMENTAL_VALUES
+#ifdef LDAP_CONTROL_VLVREQUEST
/* LDAP VLV */
REGISTER_STRING_CONSTANT("LDAP_CONTROL_VLVREQUEST", LDAP_CONTROL_VLVREQUEST, CONST_PERSISTENT | CONST_CS);
REGISTER_STRING_CONSTANT("LDAP_CONTROL_VLVRESPONSE", LDAP_CONTROL_VLVRESPONSE, CONST_PERSISTENT | CONST_CS);
@@ -488,7 +1007,7 @@ PHP_FUNCTION(ldap_connect)
int rc = LDAP_SUCCESS;
char *url = host;
if (url && !ldap_is_ldap_url(url)) {
- int urllen = hostlen + sizeof( "ldap://:65535" );
+ size_t urllen = hostlen + sizeof( "ldap://:65535" );
if (port <= 0 || port > 65535) {
efree(ld);
@@ -637,6 +1156,83 @@ PHP_FUNCTION(ldap_bind)
}
/* }}} */
+/* {{{ proto resource ldap_bind_ext(resource link [, string dn [, string password [, serverctrls]]])
+ Bind to LDAP directory */
+PHP_FUNCTION(ldap_bind_ext)
+{
+ zval *serverctrls = NULL;
+ zval *link;
+ char *ldap_bind_dn = NULL, *ldap_bind_pw = NULL;
+ size_t ldap_bind_dnlen, ldap_bind_pwlen;
+ ldap_linkdata *ld;
+ LDAPControl **lserverctrls = NULL;
+ LDAPMessage *ldap_res;
+ int rc;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|ssa", &link, &ldap_bind_dn, &ldap_bind_dnlen, &ldap_bind_pw, &ldap_bind_pwlen, &serverctrls) != SUCCESS) {
+ RETURN_FALSE;
+ }
+
+ if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
+ RETURN_FALSE;
+ }
+
+ if (ldap_bind_dn != NULL && memchr(ldap_bind_dn, '\0', ldap_bind_dnlen) != NULL) {
+ _set_lderrno(ld->link, LDAP_INVALID_CREDENTIALS);
+ php_error_docref(NULL, E_WARNING, "DN contains a null byte");
+ RETURN_FALSE;
+ }
+
+ if (ldap_bind_pw != NULL && memchr(ldap_bind_pw, '\0', ldap_bind_pwlen) != NULL) {
+ _set_lderrno(ld->link, LDAP_INVALID_CREDENTIALS);
+ php_error_docref(NULL, E_WARNING, "Password contains a null byte");
+ RETURN_FALSE;
+ }
+
+ if (serverctrls) {
+ lserverctrls = _php_ldap_controls_from_array(ld->link, serverctrls);
+ if (lserverctrls == NULL) {
+ RETVAL_FALSE;
+ goto cleanup;
+ }
+ }
+
+ {
+ /* ldap_simple_bind() is deprecated, use ldap_sasl_bind() instead */
+ struct berval cred;
+ int msgid;
+
+ cred.bv_val = ldap_bind_pw;
+ cred.bv_len = ldap_bind_pw ? ldap_bind_pwlen : 0;
+ /* asynchronous call */
+ rc = ldap_sasl_bind(ld->link, ldap_bind_dn, LDAP_SASL_SIMPLE, &cred,
+ lserverctrls, NULL, &msgid);
+ if (rc != LDAP_SUCCESS ) {
+ php_error_docref(NULL, E_WARNING, "Unable to bind to server: %s (%d)", ldap_err2string(rc), rc);
+ RETVAL_FALSE;
+ goto cleanup;
+ }
+
+ rc = ldap_result(ld->link, msgid, 1 /* LDAP_MSG_ALL */, NULL, &ldap_res);
+ if (rc == -1) {
+ php_error_docref(NULL, E_WARNING, "Bind operation failed");
+ RETVAL_FALSE;
+ goto cleanup;
+ }
+
+ /* return a PHP control object */
+ RETVAL_RES(zend_register_resource(ldap_res, le_result));
+ }
+
+cleanup:
+ if (lserverctrls) {
+ _php_ldap_controls_free(&lserverctrls);
+ }
+
+ return;
+}
+/* }}} */
+
#ifdef HAVE_LDAP_SASL
typedef struct {
char *mech;
@@ -827,22 +1423,24 @@ static void php_set_opts(LDAP *ldap, int sizelimit, int timelimit, int deref, in
*/
static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
{
- zval *link, *base_dn, *filter, *attrs = NULL, *attr;
+ zval *link, *base_dn, *filter, *attrs = NULL, *attr, *serverctrls = NULL;
zend_long attrsonly, sizelimit, timelimit, deref;
char *ldap_base_dn = NULL, *ldap_filter = NULL, **ldap_attrs = NULL;
ldap_linkdata *ld = NULL;
LDAPMessage *ldap_res;
+ LDAPControl **lserverctrls = NULL;
int ldap_attrsonly = 0, ldap_sizelimit = -1, ldap_timelimit = -1, ldap_deref = -1;
int old_ldap_sizelimit = -1, old_ldap_timelimit = -1, old_ldap_deref = -1;
int num_attribs = 0, ret = 1, i, errno, argcount = ZEND_NUM_ARGS();
- if (zend_parse_parameters(argcount, "zzz|allll", &link, &base_dn, &filter, &attrs, &attrsonly,
- &sizelimit, &timelimit, &deref) == FAILURE) {
+ if (zend_parse_parameters(argcount, "zzz|alllla", &link, &base_dn, &filter, &attrs, &attrsonly,
+ &sizelimit, &timelimit, &deref, &serverctrls) == FAILURE) {
return;
}
/* Reverse -> fall through */
switch (argcount) {
+ case 9:
case 8:
ldap_deref = deref;
case 7:
@@ -945,10 +1543,20 @@ static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
ldap_filter = Z_STRVAL_P(entry);
}
+ if (argcount > 8) {
+ // We have to parse controls again for each link as they use it
+ _php_ldap_controls_free(&lserverctrls);
+ lserverctrls = _php_ldap_controls_from_array(ld->link, serverctrls);
+ if (lserverctrls == NULL) {
+ rcs[i] = -1;
+ continue;
+ }
+ }
+
php_set_opts(ld->link, ldap_sizelimit, ldap_timelimit, ldap_deref, &old_ldap_sizelimit, &old_ldap_timelimit, &old_ldap_deref);
/* Run the actual search */
- ldap_search_ext(ld->link, ldap_base_dn, scope, ldap_filter, ldap_attrs, ldap_attrsonly, NULL, NULL, NULL, ldap_sizelimit, &rcs[i]);
+ ldap_search_ext(ld->link, ldap_base_dn, scope, ldap_filter, ldap_attrs, ldap_attrsonly, lserverctrls, NULL, NULL, ldap_sizelimit, &rcs[i]);
lds[i] = ld;
zend_hash_move_forward(Z_ARRVAL_P(link));
}
@@ -986,10 +1594,18 @@ cleanup_parallel:
goto cleanup;
}
+ if (argcount > 8) {
+ lserverctrls = _php_ldap_controls_from_array(ld->link, serverctrls);
+ if (lserverctrls == NULL) {
+ ret = 0;
+ goto cleanup;
+ }
+ }
+
php_set_opts(ld->link, ldap_sizelimit, ldap_timelimit, ldap_deref, &old_ldap_sizelimit, &old_ldap_timelimit, &old_ldap_deref);
/* Run the actual search */
- errno = ldap_search_ext_s(ld->link, ldap_base_dn, scope, ldap_filter, ldap_attrs, ldap_attrsonly, NULL, NULL, NULL, ldap_sizelimit, &ldap_res);
+ errno = ldap_search_ext_s(ld->link, ldap_base_dn, scope, ldap_filter, ldap_attrs, ldap_attrsonly, lserverctrls, NULL, NULL, ldap_sizelimit, &ldap_res);
if (errno != LDAP_SUCCESS
&& errno != LDAP_SIZELIMIT_EXCEEDED
@@ -1027,10 +1643,13 @@ cleanup:
if (!ret) {
RETVAL_BOOL(ret);
}
+ if (lserverctrls) {
+ _php_ldap_controls_free(&lserverctrls);
+ }
}
/* }}} */
-/* {{{ proto resource ldap_read(resource|array link, string base_dn, string filter [, array attrs [, int attrsonly [, int sizelimit [, int timelimit [, int deref]]]]])
+/* {{{ proto resource ldap_read(resource|array link, string base_dn, string filter [, array attrs [, int attrsonly [, int sizelimit [, int timelimit [, int deref [, array servercontrols]]]]]])
Read an entry */
PHP_FUNCTION(ldap_read)
{
@@ -1038,7 +1657,7 @@ PHP_FUNCTION(ldap_read)
}
/* }}} */
-/* {{{ proto resource ldap_list(resource|array link, string base_dn, string filter [, array attrs [, int attrsonly [, int sizelimit [, int timelimit [, int deref]]]]])
+/* {{{ proto resource ldap_list(resource|array link, string base_dn, string filter [, array attrs [, int attrsonly [, int sizelimit [, int timelimit [, int deref [, array servercontrols]]]]]])
Single-level search */
PHP_FUNCTION(ldap_list)
{
@@ -1046,7 +1665,7 @@ PHP_FUNCTION(ldap_list)
}
/* }}} */
-/* {{{ proto resource ldap_search(resource|array link, string base_dn, string filter [, array attrs [, int attrsonly [, int sizelimit [, int timelimit [, int deref]]]]])
+/* {{{ proto resource ldap_search(resource|array link, string base_dn, string filter [, array attrs [, int attrsonly [, int sizelimit [, int timelimit [, int deref [, array servercontrols]]]]]])
Search LDAP tree under base_dn */
PHP_FUNCTION(ldap_search)
{
@@ -1535,20 +2154,23 @@ PHP_FUNCTION(ldap_dn2ufn)
#define PHP_LD_FULL_ADD 0xff
/* {{{ php_ldap_do_modify
*/
-static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper)
+static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper, int ext)
{
+ zval *serverctrls = NULL;
zval *link, *entry, *value, *ivalue;
ldap_linkdata *ld;
char *dn;
LDAPMod **ldap_mods;
- int i, j, num_attribs, num_values;
+ LDAPControl **lserverctrls = NULL;
+ LDAPMessage *ldap_res;
+ int i, j, num_attribs, num_values, msgid;
size_t dn_len;
int *num_berval;
zend_string *attribute;
zend_ulong index;
int is_full_add=0; /* flag for full add operation so ldap_mod_add can be put back into oper, gerrit THomson */
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsa/", &link, &dn, &dn_len, &entry) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsa/|a", &link, &dn, &dn_len, &entry, &serverctrls) != SUCCESS) {
return;
}
@@ -1616,7 +2238,7 @@ static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper)
num_berval[i] = j;
num_attribs = i + 1;
RETVAL_FALSE;
- goto errexit;
+ goto cleanup;
}
convert_to_string_ex(ivalue);
ldap_mods[i]->mod_bvalues[j] = (struct berval *) emalloc (sizeof(struct berval));
@@ -1629,20 +2251,58 @@ static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper)
}
ldap_mods[num_attribs] = NULL;
+ if (serverctrls) {
+ lserverctrls = _php_ldap_controls_from_array(ld->link, serverctrls);
+ if (lserverctrls == NULL) {
+ RETVAL_FALSE;
+ goto cleanup;
+ }
+ }
+
/* check flag to see if do_mod was called to perform full add , gerrit thomson */
if (is_full_add == 1) {
- if ((i = ldap_add_ext_s(ld->link, dn, ldap_mods, NULL, NULL)) != LDAP_SUCCESS) {
+ if (ext) {
+ i = ldap_add_ext(ld->link, dn, ldap_mods, lserverctrls, NULL, &msgid);
+ } else {
+ i = ldap_add_ext_s(ld->link, dn, ldap_mods, lserverctrls, NULL);
+ }
+ if (i != LDAP_SUCCESS) {
php_error_docref(NULL, E_WARNING, "Add: %s", ldap_err2string(i));
RETVAL_FALSE;
+ } else if (ext) {
+ i = ldap_result(ld->link, msgid, 1 /* LDAP_MSG_ALL */, NULL, &ldap_res);
+ if (i == -1) {
+ php_error_docref(NULL, E_WARNING, "Add operation failed");
+ RETVAL_FALSE;
+ goto cleanup;
+ }
+
+ /* return a PHP control object */
+ RETVAL_RES(zend_register_resource(ldap_res, le_result));
} else RETVAL_TRUE;
} else {
- if ((i = ldap_modify_ext_s(ld->link, dn, ldap_mods, NULL, NULL)) != LDAP_SUCCESS) {
+ if (ext) {
+ i = ldap_modify_ext(ld->link, dn, ldap_mods, lserverctrls, NULL, &msgid);
+ } else {
+ i = ldap_modify_ext_s(ld->link, dn, ldap_mods, lserverctrls, NULL);
+ }
+ if (i != LDAP_SUCCESS) {
php_error_docref(NULL, E_WARNING, "Modify: %s", ldap_err2string(i));
RETVAL_FALSE;
+ } else if (ext) {
+ i = ldap_result(ld->link, msgid, 1 /* LDAP_MSG_ALL */, NULL, &ldap_res);
+ if (i == -1) {
+ php_error_docref(NULL, E_WARNING, "Modify operation failed");
+ RETVAL_FALSE;
+ goto cleanup;
+ }
+
+ /* return a PHP control object */
+ RETVAL_RES(zend_register_resource(ldap_res, le_result));
} else RETVAL_TRUE;
}
-errexit:
+cleanup:
for (i = 0; i < num_attribs; i++) {
efree(ldap_mods[i]->mod_type);
for (j = 0; j < num_berval[i]; j++) {
@@ -1654,56 +2314,95 @@ errexit:
efree(num_berval);
efree(ldap_mods);
+ if (lserverctrls) {
+ _php_ldap_controls_free(&lserverctrls);
+ }
+
return;
}
/* }}} */
-/* {{{ proto bool ldap_add(resource link, string dn, array entry)
+/* {{{ proto bool ldap_add(resource link, string dn, array entry [, array servercontrols])
Add entries to LDAP directory */
PHP_FUNCTION(ldap_add)
{
/* use a newly define parameter into the do_modify so ldap_mod_add can be used the way it is supposed to be used , Gerrit THomson */
- php_ldap_do_modify(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_LD_FULL_ADD);
+ php_ldap_do_modify(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_LD_FULL_ADD, 0);
+}
+/* }}} */
+
+/* {{{ proto resource ldap_add_ext(resource link, string dn, array entry [, array servercontrols])
+ Add entries to LDAP directory */
+PHP_FUNCTION(ldap_add_ext)
+{
+ php_ldap_do_modify(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_LD_FULL_ADD, 1);
}
/* }}} */
/* three functions for attribute base modifications, gerrit Thomson */
-/* {{{ proto bool ldap_mod_replace(resource link, string dn, array entry)
+/* {{{ proto bool ldap_mod_replace(resource link, string dn, array entry [, array servercontrols])
Replace attribute values with new ones */
PHP_FUNCTION(ldap_mod_replace)
{
- php_ldap_do_modify(INTERNAL_FUNCTION_PARAM_PASSTHRU, LDAP_MOD_REPLACE);
+ php_ldap_do_modify(INTERNAL_FUNCTION_PARAM_PASSTHRU, LDAP_MOD_REPLACE, 0);
+}
+/* }}} */
+
+/* {{{ proto resource ldap_mod_replace_ext(resource link, string dn, array entry [, array servercontrols])
+ Replace attribute values with new ones */
+PHP_FUNCTION(ldap_mod_replace_ext)
+{
+ php_ldap_do_modify(INTERNAL_FUNCTION_PARAM_PASSTHRU, LDAP_MOD_REPLACE, 1);
}
/* }}} */
-/* {{{ proto bool ldap_mod_add(resource link, string dn, array entry)
+/* {{{ proto bool ldap_mod_add(resource link, string dn, array entry [, array servercontrols])
Add attribute values to current */
PHP_FUNCTION(ldap_mod_add)
{
- php_ldap_do_modify(INTERNAL_FUNCTION_PARAM_PASSTHRU, LDAP_MOD_ADD);
+ php_ldap_do_modify(INTERNAL_FUNCTION_PARAM_PASSTHRU, LDAP_MOD_ADD, 0);
}
/* }}} */
-/* {{{ proto bool ldap_mod_del(resource link, string dn, array entry)
+/* {{{ proto resource ldap_mod_add(resource link, string dn, array entry [, array servercontrols])
+ Add attribute values to current */
+PHP_FUNCTION(ldap_mod_add_ext)
+{
+ php_ldap_do_modify(INTERNAL_FUNCTION_PARAM_PASSTHRU, LDAP_MOD_ADD, 1);
+}
+/* }}} */
+
+/* {{{ proto bool ldap_mod_del(resource link, string dn, array entry [, array servercontrols])
Delete attribute values */
PHP_FUNCTION(ldap_mod_del)
{
- php_ldap_do_modify(INTERNAL_FUNCTION_PARAM_PASSTHRU, LDAP_MOD_DELETE);
+ php_ldap_do_modify(INTERNAL_FUNCTION_PARAM_PASSTHRU, LDAP_MOD_DELETE, 0);
}
/* }}} */
-/* {{{ proto bool ldap_delete(resource link, string dn)
- Delete an entry from a directory */
-PHP_FUNCTION(ldap_delete)
+/* {{{ proto resource ldap_mod_del_ext(resource link, string dn, array entry [, array servercontrols])
+ Delete attribute values */
+PHP_FUNCTION(ldap_mod_del_ext)
{
+ php_ldap_do_modify(INTERNAL_FUNCTION_PARAM_PASSTHRU, LDAP_MOD_DELETE, 1);
+}
+/* }}} */
+
+/* {{{ php_ldap_do_delete
+ */
+static void php_ldap_do_delete(INTERNAL_FUNCTION_PARAMETERS, int ext)
+{
+ zval *serverctrls = NULL;
zval *link;
ldap_linkdata *ld;
+ LDAPControl **lserverctrls = NULL;
+ LDAPMessage *ldap_res;
char *dn;
- int rc;
+ int rc, msgid;
size_t dn_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &link, &dn, &dn_len) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|a", &link, &dn, &dn_len, &serverctrls) != SUCCESS) {
return;
}
@@ -1711,20 +2410,67 @@ PHP_FUNCTION(ldap_delete)
RETURN_FALSE;
}
- if ((rc = ldap_delete_ext_s(ld->link, dn, NULL, NULL)) != LDAP_SUCCESS) {
+ if (serverctrls) {
+ lserverctrls = _php_ldap_controls_from_array(ld->link, serverctrls);
+ if (lserverctrls == NULL) {
+ RETVAL_FALSE;
+ goto cleanup;
+ }
+ }
+
+ if (ext) {
+ rc = ldap_delete_ext(ld->link, dn, lserverctrls, NULL, &msgid);
+ } else {
+ rc = ldap_delete_ext_s(ld->link, dn, lserverctrls, NULL);
+ }
+ if (rc != LDAP_SUCCESS) {
php_error_docref(NULL, E_WARNING, "Delete: %s", ldap_err2string(rc));
- RETURN_FALSE;
+ RETVAL_FALSE;
+ goto cleanup;
+ } else if (ext) {
+ rc = ldap_result(ld->link, msgid, 1 /* LDAP_MSG_ALL */, NULL, &ldap_res);
+ if (rc == -1) {
+ php_error_docref(NULL, E_WARNING, "Delete operation failed");
+ RETVAL_FALSE;
+ goto cleanup;
+ }
+
+ /* return a PHP control object */
+ RETVAL_RES(zend_register_resource(ldap_res, le_result));
+ } else {
+ RETVAL_TRUE;
}
- RETURN_TRUE;
+cleanup:
+ if (lserverctrls) {
+ _php_ldap_controls_free(&lserverctrls);
+ }
+
+ return;
+}
+/* }}} */
+
+/* {{{ proto bool ldap_delete(resource link, string dn [, array servercontrols])
+ Delete an entry from a directory */
+PHP_FUNCTION(ldap_delete)
+{
+ php_ldap_do_delete(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
+}
+/* }}} */
+
+/* {{{ proto resource ldap_delete_ext(resource link, string dn [, array servercontrols])
+ Delete an entry from a directory */
+PHP_FUNCTION(ldap_delete_ext)
+{
+ php_ldap_do_delete(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
}
/* }}} */
/* {{{ _ldap_str_equal_to_const
*/
-static int _ldap_str_equal_to_const(const char *str, uint32_t str_len, const char *cstr)
+static size_t _ldap_str_equal_to_const(const char *str, size_t str_len, const char *cstr)
{
- uint32_t i;
+ size_t i;
if (strlen(cstr) != str_len)
return 0;
@@ -1741,9 +2487,9 @@ static int _ldap_str_equal_to_const(const char *str, uint32_t str_len, const cha
/* {{{ _ldap_strlen_max
*/
-static int _ldap_strlen_max(const char *str, uint32_t max_len)
+static size_t _ldap_strlen_max(const char *str, size_t max_len)
{
- uint32_t i;
+ size_t i;
for (i = 0; i < max_len; ++i) {
if (str[i] == '\0') {
@@ -1763,10 +2509,11 @@ static void _ldap_hash_fetch(zval *hashTbl, const char *key, zval **out)
}
/* }}} */
-/* {{{ proto bool ldap_modify_batch(resource link, string dn, array modifs)
+/* {{{ proto bool ldap_modify_batch(resource link, string dn, array modifs [, array servercontrols])
Perform multiple modifications as part of one operation */
PHP_FUNCTION(ldap_modify_batch)
{
+ zval *serverctrls = NULL;
ldap_linkdata *ld;
zval *link, *mods, *mod, *modinfo, *modval;
zval *attrib, *modtype, *vals;
@@ -1776,6 +2523,7 @@ PHP_FUNCTION(ldap_modify_batch)
int i, j, k;
int num_mods, num_modprops, num_modvals;
LDAPMod **ldap_mods;
+ LDAPControl **lserverctrls = NULL;
uint32_t oper;
/*
@@ -1802,7 +2550,7 @@ PHP_FUNCTION(ldap_modify_batch)
);
*/
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsa/", &link, &dn, &dn_len, &mods) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsa/|a", &link, &dn, &dn_len, &mods, &serverctrls) != SUCCESS) {
return;
}
@@ -1819,7 +2567,7 @@ PHP_FUNCTION(ldap_modify_batch)
zend_ulong tmpUlong;
/* make sure the DN contains no NUL bytes */
- if ((size_t)_ldap_strlen_max(dn, dn_len) != dn_len) {
+ if (_ldap_strlen_max(dn, dn_len) != dn_len) {
php_error_docref(NULL, E_WARNING, "DN must not contain NUL bytes");
RETURN_FALSE;
}
@@ -1879,7 +2627,7 @@ PHP_FUNCTION(ldap_modify_batch)
RETURN_FALSE;
}
- if (Z_STRLEN_P(modinfo) != (size_t)_ldap_strlen_max(Z_STRVAL_P(modinfo), Z_STRLEN_P(modinfo))) {
+ if (Z_STRLEN_P(modinfo) != _ldap_strlen_max(Z_STRVAL_P(modinfo), Z_STRLEN_P(modinfo))) {
php_error_docref(NULL, E_WARNING, "A '" LDAP_MODIFY_BATCH_ATTRIB "' value must not contain NUL bytes");
RETURN_FALSE;
}
@@ -2030,8 +2778,16 @@ PHP_FUNCTION(ldap_modify_batch)
/* NULL-terminate modifications */
ldap_mods[num_mods] = NULL;
+ if (serverctrls) {
+ lserverctrls = _php_ldap_controls_from_array(ld->link, serverctrls);
+ if (lserverctrls == NULL) {
+ RETVAL_FALSE;
+ goto cleanup;
+ }
+ }
+
/* perform (finally) */
- if ((i = ldap_modify_ext_s(ld->link, dn, ldap_mods, NULL, NULL)) != LDAP_SUCCESS) {
+ if ((i = ldap_modify_ext_s(ld->link, dn, ldap_mods, lserverctrls, NULL)) != LDAP_SUCCESS) {
php_error_docref(NULL, E_WARNING, "Batch Modify: %s", ldap_err2string(i));
RETVAL_FALSE;
} else RETVAL_TRUE;
@@ -2062,6 +2818,10 @@ PHP_FUNCTION(ldap_modify_batch)
/* the modifications array */
efree(ldap_mods);
+
+ if (lserverctrls) {
+ _php_ldap_controls_free(&lserverctrls);
+ }
}
}
/* }}} */
@@ -2125,14 +2885,16 @@ PHP_FUNCTION(ldap_error)
Determine if an entry has a specific value for one of its attributes */
PHP_FUNCTION(ldap_compare)
{
+ zval *serverctrls = NULL;
zval *link;
char *dn, *attr, *value;
size_t dn_len, attr_len, value_len;
ldap_linkdata *ld;
+ LDAPControl **lserverctrls = NULL;
int errno;
struct berval lvalue;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsss", &link, &dn, &dn_len, &attr, &attr_len, &value, &value_len) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsss|a", &link, &dn, &dn_len, &attr, &attr_len, &value, &value_len, &serverctrls) != SUCCESS) {
return;
}
@@ -2140,23 +2902,39 @@ PHP_FUNCTION(ldap_compare)
RETURN_FALSE;
}
+ if (serverctrls) {
+ lserverctrls = _php_ldap_controls_from_array(ld->link, serverctrls);
+ if (lserverctrls == NULL) {
+ RETVAL_FALSE;
+ goto cleanup;
+ }
+ }
+
lvalue.bv_val = value;
lvalue.bv_len = value_len;
- errno = ldap_compare_ext_s(ld->link, dn, attr, &lvalue, NULL, NULL);
+ errno = ldap_compare_ext_s(ld->link, dn, attr, &lvalue, lserverctrls, NULL);
switch (errno) {
case LDAP_COMPARE_TRUE:
- RETURN_TRUE;
+ RETVAL_TRUE;
break;
case LDAP_COMPARE_FALSE:
- RETURN_FALSE;
+ RETVAL_FALSE;
break;
+
+ default:
+ php_error_docref(NULL, E_WARNING, "Compare: %s", ldap_err2string(errno));
+ RETVAL_LONG(-1);
+ }
+
+cleanup:
+ if (lserverctrls) {
+ _php_ldap_controls_free(&lserverctrls);
}
- php_error_docref(NULL, E_WARNING, "Compare: %s", ldap_err2string(errno));
- RETURN_LONG(-1);
+ return;
}
/* }}} */
@@ -2346,9 +3124,7 @@ PHP_FUNCTION(ldap_get_option)
case LDAP_OPT_SERVER_CONTROLS:
case LDAP_OPT_CLIENT_CONTROLS:
{
- zval tmp1;
- int num_entries;
- LDAPControl **ctrls = NULL, **ctrlp;
+ LDAPControl **ctrls = NULL;
if (ldap_get_option(ld->link, option, &ctrls) || ctrls == NULL) {
if (ctrls) {
@@ -2356,24 +3132,7 @@ PHP_FUNCTION(ldap_get_option)
}
RETURN_FALSE;
}
-
- zval_ptr_dtor(retval);
- array_init(retval);
- num_entries = 0;
- ctrlp = ctrls;
- while (*ctrlp != NULL)
- {
- array_init(&tmp1);
- add_assoc_string(&tmp1, "oid", (*ctrlp)->ldctl_oid);
- add_assoc_bool(&tmp1, "iscritical", ((*ctrlp)->ldctl_iscritical != 0));
- if ((*ctrlp)->ldctl_value.bv_len) {
- add_assoc_stringl(&tmp1, "value", (*ctrlp)->ldctl_value.bv_val, (*ctrlp)->ldctl_value.bv_len);
- }
- zend_hash_index_update(Z_ARRVAL_P(retval), num_entries, &tmp1);
- num_entries++;
- ctrlp++;
- }
- ldap_controls_free(ctrls);
+ _php_ldap_controls_to_array(ld->link, ctrls, retval, 1);
} break;
/* options not implemented
case LDAP_OPT_API_INFO:
@@ -2436,7 +3195,11 @@ PHP_FUNCTION(ldap_set_option)
int val;
convert_to_long_ex(newval);
- val = Z_LVAL_P(newval);
+ if (ZEND_LONG_EXCEEDS_INT(Z_LVAL_P(newval))) {
+ php_error_docref(NULL, E_WARNING, "Option value is too big");
+ RETURN_FALSE;
+ }
+ val = (int)Z_LVAL_P(newval);
if (ldap_set_option(ldap, option, &val)) {
RETURN_FALSE;
}
@@ -2535,62 +3298,24 @@ PHP_FUNCTION(ldap_set_option)
case LDAP_OPT_SERVER_CONTROLS:
case LDAP_OPT_CLIENT_CONTROLS:
{
- LDAPControl *ctrl, **ctrls, **ctrlp;
- zval *ctrlval, *val;
- int ncontrols;
- char error=0;
+ LDAPControl **ctrls;
+ int rc;
if (Z_TYPE_P(newval) != IS_ARRAY) {
php_error_docref(NULL, E_WARNING, "Expected array value for this option");
RETURN_FALSE;
}
- ncontrols = zend_hash_num_elements(Z_ARRVAL_P(newval));
- ctrls = safe_emalloc((1 + ncontrols), sizeof(*ctrls), 0);
- *ctrls = NULL;
- ctrlp = ctrls;
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(newval), ctrlval) {
- if (Z_TYPE_P(ctrlval) != IS_ARRAY) {
- php_error_docref(NULL, E_WARNING, "The array value must contain only arrays, where each array is a control");
- error = 1;
- break;
- }
- if ((val = zend_hash_str_find(Z_ARRVAL_P(ctrlval), "oid", sizeof("oid") - 1)) == NULL) {
- php_error_docref(NULL, E_WARNING, "Control must have an oid key");
- error = 1;
- break;
- }
- ctrl = *ctrlp = emalloc(sizeof(**ctrlp));
- convert_to_string_ex(val);
- ctrl->ldctl_oid = Z_STRVAL_P(val);
- if ((val = zend_hash_str_find(Z_ARRVAL_P(ctrlval), "value", sizeof("value") - 1)) != NULL) {
- convert_to_string_ex(val);
- ctrl->ldctl_value.bv_val = Z_STRVAL_P(val);
- ctrl->ldctl_value.bv_len = Z_STRLEN_P(val);
- } else {
- ctrl->ldctl_value.bv_val = NULL;
- ctrl->ldctl_value.bv_len = 0;
- }
- if ((val = zend_hash_str_find(Z_ARRVAL_P(ctrlval), "iscritical", sizeof("iscritical") - 1)) != NULL) {
- convert_to_boolean_ex(val);
- ctrl->ldctl_iscritical = Z_TYPE_P(val) == IS_TRUE;
- } else {
- ctrl->ldctl_iscritical = 0;
- }
- ++ctrlp;
- *ctrlp = NULL;
- } ZEND_HASH_FOREACH_END();
- if (!error) {
- error = ldap_set_option(ldap, option, ctrls);
- }
- ctrlp = ctrls;
- while (*ctrlp) {
- efree(*ctrlp);
- ctrlp++;
- }
- efree(ctrls);
- if (error) {
+ ctrls = _php_ldap_controls_from_array(ldap, newval);
+
+ if (ctrls == NULL) {
RETURN_FALSE;
+ } else {
+ rc = ldap_set_option(ldap, option, ctrls);
+ _php_ldap_controls_free(&ctrls);
+ if (rc != LDAP_SUCCESS) {
+ RETURN_FALSE;
+ }
}
} break;
default:
@@ -2601,18 +3326,19 @@ PHP_FUNCTION(ldap_set_option)
/* }}} */
#ifdef HAVE_LDAP_PARSE_RESULT
-/* {{{ proto bool ldap_parse_result(resource link, resource result, int errcode, string matcheddn, string errmsg, array referrals)
+/* {{{ proto bool ldap_parse_result(resource link, resource result, int &errcode [, string &matcheddn [, string &errmsg [, array &referrals [, array &controls]]]])
Extract information from result */
PHP_FUNCTION(ldap_parse_result)
{
- zval *link, *result, *errcode, *matcheddn, *errmsg, *referrals;
+ zval *link, *result, *errcode, *matcheddn, *errmsg, *referrals, *serverctrls;
ldap_linkdata *ld;
LDAPMessage *ldap_result;
+ LDAPControl **lserverctrls = NULL, **ctrlp = NULL;
char **lreferrals, **refp;
char *lmatcheddn, *lerrmsg;
- int rc, lerrcode, myargcount = ZEND_NUM_ARGS();
+ int rc, lerrcode, myargcount = ZEND_NUM_ARGS(), ber_decode_error_count = -1;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrz/|z/z/z/", &link, &result, &errcode, &matcheddn, &errmsg, &referrals) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrz/|z/z/z/z/", &link, &result, &errcode, &matcheddn, &errmsg, &referrals, &serverctrls) != SUCCESS) {
return;
}
@@ -2628,7 +3354,7 @@ PHP_FUNCTION(ldap_parse_result)
myargcount > 3 ? &lmatcheddn : NULL,
myargcount > 4 ? &lerrmsg : NULL,
myargcount > 5 ? &lreferrals : NULL,
- NULL /* &serverctrls */,
+ myargcount > 6 ? &lserverctrls : NULL,
0);
if (rc != LDAP_SUCCESS) {
php_error_docref(NULL, E_WARNING, "Unable to parse result: %s", ldap_err2string(rc));
@@ -2640,6 +3366,8 @@ PHP_FUNCTION(ldap_parse_result)
/* Reverse -> fall through */
switch (myargcount) {
+ case 7:
+ _php_ldap_controls_to_array(ld->link, lserverctrls, serverctrls, 0);
case 6:
zval_ptr_dtor(referrals);
array_init(referrals);
@@ -2841,18 +3569,21 @@ PHP_FUNCTION(ldap_parse_reference)
/* }}} */
#endif
-/* {{{ proto bool ldap_rename(resource link, string dn, string newrdn, string newparent, bool deleteoldrdn)
- Modify the name of an entry */
-PHP_FUNCTION(ldap_rename)
+/* {{{ php_ldap_do_rename
+ */
+static void php_ldap_do_rename(INTERNAL_FUNCTION_PARAMETERS, int ext)
{
+ zval *serverctrls = NULL;
zval *link;
ldap_linkdata *ld;
- int rc;
+ LDAPControl **lserverctrls = NULL;
+ LDAPMessage *ldap_res;
+ int rc, msgid;
char *dn, *newrdn, *newparent;
size_t dn_len, newrdn_len, newparent_len;
zend_bool deleteoldrdn;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsssb", &link, &dn, &dn_len, &newrdn, &newrdn_len, &newparent, &newparent_len, &deleteoldrdn) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsssb|a", &link, &dn, &dn_len, &newrdn, &newrdn_len, &newparent, &newparent_len, &deleteoldrdn, &serverctrls) != SUCCESS) {
return;
}
@@ -2865,20 +3596,74 @@ PHP_FUNCTION(ldap_rename)
}
#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP
- rc = ldap_rename_s(ld->link, dn, newrdn, newparent, deleteoldrdn, NULL, NULL);
+ if (serverctrls) {
+ lserverctrls = _php_ldap_controls_from_array(ld->link, serverctrls);
+ if (lserverctrls == NULL) {
+ RETVAL_FALSE;
+ goto cleanup;
+ }
+ }
+
+ if (ext) {
+ rc = ldap_rename(ld->link, dn, newrdn, newparent, deleteoldrdn, lserverctrls, NULL, &msgid);
+ } else {
+ rc = ldap_rename_s(ld->link, dn, newrdn, newparent, deleteoldrdn, lserverctrls, NULL);
+ }
#else
if (newparent_len != 0) {
php_error_docref(NULL, E_WARNING, "You are using old LDAP API, newparent must be the empty string, can only modify RDN");
RETURN_FALSE;
}
+ if (serverctrls) {
+ php_error_docref(NULL, E_WARNING, "You are using old LDAP API, controls are not supported");
+ RETURN_FALSE;
+ }
+ if (ext) {
+ php_error_docref(NULL, E_WARNING, "You are using old LDAP API, ldap_rename_ext is not supported");
+ RETURN_FALSE;
+ }
/* could support old APIs but need check for ldap_modrdn2()/ldap_modrdn() */
rc = ldap_modrdn2_s(ld->link, dn, newrdn, deleteoldrdn);
#endif
- if (rc == LDAP_SUCCESS) {
- RETURN_TRUE;
+ if (rc != LDAP_SUCCESS) {
+ RETVAL_FALSE;
+ } else if (ext) {
+ rc = ldap_result(ld->link, msgid, 1 /* LDAP_MSG_ALL */, NULL, &ldap_res);
+ if (rc == -1) {
+ php_error_docref(NULL, E_WARNING, "Rename operation failed");
+ RETVAL_FALSE;
+ goto cleanup;
+ }
+
+ /* return a PHP control object */
+ RETVAL_RES(zend_register_resource(ldap_res, le_result));
+ } else {
+ RETVAL_TRUE;
}
- RETURN_FALSE;
+
+cleanup:
+ if (lserverctrls) {
+ _php_ldap_controls_free(&lserverctrls);
+ }
+
+ return;
+}
+/* }}} */
+
+/* {{{ proto bool ldap_rename(resource link, string dn, string newrdn, string newparent, bool deleteoldrdn [, array servercontrols])
+ Modify the name of an entry */
+PHP_FUNCTION(ldap_rename)
+{
+ php_ldap_do_rename(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
+}
+/* }}} */
+
+/* {{{ proto resource ldap_rename_ext(resource link, string dn, string newrdn, string newparent, bool deleteoldrdn [, array servercontrols])
+ Modify the name of an entry */
+PHP_FUNCTION(ldap_rename_ext)
+{
+ php_ldap_do_rename(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
}
/* }}} */
@@ -3030,9 +3815,9 @@ static zend_string* php_ldap_do_escape(const zend_bool *map, const char *value,
return ret;
}
-static void php_ldap_escape_map_set_chars(zend_bool *map, const char *chars, const int charslen, char escape)
+static void php_ldap_escape_map_set_chars(zend_bool *map, const char *chars, const size_t charslen, char escape)
{
- int i = 0;
+ size_t i = 0;
while (i < charslen) {
map[(unsigned char) chars[i++]] = escape;
}
@@ -3326,107 +4111,121 @@ PHP_FUNCTION(ldap_control_paged_result_response)
Extended operation */
PHP_FUNCTION(ldap_exop)
{
- zval *servercontrols;
- zval *link, *reqoid, *reqdata, *retdata, *retoid;
- char *lreqoid, *lretoid = NULL;
+ zval *serverctrls = NULL;
+ zval *link, *retdata = NULL, *retoid = NULL;
+ char *lretoid = NULL;
+ zend_string *reqoid, *reqdata = NULL;
struct berval lreqdata, *lretdata = NULL;
ldap_linkdata *ld;
LDAPMessage *ldap_res;
- int rc, msgid, myargcount = ZEND_NUM_ARGS();
- /* int reqoid_len, reqdata_len, retdata_len, retoid_len, retdat_len; */
+ LDAPControl **lserverctrls = NULL;
+ int rc, msgid;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz|zzz/z/", &link, &reqoid, &reqdata, &servercontrols, &retdata, &retoid) != SUCCESS) {
- WRONG_PARAM_COUNT;
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rS|S!a!z/z/", &link, &reqoid, &reqdata, &serverctrls, &retdata, &retoid) != SUCCESS) {
+ return;
}
if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
RETURN_FALSE;
}
- switch (myargcount) {
- case 6:
- case 5:
- case 4:
- case 3:
- convert_to_string_ex(reqdata);
- lreqdata.bv_val = Z_STRVAL_P(reqdata);
- lreqdata.bv_len = Z_STRLEN_P(reqdata);
- /* fallthru */
- case 2:
- convert_to_string_ex(reqoid);
- lreqoid = Z_STRVAL_P(reqoid);
+ if (reqdata) {
+ lreqdata.bv_val = ZSTR_VAL(reqdata);
+ lreqdata.bv_len = ZSTR_LEN(reqdata);
+ } else {
+ lreqdata.bv_len = 0;
}
- if (myargcount > 4) {
+ if (serverctrls) {
+ lserverctrls = _php_ldap_controls_from_array(ld->link, serverctrls);
+ if (lserverctrls == NULL) {
+ RETVAL_FALSE;
+ goto cleanup;
+ }
+ }
+
+ if (retdata) {
/* synchronous call */
- rc = ldap_extended_operation_s(ld->link, lreqoid,
+ rc = ldap_extended_operation_s(ld->link, ZSTR_VAL(reqoid),
lreqdata.bv_len > 0 ? &lreqdata: NULL,
+ lserverctrls,
NULL,
- NULL,
- myargcount > 5 ? &lretoid : NULL,
+ retoid ? &lretoid : NULL,
&lretdata );
if (rc != LDAP_SUCCESS ) {
- php_error_docref(NULL, E_WARNING, "Extended operation %s failed: %s (%d)", lreqoid, ldap_err2string(rc), rc);
- RETURN_FALSE;
+ php_error_docref(NULL, E_WARNING, "Extended operation %s failed: %s (%d)", ZSTR_VAL(reqoid), ldap_err2string(rc), rc);
+ RETVAL_FALSE;
+ goto cleanup;
}
- /* Reverse -> fall through */
- switch (myargcount) {
- case 6:
- zval_dtor(retoid);
- if (lretoid == NULL) {
- ZVAL_EMPTY_STRING(retoid);
- } else {
- ZVAL_STRING(retoid, lretoid);
- ldap_memfree(lretoid);
- }
- case 5:
- /* use arg #5 as the data returned by the server */
- zval_dtor(retdata);
- if (lretdata == NULL) {
- ZVAL_EMPTY_STRING(retdata);
- } else {
- ZVAL_STRINGL(retdata, lretdata->bv_val, lretdata->bv_len);
- ldap_memfree(lretdata->bv_val);
- ldap_memfree(lretdata);
- }
+ if (retoid) {
+ zval_dtor(retoid);
+ if (lretoid) {
+ ZVAL_STRING(retoid, lretoid);
+ ldap_memfree(lretoid);
+ } else {
+ ZVAL_EMPTY_STRING(retoid);
+ }
}
- RETURN_TRUE;
+ zval_dtor(retdata);
+ if (lretdata) {
+ ZVAL_STRINGL(retdata, lretdata->bv_val, lretdata->bv_len);
+ ldap_memfree(lretdata->bv_val);
+ ldap_memfree(lretdata);
+ } else {
+ ZVAL_EMPTY_STRING(retdata);
+ }
+
+ RETVAL_TRUE;
+ goto cleanup;
}
/* asynchronous call */
- rc = ldap_extended_operation(ld->link, lreqoid,
+ rc = ldap_extended_operation(ld->link, ZSTR_VAL(reqoid),
lreqdata.bv_len > 0 ? &lreqdata: NULL,
- NULL, NULL, &msgid);
+ lserverctrls,
+ NULL,
+ &msgid);
if (rc != LDAP_SUCCESS ) {
- php_error_docref(NULL, E_WARNING, "Extended operation %s failed: %s (%d)", lreqoid, ldap_err2string(rc), rc);
- RETURN_FALSE;
+ php_error_docref(NULL, E_WARNING, "Extended operation %s failed: %s (%d)", ZSTR_VAL(reqoid), ldap_err2string(rc), rc);
+ RETVAL_FALSE;
+ goto cleanup;
}
rc = ldap_result(ld->link, msgid, 1 /* LDAP_MSG_ALL */, NULL, &ldap_res);
if (rc == -1) {
- php_error_docref(NULL, E_WARNING, "Extended operation %s failed", lreqoid);
- RETURN_FALSE;
+ php_error_docref(NULL, E_WARNING, "Extended operation %s failed", ZSTR_VAL(reqoid));
+ RETVAL_FALSE;
+ goto cleanup;
}
/* return a PHP control object */
RETVAL_RES(zend_register_resource(ldap_res, le_result));
+
+ cleanup:
+ if (lserverctrls) {
+ _php_ldap_controls_free(&lserverctrls);
+ }
}
/* }}} */
#endif
-#ifdef HAVE_LDAP_PASSWD_S
-/* {{{ proto bool|string ldap_exop_passwd(resource link [, string user [, string oldpw [, string newpw ]]])
+#ifdef HAVE_LDAP_PASSWD
+/* {{{ proto bool|string ldap_exop_passwd(resource link [, string user [, string oldpw [, string newpw [, array ctrls]]]])
Passwd modify extended operation */
PHP_FUNCTION(ldap_exop_passwd)
{
- zval *link, *user, *newpw, *oldpw;
+ zval *link, *user, *newpw, *oldpw, *serverctrls;
struct berval luser, loldpw, lnewpw, lgenpasswd;
+ LDAPControl **lserverctrls = NULL, **requestctrls = NULL;
+ LDAPControl *ctrl, **ctrlp;
+ LDAPMessage* ldap_res;
ldap_linkdata *ld;
- int rc, myargcount = ZEND_NUM_ARGS();
+ int rc, myargcount = ZEND_NUM_ARGS(), msgid, err;
+ char* errmsg;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|zzz", &link, &user, &oldpw, &newpw) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|zzzz/", &link, &user, &oldpw, &newpw, &serverctrls) == FAILURE) {
WRONG_PARAM_COUNT;
}
@@ -3439,6 +4238,17 @@ PHP_FUNCTION(ldap_exop_passwd)
lnewpw.bv_len = 0;
switch (myargcount) {
+ case 5:
+ requestctrls = safe_emalloc(2, sizeof(*requestctrls), 0);
+ *requestctrls = NULL;
+ ctrlp = requestctrls;
+
+ if (ldap_create_passwordpolicy_control(ld->link, &ctrl) == LDAP_SUCCESS) {
+ *ctrlp = ctrl;
+ ++ctrlp;
+ }
+
+ *ctrlp = NULL;
case 4:
convert_to_string_ex(newpw);
lnewpw.bv_val = Z_STRVAL_P(newpw);
@@ -3455,24 +4265,52 @@ PHP_FUNCTION(ldap_exop_passwd)
luser.bv_len = Z_STRLEN_P(user);
}
- /* synchronous call */
- rc = ldap_passwd_s(ld->link, &luser,
+ /* asynchronous call to get result and controls */
+ rc = ldap_passwd(ld->link, &luser,
loldpw.bv_len > 0 ? &loldpw : NULL,
lnewpw.bv_len > 0 ? &lnewpw : NULL,
- &lgenpasswd, NULL, NULL);
+ requestctrls,
+ NULL, &msgid);
if (rc != LDAP_SUCCESS ) {
php_error_docref(NULL, E_WARNING, "Passwd modify extended operation failed: %s (%d)", ldap_err2string(rc), rc);
RETURN_FALSE;
}
+ rc = ldap_result(ld->link, msgid, 1 /* LDAP_MSG_ALL */, NULL, &ldap_res);
+ if ((rc < 0) || !ldap_res) {
+ rc = _get_lderrno(ld->link);
+ php_error_docref(NULL, E_WARNING, "Passwd modify extended operation failed: %s (%d)", ldap_err2string(rc), rc);
+ RETURN_FALSE;
+ }
+
+ rc = ldap_parse_passwd(ld->link, ldap_res, &lgenpasswd);
+ if( rc != LDAP_SUCCESS ) {
+ php_error_docref(NULL, E_WARNING, "Passwd modify extended operation failed: %s (%d)", ldap_err2string(rc), rc);
+ ldap_msgfree(ldap_res);
+ RETURN_FALSE;
+ }
+
+ rc = ldap_parse_result(ld->link, ldap_res, &err, NULL, &errmsg, NULL, (myargcount > 4 ? &lserverctrls : NULL), 1);
+ if( rc != LDAP_SUCCESS ) {
+ php_error_docref(NULL, E_WARNING, "Passwd modify extended operation failed: %s (%d)", ldap_err2string(rc), rc);
+ RETURN_FALSE;
+ }
+
if (lnewpw.bv_len == 0) {
if (lgenpasswd.bv_len == 0) {
RETVAL_EMPTY_STRING();
} else {
RETVAL_STRINGL(lgenpasswd.bv_val, lgenpasswd.bv_len);
}
+ } else if (err == LDAP_SUCCESS) {
+ RETVAL_TRUE;
} else {
- RETURN_TRUE;
+ php_error_docref(NULL, E_WARNING, "Passwd modify extended operation failed: %s (%d)", (errmsg ? errmsg : ldap_err2string(err)), err);
+ RETVAL_FALSE;
+ }
+
+ if (myargcount > 4) {
+ _php_ldap_controls_to_array(ld->link, lserverctrls, serverctrls, 0);
}
ldap_memfree(lgenpasswd.bv_val);
@@ -3515,7 +4353,44 @@ PHP_FUNCTION(ldap_exop_whoami)
}
/* }}} */
#endif
+
+#ifdef HAVE_LDAP_REFRESH_S
+/* {{{ proto bool|int ldap_exop_refresh(resource link , string dn , int ttl)
+ DDS refresh extended operation */
+PHP_FUNCTION(ldap_exop_refresh)
+{
+ zval *link, *dn, *ttl;
+ struct berval ldn;
+ ber_int_t lttl;
+ ber_int_t newttl;
+ ldap_linkdata *ld;
+ int rc;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rzz", &link, &dn, &ttl) != SUCCESS) {
+ WRONG_PARAM_COUNT;
+ }
+
+ if ((ld = (ldap_linkdata *)zend_fetch_resource(Z_RES_P(link), "ldap link", le_link)) == NULL) {
+ RETURN_FALSE;
+ }
+
+ convert_to_string_ex(dn);
+ ldn.bv_val = Z_STRVAL_P(dn);
+ ldn.bv_len = Z_STRLEN_P(dn);
+
+ convert_to_long_ex(ttl);
+ lttl = (ber_int_t)Z_LVAL_P(ttl);
+
+ rc = ldap_refresh_s(ld->link, &ldn, lttl, &newttl, NULL, NULL);
+ if (rc != LDAP_SUCCESS ) {
+ php_error_docref(NULL, E_WARNING, "Refresh extended operation failed: %s (%d)", ldap_err2string(rc), rc);
+ RETURN_FALSE;
+ }
+
+ RETURN_LONG(newttl);
+}
/* }}} */
+#endif
/* }}} */
@@ -3540,6 +4415,13 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_bind, 0, 0, 1)
ZEND_ARG_INFO(0, bind_password)
ZEND_END_ARG_INFO()
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_bind_ext, 0, 0, 1)
+ ZEND_ARG_INFO(0, link_identifier)
+ ZEND_ARG_INFO(0, bind_rdn)
+ ZEND_ARG_INFO(0, bind_password)
+ ZEND_ARG_INFO(0, servercontrols)
+ZEND_END_ARG_INFO()
+
#ifdef HAVE_LDAP_SASL
ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_sasl_bind, 0, 0, 1)
ZEND_ARG_INFO(0, link)
@@ -3561,6 +4443,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_read, 0, 0, 3)
ZEND_ARG_INFO(0, sizelimit)
ZEND_ARG_INFO(0, timelimit)
ZEND_ARG_INFO(0, deref)
+ ZEND_ARG_INFO(0, servercontrols)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_list, 0, 0, 3)
@@ -3572,6 +4455,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_list, 0, 0, 3)
ZEND_ARG_INFO(0, sizelimit)
ZEND_ARG_INFO(0, timelimit)
ZEND_ARG_INFO(0, deref)
+ ZEND_ARG_INFO(0, servercontrols)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_search, 0, 0, 3)
@@ -3583,6 +4467,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_search, 0, 0, 3)
ZEND_ARG_INFO(0, sizelimit)
ZEND_ARG_INFO(0, timelimit)
ZEND_ARG_INFO(0, deref)
+ ZEND_ARG_INFO(0, servercontrols)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_count_entries, 0, 0, 2)
@@ -3650,41 +4535,82 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_add, 0, 0, 3)
ZEND_ARG_INFO(0, link_identifier)
ZEND_ARG_INFO(0, dn)
ZEND_ARG_INFO(0, entry)
+ ZEND_ARG_INFO(0, servercontrols)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_add_ext, 0, 0, 3)
+ ZEND_ARG_INFO(0, link_identifier)
+ ZEND_ARG_INFO(0, dn)
+ ZEND_ARG_INFO(0, entry)
+ ZEND_ARG_INFO(0, servercontrols)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_delete, 0, 0, 2)
ZEND_ARG_INFO(0, link_identifier)
ZEND_ARG_INFO(0, dn)
+ ZEND_ARG_INFO(0, servercontrols)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_delete_ext, 0, 0, 2)
+ ZEND_ARG_INFO(0, link_identifier)
+ ZEND_ARG_INFO(0, dn)
+ ZEND_ARG_INFO(0, servercontrols)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_modify, 0, 0, 3)
ZEND_ARG_INFO(0, link_identifier)
ZEND_ARG_INFO(0, dn)
ZEND_ARG_INFO(0, entry)
+ ZEND_ARG_INFO(0, servercontrols)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_modify_batch, 0, 0, 3)
ZEND_ARG_INFO(0, link_identifier)
ZEND_ARG_INFO(0, dn)
ZEND_ARG_ARRAY_INFO(0, modifications_info, 0)
+ ZEND_ARG_INFO(0, servercontrols)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_mod_add, 0, 0, 3)
ZEND_ARG_INFO(0, link_identifier)
ZEND_ARG_INFO(0, dn)
ZEND_ARG_INFO(0, entry)
+ ZEND_ARG_INFO(0, servercontrols)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_mod_add_ext, 0, 0, 3)
+ ZEND_ARG_INFO(0, link_identifier)
+ ZEND_ARG_INFO(0, dn)
+ ZEND_ARG_INFO(0, entry)
+ ZEND_ARG_INFO(0, servercontrols)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_mod_replace, 0, 0, 3)
ZEND_ARG_INFO(0, link_identifier)
ZEND_ARG_INFO(0, dn)
ZEND_ARG_INFO(0, entry)
+ ZEND_ARG_INFO(0, servercontrols)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_mod_replace_ext, 0, 0, 3)
+ ZEND_ARG_INFO(0, link_identifier)
+ ZEND_ARG_INFO(0, dn)
+ ZEND_ARG_INFO(0, entry)
+ ZEND_ARG_INFO(0, servercontrols)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_mod_del, 0, 0, 3)
ZEND_ARG_INFO(0, link_identifier)
ZEND_ARG_INFO(0, dn)
ZEND_ARG_INFO(0, entry)
+ ZEND_ARG_INFO(0, servercontrols)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_mod_del_ext, 0, 0, 3)
+ ZEND_ARG_INFO(0, link_identifier)
+ ZEND_ARG_INFO(0, dn)
+ ZEND_ARG_INFO(0, entry)
+ ZEND_ARG_INFO(0, servercontrols)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_err2str, 0, 0, 1)
@@ -3696,6 +4622,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_compare, 0, 0, 4)
ZEND_ARG_INFO(0, dn)
ZEND_ARG_INFO(0, attribute)
ZEND_ARG_INFO(0, value)
+ ZEND_ARG_INFO(0, servercontrols)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_sort, 0, 0, 3)
@@ -3727,6 +4654,16 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_rename, 0, 0, 5)
ZEND_ARG_INFO(0, newrdn)
ZEND_ARG_INFO(0, newparent)
ZEND_ARG_INFO(0, deleteoldrdn)
+ ZEND_ARG_INFO(0, servercontrols)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_rename_ext, 0, 0, 5)
+ ZEND_ARG_INFO(0, link_identifier)
+ ZEND_ARG_INFO(0, dn)
+ ZEND_ARG_INFO(0, newrdn)
+ ZEND_ARG_INFO(0, newparent)
+ ZEND_ARG_INFO(0, deleteoldrdn)
+ ZEND_ARG_INFO(0, servercontrols)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_get_option, 0, 0, 3)
@@ -3768,6 +4705,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_parse_result, 0, 0, 3)
ZEND_ARG_INFO(1, matcheddn)
ZEND_ARG_INFO(1, errmsg)
ZEND_ARG_INFO(1, referrals)
+ ZEND_ARG_INFO(1, serverctrls)
ZEND_END_ARG_INFO()
#endif
#endif
@@ -3806,12 +4744,13 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_exop, 0, 0, 2)
ZEND_END_ARG_INFO()
#endif
-#ifdef HAVE_LDAP_PASSWD_S
-ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_exop_passwd, 0, 0, 4)
+#ifdef HAVE_LDAP_PASSWD
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_exop_passwd, 0, 0, 1)
ZEND_ARG_INFO(0, link)
ZEND_ARG_INFO(0, user)
ZEND_ARG_INFO(0, oldpw)
ZEND_ARG_INFO(0, newpw)
+ ZEND_ARG_INFO(1, serverctrls)
ZEND_END_ARG_INFO()
#endif
@@ -3821,6 +4760,14 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_exop_whoami, 0, 0, 1)
ZEND_END_ARG_INFO()
#endif
+#ifdef HAVE_LDAP_REFRESH_S
+ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_exop_refresh, 0, 0, 3)
+ ZEND_ARG_INFO(0, link)
+ ZEND_ARG_INFO(0, dn)
+ ZEND_ARG_INFO(0, ttl)
+ZEND_END_ARG_INFO()
+#endif
+
#ifdef HAVE_LDAP_PARSE_EXTENDED_RESULT
ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_parse_exop, 0, 0, 4)
ZEND_ARG_INFO(0, link)
@@ -3841,6 +4788,7 @@ const zend_function_entry ldap_functions[] = {
PHP_FE(ldap_connect, arginfo_ldap_connect)
PHP_FALIAS(ldap_close, ldap_unbind, arginfo_ldap_resource)
PHP_FE(ldap_bind, arginfo_ldap_bind)
+ PHP_FE(ldap_bind_ext, arginfo_ldap_bind_ext)
#ifdef HAVE_LDAP_SASL
PHP_FE(ldap_sasl_bind, arginfo_ldap_sasl_bind)
#endif
@@ -3862,14 +4810,19 @@ const zend_function_entry ldap_functions[] = {
PHP_FE(ldap_explode_dn, arginfo_ldap_explode_dn)
PHP_FE(ldap_dn2ufn, arginfo_ldap_dn2ufn)
PHP_FE(ldap_add, arginfo_ldap_add)
+ PHP_FE(ldap_add_ext, arginfo_ldap_add_ext)
PHP_FE(ldap_delete, arginfo_ldap_delete)
+ PHP_FE(ldap_delete_ext, arginfo_ldap_delete_ext)
PHP_FE(ldap_modify_batch, arginfo_ldap_modify_batch)
PHP_FALIAS(ldap_modify, ldap_mod_replace, arginfo_ldap_modify)
/* additional functions for attribute based modifications, Gerrit Thomson */
PHP_FE(ldap_mod_add, arginfo_ldap_mod_add)
+ PHP_FE(ldap_mod_add_ext, arginfo_ldap_mod_add_ext)
PHP_FE(ldap_mod_replace, arginfo_ldap_mod_replace)
+ PHP_FE(ldap_mod_replace_ext, arginfo_ldap_mod_replace_ext)
PHP_FE(ldap_mod_del, arginfo_ldap_mod_del)
+ PHP_FE(ldap_mod_del_ext, arginfo_ldap_mod_del_ext)
/* end gjt mod */
PHP_FE(ldap_errno, arginfo_ldap_resource)
@@ -3880,6 +4833,7 @@ const zend_function_entry ldap_functions[] = {
#if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP
PHP_FE(ldap_rename, arginfo_ldap_rename)
+ PHP_FE(ldap_rename_ext, arginfo_ldap_rename_ext)
PHP_FE(ldap_get_option, arginfo_ldap_get_option)
PHP_FE(ldap_set_option, arginfo_ldap_set_option)
PHP_FE(ldap_first_reference, arginfo_ldap_first_reference)
@@ -3896,12 +4850,15 @@ const zend_function_entry ldap_functions[] = {
#ifdef HAVE_LDAP_EXTENDED_OPERATION_S
PHP_FE(ldap_exop, arginfo_ldap_exop)
#endif
-#ifdef HAVE_LDAP_PASSWD_S
+#ifdef HAVE_LDAP_PASSWD
PHP_FE(ldap_exop_passwd, arginfo_ldap_exop_passwd)
#endif
#ifdef HAVE_LDAP_WHOAMI_S
PHP_FE(ldap_exop_whoami, arginfo_ldap_exop_whoami)
#endif
+#ifdef HAVE_LDAP_REFRESH_S
+ PHP_FE(ldap_exop_refresh, arginfo_ldap_exop_refresh)
+#endif
#ifdef HAVE_LDAP_PARSE_EXTENDED_RESULT
PHP_FE(ldap_parse_exop, arginfo_ldap_parse_exop)
#endif
diff --git a/ext/ldap/tests/connect.inc b/ext/ldap/tests/connect.inc
index 1c2205056e..b6366c02ac 100644
--- a/ext/ldap/tests/connect.inc
+++ b/ext/ldap/tests/connect.inc
@@ -69,6 +69,13 @@ function insert_dummy_data($link, $base) {
"sn" => "testSN3",
"userPassword" => "0r1g1na1 passw0rd",
));
+ ldap_add($link, "o=test2,$base", array(
+ "objectClass" => array(
+ "top",
+ "organization"),
+ "o" => "test2",
+ "l" => array("here", "there", "Antarctica"),
+ ));
}
function remove_dummy_data($link, $base) {
@@ -76,5 +83,6 @@ function remove_dummy_data($link, $base) {
ldap_delete($link, "cn=userA,$base");
ldap_delete($link, "cn=userB,$base");
ldap_delete($link, "o=test,$base");
+ ldap_delete($link, "o=test2,$base");
}
?>
diff --git a/ext/ldap/tests/ldap_add_error.phpt b/ext/ldap/tests/ldap_add_error.phpt
index a53277da80..533496a4b2 100644
--- a/ext/ldap/tests/ldap_add_error.phpt
+++ b/ext/ldap/tests/ldap_add_error.phpt
@@ -18,7 +18,7 @@ var_dump(ldap_add($link));
var_dump(ldap_add($link, "$base"));
// Too many parameters
-var_dump(ldap_add($link, "$base", array(), "Additional data"));
+var_dump(ldap_add($link, "$base", array(), [], "Additional data"));
var_dump(ldap_add($link, "$base", array()));
@@ -97,16 +97,16 @@ $link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
ldap_delete($link, "dc=my-domain,$base");
?>
--EXPECTF--
-Warning: ldap_add() expects exactly 3 parameters, 0 given in %s on line %d
+Warning: ldap_add() expects at least 3 parameters, 0 given in %s on line %d
NULL
-Warning: ldap_add() expects exactly 3 parameters, 1 given in %s on line %d
+Warning: ldap_add() expects at least 3 parameters, 1 given in %s on line %d
NULL
-Warning: ldap_add() expects exactly 3 parameters, 2 given in %s on line %d
+Warning: ldap_add() expects at least 3 parameters, 2 given in %s on line %d
NULL
-Warning: ldap_add() expects exactly 3 parameters, 4 given in %s on line %d
+Warning: ldap_add() expects at most 4 parameters, 5 given in %s on line %d
NULL
Warning: ldap_add(): Add: Protocol error in %s on line %d
diff --git a/ext/ldap/tests/ldap_add_ext.phpt b/ext/ldap/tests/ldap_add_ext.phpt
new file mode 100644
index 0000000000..12916d98c3
--- /dev/null
+++ b/ext/ldap/tests/ldap_add_ext.phpt
@@ -0,0 +1,94 @@
+--TEST--
+ldap_add_ext() - Add operation with controls
+--CREDITS--
+Côme Chilliet <mcmic@php.net>
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+<?php require_once('skipifbindfailure.inc'); ?>
+<?php
+require_once('skipifcontrol.inc');
+skipifunsupportedcontrol(LDAP_CONTROL_POST_READ);
+?>
+--FILE--
+<?php
+require "connect.inc";
+
+$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
+
+var_dump(
+ $result = ldap_add_ext($link, "o=test_ldap_add_ext,$base", array(
+ "objectClass" => array(
+ "top",
+ "organization"),
+ "o" => "test_ldap_add_ext",
+ ), [['oid' => LDAP_CONTROL_POST_READ, 'iscritical' => TRUE, 'value' => ['attrs' => ['o']]]]),
+ ldap_parse_result($link, $result, $errcode, $matcheddn, $errmsg, $referrals, $ctrls),
+ $errcode,
+ $errmsg,
+ $ctrls[LDAP_CONTROL_POST_READ],
+ ldap_get_entries(
+ $link,
+ ldap_search($link, "$base", "(o=test_ldap_add_ext)")
+ )
+);
+?>
+===DONE===
+--CLEAN--
+<?php
+require "connect.inc";
+
+$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
+
+ldap_delete($link, "o=test_ldap_add_ext,$base");
+?>
+--EXPECTF--
+resource(%d) of type (ldap result)
+bool(true)
+int(0)
+string(0) ""
+array(2) {
+ ["oid"]=>
+ string(14) "1.3.6.1.1.13.2"
+ ["value"]=>
+ array(2) {
+ ["dn"]=>
+ string(%d) "o=test_ldap_add_ext,%s"
+ ["o"]=>
+ array(1) {
+ [0]=>
+ string(17) "test_ldap_add_ext"
+ }
+ }
+}
+array(2) {
+ ["count"]=>
+ int(1)
+ [0]=>
+ array(6) {
+ ["objectclass"]=>
+ array(3) {
+ ["count"]=>
+ int(2)
+ [0]=>
+ string(3) "top"
+ [1]=>
+ string(12) "organization"
+ }
+ [0]=>
+ string(11) "objectclass"
+ ["o"]=>
+ array(2) {
+ ["count"]=>
+ int(1)
+ [0]=>
+ string(17) "test_ldap_add_ext"
+ }
+ [1]=>
+ string(1) "o"
+ ["count"]=>
+ int(2)
+ ["dn"]=>
+ string(%d) "o=test_ldap_add_ext,%s"
+ }
+}
+===DONE===
diff --git a/ext/ldap/tests/ldap_bind_ext.phpt b/ext/ldap/tests/ldap_bind_ext.phpt
new file mode 100644
index 0000000000..3a9ca415bd
--- /dev/null
+++ b/ext/ldap/tests/ldap_bind_ext.phpt
@@ -0,0 +1,72 @@
+--TEST--
+ldap_bind_ext() - Basic binding
+--CREDITS--
+Côme Chilliet <mcmic@php.net>
+--SKIPIF--
+<?php require_once dirname(__FILE__) .'/skipif.inc'; ?>
+<?php require_once dirname(__FILE__) .'/skipifbindfailure.inc'; ?>
+<?php
+require_once('skipifcontrol.inc');
+skipifunsupportedcontrol(LDAP_CONTROL_PASSWORDPOLICYREQUEST);
+?>
+--FILE--
+<?php
+require "connect.inc";
+
+$link = ldap_connect($host, $port);
+ldap_set_option($link, LDAP_OPT_PROTOCOL_VERSION, $protocol_version);
+
+var_dump(
+ $result = ldap_bind_ext($link, $user, $passwd),
+ ldap_parse_result($link, $result, $errcode, $matcheddn, $errmsg, $referrals, $ctrls),
+ $errcode,
+ $errmsg,
+ $ctrls,
+ $result = ldap_bind_ext($link, $user, $passwd, [['oid' => LDAP_CONTROL_PASSWORDPOLICYREQUEST]]),
+ ldap_parse_result($link, $result, $errcode, $matcheddn, $errmsg, $referrals, $ctrls),
+ $errcode,
+ $errmsg,
+ $ctrls
+);
+
+/* Failures */
+var_dump(
+ $result = ldap_bind_ext($link, $user, "wrongPassword", [['oid' => LDAP_CONTROL_PASSWORDPOLICYREQUEST]]),
+ ldap_parse_result($link, $result, $errcode, $matcheddn, $errmsg, $referrals, $ctrls),
+ $errcode,
+ $errmsg,
+ $ctrls,
+ $result = ldap_bind_ext($link, "unexistingProperty=weirdValue,$user", $passwd, [['oid' => LDAP_CONTROL_PASSWORDPOLICYREQUEST]]),
+ ldap_parse_result($link, $result, $errcode, $matcheddn, $errmsg, $referrals, $ctrls),
+ $errcode,
+ $errmsg,
+ $ctrls
+);
+?>
+===DONE===
+--EXPECTF--
+resource(%d) of type (ldap result)
+bool(true)
+int(0)
+string(0) ""
+array(0) {
+}
+resource(%d) of type (ldap result)
+bool(true)
+int(0)
+string(0) ""
+array(0) {
+}
+resource(%d) of type (ldap result)
+bool(true)
+int(49)
+string(0) ""
+array(0) {
+}
+resource(%d) of type (ldap result)
+bool(true)
+int(34)
+string(10) "invalid DN"
+array(0) {
+}
+===DONE===
diff --git a/ext/ldap/tests/ldap_compare_error.phpt b/ext/ldap/tests/ldap_compare_error.phpt
index 07393f6de6..120dfab059 100644
--- a/ext/ldap/tests/ldap_compare_error.phpt
+++ b/ext/ldap/tests/ldap_compare_error.phpt
@@ -19,7 +19,7 @@ var_dump(ldap_compare($link, $link));
var_dump(ldap_compare($link, $link, $link));
// Too many parameters
-var_dump(ldap_compare($link, $link, $link, $link, "Additional data"));
+var_dump(ldap_compare($link, $link, $link, $link, [], "Additional data"));
var_dump(
ldap_compare($link, "cn=userNotAvailable,$base", "sn", "testSN1"),
@@ -36,16 +36,16 @@ $link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
remove_dummy_data($link, $base);
?>
--EXPECTF--
-Warning: ldap_compare() expects exactly 4 parameters, 1 given in %s on line %d
+Warning: ldap_compare() expects at least 4 parameters, 1 given in %s on line %d
NULL
-Warning: ldap_compare() expects exactly 4 parameters, 2 given in %s on line %d
+Warning: ldap_compare() expects at least 4 parameters, 2 given in %s on line %d
NULL
-Warning: ldap_compare() expects exactly 4 parameters, 3 given in %s on line %d
+Warning: ldap_compare() expects at least 4 parameters, 3 given in %s on line %d
NULL
-Warning: ldap_compare() expects exactly 4 parameters, 5 given in %s on line %d
+Warning: ldap_compare() expects at most 5 parameters, 6 given in %s on line %d
NULL
Warning: ldap_compare(): Compare: No such object in %s on line %d
diff --git a/ext/ldap/tests/ldap_controls.phpt b/ext/ldap/tests/ldap_controls.phpt
new file mode 100644
index 0000000000..8a9c8f9f22
--- /dev/null
+++ b/ext/ldap/tests/ldap_controls.phpt
@@ -0,0 +1,162 @@
+--TEST--
+Test the use of controls
+--CREDITS--
+Côme Chilliet <mcmic@php.net>
+--SKIPIF--
+<?php
+require_once('skipif.inc');
+require_once('skipifbindfailure.inc');
+require_once('skipifcontrol.inc');
+skipifunsupportedcontrol(LDAP_CONTROL_ASSERT);
+skipifunsupportedcontrol(LDAP_CONTROL_VALUESRETURNFILTER);
+?>
+--FILE--
+<?php
+include "connect.inc";
+
+$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
+insert_dummy_data($link, $base);
+
+/* Test assertion control */
+var_dump(
+ $result = ldap_search($link, "o=test,$base", "objectClass=*", array('o'), 0, 0, 0, LDAP_DEREF_NEVER,
+ [['oid' => LDAP_CONTROL_ASSERT, 'iscritical' => TRUE, 'value' => ['filter' => '(objectClass=organization)']]]),
+ ldap_get_entries($link, $result),
+ $result = ldap_search($link, "o=test,$base", "objectClass=*", array('o'), 0, 0, 0, LDAP_DEREF_NEVER,
+ [['oid' => LDAP_CONTROL_ASSERT, 'iscritical' => TRUE, 'value' => ['filter' => '(objectClass=organizationalUnit)']]]),
+ ldap_modify($link, "o=test,$base", ['description' => 'desc'],
+ [['oid' => LDAP_CONTROL_ASSERT, 'iscritical' => TRUE, 'value' => ['filter' => '(!(description=*))']]]),
+ $result = ldap_read($link, "o=test,$base", "objectClass=*", array('description')),
+ ldap_get_entries($link, $result),
+ ldap_modify($link, "o=test,$base", ['description' => 'desc2'],
+ [['oid' => LDAP_CONTROL_ASSERT, 'iscritical' => TRUE, 'value' => ['filter' => '(!(description=*))']]]),
+ $result = ldap_read($link, "o=test,$base", "objectClass=*", array('description')),
+ ldap_get_entries($link, $result),
+ ldap_delete($link, "o=test,$base", [['oid' => LDAP_CONTROL_ASSERT, 'iscritical' => TRUE, 'value' => ['filter' => '(description=desc2)']]]),
+ ldap_errno($link),
+ ldap_error($link),
+ ldap_rename($link, "o=test,$base", "o=test2", "", TRUE, [['oid' => LDAP_CONTROL_ASSERT, 'iscritical' => TRUE, 'value' => ['filter' => '(description=desc2)']]]),
+ ldap_compare($link, "o=test,$base", "o", "test"),
+ ldap_compare($link, "o=test,$base", "o", "test", [['oid' => LDAP_CONTROL_ASSERT, 'iscritical' => TRUE, 'value' => ['filter' => '(description=desc2)']]]),
+ ldap_compare($link, "o=test,$base", "o", "test", [['oid' => LDAP_CONTROL_ASSERT, 'iscritical' => TRUE, 'value' => ['filter' => '(description=desc)']]])
+);
+
+/* Test valuesreturnfilter control */
+var_dump(
+ $result = ldap_read($link, "o=test2,$base", "objectClass=*", ["l"]),
+ ldap_get_entries($link, $result)[0]['l'],
+ $result = ldap_read($link, "o=test2,$base", "objectClass=*", ["l"], 0, 0, 0, LDAP_DEREF_NEVER,
+ [['oid' => LDAP_CONTROL_VALUESRETURNFILTER, 'iscritical' => TRUE, 'value' => ['filter' => '(l=*here)']]]),
+ ldap_get_entries($link, $result)[0]['l']
+);
+?>
+===DONE===
+--CLEAN--
+<?php
+include "connect.inc";
+
+$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
+remove_dummy_data($link, $base);
+?>
+--EXPECTF--
+Warning: ldap_search(): Search: Assertion Failed in %s on line %d
+
+Warning: ldap_modify(): Modify: Assertion Failed in %s on line %d
+
+Warning: ldap_delete(): Delete: Assertion Failed in %s on line %d
+
+Warning: ldap_compare(): Compare: Assertion Failed in %s on line %d
+resource(%d) of type (ldap result)
+array(2) {
+ ["count"]=>
+ int(1)
+ [0]=>
+ array(4) {
+ ["o"]=>
+ array(2) {
+ ["count"]=>
+ int(1)
+ [0]=>
+ string(4) "test"
+ }
+ [0]=>
+ string(1) "o"
+ ["count"]=>
+ int(1)
+ ["dn"]=>
+ string(%d) "o=test,%s"
+ }
+}
+bool(false)
+bool(true)
+resource(%d) of type (ldap result)
+array(2) {
+ ["count"]=>
+ int(1)
+ [0]=>
+ array(4) {
+ ["description"]=>
+ array(2) {
+ ["count"]=>
+ int(1)
+ [0]=>
+ string(4) "desc"
+ }
+ [0]=>
+ string(11) "description"
+ ["count"]=>
+ int(1)
+ ["dn"]=>
+ string(%d) "o=test,%s"
+ }
+}
+bool(false)
+resource(%d) of type (ldap result)
+array(2) {
+ ["count"]=>
+ int(1)
+ [0]=>
+ array(4) {
+ ["description"]=>
+ array(2) {
+ ["count"]=>
+ int(1)
+ [0]=>
+ string(4) "desc"
+ }
+ [0]=>
+ string(11) "description"
+ ["count"]=>
+ int(1)
+ ["dn"]=>
+ string(%d) "o=test,%s"
+ }
+}
+bool(false)
+int(122)
+string(16) "Assertion Failed"
+bool(false)
+bool(true)
+int(-1)
+bool(true)
+resource(%d) of type (ldap result)
+array(4) {
+ ["count"]=>
+ int(3)
+ [0]=>
+ string(4) "here"
+ [1]=>
+ string(5) "there"
+ [2]=>
+ string(10) "Antarctica"
+}
+resource(%d) of type (ldap result)
+array(3) {
+ ["count"]=>
+ int(2)
+ [0]=>
+ string(4) "here"
+ [1]=>
+ string(5) "there"
+}
+===DONE===
diff --git a/ext/ldap/tests/ldap_delete_error.phpt b/ext/ldap/tests/ldap_delete_error.phpt
index 1d160f1074..a34d7b39fe 100644
--- a/ext/ldap/tests/ldap_delete_error.phpt
+++ b/ext/ldap/tests/ldap_delete_error.phpt
@@ -17,7 +17,7 @@ var_dump(ldap_delete());
var_dump(ldap_delete($link));
// Too many parameters
-var_dump(ldap_delete($link, "$base", "Additional data"));
+var_dump(ldap_delete($link, "$base", [], "Additional data"));
// Invalid DN
var_dump(
@@ -41,13 +41,13 @@ require "connect.inc";
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
?>
--EXPECTF--
-Warning: ldap_delete() expects exactly 2 parameters, 0 given in %s on line %d
+Warning: ldap_delete() expects at least 2 parameters, 0 given in %s on line %d
NULL
-Warning: ldap_delete() expects exactly 2 parameters, 1 given in %s on line %d
+Warning: ldap_delete() expects at least 2 parameters, 1 given in %s on line %d
NULL
-Warning: ldap_delete() expects exactly 2 parameters, 3 given in %s on line %d
+Warning: ldap_delete() expects at most 3 parameters, 4 given in %s on line %d
NULL
Warning: ldap_delete(): Delete: Invalid DN syntax in %s on line %d
diff --git a/ext/ldap/tests/ldap_delete_ext.phpt b/ext/ldap/tests/ldap_delete_ext.phpt
new file mode 100644
index 0000000000..c4d0264088
--- /dev/null
+++ b/ext/ldap/tests/ldap_delete_ext.phpt
@@ -0,0 +1,71 @@
+--TEST--
+ldap_delete_ext() - Delete operation with controls
+--CREDITS--
+Côme Chilliet <mcmic@php.net>
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+<?php require_once('skipifbindfailure.inc'); ?>
+<?php
+require_once('skipifcontrol.inc');
+skipifunsupportedcontrol(LDAP_CONTROL_PRE_READ);
+?>
+--FILE--
+<?php
+require "connect.inc";
+
+$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
+ldap_add($link, "dc=my-domain,$base", array(
+ "objectClass" => array(
+ "top",
+ "dcObject",
+ "organization"),
+ "dc" => "my-domain",
+ "o" => "my-domain",
+));
+
+var_dump(
+ $result = ldap_delete_ext($link, "dc=my-domain,$base",
+ [['oid' => LDAP_CONTROL_PRE_READ, 'iscritical' => TRUE, 'value' => ['attrs' => ['dc', 'o']]]]
+ ),
+ ldap_parse_result($link, $result, $errcode, $matcheddn, $errmsg, $referrals, $ctrls),
+ $errcode,
+ $errmsg,
+ $ctrls[LDAP_CONTROL_PRE_READ],
+ @ldap_search($link, "dc=my-domain,$base", "(o=my-domain)")
+);
+?>
+===DONE===
+--CLEAN--
+<?php
+require "connect.inc";
+
+$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
+
+ldap_delete($link, "dc=my-domain,$base");
+?>
+--EXPECTF--
+resource(%d) of type (ldap result)
+bool(true)
+int(0)
+string(0) ""
+array(2) {
+ ["oid"]=>
+ string(14) "1.3.6.1.1.13.1"
+ ["value"]=>
+ array(3) {
+ ["dn"]=>
+ string(%d) "dc=my-domain,%s"
+ ["dc"]=>
+ array(1) {
+ [0]=>
+ string(9) "my-domain"
+ }
+ ["o"]=>
+ array(1) {
+ [0]=>
+ string(9) "my-domain"
+ }
+ }
+}
+bool(false)
+===DONE===
diff --git a/ext/ldap/tests/ldap_exop.phpt b/ext/ldap/tests/ldap_exop.phpt
index 48038cf230..f5543c0e4e 100644
--- a/ext/ldap/tests/ldap_exop.phpt
+++ b/ext/ldap/tests/ldap_exop.phpt
@@ -42,6 +42,8 @@ var_dump(
ldap_exop($link, LDAP_EXOP_WHO_AM_I, NULL, NULL, $retdata, $retoid),
$retdata,
$retoid,
+ ldap_exop($link, LDAP_EXOP_WHO_AM_I, NULL, [['oid' => LDAP_CONTROL_PROXY_AUTHZ, 'value' => "dn:cn=userA,$base"]], $retdata),
+ $retdata,
$r = ldap_exop($link, LDAP_EXOP_WHO_AM_I),
ldap_parse_exop($link, $r, $retdata2),
$retdata2,
@@ -66,6 +68,8 @@ remove_dummy_data($link, $base);
bool(true)
string(%d) "dn:%s"
string(0) ""
+bool(true)
+string(%d) "dn:cn=user%s"
resource(%d) of type (ldap result)
bool(true)
string(%d) "dn:%s"
diff --git a/ext/ldap/tests/ldap_exop_passwd.phpt b/ext/ldap/tests/ldap_exop_passwd.phpt
index 2f0d4cb599..e50b30760c 100644
--- a/ext/ldap/tests/ldap_exop_passwd.phpt
+++ b/ext/ldap/tests/ldap_exop_passwd.phpt
@@ -16,7 +16,8 @@ insert_dummy_data($link, $base);
// and optionally returns the NEW password if none was passed.
// ldap_exop_passwd(resource link [, string user [, string oldpw [, string newpw [, string newpasswd ]]]])
var_dump(
- $genpw = ldap_exop_passwd($link, "cn=userA,$base", "oops", ""),
+ $genpw = ldap_exop_passwd($link, "cn=userA,$base", "oops", "", $ctrls),
+ $ctrls,
$genpw = ldap_exop_passwd($link, "cn=userA,$base"),
test_bind($host, $port, "cn=userA,$base", $genpw, $protocol_version),
ldap_exop_passwd($link, "cn=userA,$base", $genpw, "newPassword"),
@@ -34,6 +35,8 @@ remove_dummy_data($link, $base);
?>
--EXPECTF--
string(%d) "%s"
+array(0) {
+}
string(%d) "%s"
bool(true)
bool(true)
diff --git a/ext/ldap/tests/ldap_exop_passwd_error.phpt b/ext/ldap/tests/ldap_exop_passwd_error.phpt
index d858bd4bdc..bfb0cbcae2 100644
--- a/ext/ldap/tests/ldap_exop_passwd_error.phpt
+++ b/ext/ldap/tests/ldap_exop_passwd_error.phpt
@@ -12,7 +12,8 @@ require "connect.inc";
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
insert_dummy_data($link, $base);
-var_dump(ldap_exop_passwd($link, "cn=userA,$base", "wrongPassword", "newPassword"));
+var_dump(ldap_exop_passwd($link, "cn=userA,$base", "wrongPassword", "newPassword", $ctrls));
+var_dump($ctrls);
var_dump(ldap_error($link));
var_dump(ldap_errno($link));
var_dump(test_bind($host, $port, "cn=userA,$base", "newPassword", $protocol_version));
@@ -27,8 +28,10 @@ $link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
remove_dummy_data($link, $base);
?>
--EXPECTF--
-Warning: ldap_exop_passwd(): Passwd modify extended operation failed: Server is unwilling to perform (53) in %s on line %d
+Warning: ldap_exop_passwd(): Passwd modify extended operation failed: %s (53) in %s on line %d
bool(false)
+array(0) {
+}
string(30) "Server is unwilling to perform"
int(53)
diff --git a/ext/ldap/tests/ldap_exop_refresh.phpt b/ext/ldap/tests/ldap_exop_refresh.phpt
new file mode 100644
index 0000000000..170f013943
--- /dev/null
+++ b/ext/ldap/tests/ldap_exop_refresh.phpt
@@ -0,0 +1,43 @@
+--TEST--
+ldap_exop_refresh() - Test LDAP refresh extended operation
+--CREDITS--
+Emmanuel Dreyfus <manu@netbsd.org>
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+<?php require_once('skipifbindfailure.inc'); ?>
+<?php
+ $link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
+ $r = ldap_read($link, '', 'objectClass=*', array('dynamicsubtrees')),
+ $info = ldap_get_entries($link, $r)[0];
+ if (!isset($info['dynamicsubtrees'])) {
+ die("Overlay DDS not available");
+ }
+?>
+--FILE--
+<?php
+require "connect.inc";
+
+$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
+
+insert_dummy_data($link, $base);
+ldap_add($link, "cn=tmp,$base", array(
+ "objectclass" => array("person", "dynamicObject"),
+ "cn" => "tmp",
+ "sn" => "tmp"
+));
+var_dump(
+ ldap_exop_refresh($link, "cn=tmp,$base", 1234)
+);
+?>
+===DONE===
+--CLEAN--
+<?php
+include "connect.inc";
+
+$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
+ldap_delete($link, "cn=tmp,$base");
+remove_dummy_data($link, $base);
+?>
+--EXPECTF--
+int(1234)
+===DONE===
diff --git a/ext/ldap/tests/ldap_first_reference_basic.phpt b/ext/ldap/tests/ldap_first_reference_basic.phpt
index 37155a796c..9c83c9127d 100644
--- a/ext/ldap/tests/ldap_first_reference_basic.phpt
+++ b/ext/ldap/tests/ldap_first_reference_basic.phpt
@@ -30,8 +30,7 @@ include "connect.inc";
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
// Referral can only be removed with Manage DSA IT Control
-ldap_set_option($link, LDAP_OPT_SERVER_CONTROLS, array(array("oid" => "2.16.840.1.113730.3.4.2")));
-ldap_delete($link, "cn=userref,$base");
+ldap_delete($link, "cn=userref,$base", [['oid' => LDAP_CONTROL_MANAGEDSAIT, 'iscritical' => TRUE]]);
remove_dummy_data($link, $base);
?>
--EXPECTF--
diff --git a/ext/ldap/tests/ldap_get_option_controls.phpt b/ext/ldap/tests/ldap_get_option_controls.phpt
index 3b55685d5e..abe35497d6 100644
--- a/ext/ldap/tests/ldap_get_option_controls.phpt
+++ b/ext/ldap/tests/ldap_get_option_controls.phpt
@@ -30,7 +30,17 @@ $controls_set = array(
array(
'oid' => LDAP_CONTROL_PAGEDRESULTS,
'iscritical' => TRUE,
- 'value' => build_ctrl_paged_value(1, '')
+ 'value' => build_ctrl_paged_value(1, 'opaque')
+ )
+);
+$controls_set2 = array(
+ array(
+ 'oid' => LDAP_CONTROL_PAGEDRESULTS,
+ 'iscritical' => TRUE,
+ 'value' => array(
+ 'size' => 1,
+ 'cookie' => '',
+ )
)
);
var_dump(
@@ -38,10 +48,10 @@ var_dump(
ldap_get_option($link, LDAP_OPT_SERVER_CONTROLS, $controls_get),
ldap_set_option($link, LDAP_OPT_SERVER_CONTROLS, $controls_set),
ldap_get_option($link, LDAP_OPT_SERVER_CONTROLS, $controls_get),
- count($controls_get),
- $controls_get[0]['oid'],
- $controls_get[0]['iscritical'],
- bin2hex($controls_get[0]['value']),
+ $controls_get,
+ ldap_set_option($link, LDAP_OPT_SERVER_CONTROLS, $controls_set2),
+ ldap_get_option($link, LDAP_OPT_SERVER_CONTROLS, $controls_get),
+ $controls_get,
$result = ldap_search($link, $base, "(objectClass=person)", array('cn')),
ldap_get_entries($link, $result)['count'],
ldap_set_option($link, LDAP_OPT_SERVER_CONTROLS, array()),
@@ -57,14 +67,44 @@ $link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
remove_dummy_data($link, $base);
?>
--EXPECTF--
-string(14) "30050201010400"
+string(26) "300b02010104066f7061717565"
bool(false)
bool(true)
bool(true)
-int(1)
-string(22) "1.2.840.113556.1.4.319"
+array(1) {
+ ["1.2.840.113556.1.4.319"]=>
+ array(3) {
+ ["oid"]=>
+ string(22) "1.2.840.113556.1.4.319"
+ ["iscritical"]=>
+ bool(true)
+ ["value"]=>
+ array(2) {
+ ["size"]=>
+ int(1)
+ ["cookie"]=>
+ string(6) "opaque"
+ }
+ }
+}
bool(true)
-string(14) "30050201010400"
+bool(true)
+array(1) {
+ ["1.2.840.113556.1.4.319"]=>
+ array(3) {
+ ["oid"]=>
+ string(22) "1.2.840.113556.1.4.319"
+ ["iscritical"]=>
+ bool(true)
+ ["value"]=>
+ array(2) {
+ ["size"]=>
+ int(1)
+ ["cookie"]=>
+ string(0) ""
+ }
+ }
+}
resource(%d) of type (ldap result)
int(1)
bool(true)
diff --git a/ext/ldap/tests/ldap_get_option_variation.phpt b/ext/ldap/tests/ldap_get_option_variation.phpt
index 759936ec62..a18318849f 100644
--- a/ext/ldap/tests/ldap_get_option_variation.phpt
+++ b/ext/ldap/tests/ldap_get_option_variation.phpt
@@ -66,14 +66,16 @@ bool(true)
int(0)
bool(true)
array(2) {
- [0]=>
- array(2) {
+ ["1.2.752.58.10.1"]=>
+ array(3) {
["oid"]=>
string(15) "1.2.752.58.10.1"
["iscritical"]=>
bool(true)
+ ["value"]=>
+ NULL
}
- [1]=>
+ ["1.2.752.58.1.10"]=>
array(3) {
["oid"]=>
string(15) "1.2.752.58.1.10"
@@ -85,14 +87,16 @@ array(2) {
}
bool(true)
array(2) {
- [0]=>
- array(2) {
+ ["1.2.752.58.10.1"]=>
+ array(3) {
["oid"]=>
string(15) "1.2.752.58.10.1"
["iscritical"]=>
bool(true)
+ ["value"]=>
+ NULL
}
- [1]=>
+ ["1.2.752.58.1.10"]=>
array(3) {
["oid"]=>
string(15) "1.2.752.58.1.10"
diff --git a/ext/ldap/tests/ldap_list_basic.phpt b/ext/ldap/tests/ldap_list_basic.phpt
index 3f98bc8e2d..1aadab6a17 100644
--- a/ext/ldap/tests/ldap_list_basic.phpt
+++ b/ext/ldap/tests/ldap_list_basic.phpt
@@ -67,7 +67,7 @@ array(3) {
["count"]=>
int(1)
[0]=>
- string(4) "oops"
+ string(%d) "%s"
}
[3]=>
string(12) "userpassword"
@@ -128,7 +128,7 @@ array(3) {
["count"]=>
int(1)
[0]=>
- string(15) "oopsIDitItAgain"
+ string(%d) "%s"
}
[3]=>
string(12) "userpassword"
diff --git a/ext/ldap/tests/ldap_list_error.phpt b/ext/ldap/tests/ldap_list_error.phpt
index 51bcaa583f..817622e725 100644
--- a/ext/ldap/tests/ldap_list_error.phpt
+++ b/ext/ldap/tests/ldap_list_error.phpt
@@ -17,7 +17,7 @@ var_dump(ldap_list($link));
var_dump(ldap_list($link, $link));
// Too many parameters
-var_dump(ldap_list($link, "$base", "(objectClass=*)", array(), 0, 0, 0, 0 , "Additional data"));
+var_dump(ldap_list($link, "$base", "(objectClass=*)", array(), 0, 0, 0, 0, [], "Additional data"));
?>
===DONE===
--EXPECTF--
@@ -30,6 +30,6 @@ NULL
Warning: ldap_list() expects at least 3 parameters, 2 given in %s on line %d
NULL
-Warning: ldap_list() expects at most 8 parameters, 9 given in %s on line %d
+Warning: ldap_list() expects at most 9 parameters, 10 given in %s on line %d
NULL
===DONE===
diff --git a/ext/ldap/tests/ldap_mod_add_error.phpt b/ext/ldap/tests/ldap_mod_add_error.phpt
index c04e2cbd3d..4bfbaa5551 100644
--- a/ext/ldap/tests/ldap_mod_add_error.phpt
+++ b/ext/ldap/tests/ldap_mod_add_error.phpt
@@ -18,7 +18,7 @@ var_dump(ldap_mod_add($link));
var_dump(ldap_mod_add($link, "$base"));
// Too many parameters
-var_dump(ldap_mod_add($link, "$base", array(), "Additional data"));
+var_dump(ldap_mod_add($link, "$base", array(), [], "Additional data"));
// DN not found
var_dump(ldap_mod_add($link, "dc=my-domain,$base", array()));
@@ -57,16 +57,16 @@ $link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
ldap_delete($link, "dc=my-domain,$base");
?>
--EXPECTF--
-Warning: ldap_mod_add() expects exactly 3 parameters, 0 given in %s on line %d
+Warning: ldap_mod_add() expects at least 3 parameters, 0 given in %s on line %d
NULL
-Warning: ldap_mod_add() expects exactly 3 parameters, 1 given in %s on line %d
+Warning: ldap_mod_add() expects at least 3 parameters, 1 given in %s on line %d
NULL
-Warning: ldap_mod_add() expects exactly 3 parameters, 2 given in %s on line %d
+Warning: ldap_mod_add() expects at least 3 parameters, 2 given in %s on line %d
NULL
-Warning: ldap_mod_add() expects exactly 3 parameters, 4 given in %s on line %d
+Warning: ldap_mod_add() expects at most 4 parameters, 5 given in %s on line %d
NULL
Warning: ldap_mod_add(): Modify: No such object in %s on line %d
diff --git a/ext/ldap/tests/ldap_mod_del_error.phpt b/ext/ldap/tests/ldap_mod_del_error.phpt
index 679adb6e6e..129d6472c1 100644
--- a/ext/ldap/tests/ldap_mod_del_error.phpt
+++ b/ext/ldap/tests/ldap_mod_del_error.phpt
@@ -18,7 +18,7 @@ var_dump(ldap_mod_del($link));
var_dump(ldap_mod_del($link, "$base"));
// Too many parameters
-var_dump(ldap_mod_del($link, "$base", array(), "Additional data"));
+var_dump(ldap_mod_del($link, "$base", array(), [], "Additional data"));
// DN not found
var_dump(ldap_mod_del($link, "dc=my-domain,$base", array()));
@@ -39,16 +39,16 @@ $link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
ldap_delete($link, "dc=my-domain,$base");
?>
--EXPECTF--
-Warning: ldap_mod_del() expects exactly 3 parameters, 0 given in %s on line %d
+Warning: ldap_mod_del() expects at least 3 parameters, 0 given in %s on line %d
NULL
-Warning: ldap_mod_del() expects exactly 3 parameters, 1 given in %s on line %d
+Warning: ldap_mod_del() expects at least 3 parameters, 1 given in %s on line %d
NULL
-Warning: ldap_mod_del() expects exactly 3 parameters, 2 given in %s on line %d
+Warning: ldap_mod_del() expects at least 3 parameters, 2 given in %s on line %d
NULL
-Warning: ldap_mod_del() expects exactly 3 parameters, 4 given in %s on line %d
+Warning: ldap_mod_del() expects at most 4 parameters, 5 given in %s on line %d
NULL
Warning: ldap_mod_del(): Modify: No such object in %s on line %d
diff --git a/ext/ldap/tests/ldap_mod_ext.phpt b/ext/ldap/tests/ldap_mod_ext.phpt
new file mode 100644
index 0000000000..391ecbf909
--- /dev/null
+++ b/ext/ldap/tests/ldap_mod_ext.phpt
@@ -0,0 +1,172 @@
+--TEST--
+ldap_mod_ext() - Modify operations with controls
+--CREDITS--
+Patrick Allaert <patrickallaert@php.net>
+# Belgian PHP Testfest 2009
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+<?php require_once('skipifbindfailure.inc'); ?>
+<?php
+require_once('skipifcontrol.inc');
+skipifunsupportedcontrol(LDAP_CONTROL_PRE_READ);
+skipifunsupportedcontrol(LDAP_CONTROL_POST_READ);
+?>
+--FILE--
+<?php
+require "connect.inc";
+
+$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
+insert_dummy_data($link, $base);
+
+$entry = array(
+ "description" => "Domain description",
+);
+
+var_dump(
+ $result = ldap_mod_add_ext($link, "o=test,$base", $entry,
+ [
+ ['oid' => LDAP_CONTROL_PRE_READ, 'iscritical' => TRUE, 'value' => ['attrs' => ['description']]],
+ ['oid' => LDAP_CONTROL_POST_READ, 'iscritical' => TRUE, 'value' => ['attrs' => ['description']]],
+ ]
+ ),
+ ldap_parse_result($link, $result, $errcode, $matcheddn, $errmsg, $referrals, $ctrls),
+ $errcode,
+ $errmsg,
+ $ctrls,
+ ldap_get_entries(
+ $link,
+ ldap_search($link, "o=test,$base", "(Description=Domain description)")
+ ),
+ $result = ldap_mod_del_ext($link, "o=test,$base", $entry,
+ [
+ ['oid' => LDAP_CONTROL_PRE_READ, 'iscritical' => TRUE, 'value' => ['attrs' => ['description']]],
+ ['oid' => LDAP_CONTROL_POST_READ, 'iscritical' => TRUE, 'value' => ['attrs' => ['description']]],
+ ]
+ ),
+ ldap_parse_result($link, $result, $errcode, $matcheddn, $errmsg, $referrals, $ctrls),
+ $errcode,
+ $errmsg,
+ $ctrls,
+ ldap_get_entries(
+ $link,
+ ldap_search($link, "o=test,$base", "(Description=Domain description)")
+ )
+);
+?>
+===DONE===
+--CLEAN--
+<?php
+require "connect.inc";
+
+$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
+
+remove_dummy_data($link, $base);
+?>
+--EXPECTF--
+resource(%d) of type (ldap result)
+bool(true)
+int(0)
+string(0) ""
+array(2) {
+ ["1.3.6.1.1.13.1"]=>
+ array(2) {
+ ["oid"]=>
+ string(14) "1.3.6.1.1.13.1"
+ ["value"]=>
+ array(1) {
+ ["dn"]=>
+ string(%d) "o=test,%s"
+ }
+ }
+ ["1.3.6.1.1.13.2"]=>
+ array(2) {
+ ["oid"]=>
+ string(14) "1.3.6.1.1.13.2"
+ ["value"]=>
+ array(2) {
+ ["dn"]=>
+ string(%d) "o=test,%s"
+ ["description"]=>
+ array(1) {
+ [0]=>
+ string(18) "Domain description"
+ }
+ }
+ }
+}
+array(2) {
+ ["count"]=>
+ int(1)
+ [0]=>
+ array(8) {
+ ["objectclass"]=>
+ array(3) {
+ ["count"]=>
+ int(2)
+ [0]=>
+ string(3) "top"
+ [1]=>
+ string(12) "organization"
+ }
+ [0]=>
+ string(11) "objectclass"
+ ["o"]=>
+ array(2) {
+ ["count"]=>
+ int(1)
+ [0]=>
+ string(4) "test"
+ }
+ [1]=>
+ string(1) "o"
+ ["description"]=>
+ array(2) {
+ ["count"]=>
+ int(1)
+ [0]=>
+ string(18) "Domain description"
+ }
+ [2]=>
+ string(11) "description"
+ ["count"]=>
+ int(3)
+ ["dn"]=>
+ string(%d) "o=test,%s"
+ }
+}
+resource(%d) of type (ldap result)
+bool(true)
+int(0)
+string(0) ""
+array(2) {
+ ["1.3.6.1.1.13.1"]=>
+ array(2) {
+ ["oid"]=>
+ string(14) "1.3.6.1.1.13.1"
+ ["value"]=>
+ array(2) {
+ ["dn"]=>
+ string(%d) "o=test,%s"
+ ["description"]=>
+ array(1) {
+ [0]=>
+ string(18) "Domain description"
+ }
+ }
+ }
+ ["1.3.6.1.1.13.2"]=>
+ array(2) {
+ ["oid"]=>
+ string(14) "1.3.6.1.1.13.2"
+ ["value"]=>
+ array(1) {
+ ["dn"]=>
+ string(%d) "o=test,%s"
+ }
+ }
+}
+array(1) {
+ ["count"]=>
+ int(0)
+}
+===DONE===
diff --git a/ext/ldap/tests/ldap_mod_replace_error.phpt b/ext/ldap/tests/ldap_mod_replace_error.phpt
index f796568d07..4f435b13d2 100644
--- a/ext/ldap/tests/ldap_mod_replace_error.phpt
+++ b/ext/ldap/tests/ldap_mod_replace_error.phpt
@@ -18,7 +18,7 @@ var_dump(ldap_mod_replace($link));
var_dump(ldap_mod_replace($link, "$base"));
// Too many parameters
-var_dump(ldap_mod_replace($link, "$base", array(), "Additional data"));
+var_dump(ldap_mod_replace($link, "$base", array(), [], "Additional data"));
// DN not found
var_dump(ldap_mod_replace($link, "dc=my-domain,$base", array()));
@@ -37,16 +37,16 @@ require "connect.inc";
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
?>
--EXPECTF--
-Warning: ldap_mod_replace() expects exactly 3 parameters, 0 given in %s on line %d
+Warning: ldap_mod_replace() expects at least 3 parameters, 0 given in %s on line %d
NULL
-Warning: ldap_mod_replace() expects exactly 3 parameters, 1 given in %s on line %d
+Warning: ldap_mod_replace() expects at least 3 parameters, 1 given in %s on line %d
NULL
-Warning: ldap_mod_replace() expects exactly 3 parameters, 2 given in %s on line %d
+Warning: ldap_mod_replace() expects at least 3 parameters, 2 given in %s on line %d
NULL
-Warning: ldap_mod_replace() expects exactly 3 parameters, 4 given in %s on line %d
+Warning: ldap_mod_replace() expects at most 4 parameters, 5 given in %s on line %d
NULL
Warning: ldap_mod_replace(): Modify: No such object in %s on line %d
diff --git a/ext/ldap/tests/ldap_modify_batch_basic.phpt b/ext/ldap/tests/ldap_modify_batch_basic.phpt
index 23700b49b2..0bec0e03c4 100644
--- a/ext/ldap/tests/ldap_modify_batch_basic.phpt
+++ b/ext/ldap/tests/ldap_modify_batch_basic.phpt
@@ -76,7 +76,7 @@ array(2) {
["count"]=>
int(1)
[0]=>
- string(4) "oops"
+ string(%d) "%s"
}
[2]=>
string(12) "userpassword"
diff --git a/ext/ldap/tests/ldap_modify_batch_error.phpt b/ext/ldap/tests/ldap_modify_batch_error.phpt
index 2d72d491f8..a2d9ef9deb 100644
--- a/ext/ldap/tests/ldap_modify_batch_error.phpt
+++ b/ext/ldap/tests/ldap_modify_batch_error.phpt
@@ -26,7 +26,7 @@ var_dump(ldap_modify_batch($link));
var_dump(ldap_modify_batch($link, "$base"));
// Too many parameters
-var_dump(ldap_modify_batch($link, "$base", $addGivenName, "Invalid additional parameter"));
+var_dump(ldap_modify_batch($link, "$base", $addGivenName, [], "Invalid additional parameter"));
// DN not found
var_dump(ldap_modify_batch($link, "cn=not-found,$base", $addGivenName));
@@ -78,16 +78,16 @@ $link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
ldap_delete($link, "dc=my-domain,$base");
?>
--EXPECTF--
-Warning: ldap_modify_batch() expects exactly 3 parameters, 0 given in %s on line %d
+Warning: ldap_modify_batch() expects at least 3 parameters, 0 given in %s on line %d
NULL
-Warning: ldap_modify_batch() expects exactly 3 parameters, 1 given in %s on line %d
+Warning: ldap_modify_batch() expects at least 3 parameters, 1 given in %s on line %d
NULL
-Warning: ldap_modify_batch() expects exactly 3 parameters, 2 given in %s on line %d
+Warning: ldap_modify_batch() expects at least 3 parameters, 2 given in %s on line %d
NULL
-Warning: ldap_modify_batch() expects exactly 3 parameters, 4 given in %s on line %d
+Warning: ldap_modify_batch() expects at most 4 parameters, 5 given in %s on line %d
NULL
Warning: ldap_modify_batch(): Batch Modify: No such object in %s on line %d
diff --git a/ext/ldap/tests/ldap_modify_error.phpt b/ext/ldap/tests/ldap_modify_error.phpt
index 0ca2ea49dc..31069bb98c 100644
--- a/ext/ldap/tests/ldap_modify_error.phpt
+++ b/ext/ldap/tests/ldap_modify_error.phpt
@@ -18,7 +18,7 @@ var_dump(ldap_modify($link));
var_dump(ldap_modify($link, "$base"));
// Too many parameters
-var_dump(ldap_modify($link, "$base", array(), "Additional data"));
+var_dump(ldap_modify($link, "$base", array(), [], "Additional data"));
// DN not found
var_dump(ldap_modify($link, "cn=not-found,$base", array()));
@@ -57,16 +57,16 @@ $link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
ldap_delete($link, "dc=my-domain,$base");
?>
--EXPECTF--
-Warning: ldap_modify() expects exactly 3 parameters, 0 given in %s on line %d
+Warning: ldap_modify() expects at least 3 parameters, 0 given in %s on line %d
NULL
-Warning: ldap_modify() expects exactly 3 parameters, 1 given in %s on line %d
+Warning: ldap_modify() expects at least 3 parameters, 1 given in %s on line %d
NULL
-Warning: ldap_modify() expects exactly 3 parameters, 2 given in %s on line %d
+Warning: ldap_modify() expects at least 3 parameters, 2 given in %s on line %d
NULL
-Warning: ldap_modify() expects exactly 3 parameters, 4 given in %s on line %d
+Warning: ldap_modify() expects at most 4 parameters, 5 given in %s on line %d
NULL
Warning: ldap_modify(): Modify: No such object in %s on line %d
diff --git a/ext/ldap/tests/ldap_next_reference_basic.phpt b/ext/ldap/tests/ldap_next_reference_basic.phpt
index 18b135da01..2476e02c57 100644
--- a/ext/ldap/tests/ldap_next_reference_basic.phpt
+++ b/ext/ldap/tests/ldap_next_reference_basic.phpt
@@ -35,9 +35,8 @@ include "connect.inc";
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
// Referral can only be removed with Manage DSA IT Control
-ldap_set_option($link, LDAP_OPT_SERVER_CONTROLS, array(array("oid" => "2.16.840.1.113730.3.4.2")));
-ldap_delete($link, "cn=userref,$base");
-ldap_delete($link, "cn=userref2,$base");
+ldap_delete($link, "cn=userref,$base", [['oid' => LDAP_CONTROL_MANAGEDSAIT, 'iscritical' => TRUE]]);
+ldap_delete($link, "cn=userref2,$base", [['oid' => LDAP_CONTROL_MANAGEDSAIT, 'iscritical' => TRUE]]);
remove_dummy_data($link, $base);
?>
--EXPECTF--
diff --git a/ext/ldap/tests/ldap_parse_result_basic.phpt b/ext/ldap/tests/ldap_parse_result_basic.phpt
index ec88dff377..e2a975d5b1 100644
--- a/ext/ldap/tests/ldap_parse_result_basic.phpt
+++ b/ext/ldap/tests/ldap_parse_result_basic.phpt
@@ -31,8 +31,7 @@ include "connect.inc";
$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
// Referral can only be removed with Manage DSA IT Control
-ldap_set_option($link, LDAP_OPT_SERVER_CONTROLS, array(array("oid" => "2.16.840.1.113730.3.4.2")));
-ldap_delete($link, "cn=userref,$base");
+ldap_delete($link, "cn=userref,$base", [['oid' => LDAP_CONTROL_MANAGEDSAIT, 'iscritical' => TRUE]]);
remove_dummy_data($link, $base);
?>
--EXPECTF--
diff --git a/ext/ldap/tests/ldap_parse_result_controls.phpt b/ext/ldap/tests/ldap_parse_result_controls.phpt
new file mode 100644
index 0000000000..711507f6c0
--- /dev/null
+++ b/ext/ldap/tests/ldap_parse_result_controls.phpt
@@ -0,0 +1,47 @@
+--TEST--
+ldap_parse_result() - Test the parsing of controls from result object
+--CREDITS--
+Côme Chilliet <mcmic@php.net>
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+<?php require_once('skipifbindfailure.inc'); ?>
+<?php
+require_once('skipifcontrol.inc');
+skipifunsupportedcontrol(LDAP_CONTROL_PAGEDRESULTS);
+?>
+--FILE--
+<?php
+require "connect.inc";
+
+$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
+insert_dummy_data($link, $base);
+
+$dn = "$base";
+$filter = "(cn=user*)";
+var_dump(
+ ldap_control_paged_result($link, 1),
+ $result = ldap_search($link, $dn, $filter, array('cn')),
+ ldap_parse_result($link, $result, $errcode, $dn, $errmsg, $refs, $ctrls),
+ $ctrls[LDAP_CONTROL_PAGEDRESULTS]['oid'],
+ $ctrls[LDAP_CONTROL_PAGEDRESULTS]['value']['size'],
+ bin2hex($ctrls[LDAP_CONTROL_PAGEDRESULTS]['value']['cookie']),
+ ldap_get_entries($link, $result)['count']
+);
+?>
+===DONE===
+--CLEAN--
+<?php
+include "connect.inc";
+
+$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
+remove_dummy_data($link, $base);
+?>
+--EXPECTF--
+bool(true)
+resource(%d) of type (ldap result)
+bool(true)
+string(22) "1.2.840.113556.1.4.319"
+int(%d)
+string(%d) "%s"
+int(1)
+===DONE===
diff --git a/ext/ldap/tests/ldap_read_error.phpt b/ext/ldap/tests/ldap_read_error.phpt
index 7d57172e0d..08f6280490 100644
--- a/ext/ldap/tests/ldap_read_error.phpt
+++ b/ext/ldap/tests/ldap_read_error.phpt
@@ -17,7 +17,7 @@ var_dump(ldap_read($link));
var_dump(ldap_read($link, $link));
// Too many parameters
-var_dump(ldap_read($link, "$base", "(objectClass=*)", array(), 0, 0, 0, 0 , "Additional data"));
+var_dump(ldap_read($link, "$base", "(objectClass=*)", array(), 0, 0, 0, 0, [], "Additional data"));
?>
===DONE===
--EXPECTF--
@@ -30,6 +30,6 @@ NULL
Warning: ldap_read() expects at least 3 parameters, 2 given in %s on line %d
NULL
-Warning: ldap_read() expects at most 8 parameters, 9 given in %s on line %d
+Warning: ldap_read() expects at most 9 parameters, 10 given in %s on line %d
NULL
===DONE===
diff --git a/ext/ldap/tests/ldap_rename_error.phpt b/ext/ldap/tests/ldap_rename_error.phpt
index 111717f0b0..8a580e5c34 100644
--- a/ext/ldap/tests/ldap_rename_error.phpt
+++ b/ext/ldap/tests/ldap_rename_error.phpt
@@ -15,7 +15,7 @@ var_dump(ldap_rename($link, "cn=userNotFound,$base", "cn=userZ", "$base", true))
?>
===DONE===
--EXPECTF--
-Warning: ldap_rename() expects exactly 5 parameters, 1 given in %s on line %d
+Warning: ldap_rename() expects at least 5 parameters, 1 given in %s on line %d
NULL
bool(false)
===DONE===
diff --git a/ext/ldap/tests/ldap_rename_ext.phpt b/ext/ldap/tests/ldap_rename_ext.phpt
new file mode 100644
index 0000000000..bee180b6f7
--- /dev/null
+++ b/ext/ldap/tests/ldap_rename_ext.phpt
@@ -0,0 +1,80 @@
+--TEST--
+ldap_rename_ext() - Rename operation with controls
+--CREDITS--
+Côme Chilliet <mcmic@php.net>
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+<?php require_once('skipifbindfailure.inc'); ?>
+<?php
+require_once('skipifcontrol.inc');
+skipifunsupportedcontrol(LDAP_CONTROL_PRE_READ);
+skipifunsupportedcontrol(LDAP_CONTROL_POST_READ);
+?>
+--FILE--
+<?php
+require "connect.inc";
+
+$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
+insert_dummy_data($link, $base);
+
+var_dump(
+ $result = ldap_rename_ext($link, "cn=userA,$base", "cn=userZ", "$base", TRUE,
+ [
+ ['oid' => LDAP_CONTROL_PRE_READ, 'iscritical' => TRUE, 'value' => ['attrs' => ['cn']]],
+ ['oid' => LDAP_CONTROL_POST_READ, 'iscritical' => TRUE, 'value' => ['attrs' => ['cn']]]
+ ]
+ ),
+ ldap_parse_result($link, $result, $errcode, $matcheddn, $errmsg, $referrals, $ctrls),
+ $errcode,
+ $errmsg,
+ $ctrls[LDAP_CONTROL_PRE_READ],
+ $ctrls[LDAP_CONTROL_POST_READ],
+ ldap_count_entries($link, ldap_search($link, "$base", "(cn=userA)", array("cn"))),
+ ldap_count_entries($link, ldap_search($link, "$base", "(cn=userZ)", array("cn")))
+);
+?>
+===DONE===
+--CLEAN--
+<?php
+require "connect.inc";
+
+$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
+ldap_rename($link, "cn=userZ,$base", "cn=userA", "$base", true);
+remove_dummy_data($link, $base);
+?>
+--EXPECTF--
+resource(%d) of type (ldap result)
+bool(true)
+int(0)
+string(0) ""
+array(2) {
+ ["oid"]=>
+ string(14) "1.3.6.1.1.13.1"
+ ["value"]=>
+ array(2) {
+ ["dn"]=>
+ string(%d) "cn=userA,%s"
+ ["cn"]=>
+ array(1) {
+ [0]=>
+ string(5) "userA"
+ }
+ }
+}
+array(2) {
+ ["oid"]=>
+ string(14) "1.3.6.1.1.13.2"
+ ["value"]=>
+ array(2) {
+ ["dn"]=>
+ string(%d) "cn=userZ,%s"
+ ["cn"]=>
+ array(1) {
+ [0]=>
+ string(5) "userZ"
+ }
+ }
+}
+int(0)
+int(1)
+===DONE===
diff --git a/ext/ldap/tests/ldap_search_basic.phpt b/ext/ldap/tests/ldap_search_basic.phpt
index 54523de38a..618366b1a1 100644
--- a/ext/ldap/tests/ldap_search_basic.phpt
+++ b/ext/ldap/tests/ldap_search_basic.phpt
@@ -68,7 +68,7 @@ array(4) {
["count"]=>
int(1)
[0]=>
- string(4) "oops"
+ string(%d) "%s"
}
[3]=>
string(12) "userpassword"
@@ -129,7 +129,7 @@ array(4) {
["count"]=>
int(1)
[0]=>
- string(15) "oopsIDitItAgain"
+ string(%d) "%s"
}
[3]=>
string(12) "userpassword"
@@ -181,7 +181,7 @@ array(4) {
["count"]=>
int(1)
[0]=>
- string(17) "0r1g1na1 passw0rd"
+ string(%d) "%s"
}
[3]=>
string(12) "userpassword"
diff --git a/ext/ldap/tests/ldap_search_overrides.phpt b/ext/ldap/tests/ldap_search_overrides.phpt
index 72d8e2498e..2434fe5db2 100644
--- a/ext/ldap/tests/ldap_search_overrides.phpt
+++ b/ext/ldap/tests/ldap_search_overrides.phpt
@@ -81,7 +81,7 @@ array(4) {
["count"]=>
int(1)
[0]=>
- string(4) "oops"
+ string(%d) "%s"
}
[3]=>
string(12) "userpassword"
@@ -142,7 +142,7 @@ array(4) {
["count"]=>
int(1)
[0]=>
- string(15) "oopsIDitItAgain"
+ string(%d) "%s"
}
[3]=>
string(12) "userpassword"
@@ -194,7 +194,7 @@ array(4) {
["count"]=>
int(1)
[0]=>
- string(17) "0r1g1na1 passw0rd"
+ string(%d) "%s"
}
[3]=>
string(12) "userpassword"
diff --git a/ext/ldap/tests/ldap_search_paged_result_controls.phpt b/ext/ldap/tests/ldap_search_paged_result_controls.phpt
new file mode 100644
index 0000000000..2187a54148
--- /dev/null
+++ b/ext/ldap/tests/ldap_search_paged_result_controls.phpt
@@ -0,0 +1,99 @@
+--TEST--
+ldap_search() test with paged result controls
+--CREDITS--
+Côme Chilliet <mcmic@php.net>
+--SKIPIF--
+<?php
+require_once('skipif.inc');
+require_once('skipifbindfailure.inc');
+require_once('skipifcontrol.inc');
+skipifunsupportedcontrol(LDAP_CONTROL_PAGEDRESULTS);
+?>
+--FILE--
+<?php
+include "connect.inc";
+
+$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
+insert_dummy_data($link, $base);
+
+$dn = "$base";
+$filter = "(cn=user*)";
+var_dump(
+ $result = ldap_search($link, $dn, $filter, array('cn'), 0, 0, 0, LDAP_DEREF_NEVER,
+ [['oid' => LDAP_CONTROL_PAGEDRESULTS, 'value' => ['size' => 2]]]),
+ ldap_get_entries($link, $result),
+ ldap_parse_result($link, $result, $errcode , $matcheddn , $errmsg , $referrals, $controls),
+ $result = ldap_search($link, $dn, $filter, array('cn'), 0, 0, 0, LDAP_DEREF_NEVER,
+ [['oid' => LDAP_CONTROL_PAGEDRESULTS, 'value' => ['size' => 20, 'cookie' => $controls[LDAP_CONTROL_PAGEDRESULTS]['value']['cookie']]]]),
+ ldap_get_entries($link, $result)
+);
+?>
+===DONE===
+--CLEAN--
+<?php
+include "connect.inc";
+
+$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
+remove_dummy_data($link, $base);
+?>
+--EXPECTF--
+resource(%d) of type (ldap result)
+array(3) {
+ ["count"]=>
+ int(2)
+ [0]=>
+ array(4) {
+ ["cn"]=>
+ array(2) {
+ ["count"]=>
+ int(1)
+ [0]=>
+ string(5) "userA"
+ }
+ [0]=>
+ string(2) "cn"
+ ["count"]=>
+ int(1)
+ ["dn"]=>
+ string(%d) "cn=userA,%s"
+ }
+ [1]=>
+ array(4) {
+ ["cn"]=>
+ array(2) {
+ ["count"]=>
+ int(1)
+ [0]=>
+ string(5) "userB"
+ }
+ [0]=>
+ string(2) "cn"
+ ["count"]=>
+ int(1)
+ ["dn"]=>
+ string(%d) "cn=userB,%s"
+ }
+}
+bool(true)
+resource(%d) of type (ldap result)
+array(2) {
+ ["count"]=>
+ int(1)
+ [0]=>
+ array(4) {
+ ["cn"]=>
+ array(2) {
+ ["count"]=>
+ int(1)
+ [0]=>
+ string(5) "userC"
+ }
+ [0]=>
+ string(2) "cn"
+ ["count"]=>
+ int(1)
+ ["dn"]=>
+ string(%d) "cn=userC,cn=userB,%s"
+ }
+}
+===DONE===
diff --git a/ext/ldap/tests/ldap_search_sort_controls.phpt b/ext/ldap/tests/ldap_search_sort_controls.phpt
new file mode 100644
index 0000000000..16504a6997
--- /dev/null
+++ b/ext/ldap/tests/ldap_search_sort_controls.phpt
@@ -0,0 +1,207 @@
+--TEST--
+ldap_search() test with sort and VLV controls
+--CREDITS--
+Côme Chilliet <mcmic@php.net>
+--SKIPIF--
+<?php
+require_once('skipif.inc');
+require_once('skipifbindfailure.inc');
+require_once('skipifcontrol.inc');
+skipifunsupportedcontrol(LDAP_CONTROL_SORTREQUEST);
+skipifunsupportedcontrol(LDAP_CONTROL_VLVREQUEST);
+?>
+--FILE--
+<?php
+include "connect.inc";
+
+$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
+insert_dummy_data($link, $base);
+
+/* First test with only SORT control */
+var_dump(
+ $result = ldap_search($link, $base, '(cn=*)', array('cn'), 0, 0, 0, LDAP_DEREF_NEVER,
+ [
+ [
+ 'oid' => LDAP_CONTROL_SORTREQUEST,
+ 'iscritical' => TRUE,
+ 'value' => [
+ ['attr' => 'cn', 'oid' => '2.5.13.3' /* caseIgnoreOrderingMatch */, 'reverse' => TRUE]
+ ]
+ ]
+ ]
+ ),
+ ldap_get_entries($link, $result),
+ ldap_parse_result($link, $result, $errcode , $matcheddn , $errmsg , $referrals, $controls),
+ $errcode,
+ $errmsg,
+ $controls
+);
+
+/* Then with VLV control */
+var_dump(
+ $result = ldap_search($link, $base, '(cn=*)', array('cn'), 0, 0, 0, LDAP_DEREF_NEVER,
+ [
+ [
+ 'oid' => LDAP_CONTROL_SORTREQUEST,
+ 'iscritical' => TRUE,
+ 'value' => [
+ ['attr' => 'cn', 'oid' => '2.5.13.3' /* caseIgnoreOrderingMatch */, 'reverse' => TRUE]
+ ]
+ ],
+ [
+ 'oid' => LDAP_CONTROL_VLVREQUEST,
+ 'iscritical' => TRUE,
+ 'value' => [
+ 'before' => 0, // Return 0 entry before target
+ 'after' => 1, // Return 1 entry after target
+ 'offset' => 2, // Target entry is the second one
+ 'count' => 0, // We have no idea how many entries there are
+ ]
+ ]
+ ]
+ ),
+ ldap_get_entries($link, $result),
+ ldap_parse_result($link, $result, $errcode , $matcheddn , $errmsg , $referrals, $controls),
+ array_keys($controls),
+ $controls[LDAP_CONTROL_SORTRESPONSE],
+ $controls[LDAP_CONTROL_VLVRESPONSE]['value']['target'],
+ $controls[LDAP_CONTROL_VLVRESPONSE]['value']['count'],
+ $controls[LDAP_CONTROL_VLVRESPONSE]['value']['errcode'],
+ bin2hex($controls[LDAP_CONTROL_VLVRESPONSE]['value']['context'])
+);
+?>
+===DONE===
+--CLEAN--
+<?php
+include "connect.inc";
+
+$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
+remove_dummy_data($link, $base);
+?>
+--EXPECTF--
+resource(%d) of type (ldap result)
+array(4) {
+ ["count"]=>
+ int(3)
+ [0]=>
+ array(4) {
+ ["cn"]=>
+ array(2) {
+ ["count"]=>
+ int(1)
+ [0]=>
+ string(5) "userC"
+ }
+ [0]=>
+ string(2) "cn"
+ ["count"]=>
+ int(1)
+ ["dn"]=>
+ string(%d) "cn=userC,cn=userB,%s"
+ }
+ [1]=>
+ array(4) {
+ ["cn"]=>
+ array(2) {
+ ["count"]=>
+ int(1)
+ [0]=>
+ string(5) "userB"
+ }
+ [0]=>
+ string(2) "cn"
+ ["count"]=>
+ int(1)
+ ["dn"]=>
+ string(%d) "cn=userB,%s"
+ }
+ [2]=>
+ array(4) {
+ ["cn"]=>
+ array(2) {
+ ["count"]=>
+ int(1)
+ [0]=>
+ string(5) "userA"
+ }
+ [0]=>
+ string(2) "cn"
+ ["count"]=>
+ int(1)
+ ["dn"]=>
+ string(%d) "cn=userA,%s"
+ }
+}
+bool(true)
+int(0)
+string(0) ""
+array(1) {
+ ["1.2.840.113556.1.4.474"]=>
+ array(2) {
+ ["oid"]=>
+ string(22) "1.2.840.113556.1.4.474"
+ ["value"]=>
+ array(1) {
+ ["errcode"]=>
+ int(0)
+ }
+ }
+}
+resource(%d) of type (ldap result)
+array(3) {
+ ["count"]=>
+ int(2)
+ [0]=>
+ array(4) {
+ ["cn"]=>
+ array(2) {
+ ["count"]=>
+ int(1)
+ [0]=>
+ string(5) "userB"
+ }
+ [0]=>
+ string(2) "cn"
+ ["count"]=>
+ int(1)
+ ["dn"]=>
+ string(%d) "cn=userB,%s"
+ }
+ [1]=>
+ array(4) {
+ ["cn"]=>
+ array(2) {
+ ["count"]=>
+ int(1)
+ [0]=>
+ string(5) "userA"
+ }
+ [0]=>
+ string(2) "cn"
+ ["count"]=>
+ int(1)
+ ["dn"]=>
+ string(%d) "cn=userA,%s"
+ }
+}
+bool(true)
+array(2) {
+ [0]=>
+ string(22) "1.2.840.113556.1.4.474"
+ [1]=>
+ string(24) "2.16.840.1.113730.3.4.10"
+}
+array(2) {
+ ["oid"]=>
+ string(22) "1.2.840.113556.1.4.474"
+ ["value"]=>
+ array(1) {
+ ["errcode"]=>
+ int(0)
+ }
+}
+int(2)
+int(3)
+int(0)
+string(%d) "%s"
+===DONE===
diff --git a/ext/ldap/tests/ldap_search_variation6.phpt b/ext/ldap/tests/ldap_search_variation6.phpt
index f4f98db873..a9202967b4 100644
--- a/ext/ldap/tests/ldap_search_variation6.phpt
+++ b/ext/ldap/tests/ldap_search_variation6.phpt
@@ -25,12 +25,12 @@ var_dump(
ldap_get_entries($link, $result[1]) === $result0
);
var_dump(
- $result = ldap_search(array($link, $link), null, $filter),
+ $result = ldap_search(array($link, $link), "", $filter),
ldap_get_entries($link, $result[0]),
ldap_get_entries($link, $result[1])
);
var_dump(
- $result = ldap_search(array($link, $link), null, array($filter, $filter)),
+ $result = ldap_search(array($link, $link), "", array($filter, $filter)),
ldap_get_entries($link, $result[0]),
ldap_get_entries($link, $result[1])
);
@@ -87,7 +87,7 @@ array(4) {
["count"]=>
int(1)
[0]=>
- string(4) "oops"
+ string(%d) "%s"
}
[3]=>
string(12) "userpassword"
@@ -148,7 +148,7 @@ array(4) {
["count"]=>
int(1)
[0]=>
- string(15) "oopsIDitItAgain"
+ string(%d) "%s"
}
[3]=>
string(12) "userpassword"
@@ -200,7 +200,7 @@ array(4) {
["count"]=>
int(1)
[0]=>
- string(17) "0r1g1na1 passw0rd"
+ string(%d) "%s"
}
[3]=>
string(12) "userpassword"
diff --git a/ext/ldap/tests/ldap_set_option_error.phpt b/ext/ldap/tests/ldap_set_option_error.phpt
index f319c7e6df..3ea49cbc7e 100644
--- a/ext/ldap/tests/ldap_set_option_error.phpt
+++ b/ext/ldap/tests/ldap_set_option_error.phpt
@@ -20,8 +20,7 @@ $controls = array(
array("oid" => "1.2.752.58.1.10", "value" => "magic"),
"weird"
),
- array(
- ),
+ "notanarray"
);
// Too few parameters
@@ -60,7 +59,7 @@ bool(false)
Warning: ldap_set_option(): The array value must contain only arrays, where each array is a control in %s on line %d
bool(false)
-Warning: ldap_set_option(): Expected non-empty array value for this option in %s on line %d
+Warning: ldap_set_option(): Expected array value for this option in %s on line %d
bool(false)
bool(false)
===DONE===
diff --git a/ext/ldap/tests/ldap_set_option_variation.phpt b/ext/ldap/tests/ldap_set_option_variation.phpt
index bb8a3f1051..4c0a138552 100644
--- a/ext/ldap/tests/ldap_set_option_variation.phpt
+++ b/ext/ldap/tests/ldap_set_option_variation.phpt
@@ -77,14 +77,16 @@ bool(true)
bool(false)
bool(true)
array(2) {
- [0]=>
- array(2) {
+ ["1.2.752.58.10.1"]=>
+ array(3) {
["oid"]=>
string(15) "1.2.752.58.10.1"
["iscritical"]=>
bool(true)
+ ["value"]=>
+ NULL
}
- [1]=>
+ ["1.2.752.58.1.10"]=>
array(3) {
["oid"]=>
string(15) "1.2.752.58.1.10"
@@ -96,14 +98,16 @@ array(2) {
}
bool(true)
array(2) {
- [0]=>
- array(2) {
+ ["1.2.752.58.10.1"]=>
+ array(3) {
["oid"]=>
string(15) "1.2.752.58.10.1"
["iscritical"]=>
bool(true)
+ ["value"]=>
+ NULL
}
- [1]=>
+ ["1.2.752.58.1.10"]=>
array(3) {
["oid"]=>
string(15) "1.2.752.58.1.10"
diff --git a/ext/ldap/tests/skipifcontrol.inc b/ext/ldap/tests/skipifcontrol.inc
new file mode 100644
index 0000000000..ae551d6add
--- /dev/null
+++ b/ext/ldap/tests/skipifcontrol.inc
@@ -0,0 +1,13 @@
+<?php
+require_once 'connect.inc';
+
+function skipifunsupportedcontrol($oid)
+{
+ global $host, $port, $user, $passwd, $protocol_version, $base;
+ $link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version);
+ $result = ldap_read($link, '', '(objectClass=*)', ['supportedControl']);
+ if (!in_array($oid, ldap_get_entries($link, $result)[0]['supportedcontrol'])) {
+ die(sprintf("skip Unsupported control %s", $oid));
+ }
+}
+?>
diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c
index d88860c4f3..c355ae2ba4 100644
--- a/ext/libxml/libxml.c
+++ b/ext/libxml/libxml.c
@@ -1042,9 +1042,7 @@ static PHP_FUNCTION(libxml_get_errors)
xmlErrorPtr error;
- if (array_init(return_value) == FAILURE) {
- RETURN_FALSE;
- }
+ array_init(return_value);
if (LIBXML(error_list)) {
diff --git a/ext/mbstring/.gitignore b/ext/mbstring/.gitignore
deleted file mode 100644
index 21450cdec8..0000000000
--- a/ext/mbstring/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-oniguruma/oniguruma.h
diff --git a/ext/mbstring/README b/ext/mbstring/README
deleted file mode 100644
index 338aa79fcd..0000000000
--- a/ext/mbstring/README
+++ /dev/null
@@ -1,17 +0,0 @@
-!!Caution: DO NOT ADD/CHANGE MBSTRING CODE!!
-
-New mbstring is under development, anyone who would like
-add new feature/change behavior should access to development
-source.
-
-http://cvs.sourceforge.jp/cgi-bin/viewcvs.cgi/php-i18n/
-
-All changes made after 2002/5/19 are subject to be
-removed.
-
-You are warned in php-dev and php-cvs lists many times
-already. If you are curious, search archive for details.
-
-Thank you.
-
-
diff --git a/ext/mbstring/README.libmbfl b/ext/mbstring/README.libmbfl
deleted file mode 100644
index 4f1174e2f7..0000000000
--- a/ext/mbstring/README.libmbfl
+++ /dev/null
@@ -1,16 +0,0 @@
-
-libmbfl is a streamable multibyte character code filter and
-converter library.
-libmbfl is distributed under LGPL 2.1 and bundled with PHP.
-
-The original version of libmbfl is developed and distributed
-at http://sourceforge.jp/project/php-i18n/ .
-
-If you need to modify the bundled libmbfl, the change also have to be applied for
-the libmbfl on sourceforge.jp.
-
-If you have question about libmbfl, please ask to
- hirokawa@php.net, moriyoshi@php.net.
-
-See libmbfl/DISCLAIMER for licensing information of libmbfl.
-
diff --git a/ext/mbstring/README_PHP3-i18n-ja b/ext/mbstring/README_PHP3-i18n-ja
deleted file mode 100644
index eabe9e90f2..0000000000
--- a/ext/mbstring/README_PHP3-i18n-ja
+++ /dev/null
@@ -1,774 +0,0 @@
-==========================================
- README for I18N Package
-==========================================
-
-o Name and location of package
-
-Name: php-3.0.18-i18n-ja-2
-Location: http://www.happysize.co.jp/techie/php-ja-jp/
- ftp://ftp.happysize.co.jp/php-ja-jp/
- http://php.vdomains.org/
- ftp://ftp.vdomains.org/pub/php-ja-jp/
- http://php.jpnnet.com/
-
-Currently, this I18N version of PHP only adds Japanese support to base
-PHP. It allows you to use Japanese in scripts, as well as conversion
-between various Japanese encodings. It will work perfectly fine with
-ASCII with i18n option enabled. (note: executable is bit larger due
-to UNICODE table). The basic design aproach is to allow for other
-languages to be added in the future. Developers are encourage to join
-us!
-
-For more information on Japanese encodings, please refer to the
-section "Additional Notes."
-
-
-o What is this package?
-
-This package allows you to handle multiple Japanese encodings (SJIS, EUC,
-UTF-8, JIS) in PHP. If you find any bugs in this package, please report
-them to the appropriate mailing list. For now, the PHP-jp mailing list
-is the best place for this.
-
-PHP-jp ML mailto:PHP-jp@sidecar.ics.es.osaka-u.ac.jp
- http://sidecar.ics.es.osaka-u.ac.jp/php-jp/
- (discussions are in Japanese)
-
-
-o Who should use this
-
-Due to lack of documentation, it's not intended for beginners. If
-something goes wrong, be prepared to fix it on your own.
-
-
-o Warranty and Copyright
-
-There is no warranty with this package. Use it at your own risk.
-
-Please refer to the source code for the copyrights. In general, each
-program's copyright is owned by the programmer. Unless you obey the
-copyright holders restrictions, you are not allowed to use it in any
-form.
-
-
-o Redistribution
-
-As described in the source code, this package and the components are
-allowed to be redistributed with certain restrictions.
-
-Due to this package being still in beta, please try to redistribute
-it as an entire package. Please try not to distribute it as a form
-of patch. Because we would prefer to have this package distributed
-as one single package (not patch of patch of patch), avoid releasing
-any patch to this package.
-
-
-o Who made this
-
-A team of volunteers, PHP3 Internationalization, has been contributing
-their free time producing it. Although we are not related to the core
-PHP programmers, we are hoping to have our modifications merged into the
-core distribution in the near future. Thus, we did not call this a
-"Japanese Patch" (or distribution). Our final goal is to have true
-i18nized PHP!
-
-For anyone interested in this project, please drop us a line.
-
-Contact Address:
- phpj-dev@kage.net
- (Discussions are in Japanese, but feel free to write us in English)
-
-Webpage (English and Japanese):
- http://php.jpnnet.com/
-
-Project Outline (Japanese):
- http://www.happysize.co.jp/techie/php-ja-jp/spec.htm
-
-Developers:
- Hironori Sato <satoh@jpnnet.com>
- Shigeru Kanemoto <sgk@happysize.co.jp>
- Tsukada Takuya <tsukada@fminn.nagano.nagano.jp>
- U. Kenkichi <kenkichi@axes.co.jp>
- Tateyama <tateyan@amy.hi-ho.ne.jp>
- Other gracious contributors
-
-
-o Future plans
-
-- fulfilling what's written in outline
-- support for other languages other than Japanese
-- make the character conversion as a library (?)
-- more testing
-
-
-o Special Thanks to
-
-PHP Japanese webpage maintainer, Hirokawa-san
- http://www.cityfujisawa.ne.jp/%7Elouis/apps/phpfi/
-PHP-JP ML's Yamamoto-san
- http://sidecar.ics.es.osaka-u.ac.jp/php-jp/
-Previous jp-patch developers
-
-
-
-==========================================
- Advantages of using I18N package
-==========================================
-
-- allows you to use various character encodings for script files and
- http output
-- distinguish character encoding in POST/GET/COOKIE
-- proper mail output using JIS as body and MIME/Base64/JIS subject
-- if http output's Content-Type is text/html, it will set proper charset
-- stable character encoding conversion
-- multibyte regex
-
-
-
-==========================================
- Installation
-==========================================
-
-o Summary
-
-Add --enable-i18n option when running configure. For your own setup,
-add any other appropriate options as well.
-
-Don't forget to copy php3.ini-dist to desired location.
-(ex. /usr/local/lib/php3.ini)
-
-If you have already installed PHP3, copy all the entries in php3.ini-dist
-which start with "i18n.xxxx" to php3.ini.
-
-
-o configure option
- --enable-i18n
- include i18n features
-
- --enable-mbregex
- include multibyte regex library
- (without i18n enabled, mbregex functions will not function)
-
-
-o creating cgi version
-
- % tar xvzf php-3.0.18-i18n-ja-2.tar.gz
- % cd php-3.0.18-i18n-ja-2
- % ./configure --enable-i18n --enable-mbregex
- % make
-
-
-o creating Apache version (regular module)
-
- % tar xvzf php-3.0.18-i18n-ja-2.tar.gz
- % tar xvzf apache_1.3.x.tar.gz
- % cd apache_1.3.x
- % ./configure
- % cd ../php-3.0.18-i18n-ja-2
- % ./configure --with-apache=../apache_1.3.x --enable-i18n --enable-mbregex
- % make
- % make install
- % cd ../apache_1.3.x
- % ./configure --activate-module=src/modules/php3/libphp3.a
- % make
- % make install
-
-
-o creating Apache DSO version
-
- create DSO capable Apache first
- % tar xvzf apache_1.3.x.tar.gz
- % cd apache-1.3.x
- % ./configure --enable-shared=max
- % make
- % make install
-
- now create php3
- % cd php-3.0.18-i18n-ja-2
- % ./configure --with-apxs=/usr/local/apache/bin/apxs --enable-i18n \
- --enable-mbregex
- % make
- % make install
-
-
-==========================================
- Additional Notes
-==========================================
-
-o Multibyte regex library
-
-From beta4, we have included the multibyte (mb) regex library which comes with
-Ruby. With this addition, you can now use regex in EUC, SJIS and UTF-8
-encoding. To avoid any conflicts with HSREGEX included with Apache,
-each function name has been changed. Therefore, mb regex functions are
-named differently from the original ereg functions in PHP. The character
-encoding used in mb regex is configured in i18n.internal_encoding.
-
-
-o Binary Output
-
-If http output encoding is set to other than 'pass', conversion of encoding
-from internal encoding to http output is done automatically. Thus,
-if you prefer to spit out anything in raw binary format, your data
-may be corrupted. In such event, set http_output to 'pass'.
-
-ex.
- <?
- i18n_http_output("pass");
- ...
- echo $the_binary_data_string;
- ?>
-
-
-o Content-Type
-
-Depending on the setting of http_output, PHP will output the proper charset.
-ex. Content-Type: text/html; charset="..."
-
-Be aware of following:
-
-- If you set Content-Type header using header() function, that will
- override the automatic addition of charset.
-- Be cautious when you set i18n_http_output, since if any output is
- made prior to this, proper header may have been sent out to the
- client already.
-
-
-o In the event of trouble
-
-If you find any bugs or trouble, please contact us at the above address.
-It may help us to track the problem if you send us the script as well.
-
-If you encounter any memory related error such as segmentation violation,
-add --enable-debug when you run configure. This will give you more
-detail information on where error has occurred. The error is stored
-in the server log or regular http output in CGI mode.
-
-
-o About Japanese encodings
-
-Due to historical reason, there are multiple character encodings used
-for Japanese. The most common encodings are: SJIS, EUC, JIS, and UTF-8.
-Here are (very) brief description of them:
-
-EUC
- commonly used in UNIX environment
- 8bit-8bit combo
- always >=0x80
-
-SJIS
- commonly used in Mac or PCs
- similar to EUC
- mostly 8bit-8bit (some 8bit-7bit)
- mostly >=0x80
- there are some halfwidth (size of ASCII) multibytes
-
-JIS
- commonly used in 7bit environment (nntp and smtp)
- starts with escaping char, \033 and a few more characters
-
-UTF-8
- 16bit+ encoding
- defines many languages existing in this world
- see http://www.unicode.org/ for more detail
-
-Because of having all these character encodings, PHP needs to translate
-between these encodings on the fly. Also, the addition of the mb regex
-library allows you to handle mb strings without fear of getting mb char
-chopped in half.
-
-Since Japanese is not the only language with multiple encodings, we
-encourage other developers to modify our code to suit your needs. We
-definitely need people to work with Korean, Chinese (both traditional
-and simplified), and Russian. Let us know if you are interested in
-this project!
-
-
-
-==========================================
- php3.ini setting
-==========================================
-
-The following init options will allow you to change the default settings.
-Define these settings in the global section of php3.ini.
-
-All keywords are case-insensitive.
-
-o Encoding naming
-
- For each encoding, there are three names: standarized, alias, MIME
-
- - UTF-8
- standard: UTF-8
- alias: N/A
- mime: UTF-8
-
- - ASCII
- standard: ASCII
- alias: N/A
- mime: US-ASCII
-
- - Japanese EUC
- standard: EUC-JP
- alias: EUC, EUC_JP, eucJP, x-euc-jp
- mime: EUC-JP
-
- - Shift JIS
- standard: SJIS
- alias: x-sjis, MS_Kanji
- mime: Shift_JIS
-
- - JIS
- standard: JIS
- alias: N/A
- mime: ISO-2022-JP
-
- - Quoted-Printable
- standard: Quoted-Printable
- alias: qprint
- mime: N/A
-
- - BASE64
- standard: BASE64
- alias: N/A
- mime: N/A
-
- - no conversion
- standard: pass
- alias: none
- mime: N/A
-
- - auto encoding detection
- standard: auto
- alias: unknown
- mime: N/A
-
- * N/A - Not Applicapable
-
-o i18n.http_output - default http output encoding
-
- i18n.http_output = EUC-JP|SJIS|JIS|UTF-8|pass
- EUC-JP : EUC
- SJIS: SJIS
- JIS : JIS
- UTF-8: UTF-8
- pass: no conversion
-
- The default is pass (internal encoding is used)
- It can be re-configured on the fly using i18n_http_output().
-
-
-o i18n.internal_encoding - internal encoding
-
- i18n.internal_encoding = EUC-JP|SJIS|UTF-8
- EUC-JP : EUC
- SJIS: SJIS
- UTF-8: UTF-8
-
- The default is EUC-JP.
-
- PHP parser is designed based on using ISO-8859-1. For other
- encodings, following conditions have to be satisfied in order
- to use them:
- - per byte encoding
- - single byte character in range of 00h-7fh which is compatible
- with ASCII
- - multibyte without 00h-7fh
- In case of Japanese, EUC-JP and UTF-8 are the only encoding that
- meets this criteria.
-
- If i18n.internal_encoding and i18n.http_output differs, conversion
- takes place at the time of output. If you convert any data within
- PHP scripts to URL encoding, BASE64 or Quoted-Printable, encoding
- stays as defined in i18n.internal_encoding. Thus, if you would
- prefer to encode in compliance with i18n.http_output, you need
- to manually convert encoding.
-
- ex. $str = urlencode( i18n_convert($str, i18n_http_output()) );
-
- Encoding such as ISO-2022-** and HZ encoding which uses escape
- sequences can not be used as internal encoding. If used, they
- result in following errors:
- - parser pukes funky error
- - magic_quotes_*** breaks encoding (SJIS may have similar problem)
- - string manipulation and regex will malfunction
-
-
-o i18n.script_encoding - script encoding
-
- i18n.script_encoding = auto|EUC-JP|SJIS|JIS|UTF-8
- auto: automatic
- EUC-JP : EUC
- SJIS: SJIS
- JIS : JIS
- UTF-8: UTF-8
-
- The default is auto.
- The script's encoding is converted to i18n.internal_encoding before
- entering the script parser.
-
- Be aware that auto detection may fail under some conditions.
- For best auto detection, add multibyte character at beginning of
- script.
-
-
-o i18n.http_input - handling of http input (GET/POST/COOKIE)
-
- i18n.http_input = pass|auto
- auto: auto conversion
- pass: no conversion
-
- The default is auto.
- If set to pass, no conversion will take place.
- If set to auto, it will automatically detect the encoding. If
- detection is successful, it will convert to the proper internal
- encoding. If not, it will assume the input as defined in
- i18n.http_input_default.
-
-o i18n.http_input_default - default http input encoding
-
- i18n.http_input_default = pass|EUC-JP|SJIS|JIS|UTF-8
- pass: no conversion
- EUC-JP : EUC
- SJIS: SJIS
- JIS : JIS
- UTF-8: UTF-8
-
- The default is pass.
- This option is only effective as long as i18n.http_input is set to
- auto. If the auto detection fails, this encoding is used as an
- assumption to convert the http input to the internal encoding.
- If set to pass, no conversion will take place.
-
-o sample settings
-
- 1) For most flexibility, we recommend using following example.
- i18n.http_output = SJIS
- i18n.internal_encoding = EUC-JP
- i18n.script_encoding = auto
- i18n.http_input = auto
- i18n.http_input_default = SJIS
-
- 2) To avoid unexpected encoding problems, try these:
-
- i18n.http_output = pass
- i18n.internal_encoding = EUC-JP
- i18n.script_encoding = pass
- i18n.http_input = pass
- i18n.http_input_default = pass
-
-
-
-==========================================
- PHP functions
-==========================================
-
-The following describes the additional PHP functions.
-
-All keywords are case-insensitive.
-
-o i18n_http_output(encoding)
-o encoding = i18n_http_output()
-
- This will set the http output encoding. Any output following this
- function will be controlled by this function. If no argument is given,
- the current http output encode setting is returned.
-
- encodings
- EUC-JP : EUC
- SJIS: SJIS
- JIS : JIS
- UTF-8: UTF-8
- pass: no conversion
-
- NONE is not allowed
-
-
-o encoding = i18n_internal_encoding()
-
- Returns the current internal encoding as a string.
-
- internal encoding
- EUC-JP : EUC
- SJIS: SJIS
- UTF-8: UTF-8
-
-
-o encoding = i18n_http_input()
-
- Returns http input encoding.
-
- encodings
- EUC-JP : EUC
- SJIS: SJIS
- JIS : JIS
- UTF-8: UTF-8
- pass: no conversion (only if i18n.http_input is set to pass)
-
-
-o string = i18n_convert(string, encoding)
- string = i18n_convert(string, encoding, pre-conversion-encoding)
-
- Returns converted string in desired encoding. If
- pre-conversion-encoding is not defined, the given
- string is assumed to be in internal encoding.
-
- encoding
- EUC-JP : EUC
- SJIS: SJIS
- JIS : JIS
- UTF-8: UTF-8
- pass: no conversion
-
- pre-conversion-encoding
- EUC-JP : EUC
- SJIS: SJIS
- JIS : JIS
- UTF-8: UTF-8
- pass: no conversion
- auto: auto detection
-
-
-o encoding = i18n_discover_encoding(string)
-
- Encoding of the given string is returned (as a string).
-
- encoding
- EUC-JP : EUC
- SJIS: SJIS
- JIS : JIS
- UTF-8: UTF-8
- ASCII: ASCII (only 09h, 0Ah, 0Dh, 20h-7Eh)
- pass: unable to determine (text is too short to determine)
- unknown: unknown or possible error
-
-
-o int = mbstrlen(string)
-o int = mbstrlen(string, encoding)
-
- Returns character length of a given string. If no encoding is defined,
- the encoding of string is assumed to be the internal encoding.
-
- encoding
- EUC-JP : EUC
- SJIS: SJIS
- JIS : JIS
- UTF-8: UTF-8
- auto: automatic
-
-
-o int = mbstrpos(string1, string2)
-o int = mbstrpos(string1, string2, start)
-o int = mbstrpos(string1, string2, start, encoding)
-
- Same as strpos. If no encoding is defined, the encoding of string
- is assumed to be the internal encoding.
-
- encoding
- EUC-JP : EUC
- SJIS: SJIS
- JIS : JIS
- UTF-8: UTF-8
-
-
-o int = mbstrrpos(string1, string2)
-o int = mbstrrpos(string1, string2, encoding)
-
- Same as strrpos. If no encoding is defined, the encoding of string
- is assumed to be the internal encoding.
-
- encoding
- EUC-JP : EUC
- SJIS: SJIS
- JIS : JIS
- UTF-8: UTF-8
-
-
-o string = mbsubstr(string, position)
-o string = mbsubstr(string, position, length)
-o string = mbsubstr(string, position, length, encoding)
-
- Same as substr. If no encoding is defined, the encoding of string
- is assumed to be the internal encoding.
-
- encoding
- EUC-JP : EUC
- SJIS: SJIS
- JIS : JIS
- UTF-8: UTF-8
-
-
-o string = mbstrcut(string, position)
-o string = mbstrcut(string, position, length)
-o string = mbstrcut(string, position, length, encoding)
-
- Same as subcut. If position is the 2nd byte of a mb character, it will cut
- from the first byte of that character. It will cut the string without
- chopping a single byte from a mb character. In another words, if you
- set length to 5, you will only get two mb characters. If no encoding
- is defined, the encoding of string is assumed to be the internal encoding.
-
- encoding
- EUC-JP : EUC
- SJIS: SJIS
- JIS : JIS
- UTF-8: UTF-8
-
-
-o string = i18n_mime_header_encode(string)
- MIME encode the string in the format of =?ISO-2022-JP?B?[string]?=.
-
-
-o string = i18n_mime_header_decode(string)
- MIME decodes the string.
-
-
-o string = i18n_ja_jp_hantozen(string)
-o string = i18n_ja_jp_hantozen(string, option)
-o string = i18n_ja_jp_hantozen(string, option, encoding)
-
- Conversion between full width character and halfwidth character.
-
- option
- The following options are allowed. The default is "KV".
- Acronym: FW = fullwidth, HW = halfwidth
-
- "r" : FW alphabet -> HW alphabet
-
- "R" : HW alphabet -> FW alphabet
-
- "n" : FW number -> HW number
-
- "N" : HW number -> FW number
-
- "a" : FW alpha numeric (21h-7Eh) -> HW alpha numeric
-
- "A" : HW alpha numeric (21h-7Eh) -> FW alpha numeric
-
- "k" : FW katakana -> HW katakana
-
- "K" : HW katakana -> FW katakana
-
- "h" : FW hiragana -> HW hiragana
-
- "H" : HW hiragana -> FW katakana
-
- "c" : FW katakana -> FW hiragana
-
- "C" : FW hiragana -> FW katakana
-
- "V" : merge dakuon character. only works with "K" and "H" option
-
- encoding
- If no encoding is defined, the encoding of string is assumed to be
- the internal encoding.
- EUC-JP : EUC
- SJIS: SJIS
- JIS : JIS
- UTF-8: UTF-8
-
-
-int = mbereg(regex_pattern, string, string)
-int = mberegi(regex_pattern, string, string)
- mb version of ereg() and eregi()
-
-
-string = mbereg_replace(regex_pattern, string, string)
-string = mberegi_replace(regex_pattern, string, string)
- mb version of ereg_replace() and eregi_replace()
-
-
-string_array = mbsplit(regex, string, limit)
- mb version of split()
-
-
-
-==========================================
- FAQ
-==========================================
-
-Here, we have gathered some commonly asked questions on PHP-jp mailing
-list.
-
-o To use Japanese in GET method
-
-If you need to assign Japanese text in GET method with argument, such as;
-xxxx.php?data=<Japanese text>, use urlencode function in PHP. If not,
-text may not be passed onto action php properly.
-
-ex: <a href="hoge.php?data=<? echo urlencode($data) ?>">Link</a>
-
-
-o When passing data via GET/POST/COOKIE, \ character sneaks in
-
-When using SJIS as internal encoding, or passed-on data includes '"\,
-PHP automatically inserts escaping character, \. Set magic_quotes_gpc
-in php3.ini from On to Off. An alternative work around to this problem
-is to use StripSlashes().
-
-If $quote_str is in SJIS and you would like to extract Japanese text,
-use ereg_replace as follows:
-
-ereg_replace(sprintf("([%c-%c%c-%c]\\\\)\\\\",0x81,0x9f,0xe0,0xfc),
- "\\1",$quote_str);
-
-This will effectively extract Japanese text out of $quote_str.
-
-
-o Sometimes, encoding detection fails
-
-If i18n_http_input() returns 'pass', it's likely that PHP failed to
-detect whether it's SJIS or EUC. In such case, use <input type=hidden
-value="some Japanese text"> to properly detect the incoming text's
-encoding.
-
-
-
-==========================================
- Japanese Manual
-==========================================
-Translated manual done by "PHP Japanese Manual Project" :
-
-http://www.php.net/manual/ja/manual.php
-
-Starting 3.0.18-i18n-ja, we have removed doc-jp from tarball package.
-
-
-==========================================
- Change Logs
-==========================================
-
-o 2000-10-28, Rui Hirokawa <hirokawa@php.net>
-
-This patch is derived from php-3.0.15-i18n-ja as well as php-3.0.16 by
-Kuwamura applied to original php-3.0.18. It also includes following fixes:
-
-1) allows you to set charset in mail().
-2) fixed mbregex definitions to avoid conflicts with system regex
-3) php3.ini-dist now uses PASS for http_output instead of SJIS
-
-o 2000-11-24, Hironori Sato <satoh@yyplanet.com>
-
-Applied above patched and added detection for gdImageStringTTF in configure.
-Following setups are known to work:
-
-gd-1.3-6, gd-devel-1.3-6, freetype-1.3.1-5, freetype-devel-1.3.1-5
- ImageTTFText($im,$size,$angle,$x1,$y1,$color,"/path/to/font.ttf",
- i18n_convert("ÆüËܸì", "UTF-8"));
- ImageGif($im);
-
-gd-1.7.3-1k1, gd-devel-1.7.3-1k1, freetype-1.3.1-5, freetype-devel-1.3.1-5
- ImageTTFText($im,$size,$angle,$x1,$y1,$color,"/path/to/font.ttf","ÆüËܸì");
- ImagePng($im);
- * i18n_internal_encoding = EUC Ëô¤Ï SJIS
-
-For any gd libraries before 1.6.2, you need to use i18n_convert. For
-gd-1.5.2/3, upgrade to anything above 1.7 to use ImageTTFText without
-using i18n_convert. As long as you have internal_encoding set to EUC or
-SJIS, ImageTTFText should work without mojibake. Again, make sure you
-have i18n_http_output("pass") before calling ImageGif, ImagePng, ImageJpeg!
-
-o 2000-12-09, Rui Hirokawa <hirokawa@php.net>
-
-Fixed mail() which was causing segmentation fault when header was null.
-
diff --git a/ext/mbstring/libmbfl/README b/ext/mbstring/libmbfl/README
index 5a3255560e..ecf1a5b8f9 100644
--- a/ext/mbstring/libmbfl/README
+++ b/ext/mbstring/libmbfl/README
@@ -1,8 +1,13 @@
-This is Libmbfl, a streamable multibyte character code filter and
-converter library.
+This is libmbfl, a streamable multibyte character code filter and converter
+library.
-See LICENSE and DISCLAIMER for licensing information.
+The original version of libmbfl is developed and distributed at
+https://github.com/moriyoshi/libmbfl under the LGPL 2.1 license.
+
+The libmbfl library is bundled with PHP as a fork of the original repository and
+is not in sync with the upstream at https://github.com/moriyoshi/libmbfl. As such,
+the libmbfl directory is directly modified in the php-src repository.
-See the file INSTALL for building and installation instructions.
+See LICENSE and DISCLAIMER for licensing information.
-# $Id$
+See INSTALL for building and installation instructions.
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_7bit.c b/ext/mbstring/libmbfl/filters/mbfilter_7bit.c
index ab1727146a..382c87437c 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_7bit.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_7bit.c
@@ -41,7 +41,9 @@ const mbfl_encoding mbfl_encoding_7bit = {
"7bit",
NULL,
NULL,
- MBFL_ENCTYPE_SBCS
+ MBFL_ENCTYPE_SBCS,
+ NULL,
+ NULL
};
const struct mbfl_convert_vtbl vtbl_8bit_7bit = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_armscii8.c b/ext/mbstring/libmbfl/filters/mbfilter_armscii8.c
index ad2cf0c7f0..bfe3763f18 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_armscii8.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_armscii8.c
@@ -44,7 +44,9 @@ const mbfl_encoding mbfl_encoding_armscii8 = {
"ArmSCII-8",
(const char *(*)[])&mbfl_encoding_armscii8_aliases,
NULL,
- MBFL_ENCTYPE_SBCS
+ MBFL_ENCTYPE_SBCS,
+ &vtbl_armscii8_wchar,
+ &vtbl_wchar_armscii8
};
const struct mbfl_identify_vtbl vtbl_identify_armscii8 = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_ascii.c b/ext/mbstring/libmbfl/filters/mbfilter_ascii.c
index e9eb496771..b3c1161d32 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_ascii.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_ascii.c
@@ -45,7 +45,9 @@ const mbfl_encoding mbfl_encoding_ascii = {
"US-ASCII", /* preferred MIME name */
(const char *(*)[])&mbfl_encoding_ascii_aliases,
NULL,
- MBFL_ENCTYPE_SBCS
+ MBFL_ENCTYPE_SBCS,
+ &vtbl_ascii_wchar,
+ &vtbl_wchar_ascii
};
const struct mbfl_identify_vtbl vtbl_identify_ascii = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_base64.c b/ext/mbstring/libmbfl/filters/mbfilter_base64.c
index adecdee888..661e1a4a5b 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_base64.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_base64.c
@@ -41,7 +41,9 @@ const mbfl_encoding mbfl_encoding_base64 = {
"BASE64",
NULL,
NULL,
- MBFL_ENCTYPE_ENC_STRM | MBFL_ENCTYPE_GL_UNSAFE
+ MBFL_ENCTYPE_ENC_STRM | MBFL_ENCTYPE_GL_UNSAFE,
+ NULL,
+ NULL
};
const struct mbfl_convert_vtbl vtbl_8bit_b64 = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_big5.c b/ext/mbstring/libmbfl/filters/mbfilter_big5.c
index 122ff4c778..21aac8ea7b 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_big5.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_big5.c
@@ -65,7 +65,9 @@ const mbfl_encoding mbfl_encoding_big5 = {
"BIG5",
(const char *(*)[])&mbfl_encoding_big5_aliases,
mblen_table_big5,
- MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE
+ MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE,
+ &vtbl_big5_wchar,
+ &vtbl_wchar_big5
};
const mbfl_encoding mbfl_encoding_cp950 = {
@@ -74,7 +76,9 @@ const mbfl_encoding mbfl_encoding_cp950 = {
"BIG5",
NULL,
mblen_table_big5,
- MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE
+ MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE,
+ &vtbl_cp950_wchar,
+ &vtbl_wchar_cp950
};
const struct mbfl_identify_vtbl vtbl_identify_big5 = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_byte2.c b/ext/mbstring/libmbfl/filters/mbfilter_byte2.c
index 7452c127fc..9be0fb9ae8 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_byte2.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_byte2.c
@@ -41,7 +41,9 @@ const mbfl_encoding mbfl_encoding_byte2be = {
NULL,
NULL,
NULL,
- MBFL_ENCTYPE_SBCS
+ MBFL_ENCTYPE_SBCS,
+ &vtbl_byte2be_wchar,
+ &vtbl_wchar_byte2be
};
const mbfl_encoding mbfl_encoding_byte2le = {
@@ -50,7 +52,9 @@ const mbfl_encoding mbfl_encoding_byte2le = {
NULL,
NULL,
NULL,
- MBFL_ENCTYPE_SBCS
+ MBFL_ENCTYPE_SBCS,
+ &vtbl_byte2le_wchar,
+ &vtbl_wchar_byte2le
};
const struct mbfl_convert_vtbl vtbl_byte2be_wchar = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_byte4.c b/ext/mbstring/libmbfl/filters/mbfilter_byte4.c
index 7475e5424c..46ca04bb71 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_byte4.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_byte4.c
@@ -41,7 +41,9 @@ const mbfl_encoding mbfl_encoding_byte4be = {
NULL,
NULL,
NULL,
- MBFL_ENCTYPE_SBCS
+ MBFL_ENCTYPE_SBCS,
+ &vtbl_byte4be_wchar,
+ &vtbl_wchar_byte4be
};
const mbfl_encoding mbfl_encoding_byte4le = {
@@ -50,7 +52,9 @@ const mbfl_encoding mbfl_encoding_byte4le = {
NULL,
NULL,
NULL,
- MBFL_ENCTYPE_SBCS
+ MBFL_ENCTYPE_SBCS,
+ &vtbl_byte4le_wchar,
+ &vtbl_wchar_byte4le
};
const struct mbfl_convert_vtbl vtbl_byte4be_wchar = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_cp1251.c b/ext/mbstring/libmbfl/filters/mbfilter_cp1251.c
index a26ce19492..532806fafc 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_cp1251.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_cp1251.c
@@ -45,7 +45,9 @@ const mbfl_encoding mbfl_encoding_cp1251 = {
"Windows-1251",
(const char *(*)[])&mbfl_encoding_cp1251_aliases,
NULL,
- MBFL_ENCTYPE_SBCS
+ MBFL_ENCTYPE_SBCS,
+ &vtbl_cp1251_wchar,
+ &vtbl_wchar_cp1251
};
const struct mbfl_identify_vtbl vtbl_identify_cp1251 = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_cp1252.c b/ext/mbstring/libmbfl/filters/mbfilter_cp1252.c
index 0c5eba3dd5..6479023428 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_cp1252.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_cp1252.c
@@ -45,7 +45,9 @@ const mbfl_encoding mbfl_encoding_cp1252 = {
"Windows-1252",
(const char *(*)[])&mbfl_encoding_cp1252_aliases,
NULL,
- MBFL_ENCTYPE_SBCS
+ MBFL_ENCTYPE_SBCS,
+ &vtbl_cp1252_wchar,
+ &vtbl_wchar_cp1252
};
const struct mbfl_identify_vtbl vtbl_identify_cp1252 = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_cp1254.c b/ext/mbstring/libmbfl/filters/mbfilter_cp1254.c
index 78e79335e4..b01b19fb06 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_cp1254.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_cp1254.c
@@ -45,7 +45,9 @@ const mbfl_encoding mbfl_encoding_cp1254 = {
"Windows-1254",
(const char *(*)[])&mbfl_encoding_cp1254_aliases,
NULL,
- MBFL_ENCTYPE_SBCS
+ MBFL_ENCTYPE_SBCS,
+ &vtbl_cp1254_wchar,
+ &vtbl_wchar_cp1254
};
const struct mbfl_identify_vtbl vtbl_identify_cp1254 = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_cp5022x.c b/ext/mbstring/libmbfl/filters/mbfilter_cp5022x.c
index 75d249fbe8..81b655d55f 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_cp5022x.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_cp5022x.c
@@ -54,7 +54,9 @@ const mbfl_encoding mbfl_encoding_jis_ms = {
"ISO-2022-JP",
NULL,
NULL,
- MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE | MBFL_ENCTYPE_GL_UNSAFE
+ MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE | MBFL_ENCTYPE_GL_UNSAFE,
+ &vtbl_jis_ms_wchar,
+ &vtbl_wchar_jis_ms
};
const mbfl_encoding mbfl_encoding_cp50220 = {
@@ -63,7 +65,9 @@ const mbfl_encoding mbfl_encoding_cp50220 = {
"ISO-2022-JP",
(const char *(*)[])NULL,
NULL,
- MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE | MBFL_ENCTYPE_GL_UNSAFE
+ MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE | MBFL_ENCTYPE_GL_UNSAFE,
+ &vtbl_cp50220_wchar,
+ &vtbl_wchar_cp50220
};
const mbfl_encoding mbfl_encoding_cp50220raw = {
@@ -72,7 +76,9 @@ const mbfl_encoding mbfl_encoding_cp50220raw = {
"ISO-2022-JP",
(const char *(*)[])NULL,
NULL,
- MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE | MBFL_ENCTYPE_GL_UNSAFE
+ MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE | MBFL_ENCTYPE_GL_UNSAFE,
+ &vtbl_cp50220raw_wchar,
+ &vtbl_wchar_cp50220raw
};
const mbfl_encoding mbfl_encoding_cp50221 = {
@@ -81,7 +87,9 @@ const mbfl_encoding mbfl_encoding_cp50221 = {
"ISO-2022-JP",
NULL,
NULL,
- MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE | MBFL_ENCTYPE_GL_UNSAFE
+ MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE | MBFL_ENCTYPE_GL_UNSAFE,
+ &vtbl_cp50221_wchar,
+ &vtbl_wchar_cp50221
};
const mbfl_encoding mbfl_encoding_cp50222 = {
@@ -90,7 +98,9 @@ const mbfl_encoding mbfl_encoding_cp50222 = {
"ISO-2022-JP",
NULL,
NULL,
- MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE | MBFL_ENCTYPE_GL_UNSAFE
+ MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE | MBFL_ENCTYPE_GL_UNSAFE,
+ &vtbl_cp50222_wchar,
+ &vtbl_wchar_cp50222
};
const struct mbfl_identify_vtbl vtbl_identify_jis_ms = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_cp51932.c b/ext/mbstring/libmbfl/filters/mbfilter_cp51932.c
index aae45380c8..057d6c6f91 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_cp51932.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_cp51932.c
@@ -75,7 +75,9 @@ const mbfl_encoding mbfl_encoding_cp51932 = {
"CP51932",
(const char *(*)[])&mbfl_encoding_cp51932_aliases,
mblen_table_eucjp,
- MBFL_ENCTYPE_MBCS
+ MBFL_ENCTYPE_MBCS,
+ &vtbl_cp51932_wchar,
+ &vtbl_wchar_cp51932
};
const struct mbfl_convert_vtbl vtbl_cp51932_wchar = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_cp850.c b/ext/mbstring/libmbfl/filters/mbfilter_cp850.c
index 179873eb3a..25ec247c78 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_cp850.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_cp850.c
@@ -41,7 +41,9 @@ const mbfl_encoding mbfl_encoding_cp850 = {
"CP850",
(const char *(*)[])&mbfl_encoding_cp850_aliases,
NULL,
- MBFL_ENCTYPE_SBCS
+ MBFL_ENCTYPE_SBCS,
+ &vtbl_cp850_wchar,
+ &vtbl_wchar_cp850
};
const struct mbfl_identify_vtbl vtbl_identify_cp850 = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_cp866.c b/ext/mbstring/libmbfl/filters/mbfilter_cp866.c
index 307f370d03..95b681243b 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_cp866.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_cp866.c
@@ -45,7 +45,9 @@ const mbfl_encoding mbfl_encoding_cp866 = {
"CP866",
(const char *(*)[])&mbfl_encoding_cp866_aliases,
NULL,
- MBFL_ENCTYPE_SBCS
+ MBFL_ENCTYPE_SBCS,
+ &vtbl_cp866_wchar,
+ &vtbl_wchar_cp866
};
const struct mbfl_identify_vtbl vtbl_identify_cp866 = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_cp932.c b/ext/mbstring/libmbfl/filters/mbfilter_cp932.c
index 4063a68208..e6cbd5fc43 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_cp932.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_cp932.c
@@ -66,7 +66,9 @@ const mbfl_encoding mbfl_encoding_cp932 = {
"Shift_JIS",
(const char *(*)[])&mbfl_encoding_cp932_aliases,
mblen_table_sjis,
- MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE
+ MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE,
+ &vtbl_cp932_wchar,
+ &vtbl_wchar_cp932
};
const struct mbfl_identify_vtbl vtbl_identify_cp932 = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_cp936.c b/ext/mbstring/libmbfl/filters/mbfilter_cp936.c
index 23e3a1d847..047eb62a14 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_cp936.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_cp936.c
@@ -65,7 +65,9 @@ const mbfl_encoding mbfl_encoding_cp936 = {
"CP936",
(const char *(*)[])&mbfl_encoding_cp936_aliases,
mblen_table_cp936,
- MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE
+ MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE,
+ &vtbl_cp936_wchar,
+ &vtbl_wchar_cp936
};
const struct mbfl_identify_vtbl vtbl_identify_cp936 = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_euc_cn.c b/ext/mbstring/libmbfl/filters/mbfilter_euc_cn.c
index bf3ec25ee7..7fd3d7c315 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_euc_cn.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_euc_cn.c
@@ -65,7 +65,9 @@ const mbfl_encoding mbfl_encoding_euc_cn = {
"CN-GB",
(const char *(*)[])&mbfl_encoding_euc_cn_aliases,
mblen_table_euccn,
- MBFL_ENCTYPE_MBCS
+ MBFL_ENCTYPE_MBCS,
+ &vtbl_euccn_wchar,
+ &vtbl_wchar_euccn
};
const struct mbfl_identify_vtbl vtbl_identify_euccn = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_euc_jp.c b/ext/mbstring/libmbfl/filters/mbfilter_euc_jp.c
index 3b13850882..ba794934b0 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_euc_jp.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_euc_jp.c
@@ -66,7 +66,9 @@ const mbfl_encoding mbfl_encoding_euc_jp = {
"EUC-JP",
(const char *(*)[])&mbfl_encoding_euc_jp_aliases,
mblen_table_eucjp,
- MBFL_ENCTYPE_MBCS
+ MBFL_ENCTYPE_MBCS,
+ &vtbl_eucjp_wchar,
+ &vtbl_wchar_eucjp
};
const struct mbfl_identify_vtbl vtbl_identify_eucjp = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_2004.c b/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_2004.c
index aeb94c388d..2fe24e0f57 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_2004.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_2004.c
@@ -48,7 +48,9 @@ const mbfl_encoding mbfl_encoding_eucjp2004 = {
"EUC-JP",
(const char *(*)[])&mbfl_encoding_eucjp2004_aliases,
mblen_table_eucjp,
- MBFL_ENCTYPE_MBCS
+ MBFL_ENCTYPE_MBCS,
+ &vtbl_eucjp2004_wchar,
+ &vtbl_wchar_eucjp2004
};
const struct mbfl_identify_vtbl vtbl_identify_eucjp2004 = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c b/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c
index 95aec45f4d..912ae73504 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_euc_jp_win.c
@@ -76,7 +76,9 @@ const mbfl_encoding mbfl_encoding_eucjp_win = {
"EUC-JP",
(const char *(*)[])&mbfl_encoding_eucjp_win_aliases,
mblen_table_eucjp,
- MBFL_ENCTYPE_MBCS
+ MBFL_ENCTYPE_MBCS,
+ &vtbl_eucjpwin_wchar,
+ &vtbl_wchar_eucjpwin
};
const struct mbfl_convert_vtbl vtbl_eucjpwin_wchar = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_euc_kr.c b/ext/mbstring/libmbfl/filters/mbfilter_euc_kr.c
index 2a537ade6e..ee8dc926f0 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_euc_kr.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_euc_kr.c
@@ -64,7 +64,9 @@ const mbfl_encoding mbfl_encoding_euc_kr = {
"EUC-KR",
(const char *(*)[])&mbfl_encoding_euc_kr_aliases,
mblen_table_euckr,
- MBFL_ENCTYPE_MBCS
+ MBFL_ENCTYPE_MBCS,
+ &vtbl_euckr_wchar,
+ &vtbl_wchar_euckr
};
const struct mbfl_identify_vtbl vtbl_identify_euckr = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_gb18030.c b/ext/mbstring/libmbfl/filters/mbfilter_gb18030.c
index 721c16292b..b7687b6c31 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_gb18030.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_gb18030.c
@@ -47,7 +47,9 @@ const mbfl_encoding mbfl_encoding_gb18030 = {
"GB18030",
(const char *(*)[])&mbfl_encoding_gb18030_aliases,
NULL,
- MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE
+ MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE,
+ &vtbl_gb18030_wchar,
+ &vtbl_wchar_gb18030
};
const struct mbfl_identify_vtbl vtbl_identify_gb18030 = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_htmlent.c b/ext/mbstring/libmbfl/filters/mbfilter_htmlent.c
index 03b26cc0b7..12ff178b61 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_htmlent.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_htmlent.c
@@ -70,7 +70,9 @@ const mbfl_encoding mbfl_encoding_html_ent = {
"HTML-ENTITIES",
(const char *(*)[])&mbfl_encoding_html_ent_aliases,
NULL,
- MBFL_ENCTYPE_ENC_STRM | MBFL_ENCTYPE_GL_UNSAFE
+ MBFL_ENCTYPE_ENC_STRM | MBFL_ENCTYPE_GL_UNSAFE,
+ &vtbl_html_wchar,
+ &vtbl_wchar_html
};
const struct mbfl_convert_vtbl vtbl_wchar_html = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_hz.c b/ext/mbstring/libmbfl/filters/mbfilter_hz.c
index a3422cd8e5..8a39b75e17 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_hz.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_hz.c
@@ -44,7 +44,9 @@ const mbfl_encoding mbfl_encoding_hz = {
"HZ-GB-2312",
NULL,
NULL,
- MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE | MBFL_ENCTYPE_GL_UNSAFE
+ MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE | MBFL_ENCTYPE_GL_UNSAFE,
+ &vtbl_hz_wchar,
+ &vtbl_wchar_hz
};
const struct mbfl_identify_vtbl vtbl_identify_hz = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso2022_jp_ms.c b/ext/mbstring/libmbfl/filters/mbfilter_iso2022_jp_ms.c
index 1f26d1771b..4e8b974923 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_iso2022_jp_ms.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_iso2022_jp_ms.c
@@ -48,7 +48,9 @@ const mbfl_encoding mbfl_encoding_2022jpms = {
"ISO-2022-JP",
(const char *(*)[])&mbfl_encoding_2022jpms_aliases,
NULL,
- MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE | MBFL_ENCTYPE_GL_UNSAFE
+ MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE | MBFL_ENCTYPE_GL_UNSAFE,
+ &vtbl_2022jpms_wchar,
+ &vtbl_wchar_2022jpms
};
const struct mbfl_identify_vtbl vtbl_identify_2022jpms = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso2022_kr.c b/ext/mbstring/libmbfl/filters/mbfilter_iso2022_kr.c
index 501bcb8d19..c1fe9f1222 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_iso2022_kr.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_iso2022_kr.c
@@ -43,7 +43,9 @@ const mbfl_encoding mbfl_encoding_2022kr = {
"ISO-2022-KR",
NULL,
NULL,
- MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE | MBFL_ENCTYPE_GL_UNSAFE
+ MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE | MBFL_ENCTYPE_GL_UNSAFE,
+ &vtbl_2022kr_wchar,
+ &vtbl_wchar_2022kr
};
const struct mbfl_identify_vtbl vtbl_identify_2022kr = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_2004.c b/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_2004.c
index fc6678ecb6..17355bf87b 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_2004.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_2004.c
@@ -47,7 +47,9 @@ const mbfl_encoding mbfl_encoding_2022jp_2004 = {
"ISO-2022-JP-2004",
NULL,
NULL,
- MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE | MBFL_ENCTYPE_GL_UNSAFE
+ MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE | MBFL_ENCTYPE_GL_UNSAFE,
+ &vtbl_2022jp_2004_wchar,
+ &vtbl_wchar_2022jp_2004
};
const struct mbfl_identify_vtbl vtbl_identify_2022jp_2004 = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.c b/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.c
index e0d5543882..3847f78aa1 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_iso2022jp_mobile.c
@@ -50,7 +50,9 @@ const mbfl_encoding mbfl_encoding_2022jp_kddi = {
"ISO-2022-JP",
&mbfl_encoding_2022jp_kddi_aliases,
NULL,
- MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE | MBFL_ENCTYPE_GL_UNSAFE
+ MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE | MBFL_ENCTYPE_GL_UNSAFE,
+ &vtbl_2022jp_kddi_wchar,
+ &vtbl_wchar_2022jp_kddi
};
const struct mbfl_identify_vtbl vtbl_identify_2022jp_kddi = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_1.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_1.c
index 382d0c2294..239d74e381 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_1.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_1.c
@@ -42,7 +42,9 @@ const mbfl_encoding mbfl_encoding_8859_1 = {
"ISO-8859-1",
(const char *(*)[])&mbfl_encoding_8859_1_aliases,
NULL,
- MBFL_ENCTYPE_SBCS
+ MBFL_ENCTYPE_SBCS,
+ &vtbl_8859_1_wchar,
+ &vtbl_wchar_8859_1
};
const struct mbfl_identify_vtbl vtbl_identify_8859_1 = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_10.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_10.c
index f6d1b21b55..0fb6bc88cb 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_10.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_10.c
@@ -43,7 +43,9 @@ const mbfl_encoding mbfl_encoding_8859_10 = {
"ISO-8859-10",
(const char *(*)[])&mbfl_encoding_8859_10_aliases,
NULL,
- MBFL_ENCTYPE_SBCS
+ MBFL_ENCTYPE_SBCS,
+ &vtbl_8859_10_wchar,
+ &vtbl_wchar_8859_10
};
const struct mbfl_identify_vtbl vtbl_identify_8859_10 = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_13.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_13.c
index cbc8f77d87..2b2494baa5 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_13.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_13.c
@@ -43,7 +43,9 @@ const mbfl_encoding mbfl_encoding_8859_13 = {
"ISO-8859-13",
(const char *(*)[])&mbfl_encoding_8859_13_aliases,
NULL,
- MBFL_ENCTYPE_SBCS
+ MBFL_ENCTYPE_SBCS,
+ &vtbl_8859_13_wchar,
+ &vtbl_wchar_8859_13
};
const struct mbfl_identify_vtbl vtbl_identify_8859_13 = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_14.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_14.c
index 03581ccf45..eb008b8f04 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_14.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_14.c
@@ -43,7 +43,9 @@ const mbfl_encoding mbfl_encoding_8859_14 = {
"ISO-8859-14",
(const char *(*)[])&mbfl_encoding_8859_14_aliases,
NULL,
- MBFL_ENCTYPE_SBCS
+ MBFL_ENCTYPE_SBCS,
+ &vtbl_8859_14_wchar,
+ &vtbl_wchar_8859_14
};
const struct mbfl_identify_vtbl vtbl_identify_8859_14 = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_15.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_15.c
index 25323bd7f0..74e5a2dde7 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_15.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_15.c
@@ -43,7 +43,9 @@ const mbfl_encoding mbfl_encoding_8859_15 = {
"ISO-8859-15",
(const char *(*)[])&mbfl_encoding_8859_15_aliases,
NULL,
- MBFL_ENCTYPE_SBCS
+ MBFL_ENCTYPE_SBCS,
+ &vtbl_8859_15_wchar,
+ &vtbl_wchar_8859_15
};
const struct mbfl_identify_vtbl vtbl_identify_8859_15 = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_16.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_16.c
index 1bd5f8a25d..68da24f533 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_16.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_16.c
@@ -43,7 +43,9 @@ const mbfl_encoding mbfl_encoding_8859_16 = {
"ISO-8859-16",
(const char *(*)[])&mbfl_encoding_8859_16_aliases,
NULL,
- MBFL_ENCTYPE_SBCS
+ MBFL_ENCTYPE_SBCS,
+ &vtbl_8859_16_wchar,
+ &vtbl_wchar_8859_16
};
const struct mbfl_identify_vtbl vtbl_identify_8859_16 = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_2.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_2.c
index 50649ddeb6..ec1b2bc172 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_2.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_2.c
@@ -43,7 +43,9 @@ const mbfl_encoding mbfl_encoding_8859_2 = {
"ISO-8859-2",
(const char *(*)[])&mbfl_encoding_8859_2_aliases,
NULL,
- MBFL_ENCTYPE_SBCS
+ MBFL_ENCTYPE_SBCS,
+ &vtbl_8859_2_wchar,
+ &vtbl_wchar_8859_2
};
const struct mbfl_identify_vtbl vtbl_identify_8859_2 = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_3.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_3.c
index e1897069eb..f3905ac46e 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_3.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_3.c
@@ -43,7 +43,9 @@ const mbfl_encoding mbfl_encoding_8859_3 = {
"ISO-8859-3",
(const char *(*)[])&mbfl_encoding_8859_3_aliases,
NULL,
- MBFL_ENCTYPE_SBCS
+ MBFL_ENCTYPE_SBCS,
+ &vtbl_8859_3_wchar,
+ &vtbl_wchar_8859_3
};
const struct mbfl_identify_vtbl vtbl_identify_8859_3 = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_4.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_4.c
index a04910eb78..19e105a6b8 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_4.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_4.c
@@ -43,7 +43,9 @@ const mbfl_encoding mbfl_encoding_8859_4 = {
"ISO-8859-4",
(const char *(*)[])&mbfl_encoding_8859_4_aliases,
NULL,
- MBFL_ENCTYPE_SBCS
+ MBFL_ENCTYPE_SBCS,
+ &vtbl_8859_4_wchar,
+ &vtbl_wchar_8859_4
};
const struct mbfl_identify_vtbl vtbl_identify_8859_4 = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_5.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_5.c
index 0bd4d5e155..ac3b2d2089 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_5.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_5.c
@@ -43,7 +43,9 @@ const mbfl_encoding mbfl_encoding_8859_5 = {
"ISO-8859-5",
(const char *(*)[])&mbfl_encoding_8859_5_aliases,
NULL,
- MBFL_ENCTYPE_SBCS
+ MBFL_ENCTYPE_SBCS,
+ &vtbl_8859_5_wchar,
+ &vtbl_wchar_8859_5
};
const struct mbfl_identify_vtbl vtbl_identify_8859_5 = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_6.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_6.c
index df89eb75ba..c5bbdd7eec 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_6.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_6.c
@@ -43,7 +43,9 @@ const mbfl_encoding mbfl_encoding_8859_6 = {
"ISO-8859-6",
(const char *(*)[])&mbfl_encoding_8859_6_aliases,
NULL,
- MBFL_ENCTYPE_SBCS
+ MBFL_ENCTYPE_SBCS,
+ &vtbl_8859_6_wchar,
+ &vtbl_wchar_8859_6
};
const struct mbfl_identify_vtbl vtbl_identify_8859_6 = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_7.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_7.c
index d8d4494a22..98ffade2e7 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_7.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_7.c
@@ -43,7 +43,9 @@ const mbfl_encoding mbfl_encoding_8859_7 = {
"ISO-8859-7",
(const char *(*)[])&mbfl_encoding_8859_7_aliases,
NULL,
- MBFL_ENCTYPE_SBCS
+ MBFL_ENCTYPE_SBCS,
+ &vtbl_8859_7_wchar,
+ &vtbl_wchar_8859_7
};
const struct mbfl_identify_vtbl vtbl_identify_8859_7 = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_8.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_8.c
index fad0f5c51e..3d65ce630a 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_8.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_8.c
@@ -43,7 +43,9 @@ const mbfl_encoding mbfl_encoding_8859_8 = {
"ISO-8859-8",
(const char *(*)[])&mbfl_encoding_8859_8_aliases,
NULL,
- MBFL_ENCTYPE_SBCS
+ MBFL_ENCTYPE_SBCS,
+ &vtbl_8859_8_wchar,
+ &vtbl_wchar_8859_8
};
const struct mbfl_identify_vtbl vtbl_identify_8859_8 = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_9.c b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_9.c
index 97948d0ff6..8a730ae43e 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_iso8859_9.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_iso8859_9.c
@@ -43,7 +43,9 @@ const mbfl_encoding mbfl_encoding_8859_9 = {
"ISO-8859-9",
(const char *(*)[])&mbfl_encoding_8859_9_aliases,
NULL,
- MBFL_ENCTYPE_SBCS
+ MBFL_ENCTYPE_SBCS,
+ &vtbl_8859_9_wchar,
+ &vtbl_wchar_8859_9
};
const struct mbfl_identify_vtbl vtbl_identify_8859_9 = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_jis.c b/ext/mbstring/libmbfl/filters/mbfilter_jis.c
index b3fbb4f94b..88395cb09e 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_jis.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_jis.c
@@ -46,7 +46,9 @@ const mbfl_encoding mbfl_encoding_jis = {
"ISO-2022-JP",
NULL,
NULL,
- MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE | MBFL_ENCTYPE_GL_UNSAFE
+ MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE | MBFL_ENCTYPE_GL_UNSAFE,
+ &vtbl_jis_wchar,
+ &vtbl_wchar_jis
};
const mbfl_encoding mbfl_encoding_2022jp = {
@@ -55,7 +57,9 @@ const mbfl_encoding mbfl_encoding_2022jp = {
"ISO-2022-JP",
NULL,
NULL,
- MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE | MBFL_ENCTYPE_GL_UNSAFE
+ MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE | MBFL_ENCTYPE_GL_UNSAFE,
+ &vtbl_2022jp_wchar,
+ &vtbl_wchar_2022jp
};
const struct mbfl_identify_vtbl vtbl_identify_jis = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_koi8r.c b/ext/mbstring/libmbfl/filters/mbfilter_koi8r.c
index e35a0258ac..101b3f1c85 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_koi8r.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_koi8r.c
@@ -45,7 +45,9 @@ const mbfl_encoding mbfl_encoding_koi8r = {
"KOI8-R",
(const char *(*)[])&mbfl_encoding_koi8r_aliases,
NULL,
- MBFL_ENCTYPE_SBCS
+ MBFL_ENCTYPE_SBCS,
+ &vtbl_koi8r_wchar,
+ &vtbl_wchar_koi8r
};
const struct mbfl_identify_vtbl vtbl_identify_koi8r = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_koi8u.c b/ext/mbstring/libmbfl/filters/mbfilter_koi8u.c
index 4dfc68654a..25174326f7 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_koi8u.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_koi8u.c
@@ -42,7 +42,9 @@ const mbfl_encoding mbfl_encoding_koi8u = {
"KOI8-U",
(const char *(*)[])&mbfl_encoding_koi8u_aliases,
NULL,
- MBFL_ENCTYPE_SBCS
+ MBFL_ENCTYPE_SBCS,
+ &vtbl_koi8u_wchar,
+ &vtbl_wchar_koi8u
};
const struct mbfl_identify_vtbl vtbl_identify_koi8u = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_qprint.c b/ext/mbstring/libmbfl/filters/mbfilter_qprint.c
index c141dc4102..b72724f4f1 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_qprint.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_qprint.c
@@ -43,7 +43,9 @@ const mbfl_encoding mbfl_encoding_qprint = {
"Quoted-Printable",
(const char *(*)[])&mbfl_encoding_qprint_aliases,
NULL,
- MBFL_ENCTYPE_ENC_STRM | MBFL_ENCTYPE_GL_UNSAFE
+ MBFL_ENCTYPE_ENC_STRM | MBFL_ENCTYPE_GL_UNSAFE,
+ NULL,
+ NULL
};
const struct mbfl_convert_vtbl vtbl_8bit_qprint = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_sjis.c b/ext/mbstring/libmbfl/filters/mbfilter_sjis.c
index 782e0dfaf9..33b1e1f6fe 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_sjis.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_sjis.c
@@ -69,7 +69,9 @@ const mbfl_encoding mbfl_encoding_sjis = {
"Shift_JIS",
(const char *(*)[])&mbfl_encoding_sjis_aliases,
mblen_table_sjis,
- MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE
+ MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE,
+ &vtbl_sjis_wchar,
+ &vtbl_wchar_sjis
};
const struct mbfl_identify_vtbl vtbl_identify_sjis = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c b/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c
index 4f146cebea..dd37bbabba 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_sjis_2004.c
@@ -53,7 +53,9 @@ const mbfl_encoding mbfl_encoding_sjis2004 = {
"Shift_JIS",
(const char *(*)[])&mbfl_encoding_sjis2004_aliases,
mblen_table_sjis,
- MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE
+ MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE,
+ &vtbl_sjis2004_wchar,
+ &vtbl_wchar_sjis2004
};
const struct mbfl_identify_vtbl vtbl_identify_sjis2004 = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c b/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c
index 2087786c06..ff08cf3dae 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_sjis_mac.c
@@ -52,7 +52,9 @@ const mbfl_encoding mbfl_encoding_sjis_mac = {
"Shift_JIS",
(const char *(*)[])&mbfl_encoding_sjis_mac_aliases,
mblen_table_sjis,
- MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE
+ MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE,
+ &vtbl_sjis_mac_wchar,
+ &vtbl_wchar_sjis_mac
};
const struct mbfl_identify_vtbl vtbl_identify_sjis_mac = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c b/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c
index a856aa3d46..ca3d437dfa 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_sjis_mobile.c
@@ -54,7 +54,9 @@ const mbfl_encoding mbfl_encoding_sjis_docomo = {
"Shift_JIS",
(const char *(*)[])&mbfl_encoding_sjis_docomo_aliases,
mblen_table_sjis,
- MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE
+ MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE,
+ &vtbl_sjis_docomo_wchar,
+ &vtbl_wchar_sjis_docomo
};
const mbfl_encoding mbfl_encoding_sjis_kddi = {
@@ -63,7 +65,9 @@ const mbfl_encoding mbfl_encoding_sjis_kddi = {
"Shift_JIS",
(const char *(*)[])&mbfl_encoding_sjis_kddi_aliases,
mblen_table_sjis,
- MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE
+ MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE,
+ &vtbl_sjis_kddi_wchar,
+ &vtbl_wchar_sjis_kddi
};
const mbfl_encoding mbfl_encoding_sjis_sb = {
@@ -72,7 +76,9 @@ const mbfl_encoding mbfl_encoding_sjis_sb = {
"Shift_JIS",
(const char *(*)[])&mbfl_encoding_sjis_sb_aliases,
mblen_table_sjis,
- MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE
+ MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE,
+ &vtbl_sjis_sb_wchar,
+ &vtbl_wchar_sjis_sb
};
const struct mbfl_identify_vtbl vtbl_identify_sjis_docomo = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_sjis_open.c b/ext/mbstring/libmbfl/filters/mbfilter_sjis_open.c
index 265c577e5f..17e78793d8 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_sjis_open.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_sjis_open.c
@@ -66,7 +66,9 @@ const mbfl_encoding mbfl_encoding_sjis_open = {
"Shift_JIS",
(const char *(*)[])&mbfl_encoding_sjis_open_aliases,
mblen_table_sjis,
- MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE
+ MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_GL_UNSAFE,
+ &vtbl_sjis_open_wchar,
+ &vtbl_wchar_sjis_open
};
const struct mbfl_identify_vtbl vtbl_identify_sjis_open = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_ucs2.c b/ext/mbstring/libmbfl/filters/mbfilter_ucs2.c
index 32f174f602..08cbf6ddb1 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_ucs2.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_ucs2.c
@@ -42,7 +42,9 @@ const mbfl_encoding mbfl_encoding_ucs2 = {
"UCS-2",
(const char *(*)[])&mbfl_encoding_ucs2_aliases,
NULL,
- MBFL_ENCTYPE_WCS2BE
+ MBFL_ENCTYPE_WCS2BE,
+ &vtbl_ucs2_wchar,
+ &vtbl_wchar_ucs2
};
const mbfl_encoding mbfl_encoding_ucs2be = {
@@ -51,7 +53,9 @@ const mbfl_encoding mbfl_encoding_ucs2be = {
"UCS-2BE",
NULL,
NULL,
- MBFL_ENCTYPE_WCS2BE
+ MBFL_ENCTYPE_WCS2BE,
+ &vtbl_ucs2be_wchar,
+ &vtbl_wchar_ucs2be
};
const mbfl_encoding mbfl_encoding_ucs2le = {
@@ -60,7 +64,9 @@ const mbfl_encoding mbfl_encoding_ucs2le = {
"UCS-2LE",
NULL,
NULL,
- MBFL_ENCTYPE_WCS2LE
+ MBFL_ENCTYPE_WCS2LE,
+ &vtbl_ucs2le_wchar,
+ &vtbl_wchar_ucs2le
};
const struct mbfl_convert_vtbl vtbl_ucs2_wchar = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_ucs4.c b/ext/mbstring/libmbfl/filters/mbfilter_ucs4.c
index 8906b8ff09..011c93fcda 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_ucs4.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_ucs4.c
@@ -42,7 +42,9 @@ const mbfl_encoding mbfl_encoding_ucs4 = {
"UCS-4",
(const char *(*)[])&mbfl_encoding_ucs4_aliases,
NULL,
- MBFL_ENCTYPE_WCS4BE
+ MBFL_ENCTYPE_WCS4BE,
+ &vtbl_ucs4_wchar,
+ &vtbl_wchar_ucs4
};
const mbfl_encoding mbfl_encoding_ucs4be = {
@@ -51,7 +53,9 @@ const mbfl_encoding mbfl_encoding_ucs4be = {
"UCS-4BE",
NULL,
NULL,
- MBFL_ENCTYPE_WCS4BE
+ MBFL_ENCTYPE_WCS4BE,
+ &vtbl_ucs4be_wchar,
+ &vtbl_wchar_ucs4be
};
const mbfl_encoding mbfl_encoding_ucs4le = {
@@ -60,7 +64,9 @@ const mbfl_encoding mbfl_encoding_ucs4le = {
"UCS-4LE",
NULL,
NULL,
- MBFL_ENCTYPE_WCS4LE
+ MBFL_ENCTYPE_WCS4LE,
+ &vtbl_ucs4le_wchar,
+ &vtbl_wchar_ucs4le
};
const struct mbfl_convert_vtbl vtbl_ucs4_wchar = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_uhc.c b/ext/mbstring/libmbfl/filters/mbfilter_uhc.c
index 2e1c696f8a..1603793e6a 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_uhc.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_uhc.c
@@ -65,7 +65,9 @@ const mbfl_encoding mbfl_encoding_uhc = {
"UHC",
(const char *(*)[])&mbfl_encoding_uhc_aliases,
mblen_table_uhc,
- MBFL_ENCTYPE_MBCS
+ MBFL_ENCTYPE_MBCS,
+ &vtbl_uhc_wchar,
+ &vtbl_wchar_uhc
};
const struct mbfl_identify_vtbl vtbl_identify_uhc = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_utf16.c b/ext/mbstring/libmbfl/filters/mbfilter_utf16.c
index 3e008e8035..a4864cd3ac 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_utf16.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_utf16.c
@@ -42,7 +42,9 @@ const mbfl_encoding mbfl_encoding_utf16 = {
"UTF-16",
(const char *(*)[])&mbfl_encoding_utf16_aliases,
NULL,
- MBFL_ENCTYPE_MWC2BE
+ MBFL_ENCTYPE_MWC2BE,
+ &vtbl_utf16_wchar,
+ &vtbl_wchar_utf16
};
const mbfl_encoding mbfl_encoding_utf16be = {
@@ -51,7 +53,9 @@ const mbfl_encoding mbfl_encoding_utf16be = {
"UTF-16BE",
NULL,
NULL,
- MBFL_ENCTYPE_MWC2BE
+ MBFL_ENCTYPE_MWC2BE,
+ &vtbl_utf16be_wchar,
+ &vtbl_wchar_utf16be
};
const mbfl_encoding mbfl_encoding_utf16le = {
@@ -60,7 +64,9 @@ const mbfl_encoding mbfl_encoding_utf16le = {
"UTF-16LE",
NULL,
NULL,
- MBFL_ENCTYPE_MWC2LE
+ MBFL_ENCTYPE_MWC2LE,
+ &vtbl_utf16le_wchar,
+ &vtbl_wchar_utf16le
};
const struct mbfl_convert_vtbl vtbl_utf16_wchar = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_utf32.c b/ext/mbstring/libmbfl/filters/mbfilter_utf32.c
index 852bca2002..5b02362b5d 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_utf32.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_utf32.c
@@ -42,7 +42,9 @@ const mbfl_encoding mbfl_encoding_utf32 = {
"UTF-32",
(const char *(*)[])&mbfl_encoding_utf32_aliases,
NULL,
- MBFL_ENCTYPE_WCS4BE
+ MBFL_ENCTYPE_WCS4BE,
+ &vtbl_utf32_wchar,
+ &vtbl_wchar_utf32
};
const mbfl_encoding mbfl_encoding_utf32be = {
@@ -51,7 +53,9 @@ const mbfl_encoding mbfl_encoding_utf32be = {
"UTF-32BE",
NULL,
NULL,
- MBFL_ENCTYPE_WCS4BE
+ MBFL_ENCTYPE_WCS4BE,
+ &vtbl_utf32be_wchar,
+ &vtbl_wchar_utf32be
};
const mbfl_encoding mbfl_encoding_utf32le = {
@@ -60,7 +64,9 @@ const mbfl_encoding mbfl_encoding_utf32le = {
"UTF-32LE",
NULL,
NULL,
- MBFL_ENCTYPE_WCS4LE
+ MBFL_ENCTYPE_WCS4LE,
+ &vtbl_utf32le_wchar,
+ &vtbl_wchar_utf32le
};
const struct mbfl_convert_vtbl vtbl_utf32_wchar = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_utf7.c b/ext/mbstring/libmbfl/filters/mbfilter_utf7.c
index db0979c25d..f31da86b6c 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_utf7.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_utf7.c
@@ -57,7 +57,9 @@ const mbfl_encoding mbfl_encoding_utf7 = {
"UTF-7",
(const char *(*)[])&mbfl_encoding_utf7_aliases,
NULL,
- MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE | MBFL_ENCTYPE_GL_UNSAFE
+ MBFL_ENCTYPE_MBCS | MBFL_ENCTYPE_SHFTCODE | MBFL_ENCTYPE_GL_UNSAFE,
+ &vtbl_utf7_wchar,
+ &vtbl_wchar_utf7
};
const struct mbfl_identify_vtbl vtbl_identify_utf7 = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_utf8.c b/ext/mbstring/libmbfl/filters/mbfilter_utf8.c
index e81e0860d2..1e2ad5b959 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_utf8.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_utf8.c
@@ -63,7 +63,9 @@ const mbfl_encoding mbfl_encoding_utf8 = {
"UTF-8",
(const char *(*)[])&mbfl_encoding_utf8_aliases,
mblen_table_utf8,
- MBFL_ENCTYPE_MBCS
+ MBFL_ENCTYPE_MBCS,
+ &vtbl_utf8_wchar,
+ &vtbl_wchar_utf8
};
const struct mbfl_identify_vtbl vtbl_identify_utf8 = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c b/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c
index 41e02bf314..7132d9ccd6 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_utf8_mobile.c
@@ -52,7 +52,9 @@ const mbfl_encoding mbfl_encoding_utf8_docomo = {
"UTF-8",
(const char *(*)[])&mbfl_encoding_utf8_docomo_aliases,
mblen_table_utf8,
- MBFL_ENCTYPE_MBCS
+ MBFL_ENCTYPE_MBCS,
+ &vtbl_utf8_docomo_wchar,
+ &vtbl_wchar_utf8_docomo
};
const mbfl_encoding mbfl_encoding_utf8_kddi_a = {
@@ -61,7 +63,9 @@ const mbfl_encoding mbfl_encoding_utf8_kddi_a = {
"UTF-8",
(const char *(*)[])&mbfl_encoding_utf8_kddi_a_aliases,
mblen_table_utf8,
- MBFL_ENCTYPE_MBCS
+ MBFL_ENCTYPE_MBCS,
+ &vtbl_utf8_kddi_a_wchar,
+ &vtbl_wchar_utf8_kddi_a
};
const mbfl_encoding mbfl_encoding_utf8_kddi_b = {
@@ -70,7 +74,9 @@ const mbfl_encoding mbfl_encoding_utf8_kddi_b = {
"UTF-8",
(const char *(*)[])&mbfl_encoding_utf8_kddi_b_aliases,
mblen_table_utf8,
- MBFL_ENCTYPE_MBCS
+ MBFL_ENCTYPE_MBCS,
+ &vtbl_utf8_kddi_b_wchar,
+ &vtbl_wchar_utf8_kddi_b
};
const mbfl_encoding mbfl_encoding_utf8_sb = {
@@ -79,7 +85,9 @@ const mbfl_encoding mbfl_encoding_utf8_sb = {
"UTF-8",
(const char *(*)[])&mbfl_encoding_utf8_sb_aliases,
mblen_table_utf8,
- MBFL_ENCTYPE_MBCS
+ MBFL_ENCTYPE_MBCS,
+ &vtbl_utf8_sb_wchar,
+ &vtbl_wchar_utf8_sb
};
const struct mbfl_identify_vtbl vtbl_identify_utf8_docomo = {
diff --git a/ext/mbstring/libmbfl/filters/mbfilter_uuencode.c b/ext/mbstring/libmbfl/filters/mbfilter_uuencode.c
index b8cdfcaf79..5464fac433 100644
--- a/ext/mbstring/libmbfl/filters/mbfilter_uuencode.c
+++ b/ext/mbstring/libmbfl/filters/mbfilter_uuencode.c
@@ -40,7 +40,9 @@ const mbfl_encoding mbfl_encoding_uuencode = {
"x-uuencode",
NULL,
NULL,
- MBFL_ENCTYPE_SBCS
+ MBFL_ENCTYPE_SBCS,
+ NULL,
+ NULL
};
const struct mbfl_convert_vtbl vtbl_uuencode_8bit = {
diff --git a/ext/mbstring/libmbfl/mbfl/mbfilter.c b/ext/mbstring/libmbfl/mbfl/mbfilter.c
index 4986472b9b..94ecc57491 100644
--- a/ext/mbstring/libmbfl/mbfl/mbfilter.c
+++ b/ext/mbstring/libmbfl/mbfl/mbfilter.c
@@ -1,6 +1,5 @@
/*
* charset=UTF-8
- * vim600: encoding=utf-8
*/
/*
@@ -101,8 +100,14 @@
#include "mbfilter.h"
#include "mbfl_filter_output.h"
+#include "mbfilter_8bit.h"
#include "mbfilter_pass.h"
+#include "mbfilter_wchar.h"
+#include "filters/mbfilter_ascii.h"
+#include "filters/mbfilter_base64.h"
+#include "filters/mbfilter_qprint.h"
#include "filters/mbfilter_tl_jisx0201_jisx0208.h"
+#include "filters/mbfilter_utf8.h"
#include "eaw_table.h"
@@ -124,26 +129,14 @@ static char mbfl_hexchar_table[] = {
*/
mbfl_buffer_converter *
mbfl_buffer_converter_new(
- enum mbfl_no_encoding from,
- enum mbfl_no_encoding to,
- int buf_initsz)
-{
- const mbfl_encoding *_from = mbfl_no2encoding(from);
- const mbfl_encoding *_to = mbfl_no2encoding(to);
-
- return mbfl_buffer_converter_new2(_from ? _from: &mbfl_encoding_pass, _to ? _to: &mbfl_encoding_pass, buf_initsz);
-}
-
-mbfl_buffer_converter *
-mbfl_buffer_converter_new2(
const mbfl_encoding *from,
const mbfl_encoding *to,
- int buf_initsz)
+ size_t buf_initsz)
{
mbfl_buffer_converter *convd;
/* allocate */
- convd = (mbfl_buffer_converter*)mbfl_malloc(sizeof (mbfl_buffer_converter));
+ convd = (mbfl_buffer_converter*)mbfl_malloc(sizeof(mbfl_buffer_converter));
if (convd == NULL) {
return NULL;
}
@@ -154,14 +147,14 @@ mbfl_buffer_converter_new2(
/* create convert filter */
convd->filter1 = NULL;
- convd->filter2 = NULL;
- if (mbfl_convert_filter_get_vtbl(convd->from->no_encoding, convd->to->no_encoding) != NULL) {
- convd->filter1 = mbfl_convert_filter_new(convd->from->no_encoding, convd->to->no_encoding, mbfl_memory_device_output, NULL, &convd->device);
+convd->filter2 = NULL;
+ if (mbfl_convert_filter_get_vtbl(convd->from, convd->to) != NULL) {
+ convd->filter1 = mbfl_convert_filter_new(convd->from, convd->to, mbfl_memory_device_output, NULL, &convd->device);
} else {
- convd->filter2 = mbfl_convert_filter_new(mbfl_no_encoding_wchar, convd->to->no_encoding, mbfl_memory_device_output, NULL, &convd->device);
+ convd->filter2 = mbfl_convert_filter_new(&mbfl_encoding_wchar, convd->to, mbfl_memory_device_output, NULL, &convd->device);
if (convd->filter2 != NULL) {
- convd->filter1 = mbfl_convert_filter_new(convd->from->no_encoding,
- mbfl_no_encoding_wchar,
+ convd->filter1 = mbfl_convert_filter_new(convd->from,
+ &mbfl_encoding_wchar,
(int (*)(int, void*))convd->filter2->filter_function,
(int (*)(void*))convd->filter2->filter_flush,
convd->filter2);
@@ -234,7 +227,7 @@ mbfl_buffer_converter_illegal_substchar(mbfl_buffer_converter *convd, int substc
}
int
-mbfl_buffer_converter_strncat(mbfl_buffer_converter *convd, const unsigned char *p, int n)
+mbfl_buffer_converter_strncat(mbfl_buffer_converter *convd, const unsigned char *p, size_t n)
{
mbfl_convert_filter *filter;
int (*filter_function)(int c, mbfl_convert_filter *filter);
@@ -262,9 +255,9 @@ mbfl_buffer_converter_feed(mbfl_buffer_converter *convd, mbfl_string *string)
}
int
-mbfl_buffer_converter_feed2(mbfl_buffer_converter *convd, mbfl_string *string, int *loc)
+mbfl_buffer_converter_feed2(mbfl_buffer_converter *convd, mbfl_string *string, size_t *loc)
{
- int n;
+ size_t n;
unsigned char *p;
mbfl_convert_filter *filter;
int (*filter_function)(int c, mbfl_convert_filter *filter);
@@ -318,7 +311,7 @@ mbfl_string *
mbfl_buffer_converter_getbuffer(mbfl_buffer_converter *convd, mbfl_string *result)
{
if (convd != NULL && result != NULL && convd->device.buffer != NULL) {
- result->no_encoding = convd->to->no_encoding;
+ result->encoding = convd->to;
result->val = convd->device.buffer;
result->len = convd->device.pos;
} else {
@@ -334,7 +327,7 @@ mbfl_buffer_converter_result(mbfl_buffer_converter *convd, mbfl_string *result)
if (convd == NULL || result == NULL) {
return NULL;
}
- result->no_encoding = convd->to->no_encoding;
+ result->encoding = convd->to;
return mbfl_memory_device_result(&convd->device, result);
}
@@ -352,13 +345,13 @@ mbfl_buffer_converter_feed_result(mbfl_buffer_converter *convd, mbfl_string *str
if (convd->filter2 != NULL) {
mbfl_convert_filter_flush(convd->filter2);
}
- result->no_encoding = convd->to->no_encoding;
+ result->encoding = convd->to;
return mbfl_memory_device_result(&convd->device, result);
}
-int mbfl_buffer_illegalchars(mbfl_buffer_converter *convd)
+size_t mbfl_buffer_illegalchars(mbfl_buffer_converter *convd)
{
- int num_illegalchars = 0;
+ size_t num_illegalchars = 0;
if (convd == NULL) {
return 0;
@@ -372,56 +365,14 @@ int mbfl_buffer_illegalchars(mbfl_buffer_converter *convd)
num_illegalchars += convd->filter2->num_illegalchar;
}
- return (num_illegalchars);
+ return num_illegalchars;
}
/*
* encoding detector
*/
mbfl_encoding_detector *
-mbfl_encoding_detector_new(enum mbfl_no_encoding *elist, int elistsz, int strict)
-{
- mbfl_encoding_detector *identd;
-
- int i, num;
- mbfl_identify_filter *filter;
-
- if (elist == NULL || elistsz <= 0) {
- return NULL;
- }
-
- /* allocate */
- identd = (mbfl_encoding_detector*)mbfl_malloc(sizeof(mbfl_encoding_detector));
- if (identd == NULL) {
- return NULL;
- }
- identd->filter_list = (mbfl_identify_filter **)mbfl_calloc(elistsz, sizeof(mbfl_identify_filter *));
- if (identd->filter_list == NULL) {
- mbfl_free(identd);
- return NULL;
- }
-
- /* create filters */
- i = 0;
- num = 0;
- while (i < elistsz) {
- filter = mbfl_identify_filter_new(elist[i]);
- if (filter != NULL) {
- identd->filter_list[num] = filter;
- num++;
- }
- i++;
- }
- identd->filter_list_size = num;
-
- /* set strict flag */
- identd->strict = strict;
-
- return identd;
-}
-
-mbfl_encoding_detector *
-mbfl_encoding_detector_new2(const mbfl_encoding **elist, int elistsz, int strict)
+mbfl_encoding_detector_new(const mbfl_encoding **elist, int elistsz, int strict)
{
mbfl_encoding_detector *identd;
@@ -484,20 +435,17 @@ mbfl_encoding_detector_delete(mbfl_encoding_detector *identd)
int
mbfl_encoding_detector_feed(mbfl_encoding_detector *identd, mbfl_string *string)
{
- int i, n, num, bad, res;
- unsigned char *p;
- mbfl_identify_filter *filter;
-
- res = 0;
+ int res = 0;
/* feed data */
if (identd != NULL && string != NULL && string->val != NULL) {
- num = identd->filter_list_size;
- n = string->len;
- p = string->val;
- bad = 0;
+ int num = identd->filter_list_size;
+ size_t n = string->len;
+ unsigned char *p = string->val;
+ int bad = 0;
while (n > 0) {
+ int i;
for (i = 0; i < num; i++) {
- filter = identd->filter_list[i];
+ mbfl_identify_filter *filter = identd->filter_list[i];
if (!filter->flag) {
(*filter->filter_function)(*p, filter);
if (filter->flag) {
@@ -517,7 +465,7 @@ mbfl_encoding_detector_feed(mbfl_encoding_detector *identd, mbfl_string *string)
return res;
}
-const mbfl_encoding *mbfl_encoding_detector_judge2(mbfl_encoding_detector *identd)
+const mbfl_encoding *mbfl_encoding_detector_judge(mbfl_encoding_detector *identd)
{
mbfl_identify_filter *filter;
const mbfl_encoding *encoding = NULL;
@@ -552,13 +500,6 @@ const mbfl_encoding *mbfl_encoding_detector_judge2(mbfl_encoding_detector *ident
return encoding;
}
-enum mbfl_no_encoding mbfl_encoding_detector_judge(mbfl_encoding_detector *identd)
-{
- const mbfl_encoding *encoding = mbfl_encoding_detector_judge2(identd);
- return !encoding ? mbfl_no_encoding_invalid: encoding->no_encoding;
-}
-
-
/*
* encoding converter
*/
@@ -566,29 +507,27 @@ mbfl_string *
mbfl_convert_encoding(
mbfl_string *string,
mbfl_string *result,
- enum mbfl_no_encoding toenc)
+ const mbfl_encoding *toenc)
{
- int n;
+ size_t n;
unsigned char *p;
- const mbfl_encoding *encoding;
mbfl_memory_device device;
mbfl_convert_filter *filter1;
mbfl_convert_filter *filter2;
/* initialize */
- encoding = mbfl_no2encoding(toenc);
- if (encoding == NULL || string == NULL || result == NULL) {
+ if (toenc == NULL || string == NULL || result == NULL) {
return NULL;
}
filter1 = NULL;
filter2 = NULL;
- if (mbfl_convert_filter_get_vtbl(string->no_encoding, toenc) != NULL) {
- filter1 = mbfl_convert_filter_new(string->no_encoding, toenc, mbfl_memory_device_output, 0, &device);
+ if (mbfl_convert_filter_get_vtbl(string->encoding, toenc) != NULL) {
+ filter1 = mbfl_convert_filter_new(string->encoding, toenc, mbfl_memory_device_output, 0, &device);
} else {
- filter2 = mbfl_convert_filter_new(mbfl_no_encoding_wchar, toenc, mbfl_memory_device_output, 0, &device);
+ filter2 = mbfl_convert_filter_new(&mbfl_encoding_wchar, toenc, mbfl_memory_device_output, 0, &device);
if (filter2 != NULL) {
- filter1 = mbfl_convert_filter_new(string->no_encoding, mbfl_no_encoding_wchar, (int (*)(int, void*))filter2->filter_function, NULL, filter2);
+ filter1 = mbfl_convert_filter_new(string->encoding, &mbfl_encoding_wchar, (int (*)(int, void*))filter2->filter_function, NULL, filter2);
if (filter1 == NULL) {
mbfl_convert_filter_delete(filter2);
}
@@ -632,92 +571,10 @@ mbfl_convert_encoding(
* identify encoding
*/
const mbfl_encoding *
-mbfl_identify_encoding(mbfl_string *string, enum mbfl_no_encoding *elist, int elistsz, int strict)
+mbfl_identify_encoding(mbfl_string *string, const mbfl_encoding **elist, int elistsz, int strict)
{
- int i, n, num, bad;
- unsigned char *p;
- mbfl_identify_filter *flist, *filter;
- const mbfl_encoding *encoding;
-
- /* flist is an array of mbfl_identify_filter instances */
- flist = (mbfl_identify_filter *)mbfl_calloc(elistsz, sizeof(mbfl_identify_filter));
- if (flist == NULL) {
- return NULL;
- }
-
- num = 0;
- if (elist != NULL) {
- for (i = 0; i < elistsz; i++) {
- if (!mbfl_identify_filter_init(&flist[num], elist[i])) {
- num++;
- }
- }
- }
-
- /* feed data */
- n = string->len;
- p = string->val;
-
- if (p != NULL) {
- bad = 0;
- while (n > 0) {
- for (i = 0; i < num; i++) {
- filter = &flist[i];
- if (!filter->flag) {
- (*filter->filter_function)(*p, filter);
- if (filter->flag) {
- bad++;
- }
- }
- }
- if ((num - 1) <= bad && !strict) {
- break;
- }
- p++;
- n--;
- }
- }
-
- /* judge */
- encoding = NULL;
-
- for (i = 0; i < num; i++) {
- filter = &flist[i];
- if (!filter->flag) {
- if (strict && filter->status) {
- continue;
- }
- encoding = filter->encoding;
- break;
- }
- }
-
- /* fall-back judge */
- if (!encoding) {
- for (i = 0; i < num; i++) {
- filter = &flist[i];
- if (!filter->flag && (!strict || !filter->status)) {
- encoding = filter->encoding;
- break;
- }
- }
- }
-
- /* cleanup */
- /* dtors should be called in reverse order */
- i = num; while (--i >= 0) {
- mbfl_identify_filter_cleanup(&flist[i]);
- }
-
- mbfl_free((void *)flist);
-
- return encoding;
-}
-
-const mbfl_encoding *
-mbfl_identify_encoding2(mbfl_string *string, const mbfl_encoding **elist, int elistsz, int strict)
-{
- int i, n, num, bad;
+ int i, num, bad;
+ size_t n;
unsigned char *p;
mbfl_identify_filter *flist, *filter;
const mbfl_encoding *encoding;
@@ -788,7 +645,8 @@ mbfl_identify_encoding2(mbfl_string *string, const mbfl_encoding **elist, int el
/* cleanup */
/* dtors should be called in reverse order */
- i = num; while (--i >= 0) {
+ i = num;
+ while (--i >= 0) {
mbfl_identify_filter_cleanup(&flist[i]);
}
@@ -803,22 +661,16 @@ mbfl_identify_encoding2(mbfl_string *string, const mbfl_encoding **elist, int el
static int
filter_count_output(int c, void *data)
{
- (*(int *)data)++;
+ (*(size_t *)data)++;
return c;
}
-int
+size_t
mbfl_strlen(mbfl_string *string)
{
- int len, n, m, k;
+ size_t len, n, k;
unsigned char *p;
- const unsigned char *mbtab;
- const mbfl_encoding *encoding;
-
- encoding = mbfl_no2encoding(string->no_encoding);
- if (encoding == NULL || string == NULL) {
- return -1;
- }
+ const mbfl_encoding *encoding = string->encoding;
len = 0;
if (encoding->flag & MBFL_ENCTYPE_SBCS) {
@@ -828,27 +680,27 @@ mbfl_strlen(mbfl_string *string)
} else if (encoding->flag & (MBFL_ENCTYPE_WCS4BE | MBFL_ENCTYPE_WCS4LE)) {
len = string->len/4;
} else if (encoding->mblen_table != NULL) {
- mbtab = encoding->mblen_table;
+ const unsigned char *mbtab = encoding->mblen_table;
n = 0;
p = string->val;
k = string->len;
/* count */
if (p != NULL) {
while (n < k) {
- m = mbtab[*p];
+ unsigned m = mbtab[*p];
n += m;
p += m;
len++;
- };
+ }
}
} else {
/* wchar filter */
mbfl_convert_filter *filter = mbfl_convert_filter_new(
- string->no_encoding,
- mbfl_no_encoding_wchar,
+ string->encoding,
+ &mbfl_encoding_wchar,
filter_count_output, 0, &len);
if (filter == NULL) {
- return -1;
+ return (size_t) -1;
}
/* count */
n = string->len;
@@ -872,18 +724,19 @@ mbfl_strlen(mbfl_string *string)
struct collector_strpos_data {
mbfl_convert_filter *next_filter;
mbfl_wchar_device needle;
- int needle_len;
- int start;
- int output;
- int found_pos;
- int needle_pos;
- int matched_pos;
+ size_t needle_len;
+ size_t start;
+ size_t output;
+ size_t found_pos;
+ size_t needle_pos;
+ size_t matched_pos;
};
static int
collector_strpos(int c, void* data)
{
- int *p, *h, *m, n;
+ int *p, *h, *m;
+ ssize_t n;
struct collector_strpos_data *pc = (struct collector_strpos_data*)data;
if (pc->output >= pc->start) {
@@ -931,22 +784,12 @@ retry:
/*
* oddlen
*/
-int
+size_t
mbfl_oddlen(mbfl_string *string)
{
- int len, n, m, k;
+ size_t len, n, k;
unsigned char *p;
- const unsigned char *mbtab;
- const mbfl_encoding *encoding;
-
-
- if (string == NULL) {
- return -1;
- }
- encoding = mbfl_no2encoding(string->no_encoding);
- if (encoding == NULL) {
- return -1;
- }
+ const mbfl_encoding *encoding = string->encoding;
len = 0;
if (encoding->flag & MBFL_ENCTYPE_SBCS) {
@@ -956,14 +799,14 @@ mbfl_oddlen(mbfl_string *string)
} else if (encoding->flag & (MBFL_ENCTYPE_WCS4BE | MBFL_ENCTYPE_WCS4LE)) {
return len % 4;
} else if (encoding->mblen_table != NULL) {
- mbtab = encoding->mblen_table;
+ const unsigned char *mbtab = encoding->mblen_table;
n = 0;
p = string->val;
k = string->len;
/* count */
if (p != NULL) {
while (n < k) {
- m = mbtab[*p];
+ unsigned m = mbtab[*p];
n += m;
p += m;
};
@@ -976,47 +819,46 @@ mbfl_oddlen(mbfl_string *string)
/* NOT REACHED */
}
-int
+size_t
mbfl_strpos(
mbfl_string *haystack,
mbfl_string *needle,
- int offset,
+ ssize_t offset,
int reverse)
{
- int result;
+ size_t result;
mbfl_string _haystack_u8, _needle_u8;
const mbfl_string *haystack_u8, *needle_u8 = NULL;
const unsigned char *u8_tbl;
if (haystack == NULL || haystack->val == NULL || needle == NULL || needle->val == NULL) {
- return -8;
+ return (size_t) -8;
}
{
- const mbfl_encoding *u8_enc;
- u8_enc = mbfl_no2encoding(mbfl_no_encoding_utf8);
- if (u8_enc == NULL || u8_enc->mblen_table == NULL) {
- return -8;
+ const mbfl_encoding *u8_enc = &mbfl_encoding_utf8;
+ if (u8_enc->mblen_table == NULL) {
+ return (size_t) -8;
}
u8_tbl = u8_enc->mblen_table;
}
- if (haystack->no_encoding != mbfl_no_encoding_utf8) {
+ if (haystack->encoding->no_encoding != mbfl_no_encoding_utf8) {
mbfl_string_init(&_haystack_u8);
- haystack_u8 = mbfl_convert_encoding(haystack, &_haystack_u8, mbfl_no_encoding_utf8);
+ haystack_u8 = mbfl_convert_encoding(haystack, &_haystack_u8, &mbfl_encoding_utf8);
if (haystack_u8 == NULL) {
- result = -4;
+ result = (size_t) -4;
goto out;
}
} else {
haystack_u8 = haystack;
}
- if (needle->no_encoding != mbfl_no_encoding_utf8) {
+ if (needle->encoding->no_encoding != mbfl_no_encoding_utf8) {
mbfl_string_init(&_needle_u8);
- needle_u8 = mbfl_convert_encoding(needle, &_needle_u8, mbfl_no_encoding_utf8);
+ needle_u8 = mbfl_convert_encoding(needle, &_needle_u8, &mbfl_encoding_utf8);
if (needle_u8 == NULL) {
- result = -4;
+ result = (size_t) -4;
goto out;
}
} else {
@@ -1024,19 +866,19 @@ mbfl_strpos(
}
if (needle_u8->len < 1) {
- result = -8;
+ result = (size_t) -8;
goto out;
}
- result = -1;
+ result = (size_t) -1;
if (haystack_u8->len < needle_u8->len) {
goto out;
}
if (!reverse) {
- unsigned int jtbl[1 << (sizeof(unsigned char) * 8)];
- unsigned int needle_u8_len = needle_u8->len;
- unsigned int i;
+ size_t jtbl[1 << (sizeof(unsigned char) * 8)];
+ size_t needle_u8_len = needle_u8->len;
+ size_t i;
const unsigned char *p, *q, *e;
const unsigned char *haystack_u8_val = haystack_u8->val,
*needle_u8_val = needle_u8->val;
@@ -1048,9 +890,9 @@ mbfl_strpos(
}
e = haystack_u8_val + haystack_u8->len;
p = haystack_u8_val;
- while (--offset >= 0) {
+ while (offset-- > 0) {
if (p >= e) {
- result = -16;
+ result = (size_t) -16;
goto out;
}
p += u8_tbl[*p];
@@ -1085,9 +927,9 @@ mbfl_strpos(
}
}
} else {
- unsigned int jtbl[1 << (sizeof(unsigned char) * 8)];
- unsigned int needle_u8_len = needle_u8->len, needle_len = 0;
- unsigned int i;
+ size_t jtbl[1 << (sizeof(unsigned char) * 8)];
+ size_t needle_u8_len = needle_u8->len, needle_len = 0;
+ size_t i;
const unsigned char *p, *e, *q, *qe;
const unsigned char *haystack_u8_val = haystack_u8->val,
*needle_u8_val = needle_u8->val;
@@ -1120,7 +962,7 @@ mbfl_strpos(
while (offset < 0) {
unsigned char c;
if (p <= e) {
- result = -16;
+ result = (size_t) -16;
goto out;
}
c = *(--p);
@@ -1133,9 +975,9 @@ mbfl_strpos(
}
} else {
const unsigned char *ee = haystack_u8_val + haystack_u8->len;
- while (--offset >= 0) {
+ while (offset-- > 0) {
if (e >= ee) {
- result = -16;
+ result = (size_t) -16;
goto out;
}
e += u8_tbl[*e];
@@ -1187,63 +1029,54 @@ out:
* substr_count
*/
-int
+size_t
mbfl_substr_count(
mbfl_string *haystack,
mbfl_string *needle
)
{
- int n, result = 0;
+ size_t n, result = 0;
unsigned char *p;
mbfl_convert_filter *filter;
struct collector_strpos_data pc;
if (haystack == NULL || needle == NULL) {
- return -8;
+ return (size_t) -8;
}
/* needle is converted into wchar */
mbfl_wchar_device_init(&pc.needle);
filter = mbfl_convert_filter_new(
- needle->no_encoding,
- mbfl_no_encoding_wchar,
+ needle->encoding,
+ &mbfl_encoding_wchar,
mbfl_wchar_device_output, 0, &pc.needle);
if (filter == NULL) {
- return -4;
- }
- p = needle->val;
- n = needle->len;
- if (p != NULL) {
- while (n > 0) {
- if ((*filter->filter_function)(*p++, filter) < 0) {
- break;
- }
- n--;
- }
+ return (size_t) -4;
}
+ mbfl_convert_filter_feed_string(filter, needle->val, needle->len);
mbfl_convert_filter_flush(filter);
mbfl_convert_filter_delete(filter);
pc.needle_len = pc.needle.pos;
if (pc.needle.buffer == NULL) {
- return -4;
+ return (size_t) -4;
}
if (pc.needle_len <= 0) {
mbfl_wchar_device_clear(&pc.needle);
- return -2;
+ return (size_t) -2;
}
/* initialize filter and collector data */
filter = mbfl_convert_filter_new(
- haystack->no_encoding,
- mbfl_no_encoding_wchar,
+ haystack->encoding,
+ &mbfl_encoding_wchar,
collector_strpos, 0, &pc);
if (filter == NULL) {
mbfl_wchar_device_clear(&pc.needle);
- return -4;
+ return (size_t) -4;
}
pc.start = 0;
pc.output = 0;
pc.needle_pos = 0;
pc.found_pos = 0;
- pc.matched_pos = -1;
+ pc.matched_pos = (size_t) -1;
/* feed data */
p = haystack->val;
@@ -1251,12 +1084,12 @@ mbfl_substr_count(
if (p != NULL) {
while (n > 0) {
if ((*filter->filter_function)(*p++, filter) < 0) {
- pc.matched_pos = -4;
+ pc.matched_pos = (size_t) -4;
break;
}
- if (pc.matched_pos >= 0) {
+ if (pc.matched_pos != (size_t) -1) {
++result;
- pc.matched_pos = -1;
+ pc.matched_pos = (size_t) -1;
pc.needle_pos = 0;
}
n--;
@@ -1274,9 +1107,9 @@ mbfl_substr_count(
*/
struct collector_substr_data {
mbfl_convert_filter *next_filter;
- int start;
- int stop;
- int output;
+ size_t start;
+ size_t stop;
+ size_t output;
};
static int
@@ -1301,80 +1134,79 @@ mbfl_string *
mbfl_substr(
mbfl_string *string,
mbfl_string *result,
- int from,
- int length)
+ size_t from,
+ size_t length)
{
- const mbfl_encoding *encoding;
- int n, m, k, len, start, end;
+ const mbfl_encoding *encoding = string->encoding;
+ size_t n, k, len, start, end;
+ unsigned m;
unsigned char *p, *w;
- const unsigned char *mbtab;
- encoding = mbfl_no2encoding(string->no_encoding);
- if (encoding == NULL || string == NULL || result == NULL) {
- return NULL;
- }
mbfl_string_init(result);
result->no_language = string->no_language;
- result->no_encoding = string->no_encoding;
+ result->encoding = string->encoding;
if ((encoding->flag & (MBFL_ENCTYPE_SBCS | MBFL_ENCTYPE_WCS2BE | MBFL_ENCTYPE_WCS2LE | MBFL_ENCTYPE_WCS4BE | MBFL_ENCTYPE_WCS4LE)) ||
encoding->mblen_table != NULL) {
len = string->len;
- start = from;
- end = from + length;
- if (encoding->flag & (MBFL_ENCTYPE_WCS2BE | MBFL_ENCTYPE_WCS2LE)) {
- start *= 2;
- end = start + length*2;
+ if (encoding->flag & MBFL_ENCTYPE_SBCS) {
+ start = from;
+ } else if (encoding->flag & (MBFL_ENCTYPE_WCS2BE | MBFL_ENCTYPE_WCS2LE)) {
+ start = from*2;
} else if (encoding->flag & (MBFL_ENCTYPE_WCS4BE | MBFL_ENCTYPE_WCS4LE)) {
- start *= 4;
- end = start + length*4;
- } else if (encoding->mblen_table != NULL) {
- mbtab = encoding->mblen_table;
+ start = from*4;
+ } else {
+ const unsigned char *mbtab = encoding->mblen_table;
start = 0;
- end = 0;
n = 0;
k = 0;
p = string->val;
- if (p != NULL) {
- /* search start position */
- while (k <= from) {
- start = n;
- if (n >= len) {
- break;
- }
- m = mbtab[*p];
- n += m;
- p += m;
- k++;
+ /* search start position */
+ while (k <= from) {
+ start = n;
+ if (n >= len) {
+ break;
}
- /* detect end position */
- k = 0;
- end = start;
- while (k < length) {
- end = n;
- if (n >= len) {
- break;
- }
- m = mbtab[*p];
- n += m;
- p += m;
- k++;
+ m = mbtab[*p];
+ n += m;
+ p += m;
+ k++;
+ }
+ }
+
+ if (length == MBFL_SUBSTR_UNTIL_END) {
+ end = len;
+ } else if (encoding->flag & MBFL_ENCTYPE_SBCS) {
+ end = start + length;
+ } else if (encoding->flag & (MBFL_ENCTYPE_WCS2BE | MBFL_ENCTYPE_WCS2LE)) {
+ end = start + length*2;
+ } else if (encoding->flag & (MBFL_ENCTYPE_WCS4BE | MBFL_ENCTYPE_WCS4LE)) {
+ end = start + length*4;
+ } else {
+ const unsigned char *mbtab = encoding->mblen_table;
+ end = start;
+ n = start;
+ k = 0;
+ p = string->val + start;
+ /* detect end position */
+ while (k <= length) {
+ end = n;
+ if (n >= len) {
+ break;
}
+ m = mbtab[*p];
+ n += m;
+ p += m;
+ k++;
}
}
if (start > len) {
start = len;
}
- if (start < 0) {
- start = 0;
- }
if (end > len) {
end = len;
}
- if (end < 0) {
- end = 0;
- }
if (start > end) {
start = end;
}
@@ -1382,21 +1214,11 @@ mbfl_substr(
/* allocate memory and copy */
n = end - start;
result->len = 0;
- result->val = w = (unsigned char*)mbfl_malloc((n + 8)*sizeof(unsigned char));
+ result->val = w = (unsigned char*)mbfl_malloc(n + 1);
if (w != NULL) {
- p = string->val;
- if (p != NULL) {
- p += start;
- result->len = n;
- while (n > 0) {
- *w++ = *p++;
- n--;
- }
- }
- *w++ = '\0';
- *w++ = '\0';
- *w++ = '\0';
- *w = '\0';
+ result->len = n;
+ memcpy(w, string->val + start, n);
+ w[n] = '\0';
} else {
result = NULL;
}
@@ -1406,19 +1228,23 @@ mbfl_substr(
mbfl_convert_filter *decoder;
mbfl_convert_filter *encoder;
+ if (length == MBFL_SUBSTR_UNTIL_END) {
+ length = mbfl_strlen(string) - from;
+ }
+
mbfl_memory_device_init(&device, length + 1, 0);
mbfl_string_init(result);
result->no_language = string->no_language;
- result->no_encoding = string->no_encoding;
+ result->encoding = string->encoding;
/* output code filter */
decoder = mbfl_convert_filter_new(
- mbfl_no_encoding_wchar,
- string->no_encoding,
+ &mbfl_encoding_wchar,
+ string->encoding,
mbfl_memory_device_output, 0, &device);
/* wchar filter */
encoder = mbfl_convert_filter_new(
- string->no_encoding,
- mbfl_no_encoding_wchar,
+ string->encoding,
+ &mbfl_encoding_wchar,
collector_substr, 0, &pc);
if (decoder == NULL || encoder == NULL) {
mbfl_convert_filter_delete(encoder);
@@ -1459,33 +1285,19 @@ mbfl_string *
mbfl_strcut(
mbfl_string *string,
mbfl_string *result,
- int from,
- int length)
+ size_t from,
+ size_t length)
{
- const mbfl_encoding *encoding;
+ const mbfl_encoding *encoding = string->encoding;
mbfl_memory_device device;
- /* validate the parameters */
- if (string == NULL || string->val == NULL || result == NULL) {
- return NULL;
- }
-
- if (from < 0 || length < 0) {
- return NULL;
- }
-
if (from >= string->len) {
from = string->len;
}
- encoding = mbfl_no2encoding(string->no_encoding);
- if (encoding == NULL) {
- return NULL;
- }
-
mbfl_string_init(result);
result->no_language = string->no_language;
- result->no_encoding = string->no_encoding;
+ result->encoding = string->encoding;
if ((encoding->flag & (MBFL_ENCTYPE_SBCS
| MBFL_ENCTYPE_WCS2BE
@@ -1496,7 +1308,7 @@ mbfl_strcut(
const unsigned char *start = NULL;
const unsigned char *end = NULL;
unsigned char *w;
- unsigned int sz;
+ size_t sz;
if (encoding->flag & (MBFL_ENCTYPE_WCS2BE | MBFL_ENCTYPE_WCS2LE)) {
from &= -2;
@@ -1539,7 +1351,7 @@ mbfl_strcut(
start = p;
/* search end position */
- if (length >= (int)string->len - (start - string->val)) {
+ if (length >= string->len - (start - string->val)) {
end = string->val + string->len;
} else {
for (q = p + length; p < q; p += (m = mbtab[*p]));
@@ -1577,21 +1389,21 @@ mbfl_strcut(
mbfl_convert_filter encoder;
mbfl_convert_filter decoder;
const unsigned char *p;
- int pos;
+ size_t pos;
} bk, _bk;
/* output code filter */
if (!(decoder = mbfl_convert_filter_new(
- mbfl_no_encoding_wchar,
- string->no_encoding,
+ &mbfl_encoding_wchar,
+ string->encoding,
mbfl_memory_device_output, 0, &device))) {
return NULL;
}
/* wchar filter */
if (!(encoder = mbfl_convert_filter_new(
- string->no_encoding,
- mbfl_no_encoding_wchar,
+ string->encoding,
+ &mbfl_encoding_wchar,
mbfl_filter_output_null,
NULL, NULL))) {
mbfl_convert_filter_delete(decoder);
@@ -1750,7 +1562,7 @@ mbfl_strcut(
/*
* strwidth
*/
-static int is_fullwidth(int c)
+static size_t is_fullwidth(int c)
{
int i;
@@ -1770,14 +1582,14 @@ static int is_fullwidth(int c)
static int
filter_count_width(int c, void* data)
{
- (*(int *)data) += (is_fullwidth(c) ? 2: 1);
+ (*(size_t *)data) += (is_fullwidth(c) ? 2: 1);
return c;
}
-int
+size_t
mbfl_strwidth(mbfl_string *string)
{
- int len, n;
+ size_t len, n;
unsigned char *p;
mbfl_convert_filter *filter;
@@ -1785,8 +1597,8 @@ mbfl_strwidth(mbfl_string *string)
if (string->len > 0 && string->val != NULL) {
/* wchar filter */
filter = mbfl_convert_filter_new(
- string->no_encoding,
- mbfl_no_encoding_wchar,
+ string->encoding,
+ &mbfl_encoding_wchar,
filter_count_width, 0, &len);
if (filter == NULL) {
mbfl_convert_filter_delete(filter);
@@ -1816,12 +1628,12 @@ struct collector_strimwidth_data {
mbfl_convert_filter *decoder;
mbfl_convert_filter *decoder_backup;
mbfl_memory_device device;
- int from;
- int width;
- int outwidth;
- int outchar;
+ size_t from;
+ size_t width;
+ size_t outwidth;
+ size_t outchar;
+ size_t endpos;
int status;
- int endpos;
};
static int
@@ -1861,12 +1673,12 @@ mbfl_strimwidth(
mbfl_string *string,
mbfl_string *marker,
mbfl_string *result,
- int from,
- int width)
+ size_t from,
+ size_t width)
{
struct collector_strimwidth_data pc;
mbfl_convert_filter *encoder;
- int n, mkwidth;
+ size_t n, mkwidth;
unsigned char *p;
if (string == NULL || result == NULL) {
@@ -1874,22 +1686,22 @@ mbfl_strimwidth(
}
mbfl_string_init(result);
result->no_language = string->no_language;
- result->no_encoding = string->no_encoding;
+ result->encoding = string->encoding;
mbfl_memory_device_init(&pc.device, width, 0);
/* output code filter */
pc.decoder = mbfl_convert_filter_new(
- mbfl_no_encoding_wchar,
- string->no_encoding,
+ &mbfl_encoding_wchar,
+ string->encoding,
mbfl_memory_device_output, 0, &pc.device);
pc.decoder_backup = mbfl_convert_filter_new(
- mbfl_no_encoding_wchar,
- string->no_encoding,
+ &mbfl_encoding_wchar,
+ string->encoding,
mbfl_memory_device_output, 0, &pc.device);
/* wchar filter */
encoder = mbfl_convert_filter_new(
- string->no_encoding,
- mbfl_no_encoding_wchar,
+ string->encoding,
+ &mbfl_encoding_wchar,
collector_strimwidth, 0, &pc);
if (pc.decoder == NULL || pc.decoder_backup == NULL || encoder == NULL) {
mbfl_convert_filter_delete(encoder);
@@ -1932,7 +1744,7 @@ mbfl_strimwidth(
pc.status = 10;
pc.device.pos = pc.endpos;
mbfl_convert_filter_copy(pc.decoder_backup, pc.decoder);
- mbfl_convert_filter_reset(encoder, marker->no_encoding, mbfl_no_encoding_wchar);
+ mbfl_convert_filter_reset(encoder, marker->encoding, &mbfl_encoding_wchar);
p = marker->val;
n = marker->len;
while (n > 0) {
@@ -1963,9 +1775,8 @@ mbfl_ja_jp_hantozen(
mbfl_string *result,
int mode)
{
- int n;
+ size_t n;
unsigned char *p;
- const mbfl_encoding *encoding;
mbfl_memory_device device;
mbfl_convert_filter *decoder = NULL;
mbfl_convert_filter *encoder = NULL;
@@ -1973,25 +1784,15 @@ mbfl_ja_jp_hantozen(
mbfl_convert_filter *next_filter = NULL;
mbfl_filt_tl_jisx0201_jisx0208_param *param = NULL;
- /* validate parameters */
- if (string == NULL || result == NULL) {
- return NULL;
- }
-
- encoding = mbfl_no2encoding(string->no_encoding);
- if (encoding == NULL) {
- return NULL;
- }
-
mbfl_memory_device_init(&device, string->len, 0);
mbfl_string_init(result);
result->no_language = string->no_language;
- result->no_encoding = string->no_encoding;
+ result->encoding = string->encoding;
decoder = mbfl_convert_filter_new(
- mbfl_no_encoding_wchar,
- string->no_encoding,
+ &mbfl_encoding_wchar,
+ string->encoding,
mbfl_memory_device_output, 0, &device);
if (decoder == NULL) {
goto out;
@@ -2020,8 +1821,8 @@ mbfl_ja_jp_hantozen(
next_filter = tl_filter;
encoder = mbfl_convert_filter_new(
- string->no_encoding,
- mbfl_no_encoding_wchar,
+ string->encoding,
+ &mbfl_encoding_wchar,
(int(*)(int, void*))next_filter->filter_function,
(int(*)(void*))next_filter->filter_flush,
next_filter);
@@ -2077,9 +1878,9 @@ struct mime_header_encoder_data {
mbfl_memory_device tmpdev;
int status1;
int status2;
- int prevpos;
- int linehead;
- int firstindent;
+ size_t prevpos;
+ size_t linehead;
+ size_t firstindent;
int encnamelen;
int lwsplen;
char encname[128];
@@ -2089,7 +1890,7 @@ struct mime_header_encoder_data {
static int
mime_header_encoder_block_collector(int c, void *data)
{
- int n;
+ size_t n;
struct mime_header_encoder_data *pe = (struct mime_header_encoder_data *)data;
switch (pe->status2) {
@@ -2150,7 +1951,7 @@ mime_header_encoder_collector(int c, void *data)
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 /* 0xF0 */
};
- int n;
+ size_t n;
struct mime_header_encoder_data *pe = (struct mime_header_encoder_data *)data;
switch (pe->status1) {
@@ -2226,18 +2027,16 @@ mime_header_encoder_result(struct mime_header_encoder_data *pe, mbfl_string *res
struct mime_header_encoder_data*
mime_header_encoder_new(
- enum mbfl_no_encoding incode,
- enum mbfl_no_encoding outcode,
- enum mbfl_no_encoding transenc)
+ const mbfl_encoding *incode,
+ const mbfl_encoding *outcode,
+ const mbfl_encoding *transenc)
{
- int n;
+ size_t n;
const char *s;
- const mbfl_encoding *outencoding;
struct mime_header_encoder_data *pe;
/* get output encoding and check MIME charset name */
- outencoding = mbfl_no2encoding(outcode);
- if (outencoding == NULL || outencoding->mime_name == NULL || outencoding->mime_name[0] == '\0') {
+ if (outcode->mime_name == NULL || outcode->mime_name[0] == '\0') {
return NULL;
}
@@ -2258,16 +2057,16 @@ mime_header_encoder_new(
n = 0;
pe->encname[n++] = 0x3d;
pe->encname[n++] = 0x3f;
- s = outencoding->mime_name;
+ s = outcode->mime_name;
while (*s) {
pe->encname[n++] = *s++;
}
pe->encname[n++] = 0x3f;
- if (transenc == mbfl_no_encoding_qprint) {
+ if (transenc->no_encoding == mbfl_no_encoding_qprint) {
pe->encname[n++] = 0x51;
} else {
pe->encname[n++] = 0x42;
- transenc = mbfl_no_encoding_base64;
+ transenc = &mbfl_encoding_base64;
}
pe->encname[n++] = 0x3f;
pe->encname[n] = '\0';
@@ -2285,14 +2084,14 @@ mime_header_encoder_new(
pe->encod_filter_backup = mbfl_convert_filter_new(outcode, transenc, mbfl_memory_device_output, 0, &(pe->outdev));
/* Output code filter */
- pe->conv2_filter = mbfl_convert_filter_new(mbfl_no_encoding_wchar, outcode, mbfl_filter_output_pipe, 0, pe->encod_filter);
- pe->conv2_filter_backup = mbfl_convert_filter_new(mbfl_no_encoding_wchar, outcode, mbfl_filter_output_pipe, 0, pe->encod_filter);
+ pe->conv2_filter = mbfl_convert_filter_new(&mbfl_encoding_wchar, outcode, mbfl_filter_output_pipe, 0, pe->encod_filter);
+ pe->conv2_filter_backup = mbfl_convert_filter_new(&mbfl_encoding_wchar, outcode, mbfl_filter_output_pipe, 0, pe->encod_filter);
/* encoded block filter */
- pe->block_filter = mbfl_convert_filter_new(mbfl_no_encoding_wchar, mbfl_no_encoding_wchar, mime_header_encoder_block_collector, 0, pe);
+ pe->block_filter = mbfl_convert_filter_new(&mbfl_encoding_wchar, &mbfl_encoding_wchar, mime_header_encoder_block_collector, 0, pe);
/* Input code filter */
- pe->conv1_filter = mbfl_convert_filter_new(incode, mbfl_no_encoding_wchar, mime_header_encoder_collector, 0, pe);
+ pe->conv1_filter = mbfl_convert_filter_new(incode, &mbfl_encoding_wchar, mime_header_encoder_collector, 0, pe);
if (pe->encod_filter == NULL ||
pe->encod_filter_backup == NULL ||
@@ -2303,7 +2102,7 @@ mime_header_encoder_new(
return NULL;
}
- if (transenc == mbfl_no_encoding_qprint) {
+ if (transenc->no_encoding == mbfl_no_encoding_qprint) {
pe->encod_filter->status |= MBFL_QPRINT_STS_MIME_HEADER;
pe->encod_filter_backup->status |= MBFL_QPRINT_STS_MIME_HEADER;
} else {
@@ -2340,20 +2139,20 @@ mbfl_string *
mbfl_mime_header_encode(
mbfl_string *string,
mbfl_string *result,
- enum mbfl_no_encoding outcode,
- enum mbfl_no_encoding encoding,
+ const mbfl_encoding *outcode,
+ const mbfl_encoding *encoding,
const char *linefeed,
int indent)
{
- int n;
+ size_t n;
unsigned char *p;
struct mime_header_encoder_data *pe;
mbfl_string_init(result);
result->no_language = string->no_language;
- result->no_encoding = mbfl_no_encoding_ascii;
+ result->encoding = &mbfl_encoding_ascii;
- pe = mime_header_encoder_new(string->no_encoding, outcode, encoding);
+ pe = mime_header_encoder_new(string->encoding, outcode, encoding);
if (pe == NULL) {
return NULL;
}
@@ -2394,11 +2193,11 @@ struct mime_header_decoder_data {
mbfl_convert_filter *conv2_filter;
mbfl_memory_device outdev;
mbfl_memory_device tmpdev;
- int cspos;
+ size_t cspos;
int status;
- enum mbfl_no_encoding encoding;
- enum mbfl_no_encoding incode;
- enum mbfl_no_encoding outcode;
+ const mbfl_encoding *encoding;
+ const mbfl_encoding *incode;
+ const mbfl_encoding *outcode;
};
static int
@@ -2432,7 +2231,7 @@ mime_header_decoder_collector(int c, void* data)
mbfl_memory_device_output('\0', &pd->tmpdev);
encoding = mbfl_name2encoding((const char *)&pd->tmpdev.buffer[pd->cspos]);
if (encoding != NULL) {
- pd->incode = encoding->no_encoding;
+ pd->incode = encoding;
pd->status = 3;
}
mbfl_memory_device_unput(&pd->tmpdev);
@@ -2454,10 +2253,10 @@ mime_header_decoder_collector(int c, void* data)
case 3: /* identify encoding */
mbfl_memory_device_output(c, &pd->tmpdev);
if (c == 0x42 || c == 0x62) { /* 'B' or 'b' */
- pd->encoding = mbfl_no_encoding_base64;
+ pd->encoding = &mbfl_encoding_base64;
pd->status = 4;
} else if (c == 0x51 || c == 0x71) { /* 'Q' or 'q' */
- pd->encoding = mbfl_no_encoding_qprint;
+ pd->encoding = &mbfl_encoding_qprint;
pd->status = 4;
} else {
if (c == 0x0d || c == 0x0a) { /* CR or LF */
@@ -2474,9 +2273,9 @@ mime_header_decoder_collector(int c, void* data)
mbfl_memory_device_output(c, &pd->tmpdev);
if (c == 0x3f) { /* ? */
/* charset convert filter */
- mbfl_convert_filter_reset(pd->conv1_filter, pd->incode, mbfl_no_encoding_wchar);
+ mbfl_convert_filter_reset(pd->conv1_filter, pd->incode, &mbfl_encoding_wchar);
/* decode filter */
- mbfl_convert_filter_reset(pd->deco_filter, pd->encoding, mbfl_no_encoding_8bit);
+ mbfl_convert_filter_reset(pd->deco_filter, pd->encoding, &mbfl_encoding_8bit);
pd->status = 5;
} else {
if (c == 0x0d || c == 0x0a) { /* CR or LF */
@@ -2501,7 +2300,7 @@ mime_header_decoder_collector(int c, void* data)
/* flush and reset filter */
(*pd->deco_filter->filter_flush)(pd->deco_filter);
(*pd->conv1_filter->filter_flush)(pd->conv1_filter);
- mbfl_convert_filter_reset(pd->conv1_filter, mbfl_no_encoding_ascii, mbfl_no_encoding_wchar);
+ mbfl_convert_filter_reset(pd->conv1_filter, &mbfl_encoding_ascii, &mbfl_encoding_wchar);
pd->status = 7;
} else {
(*pd->deco_filter->filter_function)(0x3f, pd->deco_filter);
@@ -2587,7 +2386,7 @@ mime_header_decoder_result(struct mime_header_decoder_data *pd, mbfl_string *res
}
struct mime_header_decoder_data*
-mime_header_decoder_new(enum mbfl_no_encoding outcode)
+mime_header_decoder_new(const mbfl_encoding *outcode)
{
struct mime_header_decoder_data *pd;
@@ -2600,14 +2399,14 @@ mime_header_decoder_new(enum mbfl_no_encoding outcode)
mbfl_memory_device_init(&pd->tmpdev, 0, 0);
pd->cspos = 0;
pd->status = 0;
- pd->encoding = mbfl_no_encoding_pass;
- pd->incode = mbfl_no_encoding_ascii;
+ pd->encoding = &mbfl_encoding_pass;
+ pd->incode = &mbfl_encoding_ascii;
pd->outcode = outcode;
/* charset convert filter */
- pd->conv2_filter = mbfl_convert_filter_new(mbfl_no_encoding_wchar, pd->outcode, mbfl_memory_device_output, 0, &pd->outdev);
- pd->conv1_filter = mbfl_convert_filter_new(pd->incode, mbfl_no_encoding_wchar, mbfl_filter_output_pipe, 0, pd->conv2_filter);
+ pd->conv2_filter = mbfl_convert_filter_new(&mbfl_encoding_wchar, pd->outcode, mbfl_memory_device_output, 0, &pd->outdev);
+ pd->conv1_filter = mbfl_convert_filter_new(pd->incode, &mbfl_encoding_wchar, mbfl_filter_output_pipe, 0, pd->conv2_filter);
/* decode filter */
- pd->deco_filter = mbfl_convert_filter_new(pd->encoding, mbfl_no_encoding_8bit, mbfl_filter_output_pipe, 0, pd->conv1_filter);
+ pd->deco_filter = mbfl_convert_filter_new(pd->encoding, &mbfl_encoding_8bit, mbfl_filter_output_pipe, 0, pd->conv1_filter);
if (pd->conv1_filter == NULL || pd->conv2_filter == NULL || pd->deco_filter == NULL) {
mime_header_decoder_delete(pd);
@@ -2640,15 +2439,15 @@ mbfl_string *
mbfl_mime_header_decode(
mbfl_string *string,
mbfl_string *result,
- enum mbfl_no_encoding outcode)
+ const mbfl_encoding *outcode)
{
- int n;
+ size_t n;
unsigned char *p;
struct mime_header_decoder_data *pd;
mbfl_string_init(result);
result->no_language = string->no_language;
- result->no_encoding = outcode;
+ result->encoding = outcode;
pd = mime_header_decoder_new(outcode);
if (pd == NULL) {
@@ -3039,7 +2838,7 @@ mbfl_html_numeric_entity(
struct collector_htmlnumericentity_data pc;
mbfl_memory_device device;
mbfl_convert_filter *encoder;
- int n;
+ size_t n;
unsigned char *p;
if (string == NULL || result == NULL) {
@@ -3047,29 +2846,29 @@ mbfl_html_numeric_entity(
}
mbfl_string_init(result);
result->no_language = string->no_language;
- result->no_encoding = string->no_encoding;
+ result->encoding = string->encoding;
mbfl_memory_device_init(&device, string->len, 0);
/* output code filter */
pc.decoder = mbfl_convert_filter_new(
- mbfl_no_encoding_wchar,
- string->no_encoding,
+ &mbfl_encoding_wchar,
+ string->encoding,
mbfl_memory_device_output, 0, &device);
/* wchar filter */
if (type == 0) { /* decimal output */
encoder = mbfl_convert_filter_new(
- string->no_encoding,
- mbfl_no_encoding_wchar,
+ string->encoding,
+ &mbfl_encoding_wchar,
collector_encode_htmlnumericentity, 0, &pc);
} else if (type == 2) { /* hex output */
encoder = mbfl_convert_filter_new(
- string->no_encoding,
- mbfl_no_encoding_wchar,
+ string->encoding,
+ &mbfl_encoding_wchar,
collector_encode_hex_htmlnumericentity, 0, &pc);
} else { /* type == 1: decimal/hex input */
encoder = mbfl_convert_filter_new(
- string->no_encoding,
- mbfl_no_encoding_wchar,
+ string->encoding,
+ &mbfl_encoding_wchar,
collector_decode_htmlnumericentity,
(int (*)(void*))mbfl_filt_decode_htmlnumericentity_flush, &pc);
}
diff --git a/ext/mbstring/libmbfl/mbfl/mbfilter.h b/ext/mbstring/libmbfl/mbfl/mbfilter.h
index 565ed3252d..bbf1b70e9d 100644
--- a/ext/mbstring/libmbfl/mbfl/mbfilter.h
+++ b/ext/mbstring/libmbfl/mbfl/mbfilter.h
@@ -98,6 +98,17 @@
#include "mbfl_convert.h"
#include "mbfl_ident.h"
+/* Prefer local fix, otherwise need to include too much. */
+#ifndef ssize_t
+#if defined(_WIN64)
+#define ssize_t __int64
+#elif defined(_WIN32)
+#define ssize_t __int32
+#elif defined(__GNUC__) && __GNUC__ >= 4
+#define ssize_t long
+#endif
+#endif
+
/*
* version information
*/
@@ -126,20 +137,19 @@ struct _mbfl_buffer_converter {
const mbfl_encoding *to;
};
-MBFLAPI extern mbfl_buffer_converter * mbfl_buffer_converter_new(enum mbfl_no_encoding from, enum mbfl_no_encoding to, int buf_initsz);
-MBFLAPI extern mbfl_buffer_converter * mbfl_buffer_converter_new2(const mbfl_encoding *from, const mbfl_encoding *to, int buf_initsz);
+MBFLAPI extern mbfl_buffer_converter * mbfl_buffer_converter_new(const mbfl_encoding *from, const mbfl_encoding *to, size_t buf_initsz);
MBFLAPI extern void mbfl_buffer_converter_delete(mbfl_buffer_converter *convd);
MBFLAPI extern void mbfl_buffer_converter_reset(mbfl_buffer_converter *convd);
MBFLAPI extern int mbfl_buffer_converter_illegal_mode(mbfl_buffer_converter *convd, int mode);
MBFLAPI extern int mbfl_buffer_converter_illegal_substchar(mbfl_buffer_converter *convd, int substchar);
-MBFLAPI extern int mbfl_buffer_converter_strncat(mbfl_buffer_converter *convd, const unsigned char *p, int n);
+MBFLAPI extern int mbfl_buffer_converter_strncat(mbfl_buffer_converter *convd, const unsigned char *p, size_t n);
MBFLAPI extern int mbfl_buffer_converter_feed(mbfl_buffer_converter *convd, mbfl_string *string);
-MBFLAPI extern int mbfl_buffer_converter_feed2(mbfl_buffer_converter *convd, mbfl_string *string, int *loc);
+MBFLAPI extern int mbfl_buffer_converter_feed2(mbfl_buffer_converter *convd, mbfl_string *string, size_t *loc);
MBFLAPI extern int mbfl_buffer_converter_flush(mbfl_buffer_converter *convd);
MBFLAPI extern mbfl_string * mbfl_buffer_converter_getbuffer(mbfl_buffer_converter *convd, mbfl_string *result);
MBFLAPI extern mbfl_string * mbfl_buffer_converter_result(mbfl_buffer_converter *convd, mbfl_string *result);
MBFLAPI extern mbfl_string * mbfl_buffer_converter_feed_result(mbfl_buffer_converter *convd, mbfl_string *string, mbfl_string *result);
-MBFLAPI extern int mbfl_buffer_illegalchars(mbfl_buffer_converter *convd);
+MBFLAPI extern size_t mbfl_buffer_illegalchars(mbfl_buffer_converter *convd);
/*
* encoding detector
@@ -152,77 +162,82 @@ struct _mbfl_encoding_detector {
int strict;
};
-MBFLAPI extern mbfl_encoding_detector * mbfl_encoding_detector_new(enum mbfl_no_encoding *elist, int elistsz, int strict);
-MBFLAPI extern mbfl_encoding_detector * mbfl_encoding_detector_new2(const mbfl_encoding **elist, int elistsz, int strict);
+MBFLAPI extern mbfl_encoding_detector * mbfl_encoding_detector_new(const mbfl_encoding **elist, int elistsz, int strict);
MBFLAPI extern void mbfl_encoding_detector_delete(mbfl_encoding_detector *identd);
MBFLAPI extern int mbfl_encoding_detector_feed(mbfl_encoding_detector *identd, mbfl_string *string);
-MBFLAPI extern enum mbfl_no_encoding mbfl_encoding_detector_judge(mbfl_encoding_detector *identd);
-MBFLAPI extern const mbfl_encoding *mbfl_encoding_detector_judge2(mbfl_encoding_detector *identd);
+MBFLAPI extern const mbfl_encoding *mbfl_encoding_detector_judge(mbfl_encoding_detector *identd);
/*
* encoding converter
*/
MBFLAPI extern mbfl_string *
-mbfl_convert_encoding(mbfl_string *string, mbfl_string *result, enum mbfl_no_encoding toenc);
+mbfl_convert_encoding(mbfl_string *string, mbfl_string *result, const mbfl_encoding *toenc);
/*
* identify encoding
*/
MBFLAPI extern const mbfl_encoding *
-mbfl_identify_encoding(mbfl_string *string, enum mbfl_no_encoding *elist, int elistsz, int strict);
+mbfl_identify_encoding(mbfl_string *string, const mbfl_encoding **elist, int elistsz, int strict);
+
+/* Lengths -1 through -16 are reserved for error return values */
+static inline int mbfl_is_error(size_t len) {
+ return len >= (size_t) -16;
+}
-MBFLAPI extern const mbfl_encoding *
-mbfl_identify_encoding2(mbfl_string *string, const mbfl_encoding **elist, int elistsz, int strict);
/*
* strlen
*/
-MBFLAPI extern int
+MBFLAPI extern size_t
mbfl_strlen(mbfl_string *string);
/*
* oddlen
*/
-MBFLAPI extern int
+MBFLAPI extern size_t
mbfl_oddlen(mbfl_string *string);
/*
* strpos
*/
-MBFLAPI extern int
-mbfl_strpos(mbfl_string *haystack, mbfl_string *needle, int offset, int reverse);
-
+MBFLAPI extern size_t
+mbfl_strpos(mbfl_string *haystack, mbfl_string *needle, ssize_t offset, int reverse);
/*
* substr_count
*/
-MBFLAPI extern int
+MBFLAPI extern size_t
mbfl_substr_count(mbfl_string *haystack, mbfl_string *needle);
/*
+ * If specified as length, the substr until the end of the string is taken.
+ */
+#define MBFL_SUBSTR_UNTIL_END ((size_t) -1)
+
+/*
* substr
*/
MBFLAPI extern mbfl_string *
-mbfl_substr(mbfl_string *string, mbfl_string *result, int from, int length);
+mbfl_substr(mbfl_string *string, mbfl_string *result, size_t from, size_t length);
/*
* strcut
*/
MBFLAPI extern mbfl_string *
-mbfl_strcut(mbfl_string *string, mbfl_string *result, int from, int length);
+mbfl_strcut(mbfl_string *string, mbfl_string *result, size_t from, size_t length);
/*
* strwidth
*/
-MBFLAPI extern int
+MBFLAPI extern size_t
mbfl_strwidth(mbfl_string *string);
/*
* strimwidth
*/
MBFLAPI extern mbfl_string *
-mbfl_strimwidth(mbfl_string *string, mbfl_string *marker, mbfl_string *result, int from, int width);
+mbfl_strimwidth(mbfl_string *string, mbfl_string *marker, mbfl_string *result, size_t from, size_t width);
/*
* MIME header encode
@@ -231,9 +246,9 @@ struct mime_header_encoder_data; /* forward declaration */
MBFLAPI extern struct mime_header_encoder_data *
mime_header_encoder_new(
- enum mbfl_no_encoding incode,
- enum mbfl_no_encoding outcode,
- enum mbfl_no_encoding encoding);
+ const mbfl_encoding *incode,
+ const mbfl_encoding *outcode,
+ const mbfl_encoding *encoding);
MBFLAPI extern void
mime_header_encoder_delete(struct mime_header_encoder_data *pe);
@@ -247,8 +262,8 @@ mime_header_encoder_result(struct mime_header_encoder_data *pe, mbfl_string *res
MBFLAPI extern mbfl_string *
mbfl_mime_header_encode(
mbfl_string *string, mbfl_string *result,
- enum mbfl_no_encoding outcode,
- enum mbfl_no_encoding encoding,
+ const mbfl_encoding *outcode,
+ const mbfl_encoding *encoding,
const char *linefeed,
int indent);
@@ -258,7 +273,7 @@ mbfl_mime_header_encode(
struct mime_header_decoder_data; /* forward declaration */
MBFLAPI extern struct mime_header_decoder_data *
-mime_header_decoder_new(enum mbfl_no_encoding outcode);
+mime_header_decoder_new(const mbfl_encoding *outcode);
MBFLAPI extern void
mime_header_decoder_delete(struct mime_header_decoder_data *pd);
@@ -273,7 +288,7 @@ MBFLAPI extern mbfl_string *
mbfl_mime_header_decode(
mbfl_string *string,
mbfl_string *result,
- enum mbfl_no_encoding outcode);
+ const mbfl_encoding *outcode);
/*
* convert HTML numeric entity
diff --git a/ext/mbstring/libmbfl/mbfl/mbfilter_8bit.c b/ext/mbstring/libmbfl/mbfl/mbfilter_8bit.c
index ed79746f6a..4faa9b8b1b 100644
--- a/ext/mbstring/libmbfl/mbfl/mbfilter_8bit.c
+++ b/ext/mbstring/libmbfl/mbfl/mbfilter_8bit.c
@@ -46,5 +46,7 @@ const mbfl_encoding mbfl_encoding_8bit = {
"8bit",
(const char *(*)[])&mbfl_encoding_8bit_aliases,
NULL,
- MBFL_ENCTYPE_SBCS
+ MBFL_ENCTYPE_SBCS,
+ NULL,
+ NULL
};
diff --git a/ext/mbstring/libmbfl/mbfl/mbfilter_pass.c b/ext/mbstring/libmbfl/mbfl/mbfilter_pass.c
index b19432f76a..a9c6fd4204 100644
--- a/ext/mbstring/libmbfl/mbfl/mbfilter_pass.c
+++ b/ext/mbstring/libmbfl/mbfl/mbfilter_pass.c
@@ -46,7 +46,9 @@ const mbfl_encoding mbfl_encoding_pass = {
NULL,
(const char *(*)[])&mbfl_encoding_pass_aliases,
NULL,
- 0
+ 0,
+ NULL,
+ NULL
};
const struct mbfl_convert_vtbl vtbl_pass = {
diff --git a/ext/mbstring/libmbfl/mbfl/mbfilter_wchar.c b/ext/mbstring/libmbfl/mbfl/mbfilter_wchar.c
index ace81b4c72..97142a16cb 100644
--- a/ext/mbstring/libmbfl/mbfl/mbfilter_wchar.c
+++ b/ext/mbstring/libmbfl/mbfl/mbfilter_wchar.c
@@ -44,5 +44,7 @@ const mbfl_encoding mbfl_encoding_wchar = {
NULL,
NULL,
NULL,
- MBFL_ENCTYPE_WCS4BE
+ MBFL_ENCTYPE_WCS4BE,
+ NULL,
+ NULL
};
diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_allocators.c b/ext/mbstring/libmbfl/mbfl/mbfl_allocators.c
index f52c94cf37..aa468da252 100644
--- a/ext/mbstring/libmbfl/mbfl/mbfl_allocators.c
+++ b/ext/mbstring/libmbfl/mbfl/mbfl_allocators.c
@@ -54,9 +54,9 @@
#include "mbfl_allocators.h"
-static void *__mbfl__malloc(unsigned int);
-static void *__mbfl__realloc(void *, unsigned int);
-static void *__mbfl__calloc(unsigned int, unsigned int);
+static void *__mbfl__malloc(size_t);
+static void *__mbfl__realloc(void *, size_t);
+static void *__mbfl__calloc(size_t, size_t);
static void __mbfl__free(void *);
static mbfl_allocators default_allocators = {
@@ -71,17 +71,17 @@ static mbfl_allocators default_allocators = {
mbfl_allocators *__mbfl_allocators = &default_allocators;
-static void *__mbfl__malloc(unsigned int sz)
+static void *__mbfl__malloc(size_t sz)
{
return malloc(sz);
}
-static void *__mbfl__realloc(void *ptr, unsigned int sz)
+static void *__mbfl__realloc(void *ptr, size_t sz)
{
return realloc(ptr, sz);
}
-static void *__mbfl__calloc(unsigned int nelems, unsigned int szelem)
+static void *__mbfl__calloc(size_t nelems, size_t szelem)
{
return calloc(nelems, szelem);
}
diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_allocators.h b/ext/mbstring/libmbfl/mbfl/mbfl_allocators.h
index b2981c6f1f..08fc275d04 100644
--- a/ext/mbstring/libmbfl/mbfl/mbfl_allocators.h
+++ b/ext/mbstring/libmbfl/mbfl/mbfl_allocators.h
@@ -31,15 +31,16 @@
#ifndef MBFL_ALLOCATORS_H
#define MBFL_ALLOCATORS_H
+#include <stddef.h>
#include "mbfl_defs.h"
typedef struct _mbfl_allocators {
- void *(*malloc)(unsigned int);
- void *(*realloc)(void *, unsigned int);
- void *(*calloc)(unsigned int, unsigned int);
+ void *(*malloc)(size_t);
+ void *(*realloc)(void *, size_t);
+ void *(*calloc)(size_t, size_t);
void (*free)(void *);
- void *(*pmalloc)(unsigned int);
- void *(*prealloc)(void *, unsigned int);
+ void *(*pmalloc)(size_t);
+ void *(*prealloc)(void *, size_t);
void (*pfree)(void *);
} mbfl_allocators;
diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_convert.c b/ext/mbstring/libmbfl/mbfl/mbfl_convert.c
index a73a0c80e5..7a0fb60264 100644
--- a/ext/mbstring/libmbfl/mbfl/mbfl_convert.c
+++ b/ext/mbstring/libmbfl/mbfl/mbfl_convert.c
@@ -110,170 +110,14 @@ static char mbfl_hexchar_table[] = {
0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x41,0x42,0x43,0x44,0x45,0x46
};
-const struct mbfl_convert_vtbl *mbfl_convert_filter_list[] = {
- &vtbl_utf8_wchar,
- &vtbl_wchar_utf8,
- &vtbl_eucjp_wchar,
- &vtbl_wchar_eucjp,
- &vtbl_sjis_wchar,
- &vtbl_wchar_sjis,
- &vtbl_sjis_open_wchar,
- &vtbl_wchar_sjis_open,
- &vtbl_sjis2004_wchar,
- &vtbl_wchar_sjis2004,
- &vtbl_cp51932_wchar,
- &vtbl_wchar_cp51932,
- &vtbl_jis_wchar,
- &vtbl_wchar_jis,
- &vtbl_jis_ms_wchar,
- &vtbl_wchar_jis_ms,
- &vtbl_2022jp_wchar,
- &vtbl_wchar_2022jp,
- &vtbl_2022jpms_wchar,
- &vtbl_wchar_2022jpms,
- &vtbl_2022jp_2004_wchar,
- &vtbl_wchar_2022jp_2004,
- &vtbl_2022jp_kddi_wchar,
- &vtbl_wchar_2022jp_kddi,
- &vtbl_eucjpwin_wchar,
- &vtbl_wchar_eucjpwin,
- &vtbl_eucjp2004_wchar,
- &vtbl_wchar_eucjp2004,
- &vtbl_cp932_wchar,
- &vtbl_wchar_cp932,
- &vtbl_sjis_docomo_wchar,
- &vtbl_wchar_sjis_docomo,
- &vtbl_sjis_kddi_wchar,
- &vtbl_wchar_sjis_kddi,
- &vtbl_sjis_sb_wchar,
- &vtbl_wchar_sjis_sb,
- &vtbl_sjis_mac_wchar,
- &vtbl_wchar_sjis_mac,
- &vtbl_utf8_docomo_wchar,
- &vtbl_wchar_utf8_docomo,
- &vtbl_utf8_kddi_a_wchar,
- &vtbl_wchar_utf8_kddi_a,
- &vtbl_utf8_kddi_b_wchar,
- &vtbl_wchar_utf8_kddi_b,
- &vtbl_utf8_sb_wchar,
- &vtbl_wchar_utf8_sb,
- &vtbl_euccn_wchar,
- &vtbl_wchar_euccn,
- &vtbl_cp936_wchar,
- &vtbl_wchar_cp936,
- &vtbl_gb18030_wchar,
- &vtbl_wchar_gb18030,
- &vtbl_hz_wchar,
- &vtbl_wchar_hz,
- &vtbl_euctw_wchar,
- &vtbl_wchar_euctw,
- &vtbl_big5_wchar,
- &vtbl_wchar_big5,
- &vtbl_cp950_wchar,
- &vtbl_wchar_cp950,
- &vtbl_euckr_wchar,
- &vtbl_wchar_euckr,
- &vtbl_uhc_wchar,
- &vtbl_wchar_uhc,
- &vtbl_2022kr_wchar,
- &vtbl_wchar_2022kr,
- &vtbl_cp1251_wchar,
- &vtbl_wchar_cp1251,
- &vtbl_cp866_wchar,
- &vtbl_wchar_cp866,
- &vtbl_koi8r_wchar,
- &vtbl_wchar_koi8r,
- &vtbl_koi8u_wchar,
- &vtbl_wchar_koi8u,
- &vtbl_cp1252_wchar,
- &vtbl_wchar_cp1252,
- &vtbl_cp1254_wchar,
- &vtbl_wchar_cp1254,
- &vtbl_cp50220_wchar,
- &vtbl_wchar_cp50220,
- &vtbl_cp50220raw_wchar,
- &vtbl_wchar_cp50220raw,
- &vtbl_cp50221_wchar,
- &vtbl_wchar_cp50221,
- &vtbl_cp50222_wchar,
- &vtbl_wchar_cp50222,
- &vtbl_ascii_wchar,
- &vtbl_wchar_ascii,
- &vtbl_8859_1_wchar,
- &vtbl_wchar_8859_1,
- &vtbl_8859_2_wchar,
- &vtbl_wchar_8859_2,
- &vtbl_8859_3_wchar,
- &vtbl_wchar_8859_3,
- &vtbl_8859_4_wchar,
- &vtbl_wchar_8859_4,
- &vtbl_8859_5_wchar,
- &vtbl_wchar_8859_5,
- &vtbl_8859_6_wchar,
- &vtbl_wchar_8859_6,
- &vtbl_8859_7_wchar,
- &vtbl_wchar_8859_7,
- &vtbl_8859_8_wchar,
- &vtbl_wchar_8859_8,
- &vtbl_8859_9_wchar,
- &vtbl_wchar_8859_9,
- &vtbl_8859_10_wchar,
- &vtbl_wchar_8859_10,
- &vtbl_8859_13_wchar,
- &vtbl_wchar_8859_13,
- &vtbl_8859_14_wchar,
- &vtbl_wchar_8859_14,
- &vtbl_8859_15_wchar,
- &vtbl_wchar_8859_15,
+static const struct mbfl_convert_vtbl *mbfl_special_filter_list[] = {
&vtbl_8bit_b64,
&vtbl_b64_8bit,
&vtbl_uuencode_8bit,
- &vtbl_wchar_html,
- &vtbl_html_wchar,
&vtbl_8bit_qprint,
&vtbl_qprint_8bit,
&vtbl_8bit_7bit,
&vtbl_7bit_8bit,
- &vtbl_utf7_wchar,
- &vtbl_wchar_utf7,
- &vtbl_utf7imap_wchar,
- &vtbl_wchar_utf7imap,
- &vtbl_utf16_wchar,
- &vtbl_wchar_utf16,
- &vtbl_utf16be_wchar,
- &vtbl_wchar_utf16be,
- &vtbl_utf16le_wchar,
- &vtbl_wchar_utf16le,
- &vtbl_utf32_wchar,
- &vtbl_wchar_utf32,
- &vtbl_utf32be_wchar,
- &vtbl_wchar_utf32be,
- &vtbl_utf32le_wchar,
- &vtbl_wchar_utf32le,
- &vtbl_ucs4_wchar,
- &vtbl_wchar_ucs4,
- &vtbl_ucs4be_wchar,
- &vtbl_wchar_ucs4be,
- &vtbl_ucs4le_wchar,
- &vtbl_wchar_ucs4le,
- &vtbl_ucs2_wchar,
- &vtbl_wchar_ucs2,
- &vtbl_ucs2be_wchar,
- &vtbl_wchar_ucs2be,
- &vtbl_ucs2le_wchar,
- &vtbl_wchar_ucs2le,
- &vtbl_byte4be_wchar,
- &vtbl_wchar_byte4be,
- &vtbl_byte4le_wchar,
- &vtbl_wchar_byte4le,
- &vtbl_byte2be_wchar,
- &vtbl_wchar_byte2be,
- &vtbl_byte2le_wchar,
- &vtbl_wchar_byte2le,
- &vtbl_armscii8_wchar,
- &vtbl_wchar_armscii8,
- &vtbl_cp850_wchar,
- &vtbl_wchar_cp850,
&vtbl_pass,
NULL
};
@@ -281,21 +125,16 @@ const struct mbfl_convert_vtbl *mbfl_convert_filter_list[] = {
static int
mbfl_convert_filter_common_init(
mbfl_convert_filter *filter,
- enum mbfl_no_encoding from,
- enum mbfl_no_encoding to,
+ const mbfl_encoding *from,
+ const mbfl_encoding *to,
const struct mbfl_convert_vtbl *vtbl,
int (*output_function)(int, void* ),
int (*flush_function)(void*),
void* data)
{
/* encoding structure */
- if ((filter->from = mbfl_no2encoding(from)) == NULL) {
- return 1;
- }
-
- if ((filter->to = mbfl_no2encoding(to)) == NULL) {
- return 1;
- }
+ filter->from = from;
+ filter->to = to;
if (output_function != NULL) {
filter->output_function = output_function;
@@ -322,8 +161,8 @@ mbfl_convert_filter_common_init(
mbfl_convert_filter *
mbfl_convert_filter_new(
- enum mbfl_no_encoding from,
- enum mbfl_no_encoding to,
+ const mbfl_encoding *from,
+ const mbfl_encoding *to,
int (*output_function)(int, void* ),
int (*flush_function)(void*),
void* data)
@@ -360,18 +199,22 @@ mbfl_convert_filter_new2(
void* data)
{
mbfl_convert_filter * filter;
+ const mbfl_encoding *from_encoding, *to_encoding;
if (vtbl == NULL) {
vtbl = &vtbl_pass;
}
+ from_encoding = mbfl_no2encoding(vtbl->from);
+ to_encoding = mbfl_no2encoding(vtbl->to);
+
/* allocate */
filter = (mbfl_convert_filter *)mbfl_malloc(sizeof(mbfl_convert_filter));
if (filter == NULL) {
return NULL;
}
- if (mbfl_convert_filter_common_init(filter, vtbl->from, vtbl->to, vtbl,
+ if (mbfl_convert_filter_common_init(filter, from_encoding, to_encoding, vtbl,
output_function, flush_function, data)) {
mbfl_free(filter);
return NULL;
@@ -396,6 +239,17 @@ mbfl_convert_filter_feed(int c, mbfl_convert_filter *filter)
}
int
+mbfl_convert_filter_feed_string(mbfl_convert_filter *filter, const unsigned char *p, size_t len) {
+ while (len > 0) {
+ if ((*filter->filter_function)(*p++, filter) < 0) {
+ return -1;
+ }
+ len--;
+ }
+ return 0;
+}
+
+int
mbfl_convert_filter_flush(mbfl_convert_filter *filter)
{
(*filter->filter_flush)(filter);
@@ -403,7 +257,7 @@ mbfl_convert_filter_flush(mbfl_convert_filter *filter)
}
void mbfl_convert_filter_reset(mbfl_convert_filter *filter,
- enum mbfl_no_encoding from, enum mbfl_no_encoding to)
+ const mbfl_encoding *from, const mbfl_encoding *to)
{
const struct mbfl_convert_vtbl *vtbl;
@@ -435,7 +289,7 @@ mbfl_convert_filter_copy(
int mbfl_convert_filter_devcat(mbfl_convert_filter *filter, mbfl_memory_device *src)
{
- int n;
+ size_t n;
unsigned char *p;
p = src->buffer;
@@ -447,7 +301,7 @@ int mbfl_convert_filter_devcat(mbfl_convert_filter *filter, mbfl_memory_device *
n--;
}
- return n;
+ return 0;
}
int mbfl_convert_filter_strcat(mbfl_convert_filter *filter, const unsigned char *p)
@@ -587,29 +441,33 @@ mbfl_filt_conv_illegal_output(int c, mbfl_convert_filter *filter)
return ret;
}
-const struct mbfl_convert_vtbl * mbfl_convert_filter_get_vtbl(enum mbfl_no_encoding from, enum mbfl_no_encoding to)
+const struct mbfl_convert_vtbl * mbfl_convert_filter_get_vtbl(
+ const mbfl_encoding *from, const mbfl_encoding *to)
{
- const struct mbfl_convert_vtbl *vtbl;
- int i;
-
- if (to == mbfl_no_encoding_base64 ||
- to == mbfl_no_encoding_qprint ||
- to == mbfl_no_encoding_7bit) {
- from = mbfl_no_encoding_8bit;
- } else if (from == mbfl_no_encoding_base64 ||
- from == mbfl_no_encoding_qprint ||
- from == mbfl_no_encoding_uuencode) {
- to = mbfl_no_encoding_8bit;
+ if (to->no_encoding == mbfl_no_encoding_base64 ||
+ to->no_encoding == mbfl_no_encoding_qprint ||
+ to->no_encoding == mbfl_no_encoding_7bit) {
+ from = &mbfl_encoding_8bit;
+ } else if (from->no_encoding == mbfl_no_encoding_base64 ||
+ from->no_encoding == mbfl_no_encoding_qprint ||
+ from->no_encoding == mbfl_no_encoding_uuencode) {
+ to = &mbfl_encoding_8bit;
}
- i = 0;
- while ((vtbl = mbfl_convert_filter_list[i++]) != NULL){
- if (vtbl->from == from && vtbl->to == to) {
- return vtbl;
+ if (to->no_encoding == mbfl_no_encoding_wchar) {
+ return from->input_filter;
+ } else if (from->no_encoding == mbfl_no_encoding_wchar) {
+ return to->output_filter;
+ } else {
+ int i = 0;
+ const struct mbfl_convert_vtbl *vtbl;
+ while ((vtbl = mbfl_special_filter_list[i++]) != NULL){
+ if (vtbl->from == from->no_encoding && vtbl->to == to->no_encoding) {
+ return vtbl;
+ }
}
+ return NULL;
}
-
- return NULL;
}
/*
diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_convert.h b/ext/mbstring/libmbfl/mbfl/mbfl_convert.h
index ad0911723a..31e54c61d1 100644
--- a/ext/mbstring/libmbfl/mbfl/mbfl_convert.h
+++ b/ext/mbstring/libmbfl/mbfl/mbfl_convert.h
@@ -52,25 +52,13 @@ struct _mbfl_convert_filter {
const mbfl_encoding *to;
int illegal_mode;
int illegal_substchar;
- int num_illegalchar;
+ size_t num_illegalchar;
void *opaque;
};
-struct mbfl_convert_vtbl {
- enum mbfl_no_encoding from;
- enum mbfl_no_encoding to;
- void (*filter_ctor)(mbfl_convert_filter *filter);
- void (*filter_dtor)(mbfl_convert_filter *filter);
- int (*filter_function)(int c, mbfl_convert_filter *filter);
- int (*filter_flush)(mbfl_convert_filter *filter);
- void (*filter_copy)(mbfl_convert_filter *src, mbfl_convert_filter *dest);
-};
-
-MBFLAPI extern const struct mbfl_convert_vtbl *mbfl_convert_filter_list[];
-
MBFLAPI extern mbfl_convert_filter *mbfl_convert_filter_new(
- enum mbfl_no_encoding from,
- enum mbfl_no_encoding to,
+ const mbfl_encoding *from,
+ const mbfl_encoding *to,
int (*output_function)(int, void *),
int (*flush_function)(void *),
void *data );
@@ -81,11 +69,12 @@ MBFLAPI extern mbfl_convert_filter *mbfl_convert_filter_new2(
void *data );
MBFLAPI extern void mbfl_convert_filter_delete(mbfl_convert_filter *filter);
MBFLAPI extern int mbfl_convert_filter_feed(int c, mbfl_convert_filter *filter);
+MBFLAPI extern int mbfl_convert_filter_feed_string(mbfl_convert_filter *filter, const unsigned char *p, size_t len);
MBFLAPI extern int mbfl_convert_filter_flush(mbfl_convert_filter *filter);
-MBFLAPI extern void mbfl_convert_filter_reset(mbfl_convert_filter *filter, enum mbfl_no_encoding from, enum mbfl_no_encoding to);
+MBFLAPI extern void mbfl_convert_filter_reset(mbfl_convert_filter *filter, const mbfl_encoding *from, const mbfl_encoding *to);
MBFLAPI extern void mbfl_convert_filter_copy(mbfl_convert_filter *src, mbfl_convert_filter *dist);
MBFLAPI extern int mbfl_filt_conv_illegal_output(int c, mbfl_convert_filter *filter);
-MBFLAPI extern const struct mbfl_convert_vtbl * mbfl_convert_filter_get_vtbl(enum mbfl_no_encoding from, enum mbfl_no_encoding to);
+MBFLAPI extern const struct mbfl_convert_vtbl * mbfl_convert_filter_get_vtbl(const mbfl_encoding *from, const mbfl_encoding *to);
MBFLAPI extern void mbfl_filt_conv_common_ctor(mbfl_convert_filter *filter);
MBFLAPI extern int mbfl_filt_conv_common_flush(mbfl_convert_filter *filter);
diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_defs.h b/ext/mbstring/libmbfl/mbfl/mbfl_defs.h
index 753724d7be..8b18e5e0c4 100644
--- a/ext/mbstring/libmbfl/mbfl/mbfl_defs.h
+++ b/ext/mbstring/libmbfl/mbfl/mbfl_defs.h
@@ -39,6 +39,10 @@
#endif
#endif
+#ifndef SIZE_MAX
+#define SIZE_MAX ((size_t)~0)
+#endif
+
#ifdef WIN32
#ifdef MBFL_DLL_EXPORT
#define MBFLAPI __declspec(dllexport)
diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_encoding.c b/ext/mbstring/libmbfl/mbfl/mbfl_encoding.c
index e03c2acaff..77c5daeeff 100644
--- a/ext/mbstring/libmbfl/mbfl/mbfl_encoding.c
+++ b/ext/mbstring/libmbfl/mbfl/mbfl_encoding.c
@@ -127,7 +127,9 @@ static const mbfl_encoding mbfl_encoding_auto = {
NULL,
(const char *(*)[])&mbfl_encoding_auto_aliases,
NULL,
- 0
+ 0,
+ NULL,
+ NULL
};
static const mbfl_encoding *mbfl_encoding_ptr_list[] = {
diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_encoding.h b/ext/mbstring/libmbfl/mbfl/mbfl_encoding.h
index d080f7b6a4..2952977fd8 100644
--- a/ext/mbstring/libmbfl/mbfl/mbfl_encoding.h
+++ b/ext/mbstring/libmbfl/mbfl/mbfl_encoding.h
@@ -128,6 +128,17 @@ enum mbfl_no_encoding {
typedef enum mbfl_no_encoding mbfl_encoding_id;
+struct _mbfl_convert_filter;
+struct mbfl_convert_vtbl {
+ enum mbfl_no_encoding from;
+ enum mbfl_no_encoding to;
+ void (*filter_ctor)(struct _mbfl_convert_filter *filter);
+ void (*filter_dtor)(struct _mbfl_convert_filter *filter);
+ int (*filter_function)(int c, struct _mbfl_convert_filter *filter);
+ int (*filter_flush)(struct _mbfl_convert_filter *filter);
+ void (*filter_copy)(struct _mbfl_convert_filter *src, struct _mbfl_convert_filter *dest);
+};
+
/*
* encoding
*/
@@ -138,6 +149,8 @@ typedef struct _mbfl_encoding {
const char *(*aliases)[];
const unsigned char *mblen_table;
unsigned int flag;
+ const struct mbfl_convert_vtbl *input_filter;
+ const struct mbfl_convert_vtbl *output_filter;
} mbfl_encoding;
MBFLAPI extern const mbfl_encoding * mbfl_name2encoding(const char *name);
diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_memory_device.c b/ext/mbstring/libmbfl/mbfl/mbfl_memory_device.c
index eae05953b2..bfa477fa06 100644
--- a/ext/mbstring/libmbfl/mbfl/mbfl_memory_device.c
+++ b/ext/mbstring/libmbfl/mbfl/mbfl_memory_device.c
@@ -36,6 +36,7 @@
#include <stddef.h>
#endif
+#include <string.h>
#include "mbfl_allocators.h"
#include "mbfl_string.h"
#include "mbfl_memory_device.h"
@@ -44,18 +45,18 @@
* memory device output functions
*/
void
-mbfl_memory_device_init(mbfl_memory_device *device, int initsz, int allocsz)
+mbfl_memory_device_init(mbfl_memory_device *device, size_t initsz, size_t allocsz)
{
if (device) {
device->length = 0;
- device->buffer = (unsigned char *)0;
+ device->buffer = NULL;
if (initsz > 0) {
- device->buffer = (unsigned char *)mbfl_malloc(initsz*sizeof(unsigned char));
+ device->buffer = (unsigned char *)mbfl_malloc(initsz);
if (device->buffer != NULL) {
device->length = initsz;
}
}
- device->pos= 0;
+ device->pos = 0;
if (allocsz > MBFL_MEMORY_DEVICE_ALLOC_SIZE) {
device->allocsz = allocsz;
} else {
@@ -65,13 +66,13 @@ mbfl_memory_device_init(mbfl_memory_device *device, int initsz, int allocsz)
}
void
-mbfl_memory_device_realloc(mbfl_memory_device *device, int initsz, int allocsz)
+mbfl_memory_device_realloc(mbfl_memory_device *device, size_t initsz, size_t allocsz)
{
unsigned char *tmp;
if (device) {
if (initsz > device->length) {
- tmp = (unsigned char *)mbfl_realloc((void *)device->buffer, initsz*sizeof(unsigned char));
+ tmp = (unsigned char *)mbfl_realloc((void *)device->buffer, initsz);
if (tmp != NULL) {
device->buffer = tmp;
device->length = initsz;
@@ -92,7 +93,7 @@ mbfl_memory_device_clear(mbfl_memory_device *device)
if (device->buffer) {
mbfl_free(device->buffer);
}
- device->buffer = (unsigned char *)0;
+ device->buffer = NULL;
device->length = 0;
device->pos = 0;
}
@@ -119,9 +120,9 @@ mbfl_memory_device_result(mbfl_memory_device *device, mbfl_string *result)
{
if (device && result) {
result->len = device->pos;
- mbfl_memory_device_output4('\0', device);
+ mbfl_memory_device_output('\0', device);
result->val = device->buffer;
- device->buffer = (unsigned char *)0;
+ device->buffer = NULL;
device->length = 0;
device->pos= 0;
if (result->val == NULL) {
@@ -142,15 +143,16 @@ mbfl_memory_device_output(int c, void *data)
if (device->pos >= device->length) {
/* reallocate buffer */
- int newlen;
+ size_t newlen;
unsigned char *tmp;
- newlen = device->length + device->allocsz;
- if (newlen <= 0) {
+ if (device->length > SIZE_MAX - device->allocsz) {
/* overflow */
return -1;
}
- tmp = (unsigned char *)mbfl_realloc((void *)device->buffer, newlen*sizeof(unsigned char));
+
+ newlen = device->length + device->allocsz;
+ tmp = (unsigned char *)mbfl_realloc((void *)device->buffer, newlen);
if (tmp == NULL) {
return -1;
}
@@ -167,17 +169,18 @@ mbfl_memory_device_output2(int c, void *data)
{
mbfl_memory_device *device = (mbfl_memory_device *)data;
- if ((device->pos + 2) >= device->length) {
+ if (2 > device->length - device->pos) {
/* reallocate buffer */
- int newlen;
+ size_t newlen;
unsigned char *tmp;
- newlen = device->length + device->allocsz;
- if (newlen <= 0) {
+ if (device->length > SIZE_MAX - device->allocsz) {
/* overflow */
return -1;
}
- tmp = (unsigned char *)mbfl_realloc((void *)device->buffer, newlen*sizeof(unsigned char));
+
+ newlen = device->length + device->allocsz;
+ tmp = (unsigned char *)mbfl_realloc((void *)device->buffer, newlen);
if (tmp == NULL) {
return -1;
}
@@ -196,17 +199,18 @@ mbfl_memory_device_output4(int c, void* data)
{
mbfl_memory_device *device = (mbfl_memory_device *)data;
- if ((device->pos + 4) >= device->length) {
+ if (4 > device->length - device->pos) {
/* reallocate buffer */
- int newlen;
+ size_t newlen;
unsigned char *tmp;
- newlen = device->length + device->allocsz;
- if (newlen <= 0) {
+ if (device->length > SIZE_MAX - device->allocsz) {
/* overflow */
return -1;
}
- tmp = (unsigned char *)mbfl_realloc((void *)device->buffer, newlen*sizeof(unsigned char));
+
+ newlen = device->length + device->allocsz;
+ tmp = (unsigned char *)mbfl_realloc((void *)device->buffer, newlen);
if (tmp == NULL) {
return -1;
}
@@ -225,114 +229,53 @@ mbfl_memory_device_output4(int c, void* data)
int
mbfl_memory_device_strcat(mbfl_memory_device *device, const char *psrc)
{
- int len;
- unsigned char *w;
- const unsigned char *p;
-
- len = 0;
- p = (const unsigned char*)psrc;
- while (*p) {
- p++;
- len++;
- }
-
- if ((device->pos + len) >= device->length) {
- /* reallocate buffer */
- int newlen = device->length + (len + MBFL_MEMORY_DEVICE_ALLOC_SIZE)*sizeof(unsigned char);
- unsigned char *tmp;
- if (newlen <= 0) {
- /* overflow */
- return -1;
- }
- tmp = (unsigned char *)mbfl_realloc((void *)device->buffer, newlen*sizeof(unsigned char));
- if (tmp == NULL) {
- return -1;
- }
- device->length = newlen;
- device->buffer = tmp;
- }
-
- p = (const unsigned char*)psrc;
- w = &device->buffer[device->pos];
- device->pos += len;
- while (len > 0) {
- *w++ = *p++;
- len--;
- }
-
- return len;
+ return mbfl_memory_device_strncat(device, psrc, strlen(psrc));
}
int
-mbfl_memory_device_strncat(mbfl_memory_device *device, const char *psrc, int len)
+mbfl_memory_device_strncat(mbfl_memory_device *device, const char *psrc, size_t len)
{
unsigned char *w;
- if ((device->pos + len) >= device->length) {
+ if (len > device->length - device->pos) {
/* reallocate buffer */
- int newlen = device->length + len + MBFL_MEMORY_DEVICE_ALLOC_SIZE;
+ size_t newlen;
unsigned char *tmp;
- if (newlen <= 0) {
+
+ if (len > SIZE_MAX - MBFL_MEMORY_DEVICE_ALLOC_SIZE
+ || device->length > SIZE_MAX - (len + MBFL_MEMORY_DEVICE_ALLOC_SIZE)) {
/* overflow */
return -1;
}
- tmp = (unsigned char *)mbfl_realloc((void *)device->buffer, newlen*sizeof(unsigned char));
+
+ newlen = device->length + len + MBFL_MEMORY_DEVICE_ALLOC_SIZE;
+ tmp = (unsigned char *)mbfl_realloc((void *)device->buffer, newlen);
if (tmp == NULL) {
return -1;
}
+
device->length = newlen;
device->buffer = tmp;
}
w = &device->buffer[device->pos];
+ memcpy(w, psrc, len);
device->pos += len;
- while (len > 0) {
- *w++ = *psrc++;
- len--;
- }
- return len;
+ return 0;
}
int
mbfl_memory_device_devcat(mbfl_memory_device *dest, mbfl_memory_device *src)
{
- int n;
- unsigned char *p, *w;
-
- if ((dest->pos + src->pos) >= dest->length) {
- /* reallocate buffer */
- int newlen = dest->length + src->pos + MBFL_MEMORY_DEVICE_ALLOC_SIZE;
- unsigned char *tmp;
- if (newlen <= 0) {
- /* overflow */
- return -1;
- }
- tmp = (unsigned char *)mbfl_realloc((void *)dest->buffer, newlen*sizeof(unsigned char));
- if (tmp == NULL) {
- return -1;
- }
- dest->length = newlen;
- dest->buffer = tmp;
- }
-
- p = src->buffer;
- w = &dest->buffer[dest->pos];
- n = src->pos;
- dest->pos += n;
- while (n > 0) {
- *w++ = *p++;
- n--;
- }
-
- return n;
+ return mbfl_memory_device_strncat(dest, (const char *) src->buffer, src->pos);
}
void
mbfl_wchar_device_init(mbfl_wchar_device *device)
{
if (device) {
- device->buffer = (unsigned int *)0;
+ device->buffer = NULL;
device->length = 0;
device->pos= 0;
device->allocsz = MBFL_MEMORY_DEVICE_ALLOC_SIZE;
@@ -346,7 +289,7 @@ mbfl_wchar_device_clear(mbfl_wchar_device *device)
if (device->buffer) {
mbfl_free(device->buffer);
}
- device->buffer = (unsigned int*)0;
+ device->buffer = NULL;
device->length = 0;
device->pos = 0;
}
@@ -359,14 +302,20 @@ mbfl_wchar_device_output(int c, void *data)
if (device->pos >= device->length) {
/* reallocate buffer */
- int newlen;
+ size_t newlen;
unsigned int *tmp;
+ if (device->length > SIZE_MAX - device->allocsz) {
+ /* overflow */
+ return -1;
+ }
+
newlen = device->length + device->allocsz;
- if (newlen <= 0) {
+ if (newlen > SIZE_MAX / sizeof(int)) {
/* overflow */
return -1;
}
+
tmp = (unsigned int *)mbfl_realloc((void *)device->buffer, newlen*sizeof(int));
if (tmp == NULL) {
return -1;
diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_memory_device.h b/ext/mbstring/libmbfl/mbfl/mbfl_memory_device.h
index 0e8a82f0e8..985e251158 100644
--- a/ext/mbstring/libmbfl/mbfl/mbfl_memory_device.h
+++ b/ext/mbstring/libmbfl/mbfl/mbfl_memory_device.h
@@ -38,29 +38,33 @@
typedef struct _mbfl_memory_device {
unsigned char *buffer;
- int length;
- int pos;
- int allocsz;
+ size_t length;
+ size_t pos;
+ size_t allocsz;
} mbfl_memory_device;
typedef struct _mbfl_wchar_device {
unsigned int *buffer;
- int length;
- int pos;
- int allocsz;
+ size_t length;
+ size_t pos;
+ size_t allocsz;
} mbfl_wchar_device;
-MBFLAPI extern void mbfl_memory_device_init(mbfl_memory_device *device, int initsz, int allocsz);
-MBFLAPI extern void mbfl_memory_device_realloc(mbfl_memory_device *device, int initsz, int allocsz);
+MBFLAPI extern void mbfl_memory_device_init(
+ mbfl_memory_device *device, size_t initsz, size_t allocsz);
+MBFLAPI extern void mbfl_memory_device_realloc(
+ mbfl_memory_device *device, size_t initsz, size_t allocsz);
MBFLAPI extern void mbfl_memory_device_clear(mbfl_memory_device *device);
MBFLAPI extern void mbfl_memory_device_reset(mbfl_memory_device *device);
-MBFLAPI extern mbfl_string * mbfl_memory_device_result(mbfl_memory_device *device, mbfl_string *result);
+MBFLAPI extern mbfl_string * mbfl_memory_device_result(
+ mbfl_memory_device *device, mbfl_string *result);
MBFLAPI extern void mbfl_memory_device_unput(mbfl_memory_device *device);
MBFLAPI extern int mbfl_memory_device_output(int c, void *data);
MBFLAPI extern int mbfl_memory_device_output2(int c, void *data);
MBFLAPI extern int mbfl_memory_device_output4(int c, void *data);
MBFLAPI extern int mbfl_memory_device_strcat(mbfl_memory_device *device, const char *psrc);
-MBFLAPI extern int mbfl_memory_device_strncat(mbfl_memory_device *device, const char *psrc, int len);
+MBFLAPI extern int mbfl_memory_device_strncat(
+ mbfl_memory_device *device, const char *psrc, size_t len);
MBFLAPI extern int mbfl_memory_device_devcat(mbfl_memory_device *dest, mbfl_memory_device *src);
MBFLAPI extern void mbfl_wchar_device_init(mbfl_wchar_device *device);
diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_string.c b/ext/mbstring/libmbfl/mbfl/mbfl_string.c
index 69f594350e..b26226500b 100644
--- a/ext/mbstring/libmbfl/mbfl/mbfl_string.c
+++ b/ext/mbstring/libmbfl/mbfl/mbfl_string.c
@@ -38,6 +38,7 @@
#include "mbfl_allocators.h"
#include "mbfl_string.h"
+#include "mbfilter_pass.h"
/*
* string object
@@ -47,18 +48,18 @@ mbfl_string_init(mbfl_string *string)
{
if (string) {
string->no_language = mbfl_no_language_uni;
- string->no_encoding = mbfl_no_encoding_pass;
+ string->encoding = &mbfl_encoding_pass;
string->val = (unsigned char*)NULL;
string->len = 0;
}
}
void
-mbfl_string_init_set(mbfl_string *string, mbfl_language_id no_language, mbfl_encoding_id no_encoding)
+mbfl_string_init_set(mbfl_string *string, mbfl_language_id no_language, const mbfl_encoding *encoding)
{
if (string) {
string->no_language = no_language;
- string->no_encoding = no_encoding;
+ string->encoding = encoding;
string->val = (unsigned char*)NULL;
string->len = 0;
}
diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_string.h b/ext/mbstring/libmbfl/mbfl/mbfl_string.h
index 560944737e..43f4a5fa75 100644
--- a/ext/mbstring/libmbfl/mbfl/mbfl_string.h
+++ b/ext/mbstring/libmbfl/mbfl/mbfl_string.h
@@ -31,6 +31,7 @@
#ifndef MBFL_STRING_H
#define MBFL_STRING_H
+#include <stddef.h>
#include "mbfl_defs.h"
#include "mbfl_encoding.h"
#include "mbfl_language.h"
@@ -40,13 +41,13 @@
*/
typedef struct _mbfl_string {
enum mbfl_no_language no_language;
- enum mbfl_no_encoding no_encoding;
+ const mbfl_encoding *encoding;
unsigned char *val;
- unsigned int len;
+ size_t len;
} mbfl_string;
MBFLAPI extern void mbfl_string_init(mbfl_string *string);
-MBFLAPI extern void mbfl_string_init_set(mbfl_string *string, mbfl_language_id no_language, mbfl_encoding_id no_encoding);
+MBFLAPI extern void mbfl_string_init_set(mbfl_string *string, mbfl_language_id no_language, const mbfl_encoding *encoding);
MBFLAPI extern void mbfl_string_clear(mbfl_string *string);
#ifndef NULL
diff --git a/ext/mbstring/mb_gpc.c b/ext/mbstring/mb_gpc.c
index dfe96ccf13..2a87ecc2e7 100644
--- a/ext/mbstring/mb_gpc.c
+++ b/ext/mbstring/mb_gpc.c
@@ -196,16 +196,16 @@ const mbfl_encoding *_php_mb_encoding_handler_ex(const php_mb_encoding_handler_i
const char *s1, *s2;
char *strtok_buf = NULL, **val_list = NULL;
zval *array_ptr = (zval *) arg;
- int n, num, *len_list = NULL;
+ size_t n, num, *len_list = NULL;
size_t val_len, new_val_len;
mbfl_string string, resvar, resval;
const mbfl_encoding *from_encoding = NULL;
mbfl_encoding_detector *identd = NULL;
mbfl_buffer_converter *convd = NULL;
- mbfl_string_init_set(&string, info->to_language, info->to_encoding->no_encoding);
- mbfl_string_init_set(&resvar, info->to_language, info->to_encoding->no_encoding);
- mbfl_string_init_set(&resval, info->to_language, info->to_encoding->no_encoding);
+ mbfl_string_init_set(&string, info->to_language, info->to_encoding);
+ mbfl_string_init_set(&resvar, info->to_language, info->to_encoding);
+ mbfl_string_init_set(&resval, info->to_language, info->to_encoding);
if (!res || *res == '\0') {
goto out;
@@ -225,7 +225,7 @@ const mbfl_encoding *_php_mb_encoding_handler_ex(const php_mb_encoding_handler_i
num *= 2; /* need space for variable name and value */
val_list = (char **)ecalloc(num, sizeof(char *));
- len_list = (int *)ecalloc(num, sizeof(int));
+ len_list = (size_t *)ecalloc(num, sizeof(size_t));
/* split and decode the query */
n = 0;
@@ -253,7 +253,7 @@ const mbfl_encoding *_php_mb_encoding_handler_ex(const php_mb_encoding_handler_i
var = php_strtok_r(NULL, info->separator, &strtok_buf);
}
- if (n > (PG(max_input_vars) * 2)) {
+ if (ZEND_SIZE_T_GT_ZEND_LONG(n, (PG(max_input_vars) * 2))) {
php_error_docref(NULL, E_WARNING, "Input variables exceeded " ZEND_LONG_FMT ". To increase the limit change max_input_vars in php.ini.", PG(max_input_vars));
goto out;
}
@@ -268,7 +268,7 @@ const mbfl_encoding *_php_mb_encoding_handler_ex(const php_mb_encoding_handler_i
} else {
/* auto detect */
from_encoding = NULL;
- identd = mbfl_encoding_detector_new2(info->from_encodings, info->num_from_encodings, MBSTRG(strict_detection));
+ identd = mbfl_encoding_detector_new(info->from_encodings, info->num_from_encodings, MBSTRG(strict_detection));
if (identd != NULL) {
n = 0;
while (n < num) {
@@ -279,7 +279,7 @@ const mbfl_encoding *_php_mb_encoding_handler_ex(const php_mb_encoding_handler_i
}
n++;
}
- from_encoding = mbfl_encoding_detector_judge2(identd);
+ from_encoding = mbfl_encoding_detector_judge(identd);
mbfl_encoding_detector_delete(identd);
}
if (!from_encoding) {
@@ -292,7 +292,7 @@ const mbfl_encoding *_php_mb_encoding_handler_ex(const php_mb_encoding_handler_i
convd = NULL;
if (from_encoding != &mbfl_encoding_pass) {
- convd = mbfl_buffer_converter_new2(from_encoding, info->to_encoding, 0);
+ convd = mbfl_buffer_converter_new(from_encoding, info->to_encoding, 0);
if (convd != NULL) {
mbfl_buffer_converter_illegal_mode(convd, MBSTRG(current_filter_illegal_mode));
mbfl_buffer_converter_illegal_substchar(convd, MBSTRG(current_filter_illegal_substchar));
@@ -305,7 +305,7 @@ const mbfl_encoding *_php_mb_encoding_handler_ex(const php_mb_encoding_handler_i
}
/* convert encoding */
- string.no_encoding = from_encoding->no_encoding;
+ string.encoding = from_encoding;
n = 0;
while (n < num) {
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c
index d2e778bff5..01fd345017 100644
--- a/ext/mbstring/mbstring.c
+++ b/ext/mbstring/mbstring.c
@@ -14,36 +14,13 @@
+----------------------------------------------------------------------+
| Author: Tsukada Takuya <tsukada@fminn.nagano.nagano.jp> |
| Rui Hirokawa <hirokawa@php.net> |
+ | Hironori Sato <satoh@jpnnet.com> |
+ | Shigeru Kanemoto <sgk@happysize.co.jp> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
-/*
- * PHP 4 Multibyte String module "mbstring"
- *
- * History:
- * 2000.5.19 Release php-4.0RC2_jstring-1.0
- * 2001.4.1 Release php4_jstring-1.0.91
- * 2001.4.30 Release php4_jstring-1.1 (contribute to The PHP Group)
- * 2001.5.1 Renamed from jstring to mbstring (hirokawa@php.net)
- */
-
-/*
- * PHP3 Internationalization support program.
- *
- * Copyright (c) 1999,2000 by the PHP3 internationalization team.
- * All rights reserved.
- *
- * See README_PHP3-i18n-ja for more detail.
- *
- * Authors:
- * Hironori Sato <satoh@jpnnet.com>
- * Shigeru Kanemoto <sgk@happysize.co.jp>
- * Tsukada Takuya <tsukada@fminn.nagano.nagano.jp>
- * Rui Hirokawa <rui_hirokawa@ybb.ne.jp>
- */
-
/* {{{ includes */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -61,7 +38,14 @@
#include "ext/standard/info.h"
#include "libmbfl/mbfl/mbfl_allocators.h"
+#include "libmbfl/mbfl/mbfilter_8bit.h"
#include "libmbfl/mbfl/mbfilter_pass.h"
+#include "libmbfl/mbfl/mbfilter_wchar.h"
+#include "libmbfl/filters/mbfilter_ascii.h"
+#include "libmbfl/filters/mbfilter_base64.h"
+#include "libmbfl/filters/mbfilter_qprint.h"
+#include "libmbfl/filters/mbfilter_ucs4.h"
+#include "libmbfl/filters/mbfilter_utf8.h"
#include "php_variables.h"
#include "php_globals.h"
@@ -647,17 +631,17 @@ static char *get_output_encoding(void) {
/* {{{ allocators */
-static void *_php_mb_allocators_malloc(unsigned int sz)
+static void *_php_mb_allocators_malloc(size_t sz)
{
return emalloc(sz);
}
-static void *_php_mb_allocators_realloc(void *ptr, unsigned int sz)
+static void *_php_mb_allocators_realloc(void *ptr, size_t sz)
{
return erealloc(ptr, sz);
}
-static void *_php_mb_allocators_calloc(unsigned int nelems, unsigned int szelem)
+static void *_php_mb_allocators_calloc(size_t nelems, size_t szelem)
{
return ecalloc(nelems, szelem);
}
@@ -667,12 +651,12 @@ static void _php_mb_allocators_free(void *ptr)
efree(ptr);
}
-static void *_php_mb_allocators_pmalloc(unsigned int sz)
+static void *_php_mb_allocators_pmalloc(size_t sz)
{
return pemalloc(sz, 1);
}
-static void *_php_mb_allocators_prealloc(void *ptr, unsigned int sz)
+static void *_php_mb_allocators_prealloc(void *ptr, size_t sz)
{
return perealloc(ptr, sz, 1);
}
@@ -701,6 +685,31 @@ static sapi_post_entry mbstr_post_entries[] = {
};
/* }}} */
+static const mbfl_encoding *php_mb_get_encoding(const char *encoding_name) {
+ if (encoding_name) {
+ const mbfl_encoding *encoding;
+ if (MBSTRG(last_used_encoding_name)
+ && !strcasecmp(encoding_name, MBSTRG(last_used_encoding_name))) {
+ return MBSTRG(last_used_encoding);
+ }
+
+ encoding = mbfl_name2encoding(encoding_name);
+ if (!encoding) {
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", encoding_name);
+ return NULL;
+ }
+
+ if (MBSTRG(last_used_encoding_name)) {
+ efree(MBSTRG(last_used_encoding_name));
+ }
+ MBSTRG(last_used_encoding_name) = estrdup(encoding_name);
+ MBSTRG(last_used_encoding) = encoding;
+ return encoding;
+ } else {
+ return MBSTRG(current_internal_encoding);
+ }
+}
+
/* {{{ static int php_mb_parse_encoding_list()
* Return 0 if input contains any illegal encoding, otherwise 1.
* Even if any illegal encoding is detected the result may contain a list
@@ -817,8 +826,9 @@ php_mb_parse_encoding_array(zval *array, const mbfl_encoding ***return_list, siz
{
zval *hash_entry;
HashTable *target_hash;
- int i, n, size, bauto, ret = SUCCESS;
+ int i, n, bauto, ret = SUCCESS;
const mbfl_encoding **list, **entry;
+ size_t size;
list = NULL;
if (Z_TYPE_P(array) == IS_ARRAY) {
@@ -912,28 +922,29 @@ static const zend_encoding *php_mb_zend_encoding_detector(const unsigned char *a
string.no_language = MBSTRG(language);
string.val = (unsigned char *)arg_string;
string.len = arg_length;
- return (const zend_encoding *) mbfl_identify_encoding2(&string, (const mbfl_encoding **)list, list_size, 0);
+ return (const zend_encoding *) mbfl_identify_encoding(&string, (const mbfl_encoding **)list, list_size, 0);
}
static size_t php_mb_zend_encoding_converter(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length, const zend_encoding *encoding_to, const zend_encoding *encoding_from)
{
mbfl_string string, result;
mbfl_buffer_converter *convd;
- int status, loc;
+ int status;
+ size_t loc;
/* new encoding */
/* initialize string */
mbfl_string_init(&string);
mbfl_string_init(&result);
- string.no_encoding = ((const mbfl_encoding*)encoding_from)->no_encoding;
+ string.encoding = (const mbfl_encoding*)encoding_from;
string.no_language = MBSTRG(language);
string.val = (unsigned char*)from;
string.len = from_length;
/* initialize converter */
- convd = mbfl_buffer_converter_new2((const mbfl_encoding *)encoding_from, (const mbfl_encoding *)encoding_to, string.len);
+ convd = mbfl_buffer_converter_new((const mbfl_encoding *)encoding_from, (const mbfl_encoding *)encoding_to, string.len);
if (convd == NULL) {
- return -1;
+ return (size_t) -1;
}
mbfl_buffer_converter_illegal_mode(convd, MBSTRG(current_filter_illegal_mode));
@@ -1081,11 +1092,11 @@ static int php_mb_nls_get_default_detect_order_list(enum mbfl_no_language lang,
}
/* }}} */
-static char *php_mb_rfc1867_substring_conf(const zend_encoding *encoding, char *start, int len, char quote)
+static char *php_mb_rfc1867_substring_conf(const zend_encoding *encoding, char *start, size_t len, char quote)
{
char *result = emalloc(len + 2);
char *resp = result;
- int i;
+ size_t i;
for (i = 0; i < len && start[i] != quote; ++i) {
if (start[i] == '\\' && (start[i + 1] == '\\' || (quote && start[i + 1] == quote))) {
@@ -1314,7 +1325,7 @@ static PHP_INI_MH(OnUpdate_mbstring_http_output)
/* }}} */
/* {{{ static _php_mb_ini_mbstring_internal_encoding_set */
-int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint32_t new_value_length)
+int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, size_t new_value_length)
{
const mbfl_encoding *encoding;
@@ -1522,6 +1533,8 @@ ZEND_TSRMLS_CACHE_UPDATE();
#if HAVE_MBREGEX
mbstring_globals->mb_regex_globals = php_mb_regex_globals_alloc();
#endif
+ mbstring_globals->last_used_encoding_name = NULL;
+ mbstring_globals->last_used_encoding = NULL;
}
/* }}} */
@@ -1568,6 +1581,11 @@ ZEND_TSRMLS_CACHE_UPDATE();
REGISTER_LONG_CONSTANT("MB_CASE_UPPER", PHP_UNICODE_CASE_UPPER, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("MB_CASE_LOWER", PHP_UNICODE_CASE_LOWER, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("MB_CASE_TITLE", PHP_UNICODE_CASE_TITLE, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("MB_CASE_FOLD", PHP_UNICODE_CASE_FOLD, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("MB_CASE_UPPER_SIMPLE", PHP_UNICODE_CASE_UPPER_SIMPLE, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("MB_CASE_LOWER_SIMPLE", PHP_UNICODE_CASE_LOWER_SIMPLE, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("MB_CASE_TITLE_SIMPLE", PHP_UNICODE_CASE_TITLE_SIMPLE, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("MB_CASE_FOLD_SIMPLE", PHP_UNICODE_CASE_FOLD_SIMPLE, CONST_CS | CONST_PERSISTENT);
#if HAVE_MBREGEX
PHP_MINIT(mb_regex) (INIT_FUNC_ARGS_PASSTHRU);
@@ -1683,6 +1701,11 @@ PHP_RSHUTDOWN_FUNCTION(mbstring)
MBSTRG(http_input_identify_cookie) = NULL;
MBSTRG(http_input_identify_string) = NULL;
+ if (MBSTRG(last_used_encoding_name)) {
+ efree(MBSTRG(last_used_encoding_name));
+ MBSTRG(last_used_encoding_name) = NULL;
+ }
+
/* clear overloaded function. */
if (MBSTRG(func_overload)){
p = &(mb_ovld[0]);
@@ -1975,7 +1998,7 @@ PHP_FUNCTION(mb_detect_order)
}
/* }}} */
-static inline int php_mb_check_code_point(long cp)
+static inline int php_mb_check_code_point(zend_long cp)
{
if (cp <= 0 || cp >= 0x110000) {
/* Out of Unicode range */
@@ -2151,7 +2174,8 @@ PHP_FUNCTION(mb_output_handler)
const char *charset;
char *p;
const mbfl_encoding *encoding;
- int last_feed, len;
+ int last_feed;
+ size_t len;
unsigned char send_text_mimetype = 0;
char *s, *mimetype = NULL;
@@ -2199,7 +2223,7 @@ PHP_FUNCTION(mb_output_handler)
}
}
/* activate the converter */
- MBSTRG(outconv) = mbfl_buffer_converter_new2(MBSTRG(current_internal_encoding), encoding, 0);
+ MBSTRG(outconv) = mbfl_buffer_converter_new(MBSTRG(current_internal_encoding), encoding, 0);
if (send_text_mimetype){
efree(mimetype);
}
@@ -2221,7 +2245,7 @@ PHP_FUNCTION(mb_output_handler)
mbfl_string_init(&string);
/* these are not needed. convd has encoding info.
string.no_language = MBSTRG(language);
- string.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
+ string.encoding = MBSTRG(current_internal_encoding);
*/
string.val = (unsigned char *)arg_string;
string.len = arg_string_len;
@@ -2248,37 +2272,29 @@ PHP_FUNCTION(mb_output_handler)
Get character numbers of a string */
PHP_FUNCTION(mb_strlen)
{
- int n;
+ size_t n;
mbfl_string string;
- char *enc_name = NULL;
- size_t enc_name_len, string_len;
+ char *str, *enc_name = NULL;
+ size_t str_len, enc_name_len;
mbfl_string_init(&string);
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", (char **)&string.val, &string_len, &enc_name, &enc_name_len) == FAILURE) {
- return;
- }
-
- if (ZEND_SIZE_T_UINT_OVFL(string_len)) {
- php_error_docref(NULL, E_WARNING, "String overflows the max allowed length of %u", UINT_MAX);
- return;
- }
-
- string.len = (uint32_t)string_len;
+ ZEND_PARSE_PARAMETERS_START(1, 2)
+ Z_PARAM_STRING(str, str_len)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STRING(enc_name, enc_name_len)
+ ZEND_PARSE_PARAMETERS_END();
+ string.val = (unsigned char *) str;
+ string.len = str_len;
string.no_language = MBSTRG(language);
- if (enc_name == NULL) {
- string.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- } else {
- string.no_encoding = mbfl_name2no_encoding(enc_name);
- if (string.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", enc_name);
- RETURN_FALSE;
- }
+ string.encoding = php_mb_get_encoding(enc_name);
+ if (!string.encoding) {
+ RETURN_FALSE;
}
n = mbfl_strlen(&string);
- if (n >= 0) {
+ if (!mbfl_is_error(n)) {
RETVAL_LONG(n);
} else {
RETVAL_FALSE;
@@ -2290,57 +2306,43 @@ PHP_FUNCTION(mb_strlen)
Find position of first occurrence of a string within another */
PHP_FUNCTION(mb_strpos)
{
- int n, reverse = 0;
- zend_long offset = 0, slen;
+ int reverse = 0;
+ zend_long offset = 0;
mbfl_string haystack, needle;
char *enc_name = NULL;
- size_t enc_name_len, haystack_len, needle_len;
+ size_t enc_name_len, n;
mbfl_string_init(&haystack);
mbfl_string_init(&needle);
- haystack.no_language = MBSTRG(language);
- haystack.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- needle.no_language = MBSTRG(language);
- needle.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|ls", (char **)&haystack.val, &haystack_len, (char **)&needle.val, &needle_len, &offset, &enc_name, &enc_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|ls", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &offset, &enc_name, &enc_name_len) == FAILURE) {
return;
}
- if (ZEND_SIZE_T_UINT_OVFL(haystack_len)) {
- php_error_docref(NULL, E_WARNING, "Haystack length overflows the max allowed length of %u", UINT_MAX);
- return;
- } else if (ZEND_SIZE_T_UINT_OVFL(needle_len)) {
- php_error_docref(NULL, E_WARNING, "Needle length overflows the max allowed length of %u", UINT_MAX);
- return;
+ haystack.no_language = needle.no_language = MBSTRG(language);
+ haystack.encoding = needle.encoding = php_mb_get_encoding(enc_name);
+ if (!haystack.encoding) {
+ RETURN_FALSE;
}
- haystack.len = (uint32_t)haystack_len;
- needle.len = (uint32_t)needle_len;
-
- if (enc_name != NULL) {
- haystack.no_encoding = needle.no_encoding = mbfl_name2no_encoding(enc_name);
- if (haystack.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", enc_name);
+ if (offset != 0) {
+ size_t slen = mbfl_strlen(&haystack);
+ if (offset < 0) {
+ offset += slen;
+ }
+ if (offset < 0 || offset > slen) {
+ php_error_docref(NULL, E_WARNING, "Offset not contained in string");
RETURN_FALSE;
}
}
- slen = mbfl_strlen(&haystack);
- if (offset < 0) {
- offset += slen;
- }
- if (offset < 0 || offset > slen) {
- php_error_docref(NULL, E_WARNING, "Offset not contained in string");
- RETURN_FALSE;
- }
if (needle.len == 0) {
php_error_docref(NULL, E_WARNING, "Empty delimiter");
RETURN_FALSE;
}
n = mbfl_strpos(&haystack, &needle, offset, reverse);
- if (n >= 0) {
+ if (!mbfl_is_error(n)) {
RETVAL_LONG(n);
} else {
switch (-n) {
@@ -2368,37 +2370,27 @@ PHP_FUNCTION(mb_strpos)
Find position of last occurrence of a string within another */
PHP_FUNCTION(mb_strrpos)
{
- int n;
mbfl_string haystack, needle;
char *enc_name = NULL;
- size_t enc_name_len, haystack_len, needle_len;
+ size_t enc_name_len;
zval *zoffset = NULL;
- long offset = 0, str_flg;
+ zend_long offset = 0, str_flg, n;
char *enc_name2 = NULL;
- int enc_name_len2;
+ size_t enc_name_len2;
mbfl_string_init(&haystack);
mbfl_string_init(&needle);
- haystack.no_language = MBSTRG(language);
- haystack.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- needle.no_language = MBSTRG(language);
- needle.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|zs", (char **)&haystack.val, &haystack_len, (char **)&needle.val, &needle_len, &zoffset, &enc_name, &enc_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|zs", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &zoffset, &enc_name, &enc_name_len) == FAILURE) {
return;
}
- if (ZEND_SIZE_T_UINT_OVFL(haystack_len)) {
- php_error_docref(NULL, E_WARNING, "Haystack length overflows the max allowed length of %u", UINT_MAX);
- return;
- } else if (ZEND_SIZE_T_UINT_OVFL(needle_len)) {
- php_error_docref(NULL, E_WARNING, "Needle length overflows the max allowed length of %u", UINT_MAX);
- return;
+ haystack.no_language = needle.no_language = MBSTRG(language);
+ haystack.encoding = needle.encoding = php_mb_get_encoding(enc_name);
+ if (!haystack.encoding) {
+ RETURN_FALSE;
}
- haystack.len = (uint32_t)haystack_len;
- needle.len = (uint32_t)needle_len;
-
if (zoffset) {
if (Z_TYPE_P(zoffset) == IS_STRING) {
enc_name2 = Z_STRVAL_P(zoffset);
@@ -2440,23 +2432,8 @@ PHP_FUNCTION(mb_strrpos)
}
}
- if (enc_name != NULL) {
- haystack.no_encoding = needle.no_encoding = mbfl_name2no_encoding(enc_name);
- if (haystack.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", enc_name);
- RETURN_FALSE;
- }
- }
-
- if (haystack.len <= 0) {
- RETURN_FALSE;
- }
- if (needle.len <= 0) {
- RETURN_FALSE;
- }
-
- {
- int haystack_char_len = mbfl_strlen(&haystack);
+ if (offset != 0) {
+ size_t haystack_char_len = mbfl_strlen(&haystack);
if ((offset > 0 && offset > haystack_char_len) ||
(offset < 0 && -offset > haystack_char_len)) {
php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack string");
@@ -2465,7 +2442,7 @@ PHP_FUNCTION(mb_strrpos)
}
n = mbfl_strpos(&haystack, &needle, offset, 1);
- if (n >= 0) {
+ if (!mbfl_is_error(n)) {
RETVAL_LONG(n);
} else {
RETVAL_FALSE;
@@ -2477,34 +2454,24 @@ PHP_FUNCTION(mb_strrpos)
Finds position of first occurrence of a string within another, case insensitive */
PHP_FUNCTION(mb_stripos)
{
- int n = -1;
+ size_t n = (size_t) -1;
zend_long offset = 0;
mbfl_string haystack, needle;
const char *from_encoding = MBSTRG(current_internal_encoding)->mime_name;
- size_t from_encoding_len, haystack_len, needle_len;
+ size_t from_encoding_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|ls", (char **)&haystack.val, &haystack_len, (char **)&needle.val, &needle_len, &offset, &from_encoding, &from_encoding_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|ls", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &offset, &from_encoding, &from_encoding_len) == FAILURE) {
return;
}
- if (ZEND_SIZE_T_UINT_OVFL(haystack_len)) {
- php_error_docref(NULL, E_WARNING, "Haystack length overflows the max allowed length of %u", UINT_MAX);
- return;
- } else if (ZEND_SIZE_T_UINT_OVFL(needle_len)) {
- php_error_docref(NULL, E_WARNING, "Needle length overflows the max allowed length of %u", UINT_MAX);
- return;
- }
-
- haystack.len = (uint32_t)haystack_len;
- needle.len = (uint32_t)needle_len;
-
if (needle.len == 0) {
php_error_docref(NULL, E_WARNING, "Empty delimiter");
RETURN_FALSE;
}
+
n = php_mb_stripos(0, (char *)haystack.val, haystack.len, (char *)needle.val, needle.len, offset, from_encoding);
- if (n >= 0) {
+ if (!mbfl_is_error(n)) {
RETVAL_LONG(n);
} else {
RETVAL_FALSE;
@@ -2516,30 +2483,19 @@ PHP_FUNCTION(mb_stripos)
Finds position of last occurrence of a string within another, case insensitive */
PHP_FUNCTION(mb_strripos)
{
- int n = -1;
+ size_t n = (size_t) -1;
zend_long offset = 0;
mbfl_string haystack, needle;
const char *from_encoding = MBSTRG(current_internal_encoding)->mime_name;
- size_t from_encoding_len, haystack_len, needle_len;
+ size_t from_encoding_len;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|ls", (char **)&haystack.val, &haystack_len, (char **)&needle.val, &needle_len, &offset, &from_encoding, &from_encoding_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|ls", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &offset, &from_encoding, &from_encoding_len) == FAILURE) {
return;
}
- if (ZEND_SIZE_T_UINT_OVFL(haystack_len)) {
- php_error_docref(NULL, E_WARNING, "Haystack length overflows the max allowed length of %u", UINT_MAX);
- return;
- } else if (ZEND_SIZE_T_UINT_OVFL(needle_len)) {
- php_error_docref(NULL, E_WARNING, "Needle length overflows the max allowed length of %u", UINT_MAX);
- return;
- }
-
- haystack.len = (uint32_t)haystack_len;
- needle.len = (uint32_t)needle_len;
-
n = php_mb_stripos(1, (char *)haystack.val, haystack.len, (char *)needle.val, needle.len, offset, from_encoding);
- if (n >= 0) {
+ if (!mbfl_is_error(n)) {
RETVAL_LONG(n);
} else {
RETVAL_FALSE;
@@ -2551,49 +2507,32 @@ PHP_FUNCTION(mb_strripos)
Finds first occurrence of a string within another */
PHP_FUNCTION(mb_strstr)
{
- int n, len, mblen;
+ size_t n;
mbfl_string haystack, needle, result, *ret = NULL;
char *enc_name = NULL;
- size_t enc_name_len, haystack_len, needle_len;
+ size_t enc_name_len;
zend_bool part = 0;
mbfl_string_init(&haystack);
mbfl_string_init(&needle);
- haystack.no_language = MBSTRG(language);
- haystack.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- needle.no_language = MBSTRG(language);
- needle.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|bs", (char **)&haystack.val, &haystack_len, (char **)&needle.val, &needle_len, &part, &enc_name, &enc_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|bs", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &part, &enc_name, &enc_name_len) == FAILURE) {
return;
}
- if (ZEND_SIZE_T_UINT_OVFL(haystack_len)) {
- php_error_docref(NULL, E_WARNING, "Haystack length overflows the max allowed length of %u", UINT_MAX);
- return;
- } else if (ZEND_SIZE_T_UINT_OVFL(needle_len)) {
- php_error_docref(NULL, E_WARNING, "Needle length overflows the max allowed length of %u", UINT_MAX);
- return;
- }
-
- haystack.len = (uint32_t)haystack_len;
- needle.len = (uint32_t)needle_len;
-
- if (enc_name != NULL) {
- haystack.no_encoding = needle.no_encoding = mbfl_name2no_encoding(enc_name);
- if (haystack.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", enc_name);
- RETURN_FALSE;
- }
+ haystack.no_language = needle.no_language = MBSTRG(language);
+ haystack.encoding = needle.encoding = php_mb_get_encoding(enc_name);
+ if (!haystack.encoding) {
+ RETURN_FALSE;
}
- if (needle.len <= 0) {
+ if (needle.len == 0) {
php_error_docref(NULL, E_WARNING, "Empty delimiter");
RETURN_FALSE;
}
+
n = mbfl_strpos(&haystack, &needle, 0, 0);
- if (n >= 0) {
- mblen = mbfl_strlen(&haystack);
+ if (!mbfl_is_error(n)) {
if (part) {
ret = mbfl_substr(&haystack, &result, 0, n);
if (ret != NULL) {
@@ -2604,8 +2543,7 @@ PHP_FUNCTION(mb_strstr)
RETVAL_FALSE;
}
} else {
- len = (mblen - n);
- ret = mbfl_substr(&haystack, &result, n, len);
+ ret = mbfl_substr(&haystack, &result, n, MBFL_SUBSTR_UNTIL_END);
if (ret != NULL) {
// TODO: avoid reallocation ???
RETVAL_STRINGL((char *)ret->val, ret->len);
@@ -2624,51 +2562,34 @@ PHP_FUNCTION(mb_strstr)
Finds the last occurrence of a character in a string within another */
PHP_FUNCTION(mb_strrchr)
{
- int n, len, mblen;
+ size_t n;
mbfl_string haystack, needle, result, *ret = NULL;
char *enc_name = NULL;
- size_t enc_name_len, haystack_len, needle_len;
+ size_t enc_name_len;
zend_bool part = 0;
mbfl_string_init(&haystack);
mbfl_string_init(&needle);
- haystack.no_language = MBSTRG(language);
- haystack.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- needle.no_language = MBSTRG(language);
- needle.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|bs", (char **)&haystack.val, &haystack_len, (char **)&needle.val, &needle_len, &part, &enc_name, &enc_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|bs", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &part, &enc_name, &enc_name_len) == FAILURE) {
return;
}
- if (ZEND_SIZE_T_UINT_OVFL(haystack_len)) {
- php_error_docref(NULL, E_WARNING, "Haystack length overflows the max allowed length of %u", UINT_MAX);
- return;
- } else if (ZEND_SIZE_T_UINT_OVFL(needle_len)) {
- php_error_docref(NULL, E_WARNING, "Needle length overflows the max allowed length of %u", UINT_MAX);
- return;
- }
-
- haystack.len = (uint32_t)haystack_len;
- needle.len = (uint32_t)needle_len;
-
- if (enc_name != NULL) {
- haystack.no_encoding = needle.no_encoding = mbfl_name2no_encoding(enc_name);
- if (haystack.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", enc_name);
- RETURN_FALSE;
- }
+ haystack.no_language = needle.no_language = MBSTRG(language);
+ haystack.encoding = needle.encoding = php_mb_get_encoding(enc_name);
+ if (!haystack.encoding) {
+ RETURN_FALSE;
}
- if (haystack.len <= 0) {
+ if (haystack.len == 0) {
RETURN_FALSE;
}
- if (needle.len <= 0) {
+ if (needle.len == 0) {
RETURN_FALSE;
}
+
n = mbfl_strpos(&haystack, &needle, 0, 1);
- if (n >= 0) {
- mblen = mbfl_strlen(&haystack);
+ if (!mbfl_is_error(n)) {
if (part) {
ret = mbfl_substr(&haystack, &result, 0, n);
if (ret != NULL) {
@@ -2679,8 +2600,7 @@ PHP_FUNCTION(mb_strrchr)
RETVAL_FALSE;
}
} else {
- len = (mblen - n);
- ret = mbfl_substr(&haystack, &result, n, len);
+ ret = mbfl_substr(&haystack, &result, n, MBFL_SUBSTR_UNTIL_END);
if (ret != NULL) {
// TODO: avoid reallocation ???
RETVAL_STRINGL((char *)ret->val, ret->len);
@@ -2700,52 +2620,32 @@ PHP_FUNCTION(mb_strrchr)
PHP_FUNCTION(mb_stristr)
{
zend_bool part = 0;
- size_t from_encoding_len, len, mblen, haystack_len, needle_len;
- int n;
+ size_t from_encoding_len, n;
mbfl_string haystack, needle, result, *ret = NULL;
- const char *from_encoding = MBSTRG(current_internal_encoding)->mime_name;
+ const char *from_encoding = NULL;
mbfl_string_init(&haystack);
mbfl_string_init(&needle);
- haystack.no_language = MBSTRG(language);
- haystack.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- needle.no_language = MBSTRG(language);
- needle.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|bs", (char **)&haystack.val, &haystack_len, (char **)&needle.val, &needle_len, &part, &from_encoding, &from_encoding_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|bs", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &part, &from_encoding, &from_encoding_len) == FAILURE) {
return;
}
- if (ZEND_SIZE_T_UINT_OVFL(haystack_len)) {
- php_error_docref(NULL, E_WARNING, "Haystack length overflows the max allowed length of %u", UINT_MAX);
- return;
- } else if (ZEND_SIZE_T_UINT_OVFL(needle_len)) {
- php_error_docref(NULL, E_WARNING, "Needle length overflows the max allowed length of %u", UINT_MAX);
- return;
+ haystack.no_language = needle.no_language = MBSTRG(language);
+ haystack.encoding = needle.encoding = php_mb_get_encoding(from_encoding);
+ if (!haystack.encoding) {
+ RETURN_FALSE;
}
- haystack.len = (uint32_t)haystack_len;
- needle.len = (uint32_t)needle_len;
-
if (!needle.len) {
php_error_docref(NULL, E_WARNING, "Empty delimiter");
RETURN_FALSE;
}
- haystack.no_encoding = needle.no_encoding = mbfl_name2no_encoding(from_encoding);
- if (haystack.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", from_encoding);
- RETURN_FALSE;
- }
-
n = php_mb_stripos(0, (char *)haystack.val, haystack.len, (char *)needle.val, needle.len, 0, from_encoding);
-
- if (n <0) {
+ if (mbfl_is_error(n)) {
RETURN_FALSE;
}
- mblen = mbfl_strlen(&haystack);
-
if (part) {
ret = mbfl_substr(&haystack, &result, 0, n);
if (ret != NULL) {
@@ -2756,8 +2656,7 @@ PHP_FUNCTION(mb_stristr)
RETVAL_FALSE;
}
} else {
- len = (mblen - n);
- ret = mbfl_substr(&haystack, &result, n, len);
+ ret = mbfl_substr(&haystack, &result, n, MBFL_SUBSTR_UNTIL_END);
if (ret != NULL) {
// TODO: avoid reallocaton ???
RETVAL_STRINGL((char *)ret->val, ret->len);
@@ -2774,47 +2673,28 @@ PHP_FUNCTION(mb_stristr)
PHP_FUNCTION(mb_strrichr)
{
zend_bool part = 0;
- int n, len, mblen;
- size_t from_encoding_len, haystack_len, needle_len;
+ size_t n;
+ size_t from_encoding_len;
mbfl_string haystack, needle, result, *ret = NULL;
- const char *from_encoding = MBSTRG(current_internal_encoding)->name;
+ const char *from_encoding = NULL;
mbfl_string_init(&haystack);
mbfl_string_init(&needle);
- haystack.no_language = MBSTRG(language);
- haystack.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- needle.no_language = MBSTRG(language);
- needle.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|bs", (char **)&haystack.val, &haystack_len, (char **)&needle.val, &needle_len, &part, &from_encoding, &from_encoding_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|bs", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &part, &from_encoding, &from_encoding_len) == FAILURE) {
return;
}
- if (ZEND_SIZE_T_UINT_OVFL(haystack_len)) {
- php_error_docref(NULL, E_WARNING, "Haystack length overflows the max allowed length of %u", UINT_MAX);
- return;
- } else if (ZEND_SIZE_T_UINT_OVFL(needle_len)) {
- php_error_docref(NULL, E_WARNING, "Needle length overflows the max allowed length of %u", UINT_MAX);
- return;
- }
-
- haystack.len = (uint32_t)haystack_len;
- needle.len = (uint32_t)needle_len;
-
- haystack.no_encoding = needle.no_encoding = mbfl_name2no_encoding(from_encoding);
- if (haystack.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", from_encoding);
+ haystack.no_language = needle.no_language = MBSTRG(language);
+ haystack.encoding = needle.encoding = php_mb_get_encoding(from_encoding);
+ if (!haystack.encoding) {
RETURN_FALSE;
}
n = php_mb_stripos(1, (char *)haystack.val, haystack.len, (char *)needle.val, needle.len, 0, from_encoding);
-
- if (n <0) {
+ if (mbfl_is_error(n)) {
RETURN_FALSE;
}
- mblen = mbfl_strlen(&haystack);
-
if (part) {
ret = mbfl_substr(&haystack, &result, 0, n);
if (ret != NULL) {
@@ -2825,8 +2705,7 @@ PHP_FUNCTION(mb_strrichr)
RETVAL_FALSE;
}
} else {
- len = (mblen - n);
- ret = mbfl_substr(&haystack, &result, n, len);
+ ret = mbfl_substr(&haystack, &result, n, MBFL_SUBSTR_UNTIL_END);
if (ret != NULL) {
// TODO: avoid reallocation ???
RETVAL_STRINGL((char *)ret->val, ret->len);
@@ -2842,48 +2721,31 @@ PHP_FUNCTION(mb_strrichr)
Count the number of substring occurrences */
PHP_FUNCTION(mb_substr_count)
{
- int n;
+ size_t n;
mbfl_string haystack, needle;
char *enc_name = NULL;
- size_t enc_name_len, haystack_len, needle_len;
+ size_t enc_name_len;
mbfl_string_init(&haystack);
mbfl_string_init(&needle);
- haystack.no_language = MBSTRG(language);
- haystack.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- needle.no_language = MBSTRG(language);
- needle.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|s", (char **)&haystack.val, &haystack_len, (char **)&needle.val, &needle_len, &enc_name, &enc_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|s", (char **)&haystack.val, &haystack.len, (char **)&needle.val, &needle.len, &enc_name, &enc_name_len) == FAILURE) {
return;
}
- if (ZEND_SIZE_T_UINT_OVFL(haystack_len)) {
- php_error_docref(NULL, E_WARNING, "Haystack length overflows the max allowed length of %u", UINT_MAX);
- return;
- } else if (ZEND_SIZE_T_UINT_OVFL(needle_len)) {
- php_error_docref(NULL, E_WARNING, "Needle length overflows the max allowed length of %u", UINT_MAX);
- return;
- }
-
- haystack.len = (uint32_t)haystack_len;
- needle.len = (uint32_t)needle_len;
-
- if (enc_name != NULL) {
- haystack.no_encoding = needle.no_encoding = mbfl_name2no_encoding(enc_name);
- if (haystack.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", enc_name);
- RETURN_FALSE;
- }
+ haystack.no_language = needle.no_language = MBSTRG(language);
+ haystack.encoding = needle.encoding = php_mb_get_encoding(enc_name);
+ if (!haystack.encoding) {
+ RETURN_FALSE;
}
- if (needle.len <= 0) {
+ if (needle.len == 0) {
php_error_docref(NULL, E_WARNING, "Empty substring");
RETURN_FALSE;
}
n = mbfl_substr_count(&haystack, &needle);
- if (n >= 0) {
+ if (!mbfl_is_error(n)) {
RETVAL_LONG(n);
} else {
RETVAL_FALSE;
@@ -2897,7 +2759,7 @@ PHP_FUNCTION(mb_substr)
{
char *str, *encoding = NULL;
zend_long from, len;
- int mblen;
+ size_t mblen, real_from, real_len;
size_t str_len, encoding_len;
zend_bool len_is_null = 1;
mbfl_string string, result, *ret;
@@ -2908,62 +2770,50 @@ PHP_FUNCTION(mb_substr)
mbfl_string_init(&string);
string.no_language = MBSTRG(language);
- string.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
-
- if (encoding) {
- string.no_encoding = mbfl_name2no_encoding(encoding);
- if (string.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", encoding);
- RETURN_FALSE;
- }
+ string.encoding = php_mb_get_encoding(encoding);
+ if (!string.encoding) {
+ RETURN_FALSE;
}
string.val = (unsigned char *)str;
string.len = str_len;
- if (len_is_null) {
- len = str_len;
- }
-
/* measures length */
mblen = 0;
- if (from < 0 || len < 0) {
+ if (from < 0 || (!len_is_null && len < 0)) {
mblen = mbfl_strlen(&string);
}
/* if "from" position is negative, count start position from the end
* of the string
*/
- if (from < 0) {
- from = mblen + from;
- if (from < 0) {
- from = 0;
- }
+ if (from >= 0) {
+ real_from = (size_t) from;
+ } else if (-from < mblen) {
+ real_from = mblen + from;
+ } else {
+ real_from = 0;
}
/* if "length" position is negative, set it to the length
* needed to stop that many chars from the end of the string
*/
- if (len < 0) {
- len = (mblen - from) + len;
- if (len < 0) {
- len = 0;
- }
+ if (len_is_null) {
+ real_len = MBFL_SUBSTR_UNTIL_END;
+ } else if (len >= 0) {
+ real_len = (size_t) len;
+ } else if (real_from < mblen && -len < mblen - real_from) {
+ real_len = (mblen - real_from) + len;
+ } else {
+ real_len = 0;
}
if (((MBSTRG(func_overload) & MB_OVERLOAD_STRING) == MB_OVERLOAD_STRING)
- && (from >= mbfl_strlen(&string))) {
+ && (real_from >= mbfl_strlen(&string))) {
RETURN_FALSE;
}
- if (from > INT_MAX) {
- from = INT_MAX;
- }
- if (len > INT_MAX) {
- len = INT_MAX;
- }
-
- ret = mbfl_substr(&string, &result, from, len);
+ ret = mbfl_substr(&string, &result, real_from, real_len);
if (NULL == ret) {
RETURN_FALSE;
}
@@ -2980,31 +2830,20 @@ PHP_FUNCTION(mb_strcut)
{
char *encoding = NULL;
zend_long from, len;
- size_t encoding_len, string_len;
+ size_t encoding_len;
zend_bool len_is_null = 1;
mbfl_string string, result, *ret;
mbfl_string_init(&string);
- string.no_language = MBSTRG(language);
- string.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl|l!s", (char **)&string.val, &string_len, &from, &len, &len_is_null, &encoding, &encoding_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl|l!s", (char **)&string.val, &string.len, &from, &len, &len_is_null, &encoding, &encoding_len) == FAILURE) {
return;
}
- if (ZEND_SIZE_T_UINT_OVFL(string_len)) {
- php_error_docref(NULL, E_WARNING, "String length overflows the max allowed length of %u", UINT_MAX);
- return;
- }
-
- string.len = (uint32_t)string_len;
-
- if (encoding) {
- string.no_encoding = mbfl_name2no_encoding(encoding);
- if (string.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", encoding);
- RETURN_FALSE;
- }
+ string.no_language = MBSTRG(language);
+ string.encoding = php_mb_get_encoding(encoding);
+ if (!string.encoding) {
+ RETURN_FALSE;
}
if (len_is_null) {
@@ -3031,7 +2870,7 @@ PHP_FUNCTION(mb_strcut)
}
}
- if ((unsigned int)from > string.len) {
+ if (from > string.len) {
RETURN_FALSE;
}
@@ -3050,37 +2889,25 @@ PHP_FUNCTION(mb_strcut)
Gets terminal width of a string */
PHP_FUNCTION(mb_strwidth)
{
- int n;
+ size_t n;
mbfl_string string;
char *enc_name = NULL;
- size_t enc_name_len, string_len;
+ size_t enc_name_len;
mbfl_string_init(&string);
- string.no_language = MBSTRG(language);
- string.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", (char **)&string.val, &string_len, &enc_name, &enc_name_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s", (char **)&string.val, &string.len, &enc_name, &enc_name_len) == FAILURE) {
return;
}
- if (ZEND_SIZE_T_UINT_OVFL(string_len)) {
- php_error_docref(NULL, E_WARNING, "String length overflows the max allowed length of %u", UINT_MAX);
- return;
- }
-
- string.len = (uint32_t)string_len;
-
- if (enc_name != NULL) {
- string.no_encoding = mbfl_name2no_encoding(enc_name);
- if (string.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", enc_name);
- RETURN_FALSE;
- }
+ string.no_language = MBSTRG(language);
+ string.encoding = php_mb_get_encoding(enc_name);
+ if (!string.encoding) {
+ RETURN_FALSE;
}
n = mbfl_strwidth(&string);
- if (n >= 0) {
+ if (!mbfl_is_error(n)) {
RETVAL_LONG(n);
} else {
RETVAL_FALSE;
@@ -3103,23 +2930,17 @@ PHP_FUNCTION(mb_strimwidth)
mbfl_string_init(&string);
mbfl_string_init(&marker);
- string.no_language = MBSTRG(language);
- string.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- marker.no_language = MBSTRG(language);
- marker.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- marker.val = NULL;
- marker.len = 0;
- if (encoding) {
- string.no_encoding = marker.no_encoding = mbfl_name2no_encoding(encoding);
- if (string.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", encoding);
- RETURN_FALSE;
- }
+ string.no_language = marker.no_language = MBSTRG(language);
+ string.encoding = marker.encoding = php_mb_get_encoding(encoding);
+ if (!string.encoding) {
+ RETURN_FALSE;
}
string.val = (unsigned char *)str;
string.len = str_len;
+ marker.val = NULL;
+ marker.len = 0;
if ((from < 0) || (width < 0)) {
swidth = mbfl_strwidth(&string);
@@ -3176,16 +2997,53 @@ static inline zend_bool php_mb_is_no_encoding_utf8(enum mbfl_no_encoding no_enc)
return (no_enc >= mbfl_no_encoding_utf8 && no_enc <= mbfl_no_encoding_utf8_sb);
}
+MBSTRING_API char *php_mb_convert_encoding_ex(const char *input, size_t length, const mbfl_encoding *to_encoding, const mbfl_encoding *from_encoding, size_t *output_len)
+{
+ mbfl_string string, result, *ret;
+ mbfl_buffer_converter *convd;
+ char *output = NULL;
+
+ if (output_len) {
+ *output_len = 0;
+ }
+
+ /* initialize string */
+ mbfl_string_init(&string);
+ mbfl_string_init(&result);
+ string.encoding = from_encoding;
+ string.no_language = MBSTRG(language);
+ string.val = (unsigned char *)input;
+ string.len = length;
+
+ /* initialize converter */
+ convd = mbfl_buffer_converter_new(from_encoding, to_encoding, string.len);
+ if (convd == NULL) {
+ php_error_docref(NULL, E_WARNING, "Unable to create character encoding converter");
+ return NULL;
+ }
+
+ mbfl_buffer_converter_illegal_mode(convd, MBSTRG(current_filter_illegal_mode));
+ mbfl_buffer_converter_illegal_substchar(convd, MBSTRG(current_filter_illegal_substchar));
+
+ /* do it */
+ ret = mbfl_buffer_converter_feed_result(convd, &string, &result);
+ if (ret) {
+ if (output_len) {
+ *output_len = ret->len;
+ }
+ output = (char *)ret->val;
+ }
+
+ MBSTRG(illegalchars) += mbfl_buffer_illegalchars(convd);
+ mbfl_buffer_converter_delete(convd);
+ return output;
+}
+/* }}} */
/* {{{ MBSTRING_API char *php_mb_convert_encoding() */
MBSTRING_API char *php_mb_convert_encoding(const char *input, size_t length, const char *_to_encoding, const char *_from_encodings, size_t *output_len)
{
- mbfl_string string, result, *ret;
const mbfl_encoding *from_encoding, *to_encoding;
- mbfl_buffer_converter *convd;
- size_t size;
- const mbfl_encoding **list;
- char *output=NULL;
if (output_len) {
*output_len = 0;
@@ -3204,33 +3062,24 @@ MBSTRING_API char *php_mb_convert_encoding(const char *input, size_t length, con
to_encoding = MBSTRG(current_internal_encoding);
}
- /* initialize string */
- mbfl_string_init(&string);
- mbfl_string_init(&result);
- from_encoding = MBSTRG(current_internal_encoding);
- string.no_encoding = from_encoding->no_encoding;
- string.no_language = MBSTRG(language);
- string.val = (unsigned char *)input;
- string.len = length;
-
/* pre-conversion encoding */
+ from_encoding = MBSTRG(current_internal_encoding);
if (_from_encodings) {
- list = NULL;
- size = 0;
+ const mbfl_encoding **list = NULL;
+ size_t size = 0;
php_mb_parse_encoding_list(_from_encodings, strlen(_from_encodings), &list, &size, 0);
if (size == 1) {
from_encoding = *list;
- string.no_encoding = from_encoding->no_encoding;
} else if (size > 1) {
/* auto detect */
- from_encoding = mbfl_identify_encoding2(&string, list, size, MBSTRG(strict_detection));
- if (from_encoding) {
- string.no_encoding = from_encoding->no_encoding;
- } else {
+ mbfl_string string;
+ mbfl_string_init(&string);
+ string.val = (unsigned char *)input;
+ string.len = length;
+ from_encoding = mbfl_identify_encoding(&string, list, size, MBSTRG(strict_detection));
+ if (!from_encoding) {
php_error_docref(NULL, E_WARNING, "Unable to detect character encoding");
from_encoding = &mbfl_encoding_pass;
- to_encoding = from_encoding;
- string.no_encoding = from_encoding->no_encoding;
}
} else {
php_error_docref(NULL, E_WARNING, "Illegal character encoding specified");
@@ -3240,28 +3089,7 @@ MBSTRING_API char *php_mb_convert_encoding(const char *input, size_t length, con
}
}
- /* initialize converter */
- convd = mbfl_buffer_converter_new2(from_encoding, to_encoding, string.len);
- if (convd == NULL) {
- php_error_docref(NULL, E_WARNING, "Unable to create character encoding converter");
- return NULL;
- }
-
- mbfl_buffer_converter_illegal_mode(convd, MBSTRG(current_filter_illegal_mode));
- mbfl_buffer_converter_illegal_substchar(convd, MBSTRG(current_filter_illegal_substchar));
-
- /* do it */
- ret = mbfl_buffer_converter_feed_result(convd, &string, &result);
- if (ret) {
- if (output_len) {
- *output_len = ret->len;
- }
- output = (char *)ret->val;
- }
-
- MBSTRG(illegalchars) += mbfl_buffer_illegalchars(convd);
- mbfl_buffer_converter_delete(convd);
- return output;
+ return php_mb_convert_encoding_ex(input, length, to_encoding, from_encoding, output_len);
}
/* }}} */
@@ -3278,13 +3106,13 @@ MBSTRING_API HashTable *php_mb_convert_encoding_recursive(HashTable *input, cons
return NULL;
}
- if (input->u.v.nApplyCount++ > 1) {
- input->u.v.nApplyCount--;
+ if (GC_IS_RECURSIVE(input)) {
+ GC_UNPROTECT_RECURSION(input);
php_error_docref(NULL, E_WARNING, "Cannot convert recursively referenced values");
return NULL;
}
- output = (HashTable *)emalloc(sizeof(HashTable));
- zend_hash_init(output, zend_hash_num_elements(input), NULL, ZVAL_PTR_DTOR, 0);
+ GC_PROTECT_RECURSION(input);
+ output = zend_new_array(zend_hash_num_elements(input));
ZEND_HASH_FOREACH_KEY_VAL(input, idx, key, entry) {
/* convert key */
if (key) {
@@ -3309,8 +3137,7 @@ MBSTRING_API HashTable *php_mb_convert_encoding_recursive(HashTable *input, cons
case IS_ARRAY:
chash = php_mb_convert_encoding_recursive(HASH_OF(entry), _to_encoding, _from_encodings);
if (!chash) {
- chash = (HashTable *)emalloc(sizeof(HashTable));
- zend_hash_init(chash, 0, NULL, ZVAL_PTR_DTOR, 0);
+ chash = zend_new_array(0);
}
ZVAL_ARR(&entry_tmp, chash);
break;
@@ -3328,7 +3155,7 @@ MBSTRING_API HashTable *php_mb_convert_encoding_recursive(HashTable *input, cons
zend_hash_index_add(output, idx, &entry_tmp);
}
} ZEND_HASH_FOREACH_END();
- input->u.v.nApplyCount--;
+ GC_UNPROTECT_RECURSION(input);
return output;
}
@@ -3418,12 +3245,13 @@ PHP_FUNCTION(mb_convert_encoding)
Returns a case-folded version of sourcestring */
PHP_FUNCTION(mb_convert_case)
{
- const char *from_encoding = MBSTRG(current_internal_encoding)->mime_name;
+ const char *from_encoding = NULL;
char *str;
size_t str_len, from_encoding_len;
zend_long case_mode = 0;
char *newstr;
size_t ret_len;
+ const mbfl_encoding *enc;
RETVAL_FALSE;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl|s!", &str, &str_len,
@@ -3431,7 +3259,17 @@ PHP_FUNCTION(mb_convert_case)
return;
}
- newstr = php_unicode_convert_case(case_mode, str, (size_t) str_len, &ret_len, from_encoding);
+ enc = php_mb_get_encoding(from_encoding);
+ if (!enc) {
+ return;
+ }
+
+ if (case_mode < 0 || case_mode > PHP_UNICODE_CASE_MODE_MAX) {
+ php_error_docref(NULL, E_WARNING, "Invalid case mode");
+ return;
+ }
+
+ newstr = php_unicode_convert_case(case_mode, str, str_len, &ret_len, enc);
if (newstr) {
// TODO: avoid reallocation ???
@@ -3446,17 +3284,24 @@ PHP_FUNCTION(mb_convert_case)
*/
PHP_FUNCTION(mb_strtoupper)
{
- const char *from_encoding = MBSTRG(current_internal_encoding)->mime_name;
+ const char *from_encoding = NULL;
char *str;
size_t str_len, from_encoding_len;
char *newstr;
size_t ret_len;
+ const mbfl_encoding *enc;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s!", &str, &str_len,
&from_encoding, &from_encoding_len) == FAILURE) {
return;
}
- newstr = php_unicode_convert_case(PHP_UNICODE_CASE_UPPER, str, (size_t) str_len, &ret_len, from_encoding);
+
+ enc = php_mb_get_encoding(from_encoding);
+ if (!enc) {
+ RETURN_FALSE;
+ }
+
+ newstr = php_unicode_convert_case(PHP_UNICODE_CASE_UPPER, str, str_len, &ret_len, enc);
if (newstr) {
// TODO: avoid reallocation ???
@@ -3473,17 +3318,24 @@ PHP_FUNCTION(mb_strtoupper)
*/
PHP_FUNCTION(mb_strtolower)
{
- const char *from_encoding = MBSTRG(current_internal_encoding)->mime_name;
+ const char *from_encoding = NULL;
char *str;
size_t str_len, from_encoding_len;
char *newstr;
size_t ret_len;
+ const mbfl_encoding *enc;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|s!", &str, &str_len,
&from_encoding, &from_encoding_len) == FAILURE) {
return;
}
- newstr = php_unicode_convert_case(PHP_UNICODE_CASE_LOWER, str, (size_t) str_len, &ret_len, from_encoding);
+
+ enc = php_mb_get_encoding(from_encoding);
+ if (!enc) {
+ RETURN_FALSE;
+ }
+
+ newstr = php_unicode_convert_case(PHP_UNICODE_CASE_LOWER, str, str_len, &ret_len, enc);
if (newstr) {
// TODO: avoid reallocation ???
@@ -3544,7 +3396,7 @@ PHP_FUNCTION(mb_detect_encoding)
}
if (ZEND_NUM_ARGS() < 3) {
- strict = (zend_bool)MBSTRG(strict_detection);
+ strict = MBSTRG(strict_detection);
}
if (size > 0 && list != NULL) {
@@ -3558,7 +3410,7 @@ PHP_FUNCTION(mb_detect_encoding)
string.no_language = MBSTRG(language);
string.val = (unsigned char *)str;
string.len = str_len;
- ret = mbfl_identify_encoding2(&string, elist, size, strict);
+ ret = mbfl_identify_encoding(&string, elist, size, strict);
if (list != NULL) {
efree((void *)list);
@@ -3625,53 +3477,46 @@ PHP_FUNCTION(mb_encoding_aliases)
Converts the string to MIME "encoded-word" in the format of =?charset?(B|Q)?encoded_string?= */
PHP_FUNCTION(mb_encode_mimeheader)
{
- enum mbfl_no_encoding charset, transenc;
+ const mbfl_encoding *charset, *transenc;
mbfl_string string, result, *ret;
char *charset_name = NULL;
size_t charset_name_len;
char *trans_enc_name = NULL;
size_t trans_enc_name_len;
char *linefeed = "\r\n";
- size_t linefeed_len, string_len;
+ size_t linefeed_len;
zend_long indent = 0;
mbfl_string_init(&string);
string.no_language = MBSTRG(language);
- string.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
+ string.encoding = MBSTRG(current_internal_encoding);
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|sssl", (char **)&string.val, &string_len, &charset_name, &charset_name_len, &trans_enc_name, &trans_enc_name_len, &linefeed, &linefeed_len, &indent) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|sssl", (char **)&string.val, &string.len, &charset_name, &charset_name_len, &trans_enc_name, &trans_enc_name_len, &linefeed, &linefeed_len, &indent) == FAILURE) {
return;
}
- if (ZEND_SIZE_T_UINT_OVFL(string_len)) {
- php_error_docref(NULL, E_WARNING, "String length overflows the max allowed length of %u", UINT_MAX);
- return;
- }
-
- string.len = (uint32_t)string_len;
-
- charset = mbfl_no_encoding_pass;
- transenc = mbfl_no_encoding_base64;
+ charset = &mbfl_encoding_pass;
+ transenc = &mbfl_encoding_base64;
if (charset_name != NULL) {
- charset = mbfl_name2no_encoding(charset_name);
- if (charset == mbfl_no_encoding_invalid) {
+ charset = mbfl_name2encoding(charset_name);
+ if (!charset) {
php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", charset_name);
RETURN_FALSE;
}
} else {
const mbfl_language *lang = mbfl_no2language(MBSTRG(language));
if (lang != NULL) {
- charset = lang->mail_charset;
- transenc = lang->mail_header_encoding;
+ charset = mbfl_no2encoding(lang->mail_charset);
+ transenc = mbfl_no2encoding(lang->mail_header_encoding);
}
}
if (trans_enc_name != NULL) {
if (*trans_enc_name == 'B' || *trans_enc_name == 'b') {
- transenc = mbfl_no_encoding_base64;
+ transenc = &mbfl_encoding_base64;
} else if (*trans_enc_name == 'Q' || *trans_enc_name == 'q') {
- transenc = mbfl_no_encoding_qprint;
+ transenc = &mbfl_encoding_qprint;
}
}
@@ -3692,25 +3537,17 @@ PHP_FUNCTION(mb_encode_mimeheader)
PHP_FUNCTION(mb_decode_mimeheader)
{
mbfl_string string, result, *ret;
- size_t string_len;
mbfl_string_init(&string);
string.no_language = MBSTRG(language);
- string.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
+ string.encoding = MBSTRG(current_internal_encoding);
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", (char **)&string.val, &string_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", (char **)&string.val, &string.len) == FAILURE) {
return;
}
- if (ZEND_SIZE_T_UINT_OVFL(string_len)) {
- php_error_docref(NULL, E_WARNING, "String length overflows the max allowed length of %u", UINT_MAX);
- return;
- }
-
- string.len = (uint32_t)string_len;
-
mbfl_string_init(&result);
- ret = mbfl_mime_header_decode(&string, &result, MBSTRG(current_internal_encoding)->no_encoding);
+ ret = mbfl_mime_header_decode(&string, &result, MBSTRG(current_internal_encoding));
if (ret != NULL) {
// TODO: avoid reallocation ???
RETVAL_STRINGL((char *)ret->val, ret->len); /* the string is already strdup()'ed */
@@ -3725,33 +3562,23 @@ PHP_FUNCTION(mb_decode_mimeheader)
Conversion between full-width character and half-width character (Japanese) */
PHP_FUNCTION(mb_convert_kana)
{
- int opt, i;
+ int opt;
mbfl_string string, result, *ret;
char *optstr = NULL;
size_t optstr_len;
char *encname = NULL;
- size_t encname_len, string_len;
+ size_t encname_len;
mbfl_string_init(&string);
- string.no_language = MBSTRG(language);
- string.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ss", (char **)&string.val, &string_len, &optstr, &optstr_len, &encname, &encname_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ss", (char **)&string.val, &string.len, &optstr, &optstr_len, &encname, &encname_len) == FAILURE) {
return;
}
- if (ZEND_SIZE_T_UINT_OVFL(string_len)) {
- php_error_docref(NULL, E_WARNING, "String length overflows the max allowed length of %u", UINT_MAX);
- return;
- }
-
- string.len = (uint32_t)string_len;
-
/* option */
if (optstr != NULL) {
char *p = optstr;
- int n = optstr_len;
- i = 0;
+ size_t i = 0, n = optstr_len;
opt = 0;
while (i < n) {
i++;
@@ -3814,12 +3641,10 @@ PHP_FUNCTION(mb_convert_kana)
}
/* encoding */
- if (encname != NULL) {
- string.no_encoding = mbfl_name2no_encoding(encname);
- if (string.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", encname);
- RETURN_FALSE;
- }
+ string.no_language = MBSTRG(language);
+ string.encoding = php_mb_get_encoding(encname);
+ if (!string.encoding) {
+ RETURN_FALSE;
}
ret = mbfl_ja_jp_hantozen(&string, &result, opt);
@@ -3833,24 +3658,112 @@ PHP_FUNCTION(mb_convert_kana)
}
/* }}} */
-#define PHP_MBSTR_STACK_BLOCK_SIZE 32
+static int mb_recursive_encoder_detector_feed(mbfl_encoding_detector *identd, zval *var, int *recursion_error) /* {{{ */
+{
+ mbfl_string string;
+ HashTable *ht;
+ zval *entry;
+
+ ZVAL_DEREF(var);
+ if (Z_TYPE_P(var) == IS_STRING) {
+ string.val = (unsigned char *)Z_STRVAL_P(var);
+ string.len = Z_STRLEN_P(var);
+ if (mbfl_encoding_detector_feed(identd, &string)) {
+ return 1; /* complete detecting */
+ }
+ } else if (Z_TYPE_P(var) == IS_ARRAY || Z_TYPE_P(var) == IS_OBJECT) {
+ if (Z_REFCOUNTED_P(var)) {
+ if (Z_IS_RECURSIVE_P(var)) {
+ *recursion_error = 1;
+ return 0;
+ }
+ Z_PROTECT_RECURSION_P(var);
+ }
+
+ ht = HASH_OF(var);
+ if (ht != NULL) {
+ ZEND_HASH_FOREACH_VAL_IND(ht, entry) {
+ if (mb_recursive_encoder_detector_feed(identd, entry, recursion_error)) {
+ if (Z_REFCOUNTED_P(var)) {
+ Z_UNPROTECT_RECURSION_P(var);
+ }
+ return 1;
+ } else if (*recursion_error) {
+ if (Z_REFCOUNTED_P(var)) {
+ Z_UNPROTECT_RECURSION_P(var);
+ }
+ return 0;
+ }
+ } ZEND_HASH_FOREACH_END();
+ }
+
+ if (Z_REFCOUNTED_P(var)) {
+ Z_UNPROTECT_RECURSION_P(var);
+ }
+ }
+ return 0;
+} /* }}} */
+
+static int mb_recursive_convert_variable(mbfl_buffer_converter *convd, zval *var) /* {{{ */
+{
+ mbfl_string string, result, *ret;
+ HashTable *ht;
+ zval *entry, *orig_var;
+
+ orig_var = var;
+ ZVAL_DEREF(var);
+ if (Z_TYPE_P(var) == IS_STRING) {
+ string.val = (unsigned char *)Z_STRVAL_P(var);
+ string.len = Z_STRLEN_P(var);
+ ret = mbfl_buffer_converter_feed_result(convd, &string, &result);
+ if (ret != NULL) {
+ zval_ptr_dtor(orig_var);
+ // TODO: avoid reallocation ???
+ ZVAL_STRINGL(orig_var, (char *)ret->val, ret->len);
+ efree(ret->val);
+ }
+ } else if (Z_TYPE_P(var) == IS_ARRAY || Z_TYPE_P(var) == IS_OBJECT) {
+ SEPARATE_ZVAL_NOREF(var);
+ if (Z_REFCOUNTED_P(var)) {
+ if (Z_IS_RECURSIVE_P(var)) {
+ return 1;
+ }
+ Z_PROTECT_RECURSION_P(var);
+ }
+
+ ht = HASH_OF(var);
+ if (ht != NULL) {
+ ZEND_HASH_FOREACH_VAL_IND(ht, entry) {
+ if (mb_recursive_convert_variable(convd, entry)) {
+ if (Z_REFCOUNTED_P(var)) {
+ Z_UNPROTECT_RECURSION_P(var);
+ }
+ return 1;
+ }
+ } ZEND_HASH_FOREACH_END();
+ }
+
+ if (Z_REFCOUNTED_P(var)) {
+ Z_UNPROTECT_RECURSION_P(var);
+ }
+ }
+ return 0;
+} /* }}} */
/* {{{ proto string mb_convert_variables(string to-encoding, mixed from-encoding, mixed vars [, ...])
Converts the string resource in variables to desired encoding */
PHP_FUNCTION(mb_convert_variables)
{
- zval *args, *stack, *var, *hash_entry, *hash_entry_ptr, *zfrom_enc;
- HashTable *target_hash;
- mbfl_string string, result, *ret;
+ zval *args, *zfrom_enc;
+ mbfl_string string, result;
const mbfl_encoding *from_encoding, *to_encoding;
mbfl_encoding_detector *identd;
mbfl_buffer_converter *convd;
- int n, argc, stack_level, stack_max;
+ int n, argc;
size_t to_enc_len;
size_t elistsz;
const mbfl_encoding **elist;
char *to_enc;
- void *ptmp;
int recursion_error = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz+", &to_enc, &to_enc_len, &zfrom_enc, &args, &argc) == FAILURE) {
@@ -3868,7 +3781,7 @@ PHP_FUNCTION(mb_convert_variables)
mbfl_string_init(&string);
mbfl_string_init(&result);
from_encoding = MBSTRG(current_internal_encoding);
- string.no_encoding = from_encoding->no_encoding;
+ string.encoding = from_encoding;
string.no_language = MBSTRG(language);
/* pre-conversion encoding */
@@ -3891,94 +3804,25 @@ PHP_FUNCTION(mb_convert_variables)
} else {
/* auto detect */
from_encoding = NULL;
- stack_max = PHP_MBSTR_STACK_BLOCK_SIZE;
- stack = (zval *)safe_emalloc(stack_max, sizeof(zval), 0);
- stack_level = 0;
- identd = mbfl_encoding_detector_new2(elist, elistsz, MBSTRG(strict_detection));
+ identd = mbfl_encoding_detector_new(elist, elistsz, MBSTRG(strict_detection));
if (identd != NULL) {
n = 0;
- while (n < argc || stack_level > 0) {
- if (stack_level <= 0) {
- var = &args[n++];
- ZVAL_DEREF(var);
- SEPARATE_ZVAL_NOREF(var);
- if (Z_TYPE_P(var) == IS_ARRAY || Z_TYPE_P(var) == IS_OBJECT) {
- target_hash = HASH_OF(var);
- if (target_hash != NULL) {
- zend_hash_internal_pointer_reset(target_hash);
- }
- }
- } else {
- stack_level--;
- var = &stack[stack_level];
- }
- if (Z_TYPE_P(var) == IS_ARRAY || Z_TYPE_P(var) == IS_OBJECT) {
- target_hash = HASH_OF(var);
- if (target_hash != NULL) {
- while ((hash_entry = zend_hash_get_current_data(target_hash)) != NULL) {
- if (Z_REFCOUNTED_P(var)) {
- if (++target_hash->u.v.nApplyCount > 1) {
- --target_hash->u.v.nApplyCount;
- recursion_error = 1;
- goto detect_end;
- }
- }
- zend_hash_move_forward(target_hash);
- if (Z_TYPE_P(hash_entry) == IS_INDIRECT) {
- hash_entry = Z_INDIRECT_P(hash_entry);
- }
- ZVAL_DEREF(hash_entry);
- if (Z_TYPE_P(hash_entry) == IS_ARRAY || Z_TYPE_P(hash_entry) == IS_OBJECT) {
- if (stack_level >= stack_max) {
- stack_max += PHP_MBSTR_STACK_BLOCK_SIZE;
- ptmp = erealloc(stack, sizeof(zval) * stack_max);
- stack = (zval *)ptmp;
- }
- ZVAL_COPY_VALUE(&stack[stack_level], var);
- stack_level++;
- var = hash_entry;
- target_hash = HASH_OF(var);
- if (target_hash != NULL) {
- zend_hash_internal_pointer_reset(target_hash);
- continue;
- }
- } else if (Z_TYPE_P(hash_entry) == IS_STRING) {
- string.val = (unsigned char *)Z_STRVAL_P(hash_entry);
- string.len = Z_STRLEN_P(hash_entry);
- if (mbfl_encoding_detector_feed(identd, &string)) {
- goto detect_end; /* complete detecting */
- }
- }
- }
- }
- } else if (Z_TYPE_P(var) == IS_STRING) {
- string.val = (unsigned char *)Z_STRVAL_P(var);
- string.len = Z_STRLEN_P(var);
- if (mbfl_encoding_detector_feed(identd, &string)) {
- goto detect_end; /* complete detecting */
- }
+ while (n < argc) {
+ if (mb_recursive_encoder_detector_feed(identd, &args[n], &recursion_error)) {
+ break;
}
+ n++;
}
-detect_end:
- from_encoding = mbfl_encoding_detector_judge2(identd);
+ from_encoding = mbfl_encoding_detector_judge(identd);
mbfl_encoding_detector_delete(identd);
- }
- if (recursion_error) {
- while(stack_level-- && (var = &stack[stack_level])) {
- if (Z_REFCOUNTED_P(var)) {
- if (HASH_OF(var)->u.v.nApplyCount > 1) {
- HASH_OF(var)->u.v.nApplyCount--;
- }
+ if (recursion_error) {
+ if (elist != NULL) {
+ efree((void *)elist);
}
+ php_error_docref(NULL, E_WARNING, "Cannot handle recursive references");
+ RETURN_FALSE;
}
- efree(stack);
- if (elist != NULL) {
- efree((void *)elist);
- }
- php_error_docref(NULL, E_WARNING, "Cannot handle recursive references");
- RETURN_FALSE;
}
- efree(stack);
if (!from_encoding) {
php_error_docref(NULL, E_WARNING, "Unable to detect encoding");
@@ -3991,7 +3835,7 @@ detect_end:
/* create converter */
convd = NULL;
if (from_encoding != &mbfl_encoding_pass) {
- convd = mbfl_buffer_converter_new2(from_encoding, to_encoding, 0);
+ convd = mbfl_buffer_converter_new(from_encoding, to_encoding, 0);
if (convd == NULL) {
php_error_docref(NULL, E_WARNING, "Unable to create converter");
RETURN_FALSE;
@@ -4002,100 +3846,25 @@ detect_end:
/* convert */
if (convd != NULL) {
- stack_max = PHP_MBSTR_STACK_BLOCK_SIZE;
- stack = (zval*)safe_emalloc(stack_max, sizeof(zval), 0);
- stack_level = 0;
n = 0;
- while (n < argc || stack_level > 0) {
- if (stack_level <= 0) {
- var = &args[n++];
- ZVAL_DEREF(var);
- SEPARATE_ZVAL_NOREF(var);
- if (Z_TYPE_P(var) == IS_ARRAY || Z_TYPE_P(var) == IS_OBJECT) {
- target_hash = HASH_OF(var);
- if (target_hash != NULL) {
- zend_hash_internal_pointer_reset(target_hash);
- }
- }
- } else {
- stack_level--;
- var = &stack[stack_level];
- }
- if (Z_TYPE_P(var) == IS_ARRAY || Z_TYPE_P(var) == IS_OBJECT) {
- target_hash = HASH_OF(var);
- if (target_hash != NULL) {
- while ((hash_entry_ptr = zend_hash_get_current_data(target_hash)) != NULL) {
- zend_hash_move_forward(target_hash);
- if (Z_TYPE_P(hash_entry_ptr) == IS_INDIRECT) {
- hash_entry_ptr = Z_INDIRECT_P(hash_entry_ptr);
- }
- hash_entry = hash_entry_ptr;
- ZVAL_DEREF(hash_entry);
- if (Z_TYPE_P(hash_entry) == IS_ARRAY || Z_TYPE_P(hash_entry) == IS_OBJECT) {
- if (Z_REFCOUNTED_P(hash_entry)) {
- if (++(HASH_OF(hash_entry)->u.v.nApplyCount) > 1) {
- --(HASH_OF(hash_entry)->u.v.nApplyCount);
- recursion_error = 1;
- goto conv_end;
- }
- }
- if (stack_level >= stack_max) {
- stack_max += PHP_MBSTR_STACK_BLOCK_SIZE;
- ptmp = erealloc(stack, sizeof(zval) * stack_max);
- stack = (zval *)ptmp;
- }
- ZVAL_COPY_VALUE(&stack[stack_level], var);
- stack_level++;
- var = hash_entry;
- SEPARATE_ZVAL(hash_entry);
- target_hash = HASH_OF(var);
- if (target_hash != NULL) {
- zend_hash_internal_pointer_reset(target_hash);
- continue;
- }
- } else if (Z_TYPE_P(hash_entry) == IS_STRING) {
- string.val = (unsigned char *)Z_STRVAL_P(hash_entry);
- string.len = Z_STRLEN_P(hash_entry);
- ret = mbfl_buffer_converter_feed_result(convd, &string, &result);
- if (ret != NULL) {
- zval_ptr_dtor(hash_entry_ptr);
- // TODO: avoid reallocation ???
- ZVAL_STRINGL(hash_entry_ptr, (char *)ret->val, ret->len);
- efree(ret->val);
- }
- }
- }
- }
- } else if (Z_TYPE_P(var) == IS_STRING) {
- string.val = (unsigned char *)Z_STRVAL_P(var);
- string.len = Z_STRLEN_P(var);
- ret = mbfl_buffer_converter_feed_result(convd, &string, &result);
- if (ret != NULL) {
- zval_ptr_dtor(var);
- // TODO: avoid reallocation ???
- ZVAL_STRINGL(var, (char *)ret->val, ret->len);
- efree(ret->val);
- }
+ while (n < argc) {
+ zval *zv = &args[n];
+
+ ZVAL_DEREF(zv);
+ recursion_error = mb_recursive_convert_variable(convd, zv);
+ if (recursion_error) {
+ break;
}
+ n++;
}
-conv_end:
MBSTRG(illegalchars) += mbfl_buffer_illegalchars(convd);
mbfl_buffer_converter_delete(convd);
if (recursion_error) {
- while(stack_level-- && (var = &stack[stack_level])) {
- if (Z_REFCOUNTED_P(var)) {
- if (HASH_OF(var)->u.v.nApplyCount > 1) {
- HASH_OF(var)->u.v.nApplyCount--;
- }
- }
- }
- efree(stack);
php_error_docref(NULL, E_WARNING, "Cannot handle recursive references");
RETURN_FALSE;
}
- efree(stack);
}
if (from_encoding) {
@@ -4118,7 +3887,6 @@ php_mb_numericentity_exec(INTERNAL_FUNCTION_PARAMETERS, int type)
int i, *convmap, *mapelm, mapsize=0;
zend_bool is_hex = 0;
mbfl_string string, result, *ret;
- enum mbfl_no_encoding no_encoding;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "sz|sb", &str, &str_len, &zconvmap, &encoding, &encoding_len, &is_hex) == FAILURE) {
return;
@@ -4126,18 +3894,16 @@ php_mb_numericentity_exec(INTERNAL_FUNCTION_PARAMETERS, int type)
mbfl_string_init(&string);
string.no_language = MBSTRG(language);
- string.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
+ string.encoding = MBSTRG(current_internal_encoding);
string.val = (unsigned char *)str;
string.len = str_len;
/* encoding */
if (encoding && encoding_len > 0) {
- no_encoding = mbfl_name2no_encoding(encoding);
- if (no_encoding == mbfl_no_encoding_invalid) {
+ string.encoding = mbfl_name2encoding(encoding);
+ if (!string.encoding) {
php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", encoding);
RETURN_FALSE;
- } else {
- string.no_encoding = no_encoding;
}
}
@@ -4383,17 +4149,16 @@ out:
PHP_FUNCTION(mb_send_mail)
{
- int n;
- char *to = NULL;
+ char *to;
size_t to_len;
- char *message = NULL;
+ char *message;
size_t message_len;
- char *subject = NULL;
+ char *subject;
size_t subject_len;
zval *headers = NULL;
zend_string *extra_cmd = NULL;
- zend_string *str_headers=NULL, *tmp_headers;
- int i;
+ zend_string *str_headers = NULL, *tmp_headers;
+ size_t n, i;
char *to_r = NULL;
char *force_extra_parameters = INI_STR("mail.force_extra_parameters");
struct {
@@ -4404,10 +4169,10 @@ PHP_FUNCTION(mb_send_mail)
char *message_buf = NULL, *subject_buf = NULL, *p;
mbfl_string orig_str, conv_str;
mbfl_string *pstr; /* pointer to mbfl string for return value */
- enum mbfl_no_encoding
- tran_cs, /* transfar text charset */
- head_enc, /* header transfar encoding */
- body_enc; /* body transfar encoding */
+ enum mbfl_no_encoding;
+ const mbfl_encoding *tran_cs, /* transfar text charset */
+ *head_enc, /* header transfar encoding */
+ *body_enc; /* body transfar encoding */
mbfl_memory_device device; /* automatic allocateable buffer for additional header */
const mbfl_language *lang;
int err = 0;
@@ -4422,14 +4187,14 @@ PHP_FUNCTION(mb_send_mail)
mbfl_string_init(&conv_str);
/* character-set, transfer-encoding */
- tran_cs = mbfl_no_encoding_utf8;
- head_enc = mbfl_no_encoding_base64;
- body_enc = mbfl_no_encoding_base64;
+ tran_cs = &mbfl_encoding_utf8;
+ head_enc = &mbfl_encoding_base64;
+ body_enc = &mbfl_encoding_base64;
lang = mbfl_no2language(MBSTRG(language));
if (lang != NULL) {
- tran_cs = lang->mail_charset;
- head_enc = lang->mail_header_encoding;
- body_enc = lang->mail_body_encoding;
+ tran_cs = mbfl_no2encoding(lang->mail_charset);
+ head_enc = mbfl_no2encoding(lang->mail_header_encoding);
+ body_enc = mbfl_no2encoding(lang->mail_body_encoding);
}
if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss|zS", &to, &to_len, &subject, &subject_len, &message, &message_len, &headers, &extra_cmd) == FAILURE) {
@@ -4483,16 +4248,16 @@ PHP_FUNCTION(mb_send_mail)
if (*p != '\0') {
if ((param_name = php_strtok_r(p, "= ", &tmp)) != NULL) {
if (strcasecmp(param_name, "charset") == 0) {
- enum mbfl_no_encoding _tran_cs = tran_cs;
+ const mbfl_encoding *_tran_cs = tran_cs;
charset = php_strtok_r(NULL, "= \"", &tmp);
if (charset != NULL) {
- _tran_cs = mbfl_name2no_encoding(charset);
+ _tran_cs = mbfl_name2encoding(charset);
}
- if (_tran_cs == mbfl_no_encoding_invalid) {
+ if (!_tran_cs) {
php_error_docref(NULL, E_WARNING, "Unsupported charset \"%s\" - will be regarded as ascii", charset);
- _tran_cs = mbfl_no_encoding_ascii;
+ _tran_cs = &mbfl_encoding_ascii;
}
tran_cs = _tran_cs;
}
@@ -4503,11 +4268,11 @@ PHP_FUNCTION(mb_send_mail)
}
if ((s = zend_hash_str_find(&ht_headers, "CONTENT-TRANSFER-ENCODING", sizeof("CONTENT-TRANSFER-ENCODING") - 1))) {
- enum mbfl_no_encoding _body_enc;
+ const mbfl_encoding *_body_enc;
ZEND_ASSERT(Z_TYPE_P(s) == IS_STRING);
- _body_enc = mbfl_name2no_encoding(Z_STRVAL_P(s));
- switch (_body_enc) {
+ _body_enc = mbfl_name2encoding(Z_STRVAL_P(s));
+ switch (_body_enc ? _body_enc->no_encoding : mbfl_no_encoding_invalid) {
case mbfl_no_encoding_base64:
case mbfl_no_encoding_7bit:
case mbfl_no_encoding_8bit:
@@ -4516,89 +4281,73 @@ PHP_FUNCTION(mb_send_mail)
default:
php_error_docref(NULL, E_WARNING, "Unsupported transfer encoding \"%s\" - will be regarded as 8bit", Z_STRVAL_P(s));
- body_enc = mbfl_no_encoding_8bit;
+ body_enc = &mbfl_encoding_8bit;
break;
}
suppressed_hdrs.cnt_trans_enc = 1;
}
/* To: */
- if (to != NULL) {
- if (to_len > 0) {
- to_r = estrndup(to, to_len);
- for (; to_len; to_len--) {
- if (!isspace((unsigned char) to_r[to_len - 1])) {
- break;
- }
- to_r[to_len - 1] = '\0';
- }
- for (i = 0; to_r[i]; i++) {
- if (iscntrl((unsigned char) to_r[i])) {
- /* According to RFC 822, section 3.1.1 long headers may be separated into
- * parts using CRLF followed at least one linear-white-space character ('\t' or ' ').
- * To prevent these separators from being replaced with a space, we use the
- * SKIP_LONG_HEADER_SEP_MBSTRING to skip over them.
- */
- SKIP_LONG_HEADER_SEP_MBSTRING(to_r, i);
- to_r[i] = ' ';
- }
+ if (to_len > 0) {
+ to_r = estrndup(to, to_len);
+ for (; to_len; to_len--) {
+ if (!isspace((unsigned char) to_r[to_len - 1])) {
+ break;
}
- } else {
- to_r = to;
+ to_r[to_len - 1] = '\0';
+ }
+ for (i = 0; to_r[i]; i++) {
+ if (iscntrl((unsigned char) to_r[i])) {
+ /* According to RFC 822, section 3.1.1 long headers may be separated into
+ * parts using CRLF followed at least one linear-white-space character ('\t' or ' ').
+ * To prevent these separators from being replaced with a space, we use the
+ * SKIP_LONG_HEADER_SEP_MBSTRING to skip over them.
+ */
+ SKIP_LONG_HEADER_SEP_MBSTRING(to_r, i);
+ to_r[i] = ' ';
+ }
}
} else {
- php_error_docref(NULL, E_WARNING, "Missing To: field");
- err = 1;
+ to_r = to;
}
/* Subject: */
- if (subject != NULL) {
- orig_str.no_language = MBSTRG(language);
- orig_str.val = (unsigned char *)subject;
- orig_str.len = subject_len;
- orig_str.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- if (orig_str.no_encoding == mbfl_no_encoding_invalid || orig_str.no_encoding == mbfl_no_encoding_pass) {
- const mbfl_encoding *encoding = mbfl_identify_encoding2(&orig_str, MBSTRG(current_detect_order_list), MBSTRG(current_detect_order_list_size), MBSTRG(strict_detection));
- orig_str.no_encoding = encoding ? encoding->no_encoding: mbfl_no_encoding_invalid;
- }
- pstr = mbfl_mime_header_encode(&orig_str, &conv_str, tran_cs, head_enc, "\n", sizeof("Subject: [PHP-jp nnnnnnnn]"));
- if (pstr != NULL) {
- subject_buf = subject = (char *)pstr->val;
- }
- } else {
- php_error_docref(NULL, E_WARNING, "Missing Subject: field");
- err = 1;
+ orig_str.no_language = MBSTRG(language);
+ orig_str.val = (unsigned char *)subject;
+ orig_str.len = subject_len;
+ orig_str.encoding = MBSTRG(current_internal_encoding);
+ if (orig_str.encoding->no_encoding == mbfl_no_encoding_invalid
+ || orig_str.encoding->no_encoding == mbfl_no_encoding_pass) {
+ orig_str.encoding = mbfl_identify_encoding(&orig_str, MBSTRG(current_detect_order_list), MBSTRG(current_detect_order_list_size), MBSTRG(strict_detection));
+ }
+ pstr = mbfl_mime_header_encode(&orig_str, &conv_str, tran_cs, head_enc, "\n", sizeof("Subject: [PHP-jp nnnnnnnn]"));
+ if (pstr != NULL) {
+ subject_buf = subject = (char *)pstr->val;
}
/* message body */
- if (message != NULL) {
- orig_str.no_language = MBSTRG(language);
- orig_str.val = (unsigned char *)message;
- orig_str.len = (unsigned int)message_len;
- orig_str.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
+ orig_str.no_language = MBSTRG(language);
+ orig_str.val = (unsigned char *)message;
+ orig_str.len = message_len;
+ orig_str.encoding = MBSTRG(current_internal_encoding);
- if (orig_str.no_encoding == mbfl_no_encoding_invalid || orig_str.no_encoding == mbfl_no_encoding_pass) {
- const mbfl_encoding *encoding = mbfl_identify_encoding2(&orig_str, MBSTRG(current_detect_order_list), MBSTRG(current_detect_order_list_size), MBSTRG(strict_detection));
- orig_str.no_encoding = encoding ? encoding->no_encoding: mbfl_no_encoding_invalid;
- }
+ if (orig_str.encoding->no_encoding == mbfl_no_encoding_invalid
+ || orig_str.encoding->no_encoding == mbfl_no_encoding_pass) {
+ orig_str.encoding = mbfl_identify_encoding(&orig_str, MBSTRG(current_detect_order_list), MBSTRG(current_detect_order_list_size), MBSTRG(strict_detection));
+ }
- pstr = NULL;
- {
- mbfl_string tmpstr;
+ pstr = NULL;
+ {
+ mbfl_string tmpstr;
- if (mbfl_convert_encoding(&orig_str, &tmpstr, tran_cs) != NULL) {
- tmpstr.no_encoding=mbfl_no_encoding_8bit;
- pstr = mbfl_convert_encoding(&tmpstr, &conv_str, body_enc);
- efree(tmpstr.val);
- }
+ if (mbfl_convert_encoding(&orig_str, &tmpstr, tran_cs) != NULL) {
+ tmpstr.encoding = &mbfl_encoding_8bit;
+ pstr = mbfl_convert_encoding(&tmpstr, &conv_str, body_enc);
+ efree(tmpstr.val);
}
- if (pstr != NULL) {
- message_buf = message = (char *)pstr->val;
- }
- } else {
- /* this is not really an error, so it is allowed. */
- php_error_docref(NULL, E_WARNING, "Empty message body");
- message = NULL;
+ }
+ if (pstr != NULL) {
+ message_buf = message = (char *)pstr->val;
}
/* other headers */
@@ -4624,7 +4373,7 @@ PHP_FUNCTION(mb_send_mail)
if (!suppressed_hdrs.cnt_type) {
mbfl_memory_device_strncat(&device, PHP_MBSTR_MAIL_MIME_HEADER2, sizeof(PHP_MBSTR_MAIL_MIME_HEADER2) - 1);
- p = (char *)mbfl_no2preferred_mime_name(tran_cs);
+ p = (char *)mbfl_no2preferred_mime_name(tran_cs->no_encoding);
if (p != NULL) {
mbfl_memory_device_strncat(&device, PHP_MBSTR_MAIL_MIME_HEADER3, sizeof(PHP_MBSTR_MAIL_MIME_HEADER3) - 1);
mbfl_memory_device_strcat(&device, p);
@@ -4633,7 +4382,7 @@ PHP_FUNCTION(mb_send_mail)
}
if (!suppressed_hdrs.cnt_trans_enc) {
mbfl_memory_device_strncat(&device, PHP_MBSTR_MAIL_MIME_HEADER4, sizeof(PHP_MBSTR_MAIL_MIME_HEADER4) - 1);
- p = (char *)mbfl_no2preferred_mime_name(body_enc);
+ p = (char *)mbfl_no2preferred_mime_name(body_enc->no_encoding);
if (p == NULL) {
p = "7bit";
}
@@ -4868,7 +4617,7 @@ static inline mbfl_buffer_converter *php_mb_init_convd(const mbfl_encoding *enco
{
mbfl_buffer_converter *convd;
- convd = mbfl_buffer_converter_new2(encoding, encoding, 0);
+ convd = mbfl_buffer_converter_new(encoding, encoding, 0);
if (convd == NULL) {
return NULL;
}
@@ -4880,10 +4629,10 @@ static inline mbfl_buffer_converter *php_mb_init_convd(const mbfl_encoding *enco
static inline int php_mb_check_encoding_impl(mbfl_buffer_converter *convd, const char *input, size_t length, const mbfl_encoding *encoding) {
mbfl_string string, result, *ret = NULL;
- long illegalchars = 0;
+ size_t illegalchars = 0;
/* initialize string */
- mbfl_string_init_set(&string, mbfl_no_language_neutral, encoding->no_encoding);
+ mbfl_string_init_set(&string, mbfl_no_language_neutral, encoding);
mbfl_string_init(&result);
string.val = (unsigned char *) input;
@@ -4960,12 +4709,12 @@ MBSTRING_API int php_mb_check_encoding_recursive(HashTable *vars, const zend_str
return 0;
}
- if (vars->u.v.nApplyCount++ > 1) {
- vars->u.v.nApplyCount--;
+ if (GC_IS_RECURSIVE(vars)) {
mbfl_buffer_converter_delete(convd);
php_error_docref(NULL, E_WARNING, "Cannot not handle circular references");
return 0;
}
+ GC_PROTECT_RECURSION(vars);
ZEND_HASH_FOREACH_KEY_VAL(vars, idx, key, entry) {
ZVAL_DEREF(entry);
if (key) {
@@ -4999,7 +4748,7 @@ MBSTRING_API int php_mb_check_encoding_recursive(HashTable *vars, const zend_str
break;
}
} ZEND_HASH_FOREACH_END();
- vars->u.v.nApplyCount--;
+ GC_UNPROTECT_RECURSION(vars);
mbfl_buffer_converter_delete(convd);
return valid;
}
@@ -5051,26 +4800,19 @@ PHP_FUNCTION(mb_check_encoding)
/* }}} */
-static inline zend_long php_mb_ord(const char* str, size_t str_len, const char* enc)
+static inline zend_long php_mb_ord(const char* str, size_t str_len, const char* enc_name)
{
+ const mbfl_encoding *enc;
enum mbfl_no_encoding no_enc;
- char* ret;
- size_t ret_len;
- zend_long cp;
-
- if (enc == NULL) {
- no_enc = MBSTRG(current_internal_encoding)->no_encoding;
- } else {
- no_enc = mbfl_name2no_encoding(enc);
- if (no_enc == mbfl_no_encoding_invalid) {
- php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", enc);
- return -1;
- }
+ enc = php_mb_get_encoding(enc_name);
+ if (!enc) {
+ return -1;
}
+ no_enc = enc->no_encoding;
if (php_mb_is_unsupported_no_encoding(no_enc)) {
- php_error_docref(NULL, E_WARNING, "Unsupported encoding \"%s\"", enc);
+ php_error_docref(NULL, E_WARNING, "Unsupported encoding \"%s\"", enc_name);
return -1;
}
@@ -5080,32 +4822,32 @@ static inline zend_long php_mb_ord(const char* str, size_t str_len, const char*
}
{
- long orig_illegalchars = MBSTRG(illegalchars);
- MBSTRG(illegalchars) = 0;
- ret = php_mb_convert_encoding(str, str_len, "UCS-4BE", enc, &ret_len);
- if (MBSTRG(illegalchars) != 0) {
- if (ret) {
- efree(ret);
- }
- MBSTRG(illegalchars) = orig_illegalchars;
+ mbfl_wchar_device dev;
+ mbfl_convert_filter *filter;
+ zend_long cp;
+
+ mbfl_wchar_device_init(&dev);
+ filter = mbfl_convert_filter_new(
+ enc, &mbfl_encoding_wchar,
+ mbfl_wchar_device_output, 0, &dev);
+ if (!filter) {
+ php_error_docref(NULL, E_WARNING, "Creation of filter failed");
return -1;
}
- MBSTRG(illegalchars) = orig_illegalchars;
- }
-
- if (ret == NULL) {
- return -1;
- }
+ mbfl_convert_filter_feed_string(filter, (const unsigned char *) str, str_len);
+ mbfl_convert_filter_flush(filter);
+ mbfl_convert_filter_delete(filter);
- cp = (unsigned char) ret[0] << 24 | \
- (unsigned char) ret[1] << 16 | \
- (unsigned char) ret[2] << 8 | \
- (unsigned char) ret[3];
-
- efree(ret);
+ if (dev.pos < 1 || filter->num_illegalchar || dev.buffer[0] >= MBFL_WCSGROUP_UCS4MAX) {
+ mbfl_wchar_device_clear(&dev);
+ return -1;
+ }
- return cp;
+ cp = dev.buffer[0];
+ mbfl_wchar_device_clear(&dev);
+ return cp;
+ }
}
@@ -5135,26 +4877,22 @@ PHP_FUNCTION(mb_ord)
/* }}} */
-static inline char* php_mb_chr(zend_long cp, const char* enc, size_t *output_len)
+static inline zend_string *php_mb_chr(zend_long cp, const char *enc_name)
{
+ const mbfl_encoding *enc;
enum mbfl_no_encoding no_enc;
+ zend_string *ret;
char* buf;
size_t buf_len;
- char* ret;
- size_t ret_len;
- if (enc == NULL) {
- no_enc = MBSTRG(current_internal_encoding)->no_encoding;
- } else {
- no_enc = mbfl_name2no_encoding(enc);
- if (no_enc == mbfl_no_encoding_invalid) {
- php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", enc);
- return NULL;
- }
+ enc = php_mb_get_encoding(enc_name);
+ if (!enc) {
+ return NULL;
}
+ no_enc = enc->no_encoding;
if (php_mb_is_unsupported_no_encoding(no_enc)) {
- php_error_docref(NULL, E_WARNING, "Unsupported encoding \"%s\"", enc);
+ php_error_docref(NULL, E_WARNING, "Unsupported encoding \"%s\"", enc_name);
return NULL;
}
@@ -5168,42 +4906,32 @@ static inline char* php_mb_chr(zend_long cp, const char* enc, size_t *output_len
}
if (cp < 0x80) {
- ret_len = 1;
- ret = (char *) safe_emalloc(ret_len, 1, 1);
- ret[0] = cp;
- ret[1] = 0;
+ ret = ZSTR_CHAR(cp);
} else if (cp < 0x800) {
- ret_len = 2;
- ret = (char *) safe_emalloc(ret_len, 1, 1);
- ret[0] = 0xc0 | (cp >> 6);
- ret[1] = 0x80 | (cp & 0x3f);
- ret[2] = 0;
+ ret = zend_string_alloc(2, 0);
+ ZSTR_VAL(ret)[0] = 0xc0 | (cp >> 6);
+ ZSTR_VAL(ret)[1] = 0x80 | (cp & 0x3f);
+ ZSTR_VAL(ret)[2] = 0;
} else if (cp < 0x10000) {
- ret_len = 3;
- ret = (char *) safe_emalloc(ret_len, 1, 1);
- ret[0] = 0xe0 | (cp >> 12);
- ret[1] = 0x80 | ((cp >> 6) & 0x3f);
- ret[2] = 0x80 | (cp & 0x3f);
- ret[3] = 0;
+ ret = zend_string_alloc(3, 0);
+ ZSTR_VAL(ret)[0] = 0xe0 | (cp >> 12);
+ ZSTR_VAL(ret)[1] = 0x80 | ((cp >> 6) & 0x3f);
+ ZSTR_VAL(ret)[2] = 0x80 | (cp & 0x3f);
+ ZSTR_VAL(ret)[3] = 0;
} else {
- ret_len = 4;
- ret = (char *) safe_emalloc(ret_len, 1, 1);
- ret[0] = 0xf0 | (cp >> 18);
- ret[1] = 0x80 | ((cp >> 12) & 0x3f);
- ret[2] = 0x80 | ((cp >> 6) & 0x3f);
- ret[3] = 0x80 | (cp & 0x3f);
- ret[4] = 0;
- }
-
- if (output_len) {
- *output_len = ret_len;
+ ret = zend_string_alloc(4, 0);
+ ZSTR_VAL(ret)[0] = 0xf0 | (cp >> 18);
+ ZSTR_VAL(ret)[1] = 0x80 | ((cp >> 12) & 0x3f);
+ ZSTR_VAL(ret)[2] = 0x80 | ((cp >> 6) & 0x3f);
+ ZSTR_VAL(ret)[3] = 0x80 | (cp & 0x3f);
+ ZSTR_VAL(ret)[4] = 0;
}
return ret;
}
buf_len = 4;
- buf = (char *) safe_emalloc(buf_len, 1, 1);
+ buf = (char *) emalloc(buf_len + 1);
buf[0] = (cp >> 24) & 0xff;
buf[1] = (cp >> 16) & 0xff;
buf[2] = (cp >> 8) & 0xff;
@@ -5211,24 +4939,24 @@ static inline char* php_mb_chr(zend_long cp, const char* enc, size_t *output_len
buf[4] = 0;
{
+ char *ret_str;
+ size_t ret_len;
long orig_illegalchars = MBSTRG(illegalchars);
MBSTRG(illegalchars) = 0;
- ret = php_mb_convert_encoding(buf, buf_len, enc, "UCS-4BE", &ret_len);
+ ret_str = php_mb_convert_encoding_ex(buf, buf_len, enc, &mbfl_encoding_ucs4be, &ret_len);
if (MBSTRG(illegalchars) != 0) {
efree(buf);
- efree(ret);
+ efree(ret_str);
MBSTRG(illegalchars) = orig_illegalchars;
return NULL;
}
+ ret = zend_string_init(ret_str, ret_len, 0);
+ efree(ret_str);
MBSTRG(illegalchars) = orig_illegalchars;
}
efree(buf);
- if (output_len) {
- *output_len = ret_len;
- }
-
return ret;
}
@@ -5239,8 +4967,7 @@ PHP_FUNCTION(mb_chr)
zend_long cp;
char* enc = NULL;
size_t enc_len;
- char* ret;
- size_t ret_len;
+ zend_string* ret;
ZEND_PARSE_PARAMETERS_START(1, 2)
Z_PARAM_LONG(cp)
@@ -5248,45 +4975,42 @@ PHP_FUNCTION(mb_chr)
Z_PARAM_STRING(enc, enc_len)
ZEND_PARSE_PARAMETERS_END();
- ret = php_mb_chr(cp, enc, &ret_len);
-
+ ret = php_mb_chr(cp, enc);
if (ret == NULL) {
RETURN_FALSE;
}
- RETVAL_STRING(ret);
- efree(ret);
+ RETURN_STR(ret);
}
/* }}} */
-static inline char* php_mb_scrub(const char* str, size_t str_len, const char* enc)
+static inline char* php_mb_scrub(const char* str, size_t str_len, const mbfl_encoding *enc)
{
size_t ret_len;
- return php_mb_convert_encoding(str, str_len, enc, enc, &ret_len);
+ return php_mb_convert_encoding_ex(str, str_len, enc, enc, &ret_len);
}
/* {{{ proto bool mb_scrub([string str[, string encoding]]) */
PHP_FUNCTION(mb_scrub)
{
+ const mbfl_encoding *enc;
char* str;
size_t str_len;
- char *enc = NULL;
- size_t enc_len;
+ char *enc_name = NULL;
+ size_t enc_name_len;
char *ret;
ZEND_PARSE_PARAMETERS_START(1, 2)
Z_PARAM_STRING(str, str_len)
Z_PARAM_OPTIONAL
- Z_PARAM_STRING(enc, enc_len)
+ Z_PARAM_STRING(enc_name, enc_name_len)
ZEND_PARSE_PARAMETERS_END();
- if (enc == NULL) {
- enc = (char *) MBSTRG(current_internal_encoding)->name;
- } else if (!mbfl_is_support_encoding(enc)) {
- php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", enc);
+ enc = php_mb_get_encoding(enc_name);
+ if (!enc) {
RETURN_FALSE;
}
@@ -5412,63 +5136,65 @@ MBSTRING_API char *php_mb_safe_strrchr(const char *s, unsigned int c, size_t nby
/* {{{ MBSTRING_API int php_mb_stripos()
*/
-MBSTRING_API int php_mb_stripos(int mode, const char *old_haystack, unsigned int old_haystack_len, const char *old_needle, unsigned int old_needle_len, long offset, const char *from_encoding)
+MBSTRING_API size_t php_mb_stripos(int mode, const char *old_haystack, size_t old_haystack_len, const char *old_needle, size_t old_needle_len, zend_long offset, const char *from_encoding)
{
- int n;
+ size_t n = (size_t) -1;
mbfl_string haystack, needle;
- n = -1;
+ const mbfl_encoding *enc;
+
+ enc = php_mb_get_encoding(from_encoding);
+ if (!enc) {
+ return (size_t) -1;
+ }
mbfl_string_init(&haystack);
mbfl_string_init(&needle);
haystack.no_language = MBSTRG(language);
- haystack.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
+ haystack.encoding = enc;
needle.no_language = MBSTRG(language);
- needle.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
+ needle.encoding = enc;
do {
+ /* We're using simple case-folding here, because we'd have to deal with remapping of
+ * offsets otherwise. */
+
size_t len = 0;
- haystack.val = (unsigned char *)php_unicode_convert_case(PHP_UNICODE_CASE_UPPER, (char *)old_haystack, old_haystack_len, &len, from_encoding);
+ haystack.val = (unsigned char *)php_unicode_convert_case(PHP_UNICODE_CASE_FOLD_SIMPLE, (char *)old_haystack, old_haystack_len, &len, enc);
haystack.len = len;
if (!haystack.val) {
break;
}
- if (haystack.len <= 0) {
+ if (haystack.len == 0) {
break;
}
- needle.val = (unsigned char *)php_unicode_convert_case(PHP_UNICODE_CASE_UPPER, (char *)old_needle, old_needle_len, &len, from_encoding);
+ needle.val = (unsigned char *)php_unicode_convert_case(PHP_UNICODE_CASE_FOLD_SIMPLE, (char *)old_needle, old_needle_len, &len, enc);
needle.len = len;
if (!needle.val) {
break;
}
- if (needle.len <= 0) {
- break;
- }
-
- haystack.no_encoding = needle.no_encoding = mbfl_name2no_encoding(from_encoding);
- if (haystack.no_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", from_encoding);
+ if (needle.len == 0) {
break;
}
- {
- int haystack_char_len = mbfl_strlen(&haystack);
+ if (offset != 0) {
+ size_t haystack_char_len = mbfl_strlen(&haystack);
if (mode) {
- if ((offset > 0 && offset > haystack_char_len) ||
- (offset < 0 && -offset > haystack_char_len)) {
+ if ((offset > 0 && (size_t)offset > haystack_char_len) ||
+ (offset < 0 && (size_t)(-offset) > haystack_char_len)) {
php_error_docref(NULL, E_WARNING, "Offset is greater than the length of haystack string");
break;
}
} else {
if (offset < 0) {
- offset += (long)haystack_char_len;
+ offset += (zend_long)haystack_char_len;
}
- if (offset < 0 || offset > haystack_char_len) {
+ if (offset < 0 || (size_t)offset > haystack_char_len) {
php_error_docref(NULL, E_WARNING, "Offset not contained in string");
break;
}
diff --git a/ext/mbstring/mbstring.h b/ext/mbstring/mbstring.h
index 4772898c89..40f28b448f 100644
--- a/ext/mbstring/mbstring.h
+++ b/ext/mbstring/mbstring.h
@@ -13,36 +13,13 @@
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Tsukada Takuya <tsukada@fminn.nagano.nagano.jp> |
+ | Hironori Sato <satoh@jpnnet.com> |
+ | Shigeru Kanemoto <sgk@happysize.co.jp> |
+----------------------------------------------------------------------+
*/
/* $Id$ */
-/*
- * PHP 4 Multibyte String module "mbstring" (currently only for Japanese)
- *
- * History:
- * 2000.5.19 Release php-4.0RC2_jstring-1.0
- * 2001.4.1 Release php4_jstring-1.0.91
- * 2001.4.30 Release php4-jstring-1.1 (contribute to The PHP Group)
- * 2001.5.1 Renamed from jstring to mbstring (hirokawa@php.net)
- */
-
-/*
- * PHP3 Internationalization support program.
- *
- * Copyright (c) 1999,2000 by the PHP3 internationalization team.
- * All rights reserved.
- *
- * See README_PHP3-i18n-ja for more detail.
- *
- * Authors:
- * Hironori Sato <satoh@jpnnet.com>
- * Shigeru Kanemoto <sgk@happysize.co.jp>
- * Tsukada Takuya <tsukada@fminn.nagano.nagano.jp>
- */
-
-
#ifndef _MBSTRING_H
#define _MBSTRING_H
@@ -140,6 +117,9 @@ MBSTRING_API char *php_mb_safe_strrchr_ex(const char *s, unsigned int c,
MBSTRING_API char *php_mb_safe_strrchr(const char *s, unsigned int c,
size_t nbytes);
+MBSTRING_API char *php_mb_convert_encoding_ex(
+ const char *input, size_t length,
+ const mbfl_encoding *to_encoding, const mbfl_encoding *from_encoding, size_t *output_len);
MBSTRING_API char * php_mb_convert_encoding(const char *input, size_t length,
const char *_to_encoding,
const char *_from_encodings,
@@ -150,20 +130,14 @@ MBSTRING_API int php_mb_check_encoding_list(const char *encoding_list);
MBSTRING_API size_t php_mb_mbchar_bytes_ex(const char *s, const mbfl_encoding *enc);
MBSTRING_API size_t php_mb_mbchar_bytes(const char *s);
-MBSTRING_API int php_mb_encoding_detector_ex(const char *arg_string, int arg_length,
- char *arg_list);
-
-MBSTRING_API int php_mb_encoding_converter_ex(char **str, int *len, const char *encoding_to,
- const char *encoding_from);
-MBSTRING_API int php_mb_stripos(int mode, const char *old_haystack, unsigned int old_haystack_len, const char *old_needle, unsigned int old_needle_len, long offset, const char *from_encoding);
+MBSTRING_API size_t php_mb_stripos(int mode, const char *old_haystack, size_t old_haystack_len, const char *old_needle, size_t old_needle_len, zend_long offset, const char *from_encoding);
MBSTRING_API int php_mb_check_encoding(const char *input, size_t length, const char *enc);
/* internal use only */
-int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint32_t new_value_length);
+int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, size_t new_value_length);
ZEND_BEGIN_MODULE_GLOBALS(mbstring)
char *internal_encoding_name;
- enum mbfl_no_language language;
const mbfl_encoding *internal_encoding;
const mbfl_encoding *current_internal_encoding;
const mbfl_encoding *http_output_encoding;
@@ -185,15 +159,18 @@ ZEND_BEGIN_MODULE_GLOBALS(mbstring)
int filter_illegal_substchar;
int current_filter_illegal_mode;
int current_filter_illegal_substchar;
- long func_overload;
+ zend_long func_overload;
+ enum mbfl_no_language language;
zend_bool encoding_translation;
- long strict_detection;
- long illegalchars;
+ zend_bool strict_detection;
+ size_t illegalchars;
mbfl_buffer_converter *outconv;
void *http_output_conv_mimetypes;
#if HAVE_MBREGEX
struct _zend_mb_regex_globals *mb_regex_globals;
#endif
+ char *last_used_encoding_name;
+ const mbfl_encoding *last_used_encoding;
ZEND_END_MODULE_GLOBALS(mbstring)
#define MB_OVERLOAD_MAIL 1
diff --git a/ext/mbstring/php_unicode.c b/ext/mbstring/php_unicode.c
index 485988fe35..3b928bcebb 100644
--- a/ext/mbstring/php_unicode.c
+++ b/ext/mbstring/php_unicode.c
@@ -43,22 +43,10 @@
#include "mbstring.h"
#include "php_unicode.h"
#include "unicode_data.h"
+#include "libmbfl/mbfl/mbfilter_wchar.h"
ZEND_EXTERN_MODULE_GLOBALS(mbstring)
-/*
- * A simple array of 32-bit masks for lookup.
- */
-static unsigned long masks32[32] = {
- 0x00000001, 0x00000002, 0x00000004, 0x00000008, 0x00000010, 0x00000020,
- 0x00000040, 0x00000080, 0x00000100, 0x00000200, 0x00000400, 0x00000800,
- 0x00001000, 0x00002000, 0x00004000, 0x00008000, 0x00010000, 0x00020000,
- 0x00040000, 0x00080000, 0x00100000, 0x00200000, 0x00400000, 0x00800000,
- 0x01000000, 0x02000000, 0x04000000, 0x08000000, 0x10000000, 0x20000000,
- 0x40000000, 0x80000000
-};
-
-
static int prop_lookup(unsigned long code, unsigned long n)
{
long l, r, m;
@@ -98,241 +86,352 @@ static int prop_lookup(unsigned long code, unsigned long n)
}
-MBSTRING_API int php_unicode_is_prop(unsigned long code, unsigned long mask1,
- unsigned long mask2)
+MBSTRING_API int php_unicode_is_prop1(unsigned long code, int prop)
{
- unsigned long i;
+ return prop_lookup(code, prop);
+}
- if (mask1 == 0 && mask2 == 0)
- return 0;
+MBSTRING_API int php_unicode_is_prop(unsigned long code, ...)
+{
+ int result = 0;
+ va_list va;
+ va_start(va, code);
- for (i = 0; mask1 && i < 32; i++) {
- if ((mask1 & masks32[i]) && prop_lookup(code, i))
- return 1;
- }
+ while (1) {
+ int prop = va_arg(va, int);
+ if (prop < 0) {
+ break;
+ }
- for (i = 32; mask2 && i < _ucprop_size; i++) {
- if ((mask2 & masks32[i & 31]) && prop_lookup(code, i))
- return 1;
+ if (prop_lookup(code, prop)) {
+ result = 1;
+ break;
+ }
}
- return 0;
+ va_end(va);
+ return result;
+}
+
+static inline unsigned mph_hash(unsigned d, unsigned x) {
+ x ^= d;
+ x = ((x >> 16) ^ x) * 0x45d9f3b;
+ return x;
}
-static unsigned long case_lookup(unsigned long code, long l, long r, int field)
+#define CODE_NOT_FOUND ((unsigned) -1)
+
+static inline unsigned mph_lookup(
+ unsigned code,
+ const short *g_table, unsigned g_table_size,
+ const unsigned *table, unsigned table_size)
{
- long m;
- const unsigned int *tmp;
+ short g = g_table[mph_hash(0, code) % g_table_size];
- /*
- * Do the binary search.
- */
- while (l <= r) {
- /*
- * Determine a "mid" point and adjust to make sure the mid point is at
- * the beginning of a case mapping triple.
- */
- m = (l + r) >> 1;
- tmp = &_uccase_map[m*3];
- if (code > *tmp)
- l = m + 1;
- else if (code < *tmp)
- r = m - 1;
- else if (code == *tmp)
- return tmp[field];
+ unsigned idx;
+ if (g <= 0) {
+ idx = -g;
+ } else {
+ idx = mph_hash(g, code) % table_size;
}
- return code;
+ if (table[2*idx] == code) {
+ return table[2*idx + 1];
+ }
+ return CODE_NOT_FOUND;
}
-MBSTRING_API unsigned long php_turkish_toupper(unsigned long code, long l, long r, int field)
+#define CASE_LOOKUP(code, type) \
+ mph_lookup(code, _uccase_##type##_g, _uccase_##type##_g_size, \
+ _uccase_##type##_table, _uccase_##type##_table_size)
+
+static unsigned php_unicode_toupper_raw(unsigned code, enum mbfl_no_encoding enc)
{
- if (code == 0x0069L) {
- return 0x0130L;
+ if (code < 0x80) {
+ /* Fast path for ASCII */
+ if (code >= 0x61 && code <= 0x7A) {
+ if (UNEXPECTED(enc == mbfl_no_encoding_8859_9 && code == 0x69)) {
+ return 0x130;
+ }
+ return code - 0x20;
+ }
+ return code;
+ } else {
+ unsigned new_code = CASE_LOOKUP(code, upper);
+ if (new_code != CODE_NOT_FOUND) {
+ return new_code;
+ }
+ return code;
}
- return case_lookup(code, l, r, field);
}
-MBSTRING_API unsigned long php_turkish_tolower(unsigned long code, long l, long r, int field)
+static unsigned php_unicode_tolower_raw(unsigned code, enum mbfl_no_encoding enc)
{
- if (code == 0x0049L) {
- return 0x0131L;
+ if (code < 0x80) {
+ /* Fast path for ASCII */
+ if (code >= 0x41 && code <= 0x5A) {
+ if (UNEXPECTED(enc == mbfl_no_encoding_8859_9 && code == 0x0049L)) {
+ return 0x0131L;
+ }
+ return code + 0x20;
+ }
+ return code;
+ } else {
+ unsigned new_code = CASE_LOOKUP(code, lower);
+ if (new_code != CODE_NOT_FOUND) {
+ if (UNEXPECTED(enc == mbfl_no_encoding_8859_9 && code == 0x130)) {
+ return 0x69;
+ }
+ return new_code;
+ }
+ return code;
}
- return case_lookup(code, l, r, field);
}
-MBSTRING_API unsigned long php_unicode_toupper(unsigned long code, enum mbfl_no_encoding enc)
+static unsigned php_unicode_totitle_raw(unsigned code, enum mbfl_no_encoding enc)
{
- int field;
- long l, r;
-
- if (php_unicode_is_upper(code))
- return code;
+ unsigned new_code = CASE_LOOKUP(code, title);
+ if (new_code != CODE_NOT_FOUND) {
+ return new_code;
+ }
- if (php_unicode_is_lower(code)) {
- /*
- * The character is lower case.
- */
- field = 1;
- l = _uccase_len[0];
- r = (l + _uccase_len[1]) - 1;
+ /* No dedicated title-case variant, use to-upper instead */
+ return php_unicode_toupper_raw(code, enc);
+}
- if (enc == mbfl_no_encoding_8859_9) {
- return php_turkish_toupper(code, l, r, field);
+unsigned php_unicode_tofold_raw(unsigned code, enum mbfl_no_encoding enc)
+{
+ if (code < 0x80) {
+ /* Fast path for ASCII */
+ if (code >= 0x41 && code <= 0x5A) {
+ if (UNEXPECTED(enc == mbfl_no_encoding_8859_9 && code == 0x49)) {
+ return 0x131;
+ }
+ return code + 0x20;
}
-
+ return code;
} else {
- /*
- * The character is title case.
- */
- field = 1;
- l = _uccase_len[0] + _uccase_len[1];
- r = _uccase_size - 1;
+ unsigned new_code = CASE_LOOKUP(code, fold);
+ if (new_code != CODE_NOT_FOUND) {
+ if (UNEXPECTED(enc == mbfl_no_encoding_8859_9 && code == 0x130)) {
+ return 0x69;
+ }
+ return new_code;
+ }
+ return code;
}
- return case_lookup(code, l, r, field);
}
-MBSTRING_API unsigned long php_unicode_tolower(unsigned long code, enum mbfl_no_encoding enc)
-{
- int field;
- long l, r;
-
- if (php_unicode_is_lower(code))
- return code;
-
- if (php_unicode_is_upper(code)) {
- /*
- * The character is upper case.
- */
- field = 1;
- l = 0;
- r = _uccase_len[0] - 1;
-
- if (enc == mbfl_no_encoding_8859_9) {
- return php_turkish_tolower(code, l, r, field);
- }
+static inline unsigned php_unicode_tolower_simple(unsigned code, enum mbfl_no_encoding enc) {
+ code = php_unicode_tolower_raw(code, enc);
+ if (UNEXPECTED(code > 0xffffff)) {
+ return _uccase_extra_table[code & 0xffffff];
+ }
+ return code;
+}
+static inline unsigned php_unicode_toupper_simple(unsigned code, enum mbfl_no_encoding enc) {
+ code = php_unicode_toupper_raw(code, enc);
+ if (UNEXPECTED(code > 0xffffff)) {
+ return _uccase_extra_table[code & 0xffffff];
+ }
+ return code;
+}
+static inline unsigned php_unicode_totitle_simple(unsigned code, enum mbfl_no_encoding enc) {
+ code = php_unicode_totitle_raw(code, enc);
+ if (UNEXPECTED(code > 0xffffff)) {
+ return _uccase_extra_table[code & 0xffffff];
+ }
+ return code;
+}
+static inline unsigned php_unicode_tofold_simple(unsigned code, enum mbfl_no_encoding enc) {
+ code = php_unicode_tofold_raw(code, enc);
+ if (UNEXPECTED(code > 0xffffff)) {
+ return _uccase_extra_table[code & 0xffffff];
+ }
+ return code;
+}
- } else {
- /*
- * The character is title case.
- */
- field = 2;
- l = _uccase_len[0] + _uccase_len[1];
- r = _uccase_size - 1;
+static inline unsigned php_unicode_tolower_full(
+ unsigned code, enum mbfl_no_encoding enc, unsigned *out) {
+ code = php_unicode_tolower_raw(code, enc);
+ if (UNEXPECTED(code > 0xffffff)) {
+ unsigned len = code >> 24;
+ const unsigned *p = &_uccase_extra_table[code & 0xffffff];
+ memcpy(out, p + 1, len * sizeof(unsigned));
+ return len;
+ }
+ *out = code;
+ return 1;
+}
+static inline unsigned php_unicode_toupper_full(
+ unsigned code, enum mbfl_no_encoding enc, unsigned *out) {
+ code = php_unicode_toupper_raw(code, enc);
+ if (UNEXPECTED(code > 0xffffff)) {
+ unsigned len = code >> 24;
+ const unsigned *p = &_uccase_extra_table[code & 0xffffff];
+ memcpy(out, p + 1, len * sizeof(unsigned));
+ return len;
+ }
+ *out = code;
+ return 1;
+}
+static inline unsigned php_unicode_totitle_full(
+ unsigned code, enum mbfl_no_encoding enc, unsigned *out) {
+ code = php_unicode_totitle_raw(code, enc);
+ if (UNEXPECTED(code > 0xffffff)) {
+ unsigned len = code >> 24;
+ const unsigned *p = &_uccase_extra_table[code & 0xffffff];
+ memcpy(out, p + 1, len * sizeof(unsigned));
+ return len;
+ }
+ *out = code;
+ return 1;
+}
+static inline unsigned php_unicode_tofold_full(
+ unsigned code, enum mbfl_no_encoding enc, unsigned *out) {
+ code = php_unicode_tofold_raw(code, enc);
+ if (UNEXPECTED(code > 0xffffff)) {
+ unsigned len = code >> 24;
+ const unsigned *p = &_uccase_extra_table[code & 0xffffff];
+ memcpy(out, p + 1, len * sizeof(unsigned));
+ return len;
}
- return case_lookup(code, l, r, field);
+ *out = code;
+ return 1;
}
-MBSTRING_API unsigned long php_unicode_totitle(unsigned long code, enum mbfl_no_encoding enc)
+struct convert_case_data {
+ mbfl_convert_filter *next_filter;
+ enum mbfl_no_encoding no_encoding;
+ int case_mode;
+ int title_mode;
+};
+
+static int convert_case_filter(int c, void *void_data)
{
- int field;
- long l, r;
+ struct convert_case_data *data = (struct convert_case_data *) void_data;
+ unsigned out[3];
+ unsigned len, i;
+ switch (data->case_mode) {
+ case PHP_UNICODE_CASE_UPPER_SIMPLE:
+ out[0] = php_unicode_toupper_simple(c, data->no_encoding);
+ len = 1;
+ break;
- if (php_unicode_is_title(code))
- return code;
+ case PHP_UNICODE_CASE_UPPER:
+ len = php_unicode_toupper_full(c, data->no_encoding, out);
+ break;
- /*
- * The offset will always be the same for converting to title case.
- */
- field = 2;
+ case PHP_UNICODE_CASE_LOWER_SIMPLE:
+ out[0] = php_unicode_tolower_simple(c, data->no_encoding);
+ len = 1;
+ break;
- if (php_unicode_is_upper(code)) {
- /*
- * The character is upper case.
- */
- l = 0;
- r = _uccase_len[0] - 1;
- } else {
- /*
- * The character is lower case.
- */
- l = _uccase_len[0];
- r = (l + _uccase_len[1]) - 1;
- }
- return case_lookup(code, l, r, field);
+ case PHP_UNICODE_CASE_LOWER:
+ len = php_unicode_tolower_full(c, data->no_encoding, out);
+ break;
-}
+ case PHP_UNICODE_CASE_FOLD:
+ len = php_unicode_tofold_full(c, data->no_encoding, out);
+ break;
+ case PHP_UNICODE_CASE_FOLD_SIMPLE:
+ out[0] = php_unicode_tofold_simple(c, data->no_encoding);
+ len = 1;
+ break;
-#define BE_ARY_TO_UINT32(ptr) (\
- ((unsigned char*)(ptr))[0]<<24 |\
- ((unsigned char*)(ptr))[1]<<16 |\
- ((unsigned char*)(ptr))[2]<< 8 |\
- ((unsigned char*)(ptr))[3] )
+ case PHP_UNICODE_CASE_TITLE_SIMPLE:
+ case PHP_UNICODE_CASE_TITLE:
+ {
+ if (data->title_mode) {
+ if (data->case_mode == PHP_UNICODE_CASE_TITLE_SIMPLE) {
+ out[0] = php_unicode_tolower_simple(c, data->no_encoding);
+ len = 1;
+ } else {
+ len = php_unicode_tolower_full(c, data->no_encoding, out);
+ }
+ } else {
+ if (data->case_mode == PHP_UNICODE_CASE_TITLE_SIMPLE) {
+ out[0] = php_unicode_totitle_simple(c, data->no_encoding);
+ len = 1;
+ } else {
+ len = php_unicode_totitle_full(c, data->no_encoding, out);
+ }
+ }
+ if (!php_unicode_is_case_ignorable(c)) {
+ data->title_mode = php_unicode_is_cased(c);
+ }
+ break;
+ }
+ default:
+ assert(0);
+ break;
+ }
-#define UINT32_TO_BE_ARY(ptr,val) { \
- unsigned int v = val; \
- ((unsigned char*)(ptr))[0] = (v>>24) & 0xff,\
- ((unsigned char*)(ptr))[1] = (v>>16) & 0xff,\
- ((unsigned char*)(ptr))[2] = (v>> 8) & 0xff,\
- ((unsigned char*)(ptr))[3] = (v ) & 0xff;\
+ for (i = 0; i < len; i++) {
+ (*data->next_filter->filter_function)(out[i], data->next_filter);
+ }
+ return 0;
}
-MBSTRING_API char *php_unicode_convert_case(int case_mode, const char *srcstr, size_t srclen, size_t *ret_len,
- const char *src_encoding)
+MBSTRING_API char *php_unicode_convert_case(
+ int case_mode, const char *srcstr, size_t srclen, size_t *ret_len,
+ const mbfl_encoding *src_encoding)
{
- char *unicode, *newstr;
- size_t unicode_len;
- unsigned char *unicode_ptr;
- size_t i;
- enum mbfl_no_encoding _src_encoding = mbfl_name2no_encoding(src_encoding);
-
- if (_src_encoding == mbfl_no_encoding_invalid) {
- php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", src_encoding);
+ struct convert_case_data data;
+ mbfl_convert_filter *from_wchar, *to_wchar;
+ mbfl_string result, *result_ptr;
+
+ mbfl_memory_device device;
+ mbfl_memory_device_init(&device, srclen + 1, 0);
+
+ /* encoding -> wchar filter */
+ to_wchar = mbfl_convert_filter_new(src_encoding,
+ &mbfl_encoding_wchar, convert_case_filter, NULL, &data);
+ if (to_wchar == NULL) {
+ mbfl_memory_device_clear(&device);
return NULL;
}
- unicode = php_mb_convert_encoding(srcstr, srclen, "UCS-4BE", src_encoding, &unicode_len);
- if (unicode == NULL)
+ /* wchar -> encoding filter */
+ from_wchar = mbfl_convert_filter_new(
+ &mbfl_encoding_wchar, src_encoding,
+ mbfl_memory_device_output, NULL, &device);
+ if (from_wchar == NULL) {
+ mbfl_convert_filter_delete(to_wchar);
+ mbfl_memory_device_clear(&device);
return NULL;
+ }
- unicode_ptr = (unsigned char *)unicode;
-
- switch(case_mode) {
- case PHP_UNICODE_CASE_UPPER:
- for (i = 0; i < unicode_len; i+=4) {
- UINT32_TO_BE_ARY(&unicode_ptr[i],
- php_unicode_toupper(BE_ARY_TO_UINT32(&unicode_ptr[i]), _src_encoding));
- }
- break;
-
- case PHP_UNICODE_CASE_LOWER:
- for (i = 0; i < unicode_len; i+=4) {
- UINT32_TO_BE_ARY(&unicode_ptr[i],
- php_unicode_tolower(BE_ARY_TO_UINT32(&unicode_ptr[i]), _src_encoding));
+ data.next_filter = from_wchar;
+ data.no_encoding = src_encoding->no_encoding;
+ data.case_mode = case_mode;
+ data.title_mode = 0;
+
+ {
+ /* feed data */
+ const unsigned char *p = (const unsigned char *) srcstr;
+ size_t n = srclen;
+ while (n > 0) {
+ if ((*to_wchar->filter_function)(*p++, to_wchar) < 0) {
+ break;
}
- break;
+ n--;
+ }
+ }
- case PHP_UNICODE_CASE_TITLE: {
- int mode = 0;
-
- for (i = 0; i < unicode_len; i+=4) {
- int res = php_unicode_is_prop(
- BE_ARY_TO_UINT32(&unicode_ptr[i]),
- UC_MN|UC_ME|UC_CF|UC_LM|UC_SK|UC_LU|UC_LL|UC_LT|UC_PO|UC_OS, 0);
- if (mode) {
- if (res) {
- UINT32_TO_BE_ARY(&unicode_ptr[i],
- php_unicode_tolower(BE_ARY_TO_UINT32(&unicode_ptr[i]), _src_encoding));
- } else {
- mode = 0;
- }
- } else {
- if (res) {
- mode = 1;
- UINT32_TO_BE_ARY(&unicode_ptr[i],
- php_unicode_totitle(BE_ARY_TO_UINT32(&unicode_ptr[i]), _src_encoding));
- }
- }
- }
- } break;
+ mbfl_convert_filter_flush(to_wchar);
+ mbfl_convert_filter_flush(from_wchar);
+ result_ptr = mbfl_memory_device_result(&device, &result);
+ mbfl_convert_filter_delete(to_wchar);
+ mbfl_convert_filter_delete(from_wchar);
+ if (!result_ptr) {
+ return NULL;
}
- newstr = php_mb_convert_encoding(unicode, unicode_len, src_encoding, "UCS-4BE", ret_len);
- efree(unicode);
-
- return newstr;
+ *ret_len = result.len;
+ return (char *) result.val;
}
diff --git a/ext/mbstring/php_unicode.h b/ext/mbstring/php_unicode.h
index a1eb3c1e12..b287a70fe2 100644
--- a/ext/mbstring/php_unicode.h
+++ b/ext/mbstring/php_unicode.h
@@ -34,155 +34,149 @@
#define PHP_UNICODE_H
#if HAVE_MBSTRING
-/*
- * Values that can appear in the `mask1' parameter of the php_unicode_is_prop()
- * function.
- */
-#define UC_MN 0x00000001 /* Mark, Non-Spacing */
-#define UC_MC 0x00000002 /* Mark, Spacing Combining */
-#define UC_ME 0x00000004 /* Mark, Enclosing */
-#define UC_ND 0x00000008 /* Number, Decimal Digit */
-#define UC_NL 0x00000010 /* Number, Letter */
-#define UC_NO 0x00000020 /* Number, Other */
-#define UC_ZS 0x00000040 /* Separator, Space */
-#define UC_ZL 0x00000080 /* Separator, Line */
-#define UC_ZP 0x00000100 /* Separator, Paragraph */
-#define UC_CC 0x00000200 /* Other, Control */
-#define UC_CF 0x00000400 /* Other, Format */
-#define UC_OS 0x00000800 /* Other, Surrogate */
-#define UC_CO 0x00001000 /* Other, Private Use */
-#define UC_CN 0x00002000 /* Other, Not Assigned */
-#define UC_LU 0x00004000 /* Letter, Uppercase */
-#define UC_LL 0x00008000 /* Letter, Lowercase */
-#define UC_LT 0x00010000 /* Letter, Titlecase */
-#define UC_LM 0x00020000 /* Letter, Modifier */
-#define UC_LO 0x00040000 /* Letter, Other */
-#define UC_PC 0x00080000 /* Punctuation, Connector */
-#define UC_PD 0x00100000 /* Punctuation, Dash */
-#define UC_PS 0x00200000 /* Punctuation, Open */
-#define UC_PE 0x00400000 /* Punctuation, Close */
-#define UC_PO 0x00800000 /* Punctuation, Other */
-#define UC_SM 0x01000000 /* Symbol, Math */
-#define UC_SC 0x02000000 /* Symbol, Currency */
-#define UC_SK 0x04000000 /* Symbol, Modifier */
-#define UC_SO 0x08000000 /* Symbol, Other */
-#define UC_L 0x10000000 /* Left-To-Right */
-#define UC_R 0x20000000 /* Right-To-Left */
-#define UC_EN 0x40000000 /* European Number */
-#define UC_ES 0x80000000 /* European Number Separator */
-
-/*
- * Values that can appear in the `mask2' parameter of the php_unicode_is_prop()
- * function.
- */
-#define UC_ET 0x00000001 /* European Number Terminator */
-#define UC_AN 0x00000002 /* Arabic Number */
-#define UC_CS 0x00000004 /* Common Number Separator */
-#define UC_B 0x00000008 /* Block Separator */
-#define UC_S 0x00000010 /* Segment Separator */
-#define UC_WS 0x00000020 /* Whitespace */
-#define UC_ON 0x00000040 /* Other Neutrals */
-/*
- * Implementation specific character properties.
- */
-#define UC_CM 0x00000080 /* Composite */
-#define UC_NB 0x00000100 /* Non-Breaking */
-#define UC_SY 0x00000200 /* Symmetric */
-#define UC_HD 0x00000400 /* Hex Digit */
-#define UC_QM 0x00000800 /* Quote Mark */
-#define UC_MR 0x00001000 /* Mirroring */
-#define UC_SS 0x00002000 /* Space, other */
-#define UC_CP 0x00004000 /* Defined */
-
-/*
- * Added for UnicodeData-2.1.3.
- */
-#define UC_PI 0x00008000 /* Punctuation, Initial */
-#define UC_PF 0x00010000 /* Punctuation, Final */
-
-MBSTRING_API int php_unicode_is_prop(unsigned long code, unsigned long mask1,
- unsigned long mask2);
-MBSTRING_API char *php_unicode_convert_case(int case_mode, const char *srcstr, size_t srclen, size_t *retlen,
- const char *src_encoding);
-
-#define PHP_UNICODE_CASE_UPPER 0
-#define PHP_UNICODE_CASE_LOWER 1
-#define PHP_UNICODE_CASE_TITLE 2
-
-#define php_unicode_is_alpha(cc) php_unicode_is_prop(cc, UC_LU|UC_LL|UC_LM|UC_LO|UC_LT, 0)
-#define php_unicode_is_digit(cc) php_unicode_is_prop(cc, UC_ND, 0)
-#define php_unicode_is_alnum(cc) php_unicode_is_prop(cc, UC_LU|UC_LL|UC_LM|UC_LO|UC_LT|UC_ND, 0)
-#define php_unicode_is_cntrl(cc) php_unicode_is_prop(cc, UC_CC|UC_CF, 0)
-#define php_unicode_is_space(cc) php_unicode_is_prop(cc, UC_ZS|UC_SS, 0)
-#define php_unicode_is_blank(cc) php_unicode_is_prop(cc, UC_ZS, 0)
-#define php_unicode_is_punct(cc) php_unicode_is_prop(cc, UC_PD|UC_PS|UC_PE|UC_PO, UC_PI|UC_PF)
-#define php_unicode_is_graph(cc) php_unicode_is_prop(cc, UC_MN|UC_MC|UC_ME|UC_ND|UC_NL|UC_NO|\
- UC_LU|UC_LL|UC_LT|UC_LM|UC_LO|UC_PC|UC_PD|\
- UC_PS|UC_PE|UC_PO|UC_SM|UC_SM|UC_SC|UC_SK|\
- UC_SO, UC_PI|UC_PF)
-#define php_unicode_is_print(cc) php_unicode_is_prop(cc, UC_MN|UC_MC|UC_ME|UC_ND|UC_NL|UC_NO|\
- UC_LU|UC_LL|UC_LT|UC_LM|UC_LO|UC_PC|UC_PD|\
- UC_PS|UC_PE|UC_PO|UC_SM|UC_SM|UC_SC|UC_SK|\
- UC_SO|UC_ZS, UC_PI|UC_PF)
-#define php_unicode_is_upper(cc) php_unicode_is_prop(cc, UC_LU, 0)
-#define php_unicode_is_lower(cc) php_unicode_is_prop(cc, UC_LL, 0)
-#define php_unicode_is_title(cc) php_unicode_is_prop(cc, UC_LT, 0)
-#define php_unicode_is_xdigit(cc) php_unicode_is_prop(cc, 0, UC_HD)
-
-#define php_unicode_is_isocntrl(cc) php_unicode_is_prop(cc, UC_CC, 0)
-#define php_unicode_is_fmtcntrl(cc) php_unicode_is_prop(cc, UC_CF, 0)
-
-#define php_unicode_is_symbol(cc) php_unicode_is_prop(cc, UC_SM|UC_SC|UC_SO|UC_SK, 0)
-#define php_unicode_is_number(cc) php_unicode_is_prop(cc, UC_ND|UC_NO|UC_NL, 0)
-#define php_unicode_is_nonspacing(cc) php_unicode_is_prop(cc, UC_MN, 0)
-#define php_unicode_is_openpunct(cc) php_unicode_is_prop(cc, UC_PS, 0)
-#define php_unicode_is_closepunct(cc) php_unicode_is_prop(cc, UC_PE, 0)
-#define php_unicode_is_initialpunct(cc) php_unicode_is_prop(cc, 0, UC_PI)
-#define php_unicode_is_finalpunct(cc) php_unicode_is_prop(cc, 0, UC_PF)
-
-#define php_unicode_is_composite(cc) php_unicode_is_prop(cc, 0, UC_CM)
-#define php_unicode_is_hex(cc) php_unicode_is_prop(cc, 0, UC_HD)
-#define php_unicode_is_quote(cc) php_unicode_is_prop(cc, 0, UC_QM)
-#define php_unicode_is_symmetric(cc) php_unicode_is_prop(cc, 0, UC_SY)
-#define php_unicode_is_mirroring(cc) php_unicode_is_prop(cc, 0, UC_MR)
-#define php_unicode_is_nonbreaking(cc) php_unicode_is_prop(cc, 0, UC_NB)
+#define UC_MN 0 /* Mark, Non-Spacing */
+#define UC_MC 1 /* Mark, Spacing Combining */
+#define UC_ME 2 /* Mark, Enclosing */
+#define UC_ND 3 /* Number, Decimal Digit */
+#define UC_NL 4 /* Number, Letter */
+#define UC_NO 5 /* Number, Other */
+#define UC_ZS 6 /* Separator, Space */
+#define UC_ZL 7 /* Separator, Line */
+#define UC_ZP 8 /* Separator, Paragraph */
+#define UC_CC 9 /* Other, Control */
+#define UC_CF 10 /* Other, Format */
+#define UC_OS 11 /* Other, Surrogate */
+#define UC_CO 12 /* Other, Private Use */
+#define UC_CN 13 /* Other, Not Assigned */
+#define UC_LU 14 /* Letter, Uppercase */
+#define UC_LL 15 /* Letter, Lowercase */
+#define UC_LT 16 /* Letter, Titlecase */
+#define UC_LM 17 /* Letter, Modifier */
+#define UC_LO 18 /* Letter, Other */
+#define UC_PC 19 /* Punctuation, Connector */
+#define UC_PD 20 /* Punctuation, Dash */
+#define UC_PS 21 /* Punctuation, Open */
+#define UC_PE 22 /* Punctuation, Close */
+#define UC_PO 23 /* Punctuation, Other */
+#define UC_SM 24 /* Symbol, Math */
+#define UC_SC 25 /* Symbol, Currency */
+#define UC_SK 26 /* Symbol, Modifier */
+#define UC_SO 27 /* Symbol, Other */
+#define UC_L 28 /* Left-To-Right */
+#define UC_R 29 /* Right-To-Left */
+#define UC_EN 30 /* European Number */
+#define UC_ES 31 /* European Number Separator */
+#define UC_ET 32 /* European Number Terminator */
+#define UC_AN 33 /* Arabic Number */
+#define UC_CS 34 /* Common Number Separator */
+#define UC_B 35 /* Block Separator */
+#define UC_S 36 /* Segment Separator */
+#define UC_WS 37 /* Whitespace */
+#define UC_ON 38 /* Other Neutrals */
+#define UC_PI 39 /* Punctuation, Initial */
+#define UC_PF 40 /* Punctuation, Final */
+#define UC_AL 41 /* Arabic Letter */
+
+/* Derived properties from DerivedCoreProperties.txt */
+#define UC_CASED 42
+#define UC_CASE_IGNORABLE 43
+
+
+MBSTRING_API int php_unicode_is_prop(unsigned long code, ...);
+MBSTRING_API int php_unicode_is_prop1(unsigned long code, int prop);
+
+MBSTRING_API char *php_unicode_convert_case(
+ int case_mode, const char *srcstr, size_t srclen, size_t *retlen,
+ const mbfl_encoding *src_encoding);
+
+#define PHP_UNICODE_CASE_UPPER 0
+#define PHP_UNICODE_CASE_LOWER 1
+#define PHP_UNICODE_CASE_TITLE 2
+#define PHP_UNICODE_CASE_FOLD 3
+#define PHP_UNICODE_CASE_UPPER_SIMPLE 4
+#define PHP_UNICODE_CASE_LOWER_SIMPLE 5
+#define PHP_UNICODE_CASE_TITLE_SIMPLE 6
+#define PHP_UNICODE_CASE_FOLD_SIMPLE 7
+#define PHP_UNICODE_CASE_MODE_MAX 7
+
+/* Optimize the common ASCII case for lower/upper */
+
+static inline int php_unicode_is_lower(unsigned long code) {
+ if (code < 0x80) {
+ return code >= 0x61 && code <= 0x7A;
+ } else {
+ return php_unicode_is_prop1(code, UC_LL);
+ }
+}
+
+static inline int php_unicode_is_upper(unsigned long code) {
+ if (code < 0x80) {
+ return code >= 0x41 && code <= 0x5A;
+ } else {
+ return php_unicode_is_prop1(code, UC_LU);
+ }
+}
+
+#define php_unicode_is_alpha(cc) php_unicode_is_prop(cc, UC_LU, UC_LL, UC_LM, UC_LO, UC_LT, -1)
+#define php_unicode_is_digit(cc) php_unicode_is_prop1(cc, UC_ND)
+#define php_unicode_is_alnum(cc) php_unicode_is_prop(cc, UC_LU, UC_LL, UC_LM, UC_LO, UC_LT, UC_ND, -1)
+#define php_unicode_is_cntrl(cc) php_unicode_is_prop(cc, UC_CC, UC_CF, -1)
+#define php_unicode_is_blank(cc) php_unicode_is_prop1(cc, UC_ZS)
+#define php_unicode_is_punct(cc) php_unicode_is_prop(cc, UC_PD, UC_PS, UC_PE, UC_PO, UC_PI, UC_PF, -1)
+#define php_unicode_is_graph(cc) php_unicode_is_prop(cc, UC_MN, UC_MC, UC_ME, UC_ND, UC_NL, UC_NO, \
+ UC_LU, UC_LL, UC_LT, UC_LM, UC_LO, UC_PC, UC_PD, \
+ UC_PS, UC_PE, UC_PO, UC_SM, UC_SM, UC_SC, UC_SK, \
+ UC_SO, UC_PI, UC_PF, -1)
+#define php_unicode_is_print(cc) php_unicode_is_prop(cc, UC_MN, UC_MC, UC_ME, UC_ND, UC_NL, UC_NO, \
+ UC_LU, UC_LL, UC_LT, UC_LM, UC_LO, UC_PC, UC_PD, \
+ UC_PS, UC_PE, UC_PO, UC_SM, UC_SM, UC_SC, UC_SK, \
+ UC_SO, UC_ZS, UC_PI, UC_PF, -1)
+#define php_unicode_is_title(cc) php_unicode_is_prop1(cc, UC_LT)
+
+#define php_unicode_is_isocntrl(cc) php_unicode_is_prop1(cc, UC_CC)
+#define php_unicode_is_fmtcntrl(cc) php_unicode_is_prop1(cc, UC_CF)
+
+#define php_unicode_is_symbol(cc) php_unicode_is_prop(cc, UC_SM, UC_SC, UC_SO, UC_SK, -1)
+#define php_unicode_is_number(cc) php_unicode_is_prop(cc, UC_ND, UC_NO, UC_NL, -1)
+#define php_unicode_is_nonspacing(cc) php_unicode_is_prop1(cc, UC_MN)
+#define php_unicode_is_openpunct(cc) php_unicode_is_prop1(cc, UC_PS)
+#define php_unicode_is_closepunct(cc) php_unicode_is_prop1(cc, UC_PE)
+#define php_unicode_is_initialpunct(cc) php_unicode_is_prop1(cc, UC_PI)
+#define php_unicode_is_finalpunct(cc) php_unicode_is_prop1(cc, UC_PF)
/*
* Directionality macros.
*/
-#define php_unicode_is_rtl(cc) php_unicode_is_prop(cc, UC_R, 0)
-#define php_unicode_is_ltr(cc) php_unicode_is_prop(cc, UC_L, 0)
-#define php_unicode_is_strong(cc) php_unicode_is_prop(cc, UC_L|UC_R, 0)
-#define php_unicode_is_weak(cc) php_unicode_is_prop(cc, UC_EN|UC_ES, UC_ET|UC_AN|UC_CS)
-#define php_unicode_is_neutral(cc) php_unicode_is_prop(cc, 0, UC_B|UC_S|UC_WS|UC_ON)
-#define php_unicode_is_separator(cc) php_unicode_is_prop(cc, 0, UC_B|UC_S)
+#define php_unicode_is_rtl(cc) php_unicode_is_prop1(cc, UC_R)
+#define php_unicode_is_ltr(cc) php_unicode_is_prop1(cc, UC_L)
+#define php_unicode_is_strong(cc) php_unicode_is_prop(cc, UC_L, UC_R, -1)
+#define php_unicode_is_weak(cc) php_unicode_is_prop(cc, UC_EN, UC_ES, UC_ET, UC_AN, UC_CS, -1)
+#define php_unicode_is_neutral(cc) php_unicode_is_prop(cc, UC_B, UC_S, UC_WS, UC_ON, -1)
+#define php_unicode_is_separator(cc) php_unicode_is_prop(cc, UC_B, UC_S, -1)
/*
* Other macros inspired by John Cowan.
*/
-#define php_unicode_is_mark(cc) php_unicode_is_prop(cc, UC_MN|UC_MC|UC_ME, 0)
-#define php_unicode_is_modif(cc) php_unicode_is_prop(cc, UC_LM, 0)
-#define php_unicode_is_letnum(cc) php_unicode_is_prop(cc, UC_NL, 0)
-#define php_unicode_is_connect(cc) php_unicode_is_prop(cc, UC_PC, 0)
-#define php_unicode_is_dash(cc) php_unicode_is_prop(cc, UC_PD, 0)
-#define php_unicode_is_math(cc) php_unicode_is_prop(cc, UC_SM, 0)
-#define php_unicode_is_currency(cc) php_unicode_is_prop(cc, UC_SC, 0)
-#define php_unicode_is_modifsymbol(cc) php_unicode_is_prop(cc, UC_SK, 0)
-#define php_unicode_is_nsmark(cc) php_unicode_is_prop(cc, UC_MN, 0)
-#define php_unicode_is_spmark(cc) php_unicode_is_prop(cc, UC_MC, 0)
-#define php_unicode_is_enclosing(cc) php_unicode_is_prop(cc, UC_ME, 0)
-#define php_unicode_is_private(cc) php_unicode_is_prop(cc, UC_CO, 0)
-#define php_unicode_is_surrogate(cc) php_unicode_is_prop(cc, UC_OS, 0)
-#define php_unicode_is_lsep(cc) php_unicode_is_prop(cc, UC_ZL, 0)
-#define php_unicode_is_psep(cc) php_unicode_is_prop(cc, UC_ZP, 0)
-
-#define php_unicode_is_identstart(cc) php_unicode_is_prop(cc, UC_LU|UC_LL|UC_LT|UC_LO|UC_NL, 0)
-#define php_unicode_is_identpart(cc) php_unicode_is_prop(cc, UC_LU|UC_LL|UC_LT|UC_LO|UC_NL|\
- UC_MN|UC_MC|UC_ND|UC_PC|UC_CF, 0)
-
-#define php_unicode_is_defined(cc) php_unicode_is_prop(cc, 0, UC_CP)
-#define php_unicode_is_undefined(cc) !php_unicode_is_prop(cc, 0, UC_CP)
+#define php_unicode_is_mark(cc) php_unicode_is_prop(cc, UC_MN, UC_MC, UC_ME, -1)
+#define php_unicode_is_modif(cc) php_unicode_is_prop1(cc, UC_LM)
+#define php_unicode_is_letnum(cc) php_unicode_is_prop1(cc, UC_NL)
+#define php_unicode_is_connect(cc) php_unicode_is_prop1(cc, UC_PC)
+#define php_unicode_is_dash(cc) php_unicode_is_prop1(cc, UC_PD)
+#define php_unicode_is_math(cc) php_unicode_is_prop1(cc, UC_SM)
+#define php_unicode_is_currency(cc) php_unicode_is_prop1(cc, UC_SC)
+#define php_unicode_is_modifsymbol(cc) php_unicode_is_prop1(cc, UC_SK)
+#define php_unicode_is_nsmark(cc) php_unicode_is_prop1(cc, UC_MN)
+#define php_unicode_is_spmark(cc) php_unicode_is_prop1(cc, UC_MC)
+#define php_unicode_is_enclosing(cc) php_unicode_is_prop1(cc, UC_ME)
+#define php_unicode_is_private(cc) php_unicode_is_prop1(cc, UC_CO)
+#define php_unicode_is_surrogate(cc) php_unicode_is_prop1(cc, UC_OS)
+#define php_unicode_is_lsep(cc) php_unicode_is_prop1(cc, UC_ZL)
+#define php_unicode_is_psep(cc) php_unicode_is_prop1(cc, UC_ZP)
+
+#define php_unicode_is_identstart(cc) php_unicode_is_prop(cc, UC_LU, UC_LL, UC_LT, UC_LO, UC_NL, -1)
+#define php_unicode_is_identpart(cc) php_unicode_is_prop(cc, UC_LU, UC_LL, UC_LT, UC_LO, UC_NL, \
+ UC_MN, UC_MC, UC_ND, UC_PC, UC_CF, -1)
/*
* Other miscellaneous character property macros.
@@ -191,6 +185,13 @@ MBSTRING_API char *php_unicode_convert_case(int case_mode, const char *srcstr, s
((cc) >= 0xf900 && (cc) <= 0xfaff))
#define php_unicode_is_hangul(cc) ((cc) >= 0xac00 && (cc) <= 0xd7ff)
+/*
+ * Derived core properties.
+ */
+
+#define php_unicode_is_cased(cc) php_unicode_is_prop1(cc, UC_CASED)
+#define php_unicode_is_case_ignorable(cc) php_unicode_is_prop1(cc, UC_CASE_IGNORABLE)
+
#endif
diff --git a/ext/mbstring/tests/bug65544.phpt b/ext/mbstring/tests/bug65544.phpt
new file mode 100644
index 0000000000..904b6d6611
--- /dev/null
+++ b/ext/mbstring/tests/bug65544.phpt
@@ -0,0 +1,8 @@
+--TEST--
+Bug #65544: mb title case conversion-first word in quotation isn't capitalized
+--FILE--
+<?php
+var_dump(mb_convert_case("\"or else it doesn't, you know. the name of the song is called 'haddocks' eyes.'\"", MB_CASE_TITLE));
+?>
+--EXPECT--
+string(80) ""Or Else It Doesn't, You Know. The Name Of The Song Is Called 'Haddocks' Eyes.'""
diff --git a/ext/mbstring/tests/bug66964.phpt b/ext/mbstring/tests/bug66964.phpt
index e982aa2e01..c33bb67c49 100644
--- a/ext/mbstring/tests/bug66964.phpt
+++ b/ext/mbstring/tests/bug66964.phpt
@@ -49,5 +49,16 @@ array(5) {
[3]=>
string(21) "日本語テキスト"
[4]=>
- *RECURSION*
-} \ No newline at end of file
+ &array(5) {
+ [0]=>
+ string(21) "日本語テキスト"
+ [1]=>
+ string(21) "日本語テキスト"
+ [2]=>
+ string(21) "日本語テキスト"
+ [3]=>
+ string(21) "日本語テキスト"
+ [4]=>
+ *RECURSION*
+ }
+}
diff --git a/ext/mbstring/tests/bug69267.phpt b/ext/mbstring/tests/bug69267.phpt
index 958f1c548b..d8ca541e11 100644
--- a/ext/mbstring/tests/bug69267.phpt
+++ b/ext/mbstring/tests/bug69267.phpt
@@ -38,7 +38,7 @@ string(8) "Džljnjdz"
string(8) "Džljnjdz"
string(3) "á¾³"
string(3) "á¾³"
-string(3) "á¾¼"
-string(3) "á¾¼"
+string(4) "ΑΙ"
+string(4) "ΑΙ"
string(3) "á¾¼"
string(3) "á¾¼"
diff --git a/ext/mbstring/tests/bug71298.phpt b/ext/mbstring/tests/bug71298.phpt
new file mode 100644
index 0000000000..f69ba29cbb
--- /dev/null
+++ b/ext/mbstring/tests/bug71298.phpt
@@ -0,0 +1,8 @@
+--TEST--
+Bug #71298: MB_CASE_TITLE misbehaves with curled apostrophe/quote (HTML &rsquo;)
+--FILE--
+<?php
+echo mb_convert_case("People's issues versus people’s issues", MB_CASE_TITLE);
+?>
+--EXPECT--
+People's Issues Versus People’s Issues
diff --git a/ext/mbstring/tests/casefolding.phpt b/ext/mbstring/tests/casefolding.phpt
new file mode 100644
index 0000000000..34f7984b07
--- /dev/null
+++ b/ext/mbstring/tests/casefolding.phpt
@@ -0,0 +1,38 @@
+--TEST--
+Case-insensitive string comparisons use case folding
+--FILE--
+<?php
+
+$tests = [
+ ["K", "K"],
+ ["k", "K"],
+ ["Ã…", "â„«"],
+ ["Ã¥", "â„«"],
+ ["ß", "ẞ"],
+ ["Θ", "ϴ"],
+ ["θ", "ϴ"],
+ ["Ï‘", "Ï´"],
+ ["Ω", "Ω"],
+ ["ω", "Ω"],
+ ["I", "ı"],
+ ["i", "ı"],
+];
+
+foreach ($tests as list($a, $b)) {
+ var_dump(mb_stripos($a, $b));
+}
+
+?>
+--EXPECT--
+int(0)
+int(0)
+int(0)
+int(0)
+int(0)
+int(0)
+int(0)
+int(0)
+int(0)
+int(0)
+bool(false)
+bool(false)
diff --git a/ext/mbstring/tests/casemapping.phpt b/ext/mbstring/tests/casemapping.phpt
new file mode 100644
index 0000000000..1f0e9fb1d5
--- /dev/null
+++ b/ext/mbstring/tests/casemapping.phpt
@@ -0,0 +1,109 @@
+--TEST--
+Unicode case mapping
+--FILE--
+<?php
+
+function toCases($str) {
+ echo "String: $str\n";
+ echo "Lower: ", mb_convert_case($str, MB_CASE_LOWER), "\n";
+ echo "Lower Simple: ", mb_convert_case($str, MB_CASE_LOWER_SIMPLE), "\n";
+ echo "Upper: ", mb_convert_case($str, MB_CASE_UPPER), "\n";
+ echo "Upper Simple: ", mb_convert_case($str, MB_CASE_UPPER_SIMPLE), "\n";
+ echo "Title: ", mb_convert_case($str, MB_CASE_TITLE), "\n";
+ echo "Title Simple: ", mb_convert_case($str, MB_CASE_TITLE_SIMPLE), "\n";
+ echo "Fold: ", mb_convert_case($str, MB_CASE_FOLD), "\n";
+ echo "Fold Simple: ", mb_convert_case($str, MB_CASE_FOLD_SIMPLE), "\n";
+ echo "\n";
+}
+
+toCases("ß");
+toCases("ff");
+toCases("İ");
+
+// Make sure that case-conversion in Turkish still works correctly.
+// Using the language-agnostic Unicode case mappins would result in
+// characters that are illegal under ISO-8859-9.
+mb_internal_encoding('ISO-8859-9');
+
+// Capital I with dot (U+0130)
+$str = "\xdd";
+echo bin2hex(mb_convert_case($str, MB_CASE_LOWER)), "\n";
+echo bin2hex(mb_convert_case($str, MB_CASE_LOWER_SIMPLE)), "\n";
+echo bin2hex(mb_convert_case($str, MB_CASE_FOLD)), "\n";
+echo bin2hex(mb_convert_case($str, MB_CASE_FOLD_SIMPLE)), "\n";
+echo "\n";
+
+// Lower i without dot (U+0131)
+$str = "\xfd";
+echo bin2hex(mb_convert_case($str, MB_CASE_UPPER)), "\n";
+echo bin2hex(mb_convert_case($str, MB_CASE_UPPER_SIMPLE)), "\n";
+echo bin2hex(mb_convert_case($str, MB_CASE_FOLD)), "\n";
+echo bin2hex(mb_convert_case($str, MB_CASE_FOLD_SIMPLE)), "\n";
+echo "\n";
+
+// Capital I without dot (U+0049)
+$str = "\x49";
+echo bin2hex(mb_convert_case($str, MB_CASE_LOWER)), "\n";
+echo bin2hex(mb_convert_case($str, MB_CASE_LOWER_SIMPLE)), "\n";
+echo bin2hex(mb_convert_case($str, MB_CASE_FOLD)), "\n";
+echo bin2hex(mb_convert_case($str, MB_CASE_FOLD_SIMPLE)), "\n";
+echo "\n";
+
+// Lower i with dot (U+0069)
+$str = "\x69";
+echo bin2hex(mb_convert_case($str, MB_CASE_UPPER)), "\n";
+echo bin2hex(mb_convert_case($str, MB_CASE_UPPER_SIMPLE)), "\n";
+echo bin2hex(mb_convert_case($str, MB_CASE_FOLD)), "\n";
+echo bin2hex(mb_convert_case($str, MB_CASE_FOLD_SIMPLE)), "\n";
+
+?>
+--EXPECT--
+String: ß
+Lower: ß
+Lower Simple: ß
+Upper: SS
+Upper Simple: ß
+Title: Ss
+Title Simple: ß
+Fold: ss
+Fold Simple: ß
+
+String: ff
+Lower: ff
+Lower Simple: ff
+Upper: FF
+Upper Simple: ff
+Title: Ff
+Title Simple: ff
+Fold: ff
+Fold Simple: ff
+
+String: İ
+Lower: i̇
+Lower Simple: i
+Upper: İ
+Upper Simple: İ
+Title: İ
+Title Simple: İ
+Fold: i̇
+Fold Simple: İ
+
+69
+69
+69
+69
+
+49
+49
+fd
+fd
+
+fd
+fd
+fd
+fd
+
+dd
+dd
+69
+69
diff --git a/ext/mbstring/tests/mb_convert_case_invalid_mode.phpt b/ext/mbstring/tests/mb_convert_case_invalid_mode.phpt
new file mode 100644
index 0000000000..af59cd2106
--- /dev/null
+++ b/ext/mbstring/tests/mb_convert_case_invalid_mode.phpt
@@ -0,0 +1,11 @@
+--TEST--
+Calling mb_convert_case() with an invalid casing mode
+--FILE--
+<?php
+
+var_dump(mb_convert_case("foobar", 100));
+
+?>
+--EXPECTF--
+Warning: mb_convert_case(): Invalid case mode in %s on line %d
+bool(false)
diff --git a/ext/mbstring/tests/mb_strtolower_variation2.phpt b/ext/mbstring/tests/mb_strtolower_variation2.phpt
index 43d0f53728..ef69eb00af 100644
--- a/ext/mbstring/tests/mb_strtolower_variation2.phpt
+++ b/ext/mbstring/tests/mb_strtolower_variation2.phpt
@@ -157,14 +157,10 @@ Warning: mb_strtolower(): Unknown encoding "0.5" in %s on line %d
bool(false)
-- Iteration 10 --
-
-Warning: mb_strtolower(): Unknown encoding "(null)" in %s on line %d
-bool(false)
+string(24) "68656c6c6f2c20776f726c64"
-- Iteration 11 --
-
-Warning: mb_strtolower(): Unknown encoding "(null)" in %s on line %d
-bool(false)
+string(24) "68656c6c6f2c20776f726c64"
-- Iteration 12 --
@@ -209,17 +205,13 @@ string(24) "68656c6c6f2c20776f726c64"
string(24) "68656c6c6f2c20776f726c64"
-- Iteration 22 --
-
-Warning: mb_strtolower(): Unknown encoding "(null)" in %s on line %d
-bool(false)
+string(24) "68656c6c6f2c20776f726c64"
-- Iteration 23 --
-
-Warning: mb_strtolower(): Unknown encoding "(null)" in %s on line %d
-bool(false)
+string(24) "68656c6c6f2c20776f726c64"
-- Iteration 24 --
Warning: mb_strtolower() expects parameter 2 to be string, resource given in %s on line %d
NULL
-Done \ No newline at end of file
+Done
diff --git a/ext/mbstring/tests/mb_strtoupper_variation2.phpt b/ext/mbstring/tests/mb_strtoupper_variation2.phpt
index 52beb3d741..25b9a53e91 100644
--- a/ext/mbstring/tests/mb_strtoupper_variation2.phpt
+++ b/ext/mbstring/tests/mb_strtoupper_variation2.phpt
@@ -158,14 +158,10 @@ Warning: mb_strtoupper(): Unknown encoding "0.5" in %s on line %d
bool(false)
-- Iteration 10 --
-
-Warning: mb_strtoupper(): Unknown encoding "(null)" in %s on line %d
-bool(false)
+string(24) "48454c4c4f2c20574f524c44"
-- Iteration 11 --
-
-Warning: mb_strtoupper(): Unknown encoding "(null)" in %s on line %d
-bool(false)
+string(24) "48454c4c4f2c20574f524c44"
-- Iteration 12 --
@@ -210,17 +206,13 @@ string(24) "48454c4c4f2c20574f524c44"
string(24) "48454c4c4f2c20574f524c44"
-- Iteration 22 --
-
-Warning: mb_strtoupper(): Unknown encoding "(null)" in %s on line %d
-bool(false)
+string(24) "48454c4c4f2c20574f524c44"
-- Iteration 23 --
-
-Warning: mb_strtoupper(): Unknown encoding "(null)" in %s on line %d
-bool(false)
+string(24) "48454c4c4f2c20574f524c44"
-- Iteration 24 --
Warning: mb_strtoupper() expects parameter 2 to be string, resource given in %s on line %d
NULL
-Done \ No newline at end of file
+Done
diff --git a/ext/mbstring/ucgendat/README b/ext/mbstring/ucgendat/README
index 7717bf89f9..b5af1b8319 100644
--- a/ext/mbstring/ucgendat/README
+++ b/ext/mbstring/ucgendat/README
@@ -3,7 +3,7 @@ This file is not necessary to build PHP.
It's only necessary to rebuild unicode_data.h from Unicode ucd files.
Example usage:
-./ucgendat UnicodeData-6.0.0d7.txt -x CompositionExclusions-6.0.0d2.txt
+php ucgendat.php UnicodeData.txt
diff --git a/ext/mbstring/ucgendat/ucgendat.c b/ext/mbstring/ucgendat/ucgendat.c
deleted file mode 100644
index c0d9b432ba..0000000000
--- a/ext/mbstring/ucgendat/ucgendat.c
+++ /dev/null
@@ -1,1999 +0,0 @@
-/* Further modified for PHP */
-/* $Id$ */
-
-/* $OpenLDAP: pkg/ldap/libraries/liblunicode/ucdata/ucgendat.c,v 1.36.2.4 2007/01/02 21:43:51 kurt Exp $ */
-/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 1998-2007 The OpenLDAP Foundation.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted only as authorized by the OpenLDAP
- * Public License.
- *
- * A copy of this license is available at
- * <http://www.OpenLDAP.org/license.html>.
- */
-
-/* Copyright 2001 Computing Research Labs, New Mexico State University
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
- * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
- * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-/* orig Id: ucgendat.c,v 1.4 2001/01/02 18:46:20 mleisher Exp $" */
-
-#include <stdio.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#define ac_uint2 unsigned short
-#define ac_uint4 unsigned int
-#define LDAP_DIRSEP "/"
-#define AC_MEMCPY memcpy
-
-#ifndef HARDCODE_DATA
-#define HARDCODE_DATA 1
-#endif
-
-#undef ishdigit
-#define ishdigit(cc) (((cc) >= '0' && (cc) <= '9') ||\
- ((cc) >= 'A' && (cc) <= 'F') ||\
- ((cc) >= 'a' && (cc) <= 'f'))
-
-/*
- * A header written to the output file with the byte-order-mark and the number
- * of property nodes.
- */
-static ac_uint2 hdr[2] = {0xfeff, 0};
-
-#define NUMPROPS 50
-#define NEEDPROPS (NUMPROPS + (4 - (NUMPROPS & 3)))
-
-typedef struct {
- char *name;
- int len;
-} _prop_t;
-
-/*
- * List of properties expected to be found in the Unicode Character Database
- * including some implementation specific properties.
- *
- * The implementation specific properties are:
- * Cm = Composed (can be decomposed)
- * Nb = Non-breaking
- * Sy = Symmetric (has left and right forms)
- * Hd = Hex digit
- * Qm = Quote marks
- * Mr = Mirroring
- * Ss = Space, other
- * Cp = Defined character
- */
-static _prop_t props[NUMPROPS] = {
- {"Mn", 2}, {"Mc", 2}, {"Me", 2}, {"Nd", 2}, {"Nl", 2}, {"No", 2},
- {"Zs", 2}, {"Zl", 2}, {"Zp", 2}, {"Cc", 2}, {"Cf", 2}, {"Cs", 2},
- {"Co", 2}, {"Cn", 2}, {"Lu", 2}, {"Ll", 2}, {"Lt", 2}, {"Lm", 2},
- {"Lo", 2}, {"Pc", 2}, {"Pd", 2}, {"Ps", 2}, {"Pe", 2}, {"Po", 2},
- {"Sm", 2}, {"Sc", 2}, {"Sk", 2}, {"So", 2}, {"L", 1}, {"R", 1},
- {"EN", 2}, {"ES", 2}, {"ET", 2}, {"AN", 2}, {"CS", 2}, {"B", 1},
- {"S", 1}, {"WS", 2}, {"ON", 2},
- {"Cm", 2}, {"Nb", 2}, {"Sy", 2}, {"Hd", 2}, {"Qm", 2}, {"Mr", 2},
- {"Ss", 2}, {"Cp", 2}, {"Pi", 2}, {"Pf", 2}, {"AL", 2}
-};
-
-typedef struct {
- ac_uint4 *ranges;
- ac_uint2 used;
- ac_uint2 size;
-} _ranges_t;
-
-static _ranges_t proptbl[NUMPROPS];
-
-/*
- * Make sure this array is sized to be on a 4-byte boundary at compile time.
- */
-static ac_uint2 propcnt[NEEDPROPS];
-
-/*
- * Array used to collect a decomposition before adding it to the decomposition
- * table.
- */
-static ac_uint4 dectmp[64];
-static ac_uint4 dectmp_size;
-
-typedef struct {
- ac_uint4 code;
- ac_uint2 size;
- ac_uint2 used;
- ac_uint4 *decomp;
-} _decomp_t;
-
-/*
- * List of decomposition. Created and expanded in order as the characters are
- * encountered. First list contains canonical mappings, second also includes
- * compatibility mappings.
- */
-static _decomp_t *decomps;
-static ac_uint4 decomps_used;
-static ac_uint4 decomps_size;
-
-static _decomp_t *kdecomps;
-static ac_uint4 kdecomps_used;
-static ac_uint4 kdecomps_size;
-
-/*
- * Composition exclusion table stuff.
- */
-#define COMPEX_SET(c) (compexs[(c) >> 5] |= (1 << ((c) & 31)))
-#define COMPEX_TEST(c) (compexs[(c) >> 5] & (1 << ((c) & 31)))
-static ac_uint4 compexs[8192];
-
-/*
- * Struct for holding a composition pair, and array of composition pairs
- */
-typedef struct {
- ac_uint4 comp;
- ac_uint4 count;
- ac_uint4 code1;
- ac_uint4 code2;
-} _comp_t;
-
-#if 0
-static _comp_t *comps;
-#endif
-static ac_uint4 comps_used;
-
-/*
- * Types and lists for handling lists of case mappings.
- */
-typedef struct {
- ac_uint4 key;
- ac_uint4 other1;
- ac_uint4 other2;
-} _case_t;
-
-static _case_t *upper;
-static _case_t *lower;
-static _case_t *title;
-static ac_uint4 upper_used;
-static ac_uint4 upper_size;
-static ac_uint4 lower_used;
-static ac_uint4 lower_size;
-static ac_uint4 title_used;
-static ac_uint4 title_size;
-
-/*
- * Array used to collect case mappings before adding them to a list.
- */
-static ac_uint4 cases[3];
-
-/*
- * An array to hold ranges for combining classes.
- */
-static ac_uint4 *ccl;
-static ac_uint4 ccl_used;
-static ac_uint4 ccl_size;
-
-/*
- * Structures for handling numbers.
- */
-typedef struct {
- ac_uint4 code;
- ac_uint4 idx;
-} _codeidx_t;
-
-typedef struct {
- short numerator;
- short denominator;
-} _num_t;
-
-/*
- * Arrays to hold the mapping of codes to numbers.
- */
-static _codeidx_t *ncodes;
-static ac_uint4 ncodes_used;
-static ac_uint4 ncodes_size;
-
-static _num_t *nums;
-static ac_uint4 nums_used;
-static ac_uint4 nums_size;
-
-/*
- * Array for holding numbers.
- */
-static _num_t *nums;
-static ac_uint4 nums_used;
-static ac_uint4 nums_size;
-
-static void
-add_range(ac_uint4 start, ac_uint4 end, char *p1, char *p2)
-{
- int i, j, k, len;
- _ranges_t *rlp;
- char *name;
-
- for (k = 0; k < 2; k++) {
- if (k == 0) {
- name = p1;
- len = 2;
- } else {
- if (p2 == 0)
- break;
-
- name = p2;
- len = 1;
- }
-
- for (i = 0; i < NUMPROPS; i++) {
- if (props[i].len == len && memcmp(props[i].name, name, len) == 0)
- break;
- }
-
- if (i == NUMPROPS)
- continue;
-
- rlp = &proptbl[i];
-
- /*
- * Resize the range list if necessary.
- */
- if (rlp->used == rlp->size) {
- if (rlp->size == 0)
- rlp->ranges = (ac_uint4 *)
- malloc(sizeof(ac_uint4) << 3);
- else
- rlp->ranges = (ac_uint4 *)
- realloc((char *) rlp->ranges,
- sizeof(ac_uint4) * (rlp->size + 8));
- rlp->size += 8;
- }
-
- /*
- * If this is the first code for this property list, just add it
- * and return.
- */
- if (rlp->used == 0) {
- rlp->ranges[0] = start;
- rlp->ranges[1] = end;
- rlp->used += 2;
- continue;
- }
-
- /*
- * Optimize the case of adding the range to the end.
- */
- j = rlp->used - 1;
- if (start > rlp->ranges[j]) {
- j = rlp->used;
- rlp->ranges[j++] = start;
- rlp->ranges[j++] = end;
- rlp->used = j;
- continue;
- }
-
- /*
- * Need to locate the insertion point.
- */
- for (i = 0;
- i < rlp->used && start > rlp->ranges[i + 1] + 1; i += 2) ;
-
- /*
- * If the start value lies in the current range, then simply set the
- * new end point of the range to the end value passed as a parameter.
- */
- if (rlp->ranges[i] <= start && start <= rlp->ranges[i + 1] + 1) {
- rlp->ranges[i + 1] = end;
- return;
- }
-
- /*
- * Shift following values up by two.
- */
- for (j = rlp->used; j > i; j -= 2) {
- rlp->ranges[j] = rlp->ranges[j - 2];
- rlp->ranges[j + 1] = rlp->ranges[j - 1];
- }
-
- /*
- * Add the new range at the insertion point.
- */
- rlp->ranges[i] = start;
- rlp->ranges[i + 1] = end;
- rlp->used += 2;
- }
-}
-
-static void
-ordered_range_insert(ac_uint4 c, char *name, int len)
-{
- int i, j;
- ac_uint4 s, e;
- _ranges_t *rlp;
-
- if (len == 0)
- return;
-
- /*
- * Deal with directionality codes introduced in Unicode 3.0.
- */
- if ((len == 2 && memcmp(name, "BN", 2) == 0) ||
- (len == 3 &&
- (memcmp(name, "NSM", 3) == 0 || memcmp(name, "PDF", 3) == 0 ||
- memcmp(name, "LRE", 3) == 0 || memcmp(name, "LRO", 3) == 0 ||
- memcmp(name, "RLE", 3) == 0 || memcmp(name, "RLO", 3) == 0 ||
- memcmp(name, "LRI", 3) == 0 || memcmp(name, "RLI", 3) == 0 ||
- memcmp(name, "FSI", 3) == 0 || memcmp(name, "PDI", 3) == 0))) {
- /*
- * Mark all of these as Other Neutral to preserve compatibility with
- * older versions.
- */
- len = 2;
- name = "ON";
- }
-
- for (i = 0; i < NUMPROPS; i++) {
- if (props[i].len == len && memcmp(props[i].name, name, len) == 0)
- break;
- }
-
- if (i == NUMPROPS) {
- printf("Unknown property %s\n", name);
- return;
- }
-
- /*
- * Have a match, so insert the code in order.
- */
- rlp = &proptbl[i];
-
- /*
- * Resize the range list if necessary.
- */
- if (rlp->used == rlp->size) {
- if (rlp->size == 0)
- rlp->ranges = (ac_uint4 *)
- malloc(sizeof(ac_uint4) << 3);
- else
- rlp->ranges = (ac_uint4 *)
- realloc((char *) rlp->ranges,
- sizeof(ac_uint4) * (rlp->size + 8));
- rlp->size += 8;
- }
-
- /*
- * If this is the first code for this property list, just add it
- * and return.
- */
- if (rlp->used == 0) {
- rlp->ranges[0] = rlp->ranges[1] = c;
- rlp->used += 2;
- return;
- }
-
- /*
- * Optimize the cases of extending the last range and adding new ranges to
- * the end.
- */
- j = rlp->used - 1;
- e = rlp->ranges[j];
- s = rlp->ranges[j - 1];
-
- if (c == e + 1) {
- /*
- * Extend the last range.
- */
- rlp->ranges[j] = c;
- return;
- }
-
- if (c > e + 1) {
- /*
- * Start another range on the end.
- */
- j = rlp->used;
- rlp->ranges[j] = rlp->ranges[j + 1] = c;
- rlp->used += 2;
- return;
- }
-
- if (c >= s)
- /*
- * The code is a duplicate of a code in the last range, so just return.
- */
- return;
-
- /*
- * The code should be inserted somewhere before the last range in the
- * list. Locate the insertion point.
- */
- for (i = 0;
- i < rlp->used && c > rlp->ranges[i + 1] + 1; i += 2) ;
-
- s = rlp->ranges[i];
- e = rlp->ranges[i + 1];
-
- if (c == e + 1)
- /*
- * Simply extend the current range.
- */
- rlp->ranges[i + 1] = c;
- else if (c < s) {
- /*
- * Add a new entry before the current location. Shift all entries
- * before the current one up by one to make room.
- */
- for (j = rlp->used; j > i; j -= 2) {
- rlp->ranges[j] = rlp->ranges[j - 2];
- rlp->ranges[j + 1] = rlp->ranges[j - 1];
- }
- rlp->ranges[i] = rlp->ranges[i + 1] = c;
-
- rlp->used += 2;
- }
-}
-
-static void
-add_decomp(ac_uint4 code, short compat)
-{
- ac_uint4 i, j, size;
- _decomp_t **pdecomps;
- ac_uint4 *pdecomps_used;
- ac_uint4 *pdecomps_size;
-
- if (compat) {
- pdecomps = &kdecomps;
- pdecomps_used = &kdecomps_used;
- pdecomps_size = &kdecomps_size;
- } else {
- pdecomps = &decomps;
- pdecomps_used = &decomps_used;
- pdecomps_size = &decomps_size;
- }
-
- /*
- * Add the code to the composite property.
- */
- if (!compat) {
- ordered_range_insert(code, "Cm", 2);
- }
-
- /*
- * Locate the insertion point for the code.
- */
- for (i = 0; i < *pdecomps_used && code > (*pdecomps)[i].code; i++) ;
-
- /*
- * Allocate space for a new decomposition.
- */
- if (*pdecomps_used == *pdecomps_size) {
- if (*pdecomps_size == 0)
- *pdecomps = (_decomp_t *) malloc(sizeof(_decomp_t) << 3);
- else
- *pdecomps = (_decomp_t *)
- realloc((char *) *pdecomps,
- sizeof(_decomp_t) * (*pdecomps_size + 8));
- (void) memset((char *) (*pdecomps + *pdecomps_size), '\0',
- sizeof(_decomp_t) << 3);
- *pdecomps_size += 8;
- }
-
- if (i < *pdecomps_used && code != (*pdecomps)[i].code) {
- /*
- * Shift the decomps up by one if the codes don't match.
- */
- for (j = *pdecomps_used; j > i; j--)
- (void) AC_MEMCPY((char *) &(*pdecomps)[j], (char *) &(*pdecomps)[j - 1],
- sizeof(_decomp_t));
- }
-
- /*
- * Insert or replace a decomposition.
- */
- size = dectmp_size + (4 - (dectmp_size & 3));
- if ((*pdecomps)[i].size < size) {
- if ((*pdecomps)[i].size == 0)
- (*pdecomps)[i].decomp = (ac_uint4 *)
- malloc(sizeof(ac_uint4) * size);
- else
- (*pdecomps)[i].decomp = (ac_uint4 *)
- realloc((char *) (*pdecomps)[i].decomp,
- sizeof(ac_uint4) * size);
- (*pdecomps)[i].size = size;
- }
-
- if ((*pdecomps)[i].code != code)
- (*pdecomps_used)++;
-
- (*pdecomps)[i].code = code;
- (*pdecomps)[i].used = dectmp_size;
- (void) AC_MEMCPY((char *) (*pdecomps)[i].decomp, (char *) dectmp,
- sizeof(ac_uint4) * dectmp_size);
-
- /*
- * NOTICE: This needs changing later so it is more general than simply
- * pairs. This calculation is done here to simplify allocation elsewhere.
- */
- if (!compat && dectmp_size == 2)
- comps_used++;
-}
-
-static void
-add_title(ac_uint4 code)
-{
- ac_uint4 i, j;
-
- /*
- * Always map the code to itself.
- */
- cases[2] = code;
-
- /* If lower/upper case does not exist, stay the same */
- if (!cases[0]) cases[0] = code;
- if (!cases[1]) cases[1] = code;
-
- if (title_used == title_size) {
- if (title_size == 0)
- title = (_case_t *) malloc(sizeof(_case_t) << 3);
- else
- title = (_case_t *) realloc((char *) title,
- sizeof(_case_t) * (title_size + 8));
- title_size += 8;
- }
-
- /*
- * Locate the insertion point.
- */
- for (i = 0; i < title_used && code > title[i].key; i++) ;
-
- if (i < title_used) {
- /*
- * Shift the array up by one.
- */
- for (j = title_used; j > i; j--)
- (void) AC_MEMCPY((char *) &title[j], (char *) &title[j - 1],
- sizeof(_case_t));
- }
-
- title[i].key = cases[2]; /* Title */
- title[i].other1 = cases[0]; /* Upper */
- title[i].other2 = cases[1]; /* Lower */
-
- title_used++;
-}
-
-static void
-add_upper(ac_uint4 code)
-{
- ac_uint4 i, j;
-
- /*
- * Always map the code to itself.
- */
- cases[0] = code;
-
- /*
- * If the title case character is not present, then make it the same as
- * the upper case.
- */
- if (cases[2] == 0)
- cases[2] = code;
-
- if (upper_used == upper_size) {
- if (upper_size == 0)
- upper = (_case_t *) malloc(sizeof(_case_t) << 3);
- else
- upper = (_case_t *) realloc((char *) upper,
- sizeof(_case_t) * (upper_size + 8));
- upper_size += 8;
- }
-
- /*
- * Locate the insertion point.
- */
- for (i = 0; i < upper_used && code > upper[i].key; i++) ;
-
- if (i < upper_used) {
- /*
- * Shift the array up by one.
- */
- for (j = upper_used; j > i; j--)
- (void) AC_MEMCPY((char *) &upper[j], (char *) &upper[j - 1],
- sizeof(_case_t));
- }
-
- upper[i].key = cases[0]; /* Upper */
- upper[i].other1 = cases[1]; /* Lower */
- upper[i].other2 = cases[2]; /* Title */
-
- upper_used++;
-}
-
-static void
-add_lower(ac_uint4 code)
-{
- ac_uint4 i, j;
-
- /*
- * Always map the code to itself.
- */
- cases[1] = code;
-
- /*
- * If the title case character is empty, then make it the same as the
- * upper case.
- */
- if (cases[2] == 0)
- cases[2] = cases[0];
-
- if (lower_used == lower_size) {
- if (lower_size == 0)
- lower = (_case_t *) malloc(sizeof(_case_t) << 3);
- else
- lower = (_case_t *) realloc((char *) lower,
- sizeof(_case_t) * (lower_size + 8));
- lower_size += 8;
- }
-
- /*
- * Locate the insertion point.
- */
- for (i = 0; i < lower_used && code > lower[i].key; i++) ;
-
- if (i < lower_used) {
- /*
- * Shift the array up by one.
- */
- for (j = lower_used; j > i; j--)
- (void) AC_MEMCPY((char *) &lower[j], (char *) &lower[j - 1],
- sizeof(_case_t));
- }
-
- lower[i].key = cases[1]; /* Lower */
- lower[i].other1 = cases[0]; /* Upper */
- lower[i].other2 = cases[2]; /* Title */
-
- lower_used++;
-}
-
-static void
-ordered_ccl_insert(ac_uint4 c, ac_uint4 ccl_code)
-{
- ac_uint4 i, j;
-
- if (ccl_used == ccl_size) {
- if (ccl_size == 0)
- ccl = (ac_uint4 *) malloc(sizeof(ac_uint4) * 24);
- else
- ccl = (ac_uint4 *)
- realloc((char *) ccl, sizeof(ac_uint4) * (ccl_size + 24));
- ccl_size += 24;
- }
-
- /*
- * Optimize adding the first item.
- */
- if (ccl_used == 0) {
- ccl[0] = ccl[1] = c;
- ccl[2] = ccl_code;
- ccl_used += 3;
- return;
- }
-
- /*
- * Handle the special case of extending the range on the end. This
- * requires that the combining class codes are the same.
- */
- if (ccl_code == ccl[ccl_used - 1] && c == ccl[ccl_used - 2] + 1) {
- ccl[ccl_used - 2] = c;
- return;
- }
-
- /*
- * Handle the special case of adding another range on the end.
- */
- if (c > ccl[ccl_used - 2] + 1 ||
- (c == ccl[ccl_used - 2] + 1 && ccl_code != ccl[ccl_used - 1])) {
- ccl[ccl_used++] = c;
- ccl[ccl_used++] = c;
- ccl[ccl_used++] = ccl_code;
- return;
- }
-
- /*
- * Locate either the insertion point or range for the code.
- */
- for (i = 0; i < ccl_used && c > ccl[i + 1] + 1; i += 3) ;
-
- if (ccl_code == ccl[i + 2] && c == ccl[i + 1] + 1) {
- /*
- * Extend an existing range.
- */
- ccl[i + 1] = c;
- return;
- } else if (c < ccl[i]) {
- /*
- * Start a new range before the current location.
- */
- for (j = ccl_used; j > i; j -= 3) {
- ccl[j] = ccl[j - 3];
- ccl[j - 1] = ccl[j - 4];
- ccl[j - 2] = ccl[j - 5];
- }
- ccl[i] = ccl[i + 1] = c;
- ccl[i + 2] = ccl_code;
- }
-}
-
-/*
- * Adds a number if it does not already exist and returns an index value
- * multiplied by 2.
- */
-static ac_uint4
-make_number(short num, short denom)
-{
- ac_uint4 n;
-
- /*
- * Determine if the number already exists.
- */
- for (n = 0; n < nums_used; n++) {
- if (nums[n].numerator == num && nums[n].denominator == denom)
- return n << 1;
- }
-
- if (nums_used == nums_size) {
- if (nums_size == 0)
- nums = (_num_t *) malloc(sizeof(_num_t) << 3);
- else
- nums = (_num_t *) realloc((char *) nums,
- sizeof(_num_t) * (nums_size + 8));
- nums_size += 8;
- }
-
- n = nums_used++;
- nums[n].numerator = num;
- nums[n].denominator = denom;
-
- return n << 1;
-}
-
-static void
-add_number(ac_uint4 code, short num, short denom)
-{
- ac_uint4 i, j;
-
- /*
- * Insert the code in order.
- */
- for (i = 0; i < ncodes_used && code > ncodes[i].code; i++) ;
-
- /*
- * Handle the case of the codes matching and simply replace the number
- * that was there before.
- */
- if (i < ncodes_used && code == ncodes[i].code) {
- ncodes[i].idx = make_number(num, denom);
- return;
- }
-
- /*
- * Resize the array if necessary.
- */
- if (ncodes_used == ncodes_size) {
- if (ncodes_size == 0)
- ncodes = (_codeidx_t *) malloc(sizeof(_codeidx_t) << 3);
- else
- ncodes = (_codeidx_t *)
- realloc((char *) ncodes, sizeof(_codeidx_t) * (ncodes_size + 8));
-
- ncodes_size += 8;
- }
-
- /*
- * Shift things around to insert the code if necessary.
- */
- if (i < ncodes_used) {
- for (j = ncodes_used; j > i; j--) {
- ncodes[j].code = ncodes[j - 1].code;
- ncodes[j].idx = ncodes[j - 1].idx;
- }
- }
- ncodes[i].code = code;
- ncodes[i].idx = make_number(num, denom);
-
- ncodes_used++;
-}
-
-/*
- * This routine assumes that the line is a valid Unicode Character Database
- * entry.
- */
-static void
-read_cdata(FILE *in)
-{
- ac_uint4 i, lineno, skip, code, ccl_code;
- short wnum, neg, number[2], compat;
- char line[512], *s, *e;
-
- lineno = skip = 0;
- while (fgets(line, sizeof(line), in)) {
- int is_title = 0;
-
- if( (s=strchr(line, '\n')) ) *s = '\0';
- lineno++;
-
- /*
- * Skip blank lines and lines that start with a '#'.
- */
- if (line[0] == 0 || line[0] == '#')
- continue;
-
- /*
- * If lines need to be skipped, do it here.
- */
- if (skip) {
- skip--;
- continue;
- }
-
- /*
- * Collect the code. The code can be up to 6 hex digits in length to
- * allow surrogates to be specified.
- */
- for (s = line, i = code = 0; *s != ';' && i < 6; i++, s++) {
- code <<= 4;
- if (*s >= '0' && *s <= '9')
- code += *s - '0';
- else if (*s >= 'A' && *s <= 'F')
- code += (*s - 'A') + 10;
- else if (*s >= 'a' && *s <= 'f')
- code += (*s - 'a') + 10;
- }
-
- /*
- * Handle the following special cases:
- * 1. 4E00-9FA5 CJK Ideographs.
- * 2. AC00-D7A3 Hangul Syllables.
- * 3. D800-DFFF Surrogates.
- * 4. E000-F8FF Private Use Area.
- * 5. F900-FA2D Han compatibility.
- * ...Plus additional ranges in newer Unicode versions...
- */
- switch (code) {
- case 0x3400:
- /* CJK Ideograph Extension A */
- add_range(0x3400, 0x4db5, "Lo", "L");
-
- add_range(0x3400, 0x4db5, "Cp", 0);
-
- skip = 1;
- break;
- case 0x4e00:
- /*
- * The Han ideographs.
- */
- add_range(0x4e00, 0x9fff, "Lo", "L");
-
- /*
- * Add the characters to the defined category.
- */
- add_range(0x4e00, 0x9fa5, "Cp", 0);
-
- skip = 1;
- break;
- case 0xac00:
- /*
- * The Hangul syllables.
- */
- add_range(0xac00, 0xd7a3, "Lo", "L");
-
- /*
- * Add the characters to the defined category.
- */
- add_range(0xac00, 0xd7a3, "Cp", 0);
-
- skip = 1;
- break;
- case 0xd800:
- /*
- * Make a range of all surrogates and assume some default
- * properties.
- */
- add_range(0x010000, 0x10ffff, "Cs", "L");
- skip = 5;
- break;
- case 0xe000:
- /*
- * The Private Use area. Add with a default set of properties.
- */
- add_range(0xe000, 0xf8ff, "Co", "L");
- skip = 1;
- break;
- case 0xf900:
- /*
- * The CJK compatibility area.
- */
- add_range(0xf900, 0xfaff, "Lo", "L");
-
- /*
- * Add the characters to the defined category.
- */
- add_range(0xf900, 0xfaff, "Cp", 0);
-
- skip = 1;
- break;
- case 0x20000:
- /* CJK Ideograph Extension B */
- add_range(0x20000, 0x2a6d6, "Lo", "L");
-
- add_range(0x20000, 0x2a6d6, "Cp", 0);
-
- skip = 1;
- break;
- case 0xf0000:
- /* Plane 15 private use */
- add_range(0xf0000, 0xffffd, "Co", "L");
- skip = 1;
- break;
-
- case 0x100000:
- /* Plane 16 private use */
- add_range(0x100000, 0x10fffd, "Co", "L");
- skip = 1;
- break;
- }
-
- if (skip)
- continue;
-
- /*
- * Add the code to the defined category.
- */
- ordered_range_insert(code, "Cp", 2);
-
- /*
- * Locate the first character property field.
- */
- for (i = 0; *s != 0 && i < 2; s++) {
- if (*s == ';')
- i++;
- }
- for (e = s; *e && *e != ';'; e++) ;
-
- ordered_range_insert(code, s, e - s);
-
- if (e - s == 2 && s[0] == 'L' && s[1] == 't') {
- is_title = 1;
- }
-
- /*
- * Locate the combining class code.
- */
- for (s = e; *s != 0 && i < 3; s++) {
- if (*s == ';')
- i++;
- }
-
- /*
- * Convert the combining class code from decimal.
- */
- for (ccl_code = 0, e = s; *e && *e != ';'; e++)
- ccl_code = (ccl_code * 10) + (*e - '0');
-
- /*
- * Add the code if it not 0.
- */
- if (ccl_code != 0)
- ordered_ccl_insert(code, ccl_code);
-
- /*
- * Locate the second character property field.
- */
- for (s = e; *s != 0 && i < 4; s++) {
- if (*s == ';')
- i++;
- }
- for (e = s; *e && *e != ';'; e++) ;
-
- ordered_range_insert(code, s, e - s);
-
- /*
- * Check for a decomposition.
- */
- s = ++e;
- if (*s != ';') {
- compat = *s == '<';
- if (compat) {
- /*
- * Skip compatibility formatting tag.
- */
- while (*s++ != '>');
- }
- /*
- * Collect the codes of the decomposition.
- */
- for (dectmp_size = 0; *s != ';'; ) {
- /*
- * Skip all leading non-hex digits.
- */
- while (!ishdigit(*s))
- s++;
-
- for (dectmp[dectmp_size] = 0; ishdigit(*s); s++) {
- dectmp[dectmp_size] <<= 4;
- if (*s >= '0' && *s <= '9')
- dectmp[dectmp_size] += *s - '0';
- else if (*s >= 'A' && *s <= 'F')
- dectmp[dectmp_size] += (*s - 'A') + 10;
- else if (*s >= 'a' && *s <= 'f')
- dectmp[dectmp_size] += (*s - 'a') + 10;
- }
- dectmp_size++;
- }
-
- /*
- * If there are any codes in the temporary decomposition array,
- * then add the character with its decomposition.
- */
- if (dectmp_size > 0) {
- if (!compat) {
- add_decomp(code, 0);
- }
- add_decomp(code, 1);
- }
- }
-
- /*
- * Skip to the number field.
- */
- for (i = 0; i < 3 && *s; s++) {
- if (*s == ';')
- i++;
- }
-
- /*
- * Scan the number in.
- */
- number[0] = number[1] = 0;
- for (e = s, neg = wnum = 0; *e && *e != ';'; e++) {
- if (*e == '-') {
- neg = 1;
- continue;
- }
-
- if (*e == '/') {
- /*
- * Move the denominator of the fraction.
- */
- if (neg)
- number[wnum] *= -1;
- neg = 0;
- e++;
- wnum++;
- }
- number[wnum] = (number[wnum] * 10) + (*e - '0');
- }
-
- if (e > s) {
- /*
- * Adjust the denominator in case of integers and add the number.
- */
- if (wnum == 0)
- number[1] = 1;
-
- add_number(code, number[0], number[1]);
- }
-
- /*
- * Skip to the start of the possible case mappings.
- */
- for (s = e, i = 0; i < 4 && *s; s++) {
- if (*s == ';')
- i++;
- }
-
- /*
- * Collect the case mappings.
- */
- cases[0] = cases[1] = cases[2] = 0;
- for (i = 0; i < 3; i++) {
- while (ishdigit(*s)) {
- cases[i] <<= 4;
- if (*s >= '0' && *s <= '9')
- cases[i] += *s - '0';
- else if (*s >= 'A' && *s <= 'F')
- cases[i] += (*s - 'A') + 10;
- else if (*s >= 'a' && *s <= 'f')
- cases[i] += (*s - 'a') + 10;
- s++;
- }
- if (*s == ';')
- s++;
- }
- if (is_title)
- /*
- * Add the upper and lower mappings for a title case character.
- */
- add_title(code);
- else if (cases[1])
- /*
- * Add the lower and title case mappings for the upper case
- * character.
- */
- add_upper(code);
- else if (cases[0])
- /*
- * Add the upper and title case mappings for the lower case
- * character.
- */
- add_lower(code);
- }
-}
-
-#if 0
-
-static _decomp_t *
-find_decomp(ac_uint4 code, short compat)
-{
- long l, r, m;
- _decomp_t *decs;
-
- l = 0;
- r = (compat ? kdecomps_used : decomps_used) - 1;
- decs = compat ? kdecomps : decomps;
- while (l <= r) {
- m = (l + r) >> 1;
- if (code > decs[m].code)
- l = m + 1;
- else if (code < decs[m].code)
- r = m - 1;
- else
- return &decs[m];
- }
- return 0;
-}
-
-static void
-decomp_it(_decomp_t *d, short compat)
-{
- ac_uint4 i;
- _decomp_t *dp;
-
- for (i = 0; i < d->used; i++) {
- if ((dp = find_decomp(d->decomp[i], compat)) != 0)
- decomp_it(dp, compat);
- else
- dectmp[dectmp_size++] = d->decomp[i];
- }
-}
-
-
-/*
- * Expand all decompositions by recursively decomposing each character
- * in the decomposition.
- */
-static void
-expand_decomp(void)
-{
- ac_uint4 i;
-
- for (i = 0; i < decomps_used; i++) {
- dectmp_size = 0;
- decomp_it(&decomps[i], 0);
- if (dectmp_size > 0)
- add_decomp(decomps[i].code, 0);
- }
-
- for (i = 0; i < kdecomps_used; i++) {
- dectmp_size = 0;
- decomp_it(&kdecomps[i], 1);
- if (dectmp_size > 0)
- add_decomp(kdecomps[i].code, 1);
- }
-}
-
-static int
-cmpcomps(const void *v_comp1, const void *v_comp2)
-{
- const _comp_t *comp1 = v_comp1, *comp2 = v_comp2;
- long diff = comp1->code1 - comp2->code1;
-
- if (!diff)
- diff = comp1->code2 - comp2->code2;
- return (int) diff;
-}
-
-#endif
-
-/*
- * Load composition exclusion data
- */
-static void
-read_compexdata(FILE *in)
-{
- ac_uint2 i;
- ac_uint4 code;
- char line[512], *s;
-
- (void) memset((char *) compexs, 0, sizeof(compexs));
-
- while (fgets(line, sizeof(line), in)) {
- if( (s=strchr(line, '\n')) ) *s = '\0';
- /*
- * Skip blank lines and lines that start with a '#'.
- */
- if (line[0] == 0 || line[0] == '#')
- continue;
-
- /*
- * Collect the code. Assume max 6 digits
- */
-
- for (s = line, i = code = 0; *s != '#' && i < 6; i++, s++) {
- if (isspace((unsigned char)*s)) break;
- code <<= 4;
- if (*s >= '0' && *s <= '9')
- code += *s - '0';
- else if (*s >= 'A' && *s <= 'F')
- code += (*s - 'A') + 10;
- else if (*s >= 'a' && *s <= 'f')
- code += (*s - 'a') + 10;
- }
- COMPEX_SET(code);
- }
-}
-
-#if 0
-
-/*
- * Creates array of compositions from decomposition array
- */
-static void
-create_comps(void)
-{
- ac_uint4 i, cu;
-
- comps = (_comp_t *) malloc(comps_used * sizeof(_comp_t));
-
- for (i = cu = 0; i < decomps_used; i++) {
- if (decomps[i].used != 2 || COMPEX_TEST(decomps[i].code))
- continue;
- comps[cu].comp = decomps[i].code;
- comps[cu].count = 2;
- comps[cu].code1 = decomps[i].decomp[0];
- comps[cu].code2 = decomps[i].decomp[1];
- cu++;
- }
- comps_used = cu;
- qsort(comps, comps_used, sizeof(_comp_t), cmpcomps);
-}
-
-#endif
-
-#if HARDCODE_DATA
-static void
-write_case(FILE *out, _case_t *tab, int num, int first)
-{
- int i;
-
- for (i=0; i<num; i++) {
- if (first) first = 0;
- else fprintf(out, ",");
- fprintf(out, "\n\t0x%08lx, 0x%08lx, 0x%08lx",
- (unsigned long) tab[i].key, (unsigned long) tab[i].other1,
- (unsigned long) tab[i].other2);
- }
-}
-
-#define PREF "static const "
-
-#endif
-
-static void
-write_cdata(char *opath)
-{
- FILE *out;
- ac_uint4 bytes;
- ac_uint4 i, idx, nprops;
-#if !(HARDCODE_DATA)
- ac_uint2 casecnt[2];
-#endif
- char path[BUFSIZ];
-#if HARDCODE_DATA
- int j, k;
-
- /*****************************************************************
- *
- * Generate the ctype data.
- *
- *****************************************************************/
-
- /*
- * Open the output file.
- */
- snprintf(path, sizeof path, "%s" LDAP_DIRSEP "uctable.h", opath);
- if ((out = fopen(path, "w")) == 0)
- return;
-#else
- /*
- * Open the ctype.dat file.
- */
- snprintf(path, sizeof path, "%s" LDAP_DIRSEP "ctype.dat", opath);
- if ((out = fopen(path, "wb")) == 0)
- return;
-#endif
-
- /*
- * Collect the offsets for the properties. The offsets array is
- * on a 4-byte boundary to keep things efficient for architectures
- * that need such a thing.
- */
- for (i = idx = 0; i < NUMPROPS; i++) {
- propcnt[i] = (proptbl[i].used != 0) ? idx : 0xffff;
- idx += proptbl[i].used;
- }
-
- /*
- * Add the sentinel index which is used by the binary search as the upper
- * bound for a search.
- */
- propcnt[i] = idx;
-
- /*
- * Record the actual number of property lists. This may be different than
- * the number of offsets actually written because of aligning on a 4-byte
- * boundary.
- */
- hdr[1] = NUMPROPS;
-
- /*
- * Calculate the byte count needed and pad the property counts array to a
- * 4-byte boundary.
- */
- if ((bytes = sizeof(ac_uint2) * (NUMPROPS + 1)) & 3)
- bytes += 4 - (bytes & 3);
- nprops = bytes / sizeof(ac_uint2);
- bytes += sizeof(ac_uint4) * idx;
-
-#if HARDCODE_DATA
- fprintf(out,
- "/* This file was generated from a modified version UCData's ucgendat.\n"
- " *\n"
- " * DO NOT EDIT THIS FILE!\n"
- " * \n"
- " * Instead, compile ucgendat.c (bundled with PHP in ext/mbstring), download\n"
- " * the appropriate UnicodeData-x.x.x.txt and CompositionExclusions-x.x.x.txt\n"
- " * files from http://www.unicode.org/Public/ and run this program.\n"
- " *\n"
- " * More information can be found in the UCData package. Unfortunately,\n"
- " * the project's page doesn't seem to be live anymore, so you can use\n"
- " * OpenLDAPs modified copy (look in libraries/liblunicode/ucdata) */\n\n");
-
- fprintf(out, PREF "unsigned short _ucprop_size = %d;\n\n", NUMPROPS);
-
- fprintf(out, PREF "unsigned short _ucprop_offsets[] = {");
-
- for (i = 0; i<nprops; i++) {
- if (i) fprintf(out, ",");
- if (!(i&7)) fprintf(out, "\n\t");
- else fprintf(out, " ");
- fprintf(out, "0x%04x", propcnt[i]);
- }
- fprintf(out, "\n};\n\n");
-
- fprintf(out, PREF "unsigned int _ucprop_ranges[] = {");
-
- k = 0;
- for (i = 0; i < NUMPROPS; i++) {
- if (proptbl[i].used > 0) {
- for (j=0; j<proptbl[i].used; j++) {
- if (k) fprintf(out, ",");
- if (!(k&3)) fprintf(out,"\n\t");
- else fprintf(out, " ");
- k++;
- fprintf(out, "0x%08lx", (unsigned long) proptbl[i].ranges[j]);
- }
- }
- }
- fprintf(out, "\n};\n\n");
-#else
- /*
- * Write the header.
- */
- fwrite((char *) hdr, sizeof(ac_uint2), 2, out);
-
- /*
- * Write the byte count.
- */
- fwrite((char *) &bytes, sizeof(ac_uint4), 1, out);
-
- /*
- * Write the property list counts.
- */
- fwrite((char *) propcnt, sizeof(ac_uint2), nprops, out);
-
- /*
- * Write the property lists.
- */
- for (i = 0; i < NUMPROPS; i++) {
- if (proptbl[i].used > 0)
- fwrite((char *) proptbl[i].ranges, sizeof(ac_uint4),
- proptbl[i].used, out);
- }
-
- fclose(out);
-#endif
-
- /*****************************************************************
- *
- * Generate the case mapping data.
- *
- *****************************************************************/
-
-#if HARDCODE_DATA
- fprintf(out, PREF "unsigned int _uccase_size = %ld;\n\n",
- (long) (upper_used + lower_used + title_used));
-
- fprintf(out,
- "/* Starting indexes of the case tables\n"
- " * UpperIndex = 0\n"
- " * LowerIndex = _uccase_len[0]\n"
- " * TitleIndex = LowerIndex + _uccase_len[1] */\n\n");
- fprintf(out, PREF "unsigned short _uccase_len[2] = {%ld, %ld};\n\n",
- (long) upper_used, (long) lower_used);
- fprintf(out, PREF "unsigned int _uccase_map[] = {");
-
- if (upper_used > 0)
- /*
- * Write the upper case table.
- */
- write_case(out, upper, upper_used, 1);
-
- if (lower_used > 0)
- /*
- * Write the lower case table.
- */
- write_case(out, lower, lower_used, !upper_used);
-
- if (title_used > 0)
- /*
- * Write the title case table.
- */
- write_case(out, title, title_used, !(upper_used||lower_used));
-
- if (!(upper_used || lower_used || title_used))
- fprintf(out, "\t0");
-
- fprintf(out, "\n};\n\n");
-#else
- /*
- * Open the case.dat file.
- */
- snprintf(path, sizeof path, "%s" LDAP_DIRSEP "case.dat", opath);
- if ((out = fopen(path, "wb")) == 0)
- return;
-
- /*
- * Write the case mapping tables.
- */
- hdr[1] = upper_used + lower_used + title_used;
- casecnt[0] = upper_used;
- casecnt[1] = lower_used;
-
- /*
- * Write the header.
- */
- fwrite((char *) hdr, sizeof(ac_uint2), 2, out);
-
- /*
- * Write the upper and lower case table sizes.
- */
- fwrite((char *) casecnt, sizeof(ac_uint2), 2, out);
-
- if (upper_used > 0)
- /*
- * Write the upper case table.
- */
- fwrite((char *) upper, sizeof(_case_t), upper_used, out);
-
- if (lower_used > 0)
- /*
- * Write the lower case table.
- */
- fwrite((char *) lower, sizeof(_case_t), lower_used, out);
-
- if (title_used > 0)
- /*
- * Write the title case table.
- */
- fwrite((char *) title, sizeof(_case_t), title_used, out);
-
- fclose(out);
-#endif
-
-#if 0
-
- /*****************************************************************
- *
- * Generate the composition data.
- *
- *****************************************************************/
-
- /*
- * Create compositions from decomposition data
- */
- create_comps();
-
-#if HARDCODE_DATA
- fprintf(out, PREF "ac_uint4 _uccomp_size = %ld;\n\n",
- comps_used * 4L);
-
- fprintf(out, PREF "ac_uint4 _uccomp_data[] = {");
-
- /*
- * Now, if comps exist, write them out.
- */
- if (comps_used > 0) {
- for (i=0; i<comps_used; i++) {
- if (i) fprintf(out, ",");
- fprintf(out, "\n\t0x%08lx, 0x%08lx, 0x%08lx, 0x%08lx",
- (unsigned long) comps[i].comp, (unsigned long) comps[i].count,
- (unsigned long) comps[i].code1, (unsigned long) comps[i].code2);
- }
- } else {
- fprintf(out, "\t0");
- }
- fprintf(out, "\n};\n\n");
-#else
- /*
- * Open the comp.dat file.
- */
- snprintf(path, sizeof path, "%s" LDAP_DIRSEP "comp.dat", opath);
- if ((out = fopen(path, "wb")) == 0)
- return;
-
- /*
- * Write the header.
- */
- hdr[1] = (ac_uint2) comps_used * 4;
- fwrite((char *) hdr, sizeof(ac_uint2), 2, out);
-
- /*
- * Write out the byte count to maintain header size.
- */
- bytes = comps_used * sizeof(_comp_t);
- fwrite((char *) &bytes, sizeof(ac_uint4), 1, out);
-
- /*
- * Now, if comps exist, write them out.
- */
- if (comps_used > 0)
- fwrite((char *) comps, sizeof(_comp_t), comps_used, out);
-
- fclose(out);
-#endif
-
- /*****************************************************************
- *
- * Generate the decomposition data.
- *
- *****************************************************************/
-
- /*
- * Fully expand all decompositions before generating the output file.
- */
- expand_decomp();
-
-#if HARDCODE_DATA
- fprintf(out, PREF "ac_uint4 _ucdcmp_size = %ld;\n\n",
- decomps_used * 2L);
-
- fprintf(out, PREF "ac_uint4 _ucdcmp_nodes[] = {");
-
- if (decomps_used) {
- /*
- * Write the list of decomp nodes.
- */
- for (i = idx = 0; i < decomps_used; i++) {
- fprintf(out, "\n\t0x%08lx, 0x%08lx,",
- (unsigned long) decomps[i].code, (unsigned long) idx);
- idx += decomps[i].used;
- }
-
- /*
- * Write the sentinel index as the last decomp node.
- */
- fprintf(out, "\n\t0x%08lx\n};\n\n", (unsigned long) idx);
-
- fprintf(out, PREF "ac_uint4 _ucdcmp_decomp[] = {");
- /*
- * Write the decompositions themselves.
- */
- k = 0;
- for (i = 0; i < decomps_used; i++)
- for (j=0; j<decomps[i].used; j++) {
- if (k) fprintf(out, ",");
- if (!(k&3)) fprintf(out,"\n\t");
- else fprintf(out, " ");
- k++;
- fprintf(out, "0x%08lx", (unsigned long) decomps[i].decomp[j]);
- }
- fprintf(out, "\n};\n\n");
- }
-#else
- /*
- * Open the decomp.dat file.
- */
- snprintf(path, sizeof path, "%s" LDAP_DIRSEP "decomp.dat", opath);
- if ((out = fopen(path, "wb")) == 0)
- return;
-
- hdr[1] = decomps_used;
-
- /*
- * Write the header.
- */
- fwrite((char *) hdr, sizeof(ac_uint2), 2, out);
-
- /*
- * Write a temporary byte count which will be calculated as the
- * decompositions are written out.
- */
- bytes = 0;
- fwrite((char *) &bytes, sizeof(ac_uint4), 1, out);
-
- if (decomps_used) {
- /*
- * Write the list of decomp nodes.
- */
- for (i = idx = 0; i < decomps_used; i++) {
- fwrite((char *) &decomps[i].code, sizeof(ac_uint4), 1, out);
- fwrite((char *) &idx, sizeof(ac_uint4), 1, out);
- idx += decomps[i].used;
- }
-
- /*
- * Write the sentinel index as the last decomp node.
- */
- fwrite((char *) &idx, sizeof(ac_uint4), 1, out);
-
- /*
- * Write the decompositions themselves.
- */
- for (i = 0; i < decomps_used; i++)
- fwrite((char *) decomps[i].decomp, sizeof(ac_uint4),
- decomps[i].used, out);
-
- /*
- * Seek back to the beginning and write the byte count.
- */
- bytes = (sizeof(ac_uint4) * idx) +
- (sizeof(ac_uint4) * ((hdr[1] << 1) + 1));
- fseek(out, sizeof(ac_uint2) << 1, 0L);
- fwrite((char *) &bytes, sizeof(ac_uint4), 1, out);
-
- fclose(out);
- }
-#endif
-
-#ifdef HARDCODE_DATA
- fprintf(out, PREF "ac_uint4 _uckdcmp_size = %ld;\n\n",
- kdecomps_used * 2L);
-
- fprintf(out, PREF "ac_uint4 _uckdcmp_nodes[] = {");
-
- if (kdecomps_used) {
- /*
- * Write the list of kdecomp nodes.
- */
- for (i = idx = 0; i < kdecomps_used; i++) {
- fprintf(out, "\n\t0x%08lx, 0x%08lx,",
- (unsigned long) kdecomps[i].code, (unsigned long) idx);
- idx += kdecomps[i].used;
- }
-
- /*
- * Write the sentinel index as the last decomp node.
- */
- fprintf(out, "\n\t0x%08lx\n};\n\n", (unsigned long) idx);
-
- fprintf(out, PREF "ac_uint4 _uckdcmp_decomp[] = {");
-
- /*
- * Write the decompositions themselves.
- */
- k = 0;
- for (i = 0; i < kdecomps_used; i++)
- for (j=0; j<kdecomps[i].used; j++) {
- if (k) fprintf(out, ",");
- if (!(k&3)) fprintf(out,"\n\t");
- else fprintf(out, " ");
- k++;
- fprintf(out, "0x%08lx", (unsigned long) kdecomps[i].decomp[j]);
- }
- fprintf(out, "\n};\n\n");
- }
-#else
- /*
- * Open the kdecomp.dat file.
- */
- snprintf(path, sizeof path, "%s" LDAP_DIRSEP "kdecomp.dat", opath);
- if ((out = fopen(path, "wb")) == 0)
- return;
-
- hdr[1] = kdecomps_used;
-
- /*
- * Write the header.
- */
- fwrite((char *) hdr, sizeof(ac_uint2), 2, out);
-
- /*
- * Write a temporary byte count which will be calculated as the
- * decompositions are written out.
- */
- bytes = 0;
- fwrite((char *) &bytes, sizeof(ac_uint4), 1, out);
-
- if (kdecomps_used) {
- /*
- * Write the list of kdecomp nodes.
- */
- for (i = idx = 0; i < kdecomps_used; i++) {
- fwrite((char *) &kdecomps[i].code, sizeof(ac_uint4), 1, out);
- fwrite((char *) &idx, sizeof(ac_uint4), 1, out);
- idx += kdecomps[i].used;
- }
-
- /*
- * Write the sentinel index as the last decomp node.
- */
- fwrite((char *) &idx, sizeof(ac_uint4), 1, out);
-
- /*
- * Write the decompositions themselves.
- */
- for (i = 0; i < kdecomps_used; i++)
- fwrite((char *) kdecomps[i].decomp, sizeof(ac_uint4),
- kdecomps[i].used, out);
-
- /*
- * Seek back to the beginning and write the byte count.
- */
- bytes = (sizeof(ac_uint4) * idx) +
- (sizeof(ac_uint4) * ((hdr[1] << 1) + 1));
- fseek(out, sizeof(ac_uint2) << 1, 0L);
- fwrite((char *) &bytes, sizeof(ac_uint4), 1, out);
-
- fclose(out);
- }
-#endif
-
- /*****************************************************************
- *
- * Generate the combining class data.
- *
- *****************************************************************/
-#ifdef HARDCODE_DATA
- fprintf(out, PREF "ac_uint4 _uccmcl_size = %ld;\n\n", (long) ccl_used);
-
- fprintf(out, PREF "ac_uint4 _uccmcl_nodes[] = {");
-
- if (ccl_used > 0) {
- /*
- * Write the combining class ranges out.
- */
- for (i = 0; i<ccl_used; i++) {
- if (i) fprintf(out, ",");
- if (!(i&3)) fprintf(out, "\n\t");
- else fprintf(out, " ");
- fprintf(out, "0x%08lx", (unsigned long) ccl[i]);
- }
- } else {
- fprintf(out, "\t0");
- }
- fprintf(out, "\n};\n\n");
-#else
- /*
- * Open the cmbcl.dat file.
- */
- snprintf(path, sizeof path, "%s" LDAP_DIRSEP "cmbcl.dat", opath);
- if ((out = fopen(path, "wb")) == 0)
- return;
-
- /*
- * Set the number of ranges used. Each range has a combining class which
- * means each entry is a 3-tuple.
- */
- hdr[1] = ccl_used / 3;
-
- /*
- * Write the header.
- */
- fwrite((char *) hdr, sizeof(ac_uint2), 2, out);
-
- /*
- * Write out the byte count to maintain header size.
- */
- bytes = ccl_used * sizeof(ac_uint4);
- fwrite((char *) &bytes, sizeof(ac_uint4), 1, out);
-
- if (ccl_used > 0)
- /*
- * Write the combining class ranges out.
- */
- fwrite((char *) ccl, sizeof(ac_uint4), ccl_used, out);
-
- fclose(out);
-#endif
-
- /*****************************************************************
- *
- * Generate the number data.
- *
- *****************************************************************/
-
-#if HARDCODE_DATA
- fprintf(out, PREF "ac_uint4 _ucnum_size = %lu;\n\n",
- (unsigned long)ncodes_used<<1);
-
- fprintf(out, PREF "ac_uint4 _ucnum_nodes[] = {");
-
- /*
- * Now, if number mappings exist, write them out.
- */
- if (ncodes_used > 0) {
- for (i = 0; i<ncodes_used; i++) {
- if (i) fprintf(out, ",");
- if (!(i&1)) fprintf(out, "\n\t");
- else fprintf(out, " ");
- fprintf(out, "0x%08lx, 0x%08lx",
- (unsigned long) ncodes[i].code, (unsigned long) ncodes[i].idx);
- }
- fprintf(out, "\n};\n\n");
-
- fprintf(out, PREF "short _ucnum_vals[] = {");
- for (i = 0; i<nums_used; i++) {
- if (i) fprintf(out, ",");
- if (!(i&3)) fprintf(out, "\n\t");
- else fprintf(out, " ");
- if (nums[i].numerator < 0) {
- fprintf(out, "%6d, 0x%04x",
- nums[i].numerator, nums[i].denominator);
- } else {
- fprintf(out, "0x%04x, 0x%04x",
- nums[i].numerator, nums[i].denominator);
- }
- }
- fprintf(out, "\n};\n\n");
- }
-#else
- /*
- * Open the num.dat file.
- */
- snprintf(path, sizeof path, "%s" LDAP_DIRSEP "num.dat", opath);
- if ((out = fopen(path, "wb")) == 0)
- return;
-
- /*
- * The count part of the header will be the total number of codes that
- * have numbers.
- */
- hdr[1] = (ac_uint2) (ncodes_used << 1);
- bytes = (ncodes_used * sizeof(_codeidx_t)) + (nums_used * sizeof(_num_t));
-
- /*
- * Write the header.
- */
- fwrite((char *) hdr, sizeof(ac_uint2), 2, out);
-
- /*
- * Write out the byte count to maintain header size.
- */
- fwrite((char *) &bytes, sizeof(ac_uint4), 1, out);
-
- /*
- * Now, if number mappings exist, write them out.
- */
- if (ncodes_used > 0) {
- fwrite((char *) ncodes, sizeof(_codeidx_t), ncodes_used, out);
- fwrite((char *) nums, sizeof(_num_t), nums_used, out);
- }
-#endif
-
-#endif
-
- fclose(out);
-}
-
-static void
-usage(char *prog)
-{
- fprintf(stderr,
- "Usage: %s [-o output-directory|-x composition-exclusions]", prog);
- fprintf(stderr, " datafile1 datafile2 ...\n\n");
- fprintf(stderr,
- "-o output-directory\n\t\tWrite the output files to a different");
- fprintf(stderr, " directory (default: .).\n");
- fprintf(stderr,
- "-x composition-exclusion\n\t\tFile of composition codes");
- fprintf(stderr, " that should be excluded.\n");
- exit(1);
-}
-
-int
-main(int argc, char *argv[])
-{
- FILE *in;
- char *prog, *opath;
-
- prog = argv[1];
-
- opath = 0;
- in = stdin;
-
- argc--;
- argv++;
-
- while (argc > 0) {
- if (argv[0][0] == '-') {
- switch (argv[0][1]) {
- case 'o':
- argc--;
- argv++;
- opath = argv[0];
- break;
- case 'x':
- argc--;
- argv++;
- if ((in = fopen(argv[0], "r")) == 0)
- fprintf(stderr,
- "%s: unable to open composition exclusion file %s\n",
- prog, argv[0]);
- else {
- read_compexdata(in);
- fclose(in);
- in = 0;
- }
- break;
- default:
- usage(prog);
- }
- } else {
- if (in != stdin && in != NULL)
- fclose(in);
- if ((in = fopen(argv[0], "r")) == 0)
- fprintf(stderr, "%s: unable to open ctype file %s\n",
- prog, argv[0]);
- else {
- read_cdata(in);
- fclose(in);
- in = 0;
- }
- }
- argc--;
- argv++;
- }
-
- if (opath == 0)
- opath = ".";
- write_cdata(opath);
-
- return 0;
-}
diff --git a/ext/mbstring/ucgendat/ucgendat.php b/ext/mbstring/ucgendat/ucgendat.php
new file mode 100644
index 0000000000..556a8cf98f
--- /dev/null
+++ b/ext/mbstring/ucgendat/ucgendat.php
@@ -0,0 +1,641 @@
+<?php error_reporting(E_ALL);
+
+/* This is based on the ucgendat.c file from the OpenLDAP project, licensed
+ * as follows. */
+
+/* Copyright 1998-2007 The OpenLDAP Foundation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available at
+ * <http://www.OpenLDAP.org/license.html>.
+ */
+
+/* Copyright 2001 Computing Research Labs, New Mexico State University
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
+ * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+if ($argc < 2) {
+ echo "Usage: php ucgendata.php ./datadir\n";
+ echo "./datadir must contain:\n";
+ echo "UnicodeData.txt, CaseFolding.txt, SpecialCasing.txt and DerivedCoreProperties.txt\n";
+ return;
+}
+
+$dir = $argv[1];
+$unicodeDataFile = $dir . '/UnicodeData.txt';
+$caseFoldingFile = $dir . '/CaseFolding.txt';
+$specialCasingFile = $dir . '/SpecialCasing.txt';
+$derivedCorePropertiesFile = $dir . '/DerivedCoreProperties.txt';
+
+$files = [$unicodeDataFile, $caseFoldingFile, $specialCasingFile, $derivedCorePropertiesFile];
+foreach ($files as $file) {
+ if (!file_exists($file)) {
+ echo "File $file does not exist.\n";
+ return;
+ }
+}
+
+$outputFile = __DIR__ . "/../unicode_data.h";
+
+$data = new UnicodeData;
+parseUnicodeData($data, file_get_contents($unicodeDataFile));
+parseCaseFolding($data, file_get_contents($caseFoldingFile));
+parseSpecialCasing($data, file_get_contents($specialCasingFile));
+parseDerivedCoreProperties($data, file_get_contents($derivedCorePropertiesFile));
+file_put_contents($outputFile, generateData($data));
+
+class Range {
+ public $start;
+ public $end;
+
+ public function __construct(int $start, int $end) {
+ $this->start = $start;
+ $this->end = $end;
+ }
+}
+
+class UnicodeData {
+ public $propIndexes;
+ public $numProps;
+ public $propRanges;
+ public $caseMaps;
+ public $extraCaseData;
+
+ public function __construct() {
+ /*
+ * List of properties expected to be found in the Unicode Character Database.
+ */
+ $this->propIndexes = array_flip([
+ "Mn", "Mc", "Me", "Nd", "Nl", "No",
+ "Zs", "Zl", "Zp", "Cc", "Cf", "Cs",
+ "Co", "Cn", "Lu", "Ll", "Lt", "Lm",
+ "Lo", "Pc", "Pd", "Ps", "Pe", "Po",
+ "Sm", "Sc", "Sk", "So", "L", "R",
+ "EN", "ES", "ET", "AN", "CS", "B",
+ "S", "WS", "ON", "Pi", "Pf", "AL",
+ "Cased", "Case_Ignorable"
+ ]);
+ $this->numProps = count($this->propIndexes);
+
+ $this->propRanges = array_fill(0, $this->numProps, []);
+ $this->caseMaps = [
+ 'upper' => [],
+ 'lower' => [],
+ 'title' => [],
+ 'fold' => [],
+ ];
+ $this->extraCaseData = [];
+ }
+
+ function propToIndex(string $prop) : int {
+ /* Deal with directionality codes introduced in Unicode 3.0. */
+ if (in_array($prop, ["BN", "NSM", "PDF", "LRE", "LRO", "RLE", "RLO", "LRI", "RLI", "FSI", "PDI"])) {
+ /*
+ * Mark all of these as Other Neutral to preserve compatibility with
+ * older versions.
+ */
+ $prop = "ON";
+ }
+
+ if (!isset($this->propIndexes[$prop])) {
+ throw new Exception("Unknown property $prop");
+ }
+
+ return $this->propIndexes[$prop];
+ }
+
+ public function addProp(int $code, string $prop) {
+ $propIdx = self::propToIndex($prop);
+
+ // Check if this extends the last range
+ $ranges = $this->propRanges[$propIdx];
+ if (!empty($ranges)) {
+ $lastRange = $ranges[count($ranges) - 1];
+ if ($code === $lastRange->end + 1) {
+ $lastRange->end++;
+ return;
+ }
+ }
+
+ $this->propRanges[$propIdx][] = new Range($code, $code);
+ }
+
+ public function addPropRange(int $startCode, int $endCode, string $prop) {
+ $propIdx = self::propToIndex($prop);
+ $this->propRanges[$propIdx][] = new Range($startCode, $endCode);
+ }
+
+ public function addCaseMapping(string $case, int $origCode, int $mappedCode) {
+ $this->caseMaps[$case][$origCode] = $mappedCode;
+ }
+
+ public function compactRangeArray(array $ranges) : array {
+ // Sort by start codepoint
+ usort($ranges, function (Range $r1, Range $r2) {
+ return $r1->start <=> $r2->start;
+ });
+
+ $lastRange = new Range(-1, -1);
+ $newRanges = [];
+ foreach ($ranges as $range) {
+ if ($lastRange->end == -1) {
+ $lastRange = $range;
+ } else if ($range->start == $lastRange->end + 1) {
+ $lastRange->end = $range->end;
+ } else if ($range->start > $lastRange->end + 1) {
+ $newRanges[] = $lastRange;
+ $lastRange = $range;
+ } else {
+ throw new Exception(sprintf(
+ "Overlapping ranges [%x, %x] and [%x, %x]",
+ $lastRange->start, $lastRange->end,
+ $range->start, $range->end
+ ));
+ }
+ }
+ if ($lastRange->end != -1) {
+ $newRanges[] = $lastRange;
+ }
+ return $newRanges;
+ }
+
+ public function compactPropRanges() {
+ foreach ($this->propRanges as &$ranges) {
+ $ranges = $this->compactRangeArray($ranges);
+ }
+ }
+}
+
+function parseDataFile(string $input) {
+ $lines = explode("\n", $input);
+ foreach ($lines as $line) {
+ // Strip comments
+ if (false !== $hashPos = strpos($line, '#')) {
+ $line = substr($line, 0, $hashPos);
+ }
+
+ // Skip empty lines
+ $line = trim($line);
+ if ($line === '') {
+ continue;
+ }
+
+ $fields = array_map('trim', explode(';', $line));
+ yield $fields;
+ }
+}
+
+function parseUnicodeData(UnicodeData $data, string $input) : void {
+ $lines = parseDataFile($input);
+ foreach ($lines as $fields) {
+ if (count($fields) != 15) {
+ throw new Exception("Line does not contain 15 fields");
+ }
+
+ $code = intval($fields[0], 16);
+
+ $name = $fields[1];
+ if ($name === '') {
+ throw new Exception("Empty name");
+ }
+
+ if ($name[0] === '<' && $name !== '<control>') {
+ // This is a character range
+ $lines->next();
+ $nextFields = $lines->current();
+ $nextCode = intval($nextFields[0], 16);
+
+ $generalCategory = $fields[2];
+ $data->addPropRange($code, $nextCode, $generalCategory);
+
+ $bidiClass = $fields[4];
+ $data->addPropRange($code, $nextCode, $bidiClass);
+ continue;
+ }
+
+ $generalCategory = $fields[2];
+ $data->addProp($code, $generalCategory);
+
+ $bidiClass = $fields[4];
+ $data->addProp($code, $bidiClass);
+
+ $upperCase = intval($fields[12], 16);
+ $lowerCase = intval($fields[13], 16);
+ $titleCase = intval($fields[14], 16) ?: $upperCase;
+ if ($upperCase) {
+ $data->addCaseMapping('upper', $code, $upperCase);
+ }
+ if ($lowerCase) {
+ $data->addCaseMapping('lower', $code, $lowerCase);
+ }
+ if ($titleCase) {
+ $data->addCaseMapping('title', $code, $titleCase);
+ }
+ }
+}
+
+function parseCodes(string $strCodes) : array {
+ $codes = [];
+ foreach (explode(' ', $strCodes) as $strCode) {
+ $codes[] = intval($strCode, 16);
+ }
+ return $codes;
+}
+
+function parseCaseFolding(UnicodeData $data, string $input) : void {
+ foreach (parseDataFile($input) as $fields) {
+ if (count($fields) != 4) {
+ throw new Exception("Line does not contain 4 fields");
+ }
+
+ $code = intval($fields[0], 16);
+ $status = $fields[1];
+ if ($status == 'T') {
+ // Use language-agnostic case folding
+ continue;
+ }
+
+ if ($status == 'C' || $status == 'S') {
+ $foldCode = intval($fields[2], 16);
+ if (!isset($data->caseMaps['fold'][$code])) {
+ $data->addCaseMapping('fold', $code, $foldCode);
+ } else {
+ // Add simple mapping to full mapping data
+ assert(is_array($data->caseMaps['fold'][$code]));
+ $data->caseMaps['fold'][$code][0] = $foldCode;
+ }
+ } else if ($status == 'F') {
+ $foldCodes = parseCodes($fields[2]);
+ $existingFoldCode = $data->caseMaps['fold'][$code] ?? $code;
+ $data->caseMaps['fold'][$code] = array_merge([$code], $foldCodes);
+ } else {
+ assert(0);
+ }
+ }
+}
+
+function addSpecialCasing(UnicodeData $data, string $type, int $code, array $caseCodes) : void {
+ $simpleCaseCode = $data->caseMaps[$type][$code] ?? $code;
+ if (count($caseCodes) == 1) {
+ if ($caseCodes[0] != $simpleCaseCode) {
+ throw new Exception("Simple case code in special casing does not match");
+ }
+
+ // Special case: If a title-case character maps to itself, we may still have to store it,
+ // if there is a non-trivial upper-case mapping for it
+ if ($type == 'title' && $code == $caseCodes[0]
+ && ($data->caseMaps['upper'][$code] ?? $code) != $code) {
+ $data->caseMaps['title'][$code] = $code;
+ }
+ return;
+ }
+
+ if (count($caseCodes) > 3) {
+ throw new Exception("Special case mapping with more than 3 code points");
+ }
+
+ $data->caseMaps[$type][$code] = array_merge([$simpleCaseCode], $caseCodes);
+}
+
+function parseSpecialCasing(UnicodeData $data, string $input) : void {
+ foreach (parseDataFile($input) as $fields) {
+ if (count($fields) != 5 && count($fields) != 6) {
+ throw new Exception("Line does not contain 5 or 6 fields");
+ }
+
+ $code = intval($fields[0], 16);
+ $lower = parseCodes($fields[1]);
+ $title = parseCodes($fields[2]);
+ $upper = parseCodes($fields[3]);
+
+ $cond = $fields[4];
+ if ($cond) {
+ // Only use unconditional mappings
+ continue;
+ }
+
+ addSpecialCasing($data, 'lower', $code, $lower);
+ addSpecialCasing($data, 'upper', $code, $upper);
+
+ // Should happen last
+ addSpecialCasing($data, 'title', $code, $title);
+ }
+}
+
+function parseDerivedCoreProperties(UnicodeData $data, string $input) : void {
+ foreach (parseDataFile($input) as $fields) {
+ if (count($fields) != 2) {
+ throw new Exception("Line does not contain 2 fields");
+ }
+
+ $property = $fields[1];
+ if ($property != 'Cased' && $property != 'Case_Ignorable') {
+ continue;
+ }
+
+ $range = explode('..', $fields[0]);
+ if (count($range) == 2) {
+ $data->addPropRange(intval($range[0], 16), intval($range[1], 16), $property);
+ } else if (count($range) == 1) {
+ $data->addProp(intval($range[0], 16), $property);
+ } else {
+ throw new Exception("Invalid range");
+ }
+ }
+}
+
+function formatArray(array $values, int $width, string $format) : string {
+ $result = '';
+ $i = 0;
+ $c = count($values);
+ for ($i = 0; $i < $c; $i++) {
+ if ($i != 0) {
+ $result .= ',';
+ }
+
+ $result .= $i % $width == 0 ? "\n\t" : " ";
+ $result .= sprintf($format, $values[$i]);
+ }
+ return $result;
+}
+
+function formatShortHexArray(array $values, int $width) : string {
+ return formatArray($values, $width, "0x%04x");
+}
+function formatShortDecArray(array $values, int $width) : string {
+ return formatArray($values, $width, "% 5d");
+}
+function formatIntArray(array $values, int $width) : string {
+ return formatArray($values, $width, "0x%08x");
+}
+
+function generatePropData(UnicodeData $data) {
+ $data->compactPropRanges();
+
+ $propOffsets = [];
+ $idx = 0;
+ foreach ($data->propRanges as $ranges) {
+ $num = count($ranges);
+ $propOffsets[] = $num ? $idx : 0xffff;
+ $idx += 2*$num;
+ }
+
+ // Add sentinel for binary search
+ $propOffsets[] = $idx;
+
+ // TODO ucgendat.c pads the prop offsets to the next multiple of 4
+ // for rather debious reasons of alignment. This should probably be
+ // dropped
+ while (count($propOffsets) % 4 != 0) {
+ $propOffsets[] = 0;
+ }
+
+ $totalRanges = $idx;
+
+ $result = "";
+ $result .= "static const unsigned short _ucprop_size = $data->numProps;\n\n";
+ $result .= "static const unsigned short _ucprop_offsets[] = {";
+ $result .= formatShortHexArray($propOffsets, 8);
+ $result .= "\n};\n\n";
+
+ $values = [];
+ foreach ($data->propRanges as $ranges) {
+ foreach ($ranges as $range) {
+ $values[] = $range->start;
+ $values[] = $range->end;
+ }
+ }
+
+ $result .= "static const unsigned int _ucprop_ranges[] = {";
+ $result .= formatIntArray($values, 4);
+ $result .= "\n};\n\n";
+ return $result;
+}
+
+function flatten(array $array) {
+ $result = [];
+ foreach ($array as $arr) {
+ foreach ($arr as $v) {
+ $result[] = $v;
+ }
+ }
+ return $result;
+}
+
+function prepareCaseData(UnicodeData $data) {
+ // Don't store titlecase if it's the same as uppercase
+ foreach ($data->caseMaps['title'] as $code => $titleCode) {
+ if ($titleCode == ($data->caseMaps['upper'][$code] ?? $code)) {
+ unset($data->caseMaps['title'][$code]);
+ }
+ }
+
+ // Store full (multi-char) case mappings in a separate table and only
+ // store an index into it
+ foreach ($data->caseMaps as $type => $caseMap) {
+ foreach ($caseMap as $code => $caseCode) {
+ if (is_array($caseCode)) {
+ // -1 because the first entry is the simple case mapping
+ $len = count($caseCode) - 1;
+ $idx = count($data->extraCaseData);
+ $data->caseMaps[$type][$code] = ($len << 24) | $idx;
+
+ foreach ($caseCode as $c) {
+ $data->extraCaseData[] = $c;
+ }
+ }
+ }
+ }
+}
+
+function generateCaseMPH(string $name, array $map) {
+ $prefix = "_uccase_" . $name;
+ list($gTable, $table) = generateMPH($map, $fast = false);
+ echo "$name: n=", count($table), ", g=", count($gTable), "\n";
+
+ $result = "";
+ $result .= "static const unsigned {$prefix}_g_size = " . count($gTable) . ";\n";
+ $result .= "static const short {$prefix}_g[] = {";
+ $result .= formatShortDecArray($gTable, 8);
+ $result .= "\n};\n\n";
+ $result .= "static const unsigned {$prefix}_table_size = " . count($table) . ";\n";
+ $result .= "static const unsigned {$prefix}_table[] = {";
+ $result .= formatIntArray(flatten($table), 4);
+ $result .= "\n};\n\n";
+ return $result;
+}
+
+function generateCaseData(UnicodeData $data) {
+ prepareCaseData($data);
+
+ $result = "";
+ $result .= generateCaseMPH('upper', $data->caseMaps['upper']);
+ $result .= generateCaseMPH('lower', $data->caseMaps['lower']);
+ $result .= generateCaseMPH('title', $data->caseMaps['title']);
+ $result .= generateCaseMPH('fold', $data->caseMaps['fold']);
+ $result .= "static const unsigned _uccase_extra_table[] = {";
+ $result .= formatIntArray($data->extraCaseData, 4);
+ $result .= "\n};\n\n";
+ return $result;
+}
+
+function generateData(UnicodeData $data) {
+ $result = <<<'HEADER'
+/* This file was generated from a modified version UCData's ucgendat.
+ *
+ * DO NOT EDIT THIS FILE!
+ *
+ * Instead, compile ucgendat.c (bundled with PHP in ext/mbstring), download
+ * the appropriate UnicodeData-x.x.x.txt and CompositionExclusions-x.x.x.txt
+ * files from http://www.unicode.org/Public/ and run this program.
+ *
+ * More information can be found in the UCData package. Unfortunately,
+ * the project's page doesn't seem to be live anymore, so you can use
+ * OpenLDAPs modified copy (look in libraries/liblunicode/ucdata) */
+HEADER;
+ $result .= "\n\n" . generatePropData($data);
+ $result .= generateCaseData($data);
+
+ return $result;
+}
+
+/*
+ * Minimal Perfect Hash Generation
+ *
+ * Based on "Hash, displace, and compress" algorithm due to
+ * Belazzougui, Botelho and Dietzfelbinger.
+ *
+ * Hash function based on https://stackoverflow.com/a/12996028/385378.
+ * MPH implementation based on http://stevehanov.ca/blog/index.php?id=119.
+ */
+
+function hashInt(int $d, int $x) {
+ $x ^= $d;
+ $x = (($x >> 16) ^ $x) * 0x45d9f3b;
+ return $x & 0xffffffff;
+}
+
+function tryGenerateMPH(array $map, int $gSize) {
+ $tableSize = count($map);
+ $table = [];
+ $gTable = array_fill(0, $gSize, 0x7fff);
+ $buckets = [];
+
+ foreach ($map as $k => $v) {
+ $h = hashInt(0, $k) % $gSize;
+ $buckets[$h][] = [$k, $v];
+ }
+
+ // Sort by descending number of collisions
+ usort($buckets, function ($b1, $b2) {
+ return -(count($b1) <=> count($b2));
+ });
+
+ foreach ($buckets as $bucket) {
+ $collisions = count($bucket);
+ if ($collisions <= 1) {
+ continue;
+ }
+
+ // Try values of $d until all elements placed in different slots
+ $d = 1;
+ $i = 0;
+ $used = [];
+ while ($i < $collisions) {
+ if ($d > 0x7fff) {
+ return [];
+ }
+
+ list($k) = $bucket[$i];
+ $slot = hashInt($d, $k) % $tableSize;
+ if (isset($table[$slot]) || isset($used[$slot])) {
+ $d++;
+ $i = 0;
+ $used = [];
+ } else {
+ $i++;
+ $used[$slot] = true;
+ }
+ }
+
+ $g = hashInt(0, $bucket[0][0]) % $gSize;
+ $gTable[$g] = $d;
+ foreach ($bucket as $elem) {
+ $table[hashInt($d, $elem[0]) % $tableSize] = $elem;
+ }
+ }
+
+ $freeSlots = [];
+ for ($i = 0; $i < $tableSize; $i++) {
+ if (!isset($table[$i])) {
+ $freeSlots[] = $i;
+ }
+ }
+
+ // For buckets with only one element, we directly store the index
+ $freeIdx = 0;
+ foreach ($buckets as $bucket) {
+ if (count($bucket) != 1) {
+ continue;
+ }
+
+ $elem = $bucket[0];
+ $slot = $freeSlots[$freeIdx++];
+ $table[$slot] = $elem;
+
+ $g = hashInt(0, $elem[0]) % $gSize;
+ $gTable[$g] = -$slot;
+ }
+
+ ksort($gTable);
+ ksort($table);
+
+ return [$gTable, $table];
+}
+
+function generateMPH(array $map, bool $fast) {
+ if ($fast) {
+ // Check size starting lambda=5.0 in 0.5 increments
+ for ($lambda = 5.0;; $lambda -= 0.5) {
+ $m = (int) (count($map) / $lambda);
+ $tmpMph = tryGenerateMPH($map, $m);
+ if (!empty($tmpMph)) {
+ $mph = $tmpMph;
+ break;
+ }
+ }
+ } else {
+ // Check all sizes starting lambda=7.0
+ $m = (int) (count($map) / 7.0);
+ for (;; $m++) {
+ $tmpMph = tryGenerateMPH($map, $m);
+ if (!empty($tmpMph)) {
+ $mph = $tmpMph;
+ break;
+ }
+ }
+ }
+
+ return $mph;
+}
diff --git a/ext/mbstring/ucgendat/uctest.php b/ext/mbstring/ucgendat/uctest.php
new file mode 100644
index 0000000000..62a4e71c5e
--- /dev/null
+++ b/ext/mbstring/ucgendat/uctest.php
@@ -0,0 +1,131 @@
+<?php error_reporting(E_ALL);
+
+$dir = __DIR__;
+$unicodeDataFile = $dir . '/UnicodeData.txt';
+$caseFoldingFile = $dir . '/CaseFolding.txt';
+$specialCasingFile = $dir . '/SpecialCasing.txt';
+
+$files = [$unicodeDataFile, $caseFoldingFile, $specialCasingFile];
+foreach ($files as $file) {
+ if (!file_exists($file)) {
+ echo "File $file does not exist.\n";
+ return;
+ }
+}
+
+testUnicodeData(file_get_contents($unicodeDataFile));
+testCaseFolding(file_get_contents($caseFoldingFile));
+testSpecialCasing(file_get_contents($specialCasingFile));
+
+function parseDataFile(string $input) {
+ $lines = explode("\n", $input);
+ foreach ($lines as $line) {
+ // Strip comments
+ if (false !== $hashPos = strpos($line, '#')) {
+ $line = substr($line, 0, $hashPos);
+ }
+
+ // Skip empty lines
+ $line = trim($line);
+ if ($line === '') {
+ continue;
+ }
+
+ $fields = array_map('trim', explode(';', $line));
+ yield $fields;
+ }
+}
+
+function parseCodes(string $strCodes) : array {
+ $codes = [];
+ foreach (explode(' ', $strCodes) as $strCode) {
+ $codes[] = intval($strCode, 16);
+ }
+ return $codes;
+}
+
+function testCaseMap($type, int $origCode, array $newCodes) {
+ $origChar = mb_chr($origCode);
+ $newStr = "";
+ foreach ($newCodes as $newCode) {
+ $newStr .= mb_chr($newCode);
+ }
+
+ $mbNewStr = mb_convert_case($origChar, $type);
+ if ($mbNewStr !== $newStr) {
+ echo "$type: $mbNewStr != $newStr\n";
+ }
+}
+
+function testSimpleCaseMap($type, int $origCode, int $newCode) {
+ if ($newCode) {
+ testCaseMap($type, $origCode, [$newCode]);
+ } else {
+ testCaseMap($type, $origCode, [$origCode]);
+ }
+}
+
+function testUnicodeData(string $input) {
+ $uppers = [];
+ $folds = [];
+
+ foreach (parseDataFile($input) as $fields) {
+ assert(count($fields) == 15);
+
+ $code = intval($fields[0], 16);
+ $upperCase = intval($fields[12], 16);
+ $lowerCase = intval($fields[13], 16);
+ $titleCase = intval($fields[14], 16);
+ testSimpleCaseMap(MB_CASE_UPPER_SIMPLE, $code, $upperCase);
+ testSimpleCaseMap(MB_CASE_LOWER_SIMPLE, $code, $lowerCase);
+
+ // Unfortunately MB_CASE_TITLE does not actually return the title case, even when passed
+ // only a single character. It does ad-hoc magic based on the character class, so that
+ // certain characters, such as roman numerals or circled characters will not be
+ // title-cased.
+ //testSimpleCaseMap(MB_CASE_TITLE_SIMPLE, $code, $titleCase ?: $upperCase);
+
+ $chr = mb_chr($code);
+ $upper = mb_strtoupper($chr);
+ $uppers[$upper][] = $chr;
+ $fold = mb_convert_case($chr, 3);
+ $folds[$fold][] = $chr;
+ }
+}
+
+function testCaseFolding(string $input) {
+ foreach (parseDataFile($input) as $fields) {
+ assert(count($fields) == 4);
+
+ $code = intval($fields[0], 16);
+ $status = $fields[1];
+ if ($status == 'C' || $status == 'S') {
+ $foldCode = intval($fields[2], 16);
+ testSimpleCaseMap(MB_CASE_FOLD_SIMPLE, $code, $foldCode);
+ } else if ($status == 'F') {
+ $foldCodes = parseCodes($fields[2]);
+ testCaseMap(MB_CASE_FOLD, $code, $foldCodes);
+ }
+ }
+}
+
+function testSpecialCasing(string $input) {
+ foreach (parseDataFile($input) as $fields) {
+ assert(count($fields) >= 5);
+
+ $code = intval($fields[0], 16);
+ $lower = parseCodes($fields[1]);
+ $title = parseCodes($fields[2]);
+ $upper = parseCodes($fields[3]);
+
+ $cond = $fields[4];
+ if ($cond) {
+ // We don't support conditional mappings
+ continue;
+ }
+
+ testCaseMap(MB_CASE_LOWER, $code, $lower);
+ testCaseMap(MB_CASE_UPPER, $code, $upper);
+ testCaseMap(MB_CASE_TITLE, $code, $title);
+ }
+}
diff --git a/ext/mbstring/unicode_data.h b/ext/mbstring/unicode_data.h
index cad451c943..9e40e4c922 100644
--- a/ext/mbstring/unicode_data.h
+++ b/ext/mbstring/unicode_data.h
@@ -10,16 +10,15 @@
* the project's page doesn't seem to be live anymore, so you can use
* OpenLDAPs modified copy (look in libraries/liblunicode/ucdata) */
-static const unsigned short _ucprop_size = 50;
+static const unsigned short _ucprop_size = 44;
static const unsigned short _ucprop_offsets[] = {
0x0000, 0x025a, 0x039a, 0x03a4, 0x0412, 0x042a, 0x04a2, 0x04b0,
0x04b2, 0x04b4, 0x04b8, 0x04dc, 0x04de, 0xffff, 0x04e4, 0x09ca,
- 0x0ebc, 0x0ed0, 0x0f42, 0x12de, 0x12ea, 0x130c, 0x13a2, 0x1432,
- 0x1584, 0x1604, 0x1626, 0x1660, 0x17ba, 0x1b4a, 0x1bca, 0x1be2,
- 0x1bf4, 0x1c20, 0x1c2c, 0x1c46, 0x1c50, 0x1c56, 0x1c64, 0x200a,
- 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x21d6, 0x26ee,
- 0x2704, 0x2718, 0x278a, 0x0000
+ 0x0ebc, 0x0ed0, 0x0f42, 0x12d8, 0x12e4, 0x1306, 0x139c, 0x142c,
+ 0x157e, 0x15fe, 0x1620, 0x165a, 0x17b4, 0x1cea, 0x1d6a, 0x1d82,
+ 0x1d94, 0x1dc0, 0x1dcc, 0x1de6, 0x1df0, 0x1df6, 0x1e04, 0x21aa,
+ 0x21c0, 0x21d4, 0x2246, 0x2354, 0x264e, 0x0000, 0x0000, 0x0000
};
static const unsigned int _ucprop_ranges[] = {
@@ -334,7 +333,7 @@ static const unsigned int _ucprop_ranges[] = {
0x0000fff9, 0x0000fffb, 0x000110bd, 0x000110bd,
0x0001bca0, 0x0001bca3, 0x0001d173, 0x0001d17a,
0x000e0001, 0x000e0001, 0x000e0020, 0x000e007f,
- 0x00010000, 0x0010ffff, 0x0000e000, 0x0000f8ff,
+ 0x0000d800, 0x0000dfff, 0x0000e000, 0x0000f8ff,
0x000f0000, 0x000ffffd, 0x00100000, 0x0010fffd,
0x00000041, 0x0000005a, 0x000000c0, 0x000000d6,
0x000000d8, 0x000000de, 0x00000100, 0x00000100,
@@ -1110,32 +1109,33 @@ static const unsigned int _ucprop_ranges[] = {
0x000030a1, 0x000030fa, 0x000030ff, 0x000030ff,
0x00003105, 0x0000312e, 0x00003131, 0x0000318e,
0x000031a0, 0x000031ba, 0x000031f0, 0x000031ff,
- 0x00003400, 0x00004db5, 0x00004e00, 0x0000a014,
- 0x0000a016, 0x0000a48c, 0x0000a4d0, 0x0000a4f7,
- 0x0000a500, 0x0000a60b, 0x0000a610, 0x0000a61f,
- 0x0000a62a, 0x0000a62b, 0x0000a66e, 0x0000a66e,
- 0x0000a6a0, 0x0000a6e5, 0x0000a78f, 0x0000a78f,
- 0x0000a7f7, 0x0000a7f7, 0x0000a7fb, 0x0000a801,
- 0x0000a803, 0x0000a805, 0x0000a807, 0x0000a80a,
- 0x0000a80c, 0x0000a822, 0x0000a840, 0x0000a873,
- 0x0000a882, 0x0000a8b3, 0x0000a8f2, 0x0000a8f7,
- 0x0000a8fb, 0x0000a8fb, 0x0000a8fd, 0x0000a8fd,
- 0x0000a90a, 0x0000a925, 0x0000a930, 0x0000a946,
- 0x0000a960, 0x0000a97c, 0x0000a984, 0x0000a9b2,
- 0x0000a9e0, 0x0000a9e4, 0x0000a9e7, 0x0000a9ef,
- 0x0000a9fa, 0x0000a9fe, 0x0000aa00, 0x0000aa28,
- 0x0000aa40, 0x0000aa42, 0x0000aa44, 0x0000aa4b,
- 0x0000aa60, 0x0000aa6f, 0x0000aa71, 0x0000aa76,
- 0x0000aa7a, 0x0000aa7a, 0x0000aa7e, 0x0000aaaf,
- 0x0000aab1, 0x0000aab1, 0x0000aab5, 0x0000aab6,
- 0x0000aab9, 0x0000aabd, 0x0000aac0, 0x0000aac0,
- 0x0000aac2, 0x0000aac2, 0x0000aadb, 0x0000aadc,
- 0x0000aae0, 0x0000aaea, 0x0000aaf2, 0x0000aaf2,
- 0x0000ab01, 0x0000ab06, 0x0000ab09, 0x0000ab0e,
- 0x0000ab11, 0x0000ab16, 0x0000ab20, 0x0000ab26,
- 0x0000ab28, 0x0000ab2e, 0x0000abc0, 0x0000abe2,
- 0x0000ac00, 0x0000d7a3, 0x0000d7b0, 0x0000d7c6,
- 0x0000d7cb, 0x0000d7fb, 0x0000f900, 0x0000faff,
+ 0x00003400, 0x00004db5, 0x00004e00, 0x00009fea,
+ 0x0000a000, 0x0000a014, 0x0000a016, 0x0000a48c,
+ 0x0000a4d0, 0x0000a4f7, 0x0000a500, 0x0000a60b,
+ 0x0000a610, 0x0000a61f, 0x0000a62a, 0x0000a62b,
+ 0x0000a66e, 0x0000a66e, 0x0000a6a0, 0x0000a6e5,
+ 0x0000a78f, 0x0000a78f, 0x0000a7f7, 0x0000a7f7,
+ 0x0000a7fb, 0x0000a801, 0x0000a803, 0x0000a805,
+ 0x0000a807, 0x0000a80a, 0x0000a80c, 0x0000a822,
+ 0x0000a840, 0x0000a873, 0x0000a882, 0x0000a8b3,
+ 0x0000a8f2, 0x0000a8f7, 0x0000a8fb, 0x0000a8fb,
+ 0x0000a8fd, 0x0000a8fd, 0x0000a90a, 0x0000a925,
+ 0x0000a930, 0x0000a946, 0x0000a960, 0x0000a97c,
+ 0x0000a984, 0x0000a9b2, 0x0000a9e0, 0x0000a9e4,
+ 0x0000a9e7, 0x0000a9ef, 0x0000a9fa, 0x0000a9fe,
+ 0x0000aa00, 0x0000aa28, 0x0000aa40, 0x0000aa42,
+ 0x0000aa44, 0x0000aa4b, 0x0000aa60, 0x0000aa6f,
+ 0x0000aa71, 0x0000aa76, 0x0000aa7a, 0x0000aa7a,
+ 0x0000aa7e, 0x0000aaaf, 0x0000aab1, 0x0000aab1,
+ 0x0000aab5, 0x0000aab6, 0x0000aab9, 0x0000aabd,
+ 0x0000aac0, 0x0000aac0, 0x0000aac2, 0x0000aac2,
+ 0x0000aadb, 0x0000aadc, 0x0000aae0, 0x0000aaea,
+ 0x0000aaf2, 0x0000aaf2, 0x0000ab01, 0x0000ab06,
+ 0x0000ab09, 0x0000ab0e, 0x0000ab11, 0x0000ab16,
+ 0x0000ab20, 0x0000ab26, 0x0000ab28, 0x0000ab2e,
+ 0x0000abc0, 0x0000abe2, 0x0000ac00, 0x0000d7a3,
+ 0x0000d7b0, 0x0000d7c6, 0x0000d7cb, 0x0000d7fb,
+ 0x0000f900, 0x0000fa6d, 0x0000fa70, 0x0000fad9,
0x0000fb1d, 0x0000fb1d, 0x0000fb1f, 0x0000fb28,
0x0000fb2a, 0x0000fb36, 0x0000fb38, 0x0000fb3c,
0x0000fb3e, 0x0000fb3e, 0x0000fb40, 0x0000fb41,
@@ -1204,532 +1204,530 @@ static const unsigned int _ucprop_ranges[] = {
0x00016ad0, 0x00016aed, 0x00016b00, 0x00016b2f,
0x00016b63, 0x00016b77, 0x00016b7d, 0x00016b8f,
0x00016f00, 0x00016f44, 0x00016f50, 0x00016f50,
- 0x00017000, 0x00017000, 0x000187ec, 0x000187ec,
- 0x00018800, 0x00018af2, 0x0001b000, 0x0001b11e,
- 0x0001b170, 0x0001b2fb, 0x0001bc00, 0x0001bc6a,
- 0x0001bc70, 0x0001bc7c, 0x0001bc80, 0x0001bc88,
- 0x0001bc90, 0x0001bc99, 0x0001e800, 0x0001e8c4,
- 0x0001ee00, 0x0001ee03, 0x0001ee05, 0x0001ee1f,
- 0x0001ee21, 0x0001ee22, 0x0001ee24, 0x0001ee24,
- 0x0001ee27, 0x0001ee27, 0x0001ee29, 0x0001ee32,
- 0x0001ee34, 0x0001ee37, 0x0001ee39, 0x0001ee39,
- 0x0001ee3b, 0x0001ee3b, 0x0001ee42, 0x0001ee42,
- 0x0001ee47, 0x0001ee47, 0x0001ee49, 0x0001ee49,
- 0x0001ee4b, 0x0001ee4b, 0x0001ee4d, 0x0001ee4f,
- 0x0001ee51, 0x0001ee52, 0x0001ee54, 0x0001ee54,
- 0x0001ee57, 0x0001ee57, 0x0001ee59, 0x0001ee59,
- 0x0001ee5b, 0x0001ee5b, 0x0001ee5d, 0x0001ee5d,
- 0x0001ee5f, 0x0001ee5f, 0x0001ee61, 0x0001ee62,
- 0x0001ee64, 0x0001ee64, 0x0001ee67, 0x0001ee6a,
- 0x0001ee6c, 0x0001ee72, 0x0001ee74, 0x0001ee77,
- 0x0001ee79, 0x0001ee7c, 0x0001ee7e, 0x0001ee7e,
- 0x0001ee80, 0x0001ee89, 0x0001ee8b, 0x0001ee9b,
- 0x0001eea1, 0x0001eea3, 0x0001eea5, 0x0001eea9,
- 0x0001eeab, 0x0001eebb, 0x00020000, 0x0002a6d6,
- 0x0002a700, 0x0002a700, 0x0002b734, 0x0002b734,
- 0x0002b740, 0x0002b740, 0x0002b81d, 0x0002b81d,
- 0x0002b820, 0x0002b820, 0x0002cea1, 0x0002cea1,
- 0x0002ceb0, 0x0002ceb0, 0x0002ebe0, 0x0002ebe0,
- 0x0002f800, 0x0002fa1d, 0x0000005f, 0x0000005f,
- 0x0000203f, 0x00002040, 0x00002054, 0x00002054,
- 0x0000fe33, 0x0000fe34, 0x0000fe4d, 0x0000fe4f,
- 0x0000ff3f, 0x0000ff3f, 0x0000002d, 0x0000002d,
- 0x0000058a, 0x0000058a, 0x000005be, 0x000005be,
- 0x00001400, 0x00001400, 0x00001806, 0x00001806,
- 0x00002010, 0x00002015, 0x00002e17, 0x00002e17,
- 0x00002e1a, 0x00002e1a, 0x00002e3a, 0x00002e3b,
- 0x00002e40, 0x00002e40, 0x0000301c, 0x0000301c,
- 0x00003030, 0x00003030, 0x000030a0, 0x000030a0,
- 0x0000fe31, 0x0000fe32, 0x0000fe58, 0x0000fe58,
- 0x0000fe63, 0x0000fe63, 0x0000ff0d, 0x0000ff0d,
- 0x00000028, 0x00000028, 0x0000005b, 0x0000005b,
- 0x0000007b, 0x0000007b, 0x00000f3a, 0x00000f3a,
- 0x00000f3c, 0x00000f3c, 0x0000169b, 0x0000169b,
- 0x0000201a, 0x0000201a, 0x0000201e, 0x0000201e,
- 0x00002045, 0x00002045, 0x0000207d, 0x0000207d,
- 0x0000208d, 0x0000208d, 0x00002308, 0x00002308,
- 0x0000230a, 0x0000230a, 0x00002329, 0x00002329,
- 0x00002768, 0x00002768, 0x0000276a, 0x0000276a,
- 0x0000276c, 0x0000276c, 0x0000276e, 0x0000276e,
- 0x00002770, 0x00002770, 0x00002772, 0x00002772,
- 0x00002774, 0x00002774, 0x000027c5, 0x000027c5,
- 0x000027e6, 0x000027e6, 0x000027e8, 0x000027e8,
- 0x000027ea, 0x000027ea, 0x000027ec, 0x000027ec,
- 0x000027ee, 0x000027ee, 0x00002983, 0x00002983,
- 0x00002985, 0x00002985, 0x00002987, 0x00002987,
- 0x00002989, 0x00002989, 0x0000298b, 0x0000298b,
- 0x0000298d, 0x0000298d, 0x0000298f, 0x0000298f,
- 0x00002991, 0x00002991, 0x00002993, 0x00002993,
- 0x00002995, 0x00002995, 0x00002997, 0x00002997,
- 0x000029d8, 0x000029d8, 0x000029da, 0x000029da,
- 0x000029fc, 0x000029fc, 0x00002e22, 0x00002e22,
- 0x00002e24, 0x00002e24, 0x00002e26, 0x00002e26,
- 0x00002e28, 0x00002e28, 0x00002e42, 0x00002e42,
- 0x00003008, 0x00003008, 0x0000300a, 0x0000300a,
- 0x0000300c, 0x0000300c, 0x0000300e, 0x0000300e,
- 0x00003010, 0x00003010, 0x00003014, 0x00003014,
- 0x00003016, 0x00003016, 0x00003018, 0x00003018,
- 0x0000301a, 0x0000301a, 0x0000301d, 0x0000301d,
- 0x0000fd3f, 0x0000fd3f, 0x0000fe17, 0x0000fe17,
- 0x0000fe35, 0x0000fe35, 0x0000fe37, 0x0000fe37,
- 0x0000fe39, 0x0000fe39, 0x0000fe3b, 0x0000fe3b,
- 0x0000fe3d, 0x0000fe3d, 0x0000fe3f, 0x0000fe3f,
- 0x0000fe41, 0x0000fe41, 0x0000fe43, 0x0000fe43,
- 0x0000fe47, 0x0000fe47, 0x0000fe59, 0x0000fe59,
- 0x0000fe5b, 0x0000fe5b, 0x0000fe5d, 0x0000fe5d,
- 0x0000ff08, 0x0000ff08, 0x0000ff3b, 0x0000ff3b,
- 0x0000ff5b, 0x0000ff5b, 0x0000ff5f, 0x0000ff5f,
- 0x0000ff62, 0x0000ff62, 0x00000029, 0x00000029,
- 0x0000005d, 0x0000005d, 0x0000007d, 0x0000007d,
- 0x00000f3b, 0x00000f3b, 0x00000f3d, 0x00000f3d,
- 0x0000169c, 0x0000169c, 0x00002046, 0x00002046,
- 0x0000207e, 0x0000207e, 0x0000208e, 0x0000208e,
- 0x00002309, 0x00002309, 0x0000230b, 0x0000230b,
- 0x0000232a, 0x0000232a, 0x00002769, 0x00002769,
- 0x0000276b, 0x0000276b, 0x0000276d, 0x0000276d,
- 0x0000276f, 0x0000276f, 0x00002771, 0x00002771,
- 0x00002773, 0x00002773, 0x00002775, 0x00002775,
- 0x000027c6, 0x000027c6, 0x000027e7, 0x000027e7,
- 0x000027e9, 0x000027e9, 0x000027eb, 0x000027eb,
- 0x000027ed, 0x000027ed, 0x000027ef, 0x000027ef,
- 0x00002984, 0x00002984, 0x00002986, 0x00002986,
- 0x00002988, 0x00002988, 0x0000298a, 0x0000298a,
- 0x0000298c, 0x0000298c, 0x0000298e, 0x0000298e,
- 0x00002990, 0x00002990, 0x00002992, 0x00002992,
- 0x00002994, 0x00002994, 0x00002996, 0x00002996,
- 0x00002998, 0x00002998, 0x000029d9, 0x000029d9,
- 0x000029db, 0x000029db, 0x000029fd, 0x000029fd,
- 0x00002e23, 0x00002e23, 0x00002e25, 0x00002e25,
- 0x00002e27, 0x00002e27, 0x00002e29, 0x00002e29,
- 0x00003009, 0x00003009, 0x0000300b, 0x0000300b,
- 0x0000300d, 0x0000300d, 0x0000300f, 0x0000300f,
- 0x00003011, 0x00003011, 0x00003015, 0x00003015,
- 0x00003017, 0x00003017, 0x00003019, 0x00003019,
- 0x0000301b, 0x0000301b, 0x0000301e, 0x0000301f,
- 0x0000fd3e, 0x0000fd3e, 0x0000fe18, 0x0000fe18,
- 0x0000fe36, 0x0000fe36, 0x0000fe38, 0x0000fe38,
- 0x0000fe3a, 0x0000fe3a, 0x0000fe3c, 0x0000fe3c,
- 0x0000fe3e, 0x0000fe3e, 0x0000fe40, 0x0000fe40,
- 0x0000fe42, 0x0000fe42, 0x0000fe44, 0x0000fe44,
- 0x0000fe48, 0x0000fe48, 0x0000fe5a, 0x0000fe5a,
- 0x0000fe5c, 0x0000fe5c, 0x0000fe5e, 0x0000fe5e,
- 0x0000ff09, 0x0000ff09, 0x0000ff3d, 0x0000ff3d,
- 0x0000ff5d, 0x0000ff5d, 0x0000ff60, 0x0000ff60,
- 0x0000ff63, 0x0000ff63, 0x00000021, 0x00000023,
- 0x00000025, 0x00000027, 0x0000002a, 0x0000002a,
- 0x0000002c, 0x0000002c, 0x0000002e, 0x0000002f,
- 0x0000003a, 0x0000003b, 0x0000003f, 0x00000040,
- 0x0000005c, 0x0000005c, 0x000000a1, 0x000000a1,
- 0x000000a7, 0x000000a7, 0x000000b6, 0x000000b7,
- 0x000000bf, 0x000000bf, 0x0000037e, 0x0000037e,
- 0x00000387, 0x00000387, 0x0000055a, 0x0000055f,
- 0x00000589, 0x00000589, 0x000005c0, 0x000005c0,
- 0x000005c3, 0x000005c3, 0x000005c6, 0x000005c6,
- 0x000005f3, 0x000005f4, 0x00000609, 0x0000060a,
- 0x0000060c, 0x0000060d, 0x0000061b, 0x0000061b,
- 0x0000061e, 0x0000061f, 0x0000066a, 0x0000066d,
- 0x000006d4, 0x000006d4, 0x00000700, 0x0000070d,
- 0x000007f7, 0x000007f9, 0x00000830, 0x0000083e,
- 0x0000085e, 0x0000085e, 0x00000964, 0x00000965,
- 0x00000970, 0x00000970, 0x000009fd, 0x000009fd,
- 0x00000af0, 0x00000af0, 0x00000df4, 0x00000df4,
- 0x00000e4f, 0x00000e4f, 0x00000e5a, 0x00000e5b,
- 0x00000f04, 0x00000f12, 0x00000f14, 0x00000f14,
- 0x00000f85, 0x00000f85, 0x00000fd0, 0x00000fd4,
- 0x00000fd9, 0x00000fda, 0x0000104a, 0x0000104f,
- 0x000010fb, 0x000010fb, 0x00001360, 0x00001368,
- 0x0000166d, 0x0000166e, 0x000016eb, 0x000016ed,
- 0x00001735, 0x00001736, 0x000017d4, 0x000017d6,
- 0x000017d8, 0x000017da, 0x00001800, 0x00001805,
- 0x00001807, 0x0000180a, 0x00001944, 0x00001945,
- 0x00001a1e, 0x00001a1f, 0x00001aa0, 0x00001aa6,
- 0x00001aa8, 0x00001aad, 0x00001b5a, 0x00001b60,
- 0x00001bfc, 0x00001bff, 0x00001c3b, 0x00001c3f,
- 0x00001c7e, 0x00001c7f, 0x00001cc0, 0x00001cc7,
- 0x00001cd3, 0x00001cd3, 0x00002016, 0x00002017,
- 0x00002020, 0x00002027, 0x00002030, 0x00002038,
- 0x0000203b, 0x0000203e, 0x00002041, 0x00002043,
- 0x00002047, 0x00002051, 0x00002053, 0x00002053,
- 0x00002055, 0x0000205e, 0x00002cf9, 0x00002cfc,
- 0x00002cfe, 0x00002cff, 0x00002d70, 0x00002d70,
- 0x00002e00, 0x00002e01, 0x00002e06, 0x00002e08,
- 0x00002e0b, 0x00002e0b, 0x00002e0e, 0x00002e16,
- 0x00002e18, 0x00002e19, 0x00002e1b, 0x00002e1b,
- 0x00002e1e, 0x00002e1f, 0x00002e2a, 0x00002e2e,
- 0x00002e30, 0x00002e39, 0x00002e3c, 0x00002e3f,
- 0x00002e41, 0x00002e41, 0x00002e43, 0x00002e49,
- 0x00003001, 0x00003003, 0x0000303d, 0x0000303d,
- 0x000030fb, 0x000030fb, 0x0000a4fe, 0x0000a4ff,
- 0x0000a60d, 0x0000a60f, 0x0000a673, 0x0000a673,
- 0x0000a67e, 0x0000a67e, 0x0000a6f2, 0x0000a6f7,
- 0x0000a874, 0x0000a877, 0x0000a8ce, 0x0000a8cf,
- 0x0000a8f8, 0x0000a8fa, 0x0000a8fc, 0x0000a8fc,
- 0x0000a92e, 0x0000a92f, 0x0000a95f, 0x0000a95f,
- 0x0000a9c1, 0x0000a9cd, 0x0000a9de, 0x0000a9df,
- 0x0000aa5c, 0x0000aa5f, 0x0000aade, 0x0000aadf,
- 0x0000aaf0, 0x0000aaf1, 0x0000abeb, 0x0000abeb,
- 0x0000fe10, 0x0000fe16, 0x0000fe19, 0x0000fe19,
- 0x0000fe30, 0x0000fe30, 0x0000fe45, 0x0000fe46,
- 0x0000fe49, 0x0000fe4c, 0x0000fe50, 0x0000fe52,
- 0x0000fe54, 0x0000fe57, 0x0000fe5f, 0x0000fe61,
- 0x0000fe68, 0x0000fe68, 0x0000fe6a, 0x0000fe6b,
- 0x0000ff01, 0x0000ff03, 0x0000ff05, 0x0000ff07,
- 0x0000ff0a, 0x0000ff0a, 0x0000ff0c, 0x0000ff0c,
- 0x0000ff0e, 0x0000ff0f, 0x0000ff1a, 0x0000ff1b,
- 0x0000ff1f, 0x0000ff20, 0x0000ff3c, 0x0000ff3c,
- 0x0000ff61, 0x0000ff61, 0x0000ff64, 0x0000ff65,
- 0x00010100, 0x00010102, 0x0001039f, 0x0001039f,
- 0x000103d0, 0x000103d0, 0x0001056f, 0x0001056f,
- 0x00010857, 0x00010857, 0x0001091f, 0x0001091f,
- 0x0001093f, 0x0001093f, 0x00010a50, 0x00010a58,
- 0x00010a7f, 0x00010a7f, 0x00010af0, 0x00010af6,
- 0x00010b39, 0x00010b3f, 0x00010b99, 0x00010b9c,
- 0x00011047, 0x0001104d, 0x000110bb, 0x000110bc,
- 0x000110be, 0x000110c1, 0x00011140, 0x00011143,
- 0x00011174, 0x00011175, 0x000111c5, 0x000111c9,
- 0x000111cd, 0x000111cd, 0x000111db, 0x000111db,
- 0x000111dd, 0x000111df, 0x00011238, 0x0001123d,
- 0x000112a9, 0x000112a9, 0x0001144b, 0x0001144f,
- 0x0001145b, 0x0001145b, 0x0001145d, 0x0001145d,
- 0x000114c6, 0x000114c6, 0x000115c1, 0x000115d7,
- 0x00011641, 0x00011643, 0x00011660, 0x0001166c,
- 0x0001173c, 0x0001173e, 0x00011a3f, 0x00011a46,
- 0x00011a9a, 0x00011a9c, 0x00011a9e, 0x00011aa2,
- 0x00011c41, 0x00011c45, 0x00011c70, 0x00011c71,
- 0x00012470, 0x00012474, 0x00016a6e, 0x00016a6f,
- 0x00016af5, 0x00016af5, 0x00016b37, 0x00016b3b,
- 0x00016b44, 0x00016b44, 0x0001bc9f, 0x0001bc9f,
- 0x0001da87, 0x0001da8b, 0x0001e95e, 0x0001e95f,
- 0x0000002b, 0x0000002b, 0x0000003c, 0x0000003e,
- 0x0000007c, 0x0000007c, 0x0000007e, 0x0000007e,
- 0x000000ac, 0x000000ac, 0x000000b1, 0x000000b1,
- 0x000000d7, 0x000000d7, 0x000000f7, 0x000000f7,
- 0x000003f6, 0x000003f6, 0x00000606, 0x00000608,
- 0x00002044, 0x00002044, 0x00002052, 0x00002052,
- 0x0000207a, 0x0000207c, 0x0000208a, 0x0000208c,
- 0x00002118, 0x00002118, 0x00002140, 0x00002144,
- 0x0000214b, 0x0000214b, 0x00002190, 0x00002194,
- 0x0000219a, 0x0000219b, 0x000021a0, 0x000021a0,
- 0x000021a3, 0x000021a3, 0x000021a6, 0x000021a6,
- 0x000021ae, 0x000021ae, 0x000021ce, 0x000021cf,
- 0x000021d2, 0x000021d2, 0x000021d4, 0x000021d4,
- 0x000021f4, 0x000022ff, 0x00002320, 0x00002321,
- 0x0000237c, 0x0000237c, 0x0000239b, 0x000023b3,
- 0x000023dc, 0x000023e1, 0x000025b7, 0x000025b7,
- 0x000025c1, 0x000025c1, 0x000025f8, 0x000025ff,
- 0x0000266f, 0x0000266f, 0x000027c0, 0x000027c4,
- 0x000027c7, 0x000027e5, 0x000027f0, 0x000027ff,
- 0x00002900, 0x00002982, 0x00002999, 0x000029d7,
- 0x000029dc, 0x000029fb, 0x000029fe, 0x00002aff,
- 0x00002b30, 0x00002b44, 0x00002b47, 0x00002b4c,
- 0x0000fb29, 0x0000fb29, 0x0000fe62, 0x0000fe62,
- 0x0000fe64, 0x0000fe66, 0x0000ff0b, 0x0000ff0b,
- 0x0000ff1c, 0x0000ff1e, 0x0000ff5c, 0x0000ff5c,
- 0x0000ff5e, 0x0000ff5e, 0x0000ffe2, 0x0000ffe2,
- 0x0000ffe9, 0x0000ffec, 0x0001d6c1, 0x0001d6c1,
- 0x0001d6db, 0x0001d6db, 0x0001d6fb, 0x0001d6fb,
- 0x0001d715, 0x0001d715, 0x0001d735, 0x0001d735,
- 0x0001d74f, 0x0001d74f, 0x0001d76f, 0x0001d76f,
- 0x0001d789, 0x0001d789, 0x0001d7a9, 0x0001d7a9,
- 0x0001d7c3, 0x0001d7c3, 0x0001eef0, 0x0001eef1,
- 0x00000024, 0x00000024, 0x000000a2, 0x000000a5,
- 0x0000058f, 0x0000058f, 0x0000060b, 0x0000060b,
- 0x000009f2, 0x000009f3, 0x000009fb, 0x000009fb,
- 0x00000af1, 0x00000af1, 0x00000bf9, 0x00000bf9,
- 0x00000e3f, 0x00000e3f, 0x000017db, 0x000017db,
- 0x000020a0, 0x000020bf, 0x0000a838, 0x0000a838,
- 0x0000fdfc, 0x0000fdfc, 0x0000fe69, 0x0000fe69,
- 0x0000ff04, 0x0000ff04, 0x0000ffe0, 0x0000ffe1,
- 0x0000ffe5, 0x0000ffe6, 0x0000005e, 0x0000005e,
- 0x00000060, 0x00000060, 0x000000a8, 0x000000a8,
- 0x000000af, 0x000000af, 0x000000b4, 0x000000b4,
- 0x000000b8, 0x000000b8, 0x000002c2, 0x000002c5,
- 0x000002d2, 0x000002df, 0x000002e5, 0x000002eb,
- 0x000002ed, 0x000002ed, 0x000002ef, 0x000002ff,
- 0x00000375, 0x00000375, 0x00000384, 0x00000385,
- 0x00001fbd, 0x00001fbd, 0x00001fbf, 0x00001fc1,
- 0x00001fcd, 0x00001fcf, 0x00001fdd, 0x00001fdf,
- 0x00001fed, 0x00001fef, 0x00001ffd, 0x00001ffe,
- 0x0000309b, 0x0000309c, 0x0000a700, 0x0000a716,
- 0x0000a720, 0x0000a721, 0x0000a789, 0x0000a78a,
- 0x0000ab5b, 0x0000ab5b, 0x0000fbb2, 0x0000fbc1,
- 0x0000ff3e, 0x0000ff3e, 0x0000ff40, 0x0000ff40,
- 0x0000ffe3, 0x0000ffe3, 0x0001f3fb, 0x0001f3ff,
- 0x000000a6, 0x000000a6, 0x000000a9, 0x000000a9,
- 0x000000ae, 0x000000ae, 0x000000b0, 0x000000b0,
- 0x00000482, 0x00000482, 0x0000058d, 0x0000058e,
- 0x0000060e, 0x0000060f, 0x000006de, 0x000006de,
- 0x000006e9, 0x000006e9, 0x000006fd, 0x000006fe,
- 0x000007f6, 0x000007f6, 0x000009fa, 0x000009fa,
- 0x00000b70, 0x00000b70, 0x00000bf3, 0x00000bf8,
- 0x00000bfa, 0x00000bfa, 0x00000c7f, 0x00000c7f,
- 0x00000d4f, 0x00000d4f, 0x00000d79, 0x00000d79,
- 0x00000f01, 0x00000f03, 0x00000f13, 0x00000f13,
- 0x00000f15, 0x00000f17, 0x00000f1a, 0x00000f1f,
- 0x00000f34, 0x00000f34, 0x00000f36, 0x00000f36,
- 0x00000f38, 0x00000f38, 0x00000fbe, 0x00000fc5,
- 0x00000fc7, 0x00000fcc, 0x00000fce, 0x00000fcf,
- 0x00000fd5, 0x00000fd8, 0x0000109e, 0x0000109f,
- 0x00001390, 0x00001399, 0x00001940, 0x00001940,
- 0x000019de, 0x000019ff, 0x00001b61, 0x00001b6a,
- 0x00001b74, 0x00001b7c, 0x00002100, 0x00002101,
- 0x00002103, 0x00002106, 0x00002108, 0x00002109,
- 0x00002114, 0x00002114, 0x00002116, 0x00002117,
- 0x0000211e, 0x00002123, 0x00002125, 0x00002125,
- 0x00002127, 0x00002127, 0x00002129, 0x00002129,
- 0x0000212e, 0x0000212e, 0x0000213a, 0x0000213b,
- 0x0000214a, 0x0000214a, 0x0000214c, 0x0000214d,
- 0x0000214f, 0x0000214f, 0x0000218a, 0x0000218b,
- 0x00002195, 0x00002199, 0x0000219c, 0x0000219f,
- 0x000021a1, 0x000021a2, 0x000021a4, 0x000021a5,
- 0x000021a7, 0x000021ad, 0x000021af, 0x000021cd,
- 0x000021d0, 0x000021d1, 0x000021d3, 0x000021d3,
- 0x000021d5, 0x000021f3, 0x00002300, 0x00002307,
- 0x0000230c, 0x0000231f, 0x00002322, 0x00002328,
- 0x0000232b, 0x0000237b, 0x0000237d, 0x0000239a,
- 0x000023b4, 0x000023db, 0x000023e2, 0x00002426,
- 0x00002440, 0x0000244a, 0x0000249c, 0x000024e9,
- 0x00002500, 0x000025b6, 0x000025b8, 0x000025c0,
- 0x000025c2, 0x000025f7, 0x00002600, 0x0000266e,
- 0x00002670, 0x00002767, 0x00002794, 0x000027bf,
- 0x00002800, 0x000028ff, 0x00002b00, 0x00002b2f,
- 0x00002b45, 0x00002b46, 0x00002b4d, 0x00002b73,
- 0x00002b76, 0x00002b95, 0x00002b98, 0x00002bb9,
- 0x00002bbd, 0x00002bc8, 0x00002bca, 0x00002bd2,
- 0x00002bec, 0x00002bef, 0x00002ce5, 0x00002cea,
- 0x00002e80, 0x00002e99, 0x00002e9b, 0x00002ef3,
- 0x00002f00, 0x00002fd5, 0x00002ff0, 0x00002ffb,
- 0x00003004, 0x00003004, 0x00003012, 0x00003013,
- 0x00003020, 0x00003020, 0x00003036, 0x00003037,
- 0x0000303e, 0x0000303f, 0x00003190, 0x00003191,
- 0x00003196, 0x0000319f, 0x000031c0, 0x000031e3,
- 0x00003200, 0x0000321e, 0x0000322a, 0x00003247,
- 0x00003250, 0x00003250, 0x00003260, 0x0000327f,
- 0x0000328a, 0x000032b0, 0x000032c0, 0x000032fe,
- 0x00003300, 0x000033ff, 0x00004dc0, 0x00004dff,
- 0x0000a490, 0x0000a4c6, 0x0000a828, 0x0000a82b,
- 0x0000a836, 0x0000a837, 0x0000a839, 0x0000a839,
- 0x0000aa77, 0x0000aa79, 0x0000fdfd, 0x0000fdfd,
- 0x0000ffe4, 0x0000ffe4, 0x0000ffe8, 0x0000ffe8,
- 0x0000ffed, 0x0000ffee, 0x0000fffc, 0x0000fffd,
- 0x00010137, 0x0001013f, 0x00010179, 0x00010189,
- 0x0001018c, 0x0001018e, 0x00010190, 0x0001019b,
- 0x000101a0, 0x000101a0, 0x000101d0, 0x000101fc,
- 0x00010877, 0x00010878, 0x00010ac8, 0x00010ac8,
- 0x0001173f, 0x0001173f, 0x00016b3c, 0x00016b3f,
- 0x00016b45, 0x00016b45, 0x0001bc9c, 0x0001bc9c,
- 0x0001d000, 0x0001d0f5, 0x0001d100, 0x0001d126,
- 0x0001d129, 0x0001d164, 0x0001d16a, 0x0001d16c,
- 0x0001d183, 0x0001d184, 0x0001d18c, 0x0001d1a9,
- 0x0001d1ae, 0x0001d1e8, 0x0001d200, 0x0001d241,
- 0x0001d245, 0x0001d245, 0x0001d300, 0x0001d356,
- 0x0001d800, 0x0001d9ff, 0x0001da37, 0x0001da3a,
- 0x0001da6d, 0x0001da74, 0x0001da76, 0x0001da83,
- 0x0001da85, 0x0001da86, 0x0001f000, 0x0001f02b,
- 0x0001f030, 0x0001f093, 0x0001f0a0, 0x0001f0ae,
- 0x0001f0b1, 0x0001f0bf, 0x0001f0c1, 0x0001f0cf,
- 0x0001f0d1, 0x0001f0f5, 0x0001f110, 0x0001f12e,
- 0x0001f130, 0x0001f16b, 0x0001f170, 0x0001f1ac,
- 0x0001f1e6, 0x0001f202, 0x0001f210, 0x0001f23b,
- 0x0001f240, 0x0001f248, 0x0001f250, 0x0001f251,
- 0x0001f260, 0x0001f265, 0x0001f300, 0x0001f3fa,
- 0x0001f400, 0x0001f6d4, 0x0001f6e0, 0x0001f6ec,
- 0x0001f6f0, 0x0001f6f8, 0x0001f700, 0x0001f773,
- 0x0001f780, 0x0001f7d4, 0x0001f800, 0x0001f80b,
- 0x0001f810, 0x0001f847, 0x0001f850, 0x0001f859,
- 0x0001f860, 0x0001f887, 0x0001f890, 0x0001f8ad,
- 0x0001f900, 0x0001f90b, 0x0001f910, 0x0001f93e,
- 0x0001f940, 0x0001f94c, 0x0001f950, 0x0001f96b,
- 0x0001f980, 0x0001f997, 0x0001f9c0, 0x0001f9c0,
- 0x0001f9d0, 0x0001f9e6, 0x00000041, 0x0000005a,
- 0x00000061, 0x0000007a, 0x000000aa, 0x000000aa,
- 0x000000b5, 0x000000b5, 0x000000ba, 0x000000ba,
- 0x000000c0, 0x000000d6, 0x000000d8, 0x000000f6,
- 0x000000f8, 0x000002b8, 0x000002bb, 0x000002c1,
- 0x000002d0, 0x000002d1, 0x000002e0, 0x000002e4,
- 0x000002ee, 0x000002ee, 0x00000370, 0x00000373,
- 0x00000376, 0x00000377, 0x0000037a, 0x0000037d,
- 0x0000037f, 0x0000037f, 0x00000386, 0x00000386,
- 0x00000388, 0x0000038a, 0x0000038c, 0x0000038c,
- 0x0000038e, 0x000003a1, 0x000003a3, 0x000003f5,
- 0x000003f7, 0x00000482, 0x0000048a, 0x0000052f,
- 0x00000531, 0x00000556, 0x00000559, 0x0000055f,
- 0x00000561, 0x00000587, 0x00000589, 0x00000589,
- 0x00000903, 0x00000939, 0x0000093b, 0x0000093b,
- 0x0000093d, 0x00000940, 0x00000949, 0x0000094c,
- 0x0000094e, 0x00000950, 0x00000958, 0x00000961,
- 0x00000964, 0x00000980, 0x00000982, 0x00000983,
- 0x00000985, 0x0000098c, 0x0000098f, 0x00000990,
- 0x00000993, 0x000009a8, 0x000009aa, 0x000009b0,
- 0x000009b2, 0x000009b2, 0x000009b6, 0x000009b9,
- 0x000009bd, 0x000009c0, 0x000009c7, 0x000009c8,
- 0x000009cb, 0x000009cc, 0x000009ce, 0x000009ce,
- 0x000009d7, 0x000009d7, 0x000009dc, 0x000009dd,
- 0x000009df, 0x000009e1, 0x000009e6, 0x000009f1,
- 0x000009f4, 0x000009fa, 0x000009fc, 0x000009fd,
- 0x00000a03, 0x00000a03, 0x00000a05, 0x00000a0a,
- 0x00000a0f, 0x00000a10, 0x00000a13, 0x00000a28,
- 0x00000a2a, 0x00000a30, 0x00000a32, 0x00000a33,
- 0x00000a35, 0x00000a36, 0x00000a38, 0x00000a39,
- 0x00000a3e, 0x00000a40, 0x00000a59, 0x00000a5c,
- 0x00000a5e, 0x00000a5e, 0x00000a66, 0x00000a6f,
- 0x00000a72, 0x00000a74, 0x00000a83, 0x00000a83,
- 0x00000a85, 0x00000a8d, 0x00000a8f, 0x00000a91,
- 0x00000a93, 0x00000aa8, 0x00000aaa, 0x00000ab0,
- 0x00000ab2, 0x00000ab3, 0x00000ab5, 0x00000ab9,
- 0x00000abd, 0x00000ac0, 0x00000ac9, 0x00000ac9,
- 0x00000acb, 0x00000acc, 0x00000ad0, 0x00000ad0,
- 0x00000ae0, 0x00000ae1, 0x00000ae6, 0x00000af0,
- 0x00000af9, 0x00000af9, 0x00000b02, 0x00000b03,
- 0x00000b05, 0x00000b0c, 0x00000b0f, 0x00000b10,
- 0x00000b13, 0x00000b28, 0x00000b2a, 0x00000b30,
- 0x00000b32, 0x00000b33, 0x00000b35, 0x00000b39,
- 0x00000b3d, 0x00000b3e, 0x00000b40, 0x00000b40,
- 0x00000b47, 0x00000b48, 0x00000b4b, 0x00000b4c,
- 0x00000b57, 0x00000b57, 0x00000b5c, 0x00000b5d,
- 0x00000b5f, 0x00000b61, 0x00000b66, 0x00000b77,
- 0x00000b83, 0x00000b83, 0x00000b85, 0x00000b8a,
- 0x00000b8e, 0x00000b90, 0x00000b92, 0x00000b95,
- 0x00000b99, 0x00000b9a, 0x00000b9c, 0x00000b9c,
- 0x00000b9e, 0x00000b9f, 0x00000ba3, 0x00000ba4,
- 0x00000ba8, 0x00000baa, 0x00000bae, 0x00000bb9,
- 0x00000bbe, 0x00000bbf, 0x00000bc1, 0x00000bc2,
- 0x00000bc6, 0x00000bc8, 0x00000bca, 0x00000bcc,
- 0x00000bd0, 0x00000bd0, 0x00000bd7, 0x00000bd7,
- 0x00000be6, 0x00000bf2, 0x00000c01, 0x00000c03,
- 0x00000c05, 0x00000c0c, 0x00000c0e, 0x00000c10,
- 0x00000c12, 0x00000c28, 0x00000c2a, 0x00000c39,
- 0x00000c3d, 0x00000c3d, 0x00000c41, 0x00000c44,
- 0x00000c58, 0x00000c5a, 0x00000c60, 0x00000c61,
- 0x00000c66, 0x00000c6f, 0x00000c7f, 0x00000c80,
- 0x00000c82, 0x00000c83, 0x00000c85, 0x00000c8c,
- 0x00000c8e, 0x00000c90, 0x00000c92, 0x00000ca8,
- 0x00000caa, 0x00000cb3, 0x00000cb5, 0x00000cb9,
- 0x00000cbd, 0x00000cc4, 0x00000cc6, 0x00000cc8,
- 0x00000cca, 0x00000ccb, 0x00000cd5, 0x00000cd6,
- 0x00000cde, 0x00000cde, 0x00000ce0, 0x00000ce1,
- 0x00000ce6, 0x00000cef, 0x00000cf1, 0x00000cf2,
- 0x00000d02, 0x00000d03, 0x00000d05, 0x00000d0c,
- 0x00000d0e, 0x00000d10, 0x00000d12, 0x00000d3a,
- 0x00000d3d, 0x00000d40, 0x00000d46, 0x00000d48,
- 0x00000d4a, 0x00000d4c, 0x00000d4e, 0x00000d4f,
- 0x00000d54, 0x00000d61, 0x00000d66, 0x00000d7f,
- 0x00000d82, 0x00000d83, 0x00000d85, 0x00000d96,
- 0x00000d9a, 0x00000db1, 0x00000db3, 0x00000dbb,
- 0x00000dbd, 0x00000dbd, 0x00000dc0, 0x00000dc6,
- 0x00000dcf, 0x00000dd1, 0x00000dd8, 0x00000ddf,
- 0x00000de6, 0x00000def, 0x00000df2, 0x00000df4,
- 0x00000e01, 0x00000e30, 0x00000e32, 0x00000e33,
- 0x00000e40, 0x00000e46, 0x00000e4f, 0x00000e5b,
- 0x00000e81, 0x00000e82, 0x00000e84, 0x00000e84,
- 0x00000e87, 0x00000e88, 0x00000e8a, 0x00000e8a,
- 0x00000e8d, 0x00000e8d, 0x00000e94, 0x00000e97,
- 0x00000e99, 0x00000e9f, 0x00000ea1, 0x00000ea3,
- 0x00000ea5, 0x00000ea5, 0x00000ea7, 0x00000ea7,
- 0x00000eaa, 0x00000eab, 0x00000ead, 0x00000eb0,
- 0x00000eb2, 0x00000eb3, 0x00000ebd, 0x00000ebd,
- 0x00000ec0, 0x00000ec4, 0x00000ec6, 0x00000ec6,
- 0x00000ed0, 0x00000ed9, 0x00000edc, 0x00000edf,
- 0x00000f00, 0x00000f17, 0x00000f1a, 0x00000f34,
- 0x00000f36, 0x00000f36, 0x00000f38, 0x00000f38,
- 0x00000f3e, 0x00000f47, 0x00000f49, 0x00000f6c,
- 0x00000f7f, 0x00000f7f, 0x00000f85, 0x00000f85,
- 0x00000f88, 0x00000f8c, 0x00000fbe, 0x00000fc5,
- 0x00000fc7, 0x00000fcc, 0x00000fce, 0x00000fda,
- 0x00001000, 0x0000102c, 0x00001031, 0x00001031,
- 0x00001038, 0x00001038, 0x0000103b, 0x0000103c,
- 0x0000103f, 0x00001057, 0x0000105a, 0x0000105d,
- 0x00001061, 0x00001070, 0x00001075, 0x00001081,
- 0x00001083, 0x00001084, 0x00001087, 0x0000108c,
- 0x0000108e, 0x0000109c, 0x0000109e, 0x000010c5,
- 0x000010c7, 0x000010c7, 0x000010cd, 0x000010cd,
- 0x000010d0, 0x00001248, 0x0000124a, 0x0000124d,
- 0x00001250, 0x00001256, 0x00001258, 0x00001258,
- 0x0000125a, 0x0000125d, 0x00001260, 0x00001288,
- 0x0000128a, 0x0000128d, 0x00001290, 0x000012b0,
- 0x000012b2, 0x000012b5, 0x000012b8, 0x000012be,
- 0x000012c0, 0x000012c0, 0x000012c2, 0x000012c5,
- 0x000012c8, 0x000012d6, 0x000012d8, 0x00001310,
- 0x00001312, 0x00001315, 0x00001318, 0x0000135a,
- 0x00001360, 0x0000137c, 0x00001380, 0x0000138f,
- 0x000013a0, 0x000013f5, 0x000013f8, 0x000013fd,
- 0x00001401, 0x0000167f, 0x00001681, 0x0000169a,
- 0x000016a0, 0x000016f8, 0x00001700, 0x0000170c,
- 0x0000170e, 0x00001711, 0x00001720, 0x00001731,
- 0x00001735, 0x00001736, 0x00001740, 0x00001751,
- 0x00001760, 0x0000176c, 0x0000176e, 0x00001770,
- 0x00001780, 0x000017b3, 0x000017b6, 0x000017b6,
- 0x000017be, 0x000017c5, 0x000017c7, 0x000017c8,
- 0x000017d4, 0x000017da, 0x000017dc, 0x000017dc,
- 0x000017e0, 0x000017e9, 0x00001810, 0x00001819,
- 0x00001820, 0x00001877, 0x00001880, 0x00001884,
- 0x00001887, 0x000018a8, 0x000018aa, 0x000018aa,
- 0x000018b0, 0x000018f5, 0x00001900, 0x0000191e,
- 0x00001923, 0x00001926, 0x00001929, 0x0000192b,
- 0x00001930, 0x00001931, 0x00001933, 0x00001938,
- 0x00001946, 0x0000196d, 0x00001970, 0x00001974,
- 0x00001980, 0x000019ab, 0x000019b0, 0x000019c9,
- 0x000019d0, 0x000019da, 0x00001a00, 0x00001a16,
- 0x00001a19, 0x00001a1a, 0x00001a1e, 0x00001a55,
- 0x00001a57, 0x00001a57, 0x00001a61, 0x00001a61,
- 0x00001a63, 0x00001a64, 0x00001a6d, 0x00001a72,
- 0x00001a80, 0x00001a89, 0x00001a90, 0x00001a99,
- 0x00001aa0, 0x00001aad, 0x00001b04, 0x00001b33,
- 0x00001b35, 0x00001b35, 0x00001b3b, 0x00001b3b,
- 0x00001b3d, 0x00001b41, 0x00001b43, 0x00001b4b,
- 0x00001b50, 0x00001b6a, 0x00001b74, 0x00001b7c,
- 0x00001b82, 0x00001ba1, 0x00001ba6, 0x00001ba7,
- 0x00001baa, 0x00001baa, 0x00001bae, 0x00001be5,
- 0x00001be7, 0x00001be7, 0x00001bea, 0x00001bec,
- 0x00001bee, 0x00001bee, 0x00001bf2, 0x00001bf3,
- 0x00001bfc, 0x00001c2b, 0x00001c34, 0x00001c35,
- 0x00001c3b, 0x00001c49, 0x00001c4d, 0x00001c88,
+ 0x00017000, 0x000187ec, 0x00018800, 0x00018af2,
+ 0x0001b000, 0x0001b11e, 0x0001b170, 0x0001b2fb,
+ 0x0001bc00, 0x0001bc6a, 0x0001bc70, 0x0001bc7c,
+ 0x0001bc80, 0x0001bc88, 0x0001bc90, 0x0001bc99,
+ 0x0001e800, 0x0001e8c4, 0x0001ee00, 0x0001ee03,
+ 0x0001ee05, 0x0001ee1f, 0x0001ee21, 0x0001ee22,
+ 0x0001ee24, 0x0001ee24, 0x0001ee27, 0x0001ee27,
+ 0x0001ee29, 0x0001ee32, 0x0001ee34, 0x0001ee37,
+ 0x0001ee39, 0x0001ee39, 0x0001ee3b, 0x0001ee3b,
+ 0x0001ee42, 0x0001ee42, 0x0001ee47, 0x0001ee47,
+ 0x0001ee49, 0x0001ee49, 0x0001ee4b, 0x0001ee4b,
+ 0x0001ee4d, 0x0001ee4f, 0x0001ee51, 0x0001ee52,
+ 0x0001ee54, 0x0001ee54, 0x0001ee57, 0x0001ee57,
+ 0x0001ee59, 0x0001ee59, 0x0001ee5b, 0x0001ee5b,
+ 0x0001ee5d, 0x0001ee5d, 0x0001ee5f, 0x0001ee5f,
+ 0x0001ee61, 0x0001ee62, 0x0001ee64, 0x0001ee64,
+ 0x0001ee67, 0x0001ee6a, 0x0001ee6c, 0x0001ee72,
+ 0x0001ee74, 0x0001ee77, 0x0001ee79, 0x0001ee7c,
+ 0x0001ee7e, 0x0001ee7e, 0x0001ee80, 0x0001ee89,
+ 0x0001ee8b, 0x0001ee9b, 0x0001eea1, 0x0001eea3,
+ 0x0001eea5, 0x0001eea9, 0x0001eeab, 0x0001eebb,
+ 0x00020000, 0x0002a6d6, 0x0002a700, 0x0002b734,
+ 0x0002b740, 0x0002b81d, 0x0002b820, 0x0002cea1,
+ 0x0002ceb0, 0x0002ebe0, 0x0002f800, 0x0002fa1d,
+ 0x0000005f, 0x0000005f, 0x0000203f, 0x00002040,
+ 0x00002054, 0x00002054, 0x0000fe33, 0x0000fe34,
+ 0x0000fe4d, 0x0000fe4f, 0x0000ff3f, 0x0000ff3f,
+ 0x0000002d, 0x0000002d, 0x0000058a, 0x0000058a,
+ 0x000005be, 0x000005be, 0x00001400, 0x00001400,
+ 0x00001806, 0x00001806, 0x00002010, 0x00002015,
+ 0x00002e17, 0x00002e17, 0x00002e1a, 0x00002e1a,
+ 0x00002e3a, 0x00002e3b, 0x00002e40, 0x00002e40,
+ 0x0000301c, 0x0000301c, 0x00003030, 0x00003030,
+ 0x000030a0, 0x000030a0, 0x0000fe31, 0x0000fe32,
+ 0x0000fe58, 0x0000fe58, 0x0000fe63, 0x0000fe63,
+ 0x0000ff0d, 0x0000ff0d, 0x00000028, 0x00000028,
+ 0x0000005b, 0x0000005b, 0x0000007b, 0x0000007b,
+ 0x00000f3a, 0x00000f3a, 0x00000f3c, 0x00000f3c,
+ 0x0000169b, 0x0000169b, 0x0000201a, 0x0000201a,
+ 0x0000201e, 0x0000201e, 0x00002045, 0x00002045,
+ 0x0000207d, 0x0000207d, 0x0000208d, 0x0000208d,
+ 0x00002308, 0x00002308, 0x0000230a, 0x0000230a,
+ 0x00002329, 0x00002329, 0x00002768, 0x00002768,
+ 0x0000276a, 0x0000276a, 0x0000276c, 0x0000276c,
+ 0x0000276e, 0x0000276e, 0x00002770, 0x00002770,
+ 0x00002772, 0x00002772, 0x00002774, 0x00002774,
+ 0x000027c5, 0x000027c5, 0x000027e6, 0x000027e6,
+ 0x000027e8, 0x000027e8, 0x000027ea, 0x000027ea,
+ 0x000027ec, 0x000027ec, 0x000027ee, 0x000027ee,
+ 0x00002983, 0x00002983, 0x00002985, 0x00002985,
+ 0x00002987, 0x00002987, 0x00002989, 0x00002989,
+ 0x0000298b, 0x0000298b, 0x0000298d, 0x0000298d,
+ 0x0000298f, 0x0000298f, 0x00002991, 0x00002991,
+ 0x00002993, 0x00002993, 0x00002995, 0x00002995,
+ 0x00002997, 0x00002997, 0x000029d8, 0x000029d8,
+ 0x000029da, 0x000029da, 0x000029fc, 0x000029fc,
+ 0x00002e22, 0x00002e22, 0x00002e24, 0x00002e24,
+ 0x00002e26, 0x00002e26, 0x00002e28, 0x00002e28,
+ 0x00002e42, 0x00002e42, 0x00003008, 0x00003008,
+ 0x0000300a, 0x0000300a, 0x0000300c, 0x0000300c,
+ 0x0000300e, 0x0000300e, 0x00003010, 0x00003010,
+ 0x00003014, 0x00003014, 0x00003016, 0x00003016,
+ 0x00003018, 0x00003018, 0x0000301a, 0x0000301a,
+ 0x0000301d, 0x0000301d, 0x0000fd3f, 0x0000fd3f,
+ 0x0000fe17, 0x0000fe17, 0x0000fe35, 0x0000fe35,
+ 0x0000fe37, 0x0000fe37, 0x0000fe39, 0x0000fe39,
+ 0x0000fe3b, 0x0000fe3b, 0x0000fe3d, 0x0000fe3d,
+ 0x0000fe3f, 0x0000fe3f, 0x0000fe41, 0x0000fe41,
+ 0x0000fe43, 0x0000fe43, 0x0000fe47, 0x0000fe47,
+ 0x0000fe59, 0x0000fe59, 0x0000fe5b, 0x0000fe5b,
+ 0x0000fe5d, 0x0000fe5d, 0x0000ff08, 0x0000ff08,
+ 0x0000ff3b, 0x0000ff3b, 0x0000ff5b, 0x0000ff5b,
+ 0x0000ff5f, 0x0000ff5f, 0x0000ff62, 0x0000ff62,
+ 0x00000029, 0x00000029, 0x0000005d, 0x0000005d,
+ 0x0000007d, 0x0000007d, 0x00000f3b, 0x00000f3b,
+ 0x00000f3d, 0x00000f3d, 0x0000169c, 0x0000169c,
+ 0x00002046, 0x00002046, 0x0000207e, 0x0000207e,
+ 0x0000208e, 0x0000208e, 0x00002309, 0x00002309,
+ 0x0000230b, 0x0000230b, 0x0000232a, 0x0000232a,
+ 0x00002769, 0x00002769, 0x0000276b, 0x0000276b,
+ 0x0000276d, 0x0000276d, 0x0000276f, 0x0000276f,
+ 0x00002771, 0x00002771, 0x00002773, 0x00002773,
+ 0x00002775, 0x00002775, 0x000027c6, 0x000027c6,
+ 0x000027e7, 0x000027e7, 0x000027e9, 0x000027e9,
+ 0x000027eb, 0x000027eb, 0x000027ed, 0x000027ed,
+ 0x000027ef, 0x000027ef, 0x00002984, 0x00002984,
+ 0x00002986, 0x00002986, 0x00002988, 0x00002988,
+ 0x0000298a, 0x0000298a, 0x0000298c, 0x0000298c,
+ 0x0000298e, 0x0000298e, 0x00002990, 0x00002990,
+ 0x00002992, 0x00002992, 0x00002994, 0x00002994,
+ 0x00002996, 0x00002996, 0x00002998, 0x00002998,
+ 0x000029d9, 0x000029d9, 0x000029db, 0x000029db,
+ 0x000029fd, 0x000029fd, 0x00002e23, 0x00002e23,
+ 0x00002e25, 0x00002e25, 0x00002e27, 0x00002e27,
+ 0x00002e29, 0x00002e29, 0x00003009, 0x00003009,
+ 0x0000300b, 0x0000300b, 0x0000300d, 0x0000300d,
+ 0x0000300f, 0x0000300f, 0x00003011, 0x00003011,
+ 0x00003015, 0x00003015, 0x00003017, 0x00003017,
+ 0x00003019, 0x00003019, 0x0000301b, 0x0000301b,
+ 0x0000301e, 0x0000301f, 0x0000fd3e, 0x0000fd3e,
+ 0x0000fe18, 0x0000fe18, 0x0000fe36, 0x0000fe36,
+ 0x0000fe38, 0x0000fe38, 0x0000fe3a, 0x0000fe3a,
+ 0x0000fe3c, 0x0000fe3c, 0x0000fe3e, 0x0000fe3e,
+ 0x0000fe40, 0x0000fe40, 0x0000fe42, 0x0000fe42,
+ 0x0000fe44, 0x0000fe44, 0x0000fe48, 0x0000fe48,
+ 0x0000fe5a, 0x0000fe5a, 0x0000fe5c, 0x0000fe5c,
+ 0x0000fe5e, 0x0000fe5e, 0x0000ff09, 0x0000ff09,
+ 0x0000ff3d, 0x0000ff3d, 0x0000ff5d, 0x0000ff5d,
+ 0x0000ff60, 0x0000ff60, 0x0000ff63, 0x0000ff63,
+ 0x00000021, 0x00000023, 0x00000025, 0x00000027,
+ 0x0000002a, 0x0000002a, 0x0000002c, 0x0000002c,
+ 0x0000002e, 0x0000002f, 0x0000003a, 0x0000003b,
+ 0x0000003f, 0x00000040, 0x0000005c, 0x0000005c,
+ 0x000000a1, 0x000000a1, 0x000000a7, 0x000000a7,
+ 0x000000b6, 0x000000b7, 0x000000bf, 0x000000bf,
+ 0x0000037e, 0x0000037e, 0x00000387, 0x00000387,
+ 0x0000055a, 0x0000055f, 0x00000589, 0x00000589,
+ 0x000005c0, 0x000005c0, 0x000005c3, 0x000005c3,
+ 0x000005c6, 0x000005c6, 0x000005f3, 0x000005f4,
+ 0x00000609, 0x0000060a, 0x0000060c, 0x0000060d,
+ 0x0000061b, 0x0000061b, 0x0000061e, 0x0000061f,
+ 0x0000066a, 0x0000066d, 0x000006d4, 0x000006d4,
+ 0x00000700, 0x0000070d, 0x000007f7, 0x000007f9,
+ 0x00000830, 0x0000083e, 0x0000085e, 0x0000085e,
+ 0x00000964, 0x00000965, 0x00000970, 0x00000970,
+ 0x000009fd, 0x000009fd, 0x00000af0, 0x00000af0,
+ 0x00000df4, 0x00000df4, 0x00000e4f, 0x00000e4f,
+ 0x00000e5a, 0x00000e5b, 0x00000f04, 0x00000f12,
+ 0x00000f14, 0x00000f14, 0x00000f85, 0x00000f85,
+ 0x00000fd0, 0x00000fd4, 0x00000fd9, 0x00000fda,
+ 0x0000104a, 0x0000104f, 0x000010fb, 0x000010fb,
+ 0x00001360, 0x00001368, 0x0000166d, 0x0000166e,
+ 0x000016eb, 0x000016ed, 0x00001735, 0x00001736,
+ 0x000017d4, 0x000017d6, 0x000017d8, 0x000017da,
+ 0x00001800, 0x00001805, 0x00001807, 0x0000180a,
+ 0x00001944, 0x00001945, 0x00001a1e, 0x00001a1f,
+ 0x00001aa0, 0x00001aa6, 0x00001aa8, 0x00001aad,
+ 0x00001b5a, 0x00001b60, 0x00001bfc, 0x00001bff,
+ 0x00001c3b, 0x00001c3f, 0x00001c7e, 0x00001c7f,
0x00001cc0, 0x00001cc7, 0x00001cd3, 0x00001cd3,
- 0x00001ce1, 0x00001ce1, 0x00001ce9, 0x00001cec,
- 0x00001cee, 0x00001cf3, 0x00001cf5, 0x00001cf7,
- 0x00001d00, 0x00001dbf, 0x00001e00, 0x00001f15,
- 0x00001f18, 0x00001f1d, 0x00001f20, 0x00001f45,
- 0x00001f48, 0x00001f4d, 0x00001f50, 0x00001f57,
- 0x00001f59, 0x00001f59, 0x00001f5b, 0x00001f5b,
- 0x00001f5d, 0x00001f5d, 0x00001f5f, 0x00001f7d,
- 0x00001f80, 0x00001fb4, 0x00001fb6, 0x00001fbc,
- 0x00001fbe, 0x00001fbe, 0x00001fc2, 0x00001fc4,
- 0x00001fc6, 0x00001fcc, 0x00001fd0, 0x00001fd3,
- 0x00001fd6, 0x00001fdb, 0x00001fe0, 0x00001fec,
- 0x00001ff2, 0x00001ff4, 0x00001ff6, 0x00001ffc,
- 0x0000200e, 0x0000200e, 0x00002071, 0x00002071,
- 0x0000207f, 0x0000207f, 0x00002090, 0x0000209c,
- 0x00002102, 0x00002102, 0x00002107, 0x00002107,
- 0x0000210a, 0x00002113, 0x00002115, 0x00002115,
- 0x00002119, 0x0000211d, 0x00002124, 0x00002124,
- 0x00002126, 0x00002126, 0x00002128, 0x00002128,
- 0x0000212a, 0x0000212d, 0x0000212f, 0x00002139,
- 0x0000213c, 0x0000213f, 0x00002145, 0x00002149,
- 0x0000214e, 0x0000214f, 0x00002160, 0x00002188,
- 0x00002336, 0x0000237a, 0x00002395, 0x00002395,
- 0x0000249c, 0x000024e9, 0x000026ac, 0x000026ac,
- 0x00002800, 0x000028ff, 0x00002c00, 0x00002c2e,
- 0x00002c30, 0x00002c5e, 0x00002c60, 0x00002ce4,
- 0x00002ceb, 0x00002cee, 0x00002cf2, 0x00002cf3,
- 0x00002d00, 0x00002d25, 0x00002d27, 0x00002d27,
- 0x00002d2d, 0x00002d2d, 0x00002d30, 0x00002d67,
- 0x00002d6f, 0x00002d70, 0x00002d80, 0x00002d96,
- 0x00002da0, 0x00002da6, 0x00002da8, 0x00002dae,
- 0x00002db0, 0x00002db6, 0x00002db8, 0x00002dbe,
- 0x00002dc0, 0x00002dc6, 0x00002dc8, 0x00002dce,
- 0x00002dd0, 0x00002dd6, 0x00002dd8, 0x00002dde,
- 0x00003005, 0x00003007, 0x00003021, 0x00003029,
- 0x0000302e, 0x0000302f, 0x00003031, 0x00003035,
- 0x00003038, 0x0000303c, 0x00003041, 0x00003096,
- 0x0000309d, 0x0000309f, 0x000030a1, 0x000030fa,
- 0x000030fc, 0x000030ff, 0x00003105, 0x0000312e,
- 0x00003131, 0x0000318e, 0x00003190, 0x000031ba,
- 0x000031f0, 0x0000321c, 0x00003220, 0x0000324f,
- 0x00003260, 0x0000327b, 0x0000327f, 0x000032b0,
- 0x000032c0, 0x000032cb, 0x000032d0, 0x000032fe,
- 0x00003300, 0x00003376, 0x0000337b, 0x000033dd,
- 0x000033e0, 0x000033fe, 0x00003400, 0x00004db5,
- 0x00004e00, 0x0000a48c, 0x0000a4d0, 0x0000a60c,
+ 0x00002016, 0x00002017, 0x00002020, 0x00002027,
+ 0x00002030, 0x00002038, 0x0000203b, 0x0000203e,
+ 0x00002041, 0x00002043, 0x00002047, 0x00002051,
+ 0x00002053, 0x00002053, 0x00002055, 0x0000205e,
+ 0x00002cf9, 0x00002cfc, 0x00002cfe, 0x00002cff,
+ 0x00002d70, 0x00002d70, 0x00002e00, 0x00002e01,
+ 0x00002e06, 0x00002e08, 0x00002e0b, 0x00002e0b,
+ 0x00002e0e, 0x00002e16, 0x00002e18, 0x00002e19,
+ 0x00002e1b, 0x00002e1b, 0x00002e1e, 0x00002e1f,
+ 0x00002e2a, 0x00002e2e, 0x00002e30, 0x00002e39,
+ 0x00002e3c, 0x00002e3f, 0x00002e41, 0x00002e41,
+ 0x00002e43, 0x00002e49, 0x00003001, 0x00003003,
+ 0x0000303d, 0x0000303d, 0x000030fb, 0x000030fb,
+ 0x0000a4fe, 0x0000a4ff, 0x0000a60d, 0x0000a60f,
+ 0x0000a673, 0x0000a673, 0x0000a67e, 0x0000a67e,
+ 0x0000a6f2, 0x0000a6f7, 0x0000a874, 0x0000a877,
+ 0x0000a8ce, 0x0000a8cf, 0x0000a8f8, 0x0000a8fa,
+ 0x0000a8fc, 0x0000a8fc, 0x0000a92e, 0x0000a92f,
+ 0x0000a95f, 0x0000a95f, 0x0000a9c1, 0x0000a9cd,
+ 0x0000a9de, 0x0000a9df, 0x0000aa5c, 0x0000aa5f,
+ 0x0000aade, 0x0000aadf, 0x0000aaf0, 0x0000aaf1,
+ 0x0000abeb, 0x0000abeb, 0x0000fe10, 0x0000fe16,
+ 0x0000fe19, 0x0000fe19, 0x0000fe30, 0x0000fe30,
+ 0x0000fe45, 0x0000fe46, 0x0000fe49, 0x0000fe4c,
+ 0x0000fe50, 0x0000fe52, 0x0000fe54, 0x0000fe57,
+ 0x0000fe5f, 0x0000fe61, 0x0000fe68, 0x0000fe68,
+ 0x0000fe6a, 0x0000fe6b, 0x0000ff01, 0x0000ff03,
+ 0x0000ff05, 0x0000ff07, 0x0000ff0a, 0x0000ff0a,
+ 0x0000ff0c, 0x0000ff0c, 0x0000ff0e, 0x0000ff0f,
+ 0x0000ff1a, 0x0000ff1b, 0x0000ff1f, 0x0000ff20,
+ 0x0000ff3c, 0x0000ff3c, 0x0000ff61, 0x0000ff61,
+ 0x0000ff64, 0x0000ff65, 0x00010100, 0x00010102,
+ 0x0001039f, 0x0001039f, 0x000103d0, 0x000103d0,
+ 0x0001056f, 0x0001056f, 0x00010857, 0x00010857,
+ 0x0001091f, 0x0001091f, 0x0001093f, 0x0001093f,
+ 0x00010a50, 0x00010a58, 0x00010a7f, 0x00010a7f,
+ 0x00010af0, 0x00010af6, 0x00010b39, 0x00010b3f,
+ 0x00010b99, 0x00010b9c, 0x00011047, 0x0001104d,
+ 0x000110bb, 0x000110bc, 0x000110be, 0x000110c1,
+ 0x00011140, 0x00011143, 0x00011174, 0x00011175,
+ 0x000111c5, 0x000111c9, 0x000111cd, 0x000111cd,
+ 0x000111db, 0x000111db, 0x000111dd, 0x000111df,
+ 0x00011238, 0x0001123d, 0x000112a9, 0x000112a9,
+ 0x0001144b, 0x0001144f, 0x0001145b, 0x0001145b,
+ 0x0001145d, 0x0001145d, 0x000114c6, 0x000114c6,
+ 0x000115c1, 0x000115d7, 0x00011641, 0x00011643,
+ 0x00011660, 0x0001166c, 0x0001173c, 0x0001173e,
+ 0x00011a3f, 0x00011a46, 0x00011a9a, 0x00011a9c,
+ 0x00011a9e, 0x00011aa2, 0x00011c41, 0x00011c45,
+ 0x00011c70, 0x00011c71, 0x00012470, 0x00012474,
+ 0x00016a6e, 0x00016a6f, 0x00016af5, 0x00016af5,
+ 0x00016b37, 0x00016b3b, 0x00016b44, 0x00016b44,
+ 0x0001bc9f, 0x0001bc9f, 0x0001da87, 0x0001da8b,
+ 0x0001e95e, 0x0001e95f, 0x0000002b, 0x0000002b,
+ 0x0000003c, 0x0000003e, 0x0000007c, 0x0000007c,
+ 0x0000007e, 0x0000007e, 0x000000ac, 0x000000ac,
+ 0x000000b1, 0x000000b1, 0x000000d7, 0x000000d7,
+ 0x000000f7, 0x000000f7, 0x000003f6, 0x000003f6,
+ 0x00000606, 0x00000608, 0x00002044, 0x00002044,
+ 0x00002052, 0x00002052, 0x0000207a, 0x0000207c,
+ 0x0000208a, 0x0000208c, 0x00002118, 0x00002118,
+ 0x00002140, 0x00002144, 0x0000214b, 0x0000214b,
+ 0x00002190, 0x00002194, 0x0000219a, 0x0000219b,
+ 0x000021a0, 0x000021a0, 0x000021a3, 0x000021a3,
+ 0x000021a6, 0x000021a6, 0x000021ae, 0x000021ae,
+ 0x000021ce, 0x000021cf, 0x000021d2, 0x000021d2,
+ 0x000021d4, 0x000021d4, 0x000021f4, 0x000022ff,
+ 0x00002320, 0x00002321, 0x0000237c, 0x0000237c,
+ 0x0000239b, 0x000023b3, 0x000023dc, 0x000023e1,
+ 0x000025b7, 0x000025b7, 0x000025c1, 0x000025c1,
+ 0x000025f8, 0x000025ff, 0x0000266f, 0x0000266f,
+ 0x000027c0, 0x000027c4, 0x000027c7, 0x000027e5,
+ 0x000027f0, 0x000027ff, 0x00002900, 0x00002982,
+ 0x00002999, 0x000029d7, 0x000029dc, 0x000029fb,
+ 0x000029fe, 0x00002aff, 0x00002b30, 0x00002b44,
+ 0x00002b47, 0x00002b4c, 0x0000fb29, 0x0000fb29,
+ 0x0000fe62, 0x0000fe62, 0x0000fe64, 0x0000fe66,
+ 0x0000ff0b, 0x0000ff0b, 0x0000ff1c, 0x0000ff1e,
+ 0x0000ff5c, 0x0000ff5c, 0x0000ff5e, 0x0000ff5e,
+ 0x0000ffe2, 0x0000ffe2, 0x0000ffe9, 0x0000ffec,
+ 0x0001d6c1, 0x0001d6c1, 0x0001d6db, 0x0001d6db,
+ 0x0001d6fb, 0x0001d6fb, 0x0001d715, 0x0001d715,
+ 0x0001d735, 0x0001d735, 0x0001d74f, 0x0001d74f,
+ 0x0001d76f, 0x0001d76f, 0x0001d789, 0x0001d789,
+ 0x0001d7a9, 0x0001d7a9, 0x0001d7c3, 0x0001d7c3,
+ 0x0001eef0, 0x0001eef1, 0x00000024, 0x00000024,
+ 0x000000a2, 0x000000a5, 0x0000058f, 0x0000058f,
+ 0x0000060b, 0x0000060b, 0x000009f2, 0x000009f3,
+ 0x000009fb, 0x000009fb, 0x00000af1, 0x00000af1,
+ 0x00000bf9, 0x00000bf9, 0x00000e3f, 0x00000e3f,
+ 0x000017db, 0x000017db, 0x000020a0, 0x000020bf,
+ 0x0000a838, 0x0000a838, 0x0000fdfc, 0x0000fdfc,
+ 0x0000fe69, 0x0000fe69, 0x0000ff04, 0x0000ff04,
+ 0x0000ffe0, 0x0000ffe1, 0x0000ffe5, 0x0000ffe6,
+ 0x0000005e, 0x0000005e, 0x00000060, 0x00000060,
+ 0x000000a8, 0x000000a8, 0x000000af, 0x000000af,
+ 0x000000b4, 0x000000b4, 0x000000b8, 0x000000b8,
+ 0x000002c2, 0x000002c5, 0x000002d2, 0x000002df,
+ 0x000002e5, 0x000002eb, 0x000002ed, 0x000002ed,
+ 0x000002ef, 0x000002ff, 0x00000375, 0x00000375,
+ 0x00000384, 0x00000385, 0x00001fbd, 0x00001fbd,
+ 0x00001fbf, 0x00001fc1, 0x00001fcd, 0x00001fcf,
+ 0x00001fdd, 0x00001fdf, 0x00001fed, 0x00001fef,
+ 0x00001ffd, 0x00001ffe, 0x0000309b, 0x0000309c,
+ 0x0000a700, 0x0000a716, 0x0000a720, 0x0000a721,
+ 0x0000a789, 0x0000a78a, 0x0000ab5b, 0x0000ab5b,
+ 0x0000fbb2, 0x0000fbc1, 0x0000ff3e, 0x0000ff3e,
+ 0x0000ff40, 0x0000ff40, 0x0000ffe3, 0x0000ffe3,
+ 0x0001f3fb, 0x0001f3ff, 0x000000a6, 0x000000a6,
+ 0x000000a9, 0x000000a9, 0x000000ae, 0x000000ae,
+ 0x000000b0, 0x000000b0, 0x00000482, 0x00000482,
+ 0x0000058d, 0x0000058e, 0x0000060e, 0x0000060f,
+ 0x000006de, 0x000006de, 0x000006e9, 0x000006e9,
+ 0x000006fd, 0x000006fe, 0x000007f6, 0x000007f6,
+ 0x000009fa, 0x000009fa, 0x00000b70, 0x00000b70,
+ 0x00000bf3, 0x00000bf8, 0x00000bfa, 0x00000bfa,
+ 0x00000c7f, 0x00000c7f, 0x00000d4f, 0x00000d4f,
+ 0x00000d79, 0x00000d79, 0x00000f01, 0x00000f03,
+ 0x00000f13, 0x00000f13, 0x00000f15, 0x00000f17,
+ 0x00000f1a, 0x00000f1f, 0x00000f34, 0x00000f34,
+ 0x00000f36, 0x00000f36, 0x00000f38, 0x00000f38,
+ 0x00000fbe, 0x00000fc5, 0x00000fc7, 0x00000fcc,
+ 0x00000fce, 0x00000fcf, 0x00000fd5, 0x00000fd8,
+ 0x0000109e, 0x0000109f, 0x00001390, 0x00001399,
+ 0x00001940, 0x00001940, 0x000019de, 0x000019ff,
+ 0x00001b61, 0x00001b6a, 0x00001b74, 0x00001b7c,
+ 0x00002100, 0x00002101, 0x00002103, 0x00002106,
+ 0x00002108, 0x00002109, 0x00002114, 0x00002114,
+ 0x00002116, 0x00002117, 0x0000211e, 0x00002123,
+ 0x00002125, 0x00002125, 0x00002127, 0x00002127,
+ 0x00002129, 0x00002129, 0x0000212e, 0x0000212e,
+ 0x0000213a, 0x0000213b, 0x0000214a, 0x0000214a,
+ 0x0000214c, 0x0000214d, 0x0000214f, 0x0000214f,
+ 0x0000218a, 0x0000218b, 0x00002195, 0x00002199,
+ 0x0000219c, 0x0000219f, 0x000021a1, 0x000021a2,
+ 0x000021a4, 0x000021a5, 0x000021a7, 0x000021ad,
+ 0x000021af, 0x000021cd, 0x000021d0, 0x000021d1,
+ 0x000021d3, 0x000021d3, 0x000021d5, 0x000021f3,
+ 0x00002300, 0x00002307, 0x0000230c, 0x0000231f,
+ 0x00002322, 0x00002328, 0x0000232b, 0x0000237b,
+ 0x0000237d, 0x0000239a, 0x000023b4, 0x000023db,
+ 0x000023e2, 0x00002426, 0x00002440, 0x0000244a,
+ 0x0000249c, 0x000024e9, 0x00002500, 0x000025b6,
+ 0x000025b8, 0x000025c0, 0x000025c2, 0x000025f7,
+ 0x00002600, 0x0000266e, 0x00002670, 0x00002767,
+ 0x00002794, 0x000027bf, 0x00002800, 0x000028ff,
+ 0x00002b00, 0x00002b2f, 0x00002b45, 0x00002b46,
+ 0x00002b4d, 0x00002b73, 0x00002b76, 0x00002b95,
+ 0x00002b98, 0x00002bb9, 0x00002bbd, 0x00002bc8,
+ 0x00002bca, 0x00002bd2, 0x00002bec, 0x00002bef,
+ 0x00002ce5, 0x00002cea, 0x00002e80, 0x00002e99,
+ 0x00002e9b, 0x00002ef3, 0x00002f00, 0x00002fd5,
+ 0x00002ff0, 0x00002ffb, 0x00003004, 0x00003004,
+ 0x00003012, 0x00003013, 0x00003020, 0x00003020,
+ 0x00003036, 0x00003037, 0x0000303e, 0x0000303f,
+ 0x00003190, 0x00003191, 0x00003196, 0x0000319f,
+ 0x000031c0, 0x000031e3, 0x00003200, 0x0000321e,
+ 0x0000322a, 0x00003247, 0x00003250, 0x00003250,
+ 0x00003260, 0x0000327f, 0x0000328a, 0x000032b0,
+ 0x000032c0, 0x000032fe, 0x00003300, 0x000033ff,
+ 0x00004dc0, 0x00004dff, 0x0000a490, 0x0000a4c6,
+ 0x0000a828, 0x0000a82b, 0x0000a836, 0x0000a837,
+ 0x0000a839, 0x0000a839, 0x0000aa77, 0x0000aa79,
+ 0x0000fdfd, 0x0000fdfd, 0x0000ffe4, 0x0000ffe4,
+ 0x0000ffe8, 0x0000ffe8, 0x0000ffed, 0x0000ffee,
+ 0x0000fffc, 0x0000fffd, 0x00010137, 0x0001013f,
+ 0x00010179, 0x00010189, 0x0001018c, 0x0001018e,
+ 0x00010190, 0x0001019b, 0x000101a0, 0x000101a0,
+ 0x000101d0, 0x000101fc, 0x00010877, 0x00010878,
+ 0x00010ac8, 0x00010ac8, 0x0001173f, 0x0001173f,
+ 0x00016b3c, 0x00016b3f, 0x00016b45, 0x00016b45,
+ 0x0001bc9c, 0x0001bc9c, 0x0001d000, 0x0001d0f5,
+ 0x0001d100, 0x0001d126, 0x0001d129, 0x0001d164,
+ 0x0001d16a, 0x0001d16c, 0x0001d183, 0x0001d184,
+ 0x0001d18c, 0x0001d1a9, 0x0001d1ae, 0x0001d1e8,
+ 0x0001d200, 0x0001d241, 0x0001d245, 0x0001d245,
+ 0x0001d300, 0x0001d356, 0x0001d800, 0x0001d9ff,
+ 0x0001da37, 0x0001da3a, 0x0001da6d, 0x0001da74,
+ 0x0001da76, 0x0001da83, 0x0001da85, 0x0001da86,
+ 0x0001f000, 0x0001f02b, 0x0001f030, 0x0001f093,
+ 0x0001f0a0, 0x0001f0ae, 0x0001f0b1, 0x0001f0bf,
+ 0x0001f0c1, 0x0001f0cf, 0x0001f0d1, 0x0001f0f5,
+ 0x0001f110, 0x0001f12e, 0x0001f130, 0x0001f16b,
+ 0x0001f170, 0x0001f1ac, 0x0001f1e6, 0x0001f202,
+ 0x0001f210, 0x0001f23b, 0x0001f240, 0x0001f248,
+ 0x0001f250, 0x0001f251, 0x0001f260, 0x0001f265,
+ 0x0001f300, 0x0001f3fa, 0x0001f400, 0x0001f6d4,
+ 0x0001f6e0, 0x0001f6ec, 0x0001f6f0, 0x0001f6f8,
+ 0x0001f700, 0x0001f773, 0x0001f780, 0x0001f7d4,
+ 0x0001f800, 0x0001f80b, 0x0001f810, 0x0001f847,
+ 0x0001f850, 0x0001f859, 0x0001f860, 0x0001f887,
+ 0x0001f890, 0x0001f8ad, 0x0001f900, 0x0001f90b,
+ 0x0001f910, 0x0001f93e, 0x0001f940, 0x0001f94c,
+ 0x0001f950, 0x0001f96b, 0x0001f980, 0x0001f997,
+ 0x0001f9c0, 0x0001f9c0, 0x0001f9d0, 0x0001f9e6,
+ 0x00000041, 0x0000005a, 0x00000061, 0x0000007a,
+ 0x000000aa, 0x000000aa, 0x000000b5, 0x000000b5,
+ 0x000000ba, 0x000000ba, 0x000000c0, 0x000000d6,
+ 0x000000d8, 0x000000f6, 0x000000f8, 0x000002b8,
+ 0x000002bb, 0x000002c1, 0x000002d0, 0x000002d1,
+ 0x000002e0, 0x000002e4, 0x000002ee, 0x000002ee,
+ 0x00000370, 0x00000373, 0x00000376, 0x00000377,
+ 0x0000037a, 0x0000037d, 0x0000037f, 0x0000037f,
+ 0x00000386, 0x00000386, 0x00000388, 0x0000038a,
+ 0x0000038c, 0x0000038c, 0x0000038e, 0x000003a1,
+ 0x000003a3, 0x000003f5, 0x000003f7, 0x00000482,
+ 0x0000048a, 0x0000052f, 0x00000531, 0x00000556,
+ 0x00000559, 0x0000055f, 0x00000561, 0x00000587,
+ 0x00000589, 0x00000589, 0x00000903, 0x00000939,
+ 0x0000093b, 0x0000093b, 0x0000093d, 0x00000940,
+ 0x00000949, 0x0000094c, 0x0000094e, 0x00000950,
+ 0x00000958, 0x00000961, 0x00000964, 0x00000980,
+ 0x00000982, 0x00000983, 0x00000985, 0x0000098c,
+ 0x0000098f, 0x00000990, 0x00000993, 0x000009a8,
+ 0x000009aa, 0x000009b0, 0x000009b2, 0x000009b2,
+ 0x000009b6, 0x000009b9, 0x000009bd, 0x000009c0,
+ 0x000009c7, 0x000009c8, 0x000009cb, 0x000009cc,
+ 0x000009ce, 0x000009ce, 0x000009d7, 0x000009d7,
+ 0x000009dc, 0x000009dd, 0x000009df, 0x000009e1,
+ 0x000009e6, 0x000009f1, 0x000009f4, 0x000009fa,
+ 0x000009fc, 0x000009fd, 0x00000a03, 0x00000a03,
+ 0x00000a05, 0x00000a0a, 0x00000a0f, 0x00000a10,
+ 0x00000a13, 0x00000a28, 0x00000a2a, 0x00000a30,
+ 0x00000a32, 0x00000a33, 0x00000a35, 0x00000a36,
+ 0x00000a38, 0x00000a39, 0x00000a3e, 0x00000a40,
+ 0x00000a59, 0x00000a5c, 0x00000a5e, 0x00000a5e,
+ 0x00000a66, 0x00000a6f, 0x00000a72, 0x00000a74,
+ 0x00000a83, 0x00000a83, 0x00000a85, 0x00000a8d,
+ 0x00000a8f, 0x00000a91, 0x00000a93, 0x00000aa8,
+ 0x00000aaa, 0x00000ab0, 0x00000ab2, 0x00000ab3,
+ 0x00000ab5, 0x00000ab9, 0x00000abd, 0x00000ac0,
+ 0x00000ac9, 0x00000ac9, 0x00000acb, 0x00000acc,
+ 0x00000ad0, 0x00000ad0, 0x00000ae0, 0x00000ae1,
+ 0x00000ae6, 0x00000af0, 0x00000af9, 0x00000af9,
+ 0x00000b02, 0x00000b03, 0x00000b05, 0x00000b0c,
+ 0x00000b0f, 0x00000b10, 0x00000b13, 0x00000b28,
+ 0x00000b2a, 0x00000b30, 0x00000b32, 0x00000b33,
+ 0x00000b35, 0x00000b39, 0x00000b3d, 0x00000b3e,
+ 0x00000b40, 0x00000b40, 0x00000b47, 0x00000b48,
+ 0x00000b4b, 0x00000b4c, 0x00000b57, 0x00000b57,
+ 0x00000b5c, 0x00000b5d, 0x00000b5f, 0x00000b61,
+ 0x00000b66, 0x00000b77, 0x00000b83, 0x00000b83,
+ 0x00000b85, 0x00000b8a, 0x00000b8e, 0x00000b90,
+ 0x00000b92, 0x00000b95, 0x00000b99, 0x00000b9a,
+ 0x00000b9c, 0x00000b9c, 0x00000b9e, 0x00000b9f,
+ 0x00000ba3, 0x00000ba4, 0x00000ba8, 0x00000baa,
+ 0x00000bae, 0x00000bb9, 0x00000bbe, 0x00000bbf,
+ 0x00000bc1, 0x00000bc2, 0x00000bc6, 0x00000bc8,
+ 0x00000bca, 0x00000bcc, 0x00000bd0, 0x00000bd0,
+ 0x00000bd7, 0x00000bd7, 0x00000be6, 0x00000bf2,
+ 0x00000c01, 0x00000c03, 0x00000c05, 0x00000c0c,
+ 0x00000c0e, 0x00000c10, 0x00000c12, 0x00000c28,
+ 0x00000c2a, 0x00000c39, 0x00000c3d, 0x00000c3d,
+ 0x00000c41, 0x00000c44, 0x00000c58, 0x00000c5a,
+ 0x00000c60, 0x00000c61, 0x00000c66, 0x00000c6f,
+ 0x00000c7f, 0x00000c80, 0x00000c82, 0x00000c83,
+ 0x00000c85, 0x00000c8c, 0x00000c8e, 0x00000c90,
+ 0x00000c92, 0x00000ca8, 0x00000caa, 0x00000cb3,
+ 0x00000cb5, 0x00000cb9, 0x00000cbd, 0x00000cc4,
+ 0x00000cc6, 0x00000cc8, 0x00000cca, 0x00000ccb,
+ 0x00000cd5, 0x00000cd6, 0x00000cde, 0x00000cde,
+ 0x00000ce0, 0x00000ce1, 0x00000ce6, 0x00000cef,
+ 0x00000cf1, 0x00000cf2, 0x00000d02, 0x00000d03,
+ 0x00000d05, 0x00000d0c, 0x00000d0e, 0x00000d10,
+ 0x00000d12, 0x00000d3a, 0x00000d3d, 0x00000d40,
+ 0x00000d46, 0x00000d48, 0x00000d4a, 0x00000d4c,
+ 0x00000d4e, 0x00000d4f, 0x00000d54, 0x00000d61,
+ 0x00000d66, 0x00000d7f, 0x00000d82, 0x00000d83,
+ 0x00000d85, 0x00000d96, 0x00000d9a, 0x00000db1,
+ 0x00000db3, 0x00000dbb, 0x00000dbd, 0x00000dbd,
+ 0x00000dc0, 0x00000dc6, 0x00000dcf, 0x00000dd1,
+ 0x00000dd8, 0x00000ddf, 0x00000de6, 0x00000def,
+ 0x00000df2, 0x00000df4, 0x00000e01, 0x00000e30,
+ 0x00000e32, 0x00000e33, 0x00000e40, 0x00000e46,
+ 0x00000e4f, 0x00000e5b, 0x00000e81, 0x00000e82,
+ 0x00000e84, 0x00000e84, 0x00000e87, 0x00000e88,
+ 0x00000e8a, 0x00000e8a, 0x00000e8d, 0x00000e8d,
+ 0x00000e94, 0x00000e97, 0x00000e99, 0x00000e9f,
+ 0x00000ea1, 0x00000ea3, 0x00000ea5, 0x00000ea5,
+ 0x00000ea7, 0x00000ea7, 0x00000eaa, 0x00000eab,
+ 0x00000ead, 0x00000eb0, 0x00000eb2, 0x00000eb3,
+ 0x00000ebd, 0x00000ebd, 0x00000ec0, 0x00000ec4,
+ 0x00000ec6, 0x00000ec6, 0x00000ed0, 0x00000ed9,
+ 0x00000edc, 0x00000edf, 0x00000f00, 0x00000f17,
+ 0x00000f1a, 0x00000f34, 0x00000f36, 0x00000f36,
+ 0x00000f38, 0x00000f38, 0x00000f3e, 0x00000f47,
+ 0x00000f49, 0x00000f6c, 0x00000f7f, 0x00000f7f,
+ 0x00000f85, 0x00000f85, 0x00000f88, 0x00000f8c,
+ 0x00000fbe, 0x00000fc5, 0x00000fc7, 0x00000fcc,
+ 0x00000fce, 0x00000fda, 0x00001000, 0x0000102c,
+ 0x00001031, 0x00001031, 0x00001038, 0x00001038,
+ 0x0000103b, 0x0000103c, 0x0000103f, 0x00001057,
+ 0x0000105a, 0x0000105d, 0x00001061, 0x00001070,
+ 0x00001075, 0x00001081, 0x00001083, 0x00001084,
+ 0x00001087, 0x0000108c, 0x0000108e, 0x0000109c,
+ 0x0000109e, 0x000010c5, 0x000010c7, 0x000010c7,
+ 0x000010cd, 0x000010cd, 0x000010d0, 0x00001248,
+ 0x0000124a, 0x0000124d, 0x00001250, 0x00001256,
+ 0x00001258, 0x00001258, 0x0000125a, 0x0000125d,
+ 0x00001260, 0x00001288, 0x0000128a, 0x0000128d,
+ 0x00001290, 0x000012b0, 0x000012b2, 0x000012b5,
+ 0x000012b8, 0x000012be, 0x000012c0, 0x000012c0,
+ 0x000012c2, 0x000012c5, 0x000012c8, 0x000012d6,
+ 0x000012d8, 0x00001310, 0x00001312, 0x00001315,
+ 0x00001318, 0x0000135a, 0x00001360, 0x0000137c,
+ 0x00001380, 0x0000138f, 0x000013a0, 0x000013f5,
+ 0x000013f8, 0x000013fd, 0x00001401, 0x0000167f,
+ 0x00001681, 0x0000169a, 0x000016a0, 0x000016f8,
+ 0x00001700, 0x0000170c, 0x0000170e, 0x00001711,
+ 0x00001720, 0x00001731, 0x00001735, 0x00001736,
+ 0x00001740, 0x00001751, 0x00001760, 0x0000176c,
+ 0x0000176e, 0x00001770, 0x00001780, 0x000017b3,
+ 0x000017b6, 0x000017b6, 0x000017be, 0x000017c5,
+ 0x000017c7, 0x000017c8, 0x000017d4, 0x000017da,
+ 0x000017dc, 0x000017dc, 0x000017e0, 0x000017e9,
+ 0x00001810, 0x00001819, 0x00001820, 0x00001877,
+ 0x00001880, 0x00001884, 0x00001887, 0x000018a8,
+ 0x000018aa, 0x000018aa, 0x000018b0, 0x000018f5,
+ 0x00001900, 0x0000191e, 0x00001923, 0x00001926,
+ 0x00001929, 0x0000192b, 0x00001930, 0x00001931,
+ 0x00001933, 0x00001938, 0x00001946, 0x0000196d,
+ 0x00001970, 0x00001974, 0x00001980, 0x000019ab,
+ 0x000019b0, 0x000019c9, 0x000019d0, 0x000019da,
+ 0x00001a00, 0x00001a16, 0x00001a19, 0x00001a1a,
+ 0x00001a1e, 0x00001a55, 0x00001a57, 0x00001a57,
+ 0x00001a61, 0x00001a61, 0x00001a63, 0x00001a64,
+ 0x00001a6d, 0x00001a72, 0x00001a80, 0x00001a89,
+ 0x00001a90, 0x00001a99, 0x00001aa0, 0x00001aad,
+ 0x00001b04, 0x00001b33, 0x00001b35, 0x00001b35,
+ 0x00001b3b, 0x00001b3b, 0x00001b3d, 0x00001b41,
+ 0x00001b43, 0x00001b4b, 0x00001b50, 0x00001b6a,
+ 0x00001b74, 0x00001b7c, 0x00001b82, 0x00001ba1,
+ 0x00001ba6, 0x00001ba7, 0x00001baa, 0x00001baa,
+ 0x00001bae, 0x00001be5, 0x00001be7, 0x00001be7,
+ 0x00001bea, 0x00001bec, 0x00001bee, 0x00001bee,
+ 0x00001bf2, 0x00001bf3, 0x00001bfc, 0x00001c2b,
+ 0x00001c34, 0x00001c35, 0x00001c3b, 0x00001c49,
+ 0x00001c4d, 0x00001c88, 0x00001cc0, 0x00001cc7,
+ 0x00001cd3, 0x00001cd3, 0x00001ce1, 0x00001ce1,
+ 0x00001ce9, 0x00001cec, 0x00001cee, 0x00001cf3,
+ 0x00001cf5, 0x00001cf7, 0x00001d00, 0x00001dbf,
+ 0x00001e00, 0x00001f15, 0x00001f18, 0x00001f1d,
+ 0x00001f20, 0x00001f45, 0x00001f48, 0x00001f4d,
+ 0x00001f50, 0x00001f57, 0x00001f59, 0x00001f59,
+ 0x00001f5b, 0x00001f5b, 0x00001f5d, 0x00001f5d,
+ 0x00001f5f, 0x00001f7d, 0x00001f80, 0x00001fb4,
+ 0x00001fb6, 0x00001fbc, 0x00001fbe, 0x00001fbe,
+ 0x00001fc2, 0x00001fc4, 0x00001fc6, 0x00001fcc,
+ 0x00001fd0, 0x00001fd3, 0x00001fd6, 0x00001fdb,
+ 0x00001fe0, 0x00001fec, 0x00001ff2, 0x00001ff4,
+ 0x00001ff6, 0x00001ffc, 0x0000200e, 0x0000200e,
+ 0x00002071, 0x00002071, 0x0000207f, 0x0000207f,
+ 0x00002090, 0x0000209c, 0x00002102, 0x00002102,
+ 0x00002107, 0x00002107, 0x0000210a, 0x00002113,
+ 0x00002115, 0x00002115, 0x00002119, 0x0000211d,
+ 0x00002124, 0x00002124, 0x00002126, 0x00002126,
+ 0x00002128, 0x00002128, 0x0000212a, 0x0000212d,
+ 0x0000212f, 0x00002139, 0x0000213c, 0x0000213f,
+ 0x00002145, 0x00002149, 0x0000214e, 0x0000214f,
+ 0x00002160, 0x00002188, 0x00002336, 0x0000237a,
+ 0x00002395, 0x00002395, 0x0000249c, 0x000024e9,
+ 0x000026ac, 0x000026ac, 0x00002800, 0x000028ff,
+ 0x00002c00, 0x00002c2e, 0x00002c30, 0x00002c5e,
+ 0x00002c60, 0x00002ce4, 0x00002ceb, 0x00002cee,
+ 0x00002cf2, 0x00002cf3, 0x00002d00, 0x00002d25,
+ 0x00002d27, 0x00002d27, 0x00002d2d, 0x00002d2d,
+ 0x00002d30, 0x00002d67, 0x00002d6f, 0x00002d70,
+ 0x00002d80, 0x00002d96, 0x00002da0, 0x00002da6,
+ 0x00002da8, 0x00002dae, 0x00002db0, 0x00002db6,
+ 0x00002db8, 0x00002dbe, 0x00002dc0, 0x00002dc6,
+ 0x00002dc8, 0x00002dce, 0x00002dd0, 0x00002dd6,
+ 0x00002dd8, 0x00002dde, 0x00003005, 0x00003007,
+ 0x00003021, 0x00003029, 0x0000302e, 0x0000302f,
+ 0x00003031, 0x00003035, 0x00003038, 0x0000303c,
+ 0x00003041, 0x00003096, 0x0000309d, 0x0000309f,
+ 0x000030a1, 0x000030fa, 0x000030fc, 0x000030ff,
+ 0x00003105, 0x0000312e, 0x00003131, 0x0000318e,
+ 0x00003190, 0x000031ba, 0x000031f0, 0x0000321c,
+ 0x00003220, 0x0000324f, 0x00003260, 0x0000327b,
+ 0x0000327f, 0x000032b0, 0x000032c0, 0x000032cb,
+ 0x000032d0, 0x000032fe, 0x00003300, 0x00003376,
+ 0x0000337b, 0x000033dd, 0x000033e0, 0x000033fe,
+ 0x00003400, 0x00004db5, 0x00004e00, 0x00009fea,
+ 0x0000a000, 0x0000a48c, 0x0000a4d0, 0x0000a60c,
0x0000a610, 0x0000a62b, 0x0000a640, 0x0000a66e,
0x0000a680, 0x0000a69d, 0x0000a6a0, 0x0000a6ef,
0x0000a6f2, 0x0000a6f7, 0x0000a722, 0x0000a787,
@@ -1759,15 +1757,120 @@ static const unsigned int _ucprop_ranges[] = {
0x0000abe6, 0x0000abe7, 0x0000abe9, 0x0000abec,
0x0000abf0, 0x0000abf9, 0x0000ac00, 0x0000d7a3,
0x0000d7b0, 0x0000d7c6, 0x0000d7cb, 0x0000d7fb,
- 0x0000e000, 0x0000fb06, 0x0000fb13, 0x0000fb17,
+ 0x0000d800, 0x0000fa6d, 0x0000fa70, 0x0000fad9,
+ 0x0000fb00, 0x0000fb06, 0x0000fb13, 0x0000fb17,
0x0000ff21, 0x0000ff3a, 0x0000ff41, 0x0000ff5a,
0x0000ff66, 0x0000ffbe, 0x0000ffc2, 0x0000ffc7,
0x0000ffca, 0x0000ffcf, 0x0000ffd2, 0x0000ffd7,
- 0x0000ffda, 0x0000ffdc, 0x00010000, 0x0002a6d6,
- 0x0002a700, 0x0002a700, 0x0002b734, 0x0002b734,
- 0x0002b740, 0x0002b740, 0x0002b81d, 0x0002b81d,
- 0x0002b820, 0x0002b820, 0x0002cea1, 0x0002cea1,
- 0x0002ceb0, 0x0002ceb0, 0x0002ebe0, 0x0002ebe0,
+ 0x0000ffda, 0x0000ffdc, 0x00010000, 0x0001000b,
+ 0x0001000d, 0x00010026, 0x00010028, 0x0001003a,
+ 0x0001003c, 0x0001003d, 0x0001003f, 0x0001004d,
+ 0x00010050, 0x0001005d, 0x00010080, 0x000100fa,
+ 0x00010100, 0x00010100, 0x00010102, 0x00010102,
+ 0x00010107, 0x00010133, 0x00010137, 0x0001013f,
+ 0x0001018d, 0x0001018e, 0x000101d0, 0x000101fc,
+ 0x00010280, 0x0001029c, 0x000102a0, 0x000102d0,
+ 0x00010300, 0x00010323, 0x0001032d, 0x0001034a,
+ 0x00010350, 0x00010375, 0x00010380, 0x0001039d,
+ 0x0001039f, 0x000103c3, 0x000103c8, 0x000103d5,
+ 0x00010400, 0x0001049d, 0x000104a0, 0x000104a9,
+ 0x000104b0, 0x000104d3, 0x000104d8, 0x000104fb,
+ 0x00010500, 0x00010527, 0x00010530, 0x00010563,
+ 0x0001056f, 0x0001056f, 0x00010600, 0x00010736,
+ 0x00010740, 0x00010755, 0x00010760, 0x00010767,
+ 0x00011000, 0x00011000, 0x00011002, 0x00011037,
+ 0x00011047, 0x0001104d, 0x00011066, 0x0001106f,
+ 0x00011082, 0x000110b2, 0x000110b7, 0x000110b8,
+ 0x000110bb, 0x000110c1, 0x000110d0, 0x000110e8,
+ 0x000110f0, 0x000110f9, 0x00011103, 0x00011126,
+ 0x0001112c, 0x0001112c, 0x00011136, 0x00011143,
+ 0x00011150, 0x00011172, 0x00011174, 0x00011176,
+ 0x00011182, 0x000111b5, 0x000111bf, 0x000111c9,
+ 0x000111cd, 0x000111cd, 0x000111d0, 0x000111df,
+ 0x000111e1, 0x000111f4, 0x00011200, 0x00011211,
+ 0x00011213, 0x0001122e, 0x00011232, 0x00011233,
+ 0x00011235, 0x00011235, 0x00011238, 0x0001123d,
+ 0x00011280, 0x00011286, 0x00011288, 0x00011288,
+ 0x0001128a, 0x0001128d, 0x0001128f, 0x0001129d,
+ 0x0001129f, 0x000112a9, 0x000112b0, 0x000112de,
+ 0x000112e0, 0x000112e2, 0x000112f0, 0x000112f9,
+ 0x00011302, 0x00011303, 0x00011305, 0x0001130c,
+ 0x0001130f, 0x00011310, 0x00011313, 0x00011328,
+ 0x0001132a, 0x00011330, 0x00011332, 0x00011333,
+ 0x00011335, 0x00011339, 0x0001133d, 0x0001133f,
+ 0x00011341, 0x00011344, 0x00011347, 0x00011348,
+ 0x0001134b, 0x0001134d, 0x00011350, 0x00011350,
+ 0x00011357, 0x00011357, 0x0001135d, 0x00011363,
+ 0x00011400, 0x00011437, 0x00011440, 0x00011441,
+ 0x00011445, 0x00011445, 0x00011447, 0x00011459,
+ 0x0001145b, 0x0001145b, 0x0001145d, 0x0001145d,
+ 0x00011480, 0x000114b2, 0x000114b9, 0x000114b9,
+ 0x000114bb, 0x000114be, 0x000114c1, 0x000114c1,
+ 0x000114c4, 0x000114c7, 0x000114d0, 0x000114d9,
+ 0x00011580, 0x000115b1, 0x000115b8, 0x000115bb,
+ 0x000115be, 0x000115be, 0x000115c1, 0x000115db,
+ 0x00011600, 0x00011632, 0x0001163b, 0x0001163c,
+ 0x0001163e, 0x0001163e, 0x00011641, 0x00011644,
+ 0x00011650, 0x00011659, 0x00011680, 0x000116aa,
+ 0x000116ac, 0x000116ac, 0x000116ae, 0x000116af,
+ 0x000116b6, 0x000116b6, 0x000116c0, 0x000116c9,
+ 0x00011700, 0x00011719, 0x00011720, 0x00011721,
+ 0x00011726, 0x00011726, 0x00011730, 0x0001173f,
+ 0x000118a0, 0x000118f2, 0x000118ff, 0x000118ff,
+ 0x00011a00, 0x00011a00, 0x00011a07, 0x00011a08,
+ 0x00011a0b, 0x00011a32, 0x00011a39, 0x00011a3a,
+ 0x00011a3f, 0x00011a46, 0x00011a50, 0x00011a50,
+ 0x00011a57, 0x00011a58, 0x00011a5c, 0x00011a83,
+ 0x00011a86, 0x00011a89, 0x00011a97, 0x00011a97,
+ 0x00011a9a, 0x00011a9c, 0x00011a9e, 0x00011aa2,
+ 0x00011ac0, 0x00011af8, 0x00011c00, 0x00011c08,
+ 0x00011c0a, 0x00011c2f, 0x00011c3e, 0x00011c45,
+ 0x00011c50, 0x00011c6c, 0x00011c70, 0x00011c8f,
+ 0x00011ca9, 0x00011ca9, 0x00011cb1, 0x00011cb1,
+ 0x00011cb4, 0x00011cb4, 0x00011d00, 0x00011d06,
+ 0x00011d08, 0x00011d09, 0x00011d0b, 0x00011d30,
+ 0x00011d46, 0x00011d46, 0x00011d50, 0x00011d59,
+ 0x00012000, 0x00012399, 0x00012400, 0x0001246e,
+ 0x00012470, 0x00012474, 0x00012480, 0x00012543,
+ 0x00013000, 0x0001342e, 0x00014400, 0x00014646,
+ 0x00016800, 0x00016a38, 0x00016a40, 0x00016a5e,
+ 0x00016a60, 0x00016a69, 0x00016a6e, 0x00016a6f,
+ 0x00016ad0, 0x00016aed, 0x00016af5, 0x00016af5,
+ 0x00016b00, 0x00016b2f, 0x00016b37, 0x00016b45,
+ 0x00016b50, 0x00016b59, 0x00016b5b, 0x00016b61,
+ 0x00016b63, 0x00016b77, 0x00016b7d, 0x00016b8f,
+ 0x00016f00, 0x00016f44, 0x00016f50, 0x00016f7e,
+ 0x00016f93, 0x00016f9f, 0x00016fe0, 0x00016fe1,
+ 0x00017000, 0x000187ec, 0x00018800, 0x00018af2,
+ 0x0001b000, 0x0001b11e, 0x0001b170, 0x0001b2fb,
+ 0x0001bc00, 0x0001bc6a, 0x0001bc70, 0x0001bc7c,
+ 0x0001bc80, 0x0001bc88, 0x0001bc90, 0x0001bc99,
+ 0x0001bc9c, 0x0001bc9c, 0x0001bc9f, 0x0001bc9f,
+ 0x0001d000, 0x0001d0f5, 0x0001d100, 0x0001d126,
+ 0x0001d129, 0x0001d166, 0x0001d16a, 0x0001d172,
+ 0x0001d183, 0x0001d184, 0x0001d18c, 0x0001d1a9,
+ 0x0001d1ae, 0x0001d1e8, 0x0001d360, 0x0001d371,
+ 0x0001d400, 0x0001d454, 0x0001d456, 0x0001d49c,
+ 0x0001d49e, 0x0001d49f, 0x0001d4a2, 0x0001d4a2,
+ 0x0001d4a5, 0x0001d4a6, 0x0001d4a9, 0x0001d4ac,
+ 0x0001d4ae, 0x0001d4b9, 0x0001d4bb, 0x0001d4bb,
+ 0x0001d4bd, 0x0001d4c3, 0x0001d4c5, 0x0001d505,
+ 0x0001d507, 0x0001d50a, 0x0001d50d, 0x0001d514,
+ 0x0001d516, 0x0001d51c, 0x0001d51e, 0x0001d539,
+ 0x0001d53b, 0x0001d53e, 0x0001d540, 0x0001d544,
+ 0x0001d546, 0x0001d546, 0x0001d54a, 0x0001d550,
+ 0x0001d552, 0x0001d6a5, 0x0001d6a8, 0x0001d6da,
+ 0x0001d6dc, 0x0001d714, 0x0001d716, 0x0001d74e,
+ 0x0001d750, 0x0001d788, 0x0001d78a, 0x0001d7c2,
+ 0x0001d7c4, 0x0001d7cb, 0x0001d800, 0x0001d9ff,
+ 0x0001da37, 0x0001da3a, 0x0001da6d, 0x0001da74,
+ 0x0001da76, 0x0001da83, 0x0001da85, 0x0001da8b,
+ 0x0001f110, 0x0001f12e, 0x0001f130, 0x0001f169,
+ 0x0001f170, 0x0001f1ac, 0x0001f1e6, 0x0001f202,
+ 0x0001f210, 0x0001f23b, 0x0001f240, 0x0001f248,
+ 0x0001f250, 0x0001f251, 0x00020000, 0x0002a6d6,
+ 0x0002a700, 0x0002b734, 0x0002b740, 0x0002b81d,
+ 0x0002b820, 0x0002cea1, 0x0002ceb0, 0x0002ebe0,
0x0002f800, 0x0002fa1d, 0x000f0000, 0x000ffffd,
0x00100000, 0x0010fffd, 0x000005be, 0x000005be,
0x000005c0, 0x000005c0, 0x000005c3, 0x000005c3,
@@ -2073,447 +2176,6 @@ static const unsigned int _ucprop_ranges[] = {
0x0001f950, 0x0001f96b, 0x0001f980, 0x0001f997,
0x0001f9c0, 0x0001f9c0, 0x0001f9d0, 0x0001f9e6,
0x000e0001, 0x000e0001, 0x000e0020, 0x000e007f,
- 0x000e0100, 0x000e01ef, 0x000000c0, 0x000000c5,
- 0x000000c7, 0x000000cf, 0x000000d1, 0x000000d6,
- 0x000000d9, 0x000000dd, 0x000000e0, 0x000000e5,
- 0x000000e7, 0x000000ef, 0x000000f1, 0x000000f6,
- 0x000000f9, 0x000000fd, 0x000000ff, 0x0000010f,
- 0x00000112, 0x00000125, 0x00000128, 0x00000130,
- 0x00000134, 0x00000137, 0x00000139, 0x0000013e,
- 0x00000143, 0x00000148, 0x0000014c, 0x00000151,
- 0x00000154, 0x00000165, 0x00000168, 0x0000017e,
- 0x000001a0, 0x000001a1, 0x000001af, 0x000001b0,
- 0x000001cd, 0x000001dc, 0x000001de, 0x000001e3,
- 0x000001e6, 0x000001f0, 0x000001f4, 0x000001f5,
- 0x000001f8, 0x0000021b, 0x0000021e, 0x0000021f,
- 0x00000226, 0x00000233, 0x00000340, 0x00000341,
- 0x00000343, 0x00000344, 0x00000374, 0x00000374,
- 0x0000037e, 0x0000037e, 0x00000385, 0x0000038a,
- 0x0000038c, 0x0000038c, 0x0000038e, 0x00000390,
- 0x000003aa, 0x000003b0, 0x000003ca, 0x000003ce,
- 0x000003d3, 0x000003d4, 0x00000400, 0x00000401,
- 0x00000403, 0x00000403, 0x00000407, 0x00000407,
- 0x0000040c, 0x0000040e, 0x00000419, 0x00000419,
- 0x00000439, 0x00000439, 0x00000450, 0x00000451,
- 0x00000453, 0x00000453, 0x00000457, 0x00000457,
- 0x0000045c, 0x0000045e, 0x00000476, 0x00000477,
- 0x000004c1, 0x000004c2, 0x000004d0, 0x000004d3,
- 0x000004d6, 0x000004d7, 0x000004da, 0x000004df,
- 0x000004e2, 0x000004e7, 0x000004ea, 0x000004f5,
- 0x000004f8, 0x000004f9, 0x00000622, 0x00000626,
- 0x000006c0, 0x000006c0, 0x000006c2, 0x000006c2,
- 0x000006d3, 0x000006d3, 0x00000929, 0x00000929,
- 0x00000931, 0x00000931, 0x00000934, 0x00000934,
- 0x00000958, 0x0000095f, 0x000009cb, 0x000009cc,
- 0x000009dc, 0x000009dd, 0x000009df, 0x000009df,
- 0x00000a33, 0x00000a33, 0x00000a36, 0x00000a36,
- 0x00000a59, 0x00000a5b, 0x00000a5e, 0x00000a5e,
- 0x00000b48, 0x00000b48, 0x00000b4b, 0x00000b4c,
- 0x00000b5c, 0x00000b5d, 0x00000b94, 0x00000b94,
- 0x00000bca, 0x00000bcc, 0x00000c48, 0x00000c48,
- 0x00000cc0, 0x00000cc0, 0x00000cc7, 0x00000cc8,
- 0x00000cca, 0x00000ccb, 0x00000d4a, 0x00000d4c,
- 0x00000dda, 0x00000dda, 0x00000ddc, 0x00000dde,
- 0x00000f43, 0x00000f43, 0x00000f4d, 0x00000f4d,
- 0x00000f52, 0x00000f52, 0x00000f57, 0x00000f57,
- 0x00000f5c, 0x00000f5c, 0x00000f69, 0x00000f69,
- 0x00000f73, 0x00000f73, 0x00000f75, 0x00000f76,
- 0x00000f78, 0x00000f78, 0x00000f81, 0x00000f81,
- 0x00000f93, 0x00000f93, 0x00000f9d, 0x00000f9d,
- 0x00000fa2, 0x00000fa2, 0x00000fa7, 0x00000fa7,
- 0x00000fac, 0x00000fac, 0x00000fb9, 0x00000fb9,
- 0x00001026, 0x00001026, 0x00001b06, 0x00001b06,
- 0x00001b08, 0x00001b08, 0x00001b0a, 0x00001b0a,
- 0x00001b0c, 0x00001b0c, 0x00001b0e, 0x00001b0e,
- 0x00001b12, 0x00001b12, 0x00001b3b, 0x00001b3b,
- 0x00001b3d, 0x00001b3d, 0x00001b40, 0x00001b41,
- 0x00001b43, 0x00001b43, 0x00001e00, 0x00001e99,
- 0x00001e9b, 0x00001e9b, 0x00001ea0, 0x00001ef9,
- 0x00001f00, 0x00001f15, 0x00001f18, 0x00001f1d,
- 0x00001f20, 0x00001f45, 0x00001f48, 0x00001f4d,
- 0x00001f50, 0x00001f57, 0x00001f59, 0x00001f59,
- 0x00001f5b, 0x00001f5b, 0x00001f5d, 0x00001f5d,
- 0x00001f5f, 0x00001f7d, 0x00001f80, 0x00001fb4,
- 0x00001fb6, 0x00001fbc, 0x00001fbe, 0x00001fbe,
- 0x00001fc1, 0x00001fc4, 0x00001fc6, 0x00001fd3,
- 0x00001fd6, 0x00001fdb, 0x00001fdd, 0x00001fef,
- 0x00001ff2, 0x00001ff4, 0x00001ff6, 0x00001ffd,
- 0x00002000, 0x00002001, 0x00002126, 0x00002126,
- 0x0000212a, 0x0000212b, 0x0000219a, 0x0000219b,
- 0x000021ae, 0x000021ae, 0x000021cd, 0x000021cf,
- 0x00002204, 0x00002204, 0x00002209, 0x00002209,
- 0x0000220c, 0x0000220c, 0x00002224, 0x00002224,
- 0x00002226, 0x00002226, 0x00002241, 0x00002241,
- 0x00002244, 0x00002244, 0x00002247, 0x00002247,
- 0x00002249, 0x00002249, 0x00002260, 0x00002260,
- 0x00002262, 0x00002262, 0x0000226d, 0x00002271,
- 0x00002274, 0x00002275, 0x00002278, 0x00002279,
- 0x00002280, 0x00002281, 0x00002284, 0x00002285,
- 0x00002288, 0x00002289, 0x000022ac, 0x000022af,
- 0x000022e0, 0x000022e3, 0x000022ea, 0x000022ed,
- 0x00002329, 0x0000232a, 0x00002adc, 0x00002adc,
- 0x0000304c, 0x0000304c, 0x0000304e, 0x0000304e,
- 0x00003050, 0x00003050, 0x00003052, 0x00003052,
- 0x00003054, 0x00003054, 0x00003056, 0x00003056,
- 0x00003058, 0x00003058, 0x0000305a, 0x0000305a,
- 0x0000305c, 0x0000305c, 0x0000305e, 0x0000305e,
- 0x00003060, 0x00003060, 0x00003062, 0x00003062,
- 0x00003065, 0x00003065, 0x00003067, 0x00003067,
- 0x00003069, 0x00003069, 0x00003070, 0x00003071,
- 0x00003073, 0x00003074, 0x00003076, 0x00003077,
- 0x00003079, 0x0000307a, 0x0000307c, 0x0000307d,
- 0x00003094, 0x00003094, 0x0000309e, 0x0000309e,
- 0x000030ac, 0x000030ac, 0x000030ae, 0x000030ae,
- 0x000030b0, 0x000030b0, 0x000030b2, 0x000030b2,
- 0x000030b4, 0x000030b4, 0x000030b6, 0x000030b6,
- 0x000030b8, 0x000030b8, 0x000030ba, 0x000030ba,
- 0x000030bc, 0x000030bc, 0x000030be, 0x000030be,
- 0x000030c0, 0x000030c0, 0x000030c2, 0x000030c2,
- 0x000030c5, 0x000030c5, 0x000030c7, 0x000030c7,
- 0x000030c9, 0x000030c9, 0x000030d0, 0x000030d1,
- 0x000030d3, 0x000030d4, 0x000030d6, 0x000030d7,
- 0x000030d9, 0x000030da, 0x000030dc, 0x000030dd,
- 0x000030f4, 0x000030f4, 0x000030f7, 0x000030fa,
- 0x000030fe, 0x000030fe, 0x0000f902, 0x0000fa0d,
- 0x0000fa10, 0x0000fa10, 0x0000fa12, 0x0000fa12,
- 0x0000fa15, 0x0000fa1e, 0x0000fa20, 0x0000fa20,
- 0x0000fa22, 0x0000fa22, 0x0000fa25, 0x0000fa26,
- 0x0000fa2a, 0x0000fa6d, 0x0000fa70, 0x0000fad9,
- 0x0000fb1d, 0x0000fb1d, 0x0000fb1f, 0x0000fb1f,
- 0x0000fb2a, 0x0000fb36, 0x0000fb38, 0x0000fb3c,
- 0x0000fb3e, 0x0000fb3e, 0x0000fb40, 0x0000fb41,
- 0x0000fb43, 0x0000fb44, 0x0000fb46, 0x0000fb4e,
- 0x0001109a, 0x0001109a, 0x0001109c, 0x0001109c,
- 0x000110ab, 0x000110ab, 0x0001112e, 0x0001112f,
- 0x0001134b, 0x0001134c, 0x000114bb, 0x000114bc,
- 0x000114be, 0x000114be, 0x000115ba, 0x000115bb,
- 0x0001d15e, 0x0001d164, 0x0001d1bb, 0x0001d1c0,
- 0x0002f800, 0x0002fa1d, 0x00000000, 0x00000377,
- 0x0000037a, 0x0000037f, 0x00000384, 0x0000038a,
- 0x0000038c, 0x0000038c, 0x0000038e, 0x000003a1,
- 0x000003a3, 0x0000052f, 0x00000531, 0x00000556,
- 0x00000559, 0x0000055f, 0x00000561, 0x00000587,
- 0x00000589, 0x0000058a, 0x0000058d, 0x0000058f,
- 0x00000591, 0x000005c7, 0x000005d0, 0x000005ea,
- 0x000005f0, 0x000005f4, 0x00000600, 0x0000061c,
- 0x0000061e, 0x0000070d, 0x0000070f, 0x0000074a,
- 0x0000074d, 0x000007b1, 0x000007c0, 0x000007fa,
- 0x00000800, 0x0000082d, 0x00000830, 0x0000083e,
- 0x00000840, 0x0000085b, 0x0000085e, 0x0000085e,
- 0x00000860, 0x0000086a, 0x000008a0, 0x000008b4,
- 0x000008b6, 0x000008bd, 0x000008d4, 0x00000983,
- 0x00000985, 0x0000098c, 0x0000098f, 0x00000990,
- 0x00000993, 0x000009a8, 0x000009aa, 0x000009b0,
- 0x000009b2, 0x000009b2, 0x000009b6, 0x000009b9,
- 0x000009bc, 0x000009c4, 0x000009c7, 0x000009c8,
- 0x000009cb, 0x000009ce, 0x000009d7, 0x000009d7,
- 0x000009dc, 0x000009dd, 0x000009df, 0x000009e3,
- 0x000009e6, 0x000009fd, 0x00000a01, 0x00000a03,
- 0x00000a05, 0x00000a0a, 0x00000a0f, 0x00000a10,
- 0x00000a13, 0x00000a28, 0x00000a2a, 0x00000a30,
- 0x00000a32, 0x00000a33, 0x00000a35, 0x00000a36,
- 0x00000a38, 0x00000a39, 0x00000a3c, 0x00000a3c,
- 0x00000a3e, 0x00000a42, 0x00000a47, 0x00000a48,
- 0x00000a4b, 0x00000a4d, 0x00000a51, 0x00000a51,
- 0x00000a59, 0x00000a5c, 0x00000a5e, 0x00000a5e,
- 0x00000a66, 0x00000a75, 0x00000a81, 0x00000a83,
- 0x00000a85, 0x00000a8d, 0x00000a8f, 0x00000a91,
- 0x00000a93, 0x00000aa8, 0x00000aaa, 0x00000ab0,
- 0x00000ab2, 0x00000ab3, 0x00000ab5, 0x00000ab9,
- 0x00000abc, 0x00000ac5, 0x00000ac7, 0x00000ac9,
- 0x00000acb, 0x00000acd, 0x00000ad0, 0x00000ad0,
- 0x00000ae0, 0x00000ae3, 0x00000ae6, 0x00000af1,
- 0x00000af9, 0x00000aff, 0x00000b01, 0x00000b03,
- 0x00000b05, 0x00000b0c, 0x00000b0f, 0x00000b10,
- 0x00000b13, 0x00000b28, 0x00000b2a, 0x00000b30,
- 0x00000b32, 0x00000b33, 0x00000b35, 0x00000b39,
- 0x00000b3c, 0x00000b44, 0x00000b47, 0x00000b48,
- 0x00000b4b, 0x00000b4d, 0x00000b56, 0x00000b57,
- 0x00000b5c, 0x00000b5d, 0x00000b5f, 0x00000b63,
- 0x00000b66, 0x00000b77, 0x00000b82, 0x00000b83,
- 0x00000b85, 0x00000b8a, 0x00000b8e, 0x00000b90,
- 0x00000b92, 0x00000b95, 0x00000b99, 0x00000b9a,
- 0x00000b9c, 0x00000b9c, 0x00000b9e, 0x00000b9f,
- 0x00000ba3, 0x00000ba4, 0x00000ba8, 0x00000baa,
- 0x00000bae, 0x00000bb9, 0x00000bbe, 0x00000bc2,
- 0x00000bc6, 0x00000bc8, 0x00000bca, 0x00000bcd,
- 0x00000bd0, 0x00000bd0, 0x00000bd7, 0x00000bd7,
- 0x00000be6, 0x00000bfa, 0x00000c00, 0x00000c03,
- 0x00000c05, 0x00000c0c, 0x00000c0e, 0x00000c10,
- 0x00000c12, 0x00000c28, 0x00000c2a, 0x00000c39,
- 0x00000c3d, 0x00000c44, 0x00000c46, 0x00000c48,
- 0x00000c4a, 0x00000c4d, 0x00000c55, 0x00000c56,
- 0x00000c58, 0x00000c5a, 0x00000c60, 0x00000c63,
- 0x00000c66, 0x00000c6f, 0x00000c78, 0x00000c83,
- 0x00000c85, 0x00000c8c, 0x00000c8e, 0x00000c90,
- 0x00000c92, 0x00000ca8, 0x00000caa, 0x00000cb3,
- 0x00000cb5, 0x00000cb9, 0x00000cbc, 0x00000cc4,
- 0x00000cc6, 0x00000cc8, 0x00000cca, 0x00000ccd,
- 0x00000cd5, 0x00000cd6, 0x00000cde, 0x00000cde,
- 0x00000ce0, 0x00000ce3, 0x00000ce6, 0x00000cef,
- 0x00000cf1, 0x00000cf2, 0x00000d00, 0x00000d03,
- 0x00000d05, 0x00000d0c, 0x00000d0e, 0x00000d10,
- 0x00000d12, 0x00000d44, 0x00000d46, 0x00000d48,
- 0x00000d4a, 0x00000d4f, 0x00000d54, 0x00000d63,
- 0x00000d66, 0x00000d7f, 0x00000d82, 0x00000d83,
- 0x00000d85, 0x00000d96, 0x00000d9a, 0x00000db1,
- 0x00000db3, 0x00000dbb, 0x00000dbd, 0x00000dbd,
- 0x00000dc0, 0x00000dc6, 0x00000dca, 0x00000dca,
- 0x00000dcf, 0x00000dd4, 0x00000dd6, 0x00000dd6,
- 0x00000dd8, 0x00000ddf, 0x00000de6, 0x00000def,
- 0x00000df2, 0x00000df4, 0x00000e01, 0x00000e3a,
- 0x00000e3f, 0x00000e5b, 0x00000e81, 0x00000e82,
- 0x00000e84, 0x00000e84, 0x00000e87, 0x00000e88,
- 0x00000e8a, 0x00000e8a, 0x00000e8d, 0x00000e8d,
- 0x00000e94, 0x00000e97, 0x00000e99, 0x00000e9f,
- 0x00000ea1, 0x00000ea3, 0x00000ea5, 0x00000ea5,
- 0x00000ea7, 0x00000ea7, 0x00000eaa, 0x00000eab,
- 0x00000ead, 0x00000eb9, 0x00000ebb, 0x00000ebd,
- 0x00000ec0, 0x00000ec4, 0x00000ec6, 0x00000ec6,
- 0x00000ec8, 0x00000ecd, 0x00000ed0, 0x00000ed9,
- 0x00000edc, 0x00000edf, 0x00000f00, 0x00000f47,
- 0x00000f49, 0x00000f6c, 0x00000f71, 0x00000f97,
- 0x00000f99, 0x00000fbc, 0x00000fbe, 0x00000fcc,
- 0x00000fce, 0x00000fda, 0x00001000, 0x000010c5,
- 0x000010c7, 0x000010c7, 0x000010cd, 0x000010cd,
- 0x000010d0, 0x00001248, 0x0000124a, 0x0000124d,
- 0x00001250, 0x00001256, 0x00001258, 0x00001258,
- 0x0000125a, 0x0000125d, 0x00001260, 0x00001288,
- 0x0000128a, 0x0000128d, 0x00001290, 0x000012b0,
- 0x000012b2, 0x000012b5, 0x000012b8, 0x000012be,
- 0x000012c0, 0x000012c0, 0x000012c2, 0x000012c5,
- 0x000012c8, 0x000012d6, 0x000012d8, 0x00001310,
- 0x00001312, 0x00001315, 0x00001318, 0x0000135a,
- 0x0000135d, 0x0000137c, 0x00001380, 0x00001399,
- 0x000013a0, 0x000013f5, 0x000013f8, 0x000013fd,
- 0x00001400, 0x0000169c, 0x000016a0, 0x000016f8,
- 0x00001700, 0x0000170c, 0x0000170e, 0x00001714,
- 0x00001720, 0x00001736, 0x00001740, 0x00001753,
- 0x00001760, 0x0000176c, 0x0000176e, 0x00001770,
- 0x00001772, 0x00001773, 0x00001780, 0x000017dd,
- 0x000017e0, 0x000017e9, 0x000017f0, 0x000017f9,
- 0x00001800, 0x0000180e, 0x00001810, 0x00001819,
- 0x00001820, 0x00001877, 0x00001880, 0x000018aa,
- 0x000018b0, 0x000018f5, 0x00001900, 0x0000191e,
- 0x00001920, 0x0000192b, 0x00001930, 0x0000193b,
- 0x00001940, 0x00001940, 0x00001944, 0x0000196d,
- 0x00001970, 0x00001974, 0x00001980, 0x000019ab,
- 0x000019b0, 0x000019c9, 0x000019d0, 0x000019da,
- 0x000019de, 0x00001a1b, 0x00001a1e, 0x00001a5e,
- 0x00001a60, 0x00001a7c, 0x00001a7f, 0x00001a89,
- 0x00001a90, 0x00001a99, 0x00001aa0, 0x00001aad,
- 0x00001ab0, 0x00001abe, 0x00001b00, 0x00001b4b,
- 0x00001b50, 0x00001b7c, 0x00001b80, 0x00001bf3,
- 0x00001bfc, 0x00001c37, 0x00001c3b, 0x00001c49,
- 0x00001c4d, 0x00001c88, 0x00001cc0, 0x00001cc7,
- 0x00001cd0, 0x00001cf9, 0x00001d00, 0x00001df9,
- 0x00001dfb, 0x00001f15, 0x00001f18, 0x00001f1d,
- 0x00001f20, 0x00001f45, 0x00001f48, 0x00001f4d,
- 0x00001f50, 0x00001f57, 0x00001f59, 0x00001f59,
- 0x00001f5b, 0x00001f5b, 0x00001f5d, 0x00001f5d,
- 0x00001f5f, 0x00001f7d, 0x00001f80, 0x00001fb4,
- 0x00001fb6, 0x00001fc4, 0x00001fc6, 0x00001fd3,
- 0x00001fd6, 0x00001fdb, 0x00001fdd, 0x00001fef,
- 0x00001ff2, 0x00001ff4, 0x00001ff6, 0x00001ffe,
- 0x00002000, 0x00002064, 0x00002066, 0x00002071,
- 0x00002074, 0x0000208e, 0x00002090, 0x0000209c,
- 0x000020a0, 0x000020bf, 0x000020d0, 0x000020f0,
- 0x00002100, 0x0000218b, 0x00002190, 0x00002426,
- 0x00002440, 0x0000244a, 0x00002460, 0x00002b73,
- 0x00002b76, 0x00002b95, 0x00002b98, 0x00002bb9,
- 0x00002bbd, 0x00002bc8, 0x00002bca, 0x00002bd2,
- 0x00002bec, 0x00002bef, 0x00002c00, 0x00002c2e,
- 0x00002c30, 0x00002c5e, 0x00002c60, 0x00002cf3,
- 0x00002cf9, 0x00002d25, 0x00002d27, 0x00002d27,
- 0x00002d2d, 0x00002d2d, 0x00002d30, 0x00002d67,
- 0x00002d6f, 0x00002d70, 0x00002d7f, 0x00002d96,
- 0x00002da0, 0x00002da6, 0x00002da8, 0x00002dae,
- 0x00002db0, 0x00002db6, 0x00002db8, 0x00002dbe,
- 0x00002dc0, 0x00002dc6, 0x00002dc8, 0x00002dce,
- 0x00002dd0, 0x00002dd6, 0x00002dd8, 0x00002dde,
- 0x00002de0, 0x00002e49, 0x00002e80, 0x00002e99,
- 0x00002e9b, 0x00002ef3, 0x00002f00, 0x00002fd5,
- 0x00002ff0, 0x00002ffb, 0x00003000, 0x0000303f,
- 0x00003041, 0x00003096, 0x00003099, 0x000030ff,
- 0x00003105, 0x0000312e, 0x00003131, 0x0000318e,
- 0x00003190, 0x000031ba, 0x000031c0, 0x000031e3,
- 0x000031f0, 0x0000321e, 0x00003220, 0x000032fe,
- 0x00003300, 0x000033ff, 0x00003400, 0x00004db5,
- 0x00004dc0, 0x00004dff, 0x00004e00, 0x00009fa5,
- 0x0000a000, 0x0000a48c, 0x0000a490, 0x0000a4c6,
- 0x0000a4d0, 0x0000a62b, 0x0000a640, 0x0000a6f7,
- 0x0000a700, 0x0000a7ae, 0x0000a7b0, 0x0000a7b7,
- 0x0000a7f7, 0x0000a82b, 0x0000a830, 0x0000a839,
- 0x0000a840, 0x0000a877, 0x0000a880, 0x0000a8c5,
- 0x0000a8ce, 0x0000a8d9, 0x0000a8e0, 0x0000a8fd,
- 0x0000a900, 0x0000a953, 0x0000a95f, 0x0000a97c,
- 0x0000a980, 0x0000a9cd, 0x0000a9cf, 0x0000a9d9,
- 0x0000a9de, 0x0000a9fe, 0x0000aa00, 0x0000aa36,
- 0x0000aa40, 0x0000aa4d, 0x0000aa50, 0x0000aa59,
- 0x0000aa5c, 0x0000aac2, 0x0000aadb, 0x0000aaf6,
- 0x0000ab01, 0x0000ab06, 0x0000ab09, 0x0000ab0e,
- 0x0000ab11, 0x0000ab16, 0x0000ab20, 0x0000ab26,
- 0x0000ab28, 0x0000ab2e, 0x0000ab30, 0x0000ab65,
- 0x0000ab70, 0x0000abed, 0x0000abf0, 0x0000abf9,
- 0x0000ac00, 0x0000d7a3, 0x0000d7b0, 0x0000d7c6,
- 0x0000d7cb, 0x0000d7fb, 0x0000f900, 0x0000fb06,
- 0x0000fb13, 0x0000fb17, 0x0000fb1d, 0x0000fb36,
- 0x0000fb38, 0x0000fb3c, 0x0000fb3e, 0x0000fb3e,
- 0x0000fb40, 0x0000fb41, 0x0000fb43, 0x0000fb44,
- 0x0000fb46, 0x0000fbc1, 0x0000fbd3, 0x0000fd3f,
- 0x0000fd50, 0x0000fd8f, 0x0000fd92, 0x0000fdc7,
- 0x0000fdf0, 0x0000fdfd, 0x0000fe00, 0x0000fe19,
- 0x0000fe20, 0x0000fe52, 0x0000fe54, 0x0000fe66,
- 0x0000fe68, 0x0000fe6b, 0x0000fe70, 0x0000fe74,
- 0x0000fe76, 0x0000fefc, 0x0000feff, 0x0000feff,
- 0x0000ff01, 0x0000ffbe, 0x0000ffc2, 0x0000ffc7,
- 0x0000ffca, 0x0000ffcf, 0x0000ffd2, 0x0000ffd7,
- 0x0000ffda, 0x0000ffdc, 0x0000ffe0, 0x0000ffe6,
- 0x0000ffe8, 0x0000ffee, 0x0000fff9, 0x0000fffd,
- 0x00010000, 0x0001000b, 0x0001000d, 0x00010026,
- 0x00010028, 0x0001003a, 0x0001003c, 0x0001003d,
- 0x0001003f, 0x0001004d, 0x00010050, 0x0001005d,
- 0x00010080, 0x000100fa, 0x00010100, 0x00010102,
- 0x00010107, 0x00010133, 0x00010137, 0x0001018e,
- 0x00010190, 0x0001019b, 0x000101a0, 0x000101a0,
- 0x000101d0, 0x000101fd, 0x00010280, 0x0001029c,
- 0x000102a0, 0x000102d0, 0x000102e0, 0x000102fb,
- 0x00010300, 0x00010323, 0x0001032d, 0x0001034a,
- 0x00010350, 0x0001037a, 0x00010380, 0x0001039d,
- 0x0001039f, 0x000103c3, 0x000103c8, 0x000103d5,
- 0x00010400, 0x0001049d, 0x000104a0, 0x000104a9,
- 0x000104b0, 0x000104d3, 0x000104d8, 0x000104fb,
- 0x00010500, 0x00010527, 0x00010530, 0x00010563,
- 0x0001056f, 0x0001056f, 0x00010600, 0x00010736,
- 0x00010740, 0x00010755, 0x00010760, 0x00010767,
- 0x00010800, 0x00010805, 0x00010808, 0x00010808,
- 0x0001080a, 0x00010835, 0x00010837, 0x00010838,
- 0x0001083c, 0x0001083c, 0x0001083f, 0x00010855,
- 0x00010857, 0x0001089e, 0x000108a7, 0x000108af,
- 0x000108e0, 0x000108f2, 0x000108f4, 0x000108f5,
- 0x000108fb, 0x0001091b, 0x0001091f, 0x00010939,
- 0x0001093f, 0x0001093f, 0x00010980, 0x000109b7,
- 0x000109bc, 0x000109cf, 0x000109d2, 0x00010a03,
- 0x00010a05, 0x00010a06, 0x00010a0c, 0x00010a13,
- 0x00010a15, 0x00010a17, 0x00010a19, 0x00010a33,
- 0x00010a38, 0x00010a3a, 0x00010a3f, 0x00010a47,
- 0x00010a50, 0x00010a58, 0x00010a60, 0x00010a9f,
- 0x00010ac0, 0x00010ae6, 0x00010aeb, 0x00010af6,
- 0x00010b00, 0x00010b35, 0x00010b39, 0x00010b55,
- 0x00010b58, 0x00010b72, 0x00010b78, 0x00010b91,
- 0x00010b99, 0x00010b9c, 0x00010ba9, 0x00010baf,
- 0x00010c00, 0x00010c48, 0x00010c80, 0x00010cb2,
- 0x00010cc0, 0x00010cf2, 0x00010cfa, 0x00010cff,
- 0x00010e60, 0x00010e7e, 0x00011000, 0x0001104d,
- 0x00011052, 0x0001106f, 0x0001107f, 0x000110c1,
- 0x000110d0, 0x000110e8, 0x000110f0, 0x000110f9,
- 0x00011100, 0x00011134, 0x00011136, 0x00011143,
- 0x00011150, 0x00011176, 0x00011180, 0x000111cd,
- 0x000111d0, 0x000111df, 0x000111e1, 0x000111f4,
- 0x00011200, 0x00011211, 0x00011213, 0x0001123e,
- 0x00011280, 0x00011286, 0x00011288, 0x00011288,
- 0x0001128a, 0x0001128d, 0x0001128f, 0x0001129d,
- 0x0001129f, 0x000112a9, 0x000112b0, 0x000112ea,
- 0x000112f0, 0x000112f9, 0x00011300, 0x00011303,
- 0x00011305, 0x0001130c, 0x0001130f, 0x00011310,
- 0x00011313, 0x00011328, 0x0001132a, 0x00011330,
- 0x00011332, 0x00011333, 0x00011335, 0x00011339,
- 0x0001133c, 0x00011344, 0x00011347, 0x00011348,
- 0x0001134b, 0x0001134d, 0x00011350, 0x00011350,
- 0x00011357, 0x00011357, 0x0001135d, 0x00011363,
- 0x00011366, 0x0001136c, 0x00011370, 0x00011374,
- 0x00011400, 0x00011459, 0x0001145b, 0x0001145b,
- 0x0001145d, 0x0001145d, 0x00011480, 0x000114c7,
- 0x000114d0, 0x000114d9, 0x00011580, 0x000115b5,
- 0x000115b8, 0x000115dd, 0x00011600, 0x00011644,
- 0x00011650, 0x00011659, 0x00011660, 0x0001166c,
- 0x00011680, 0x000116b7, 0x000116c0, 0x000116c9,
- 0x00011700, 0x00011719, 0x0001171d, 0x0001172b,
- 0x00011730, 0x0001173f, 0x000118a0, 0x000118f2,
- 0x000118ff, 0x000118ff, 0x00011a00, 0x00011a47,
- 0x00011a50, 0x00011a83, 0x00011a86, 0x00011a9c,
- 0x00011a9e, 0x00011aa2, 0x00011ac0, 0x00011af8,
- 0x00011c00, 0x00011c08, 0x00011c0a, 0x00011c36,
- 0x00011c38, 0x00011c45, 0x00011c50, 0x00011c6c,
- 0x00011c70, 0x00011c8f, 0x00011c92, 0x00011ca7,
- 0x00011ca9, 0x00011cb6, 0x00011d00, 0x00011d06,
- 0x00011d08, 0x00011d09, 0x00011d0b, 0x00011d36,
- 0x00011d3a, 0x00011d3a, 0x00011d3c, 0x00011d3d,
- 0x00011d3f, 0x00011d47, 0x00011d50, 0x00011d59,
- 0x00012000, 0x00012399, 0x00012400, 0x0001246e,
- 0x00012470, 0x00012474, 0x00012480, 0x00012543,
- 0x00013000, 0x0001342e, 0x00014400, 0x00014646,
- 0x00016800, 0x00016a38, 0x00016a40, 0x00016a5e,
- 0x00016a60, 0x00016a69, 0x00016a6e, 0x00016a6f,
- 0x00016ad0, 0x00016aed, 0x00016af0, 0x00016af5,
- 0x00016b00, 0x00016b45, 0x00016b50, 0x00016b59,
- 0x00016b5b, 0x00016b61, 0x00016b63, 0x00016b77,
- 0x00016b7d, 0x00016b8f, 0x00016f00, 0x00016f44,
- 0x00016f50, 0x00016f7e, 0x00016f8f, 0x00016f9f,
- 0x00016fe0, 0x00016fe1, 0x00017000, 0x00017000,
- 0x000187ec, 0x000187ec, 0x00018800, 0x00018af2,
- 0x0001b000, 0x0001b11e, 0x0001b170, 0x0001b2fb,
- 0x0001bc00, 0x0001bc6a, 0x0001bc70, 0x0001bc7c,
- 0x0001bc80, 0x0001bc88, 0x0001bc90, 0x0001bc99,
- 0x0001bc9c, 0x0001bca3, 0x0001d000, 0x0001d0f5,
- 0x0001d100, 0x0001d126, 0x0001d129, 0x0001d1e8,
- 0x0001d200, 0x0001d245, 0x0001d300, 0x0001d356,
- 0x0001d360, 0x0001d371, 0x0001d400, 0x0001d454,
- 0x0001d456, 0x0001d49c, 0x0001d49e, 0x0001d49f,
- 0x0001d4a2, 0x0001d4a2, 0x0001d4a5, 0x0001d4a6,
- 0x0001d4a9, 0x0001d4ac, 0x0001d4ae, 0x0001d4b9,
- 0x0001d4bb, 0x0001d4bb, 0x0001d4bd, 0x0001d4c3,
- 0x0001d4c5, 0x0001d505, 0x0001d507, 0x0001d50a,
- 0x0001d50d, 0x0001d514, 0x0001d516, 0x0001d51c,
- 0x0001d51e, 0x0001d539, 0x0001d53b, 0x0001d53e,
- 0x0001d540, 0x0001d544, 0x0001d546, 0x0001d546,
- 0x0001d54a, 0x0001d550, 0x0001d552, 0x0001d6a5,
- 0x0001d6a8, 0x0001d7cb, 0x0001d7ce, 0x0001da8b,
- 0x0001da9b, 0x0001da9f, 0x0001daa1, 0x0001daaf,
- 0x0001e000, 0x0001e006, 0x0001e008, 0x0001e018,
- 0x0001e01b, 0x0001e021, 0x0001e023, 0x0001e024,
- 0x0001e026, 0x0001e02a, 0x0001e800, 0x0001e8c4,
- 0x0001e8c7, 0x0001e8d6, 0x0001e900, 0x0001e94a,
- 0x0001e950, 0x0001e959, 0x0001e95e, 0x0001e95f,
- 0x0001ee00, 0x0001ee03, 0x0001ee05, 0x0001ee1f,
- 0x0001ee21, 0x0001ee22, 0x0001ee24, 0x0001ee24,
- 0x0001ee27, 0x0001ee27, 0x0001ee29, 0x0001ee32,
- 0x0001ee34, 0x0001ee37, 0x0001ee39, 0x0001ee39,
- 0x0001ee3b, 0x0001ee3b, 0x0001ee42, 0x0001ee42,
- 0x0001ee47, 0x0001ee47, 0x0001ee49, 0x0001ee49,
- 0x0001ee4b, 0x0001ee4b, 0x0001ee4d, 0x0001ee4f,
- 0x0001ee51, 0x0001ee52, 0x0001ee54, 0x0001ee54,
- 0x0001ee57, 0x0001ee57, 0x0001ee59, 0x0001ee59,
- 0x0001ee5b, 0x0001ee5b, 0x0001ee5d, 0x0001ee5d,
- 0x0001ee5f, 0x0001ee5f, 0x0001ee61, 0x0001ee62,
- 0x0001ee64, 0x0001ee64, 0x0001ee67, 0x0001ee6a,
- 0x0001ee6c, 0x0001ee72, 0x0001ee74, 0x0001ee77,
- 0x0001ee79, 0x0001ee7c, 0x0001ee7e, 0x0001ee7e,
- 0x0001ee80, 0x0001ee89, 0x0001ee8b, 0x0001ee9b,
- 0x0001eea1, 0x0001eea3, 0x0001eea5, 0x0001eea9,
- 0x0001eeab, 0x0001eebb, 0x0001eef0, 0x0001eef1,
- 0x0001f000, 0x0001f02b, 0x0001f030, 0x0001f093,
- 0x0001f0a0, 0x0001f0ae, 0x0001f0b1, 0x0001f0bf,
- 0x0001f0c1, 0x0001f0cf, 0x0001f0d1, 0x0001f0f5,
- 0x0001f100, 0x0001f10c, 0x0001f110, 0x0001f12e,
- 0x0001f130, 0x0001f16b, 0x0001f170, 0x0001f1ac,
- 0x0001f1e6, 0x0001f202, 0x0001f210, 0x0001f23b,
- 0x0001f240, 0x0001f248, 0x0001f250, 0x0001f251,
- 0x0001f260, 0x0001f265, 0x0001f300, 0x0001f6d4,
- 0x0001f6e0, 0x0001f6ec, 0x0001f6f0, 0x0001f6f8,
- 0x0001f700, 0x0001f773, 0x0001f780, 0x0001f7d4,
- 0x0001f800, 0x0001f80b, 0x0001f810, 0x0001f847,
- 0x0001f850, 0x0001f859, 0x0001f860, 0x0001f887,
- 0x0001f890, 0x0001f8ad, 0x0001f900, 0x0001f90b,
- 0x0001f910, 0x0001f93e, 0x0001f940, 0x0001f94c,
- 0x0001f950, 0x0001f96b, 0x0001f980, 0x0001f997,
- 0x0001f9c0, 0x0001f9c0, 0x0001f9d0, 0x0001f9e6,
- 0x00020000, 0x0002a6d6, 0x0002a700, 0x0002a700,
- 0x0002b734, 0x0002b734, 0x0002b740, 0x0002b740,
- 0x0002b81d, 0x0002b81d, 0x0002b820, 0x0002b820,
- 0x0002cea1, 0x0002cea1, 0x0002ceb0, 0x0002ceb0,
- 0x0002ebe0, 0x0002ebe0, 0x0002f800, 0x0002fa1d,
- 0x000e0001, 0x000e0001, 0x000e0020, 0x000e007f,
0x000e0100, 0x000e01ef, 0x000000ab, 0x000000ab,
0x00002018, 0x00002018, 0x0000201b, 0x0000201c,
0x0000201f, 0x0000201f, 0x00002039, 0x00002039,
@@ -2553,2639 +2215,2674 @@ static const unsigned int _ucprop_ranges[] = {
0x0001ee79, 0x0001ee7c, 0x0001ee7e, 0x0001ee7e,
0x0001ee80, 0x0001ee89, 0x0001ee8b, 0x0001ee9b,
0x0001eea1, 0x0001eea3, 0x0001eea5, 0x0001eea9,
- 0x0001eeab, 0x0001eebb
+ 0x0001eeab, 0x0001eebb, 0x00000041, 0x0000005a,
+ 0x00000061, 0x0000007a, 0x000000aa, 0x000000aa,
+ 0x000000b5, 0x000000b5, 0x000000ba, 0x000000ba,
+ 0x000000c0, 0x000000d6, 0x000000d8, 0x000000f6,
+ 0x000000f8, 0x000001ba, 0x000001bc, 0x000001bf,
+ 0x000001c4, 0x00000293, 0x00000295, 0x000002b8,
+ 0x000002c0, 0x000002c1, 0x000002e0, 0x000002e4,
+ 0x00000345, 0x00000345, 0x00000370, 0x00000373,
+ 0x00000376, 0x00000377, 0x0000037a, 0x0000037d,
+ 0x0000037f, 0x0000037f, 0x00000386, 0x00000386,
+ 0x00000388, 0x0000038a, 0x0000038c, 0x0000038c,
+ 0x0000038e, 0x000003a1, 0x000003a3, 0x000003f5,
+ 0x000003f7, 0x00000481, 0x0000048a, 0x0000052f,
+ 0x00000531, 0x00000556, 0x00000561, 0x00000587,
+ 0x000010a0, 0x000010c5, 0x000010c7, 0x000010c7,
+ 0x000010cd, 0x000010cd, 0x000013a0, 0x000013f5,
+ 0x000013f8, 0x000013fd, 0x00001c80, 0x00001c88,
+ 0x00001d00, 0x00001dbf, 0x00001e00, 0x00001f15,
+ 0x00001f18, 0x00001f1d, 0x00001f20, 0x00001f45,
+ 0x00001f48, 0x00001f4d, 0x00001f50, 0x00001f57,
+ 0x00001f59, 0x00001f59, 0x00001f5b, 0x00001f5b,
+ 0x00001f5d, 0x00001f5d, 0x00001f5f, 0x00001f7d,
+ 0x00001f80, 0x00001fb4, 0x00001fb6, 0x00001fbc,
+ 0x00001fbe, 0x00001fbe, 0x00001fc2, 0x00001fc4,
+ 0x00001fc6, 0x00001fcc, 0x00001fd0, 0x00001fd3,
+ 0x00001fd6, 0x00001fdb, 0x00001fe0, 0x00001fec,
+ 0x00001ff2, 0x00001ff4, 0x00001ff6, 0x00001ffc,
+ 0x00002071, 0x00002071, 0x0000207f, 0x0000207f,
+ 0x00002090, 0x0000209c, 0x00002102, 0x00002102,
+ 0x00002107, 0x00002107, 0x0000210a, 0x00002113,
+ 0x00002115, 0x00002115, 0x00002119, 0x0000211d,
+ 0x00002124, 0x00002124, 0x00002126, 0x00002126,
+ 0x00002128, 0x00002128, 0x0000212a, 0x0000212d,
+ 0x0000212f, 0x00002134, 0x00002139, 0x00002139,
+ 0x0000213c, 0x0000213f, 0x00002145, 0x00002149,
+ 0x0000214e, 0x0000214e, 0x00002160, 0x0000217f,
+ 0x00002183, 0x00002184, 0x000024b6, 0x000024e9,
+ 0x00002c00, 0x00002c2e, 0x00002c30, 0x00002c5e,
+ 0x00002c60, 0x00002ce4, 0x00002ceb, 0x00002cee,
+ 0x00002cf2, 0x00002cf3, 0x00002d00, 0x00002d25,
+ 0x00002d27, 0x00002d27, 0x00002d2d, 0x00002d2d,
+ 0x0000a640, 0x0000a66d, 0x0000a680, 0x0000a69d,
+ 0x0000a722, 0x0000a787, 0x0000a78b, 0x0000a78e,
+ 0x0000a790, 0x0000a7ae, 0x0000a7b0, 0x0000a7b7,
+ 0x0000a7f8, 0x0000a7fa, 0x0000ab30, 0x0000ab5a,
+ 0x0000ab5c, 0x0000ab65, 0x0000ab70, 0x0000abbf,
+ 0x0000fb00, 0x0000fb06, 0x0000fb13, 0x0000fb17,
+ 0x0000ff21, 0x0000ff3a, 0x0000ff41, 0x0000ff5a,
+ 0x00010400, 0x0001044f, 0x000104b0, 0x000104d3,
+ 0x000104d8, 0x000104fb, 0x00010c80, 0x00010cb2,
+ 0x00010cc0, 0x00010cf2, 0x000118a0, 0x000118df,
+ 0x0001d400, 0x0001d454, 0x0001d456, 0x0001d49c,
+ 0x0001d49e, 0x0001d49f, 0x0001d4a2, 0x0001d4a2,
+ 0x0001d4a5, 0x0001d4a6, 0x0001d4a9, 0x0001d4ac,
+ 0x0001d4ae, 0x0001d4b9, 0x0001d4bb, 0x0001d4bb,
+ 0x0001d4bd, 0x0001d4c3, 0x0001d4c5, 0x0001d505,
+ 0x0001d507, 0x0001d50a, 0x0001d50d, 0x0001d514,
+ 0x0001d516, 0x0001d51c, 0x0001d51e, 0x0001d539,
+ 0x0001d53b, 0x0001d53e, 0x0001d540, 0x0001d544,
+ 0x0001d546, 0x0001d546, 0x0001d54a, 0x0001d550,
+ 0x0001d552, 0x0001d6a5, 0x0001d6a8, 0x0001d6c0,
+ 0x0001d6c2, 0x0001d6da, 0x0001d6dc, 0x0001d6fa,
+ 0x0001d6fc, 0x0001d714, 0x0001d716, 0x0001d734,
+ 0x0001d736, 0x0001d74e, 0x0001d750, 0x0001d76e,
+ 0x0001d770, 0x0001d788, 0x0001d78a, 0x0001d7a8,
+ 0x0001d7aa, 0x0001d7c2, 0x0001d7c4, 0x0001d7cb,
+ 0x0001e900, 0x0001e943, 0x0001f130, 0x0001f149,
+ 0x0001f150, 0x0001f169, 0x0001f170, 0x0001f189,
+ 0x00000027, 0x00000027, 0x0000002e, 0x0000002e,
+ 0x0000003a, 0x0000003a, 0x0000005e, 0x0000005e,
+ 0x00000060, 0x00000060, 0x000000a8, 0x000000a8,
+ 0x000000ad, 0x000000ad, 0x000000af, 0x000000af,
+ 0x000000b4, 0x000000b4, 0x000000b7, 0x000000b8,
+ 0x000002b0, 0x0000036f, 0x00000374, 0x00000375,
+ 0x0000037a, 0x0000037a, 0x00000384, 0x00000385,
+ 0x00000387, 0x00000387, 0x00000483, 0x00000489,
+ 0x00000559, 0x00000559, 0x00000591, 0x000005bd,
+ 0x000005bf, 0x000005bf, 0x000005c1, 0x000005c2,
+ 0x000005c4, 0x000005c5, 0x000005c7, 0x000005c7,
+ 0x000005f4, 0x000005f4, 0x00000600, 0x00000605,
+ 0x00000610, 0x0000061a, 0x0000061c, 0x0000061c,
+ 0x00000640, 0x00000640, 0x0000064b, 0x0000065f,
+ 0x00000670, 0x00000670, 0x000006d6, 0x000006dd,
+ 0x000006df, 0x000006e8, 0x000006ea, 0x000006ed,
+ 0x0000070f, 0x0000070f, 0x00000711, 0x00000711,
+ 0x00000730, 0x0000074a, 0x000007a6, 0x000007b0,
+ 0x000007eb, 0x000007f5, 0x000007fa, 0x000007fa,
+ 0x00000816, 0x0000082d, 0x00000859, 0x0000085b,
+ 0x000008d4, 0x00000902, 0x0000093a, 0x0000093a,
+ 0x0000093c, 0x0000093c, 0x00000941, 0x00000948,
+ 0x0000094d, 0x0000094d, 0x00000951, 0x00000957,
+ 0x00000962, 0x00000963, 0x00000971, 0x00000971,
+ 0x00000981, 0x00000981, 0x000009bc, 0x000009bc,
+ 0x000009c1, 0x000009c4, 0x000009cd, 0x000009cd,
+ 0x000009e2, 0x000009e3, 0x00000a01, 0x00000a02,
+ 0x00000a3c, 0x00000a3c, 0x00000a41, 0x00000a42,
+ 0x00000a47, 0x00000a48, 0x00000a4b, 0x00000a4d,
+ 0x00000a51, 0x00000a51, 0x00000a70, 0x00000a71,
+ 0x00000a75, 0x00000a75, 0x00000a81, 0x00000a82,
+ 0x00000abc, 0x00000abc, 0x00000ac1, 0x00000ac5,
+ 0x00000ac7, 0x00000ac8, 0x00000acd, 0x00000acd,
+ 0x00000ae2, 0x00000ae3, 0x00000afa, 0x00000aff,
+ 0x00000b01, 0x00000b01, 0x00000b3c, 0x00000b3c,
+ 0x00000b3f, 0x00000b3f, 0x00000b41, 0x00000b44,
+ 0x00000b4d, 0x00000b4d, 0x00000b56, 0x00000b56,
+ 0x00000b62, 0x00000b63, 0x00000b82, 0x00000b82,
+ 0x00000bc0, 0x00000bc0, 0x00000bcd, 0x00000bcd,
+ 0x00000c00, 0x00000c00, 0x00000c3e, 0x00000c40,
+ 0x00000c46, 0x00000c48, 0x00000c4a, 0x00000c4d,
+ 0x00000c55, 0x00000c56, 0x00000c62, 0x00000c63,
+ 0x00000c81, 0x00000c81, 0x00000cbc, 0x00000cbc,
+ 0x00000cbf, 0x00000cbf, 0x00000cc6, 0x00000cc6,
+ 0x00000ccc, 0x00000ccd, 0x00000ce2, 0x00000ce3,
+ 0x00000d00, 0x00000d01, 0x00000d3b, 0x00000d3c,
+ 0x00000d41, 0x00000d44, 0x00000d4d, 0x00000d4d,
+ 0x00000d62, 0x00000d63, 0x00000dca, 0x00000dca,
+ 0x00000dd2, 0x00000dd4, 0x00000dd6, 0x00000dd6,
+ 0x00000e31, 0x00000e31, 0x00000e34, 0x00000e3a,
+ 0x00000e46, 0x00000e4e, 0x00000eb1, 0x00000eb1,
+ 0x00000eb4, 0x00000eb9, 0x00000ebb, 0x00000ebc,
+ 0x00000ec6, 0x00000ec6, 0x00000ec8, 0x00000ecd,
+ 0x00000f18, 0x00000f19, 0x00000f35, 0x00000f35,
+ 0x00000f37, 0x00000f37, 0x00000f39, 0x00000f39,
+ 0x00000f71, 0x00000f7e, 0x00000f80, 0x00000f84,
+ 0x00000f86, 0x00000f87, 0x00000f8d, 0x00000f97,
+ 0x00000f99, 0x00000fbc, 0x00000fc6, 0x00000fc6,
+ 0x0000102d, 0x00001030, 0x00001032, 0x00001037,
+ 0x00001039, 0x0000103a, 0x0000103d, 0x0000103e,
+ 0x00001058, 0x00001059, 0x0000105e, 0x00001060,
+ 0x00001071, 0x00001074, 0x00001082, 0x00001082,
+ 0x00001085, 0x00001086, 0x0000108d, 0x0000108d,
+ 0x0000109d, 0x0000109d, 0x000010fc, 0x000010fc,
+ 0x0000135d, 0x0000135f, 0x00001712, 0x00001714,
+ 0x00001732, 0x00001734, 0x00001752, 0x00001753,
+ 0x00001772, 0x00001773, 0x000017b4, 0x000017b5,
+ 0x000017b7, 0x000017bd, 0x000017c6, 0x000017c6,
+ 0x000017c9, 0x000017d3, 0x000017d7, 0x000017d7,
+ 0x000017dd, 0x000017dd, 0x0000180b, 0x0000180e,
+ 0x00001843, 0x00001843, 0x00001885, 0x00001886,
+ 0x000018a9, 0x000018a9, 0x00001920, 0x00001922,
+ 0x00001927, 0x00001928, 0x00001932, 0x00001932,
+ 0x00001939, 0x0000193b, 0x00001a17, 0x00001a18,
+ 0x00001a1b, 0x00001a1b, 0x00001a56, 0x00001a56,
+ 0x00001a58, 0x00001a5e, 0x00001a60, 0x00001a60,
+ 0x00001a62, 0x00001a62, 0x00001a65, 0x00001a6c,
+ 0x00001a73, 0x00001a7c, 0x00001a7f, 0x00001a7f,
+ 0x00001aa7, 0x00001aa7, 0x00001ab0, 0x00001abe,
+ 0x00001b00, 0x00001b03, 0x00001b34, 0x00001b34,
+ 0x00001b36, 0x00001b3a, 0x00001b3c, 0x00001b3c,
+ 0x00001b42, 0x00001b42, 0x00001b6b, 0x00001b73,
+ 0x00001b80, 0x00001b81, 0x00001ba2, 0x00001ba5,
+ 0x00001ba8, 0x00001ba9, 0x00001bab, 0x00001bad,
+ 0x00001be6, 0x00001be6, 0x00001be8, 0x00001be9,
+ 0x00001bed, 0x00001bed, 0x00001bef, 0x00001bf1,
+ 0x00001c2c, 0x00001c33, 0x00001c36, 0x00001c37,
+ 0x00001c78, 0x00001c7d, 0x00001cd0, 0x00001cd2,
+ 0x00001cd4, 0x00001ce0, 0x00001ce2, 0x00001ce8,
+ 0x00001ced, 0x00001ced, 0x00001cf4, 0x00001cf4,
+ 0x00001cf8, 0x00001cf9, 0x00001d2c, 0x00001d6a,
+ 0x00001d78, 0x00001d78, 0x00001d9b, 0x00001df9,
+ 0x00001dfb, 0x00001dff, 0x00001fbd, 0x00001fbd,
+ 0x00001fbf, 0x00001fc1, 0x00001fcd, 0x00001fcf,
+ 0x00001fdd, 0x00001fdf, 0x00001fed, 0x00001fef,
+ 0x00001ffd, 0x00001ffe, 0x0000200b, 0x0000200f,
+ 0x00002018, 0x00002019, 0x00002024, 0x00002024,
+ 0x00002027, 0x00002027, 0x0000202a, 0x0000202e,
+ 0x00002060, 0x00002064, 0x00002066, 0x0000206f,
+ 0x00002071, 0x00002071, 0x0000207f, 0x0000207f,
+ 0x00002090, 0x0000209c, 0x000020d0, 0x000020f0,
+ 0x00002c7c, 0x00002c7d, 0x00002cef, 0x00002cf1,
+ 0x00002d6f, 0x00002d6f, 0x00002d7f, 0x00002d7f,
+ 0x00002de0, 0x00002dff, 0x00002e2f, 0x00002e2f,
+ 0x00003005, 0x00003005, 0x0000302a, 0x0000302d,
+ 0x00003031, 0x00003035, 0x0000303b, 0x0000303b,
+ 0x00003099, 0x0000309e, 0x000030fc, 0x000030fe,
+ 0x0000a015, 0x0000a015, 0x0000a4f8, 0x0000a4fd,
+ 0x0000a60c, 0x0000a60c, 0x0000a66f, 0x0000a672,
+ 0x0000a674, 0x0000a67d, 0x0000a67f, 0x0000a67f,
+ 0x0000a69c, 0x0000a69f, 0x0000a6f0, 0x0000a6f1,
+ 0x0000a700, 0x0000a721, 0x0000a770, 0x0000a770,
+ 0x0000a788, 0x0000a78a, 0x0000a7f8, 0x0000a7f9,
+ 0x0000a802, 0x0000a802, 0x0000a806, 0x0000a806,
+ 0x0000a80b, 0x0000a80b, 0x0000a825, 0x0000a826,
+ 0x0000a8c4, 0x0000a8c5, 0x0000a8e0, 0x0000a8f1,
+ 0x0000a926, 0x0000a92d, 0x0000a947, 0x0000a951,
+ 0x0000a980, 0x0000a982, 0x0000a9b3, 0x0000a9b3,
+ 0x0000a9b6, 0x0000a9b9, 0x0000a9bc, 0x0000a9bc,
+ 0x0000a9cf, 0x0000a9cf, 0x0000a9e5, 0x0000a9e6,
+ 0x0000aa29, 0x0000aa2e, 0x0000aa31, 0x0000aa32,
+ 0x0000aa35, 0x0000aa36, 0x0000aa43, 0x0000aa43,
+ 0x0000aa4c, 0x0000aa4c, 0x0000aa70, 0x0000aa70,
+ 0x0000aa7c, 0x0000aa7c, 0x0000aab0, 0x0000aab0,
+ 0x0000aab2, 0x0000aab4, 0x0000aab7, 0x0000aab8,
+ 0x0000aabe, 0x0000aabf, 0x0000aac1, 0x0000aac1,
+ 0x0000aadd, 0x0000aadd, 0x0000aaec, 0x0000aaed,
+ 0x0000aaf3, 0x0000aaf4, 0x0000aaf6, 0x0000aaf6,
+ 0x0000ab5b, 0x0000ab5f, 0x0000abe5, 0x0000abe5,
+ 0x0000abe8, 0x0000abe8, 0x0000abed, 0x0000abed,
+ 0x0000fb1e, 0x0000fb1e, 0x0000fbb2, 0x0000fbc1,
+ 0x0000fe00, 0x0000fe0f, 0x0000fe13, 0x0000fe13,
+ 0x0000fe20, 0x0000fe2f, 0x0000fe52, 0x0000fe52,
+ 0x0000fe55, 0x0000fe55, 0x0000feff, 0x0000feff,
+ 0x0000ff07, 0x0000ff07, 0x0000ff0e, 0x0000ff0e,
+ 0x0000ff1a, 0x0000ff1a, 0x0000ff3e, 0x0000ff3e,
+ 0x0000ff40, 0x0000ff40, 0x0000ff70, 0x0000ff70,
+ 0x0000ff9e, 0x0000ff9f, 0x0000ffe3, 0x0000ffe3,
+ 0x0000fff9, 0x0000fffb, 0x000101fd, 0x000101fd,
+ 0x000102e0, 0x000102e0, 0x00010376, 0x0001037a,
+ 0x00010a01, 0x00010a03, 0x00010a05, 0x00010a06,
+ 0x00010a0c, 0x00010a0f, 0x00010a38, 0x00010a3a,
+ 0x00010a3f, 0x00010a3f, 0x00010ae5, 0x00010ae6,
+ 0x00011001, 0x00011001, 0x00011038, 0x00011046,
+ 0x0001107f, 0x00011081, 0x000110b3, 0x000110b6,
+ 0x000110b9, 0x000110ba, 0x000110bd, 0x000110bd,
+ 0x00011100, 0x00011102, 0x00011127, 0x0001112b,
+ 0x0001112d, 0x00011134, 0x00011173, 0x00011173,
+ 0x00011180, 0x00011181, 0x000111b6, 0x000111be,
+ 0x000111ca, 0x000111cc, 0x0001122f, 0x00011231,
+ 0x00011234, 0x00011234, 0x00011236, 0x00011237,
+ 0x0001123e, 0x0001123e, 0x000112df, 0x000112df,
+ 0x000112e3, 0x000112ea, 0x00011300, 0x00011301,
+ 0x0001133c, 0x0001133c, 0x00011340, 0x00011340,
+ 0x00011366, 0x0001136c, 0x00011370, 0x00011374,
+ 0x00011438, 0x0001143f, 0x00011442, 0x00011444,
+ 0x00011446, 0x00011446, 0x000114b3, 0x000114b8,
+ 0x000114ba, 0x000114ba, 0x000114bf, 0x000114c0,
+ 0x000114c2, 0x000114c3, 0x000115b2, 0x000115b5,
+ 0x000115bc, 0x000115bd, 0x000115bf, 0x000115c0,
+ 0x000115dc, 0x000115dd, 0x00011633, 0x0001163a,
+ 0x0001163d, 0x0001163d, 0x0001163f, 0x00011640,
+ 0x000116ab, 0x000116ab, 0x000116ad, 0x000116ad,
+ 0x000116b0, 0x000116b5, 0x000116b7, 0x000116b7,
+ 0x0001171d, 0x0001171f, 0x00011722, 0x00011725,
+ 0x00011727, 0x0001172b, 0x00011a01, 0x00011a06,
+ 0x00011a09, 0x00011a0a, 0x00011a33, 0x00011a38,
+ 0x00011a3b, 0x00011a3e, 0x00011a47, 0x00011a47,
+ 0x00011a51, 0x00011a56, 0x00011a59, 0x00011a5b,
+ 0x00011a8a, 0x00011a96, 0x00011a98, 0x00011a99,
+ 0x00011c30, 0x00011c36, 0x00011c38, 0x00011c3d,
+ 0x00011c3f, 0x00011c3f, 0x00011c92, 0x00011ca7,
+ 0x00011caa, 0x00011cb0, 0x00011cb2, 0x00011cb3,
+ 0x00011cb5, 0x00011cb6, 0x00011d31, 0x00011d36,
+ 0x00011d3a, 0x00011d3a, 0x00011d3c, 0x00011d3d,
+ 0x00011d3f, 0x00011d45, 0x00011d47, 0x00011d47,
+ 0x00016af0, 0x00016af4, 0x00016b30, 0x00016b36,
+ 0x00016b40, 0x00016b43, 0x00016f8f, 0x00016f9f,
+ 0x00016fe0, 0x00016fe1, 0x0001bc9d, 0x0001bc9e,
+ 0x0001bca0, 0x0001bca3, 0x0001d167, 0x0001d169,
+ 0x0001d173, 0x0001d182, 0x0001d185, 0x0001d18b,
+ 0x0001d1aa, 0x0001d1ad, 0x0001d242, 0x0001d244,
+ 0x0001da00, 0x0001da36, 0x0001da3b, 0x0001da6c,
+ 0x0001da75, 0x0001da75, 0x0001da84, 0x0001da84,
+ 0x0001da9b, 0x0001da9f, 0x0001daa1, 0x0001daaf,
+ 0x0001e000, 0x0001e006, 0x0001e008, 0x0001e018,
+ 0x0001e01b, 0x0001e021, 0x0001e023, 0x0001e024,
+ 0x0001e026, 0x0001e02a, 0x0001e8d0, 0x0001e8d6,
+ 0x0001e944, 0x0001e94a, 0x0001f3fb, 0x0001f3ff,
+ 0x000e0001, 0x000e0001, 0x000e0020, 0x000e007f,
+ 0x000e0100, 0x000e01ef
+};
+
+static const unsigned _uccase_upper_g_size = 254;
+static const short _uccase_upper_g[] = {
+ 4516, 492, 479, 343, 210, 2449, 70, 1,
+ 7103, 1, 186, 263, 29574, 9, 5070, 3,
+ 358, 4143, 4442, 1227, 520, 8, 1203, 36,
+ -299, 558, 42, 26, 101, 501, 384, 122,
+ 4012, 30, 601, 1241, 460, -631, 344, 1,
+ 786, 491, 1658, 10744, 803, 2, 935, 2,
+ 120, 1, 2269, 343, 576, 2, 440, 1155,
+ 479, 1223, 6447, 54, 831, 39, 16850, 1484,
+ 836, 2, 378, 24, 227, 1140, 441, 1,
+ 154, 137, 1095, 217, 3586, 515, 170, 534,
+ 1449, 3060, 307, 1, 908, 3, 1842, 125,
+ -1388, 1, 586, 1, 249, 4091, 692, 260,
+ 754, 65, 625, 368, -70, 326, 2255, 65,
+ 389, 1661, 1709, 1160, 2933, 1, 680, 96,
+ -961, 385, 40, 51, 1087, 3, 665, 1815,
+ 1265, 2, 79, 24, 3984, 1220, 32767, 612,
+ 691, 16, 175, 469, 1639, 268, 61, 27,
+ 1259, 624, -619, 3, 109, 1, 1238, 7737,
+ 1659, 6819, 2792, 1, 2326, 112, -1308, 516,
+ 533, 17, 1704, 441, 645, 10808, 1105, 2,
+ 129, 1, 902, 667, -467, 63, 170, 6,
+ 17, 1367, 580, 1048, 1020, 18, 1095, 30,
+ 148, -1081, 1559, 1, 185, 459, 1758, 499,
+ 335, 42, 202, 6, -1211, 2376, 1148, 4,
+ 1664, 98, 4484, 8432, 1243, 86, 2611, 62,
+ 185, 108, -463, 56, 353, 2, 150, -1176,
+ 2518, 766, 4997, 36, 425, 713, 183, 2662,
+ 489, 1, 41, 699, 99, 2769, 1415, 198,
+ 725, 2, 4, 1996, 645, 1, -948, 250,
+ 155, 1049, 883, 306, 4668, 34, 966, 57,
+ 10917, 1439, 136, 1, 56, 62, 288, 1174,
+ 5175, 35, 807, 207, 89, 2279
+};
+
+static const unsigned _uccase_upper_table_size = 1396;
+static const unsigned _uccase_upper_table[] = {
+ 0x00001e05, 0x00001e04, 0x0000056e, 0x0000053e,
+ 0x00002c4a, 0x00002c1a, 0x0000ab9e, 0x000013ce,
+ 0x00002c87, 0x00002c86, 0x000104de, 0x000104b6,
+ 0x00002cd7, 0x00002cd6, 0x0001e927, 0x0001e905,
+ 0x00000259, 0x0000018f, 0x0001043a, 0x00010412,
+ 0x0000ff46, 0x0000ff26, 0x00001edf, 0x00001ede,
+ 0x00000256, 0x00000189, 0x00001fa8, 0x02000103,
+ 0x000003b5, 0x00000395, 0x0000aba2, 0x000013d2,
+ 0x000004b1, 0x000004b0, 0x00000173, 0x00000172,
+ 0x000024e0, 0x000024c6, 0x00002c8b, 0x00002c8a,
+ 0x0000ab74, 0x000013a4, 0x0000019e, 0x00000220,
+ 0x0000045e, 0x0000040e, 0x00002d17, 0x000010b7,
+ 0x00001e41, 0x00001e40, 0x00002d0f, 0x000010af,
+ 0x00002c3f, 0x00002c0f, 0x0000a7a3, 0x0000a7a2,
+ 0x00001ff6, 0x020000d0, 0x00002d0a, 0x000010aa,
+ 0x000104f1, 0x000104c9, 0x0000ab9a, 0x000013ca,
+ 0x00001f91, 0x0200001b, 0x000024e7, 0x000024cd,
+ 0x00002c65, 0x0000023a, 0x0001044b, 0x00010423,
+ 0x0000ab71, 0x000013a1, 0x0001e92f, 0x0001e90d,
+ 0x0000048d, 0x0000048c, 0x0000ab7f, 0x000013af,
+ 0x0000a689, 0x0000a688, 0x000001d2, 0x000001d1,
+ 0x00002d0e, 0x000010ae, 0x00001ed7, 0x00001ed6,
+ 0x0000a72d, 0x0000a72c, 0x00001fc7, 0x0300013a,
+ 0x00000125, 0x00000124, 0x00002c32, 0x00002c02,
+ 0x00000195, 0x000001f6, 0x00000453, 0x00000403,
+ 0x000004c6, 0x000004c5, 0x00000167, 0x00000166,
+ 0x00010ce1, 0x00010ca1, 0x00002cbf, 0x00002cbe,
+ 0x00002c3a, 0x00002c0a, 0x0000a667, 0x0000a666,
+ 0x00010446, 0x0001041e, 0x0000ff52, 0x0000ff32,
+ 0x00001e27, 0x00001e26, 0x000003f2, 0x000003f9,
+ 0x00001ef9, 0x00001ef8, 0x000004d5, 0x000004d4,
+ 0x00001f53, 0x00001f5b, 0x000003e7, 0x000003e6,
+ 0x0000ab9b, 0x000013cb, 0x000004e1, 0x000004e0,
+ 0x0000ab9c, 0x000013cc, 0x0000056a, 0x0000053a,
+ 0x00002c4e, 0x00002c1e, 0x0001042a, 0x00010402,
+ 0x00010429, 0x00010401, 0x00001e83, 0x00001e82,
+ 0x00002c3e, 0x00002c0e, 0x00001e8d, 0x00001e8c,
+ 0x00001f92, 0x0200001e, 0x00001f42, 0x00001f4a,
+ 0x00000435, 0x00000415, 0x000104fb, 0x000104d3,
+ 0x00000121, 0x00000120, 0x00001e25, 0x00001e24,
+ 0x00000561, 0x00000531, 0x00002c56, 0x00002c26,
+ 0x00000573, 0x00000543, 0x00002c97, 0x00002c96,
+ 0x00000570, 0x00000540, 0x00000079, 0x00000059,
+ 0x0000ab7e, 0x000013ae, 0x00000491, 0x00000490,
+ 0x0000abb5, 0x000013e5, 0x0000a649, 0x0000a648,
+ 0x00001f03, 0x00001f0b, 0x000004b3, 0x000004b2,
+ 0x00001f15, 0x00001f1d, 0x000003b1, 0x00000391,
+ 0x00001eed, 0x00001eec, 0x000004bf, 0x000004be,
+ 0x0000028c, 0x00000245, 0x00010ce6, 0x00010ca6,
+ 0x00002c5c, 0x00002c2c, 0x0000052f, 0x0000052e,
+ 0x0000a685, 0x0000a684, 0x0000abb3, 0x000013e3,
+ 0x00002d23, 0x000010c3, 0x00002174, 0x00002164,
+ 0x00000254, 0x00000186, 0x00001e47, 0x00001e46,
+ 0x00001f63, 0x00001f6b, 0x00001f7b, 0x00001feb,
+ 0x00000511, 0x00000510, 0x00001f89, 0x020000d6,
+ 0x000001e9, 0x000001e8, 0x00002c47, 0x00002c17,
+ 0x000000e2, 0x000000c2, 0x0001e941, 0x0001e91f,
+ 0x0000ab87, 0x000013b7, 0x00000135, 0x00000134,
+ 0x0000056b, 0x0000053b, 0x000003ce, 0x0000038f,
+ 0x00001fe5, 0x00001fec, 0x0000020d, 0x0000020c,
+ 0x00001fa2, 0x02000036, 0x00000261, 0x0000a7ac,
+ 0x00001e97, 0x0200008e, 0x00000269, 0x00000196,
+ 0x00001ff3, 0x0200004e, 0x00000585, 0x00000555,
+ 0x00000576, 0x00000546, 0x00000142, 0x00000141,
+ 0x00000161, 0x00000160, 0x00001ef5, 0x00001ef4,
+ 0x00002cc9, 0x00002cc8, 0x0000abbf, 0x000013ef,
+ 0x0000a661, 0x0000a660, 0x00001e0d, 0x00001e0c,
+ 0x00002d24, 0x000010c4, 0x000118c5, 0x000118a5,
+ 0x000003b9, 0x00000399, 0x00001fa0, 0x02000030,
+ 0x0000ff55, 0x0000ff35, 0x0000fb15, 0x02000074,
+ 0x000004f5, 0x000004f4, 0x00001fa6, 0x02000042,
+ 0x000024e2, 0x000024c8, 0x00002d16, 0x000010b6,
+ 0x0000026c, 0x0000a7ad, 0x00002c39, 0x00002c09,
+ 0x0000028a, 0x000001b1, 0x00002d22, 0x000010c2,
+ 0x0001e92c, 0x0001e90a, 0x00002d1c, 0x000010bc,
+ 0x00001e85, 0x00001e84, 0x0000a781, 0x0000a780,
+ 0x00001e99, 0x02000094, 0x00000431, 0x00000411,
+ 0x00001eab, 0x00001eaa, 0x00000443, 0x00000423,
+ 0x0000a73d, 0x0000a73c, 0x0000043a, 0x0000041a,
+ 0x0000a64d, 0x0000a64c, 0x000118ca, 0x000118aa,
+ 0x00002c8f, 0x00002c8e, 0x00010cc5, 0x00010c85,
+ 0x0000024f, 0x0000024e, 0x000001c6, 0x000001c4,
+ 0x0000ab73, 0x000013a3, 0x00000288, 0x000001ae,
+ 0x0000037b, 0x000003fd, 0x00001ecb, 0x00001eca,
+ 0x000001c8, 0x000001c7, 0x00001f8e, 0x020000e5,
+ 0x00010434, 0x0001040c, 0x00001f30, 0x00001f38,
+ 0x000004a3, 0x000004a2, 0x0000026a, 0x0000a7ae,
+ 0x0000aba9, 0x000013d9, 0x00002ccf, 0x00002cce,
+ 0x000003b6, 0x00000396, 0x0000a76b, 0x0000a76a,
+ 0x0000a73b, 0x0000a73a, 0x000118d8, 0x000118b8,
+ 0x00001e49, 0x00001e48, 0x00002d08, 0x000010a8,
+ 0x00001e35, 0x00001e34, 0x000000fc, 0x000000dc,
+ 0x00001e6d, 0x00001e6c, 0x0000017f, 0x00000053,
+ 0x000104e2, 0x000104ba, 0x000024e5, 0x000024cb,
+ 0x00001f02, 0x00001f0a, 0x00000519, 0x00000518,
+ 0x00000123, 0x00000122, 0x00002176, 0x00002166,
+ 0x00002c83, 0x00002c82, 0x000104f9, 0x000104d1,
+ 0x00000223, 0x00000222, 0x000104dc, 0x000104b4,
+ 0x000024d2, 0x000024b8, 0x00001ebd, 0x00001ebc,
+ 0x0000a763, 0x0000a762, 0x00001fa9, 0x02000106,
+ 0x0000a735, 0x0000a734, 0x00001e81, 0x00001e80,
+ 0x00000583, 0x00000553, 0x00000225, 0x00000224,
+ 0x00000283, 0x000001a9, 0x00000113, 0x00000112,
+ 0x00001f22, 0x00001f2a, 0x00002cc7, 0x00002cc6,
+ 0x00010ce0, 0x00010ca0, 0x00002caf, 0x00002cae,
+ 0x0000ab84, 0x000013b4, 0x00000078, 0x00000058,
+ 0x00001fa4, 0x0200003c, 0x0000a785, 0x0000a784,
+ 0x00001ffc, 0x02000121, 0x0000ff53, 0x0000ff33,
+ 0x00001f82, 0x02000006, 0x000004dd, 0x000004dc,
+ 0x00002d20, 0x000010c0, 0x0000abbd, 0x000013ed,
+ 0x0000ab77, 0x000013a7, 0x00001f74, 0x00001fca,
+ 0x0000014b, 0x0000014a, 0x00000066, 0x00000046,
+ 0x000000e5, 0x000000c5, 0x00001f78, 0x00001ff8,
+ 0x000001dc, 0x000001db, 0x0001e929, 0x0001e907,
+ 0x00000219, 0x00000218, 0x000104f4, 0x000104cc,
+ 0x0000046b, 0x0000046a, 0x00001fab, 0x0200010c,
+ 0x0000043d, 0x0000041d, 0x0000022d, 0x0000022c,
+ 0x0000abb1, 0x000013e1, 0x00002c57, 0x00002c27,
+ 0x00000569, 0x00000539, 0x00002c9d, 0x00002c9c,
+ 0x00000109, 0x00000108, 0x0000a64b, 0x0000a64a,
+ 0x00002cb9, 0x00002cb8, 0x0000a729, 0x0000a728,
+ 0x00010442, 0x0001041a, 0x0000a643, 0x0000a642,
+ 0x00002c52, 0x00002c22, 0x00002c6c, 0x00002c6b,
+ 0x000104ef, 0x000104c7, 0x00000065, 0x00000045,
+ 0x000024e3, 0x000024c9, 0x0000048b, 0x0000048a,
+ 0x0000012d, 0x0000012c, 0x00001fc2, 0x0200012a,
+ 0x000104e7, 0x000104bf, 0x000000f0, 0x000000d0,
+ 0x0001043b, 0x00010413, 0x0000026f, 0x0000019c,
+ 0x0000a697, 0x0000a696, 0x00001e5d, 0x00001e5c,
+ 0x00000280, 0x000001a6, 0x00000111, 0x00000110,
+ 0x000003ad, 0x00000388, 0x00001e51, 0x00001e50,
+ 0x000003d6, 0x000003a0, 0x00001f83, 0x02000009,
+ 0x000003b0, 0x03000084, 0x00000117, 0x00000116,
+ 0x0000052b, 0x0000052a, 0x00002c51, 0x00002c21,
+ 0x00000503, 0x00000502, 0x0000abaf, 0x000013df,
+ 0x0000abaa, 0x000013da, 0x00002c5b, 0x00002c2b,
+ 0x00010436, 0x0001040e, 0x00002c58, 0x00002c28,
+ 0x00001ebb, 0x00001eba, 0x0000014d, 0x0000014c,
+ 0x00010438, 0x00010410, 0x0000a74d, 0x0000a74c,
+ 0x00001f7c, 0x00001ffa, 0x000024d8, 0x000024be,
+ 0x00001eaf, 0x00001eae, 0x00000107, 0x00000106,
+ 0x000001ce, 0x000001cd, 0x00000448, 0x00000428,
+ 0x00000061, 0x00000041, 0x00010cdc, 0x00010c9c,
+ 0x0000a655, 0x0000a654, 0x0000ab92, 0x000013c2,
+ 0x0000a669, 0x0000a668, 0x00001e15, 0x00001e14,
+ 0x0000a7a1, 0x0000a7a0, 0x00001f33, 0x00001f3b,
+ 0x0000015b, 0x0000015a, 0x00001e3d, 0x00001e3c,
+ 0x0000a7a7, 0x0000a7a6, 0x00002d02, 0x000010a2,
+ 0x00010cc7, 0x00010c87, 0x0000abba, 0x000013ea,
+ 0x000004ff, 0x000004fe, 0x00010cf1, 0x00010cb1,
+ 0x000118dc, 0x000118bc, 0x000001dd, 0x0000018e,
+ 0x00010cc0, 0x00010c80, 0x000001ed, 0x000001ec,
+ 0x0001e934, 0x0001e912, 0x00000073, 0x00000053,
+ 0x000104f2, 0x000104ca, 0x0000ff48, 0x0000ff28,
+ 0x00001ea1, 0x00001ea0, 0x000001b0, 0x000001af,
+ 0x00010440, 0x00010418, 0x0000abbc, 0x000013ec,
+ 0x0000ff45, 0x0000ff25, 0x000001f5, 0x000001f4,
+ 0x00000157, 0x00000156, 0x00000571, 0x00000541,
+ 0x000000e6, 0x000000c6, 0x00010cc2, 0x00010c82,
+ 0x00002ca7, 0x00002ca6, 0x0000048f, 0x0000048e,
+ 0x00000371, 0x00000370, 0x00001e09, 0x00001e08,
+ 0x000000e1, 0x000000c1, 0x00001e01, 0x00001e00,
+ 0x0000a769, 0x0000a768, 0x00001f75, 0x00001fcb,
+ 0x000004af, 0x000004ae, 0x000104ed, 0x000104c5,
+ 0x000004f3, 0x000004f2, 0x000000e4, 0x000000c4,
+ 0x00002178, 0x00002168, 0x00002cdd, 0x00002cdc,
+ 0x0000abad, 0x000013dd, 0x000001e5, 0x000001e4,
+ 0x0000ab8d, 0x000013bd, 0x0000a65b, 0x0000a65a,
+ 0x000118da, 0x000118ba, 0x0000a79f, 0x0000a79e,
+ 0x00001e63, 0x00001e62, 0x00000074, 0x00000054,
+ 0x00001f7d, 0x00001ffb, 0x000104f5, 0x000104cd,
+ 0x00001f8f, 0x020000e8, 0x00001fe6, 0x020000c9,
+ 0x000001cc, 0x000001ca, 0x00000515, 0x00000514,
+ 0x00000203, 0x00000202, 0x00001c83, 0x00000421,
+ 0x00000227, 0x00000226, 0x000003e3, 0x000003e2,
+ 0x0000012b, 0x0000012a, 0x00001ff4, 0x02000133,
+ 0x0000a64f, 0x0000a64e, 0x0000aba7, 0x000013d7,
+ 0x0000a72b, 0x0000a72a, 0x00001ec1, 0x00001ec0,
+ 0x00000471, 0x00000470, 0x00001ee9, 0x00001ee8,
+ 0x000000fe, 0x000000de, 0x0000006d, 0x0000004d,
+ 0x0000011f, 0x0000011e, 0x00002c42, 0x00002c12,
+ 0x00000068, 0x00000048, 0x00002c50, 0x00002c20,
+ 0x00010ce8, 0x00010ca8, 0x0000a665, 0x0000a664,
+ 0x00001e53, 0x00001e52, 0x000003c0, 0x000003a0,
+ 0x00001fa5, 0x0200003f, 0x0000a79d, 0x0000a79c,
+ 0x00001e37, 0x00001e36, 0x0000a797, 0x0000a796,
+ 0x00001f11, 0x00001f19, 0x00010435, 0x0001040d,
+ 0x00002c35, 0x00002c05, 0x00010cd9, 0x00010c99,
+ 0x0000044e, 0x0000042e, 0x0001e93c, 0x0001e91a,
+ 0x000000fa, 0x000000da, 0x00010ccd, 0x00010c8d,
+ 0x00010cd4, 0x00010c94, 0x0001e928, 0x0001e906,
+ 0x000003ac, 0x00000386, 0x00001e93, 0x00001e92,
+ 0x00000577, 0x00000547, 0x00001e8b, 0x00001e8a,
+ 0x00000433, 0x00000413, 0x00001ea9, 0x00001ea8,
+ 0x00001fc4, 0x0200012d, 0x00001fa7, 0x02000045,
+ 0x0000056d, 0x0000053d, 0x00000119, 0x00000118,
+ 0x00001c82, 0x0000041e, 0x00002cab, 0x00002caa,
+ 0x00010cd5, 0x00010c95, 0x00000446, 0x00000426,
+ 0x0001e93f, 0x0001e91d, 0x000118d5, 0x000118b5,
+ 0x000118d3, 0x000118b3, 0x0000a753, 0x0000a752,
+ 0x00000201, 0x00000200, 0x0000a761, 0x0000a760,
+ 0x00001f13, 0x00001f1b, 0x0000049f, 0x0000049e,
+ 0x00001f25, 0x00001f2d, 0x000004b9, 0x000004b8,
+ 0x000003c6, 0x000003a6, 0x00000493, 0x00000492,
+ 0x0000217f, 0x0000216f, 0x000118c8, 0x000118a8,
+ 0x000000f6, 0x000000d6, 0x0000ab93, 0x000013c3,
+ 0x00002c6a, 0x00002c69, 0x000104f8, 0x000104d0,
+ 0x0000a745, 0x0000a744, 0x000104ea, 0x000104c2,
+ 0x000003f5, 0x00000395, 0x00001e4d, 0x00001e4c,
+ 0x0000050d, 0x0000050c, 0x0000ab8e, 0x000013be,
+ 0x00010cdf, 0x00010c9f, 0x00010cf2, 0x00010cb2,
+ 0x000003b2, 0x00000392, 0x00002c59, 0x00002c29,
+ 0x0000aba1, 0x000013d1, 0x00002170, 0x00002160,
+ 0x0000ab80, 0x000013b0, 0x0000a725, 0x0000a724,
+ 0x00001ea3, 0x00001ea2, 0x00000144, 0x00000143,
+ 0x00001ec3, 0x00001ec2, 0x0000ff4a, 0x0000ff2a,
+ 0x00001ecf, 0x00001ece, 0x00000469, 0x00000468,
+ 0x00001ee7, 0x00001ee6, 0x00000467, 0x00000466,
+ 0x000001c5, 0x000001c4, 0x00000101, 0x00000100,
+ 0x0001e935, 0x0001e913, 0x00010cce, 0x00010c8e,
+ 0x00002c41, 0x00002c11, 0x00010cc6, 0x00010c86,
+ 0x0000a65d, 0x0000a65c, 0x00010448, 0x00010420,
+ 0x0000029d, 0x0000a7b2, 0x00001f23, 0x00001f2b,
+ 0x0000a683, 0x0000a682, 0x00001fb4, 0x02000127,
+ 0x000004d3, 0x000004d2, 0x00001f43, 0x00001f4b,
+ 0x000004ca, 0x000004c9, 0x00001f12, 0x00001f1a,
+ 0x00010cd2, 0x00010c92, 0x000024d6, 0x000024bc,
+ 0x0000051d, 0x0000051c, 0x00002172, 0x00002162,
+ 0x00001fe3, 0x030000c2, 0x00002c37, 0x00002c07,
+ 0x00001f98, 0x020000eb, 0x00000442, 0x00000422,
+ 0x000104e8, 0x000104c0, 0x00000271, 0x00002c6e,
+ 0x00001ea5, 0x00001ea4, 0x00010ced, 0x00010cad,
+ 0x00001fb3, 0x02000048, 0x0000057f, 0x0000054f,
+ 0x00000242, 0x00000241, 0x00010ceb, 0x00010cab,
+ 0x00002cb7, 0x00002cb6, 0x0000026b, 0x00002c62,
+ 0x00002cad, 0x00002cac, 0x00000436, 0x00000416,
+ 0x0000024d, 0x0000024c, 0x0001e937, 0x0001e915,
+ 0x0001e943, 0x0001e921, 0x00010cf0, 0x00010cb0,
+ 0x0000a645, 0x0000a644, 0x00001ec5, 0x00001ec4,
+ 0x00010cc9, 0x00010c89, 0x00010431, 0x00010409,
+ 0x000004e5, 0x000004e4, 0x0000abb0, 0x000013e0,
+ 0x000004b7, 0x000004b6, 0x00001f26, 0x00001f2e,
+ 0x0000ab79, 0x000013a9, 0x000000e3, 0x000000c3,
+ 0x00001e96, 0x0200008b, 0x00002d25, 0x000010c5,
+ 0x00001f60, 0x00001f68, 0x0000a695, 0x0000a694,
+ 0x00001e45, 0x00001e44, 0x0000a793, 0x0000a792,
+ 0x0000aba6, 0x000013d6, 0x000024d0, 0x000024b6,
+ 0x00001f71, 0x00001fbb, 0x000024db, 0x000024c1,
+ 0x00001f85, 0x0200000f, 0x00000439, 0x00000419,
+ 0x00001fae, 0x02000115, 0x00000513, 0x00000512,
+ 0x00002c4f, 0x00002c1f, 0x00000452, 0x00000402,
+ 0x00000192, 0x00000191, 0x0001e942, 0x0001e920,
+ 0x00001f62, 0x00001f6a, 0x000104e5, 0x000104bd,
+ 0x00000566, 0x00000536, 0x0001042c, 0x00010404,
+ 0x000024df, 0x000024c5, 0x000104ec, 0x000104c4,
+ 0x000000f8, 0x000000d8, 0x00001fd7, 0x030000ba,
+ 0x00000450, 0x00000400, 0x000118c9, 0x000118a9,
+ 0x000004a9, 0x000004a8, 0x00002179, 0x00002169,
+ 0x0000016f, 0x0000016e, 0x00000169, 0x00000168,
+ 0x00000171, 0x00000170, 0x0000a747, 0x0000a746,
+ 0x00001e0b, 0x00001e0a, 0x000001b4, 0x000001b3,
+ 0x00001f52, 0x0300009d, 0x0000a783, 0x0000a782,
+ 0x00001f35, 0x00001f3d, 0x0000ff57, 0x0000ff37,
+ 0x0000a7b7, 0x0000a7b6, 0x000004db, 0x000004da,
+ 0x00010437, 0x0001040f, 0x0001044e, 0x00010426,
+ 0x00002c76, 0x00002c75, 0x000004ed, 0x000004ec,
+ 0x00000266, 0x0000a7aa, 0x00010ccf, 0x00010c8f,
+ 0x00002cbb, 0x00002cba, 0x00001e39, 0x00001e38,
+ 0x00000067, 0x00000047, 0x00001f93, 0x02000021,
+ 0x0000fb05, 0x02000065, 0x000104f6, 0x000104ce,
+ 0x0000a73f, 0x0000a73e, 0x00010449, 0x00010421,
+ 0x0000ab88, 0x000013b8, 0x00010444, 0x0001041c,
+ 0x0000ff4e, 0x0000ff2e, 0x00002c61, 0x00002c60,
+ 0x0000ab89, 0x000013b9, 0x00002c95, 0x00002c94,
+ 0x00000579, 0x00000549, 0x00002d1e, 0x000010be,
+ 0x000000e8, 0x000000c8, 0x0000025b, 0x00000190,
+ 0x000104eb, 0x000104c3, 0x0000a757, 0x0000a756,
+ 0x00001ed5, 0x00001ed4, 0x0000a75b, 0x0000a75a,
+ 0x00001e03, 0x00001e02, 0x000003b3, 0x00000393,
+ 0x00010cee, 0x00010cae, 0x000003b7, 0x00000397,
+ 0x000104dd, 0x000104b5, 0x00000564, 0x00000534,
+ 0x0000044d, 0x0000042d, 0x0000019a, 0x0000023d,
+ 0x00002cdf, 0x00002cde, 0x0000abbb, 0x000013eb,
+ 0x0000a693, 0x0000a692, 0x00001e43, 0x00001e42,
+ 0x00002c68, 0x00002c67, 0x000000ec, 0x000000cc,
+ 0x000003eb, 0x000003ea, 0x00001e07, 0x00001e06,
+ 0x00010cc3, 0x00010c83, 0x0000037c, 0x000003fe,
+ 0x00000580, 0x00000550, 0x00000188, 0x00000187,
+ 0x00000529, 0x00000528, 0x000000ed, 0x000000cd,
+ 0x0000007a, 0x0000005a, 0x00000071, 0x00000051,
+ 0x00001c85, 0x00000422, 0x00002c55, 0x00002c25,
+ 0x000118c0, 0x000118a0, 0x000003db, 0x000003da,
+ 0x0000a7b5, 0x0000a7b4, 0x0000ff56, 0x0000ff36,
+ 0x00001f73, 0x00001fc9, 0x00000463, 0x00000462,
+ 0x00001edd, 0x00001edc, 0x000004b5, 0x000004b4,
+ 0x00001ff7, 0x0300013e, 0x000001f9, 0x000001f8,
+ 0x000104d9, 0x000104b1, 0x00000473, 0x00000472,
+ 0x0000015f, 0x0000015e, 0x00001f96, 0x0200002a,
+ 0x00002d12, 0x000010b2, 0x00001e19, 0x00001e18,
+ 0x00002ce3, 0x00002ce2, 0x00001e13, 0x00001e12,
+ 0x0000a79b, 0x0000a79a, 0x00001ee1, 0x00001ee0,
+ 0x0000023f, 0x00002c7e, 0x00010445, 0x0001041d,
+ 0x0000a7a5, 0x0000a7a4, 0x00001f36, 0x00001f3e,
+ 0x000004eb, 0x000004ea, 0x000104fa, 0x000104d2,
+ 0x00000586, 0x00000556, 0x000000e7, 0x000000c7,
+ 0x0000020f, 0x0000020e, 0x000001e7, 0x000001e6,
+ 0x000003f8, 0x000003f7, 0x0000fb04, 0x03000061,
+ 0x0001e930, 0x0001e90e, 0x000000ff, 0x00000178,
+ 0x00001ecd, 0x00001ecc, 0x00000459, 0x00000409,
+ 0x00001ef1, 0x00001ef0, 0x0001042b, 0x00010403,
+ 0x00001eb1, 0x00001eb0, 0x00000445, 0x00000425,
+ 0x00001f8b, 0x020000dc, 0x0000045b, 0x0000040b,
+ 0x00000129, 0x00000128, 0x000001fb, 0x000001fa,
+ 0x00002c93, 0x00002c92, 0x000003e1, 0x000003e0,
+ 0x00002ca5, 0x00002ca4, 0x000118cb, 0x000118ab,
+ 0x00002c34, 0x00002c04, 0x0000ab9d, 0x000013cd,
+ 0x0000a755, 0x0000a754, 0x00001f01, 0x00001f09,
+ 0x0000a767, 0x0000a766, 0x00001f05, 0x00001f0d,
+ 0x000004ad, 0x000004ac, 0x000003c8, 0x000003a8,
+ 0x00010cc8, 0x00010c88, 0x000001b6, 0x000001b5,
+ 0x00001c80, 0x00000412, 0x00000148, 0x00000147,
+ 0x000004f1, 0x000004f0, 0x00002d0b, 0x000010ab,
+ 0x00000440, 0x00000420, 0x00002d19, 0x000010b9,
+ 0x00001e55, 0x00001e54, 0x000001f0, 0x02000088,
+ 0x00001e61, 0x00001e60, 0x000003ed, 0x000003ec,
+ 0x00001f79, 0x00001ff9, 0x00000140, 0x0000013f,
+ 0x00001f8d, 0x020000e2, 0x000000df, 0x02000051,
+ 0x0000217c, 0x0000216c, 0x00001e7b, 0x00001e7a,
+ 0x00002cee, 0x00002ced, 0x0000ab72, 0x000013a2,
+ 0x0000021f, 0x0000021e, 0x00000076, 0x00000056,
+ 0x0000a727, 0x0000a726, 0x0000abac, 0x000013dc,
+ 0x00002d10, 0x000010b0, 0x00001eb5, 0x00001eb4,
+ 0x0000045d, 0x0000040d, 0x00001e98, 0x02000091,
+ 0x0000046f, 0x0000046e, 0x00001eeb, 0x00001eea,
+ 0x00000146, 0x00000145, 0x0000fb14, 0x02000071,
+ 0x00000438, 0x00000418, 0x00000163, 0x00000162,
+ 0x0000aba8, 0x000013d8, 0x00000075, 0x00000055,
+ 0x00010ce4, 0x00010ca4, 0x00002cbd, 0x00002cbc,
+ 0x000003d0, 0x00000392, 0x0000a663, 0x0000a662,
+ 0x00001e23, 0x00001e22, 0x0000a681, 0x0000a680,
+ 0x000104e4, 0x000104bc, 0x000003c9, 0x000003a9,
+ 0x0000a687, 0x0000a686, 0x000000fd, 0x000000dd,
+ 0x00001f61, 0x00001f69, 0x00001f88, 0x020000d3,
+ 0x0000006c, 0x0000004c, 0x0000050b, 0x0000050a,
+ 0x00002c89, 0x00002c88, 0x0001e938, 0x0001e916,
+ 0x000024d4, 0x000024ba, 0x0001e92e, 0x0001e90c,
+ 0x0000ff41, 0x0000ff21, 0x00001d7d, 0x00002c63,
+ 0x00001fc6, 0x020000ac, 0x00001efb, 0x00001efa,
+ 0x00002177, 0x00002167, 0x00001fb1, 0x00001fb9,
+ 0x0000ff47, 0x0000ff27, 0x0000006a, 0x0000004a,
+ 0x0000ab8b, 0x000013bb, 0x00000272, 0x0000019d,
+ 0x00010ce5, 0x00010ca5, 0x000024e9, 0x000024cf,
+ 0x0000abb6, 0x000013e6, 0x000001bd, 0x000001bc,
+ 0x0001043e, 0x00010416, 0x00002cb1, 0x00002cb0,
+ 0x0000022b, 0x0000022a, 0x0000057a, 0x0000054a,
+ 0x000104e3, 0x000104bb, 0x0000049d, 0x0000049c,
+ 0x000013fd, 0x000013f5, 0x00000499, 0x00000498,
+ 0x000024e1, 0x000024c7, 0x0000049b, 0x0000049a,
+ 0x0000044b, 0x0000042b, 0x0000aba3, 0x000013d3,
+ 0x00002c3d, 0x00002c0d, 0x000024d9, 0x000024bf,
+ 0x000001a5, 0x000001a4, 0x0000014f, 0x0000014e,
+ 0x0000a69b, 0x0000a69a, 0x000118ce, 0x000118ae,
+ 0x00002c33, 0x00002c03, 0x00001f41, 0x00001f49,
+ 0x000003f3, 0x0000037f, 0x00001e6f, 0x00001e6e,
+ 0x0000a799, 0x0000a798, 0x00001f81, 0x02000003,
+ 0x00000209, 0x00000208, 0x000118c7, 0x000118a7,
+ 0x00001fb6, 0x020000a9, 0x00002c4d, 0x00002c1d,
+ 0x0000057d, 0x0000054d, 0x00000229, 0x00000228,
+ 0x00001f97, 0x0200002d, 0x000000f2, 0x000000d2,
+ 0x0001044d, 0x00010425, 0x0000a78c, 0x0000a78b,
+ 0x0000abb2, 0x000013e2, 0x0000ff5a, 0x0000ff3a,
+ 0x000013f9, 0x000013f1, 0x00002d14, 0x000010b4,
+ 0x00002c66, 0x0000023e, 0x00000581, 0x00000551,
+ 0x0000ab86, 0x000013b6, 0x00000495, 0x00000494,
+ 0x00000153, 0x00000152, 0x00000574, 0x00000544,
+ 0x00001f80, 0x02000000, 0x00010ce2, 0x00010ca2,
+ 0x00000289, 0x00000244, 0x00000456, 0x00000406,
+ 0x000001ad, 0x000001ac, 0x0001e925, 0x0001e903,
+ 0x000003af, 0x0000038a, 0x00001f31, 0x00001f39,
+ 0x000003c7, 0x000003a7, 0x000118c2, 0x000118a2,
+ 0x000004a1, 0x000004a0, 0x00001fe2, 0x030000be,
+ 0x000004fb, 0x000004fa, 0x000001d8, 0x000001d7,
+ 0x0000aba4, 0x000013d4, 0x00002c43, 0x00002c13,
+ 0x00001f9f, 0x02000100, 0x00002c45, 0x00002c15,
+ 0x00001f9c, 0x020000f7, 0x000000fb, 0x000000db,
+ 0x000104e6, 0x000104be, 0x00002d00, 0x000010a0,
+ 0x00001fcc, 0x0200011e, 0x000004d1, 0x000004d0,
+ 0x00001faf, 0x02000118, 0x0000043f, 0x0000041f,
+ 0x00001c84, 0x00000422, 0x0000045f, 0x0000040f,
+ 0x00000215, 0x00000214, 0x00001f72, 0x00001fc8,
+ 0x00000454, 0x00000404, 0x00000449, 0x00000429,
+ 0x00002c9b, 0x00002c9a, 0x00002c5e, 0x00002c2e,
+ 0x00000155, 0x00000154, 0x000001d4, 0x000001d3,
+ 0x0000a749, 0x0000a748, 0x000003d9, 0x000003d8,
+ 0x0000a75d, 0x0000a75c, 0x000118cf, 0x000118af,
+ 0x00002c3b, 0x00002c0b, 0x00001f20, 0x00001f28,
+ 0x0000043c, 0x0000041c, 0x00001f90, 0x02000018,
+ 0x0000045c, 0x0000040c, 0x00002c54, 0x00002c24,
+ 0x000104df, 0x000104b7, 0x00002ce1, 0x00002ce0,
+ 0x00001fe4, 0x020000c6, 0x00002d13, 0x000010b3,
+ 0x0000fb16, 0x02000077, 0x0000a791, 0x0000a790,
+ 0x0000ab82, 0x000013b2, 0x000003ef, 0x000003ee,
+ 0x00001e69, 0x00001e68, 0x0000017a, 0x00000179,
+ 0x000104e0, 0x000104b8, 0x00000447, 0x00000427,
+ 0x00001f95, 0x02000027, 0x000004c2, 0x000004c1,
+ 0x00002c4b, 0x00002c1b, 0x00000505, 0x00000504,
+ 0x00010cd1, 0x00010c91, 0x0000ab8a, 0x000013ba,
+ 0x00010ce9, 0x00010ca9, 0x00010439, 0x00010411,
+ 0x00000233, 0x00000232, 0x00001eb9, 0x00001eb8,
+ 0x000003c2, 0x000003a3, 0x00010ccc, 0x00010c8c,
+ 0x00000465, 0x00000464, 0x00001f76, 0x00001fda,
+ 0x0000ab8c, 0x000013bc, 0x00001fd3, 0x030000b3,
+ 0x00000481, 0x00000480, 0x00002d06, 0x000010a6,
+ 0x0001e923, 0x0001e901, 0x00002cc3, 0x00002cc2,
+ 0x000000f4, 0x000000d4, 0x00002ccb, 0x00002cca,
+ 0x0000abab, 0x000013db, 0x00000253, 0x00000181,
+ 0x00001e2b, 0x00001e2a, 0x0000ff4b, 0x0000ff2b,
+ 0x00001fe1, 0x00001fe9, 0x0000ff4f, 0x0000ff2f,
+ 0x00001e2d, 0x00001e2c, 0x0000ab90, 0x000013c0,
+ 0x00001f57, 0x00001f5f, 0x00002175, 0x00002165,
+ 0x000000b5, 0x0000039c, 0x000001cb, 0x000001ca,
+ 0x0000044a, 0x0000042a, 0x0001e939, 0x0001e917,
+ 0x00002c31, 0x00002c01, 0x00001fd0, 0x00001fd8,
+ 0x000000eb, 0x000000cb, 0x00001e59, 0x00001e58,
+ 0x0000214e, 0x00002132, 0x000104f0, 0x000104c8,
+ 0x0000a74b, 0x0000a74a, 0x00001e67, 0x00001e66,
+ 0x0000aba0, 0x000013d0, 0x00001faa, 0x02000109,
+ 0x00000479, 0x00000478, 0x000001a8, 0x000001a7,
+ 0x00000565, 0x00000535, 0x000118c1, 0x000118a1,
+ 0x00000434, 0x00000414, 0x0000016b, 0x0000016a,
+ 0x0000ab8f, 0x000013bf, 0x00002c3c, 0x00002c0c,
+ 0x00000265, 0x0000a78d, 0x0000a75f, 0x0000a75e,
+ 0x00001ef7, 0x00001ef6, 0x00000251, 0x00002c6d,
+ 0x000118d7, 0x000118b7, 0x000003bf, 0x0000039f,
+ 0x00001ef3, 0x00001ef2, 0x000003ca, 0x000003aa,
+ 0x00000185, 0x00000184, 0x00000578, 0x00000548,
+ 0x00002cec, 0x00002ceb, 0x000003cc, 0x0000038c,
+ 0x000001a3, 0x000001a2, 0x0001e93b, 0x0001e919,
+ 0x00002d0d, 0x000010ad, 0x000118d2, 0x000118b2,
+ 0x00002d1f, 0x000010bf, 0x0001e936, 0x0001e914,
+ 0x00002c30, 0x00002c00, 0x00001fbc, 0x0200011b,
+ 0x000003fb, 0x000003fa, 0x00001e4b, 0x00001e4a,
+ 0x0000044c, 0x0000042c, 0x0000ab98, 0x000013c8,
+ 0x00000527, 0x00000526, 0x000000ef, 0x000000cf,
+ 0x0000217e, 0x0000216e, 0x00002c46, 0x00002c16,
+ 0x00001fa3, 0x02000039, 0x0000013a, 0x00000139,
+ 0x00001f94, 0x02000024, 0x00000127, 0x00000126,
+ 0x00001ea7, 0x00001ea6, 0x00002184, 0x00002183,
+ 0x00001fb2, 0x02000124, 0x00002c36, 0x00002c06,
+ 0x00001edb, 0x00001eda, 0x00000373, 0x00000372,
+ 0x000004c4, 0x000004c3, 0x000004a7, 0x000004a6,
+ 0x00002173, 0x00002163, 0x00000159, 0x00000158,
+ 0x00000165, 0x00000164, 0x0000abb7, 0x000013e7,
+ 0x00002c81, 0x00002c80, 0x00000064, 0x00000044,
+ 0x00002ca1, 0x00002ca0, 0x0000022f, 0x0000022e,
+ 0x0000ff54, 0x0000ff34, 0x00001e73, 0x00001e72,
+ 0x000003bd, 0x0000039d, 0x000104f7, 0x000104cf,
+ 0x000004d7, 0x000004d6, 0x0000fb17, 0x0200007a,
+ 0x000004e9, 0x000004e8, 0x00002171, 0x00002161,
+ 0x00000115, 0x00000114, 0x00000457, 0x00000407,
+ 0x0000006e, 0x0000004e, 0x00002d2d, 0x000010cd,
+ 0x00001f44, 0x00001f4c, 0x00002ca9, 0x00002ca8,
+ 0x00001e5b, 0x00001e5a, 0x000003c1, 0x000003a1,
+ 0x000104ee, 0x000104c6, 0x0000a733, 0x0000a732,
+ 0x00001f32, 0x00001f3a, 0x000024d3, 0x000024b9,
+ 0x00001fb7, 0x03000136, 0x00010cdb, 0x00010c9b,
+ 0x000001ff, 0x000001fe, 0x00010ce3, 0x00010ca3,
+ 0x00000063, 0x00000043, 0x00000105, 0x00000104,
+ 0x0000a743, 0x0000a742, 0x00010cda, 0x00010c9a,
+ 0x00002ca3, 0x00002ca2, 0x00000151, 0x00000150,
+ 0x00001f65, 0x00001f6d, 0x0000ab99, 0x000013c9,
+ 0x0000a751, 0x0000a750, 0x00001f07, 0x00001f0f,
+ 0x0000a765, 0x0000a764, 0x0000029e, 0x0000a7b0,
+ 0x0001042e, 0x00010406, 0x0000a653, 0x0000a652,
+ 0x000003b4, 0x00000394, 0x000000ee, 0x000000ce,
+ 0x00001f8a, 0x020000d9, 0x0000217d, 0x0000216d,
+ 0x00010cd0, 0x00010c90, 0x000000f1, 0x000000d1,
+ 0x00001e29, 0x00001e28, 0x000000f3, 0x000000d3,
+ 0x000118d0, 0x000118b0, 0x000003d7, 0x000003cf,
+ 0x00001e5f, 0x00001e5e, 0x000003e5, 0x000003e4,
+ 0x00001fd2, 0x030000af, 0x0000ab78, 0x000013a8,
+ 0x00001f9b, 0x020000f4, 0x00010cd3, 0x00010c93,
+ 0x00001f06, 0x00001f0e, 0x00010ce7, 0x00010ca7,
+ 0x00002c53, 0x00002c23, 0x0001e924, 0x0001e902,
+ 0x00000133, 0x00000132, 0x0001e926, 0x0001e904,
+ 0x0000a741, 0x0000a740, 0x000001c9, 0x000001c7,
+ 0x00000247, 0x00000246, 0x00001ed1, 0x00001ed0,
+ 0x0000024b, 0x0000024a, 0x0000aba5, 0x000013d5,
+ 0x0000046d, 0x0000046c, 0x00001ee5, 0x00001ee4,
+ 0x0000047f, 0x0000047e, 0x0001044f, 0x00010427,
+ 0x0000ab81, 0x000013b1, 0x0000ab96, 0x000013c6,
+ 0x000004fd, 0x000004fc, 0x00002cdb, 0x00002cda,
+ 0x0001e92b, 0x0001e909, 0x00002cd3, 0x00002cd2,
+ 0x00001e0f, 0x00001e0e, 0x0000a66b, 0x0000a66a,
+ 0x00001e21, 0x00001e20, 0x00000292, 0x000001b7,
+ 0x00001fac, 0x0200010f, 0x000003cb, 0x000003ab,
+ 0x0000ab85, 0x000013b5, 0x000024d7, 0x000024bd,
+ 0x00001fd6, 0x020000b7, 0x0001043d, 0x00010415,
+ 0x0000fb06, 0x02000068, 0x0000052d, 0x0000052c,
+ 0x000000e9, 0x000000c9, 0x00001f00, 0x00001f08,
+ 0x0000a77c, 0x0000a77b, 0x0001e932, 0x0001e910,
+ 0x000013fb, 0x000013f3, 0x00001e87, 0x00001e86,
+ 0x000003be, 0x0000039e, 0x00001e95, 0x00001e94,
+ 0x000024d5, 0x000024bb, 0x0000ab91, 0x000013c1,
+ 0x00000441, 0x00000421, 0x00001f8c, 0x020000df,
+ 0x0000051b, 0x0000051a, 0x00001fb0, 0x00001fb8,
+ 0x00000477, 0x00000476, 0x000001d0, 0x000001cf,
+ 0x0000056f, 0x0000053f, 0x00002c9f, 0x00002c9e,
+ 0x000118dd, 0x000118bd, 0x00002d18, 0x000010b8,
+ 0x00010428, 0x00010400, 0x0000a647, 0x0000a646,
+ 0x00001eff, 0x00001efe, 0x0000a759, 0x0000a758,
+ 0x000118d9, 0x000118b9, 0x0000ff49, 0x0000ff29,
+ 0x00001e77, 0x00001e76, 0x000004a5, 0x000004a4,
+ 0x0000217b, 0x0000216b, 0x000004d9, 0x000004d8,
+ 0x0000a76f, 0x0000a76e, 0x00000562, 0x00000532,
+ 0x00002d01, 0x000010a1, 0x00000275, 0x0000019f,
+ 0x00002d15, 0x000010b5, 0x00001e4f, 0x00001e4e,
+ 0x00000430, 0x00000410, 0x00001f84, 0x0200000c,
+ 0x00002c5a, 0x00002c2a, 0x00001f45, 0x00001f4d,
+ 0x00000250, 0x00002c6f, 0x0000fb02, 0x0200005a,
+ 0x0000043e, 0x0000041e, 0x00010443, 0x0001041b,
+ 0x000001fd, 0x000001fc, 0x00002c73, 0x00002c72,
+ 0x0001044a, 0x00010422, 0x00002d05, 0x000010a5,
+ 0x0001e931, 0x0001e90f, 0x0000a68d, 0x0000a68c,
+ 0x00001f10, 0x00001f18, 0x00002c85, 0x00002c84,
+ 0x00010447, 0x0001041f, 0x0000a739, 0x0000a738,
+ 0x00001fc3, 0x0200004b, 0x00000461, 0x00000460,
+ 0x00001ee3, 0x00001ee2, 0x0000047d, 0x0000047c,
+ 0x000104d8, 0x000104b0, 0x00000567, 0x00000537,
+ 0x0000006b, 0x0000004b, 0x00010cdd, 0x00010c9d,
+ 0x00002cc5, 0x00002cc4, 0x0000ab83, 0x000013b3,
+ 0x00000287, 0x0000a7b1, 0x00001f70, 0x00001fba,
+ 0x00000149, 0x0200007d, 0x00001e9a, 0x02000097,
+ 0x0000a787, 0x0000a786, 0x00001f37, 0x00001f3f,
+ 0x0000ff51, 0x0000ff31, 0x00001e75, 0x00001e74,
+ 0x000004df, 0x000004de, 0x00000205, 0x00000204,
+ 0x00000183, 0x00000182, 0x0000fb03, 0x0300005d,
+ 0x0000011b, 0x0000011a, 0x0000ab76, 0x000013a6,
+ 0x0001e92d, 0x0001e90b, 0x000001e1, 0x000001e0,
+ 0x000118db, 0x000118bb, 0x00002d21, 0x000010c1,
+ 0x00001d79, 0x0000a77d, 0x0000ab97, 0x000013c7,
+ 0x0000018c, 0x0000018b, 0x00000444, 0x00000424,
+ 0x00001ead, 0x00001eac, 0x00000252, 0x00002c70,
+ 0x0000ff58, 0x0000ff38, 0x0000ff42, 0x0000ff22,
+ 0x00001fd1, 0x00001fd9, 0x0000abbe, 0x000013ee,
+ 0x0000012f, 0x0000012e, 0x000118df, 0x000118bf,
+ 0x0000a77a, 0x0000a779, 0x00010cca, 0x00010c8a,
+ 0x000001da, 0x000001d9, 0x00001ff2, 0x02000130,
+ 0x0000a641, 0x0000a640, 0x00001ed3, 0x00001ed2,
+ 0x00001f9e, 0x020000fd, 0x00001e11, 0x00001e10,
+ 0x0000a76d, 0x0000a76c, 0x00000207, 0x00000206,
+ 0x00000582, 0x00000552, 0x00000175, 0x00000174,
+ 0x00010441, 0x00010419, 0x00002c44, 0x00002c14,
+ 0x000118de, 0x000118be, 0x000001a1, 0x000001a0,
+ 0x00010cea, 0x00010caa, 0x0000a691, 0x0000a690,
+ 0x000118c4, 0x000118a4, 0x000003d5, 0x000003a6,
+ 0x0001042d, 0x00010405, 0x000003e9, 0x000003e8,
+ 0x00001fa1, 0x02000033, 0x00000211, 0x00000210,
+ 0x0000ab7b, 0x000013ab, 0x0000050f, 0x0000050e,
+ 0x00001e79, 0x00001e78, 0x000004cf, 0x000004c0,
+ 0x0000fb00, 0x02000054, 0x00000525, 0x00000524,
+ 0x00001f50, 0x0200009a, 0x00001c87, 0x00000462,
+ 0x0000021d, 0x0000021c, 0x0000020b, 0x0000020a,
+ 0x00000377, 0x00000376, 0x0000ab53, 0x0000a7b3,
+ 0x00000268, 0x00000197, 0x0000017e, 0x0000017d,
+ 0x0000a72f, 0x0000a72e, 0x00001c86, 0x0000042a,
+ 0x00000475, 0x00000474, 0x000104e9, 0x000104c1,
+ 0x000001f2, 0x000001f1, 0x00002cb3, 0x00002cb2,
+ 0x00000263, 0x00000194, 0x0000016d, 0x0000016c,
+ 0x0000ab95, 0x000013c5, 0x00000103, 0x00000102,
+ 0x00001e3b, 0x00001e3a, 0x00002cd5, 0x00002cd4,
+ 0x00001e17, 0x00001e16, 0x00002d07, 0x000010a7,
+ 0x00001f21, 0x00001f29, 0x0000ff4d, 0x0000ff2d,
+ 0x00001e33, 0x00001e32, 0x0000ff4c, 0x0000ff2c,
+ 0x00001f55, 0x00001f5d, 0x0000023c, 0x0000023b,
+ 0x000004ce, 0x000004cd, 0x0000043b, 0x0000041b,
+ 0x00002c5d, 0x00002c2d, 0x0000057b, 0x0000054b,
+ 0x000001df, 0x000001de, 0x000104db, 0x000104b3,
+ 0x000003ba, 0x0000039a, 0x0001e93a, 0x0001e918,
+ 0x00002d1b, 0x000010bb, 0x00001e8f, 0x00001e8e,
+ 0x000024d1, 0x000024b7, 0x00001f9a, 0x020000f1,
+ 0x00000437, 0x00000417, 0x00001eb7, 0x00001eb6,
+ 0x000024dd, 0x000024c3, 0x0000013c, 0x0000013b,
+ 0x00000563, 0x00000533, 0x00000077, 0x00000057,
+ 0x00001fbe, 0x00000399, 0x00002c91, 0x00002c90,
+ 0x000118d1, 0x000118b1, 0x00000257, 0x0000018a,
+ 0x0001043c, 0x00010414, 0x0000a659, 0x0000a658,
+ 0x0001e922, 0x0001e900, 0x000024de, 0x000024c4,
+ 0x0000ab7d, 0x000013ad, 0x00010cc1, 0x00010c81,
+ 0x0000abb8, 0x000013e8, 0x000003df, 0x000003de,
+ 0x000024dc, 0x000024c2, 0x000004bd, 0x000004bc,
+ 0x0000ab75, 0x000013a5, 0x00000070, 0x00000050,
+ 0x00000507, 0x00000506, 0x00001f7a, 0x00001fea,
+ 0x00002d09, 0x000010a9, 0x00001e3f, 0x00001e3e,
+ 0x00002d1d, 0x000010bd, 0x00001e65, 0x00001e64,
+ 0x0000a651, 0x0000a650, 0x00001f40, 0x00001f48,
+ 0x0000057c, 0x0000054c, 0x00001e71, 0x00001e70,
+ 0x000024e6, 0x000024cc, 0x00001f77, 0x00001fdb,
+ 0x00010432, 0x0001040a, 0x000118d6, 0x000118b6,
+ 0x00010cd6, 0x00010c96, 0x0000ab94, 0x000013c4,
+ 0x00001c81, 0x00000414, 0x000003bc, 0x0000039c,
+ 0x0001e940, 0x0001e91e, 0x00000390, 0x03000080,
+ 0x00001f04, 0x00001f0c, 0x00010ccb, 0x00010c8b,
+ 0x0001e93e, 0x0001e91c, 0x00000131, 0x00000049,
+ 0x00001ed9, 0x00001ed8, 0x0000028b, 0x000001b2,
+ 0x000004c8, 0x000004c7, 0x0000ab7c, 0x000013ac,
+ 0x0000006f, 0x0000004f, 0x000024da, 0x000024c0,
+ 0x00002d03, 0x000010a3, 0x00001c88, 0x0000a64a,
+ 0x00002ccd, 0x00002ccc, 0x0001e933, 0x0001e911,
+ 0x00002c48, 0x00002c18, 0x000004cc, 0x000004cb,
+ 0x00002c40, 0x00002c10, 0x0000ab70, 0x000013a0,
+ 0x000003bb, 0x0000039b, 0x0001042f, 0x00010407,
+ 0x0000ff59, 0x0000ff39, 0x00001f51, 0x00001f59,
+ 0x000004e7, 0x000004e6, 0x0000fb13, 0x0200006e,
+ 0x000004f9, 0x000004f8, 0x000104da, 0x000104b2,
+ 0x000003d1, 0x00000398, 0x00002c4c, 0x00002c1c,
+ 0x00001eef, 0x00001eee, 0x000001ef, 0x000001ee,
+ 0x00001fe0, 0x00001fe8, 0x000000f9, 0x000000d9,
+ 0x00001e89, 0x00001e88, 0x0000a68b, 0x0000a68a,
+ 0x00001e9b, 0x00001e60, 0x0000057e, 0x0000054e,
+ 0x00001f67, 0x00001f6f, 0x0000044f, 0x0000042f,
+ 0x00001e7f, 0x00001e7e, 0x00000451, 0x00000401,
+ 0x00010cec, 0x00010cac, 0x00000177, 0x00000176,
+ 0x00002d0c, 0x000010ac, 0x000003ae, 0x00000389,
+ 0x0000010d, 0x0000010c, 0x000000e0, 0x000000c0,
+ 0x00010430, 0x00010408, 0x00001f56, 0x030000a5,
+ 0x0000037d, 0x000003ff, 0x000013f8, 0x000013f0,
+ 0x00000497, 0x00000496, 0x0001043f, 0x00010417,
+ 0x00000137, 0x00000136, 0x00010cef, 0x00010caf,
+ 0x000004bb, 0x000004ba, 0x00000062, 0x00000042,
+ 0x00010cc4, 0x00010c84, 0x00002cd1, 0x00002cd0,
+ 0x00001f54, 0x030000a1, 0x0000a68f, 0x0000a68e,
+ 0x000013fa, 0x000013f2, 0x00002d11, 0x000010b1,
+ 0x000118cc, 0x000118ac, 0x0000a74f, 0x0000a74e,
+ 0x00001e1d, 0x00001e1c, 0x00000072, 0x00000052,
+ 0x0001e93d, 0x0001e91b, 0x0000051f, 0x0000051e,
+ 0x000001bf, 0x000001f7, 0x00000517, 0x00000516,
+ 0x00010433, 0x0001040b, 0x000024e8, 0x000024ce,
+ 0x0000010b, 0x0000010a, 0x000000ea, 0x000000ca,
+ 0x00000213, 0x00000212, 0x00000501, 0x00000500,
+ 0x00000217, 0x00000216, 0x00002d04, 0x000010a4,
+ 0x00002d1a, 0x000010ba, 0x00001ec9, 0x00001ec8,
+ 0x00000249, 0x00000248, 0x00001eb3, 0x00001eb2,
+ 0x0000047b, 0x0000047a, 0x00001ec7, 0x00001ec6,
+ 0x00000587, 0x0200006b, 0x0001044c, 0x00010424,
+ 0x0000011d, 0x0000011c, 0x0000217a, 0x0000216a,
+ 0x00001f66, 0x00001f6e, 0x00002cc1, 0x00002cc0,
+ 0x0000abb9, 0x000013e9, 0x0000a65f, 0x0000a65e,
+ 0x00001fe7, 0x030000cc, 0x0000a66d, 0x0000a66c,
+ 0x00001e1f, 0x00001e1e, 0x0000a699, 0x0000a698,
+ 0x00001e31, 0x00001e30, 0x000003c5, 0x000003a5,
+ 0x000024e4, 0x000024ca, 0x000004e3, 0x000004e2,
+ 0x000104e1, 0x000104b9, 0x000004f7, 0x000004f6,
+ 0x0000fb01, 0x02000057, 0x00000521, 0x00000520,
+ 0x0000ab7a, 0x000013aa, 0x00000509, 0x00000508,
+ 0x0000a737, 0x0000a736, 0x0001e92a, 0x0001e908,
+ 0x000003b8, 0x00000398, 0x000003dd, 0x000003dc,
+ 0x0000a657, 0x0000a656, 0x00001f87, 0x02000015,
+ 0x00002cb5, 0x00002cb4, 0x00001fad, 0x02000112,
+ 0x000000f5, 0x000000d5, 0x00000069, 0x00000049,
+ 0x00001f64, 0x00001f6c, 0x00002c8d, 0x00002c8c,
+ 0x00000432, 0x00000412, 0x0000015d, 0x0000015c,
+ 0x00000575, 0x00000545, 0x00002c99, 0x00002c98,
+ 0x0000056c, 0x0000053c, 0x00002c38, 0x00002c08,
+ 0x000013fc, 0x000013f4, 0x00000231, 0x00000230,
+ 0x000118c6, 0x000118a6, 0x00000260, 0x00000193,
+ 0x00001f34, 0x00001f3c, 0x000003cd, 0x0000038e,
+ 0x00000458, 0x00000408, 0x000004ab, 0x000004aa,
+ 0x000003f0, 0x0000039a, 0x0000013e, 0x0000013d,
+ 0x000104f3, 0x000104cb, 0x00000584, 0x00000554,
+ 0x00002d27, 0x000010c7, 0x0000abb4, 0x000013e4,
+ 0x000001b9, 0x000001b8, 0x00001e57, 0x00001e56,
+ 0x0000ff50, 0x0000ff30, 0x0000abae, 0x000013de,
+ 0x000003c4, 0x000003a4, 0x00001e6b, 0x00001e6a,
+ 0x0000ff43, 0x0000ff23, 0x00001f9d, 0x020000fa,
+ 0x00000199, 0x00000198, 0x00001f14, 0x00001f1c,
+ 0x000001eb, 0x000001ea, 0x00002c49, 0x00002c19,
+ 0x00010cd7, 0x00010c97, 0x00001f24, 0x00001f2c,
+ 0x00000568, 0x00000538, 0x0000021b, 0x0000021a,
+ 0x0000ab9f, 0x000013cf, 0x0000025c, 0x0000a7ab,
+ 0x00001ebf, 0x00001ebe, 0x0000a77f, 0x0000a77e,
+ 0x0000010f, 0x0000010e, 0x0000a723, 0x0000a722,
+ 0x00001f27, 0x00001f2f, 0x00000345, 0x00000399,
+ 0x00002cf3, 0x00002cf2, 0x00010cd8, 0x00010c98,
+ 0x0000027d, 0x00002c64, 0x00000455, 0x00000405,
+ 0x00002cd9, 0x00002cd8, 0x00010cde, 0x00010c9e,
+ 0x000001d6, 0x000001d5, 0x00001efd, 0x00001efc,
+ 0x0000ff44, 0x0000ff24, 0x00001e1b, 0x00001e1a,
+ 0x000003f1, 0x000003a1, 0x00001e2f, 0x00001e2e,
+ 0x000003c3, 0x000003a3, 0x000118d4, 0x000118b4,
+ 0x0000a7a9, 0x0000a7a8, 0x000118cd, 0x000118ad,
+ 0x000004ef, 0x000004ee, 0x000118c3, 0x000118a3,
+ 0x00000523, 0x00000522, 0x00000572, 0x00000542,
+ 0x0000017c, 0x0000017b, 0x000001e3, 0x000001e2,
+ 0x00000180, 0x00000243, 0x0000045a, 0x0000040a,
+ 0x00001e7d, 0x00001e7c, 0x000001f3, 0x000001f1,
+ 0x00001e91, 0x00001e90, 0x00000240, 0x00002c7f,
+ 0x00001f99, 0x020000ee, 0x00001f86, 0x02000012
+};
+
+static const unsigned _uccase_lower_g_size = 226;
+static const short _uccase_lower_g[] = {
+ 174, 834, 830, 1261, 252, 997, 556, 843,
+ 6, 2109, 145, 1305, 273, 4287, 671, 70,
+ 526, 9368, 50, -207, 128, 7, 4804, 632,
+ 1, -720, 6, 1678, 16681, -937, 7, 4106,
+ 4, 703, 233, 4578, 424, 1988, 7, 1733,
+ 33, 438, 4640, 3438, 339, 1230, 6, 700,
+ 198, 5215, 378, 745, 2, 1705, 141, 11971,
+ 559, 1365, 19, 736, 152, 715, 64, 268,
+ 575, 34, 11061, 628, 1, -565, 50, 73,
+ 20631, 289, 2, 817, 382, 6033, 658, 2119,
+ 33, 397, 144, 32767, 389, 491, 2616, 1837,
+ 191, 666, 2, 384, 1, 2083, 416, 562,
+ 5, 3012, 406, 7369, 268, 6961, 100, 799,
+ 537, 233, 55, 1085, 563, 130, 19254, 555,
+ 1, -273, 37, 40, 2992, 420, 1, 2219,
+ 664, 4076, 676, 3672, 8, 1400, 1828, -466,
+ 1593, 760, 583, 78, 389, 850, 33, -8,
+ 53, 3681, 410, 1221, 1, 205, 45, 3222,
+ 7, 2248, 333, 2155, 24, 1832, 70, 522,
+ 618, 914, 451, 8903, 2, 1127, 447, 166,
+ 1974, 3319, 40, -289, 7, 862, 9799, 682,
+ 2, 2919, 44, -183, 296, 2003, 506, 1136,
+ 37, 6362, 87, -110, 186, 250, 1258, 116,
+ 29, -181, 3, 3900, 2633, 1724, 2, 58,
+ 731, 663, 1, 11545, 69, 253, 521, 913,
+ 14, -269, 139, 3, 5560, 13878, 1, -767,
+ 930, 257, 5047, 2220, 2, 1144, 2226, 1326,
+ 423, 4483, 608, 6795, 384, 2580, 42, -57,
+ 5403, 5444
};
-static const unsigned int _uccase_size = 2621;
+static const unsigned _uccase_lower_table_size = 1304;
+static const unsigned _uccase_lower_table[] = {
+ 0x00002c06, 0x00002c36, 0x000010aa, 0x00002d0a,
+ 0x000104b0, 0x000104d8, 0x00010411, 0x00010439,
+ 0x0000a766, 0x0000a767, 0x00001f59, 0x00001f51,
+ 0x000004f6, 0x000004f7, 0x00010402, 0x0001042a,
+ 0x000104c6, 0x000104ee, 0x000104b5, 0x000104dd,
+ 0x0001e90f, 0x0001e931, 0x00001e50, 0x00001e51,
+ 0x0000a666, 0x0000a667, 0x0000016a, 0x0000016b,
+ 0x00010c89, 0x00010cc9, 0x000001b7, 0x00000292,
+ 0x000024cf, 0x000024e9, 0x00001ed2, 0x00001ed3,
+ 0x00010c86, 0x00010cc6, 0x0000a7a8, 0x0000a7a9,
+ 0x000010b6, 0x00002d16, 0x0000a66c, 0x0000a66d,
+ 0x00001f8a, 0x00001f82, 0x000001d7, 0x000001d8,
+ 0x000013b2, 0x0000ab82, 0x00002c72, 0x00002c73,
+ 0x000013ed, 0x0000abbd, 0x00001e82, 0x00001e83,
+ 0x00002c22, 0x00002c52, 0x00010414, 0x0001043c,
+ 0x000013d3, 0x0000aba3, 0x0000053f, 0x0000056f,
+ 0x00000531, 0x00000561, 0x000104cc, 0x000104f4,
+ 0x00002c02, 0x00002c32, 0x00000134, 0x00000135,
+ 0x0000a79e, 0x0000a79f, 0x00000056, 0x00000076,
+ 0x00002c67, 0x00002c68, 0x0000216c, 0x0000217c,
+ 0x000104c7, 0x000104ef, 0x0000054b, 0x0000057b,
+ 0x00001e30, 0x00001e31, 0x0000018e, 0x000001dd,
+ 0x00000541, 0x00000571, 0x00002cd6, 0x00002cd7,
+ 0x000118b4, 0x000118d4, 0x000013c5, 0x0000ab95,
+ 0x00001faa, 0x00001fa2, 0x0000054a, 0x0000057a,
+ 0x00001eb2, 0x00001eb3, 0x000004a8, 0x000004a9,
+ 0x00000120, 0x00000121, 0x000003e4, 0x000003e5,
+ 0x00000048, 0x00000068, 0x000024ca, 0x000024e4,
+ 0x00002166, 0x00002176, 0x000104ca, 0x000104f2,
+ 0x00001ee6, 0x00001ee7, 0x00000468, 0x00000469,
+ 0x00002c1a, 0x00002c4a, 0x00001e8a, 0x00001e8b,
+ 0x0000ff34, 0x0000ff54, 0x000013d0, 0x0000aba0,
+ 0x00002c00, 0x00002c30, 0x00001fbc, 0x00001fb3,
+ 0x000010a0, 0x00002d00, 0x000003fe, 0x0000037c,
+ 0x000004b6, 0x000004b7, 0x000000d1, 0x000000f1,
+ 0x00010420, 0x00010448, 0x00001feb, 0x00001f7b,
+ 0x000024b9, 0x000024d3, 0x0000047e, 0x0000047f,
+ 0x000000ca, 0x000000ea, 0x0000013f, 0x00000140,
+ 0x000013c6, 0x0000ab96, 0x0000052e, 0x0000052f,
+ 0x00000196, 0x00000269, 0x0000ff2c, 0x0000ff4c,
+ 0x000000d2, 0x000000f2, 0x0000041f, 0x0000043f,
+ 0x000003e0, 0x000003e1, 0x000024c0, 0x000024da,
+ 0x0000041e, 0x0000043e, 0x0001041f, 0x00010447,
+ 0x00000419, 0x00000439, 0x00002cc2, 0x00002cc3,
+ 0x00000540, 0x00000570, 0x000003ab, 0x000003cb,
+ 0x00010ca9, 0x00010ce9, 0x00001f9b, 0x00001f93,
+ 0x00000472, 0x00000473, 0x00000244, 0x00000289,
+ 0x0000a664, 0x0000a665, 0x000003aa, 0x000003ca,
+ 0x00000403, 0x00000453, 0x000010a5, 0x00002d05,
+ 0x000013a7, 0x0000ab77, 0x00001ed6, 0x00001ed7,
+ 0x000118bd, 0x000118dd, 0x0000042d, 0x0000044d,
+ 0x000013a4, 0x0000ab74, 0x000003dc, 0x000003dd,
+ 0x0000a7b1, 0x00000287, 0x0000054f, 0x0000057f,
+ 0x00000154, 0x00000155, 0x00000406, 0x00000456,
+ 0x00002c21, 0x00002c51, 0x00001e7e, 0x00001e7f,
+ 0x000104c8, 0x000104f0, 0x000010b4, 0x00002d14,
+ 0x000003a0, 0x000003c0, 0x000013bc, 0x0000ab8c,
+ 0x0000216b, 0x0000217b, 0x000118a4, 0x000118c4,
+ 0x000001cd, 0x000001ce, 0x00001e2a, 0x00001e2b,
+ 0x0000216d, 0x0000217d, 0x00010403, 0x0001042b,
+ 0x00000512, 0x00000513, 0x000013ea, 0x0000abba,
+ 0x0000051c, 0x0000051d, 0x00001e56, 0x00001e57,
+ 0x0000a748, 0x0000a749, 0x0000a746, 0x0000a747,
+ 0x0000050c, 0x0000050d, 0x00001e66, 0x00001e67,
+ 0x00002161, 0x00002171, 0x00000182, 0x00000183,
+ 0x00002c11, 0x00002c41, 0x0000a648, 0x0000a649,
+ 0x00001e7c, 0x00001e7d, 0x000004aa, 0x000004ab,
+ 0x000004ac, 0x000004ad, 0x000118aa, 0x000118ca,
+ 0x0000005a, 0x0000007a, 0x00001e14, 0x00001e15,
+ 0x0000ff24, 0x0000ff44, 0x000013a1, 0x0000ab71,
+ 0x00001e20, 0x00001e21, 0x00002c14, 0x00002c44,
+ 0x000003a9, 0x000003c9, 0x00000554, 0x00000584,
+ 0x00000520, 0x00000521, 0x000118b3, 0x000118d3,
+ 0x000003f4, 0x000003b8, 0x00001f9a, 0x00001f92,
+ 0x000104c0, 0x000104e8, 0x00001e68, 0x00001e69,
+ 0x0000212a, 0x0000006b, 0x00001e84, 0x00001e85,
+ 0x000010b0, 0x00002d10, 0x0000023e, 0x00002c66,
+ 0x00002ca0, 0x00002ca1, 0x00000474, 0x00000475,
+ 0x000118ad, 0x000118cd, 0x00000396, 0x000003b6,
+ 0x00010c94, 0x00010cd4, 0x00001fea, 0x00001f7a,
+ 0x00001eaa, 0x00001eab, 0x00002ced, 0x00002cee,
+ 0x000118a5, 0x000118c5, 0x0000039b, 0x000003bb,
+ 0x00002c86, 0x00002c87, 0x000024ce, 0x000024e8,
+ 0x00001e64, 0x00001e65, 0x0001041b, 0x00010443,
+ 0x00001e48, 0x00001e49, 0x0000a640, 0x0000a641,
+ 0x00001fa8, 0x00001fa0, 0x000013a0, 0x0000ab70,
+ 0x000001e6, 0x000001e7, 0x00010c91, 0x00010cd1,
+ 0x00000388, 0x000003ad, 0x00002c6f, 0x00000250,
+ 0x00000502, 0x00000503, 0x00001e10, 0x00001e11,
+ 0x0000040a, 0x0000045a, 0x000000d4, 0x000000f4,
+ 0x0000039e, 0x000003be, 0x000104be, 0x000104e6,
+ 0x0000a690, 0x0000a691, 0x00000041, 0x00000061,
+ 0x00010409, 0x00010431, 0x00000055, 0x00000075,
+ 0x000013e0, 0x0000abb0, 0x0000038f, 0x000003ce,
+ 0x00010404, 0x0001042c, 0x00010caf, 0x00010cef,
+ 0x000013e7, 0x0000abb7, 0x00010400, 0x00010428,
+ 0x00001ef0, 0x00001ef1, 0x000024bb, 0x000024d5,
+ 0x00010ca6, 0x00010ce6, 0x000013b5, 0x0000ab85,
+ 0x0000014c, 0x0000014d, 0x00000498, 0x00000499,
+ 0x00000547, 0x00000577, 0x000104d3, 0x000104fb,
+ 0x00000412, 0x00000432, 0x000118b8, 0x000118d8,
+ 0x0000a7b0, 0x0000029e, 0x000013ad, 0x0000ab7d,
+ 0x000013d9, 0x0000aba9, 0x00001e1a, 0x00001e1b,
+ 0x000003fd, 0x0000037b, 0x00002c07, 0x00002c37,
+ 0x000104d2, 0x000104fa, 0x000013d5, 0x0000aba5,
+ 0x0000051e, 0x0000051f, 0x00002c1c, 0x00002c4c,
+ 0x0000a752, 0x0000a753, 0x0000039d, 0x000003bd,
+ 0x000013ce, 0x0000ab9e, 0x00000198, 0x00000199,
+ 0x00010cae, 0x00010cee, 0x0000a7aa, 0x00000266,
+ 0x00010405, 0x0001042d, 0x000010a6, 0x00002d06,
+ 0x00001fe9, 0x00001fe1, 0x0000041d, 0x0000043d,
+ 0x000001ca, 0x000001cc, 0x00000424, 0x00000444,
+ 0x000104bd, 0x000104e5, 0x0000a72a, 0x0000a72b,
+ 0x00001ffb, 0x00001f7d, 0x00001e00, 0x00001e01,
+ 0x000004f0, 0x000004f1, 0x000013c4, 0x0000ab94,
+ 0x000004da, 0x000004db, 0x00001e52, 0x00001e53,
+ 0x0000ff38, 0x0000ff58, 0x000001a4, 0x000001a5,
+ 0x0000a796, 0x0000a797, 0x00000058, 0x00000078,
+ 0x0000a75c, 0x0000a75d, 0x0000216a, 0x0000217a,
+ 0x0001e90d, 0x0001e92f, 0x00001efa, 0x00001efb,
+ 0x00010c9b, 0x00010cdb, 0x00000053, 0x00000073,
+ 0x000000cd, 0x000000ed, 0x0000049a, 0x0000049b,
+ 0x000118b7, 0x000118d7, 0x00002c2d, 0x00002c5d,
+ 0x00001f9e, 0x00001f96, 0x00000043, 0x00000063,
+ 0x00010c9a, 0x00010cda, 0x000024bd, 0x000024d7,
+ 0x000001a0, 0x000001a1, 0x000003ee, 0x000003ef,
+ 0x00000044, 0x00000064, 0x00001f2d, 0x00001f25,
+ 0x000001fc, 0x000001fd, 0x0001041a, 0x00010442,
+ 0x0000039a, 0x000003ba, 0x0000a7ae, 0x0000026a,
+ 0x00000539, 0x00000569, 0x00001eae, 0x00001eaf,
+ 0x00002cce, 0x00002ccf, 0x00001f19, 0x00001f11,
+ 0x00002c12, 0x00002c42, 0x000004bc, 0x000004bd,
+ 0x0000017b, 0x0000017c, 0x000001e2, 0x000001e3,
+ 0x0000040f, 0x0000045f, 0x000003da, 0x000003db,
+ 0x00001f3d, 0x00001f35, 0x00002c05, 0x00002c35,
+ 0x0000a652, 0x0000a653, 0x0000ff3a, 0x0000ff5a,
+ 0x00000122, 0x00000123, 0x00002c01, 0x00002c31,
+ 0x000118a0, 0x000118c0, 0x000024b7, 0x000024d1,
+ 0x00002c2c, 0x00002c5c, 0x0000ff2e, 0x0000ff4e,
+ 0x000013b3, 0x0000ab83, 0x0000a786, 0x0000a787,
+ 0x0000a77d, 0x00001d79, 0x0000a692, 0x0000a693,
+ 0x00001eb8, 0x00001eb9, 0x00010427, 0x0001044f,
+ 0x000003a1, 0x000003c1, 0x00010cb2, 0x00010cf2,
+ 0x00000544, 0x00000574, 0x000010bc, 0x00002d1c,
+ 0x0000ff2a, 0x0000ff4a, 0x000004cd, 0x000004ce,
+ 0x0000010c, 0x0000010d, 0x0000024e, 0x0000024f,
+ 0x00000526, 0x00000527, 0x00001e8c, 0x00001e8d,
+ 0x00002c7f, 0x00000240, 0x000000d8, 0x000000f8,
+ 0x0000a764, 0x0000a765, 0x00000102, 0x00000103,
+ 0x000004dc, 0x000004dd, 0x00000414, 0x00000434,
+ 0x0000048c, 0x0000048d, 0x00002c0d, 0x00002c3d,
+ 0x000104b7, 0x000104df, 0x00000552, 0x00000582,
+ 0x0000015a, 0x0000015b, 0x00002cae, 0x00002caf,
+ 0x0001e90a, 0x0001e92c, 0x000003fa, 0x000003fb,
+ 0x000013f2, 0x000013fa, 0x0000a650, 0x0000a651,
+ 0x000003a4, 0x000003c4, 0x000024cd, 0x000024e7,
+ 0x000003a7, 0x000003c7, 0x000013a8, 0x0000ab78,
+ 0x000000c9, 0x000000e9, 0x00001ed8, 0x00001ed9,
+ 0x00010c9c, 0x00010cdc, 0x00010407, 0x0001042f,
+ 0x00002c80, 0x00002c81, 0x00002c64, 0x0000027d,
+ 0x000104b8, 0x000104e0, 0x000104cf, 0x000104f7,
+ 0x0000a64e, 0x0000a64f, 0x00001eb4, 0x00001eb5,
+ 0x0001e91c, 0x0001e93e, 0x000013ee, 0x0000abbe,
+ 0x000013c3, 0x0000ab93, 0x00002c24, 0x00002c54,
+ 0x0000a760, 0x0000a761, 0x00002c08, 0x00002c38,
+ 0x00001ecc, 0x00001ecd, 0x00000506, 0x00000507,
+ 0x000118ac, 0x000118cc, 0x0000012c, 0x0000012d,
+ 0x00001fc8, 0x00001f72, 0x0000a758, 0x0000a759,
+ 0x00001f0c, 0x00001f04, 0x0001e90b, 0x0001e92d,
+ 0x000001ae, 0x00000288, 0x000013bd, 0x0000ab8d,
+ 0x00000106, 0x00000107, 0x0000053d, 0x0000056d,
+ 0x00001f18, 0x00001f10, 0x000118b5, 0x000118d5,
+ 0x00000372, 0x00000373, 0x00000553, 0x00000583,
+ 0x000104c5, 0x000104ed, 0x00001e78, 0x00001e79,
+ 0x000010bf, 0x00002d1f, 0x00001e36, 0x00001e37,
+ 0x00001f8d, 0x00001f85, 0x0000004a, 0x0000006a,
+ 0x000004c9, 0x000004ca, 0x000001f2, 0x000001f3,
+ 0x000013b4, 0x0000ab84, 0x00000398, 0x000003b8,
+ 0x0000a7b2, 0x0000029d, 0x000004ba, 0x000004bb,
+ 0x00001f5d, 0x00001f55, 0x0000047c, 0x0000047d,
+ 0x000118a1, 0x000118c1, 0x00000393, 0x000003b3,
+ 0x00010c96, 0x00010cd6, 0x00010406, 0x0001042e,
+ 0x00001f2c, 0x00001f24, 0x00010c82, 0x00010cc2,
+ 0x00001e4c, 0x00001e4d, 0x00000187, 0x00000188,
+ 0x000000c2, 0x000000e2, 0x00000508, 0x00000509,
+ 0x000004e0, 0x000004e1, 0x00002c2b, 0x00002c5b,
+ 0x00002c15, 0x00002c45, 0x000010be, 0x00002d1e,
+ 0x0000053c, 0x0000056c, 0x00001eca, 0x00001ecb,
+ 0x0000ff32, 0x0000ff52, 0x00001faf, 0x00001fa7,
+ 0x00000047, 0x00000067, 0x000001a7, 0x000001a8,
+ 0x00010418, 0x00010440, 0x00001ebe, 0x00001ebf,
+ 0x000004d6, 0x000004d7, 0x0001041c, 0x00010444,
+ 0x000013ef, 0x0000abbf, 0x00000522, 0x00000523,
+ 0x000000cf, 0x000000ef, 0x00000404, 0x00000454,
+ 0x00000132, 0x00000133, 0x000010a3, 0x00002d03,
+ 0x00001fbb, 0x00001f71, 0x00000510, 0x00000511,
+ 0x00010425, 0x0001044d, 0x00002cb0, 0x00002cb1,
+ 0x000001b8, 0x000001b9, 0x0000a7b3, 0x0000ab53,
+ 0x00000194, 0x00000263, 0x000024b6, 0x000024d0,
+ 0x00001eb0, 0x00001eb1, 0x00001f6d, 0x00001f65,
+ 0x00002c63, 0x00001d7d, 0x000013da, 0x0000abaa,
+ 0x00000248, 0x00000249, 0x00000178, 0x000000ff,
+ 0x00010ca7, 0x00010ce7, 0x000104ba, 0x000104e2,
+ 0x000000db, 0x000000fb, 0x0000ff2b, 0x0000ff4b,
+ 0x000024c8, 0x000024e2, 0x00002c8c, 0x00002c8d,
+ 0x00010ca3, 0x00010ce3, 0x0000019d, 0x00000272,
+ 0x00000139, 0x0000013a, 0x0000a754, 0x0000a755,
+ 0x000010a8, 0x00002d08, 0x00000418, 0x00000438,
+ 0x00001f99, 0x00001f91, 0x000010af, 0x00002d0f,
+ 0x0001e912, 0x0001e934, 0x000000c1, 0x000000e1,
+ 0x0000004d, 0x0000006d, 0x00000426, 0x00000446,
+ 0x00001e60, 0x00001e61, 0x000010b2, 0x00002d12,
+ 0x0001e902, 0x0001e924, 0x000001b1, 0x0000028a,
+ 0x00002c88, 0x00002c89, 0x00000230, 0x00000231,
+ 0x0000a694, 0x0000a695, 0x000013ba, 0x0000ab8a,
+ 0x0000016c, 0x0000016d, 0x0000011a, 0x0000011b,
+ 0x00001e62, 0x00001e63, 0x00001f1b, 0x00001f13,
+ 0x0000a646, 0x0000a647, 0x000013dc, 0x0000abac,
+ 0x00000551, 0x00000581, 0x000003a6, 0x000003c6,
+ 0x000104b6, 0x000104de, 0x00001f4b, 0x00001f43,
+ 0x000104d1, 0x000104f9, 0x00002cda, 0x00002cdb,
+ 0x000118b9, 0x000118d9, 0x0000ff25, 0x0000ff45,
+ 0x000000c5, 0x000000e5, 0x00002c17, 0x00002c47,
+ 0x00001e18, 0x00001e19, 0x0000042f, 0x0000044f,
+ 0x00002cc0, 0x00002cc1, 0x000013a9, 0x0000ab79,
+ 0x0000004c, 0x0000006c, 0x00010c9f, 0x00010cdf,
+ 0x000001f7, 0x000001bf, 0x000118ae, 0x000118ce,
+ 0x0000012a, 0x0000012b, 0x00010c90, 0x00010cd0,
+ 0x0000a688, 0x0000a689, 0x000010c1, 0x00002d21,
+ 0x000004ee, 0x000004ef, 0x0000023a, 0x00002c65,
+ 0x0000ff29, 0x0000ff49, 0x0000019f, 0x00000275,
+ 0x00000548, 0x00000578, 0x000013b0, 0x0000ab80,
+ 0x00002cd8, 0x00002cd9, 0x00001e86, 0x00001e87,
+ 0x0000037f, 0x000003f3, 0x00001e0e, 0x00001e0f,
+ 0x000024c6, 0x000024e0, 0x00001ece, 0x00001ecf,
+ 0x00000222, 0x00000223, 0x0000038a, 0x000003af,
+ 0x00001f9c, 0x00001f94, 0x00000532, 0x00000562,
+ 0x000013aa, 0x0000ab7a, 0x0000ff30, 0x0000ff50,
+ 0x0000024c, 0x0000024d, 0x00002ceb, 0x00002cec,
+ 0x0000a750, 0x0000a751, 0x0000a732, 0x0000a733,
+ 0x000001f1, 0x000001f3, 0x0001040a, 0x00010432,
+ 0x00002c13, 0x00002c43, 0x00010c97, 0x00010cd7,
+ 0x0000ff39, 0x0000ff59, 0x00001e38, 0x00001e39,
+ 0x00002c28, 0x00002c58, 0x000004c7, 0x000004c8,
+ 0x000004cb, 0x000004cc, 0x000013d7, 0x0000aba7,
+ 0x0000048e, 0x0000048f, 0x00001ff8, 0x00001f78,
+ 0x0000a736, 0x0000a737, 0x00000407, 0x00000457,
+ 0x00001e02, 0x00001e03, 0x00010423, 0x0001044b,
+ 0x0000a68a, 0x0000a68b, 0x000001ac, 0x000001ad,
+ 0x00010410, 0x00010438, 0x00002c10, 0x00002c40,
+ 0x00001f08, 0x00001f00, 0x0000ff35, 0x0000ff55,
+ 0x00000152, 0x00000153, 0x0000a734, 0x0000a735,
+ 0x00000118, 0x00000119, 0x000013eb, 0x0000abbb,
+ 0x000013c1, 0x0000ab91, 0x0000053b, 0x0000056b,
+ 0x000000da, 0x000000fa, 0x0000021e, 0x0000021f,
+ 0x00000186, 0x00000254, 0x0000a73c, 0x0000a73d,
+ 0x00001ef2, 0x00001ef3, 0x00001e2e, 0x00001e2f,
+ 0x000001b2, 0x0000028b, 0x0000ff27, 0x0000ff47,
+ 0x0000a74c, 0x0000a74d, 0x00000411, 0x00000431,
+ 0x00002cac, 0x00002cad, 0x00001fab, 0x00001fa3,
+ 0x0001e91a, 0x0001e93c, 0x000000c0, 0x000000e0,
+ 0x00010ca4, 0x00010ce4, 0x00002183, 0x00002184,
+ 0x0000053e, 0x0000056e, 0x00001e70, 0x00001e71,
+ 0x00001f8f, 0x00001f87, 0x0000004b, 0x0000006b,
+ 0x000118a8, 0x000118c8, 0x00002c8e, 0x00002c8f,
+ 0x00001e24, 0x00001e25, 0x0000a7a0, 0x0000a7a1,
+ 0x000010b8, 0x00002d18, 0x000010a9, 0x00002d09,
+ 0x000013e8, 0x0000abb8, 0x000118b6, 0x000118d6,
+ 0x00000190, 0x0000025b, 0x000104bb, 0x000104e3,
+ 0x00001e6e, 0x00001e6f, 0x000013f3, 0x000013fb,
+ 0x00002c20, 0x00002c50, 0x000104b4, 0x000104dc,
+ 0x00000160, 0x00000161, 0x00001f9f, 0x00001f97,
+ 0x0000048a, 0x0000048b, 0x00001efe, 0x00001eff,
+ 0x00002c75, 0x00002c76, 0x000104b1, 0x000104d9,
+ 0x000003e8, 0x000003e9, 0x0000004e, 0x0000006e,
+ 0x00000224, 0x00000225, 0x000001f4, 0x000001f5,
+ 0x000118bb, 0x000118db, 0x00000116, 0x00000117,
+ 0x0000a7b4, 0x0000a7b5, 0x0000040c, 0x0000045c,
+ 0x000010ba, 0x00002d1a, 0x00000220, 0x0000019e,
+ 0x000118a9, 0x000118c9, 0x000001c5, 0x000001c6,
+ 0x00001fd9, 0x00001fd1, 0x000004e6, 0x000004e7,
+ 0x0001e910, 0x0001e932, 0x00010412, 0x0001043a,
+ 0x00002c98, 0x00002c99, 0x00000193, 0x00000260,
+ 0x000001a9, 0x00000283, 0x000013be, 0x0000ab8e,
+ 0x0000a779, 0x0000a77a, 0x00001f5b, 0x00001f53,
+ 0x0000038c, 0x000003cc, 0x00001f49, 0x00001f41,
+ 0x00000537, 0x00000567, 0x0001e915, 0x0001e937,
+ 0x0000046a, 0x0000046b, 0x000104cb, 0x000104f3,
+ 0x00002cba, 0x00002cbb, 0x00001f6a, 0x00001f62,
+ 0x000024c1, 0x000024db, 0x000004c1, 0x000004c2,
+ 0x00010417, 0x0001043f, 0x000013a3, 0x0000ab73,
+ 0x0000011e, 0x0000011f, 0x00000543, 0x00000573,
+ 0x00001f0e, 0x00001f06, 0x00002c94, 0x00002c95,
+ 0x000001db, 0x000001dc, 0x00001f69, 0x00001f61,
+ 0x00001f6b, 0x00001f63, 0x0000a660, 0x0000a661,
+ 0x00001e12, 0x00001e13, 0x00002c90, 0x00002c91,
+ 0x000000d5, 0x000000f5, 0x00001f0b, 0x00001f03,
+ 0x0000019c, 0x0000026f, 0x0000a68e, 0x0000a68f,
+ 0x00001eb6, 0x00001eb7, 0x000104c2, 0x000104ea,
+ 0x0000212b, 0x000000e5, 0x000013d8, 0x0000aba8,
+ 0x0000049c, 0x0000049d, 0x000013e1, 0x0000abb1,
+ 0x00000409, 0x00000459, 0x00002c27, 0x00002c57,
+ 0x000004d0, 0x000004d1, 0x0000a72e, 0x0000a72f,
+ 0x000024cc, 0x000024e6, 0x00010416, 0x0001043e,
+ 0x00002163, 0x00002173, 0x000013cb, 0x0000ab9b,
+ 0x0000a784, 0x0000a785, 0x0000054c, 0x0000057c,
+ 0x00001e32, 0x00001e33, 0x00002c23, 0x00002c53,
+ 0x00001fb9, 0x00001fb1, 0x00000370, 0x00000371,
+ 0x000013d2, 0x0000aba2, 0x000004ec, 0x000004ed,
+ 0x00001e90, 0x00001e91, 0x00000428, 0x00000448,
+ 0x00001ed4, 0x00001ed5, 0x0000a738, 0x0000a739,
+ 0x000013f0, 0x000013f8, 0x0000a668, 0x0000a669,
+ 0x00000391, 0x000003b1, 0x00001ee4, 0x00001ee5,
+ 0x00000184, 0x00000185, 0x00001ec8, 0x00001ec9,
+ 0x0000047a, 0x0000047b, 0x000104b9, 0x000104e1,
+ 0x000004fa, 0x000004fb, 0x00001fcc, 0x00001fc3,
+ 0x00000210, 0x00000211, 0x000104b3, 0x000104db,
+ 0x000004f2, 0x000004f3, 0x00001e6c, 0x00001e6d,
+ 0x00010c8b, 0x00010ccb, 0x00001e6a, 0x00001e6b,
+ 0x0000a728, 0x0000a729, 0x00002cdc, 0x00002cdd,
+ 0x00000417, 0x00000437, 0x00000166, 0x00000167,
+ 0x00002c2e, 0x00002c5e, 0x0001e91d, 0x0001e93f,
+ 0x00001e7a, 0x00001e7b, 0x00002c25, 0x00002c55,
+ 0x0000040b, 0x0000045b, 0x0000022e, 0x0000022f,
+ 0x00000189, 0x00000256, 0x00000535, 0x00000565,
+ 0x00002164, 0x00002174, 0x000118bf, 0x000118df,
+ 0x00002165, 0x00002175, 0x0000a782, 0x0000a783,
+ 0x0000a680, 0x0000a681, 0x000104c4, 0x000104ec,
+ 0x0000a662, 0x0000a663, 0x000118ab, 0x000118cb,
+ 0x000001de, 0x000001df, 0x000104d0, 0x000104f8,
+ 0x0001e909, 0x0001e92b, 0x00001f68, 0x00001f60,
+ 0x000004a0, 0x000004a1, 0x00001e1e, 0x00001e1f,
+ 0x00010c92, 0x00010cd2, 0x00000110, 0x00000111,
+ 0x000004f8, 0x000004f9, 0x0000ff33, 0x0000ff53,
+ 0x000024c9, 0x000024e3, 0x0000038e, 0x000003cd,
+ 0x00000464, 0x00000465, 0x00000534, 0x00000564,
+ 0x00001ea8, 0x00001ea9, 0x000010c7, 0x00002d27,
+ 0x000000d0, 0x000000f0, 0x0000a75e, 0x0000a75f,
+ 0x00002c03, 0x00002c33, 0x0000a696, 0x0000a697,
+ 0x00001ec4, 0x00001ec5, 0x000001d5, 0x000001d6,
+ 0x0001041e, 0x00010446, 0x00010c99, 0x00010cd9,
+ 0x00000500, 0x00000501, 0x00010ca5, 0x00010ce5,
+ 0x0000ff36, 0x0000ff56, 0x000010b7, 0x00002d17,
+ 0x00002ca2, 0x00002ca3, 0x00001ed0, 0x00001ed1,
+ 0x00001e74, 0x00001e75, 0x00001e92, 0x00001e93,
+ 0x00002c9a, 0x00002c9b, 0x00000128, 0x00000129,
+ 0x00010c95, 0x00010cd5, 0x000010ae, 0x00002d0e,
+ 0x0001e913, 0x0001e935, 0x00000112, 0x00000113,
+ 0x000118bc, 0x000118dc, 0x000003de, 0x000003df,
+ 0x00001e5c, 0x00001e5d, 0x00000181, 0x00000253,
+ 0x00000176, 0x00000177, 0x00002c16, 0x00002c46,
+ 0x000013d1, 0x0000aba1, 0x00002c1f, 0x00002c4f,
+ 0x00000200, 0x00000201, 0x00000533, 0x00000563,
+ 0x00001ffc, 0x00001ff3, 0x0000004f, 0x0000006f,
+ 0x00000218, 0x00000219, 0x000013ae, 0x0000ab7e,
+ 0x0000a658, 0x0000a659, 0x000010a4, 0x00002d04,
+ 0x0000010e, 0x0000010f, 0x0001040b, 0x00010433,
+ 0x000013ab, 0x0000ab7b, 0x00001f38, 0x00001f30,
+ 0x00000405, 0x00000455, 0x0000013b, 0x0000013c,
+ 0x00000429, 0x00000449, 0x00001f8c, 0x00001f84,
+ 0x00000191, 0x00000192, 0x00002132, 0x0000214e,
+ 0x0000a742, 0x0000a743, 0x00000150, 0x00000151,
+ 0x00002ca6, 0x00002ca7, 0x00010ca8, 0x00010ce8,
+ 0x000010bd, 0x00002d1d, 0x00002c19, 0x00002c49,
+ 0x00000124, 0x00000125, 0x00002c29, 0x00002c59,
+ 0x00000059, 0x00000079, 0x00002167, 0x00002177,
+ 0x00001ea4, 0x00001ea5, 0x0001e90c, 0x0001e92e,
+ 0x00001e44, 0x00001e45, 0x00001f6f, 0x00001f67,
+ 0x00001fd8, 0x00001fd0, 0x00000545, 0x00000575,
+ 0x00002cbe, 0x00002cbf, 0x00001ede, 0x00001edf,
+ 0x00000162, 0x00000163, 0x000013e3, 0x0000abb3,
+ 0x0000a644, 0x0000a645, 0x00001ec0, 0x00001ec1,
+ 0x0000a790, 0x0000a791, 0x00001f2f, 0x00001f27,
+ 0x00002cc6, 0x00002cc7, 0x000003a8, 0x000003c8,
+ 0x0000a74e, 0x0000a74f, 0x000001f6, 0x00000195,
+ 0x00002c82, 0x00002c83, 0x00000136, 0x00000137,
+ 0x0000a77e, 0x0000a77f, 0x0000a686, 0x0000a687,
+ 0x00001eac, 0x00001ead, 0x00000427, 0x00000447,
+ 0x000004fe, 0x000004ff, 0x00002126, 0x000003c9,
+ 0x00001f28, 0x00001f20, 0x00000214, 0x00000215,
+ 0x0000ff21, 0x0000ff41, 0x000004a6, 0x000004a7,
+ 0x00001e08, 0x00001e09, 0x00001e9e, 0x000000df,
+ 0x00000046, 0x00000066, 0x000000c7, 0x000000e7,
+ 0x000001e8, 0x000001e9, 0x0000018f, 0x00000259,
+ 0x00001f0a, 0x00001f02, 0x00000462, 0x00000463,
+ 0x00001ee8, 0x00001ee9, 0x00001e94, 0x00001e95,
+ 0x00002ccc, 0x00002ccd, 0x000000d6, 0x000000f6,
+ 0x00010ca2, 0x00010ce2, 0x00001ff9, 0x00001f79,
+ 0x000010a2, 0x00002d02, 0x000001bc, 0x000001bd,
+ 0x00000494, 0x00000495, 0x000118ba, 0x000118da,
+ 0x0000a73a, 0x0000a73b, 0x00000549, 0x00000579,
+ 0x00001e8e, 0x00001e8f, 0x00002c18, 0x00002c48,
+ 0x00000108, 0x00000109, 0x00010c8c, 0x00010ccc,
+ 0x00002c0b, 0x00002c3b, 0x0000a64c, 0x0000a64d,
+ 0x0000011c, 0x0000011d, 0x00002cb6, 0x00002cb7,
+ 0x00001fb8, 0x00001fb0, 0x000013ca, 0x0000ab9a,
+ 0x0000a78d, 0x00000265, 0x000024ba, 0x000024d4,
+ 0x00000410, 0x00000430, 0x00010422, 0x0001044a,
+ 0x00010c8a, 0x00010cca, 0x000013cc, 0x0000ab9c,
+ 0x0000a792, 0x0000a793, 0x0000015c, 0x0000015d,
+ 0x00010cab, 0x00010ceb, 0x000010bb, 0x00002d1b,
+ 0x00000226, 0x00000227, 0x00001f48, 0x00001f40,
+ 0x000013db, 0x0000abab, 0x00001ea6, 0x00001ea7,
+ 0x000118a2, 0x000118c2, 0x000004c5, 0x000004c6,
+ 0x000013b6, 0x0000ab86, 0x0000ff2d, 0x0000ff4d,
+ 0x00001e34, 0x00001e35, 0x0000a77b, 0x0000a77c,
+ 0x0001040e, 0x00010436, 0x00010c9e, 0x00010cde,
+ 0x000013d4, 0x0000aba4, 0x0000021a, 0x0000021b,
+ 0x00001ef6, 0x00001ef7, 0x0000042a, 0x0000044a,
+ 0x00001e5e, 0x00001e5f, 0x0001e900, 0x0001e922,
+ 0x00001f3e, 0x00001f36, 0x0000050e, 0x0000050f,
+ 0x00000170, 0x00000171, 0x000013c2, 0x0000ab92,
+ 0x0000014a, 0x0000014b, 0x00001e1c, 0x00001e1d,
+ 0x00002c9c, 0x00002c9d, 0x00001e0c, 0x00001e0d,
+ 0x00002160, 0x00002170, 0x00001fca, 0x00001f74,
+ 0x000004d8, 0x000004d9, 0x000013e4, 0x0000abb4,
+ 0x000104bc, 0x000104e4, 0x000001c8, 0x000001c9,
+ 0x000010c2, 0x00002d22, 0x000000c4, 0x000000e4,
+ 0x000013c7, 0x0000ab97, 0x00002cde, 0x00002cdf,
+ 0x0000a7ad, 0x0000026c, 0x00002c1e, 0x00002c4e,
+ 0x0000a654, 0x0000a655, 0x0000a642, 0x0000a643,
+ 0x00001e5a, 0x00001e5b, 0x00000490, 0x00000491,
+ 0x000001b3, 0x000001b4, 0x0000a7b6, 0x0000a7b7,
+ 0x00000246, 0x00000247, 0x00001e16, 0x00001e17,
+ 0x000001fa, 0x000001fb, 0x00000496, 0x00000497,
+ 0x00000399, 0x000003b9, 0x00010c87, 0x00010cc7,
+ 0x0000a682, 0x0000a683, 0x000010b9, 0x00002d19,
+ 0x00002cd0, 0x00002cd1, 0x0000051a, 0x0000051b,
+ 0x000003d8, 0x000003d9, 0x000001a6, 0x00000280,
+ 0x00010426, 0x0001044e, 0x000118a6, 0x000118c6,
+ 0x000004a2, 0x000004a3, 0x00000100, 0x00000101,
+ 0x0000a7a2, 0x0000a7a3, 0x00001f98, 0x00001f90,
+ 0x00000415, 0x00000435, 0x00002ca4, 0x00002ca5,
+ 0x000013df, 0x0000abaf, 0x00000401, 0x00000451,
+ 0x0000a7ab, 0x0000025c, 0x00000536, 0x00000566,
+ 0x0000041b, 0x0000043b, 0x00000476, 0x00000477,
+ 0x000118a3, 0x000118c3, 0x000001c7, 0x000001c9,
+ 0x0000040d, 0x0000045d, 0x0000a698, 0x0000a699,
+ 0x00001ec6, 0x00001ec7, 0x0001e916, 0x0001e938,
+ 0x000010a7, 0x00002d07, 0x00002c6d, 0x00000251,
+ 0x00001fe8, 0x00001fe0, 0x000010c4, 0x00002d24,
+ 0x00002c0e, 0x00002c3e, 0x000013ec, 0x0000abbc,
+ 0x00000386, 0x000003ac, 0x00000413, 0x00000433,
+ 0x00000528, 0x00000529, 0x000003f9, 0x000003f2,
+ 0x000104b2, 0x000104da, 0x00000395, 0x000003b5,
+ 0x00000376, 0x00000377, 0x00001efc, 0x00001efd,
+ 0x000024bf, 0x000024d9, 0x00000416, 0x00000436,
+ 0x00010415, 0x0001043d, 0x000004d4, 0x000004d5,
+ 0x000013e2, 0x0000abb2, 0x000004fc, 0x000004fd,
+ 0x000013dd, 0x0000abad, 0x00010cad, 0x00010ced,
+ 0x00001e06, 0x00001e07, 0x0000054e, 0x0000057e,
+ 0x00000204, 0x00000205, 0x000024cb, 0x000024e5,
+ 0x000013c0, 0x0000ab90, 0x000004e4, 0x000004e5,
+ 0x00001f09, 0x00001f01, 0x000013e6, 0x0000abb6,
+ 0x0001e91b, 0x0001e93d, 0x000010c0, 0x00002d20,
+ 0x00000422, 0x00000442, 0x0001040d, 0x00010435,
+ 0x00001eec, 0x00001eed, 0x000013f1, 0x000013f9,
+ 0x00002cc4, 0x00002cc5, 0x00001f2a, 0x00001f22,
+ 0x0000042b, 0x0000044b, 0x00001fba, 0x00001f70,
+ 0x000000cb, 0x000000eb, 0x00000202, 0x00000203,
+ 0x00002cc8, 0x00002cc9, 0x00000141, 0x00000142,
+ 0x00010c8d, 0x00010ccd, 0x00000208, 0x00000209,
+ 0x000010b1, 0x00002d11, 0x0000ff28, 0x0000ff48,
+ 0x00001e28, 0x00001e29, 0x0000a7a4, 0x0000a7a5,
+ 0x00010cac, 0x00010cec, 0x00000460, 0x00000461,
+ 0x000013f4, 0x000013fc, 0x0001e911, 0x0001e933,
+ 0x0001e920, 0x0001e942, 0x00010c8e, 0x00010cce,
+ 0x00000555, 0x00000585, 0x0000a724, 0x0000a725,
+ 0x00002ce2, 0x00002ce3, 0x00010c84, 0x00010cc4,
+ 0x00000164, 0x00000165, 0x0000a756, 0x0000a757,
+ 0x00001f5f, 0x00001f57, 0x000001cf, 0x000001d0,
+ 0x000004b0, 0x000004b1, 0x00001e3c, 0x00001e3d,
+ 0x0000a79a, 0x0000a79b, 0x00000052, 0x00000072,
+ 0x000004be, 0x000004bf, 0x000001f8, 0x000001f9,
+ 0x0000a76a, 0x0000a76b, 0x00001e3e, 0x00001e3f,
+ 0x00002c6e, 0x00000271, 0x0001e903, 0x0001e925,
+ 0x00001eda, 0x00001edb, 0x00002cf2, 0x00002cf3,
+ 0x0000014e, 0x0000014f, 0x0000a76e, 0x0000a76f,
+ 0x00001eee, 0x00001eef, 0x000004c0, 0x000004cf,
+ 0x000013b8, 0x0000ab88, 0x000001b5, 0x000001b6,
+ 0x00001e3a, 0x00001e3b, 0x00001ee2, 0x00001ee3,
+ 0x000013cf, 0x0000ab9f, 0x00002c8a, 0x00002c8b,
+ 0x000001e4, 0x000001e5, 0x00000514, 0x00000515,
+ 0x0000039c, 0x000003bc, 0x0000a7ac, 0x00000261,
+ 0x0000053a, 0x0000056a, 0x00001f1c, 0x00001f14,
+ 0x0000ff31, 0x0000ff51, 0x000118a7, 0x000118c7,
+ 0x0001e921, 0x0001e943, 0x0000013d, 0x0000013e,
+ 0x000024c4, 0x000024de, 0x00000130, 0x02000142,
+ 0x00002c1b, 0x00002c4b, 0x00001e04, 0x00001e05,
+ 0x0001e90e, 0x0001e930, 0x00000179, 0x0000017a,
+ 0x00001e46, 0x00001e47, 0x0000ff26, 0x0000ff46,
+ 0x00000243, 0x00000180, 0x00000389, 0x000003ae,
+ 0x00001e54, 0x00001e55, 0x000003cf, 0x000003d7,
+ 0x00001fcb, 0x00001f75, 0x00010c9d, 0x00010cdd,
+ 0x000000ce, 0x000000ee, 0x00002cbc, 0x00002cbd,
+ 0x00001eea, 0x00001eeb, 0x000024bc, 0x000024d6,
+ 0x00001eba, 0x00001ebb, 0x00001f89, 0x00001f81,
+ 0x00001f2e, 0x00001f26, 0x0000a726, 0x0000a727,
+ 0x000003ea, 0x000003eb, 0x00000158, 0x00000159,
+ 0x00000480, 0x00000481, 0x0001e918, 0x0001e93a,
+ 0x0000a722, 0x0000a723, 0x00001f4a, 0x00001f42,
+ 0x0000a65a, 0x0000a65b, 0x000000cc, 0x000000ec,
+ 0x000004c3, 0x000004c4, 0x00002162, 0x00002172,
+ 0x00002c7e, 0x0000023f, 0x000004e8, 0x000004e9,
+ 0x00001e0a, 0x00001e0b, 0x000010b3, 0x00002d13,
+ 0x000003ff, 0x0000037d, 0x000004e2, 0x000004e3,
+ 0x000013d6, 0x0000aba6, 0x0000a73e, 0x0000a73f,
+ 0x00001e76, 0x00001e77, 0x0000a66a, 0x0000a66b,
+ 0x0000010a, 0x0000010b, 0x0000049e, 0x0000049f,
+ 0x00001f3c, 0x00001f34, 0x00000546, 0x00000576,
+ 0x000003ec, 0x000003ed, 0x0000046c, 0x0000046d,
+ 0x000001d1, 0x000001d2, 0x0000ff37, 0x0000ff57,
+ 0x0001e901, 0x0001e923, 0x00000174, 0x00000175,
+ 0x00002cb2, 0x00002cb3, 0x00001f1d, 0x00001f15,
+ 0x00000228, 0x00000229, 0x00000206, 0x00000207,
+ 0x0000023b, 0x0000023c, 0x000003a5, 0x000003c5,
+ 0x0000042e, 0x0000044e, 0x00001fdb, 0x00001f77,
+ 0x00010ca0, 0x00010ce0, 0x00002ce0, 0x00002ce1,
+ 0x00001ec2, 0x00001ec3, 0x000003e2, 0x000003e3,
+ 0x00010cb1, 0x00010cf1, 0x00000542, 0x00000572,
+ 0x00001edc, 0x00001edd, 0x0000024a, 0x0000024b,
+ 0x00002c0f, 0x00002c3f, 0x00002c60, 0x00002c61,
+ 0x00000057, 0x00000077, 0x00002c62, 0x0000026b,
+ 0x00002168, 0x00002178, 0x000004d2, 0x000004d3,
+ 0x00001e42, 0x00001e43, 0x000013bb, 0x0000ab8b,
+ 0x0000a684, 0x0000a685, 0x000104cd, 0x000104f5,
+ 0x00000478, 0x00000479, 0x000118af, 0x000118cf,
+ 0x0000022c, 0x0000022d, 0x0000020a, 0x0000020b,
+ 0x0000020c, 0x0000020d, 0x000013a6, 0x0000ab76,
+ 0x000004a4, 0x000004a5, 0x00001fae, 0x00001fa6,
+ 0x000013bf, 0x0000ab8f, 0x00000421, 0x00000441,
+ 0x0000050a, 0x0000050b, 0x000001ea, 0x000001eb,
+ 0x00010419, 0x00010441, 0x00000392, 0x000003b2,
+ 0x0001e908, 0x0001e92a, 0x00000538, 0x00000568,
+ 0x00010c85, 0x00010cc5, 0x00001ee0, 0x00001ee1,
+ 0x000000dc, 0x000000fc, 0x00000212, 0x00000213,
+ 0x00000051, 0x00000071, 0x0000a69a, 0x0000a69b,
+ 0x00000126, 0x00000127, 0x000004b8, 0x000004b9,
+ 0x0000216f, 0x0000217f, 0x0000a75a, 0x0000a75b,
+ 0x00001fec, 0x00001fe5, 0x000024c7, 0x000024e1,
+ 0x00002caa, 0x00002cab, 0x00001f29, 0x00001f21,
+ 0x0000a65e, 0x0000a65f, 0x00001e58, 0x00001e59,
+ 0x00000524, 0x00000525, 0x000003f7, 0x000003f8,
+ 0x00000423, 0x00000443, 0x00001fad, 0x00001fa5,
+ 0x00010424, 0x0001044c, 0x00000147, 0x00000148,
+ 0x0000a68c, 0x0000a68d, 0x00001ebc, 0x00001ebd,
+ 0x00001f3b, 0x00001f33, 0x000013b1, 0x0000ab81,
+ 0x00001ea2, 0x00001ea3, 0x00000470, 0x00000471,
+ 0x000013c9, 0x0000ab99, 0x00010c8f, 0x00010ccf,
+ 0x0001e904, 0x0001e926, 0x000010ac, 0x00002d0c,
+ 0x000010c5, 0x00002d25, 0x000013f5, 0x000013fd,
+ 0x0001e907, 0x0001e929, 0x00000049, 0x00000069,
+ 0x00000104, 0x00000105, 0x0000a744, 0x0000a745,
+ 0x00002c84, 0x00002c85, 0x000118be, 0x000118de,
+ 0x0000040e, 0x0000045e, 0x0001040f, 0x00010437,
+ 0x00002c0c, 0x00002c3c, 0x0000023d, 0x0000019a,
+ 0x0000a74a, 0x0000a74b, 0x00000172, 0x00000173,
+ 0x0000042c, 0x0000044c, 0x00000114, 0x00000115,
+ 0x0001e905, 0x0001e927, 0x00001f1a, 0x00001f12,
+ 0x0000a64a, 0x0000a64b, 0x00001e4a, 0x00001e4b,
+ 0x0000018b, 0x0000018c, 0x000010ab, 0x00002d0b,
+ 0x00001ef4, 0x00001ef5, 0x000000c6, 0x000000e6,
+ 0x00002c6b, 0x00002c6c, 0x0000a7a6, 0x0000a7a7,
+ 0x00010401, 0x00010429, 0x000013af, 0x0000ab7f,
+ 0x000000c3, 0x000000e3, 0x000004b4, 0x000004b5,
+ 0x000010ad, 0x00002d0d, 0x00000420, 0x00000440,
+ 0x00000216, 0x00000217, 0x0001e917, 0x0001e939,
+ 0x00001f3a, 0x00001f32, 0x0001e91e, 0x0001e940,
+ 0x0000016e, 0x0000016f, 0x00010ca1, 0x00010ce1,
+ 0x00000516, 0x00000517, 0x00001f2b, 0x00001f23,
+ 0x0000a76c, 0x0000a76d, 0x0000a78b, 0x0000a78c,
+ 0x0000a798, 0x0000a799, 0x00000054, 0x00000074,
+ 0x000013de, 0x0000abae, 0x000104c9, 0x000104f1,
+ 0x000010c3, 0x00002d23, 0x00001e40, 0x00001e41,
+ 0x00010c81, 0x00010cc1, 0x00000245, 0x0000028c,
+ 0x000013ac, 0x0000ab7c, 0x00002cd2, 0x00002cd3,
+ 0x000118b2, 0x000118d2, 0x00002c26, 0x00002c56,
+ 0x00001f8e, 0x00001f86, 0x0000a72c, 0x0000a72d,
+ 0x000001fe, 0x000001ff, 0x000000d3, 0x000000f3,
+ 0x00000241, 0x00000242, 0x000003a3, 0x000003c3,
+ 0x000001e0, 0x000001e1, 0x00001f3f, 0x00001f37,
+ 0x000001ec, 0x000001ed, 0x00002c04, 0x00002c34,
+ 0x00000397, 0x000003b7, 0x00010caa, 0x00010cea,
+ 0x0000a656, 0x0000a657, 0x00001fc9, 0x00001f73,
+ 0x00000550, 0x00000580, 0x000000c8, 0x000000e8,
+ 0x00002c96, 0x00002c97, 0x00001fac, 0x00001fa4,
+ 0x00000556, 0x00000586, 0x0000012e, 0x0000012f,
+ 0x00000492, 0x00000493, 0x0001e906, 0x0001e928,
+ 0x00000518, 0x00000519, 0x00001ef8, 0x00001ef9,
+ 0x0000a762, 0x0000a763, 0x000001c4, 0x000001c6,
+ 0x0000041a, 0x0000043a, 0x00001f39, 0x00001f31,
+ 0x00001ea0, 0x00001ea1, 0x0000052a, 0x0000052b,
+ 0x00001e80, 0x00001e81, 0x0000216e, 0x0000217e,
+ 0x00001ffa, 0x00001f7c, 0x00010c93, 0x00010cd3,
+ 0x000003e6, 0x000003e7, 0x000024be, 0x000024d8,
+ 0x0000041c, 0x0000043c, 0x0000018a, 0x00000257,
+ 0x00010cb0, 0x00010cf0, 0x00000400, 0x00000450,
+ 0x00000466, 0x00000467, 0x000024c3, 0x000024dd,
+ 0x00002c1d, 0x00002c4d, 0x00001f0d, 0x00001f05,
+ 0x0000a65c, 0x0000a65d, 0x00001f4c, 0x00001f44,
+ 0x000024b8, 0x000024d2, 0x000013e5, 0x0000abb5,
+ 0x00002ca8, 0x00002ca9, 0x00002c69, 0x00002c6a,
+ 0x000001cb, 0x000001cc, 0x00001e22, 0x00001e23,
+ 0x000010b5, 0x00002d15, 0x00000425, 0x00000445,
+ 0x00010413, 0x0001043b, 0x00002c0a, 0x00002c3a,
+ 0x00001e88, 0x00001e89, 0x00010c98, 0x00010cd8,
+ 0x00000156, 0x00000157, 0x0000a740, 0x0000a741,
+ 0x00000045, 0x00000065, 0x0001e919, 0x0001e93b,
+ 0x000013b7, 0x0000ab87, 0x000010a1, 0x00002d01,
+ 0x0000015e, 0x0000015f, 0x0000017d, 0x0000017e,
+ 0x0001e914, 0x0001e936, 0x000013e9, 0x0000abb9,
+ 0x00002c92, 0x00002c93, 0x00001e2c, 0x00001e2d,
+ 0x00000402, 0x00000452, 0x00000042, 0x00000062,
+ 0x000013a5, 0x0000ab75, 0x0000020e, 0x0000020f,
+ 0x000001af, 0x000001b0, 0x00001e4e, 0x00001e4f,
+ 0x00002cb4, 0x00002cb5, 0x000001d9, 0x000001da,
+ 0x000104c3, 0x000104eb, 0x000004b2, 0x000004b3,
+ 0x00001f6c, 0x00001f64, 0x00000168, 0x00000169,
+ 0x000004de, 0x000004df, 0x00000145, 0x00000146,
+ 0x00001e72, 0x00001e73, 0x00002c09, 0x00002c39,
+ 0x00001e26, 0x00001e27, 0x0000a79c, 0x0000a79d,
+ 0x0000054d, 0x0000057d, 0x00002c2a, 0x00002c5a,
+ 0x0000ff22, 0x0000ff42, 0x000024c5, 0x000024df,
+ 0x000001d3, 0x000001d4, 0x00001f9d, 0x00001f95,
+ 0x00000050, 0x00000070, 0x00010c80, 0x00010cc0,
+ 0x00002cd4, 0x00002cd5, 0x000118b1, 0x000118d1,
+ 0x0000a768, 0x0000a769, 0x000000dd, 0x000000fd,
+ 0x000004ea, 0x000004eb, 0x000013c8, 0x0000ab98,
+ 0x000004ae, 0x000004af, 0x0001040c, 0x00010434,
+ 0x00002c70, 0x00000252, 0x0000ff23, 0x0000ff43,
+ 0x00010c83, 0x00010cc3, 0x000001ee, 0x000001ef,
+ 0x0001041d, 0x00010445, 0x00000394, 0x000003b4,
+ 0x000010cd, 0x00002d2d, 0x00001fda, 0x00001f76,
+ 0x00001fa9, 0x00001fa1, 0x00000143, 0x00000144,
+ 0x000000de, 0x000000fe, 0x000013b9, 0x0000ab89,
+ 0x000000d9, 0x000000f9, 0x0001e91f, 0x0001e941,
+ 0x000104c1, 0x000104e9, 0x00002cca, 0x00002ccb,
+ 0x000004f4, 0x000004f5, 0x0000a780, 0x0000a781,
+ 0x00000232, 0x00000233, 0x000013a2, 0x0000ab72,
+ 0x00002c9e, 0x00002c9f, 0x00010c88, 0x00010cc8,
+ 0x00000197, 0x00000268, 0x0000021c, 0x0000021d,
+ 0x0000052c, 0x0000052d, 0x00010421, 0x00010449,
+ 0x0000ff2f, 0x0000ff4f, 0x0000022a, 0x0000022b,
+ 0x000013cd, 0x0000ab9d, 0x0000039f, 0x000003bf,
+ 0x000024c2, 0x000024dc, 0x00000408, 0x00000458,
+ 0x00001f88, 0x00001f80, 0x000001a2, 0x000001a3,
+ 0x000104bf, 0x000104e7, 0x0000046e, 0x0000046f,
+ 0x00001f8b, 0x00001f83, 0x00002cb8, 0x00002cb9,
+ 0x00010408, 0x00010430, 0x00001f0f, 0x00001f07,
+ 0x00001f4d, 0x00001f45, 0x00000504, 0x00000505,
+ 0x000104ce, 0x000104f6, 0x000118b0, 0x000118d0,
+ 0x00001f6e, 0x00001f66, 0x00002169, 0x00002179
+};
+
+static const unsigned _uccase_title_g_size = 20;
+static const short _uccase_title_g[] = {
+ 120, 10, 124, 98, -37, -18, -73, 454,
+ 1, 33, 265, 32767, 20018, 1, -68, 376,
+ 134, 1, 2, -62
+};
-/* Starting indexes of the case tables
- * UpperIndex = 0
- * LowerIndex = _uccase_len[0]
- * TitleIndex = LowerIndex + _uccase_len[1] */
+static const unsigned _uccase_title_table_size = 89;
+static const unsigned _uccase_title_table[] = {
+ 0x00001f8b, 0x00001f8b, 0x000001c8, 0x000001c8,
+ 0x00001f89, 0x00001f89, 0x00001f93, 0x00001f9b,
+ 0x0000fb13, 0x02000162, 0x00001f91, 0x00001f99,
+ 0x00001f9b, 0x00001f9b, 0x00001f9f, 0x00001f9f,
+ 0x00001f99, 0x00001f99, 0x0000fb04, 0x03000155,
+ 0x00001fa7, 0x00001faf, 0x000001c7, 0x000001c8,
+ 0x000001c9, 0x000001c8, 0x00001faf, 0x00001faf,
+ 0x0000fb01, 0x0200014b, 0x000000df, 0x02000145,
+ 0x00001fb7, 0x03000183, 0x00001fb4, 0x02000174,
+ 0x0000fb03, 0x03000151, 0x00001fc2, 0x02000177,
+ 0x00001f86, 0x00001f8e, 0x00001fa0, 0x00001fa8,
+ 0x00001fc7, 0x03000187, 0x00001f8e, 0x00001f8e,
+ 0x00001fa8, 0x00001fa8, 0x00001fb2, 0x02000171,
+ 0x00001f96, 0x00001f9e, 0x000001f3, 0x000001f2,
+ 0x00001faa, 0x00001faa, 0x00001fa6, 0x00001fae,
+ 0x00001f80, 0x00001f88, 0x00001ff7, 0x0300018b,
+ 0x00001f9e, 0x00001f9e, 0x00001f88, 0x00001f88,
+ 0x000001ca, 0x000001cb, 0x000001f2, 0x000001f2,
+ 0x00001f90, 0x00001f98, 0x0000fb14, 0x02000165,
+ 0x00001fa1, 0x00001fa9, 0x00001f98, 0x00001f98,
+ 0x00001f9c, 0x00001f9c, 0x00001fa9, 0x00001fa9,
+ 0x0000fb06, 0x0200015c, 0x00001f87, 0x00001f8f,
+ 0x000001c4, 0x000001c5, 0x00001f85, 0x00001f8d,
+ 0x00001f8f, 0x00001f8f, 0x000001cc, 0x000001cb,
+ 0x00001f8d, 0x00001f8d, 0x00001f97, 0x00001f9f,
+ 0x0000fb17, 0x0200016e, 0x00001f95, 0x00001f9d,
+ 0x0000fb00, 0x02000148, 0x00001fa3, 0x00001fab,
+ 0x000001f1, 0x000001f2, 0x000001c5, 0x000001c5,
+ 0x00001fab, 0x00001fab, 0x000001cb, 0x000001cb,
+ 0x00001fc4, 0x0200017a, 0x00001fb3, 0x00001fbc,
+ 0x0000fb05, 0x02000159, 0x00001fcc, 0x00001fcc,
+ 0x0000fb15, 0x02000168, 0x00001f82, 0x00001f8a,
+ 0x00001fbc, 0x00001fbc, 0x00001fc3, 0x00001fcc,
+ 0x00001f8a, 0x00001f8a, 0x00001fa4, 0x00001fac,
+ 0x0000fb16, 0x0200016b, 0x00001f92, 0x00001f9a,
+ 0x00001fac, 0x00001fac, 0x00001fae, 0x00001fae,
+ 0x00001f9a, 0x00001f9a, 0x00001ff2, 0x0200017d,
+ 0x00001ff3, 0x00001ffc, 0x00001fa2, 0x00001faa,
+ 0x00001f84, 0x00001f8c, 0x000001c6, 0x000001c5,
+ 0x00001f9d, 0x00001f9d, 0x00001f8c, 0x00001f8c,
+ 0x00001ff4, 0x02000180, 0x00001fa5, 0x00001fad,
+ 0x00001f94, 0x00001f9c, 0x00001ffc, 0x00001ffc,
+ 0x00001fad, 0x00001fad, 0x0000fb02, 0x0200014e,
+ 0x00001f83, 0x00001f8b, 0x00000587, 0x0200015f,
+ 0x00001f81, 0x00001f89
+};
-static const unsigned short _uccase_len[2] = {1273, 1317};
+static const unsigned _uccase_fold_g_size = 257;
+static const short _uccase_fold_g[] = {
+ 4, 162, 2377, 355, 774, 2197, 222, 2,
+ 1027, -835, 1660, 8, 502, 350, 5, 500,
+ 220, 3466, 23, 8122, 12032, 3550, 1, 173,
+ 16536, 288, 350, 2531, 269, 79, 759, 148,
+ 1092, 8, 36, 418, 9, 1, 1680, 3457,
+ 585, 436, 2233, 390, 1, 131, -996, 739,
+ 66, 107, 350, 156, 766, 1041, 1335, 174,
+ 45, 2825, 4, 72, 79, 154, 358, 46,
+ 1245, 4280, 122, 63, -1085, 61, 15, 18230,
+ 2465, 58, 322, 10438, 152, 312, 13, 1667,
+ 1, 252, 1105, -467, 1384, 46, 705, 1175,
+ 2, 63, -1169, 98, 409, 1203, 1013, 287,
+ 20, 11838, 1203, 246, 151, 1584, 2, 123,
+ 203, -681, 16779, 70, 498, 2058, 35, 128,
+ -1252, 88, 61, -1375, 4607, 1, 593, 8856,
+ 851, 243, 384, 78, 107, 2, 1022, 419,
+ 742, 371, 1282, 52, 20, 146, -1277, 701,
+ 76, 2782, 493, 513, 139, 2398, 3085, 277,
+ 403, 3462, 11, 49, 78, 842, 213, 390,
+ 3873, 1306, 16, 42, -429, 1810, 51, 4437,
+ 866, 134, 259, 1665, 1325, 1289, 305, 629,
+ 2, 10, 5, 2025, 448, 133, 2803, 243,
+ 1, 28, 590, 640, 777, 12597, 2448, 11,
+ 412, 1069, 209, 208, 13, 3214, 335, 61,
+ 2, -749, 1273, 3795, 1635, 3207, 1, 17,
+ 10634, 4536, 78, 3432, 1814, 45, 5470, 2308,
+ 3851, 1077, 325, 431, 89, 37, 34, 504,
+ 1259, 911, 13469, 334, 4, 1709, 918, 284,
+ 91, 166, 5828, 5, 253, 1356, 143, 121,
+ 29, 4127, 428, 14, 2769, 3414, -369, 31,
+ 3924, 227, 1, 1026, 16002, 8110, 88, 480,
+ 457, 28, 1186, 542, 7689, 216, 385, 1642,
+ 1011
+};
+
+static const unsigned _uccase_fold_table_size = 1401;
+static const unsigned _uccase_fold_table[] = {
+ 0x0000022c, 0x0000022d, 0x00001e2c, 0x00001e2d,
+ 0x000001a4, 0x000001a5, 0x00002c60, 0x00002c61,
+ 0x0000042d, 0x0000044d, 0x000104c7, 0x000104ef,
+ 0x00002c2a, 0x00002c5a, 0x00001f0f, 0x00001f07,
+ 0x000001c7, 0x000001c9, 0x0000fb13, 0x020002c8,
+ 0x000004f8, 0x000004f9, 0x000001b8, 0x000001b9,
+ 0x00000190, 0x0000025b, 0x00001f84, 0x020001d3,
+ 0x0000a7b3, 0x0000ab53, 0x00000409, 0x00000459,
+ 0x0000a784, 0x0000a785, 0x00002c1c, 0x00002c4c,
+ 0x000013fb, 0x000013f3, 0x00001eb6, 0x00001eb7,
+ 0x000001d3, 0x000001d4, 0x00001ed6, 0x00001ed7,
+ 0x00001eee, 0x00001eef, 0x00002c05, 0x00002c35,
+ 0x00010c89, 0x00010cc9, 0x0000a7ae, 0x0000026a,
+ 0x000004c0, 0x000004cf, 0x00001f3a, 0x00001f32,
+ 0x00000197, 0x00000268, 0x0000abb3, 0x000013e3,
+ 0x0000047c, 0x0000047d, 0x00000549, 0x00000579,
+ 0x00001ee6, 0x00001ee7, 0x0000a66a, 0x0000a66b,
+ 0x00001e3e, 0x00001e3f, 0x00000189, 0x00000256,
+ 0x00001ebc, 0x00001ebd, 0x00000406, 0x00000456,
+ 0x0000a72a, 0x0000a72b, 0x0001e90c, 0x0001e92e,
+ 0x00000427, 0x00000447, 0x0000a779, 0x0000a77a,
+ 0x000000c2, 0x000000e2, 0x00001e99, 0x020001af,
+ 0x00001faf, 0x02000254, 0x00002169, 0x00002179,
+ 0x00010ca7, 0x00010ce7, 0x0000017f, 0x00000073,
+ 0x000010b1, 0x00002d11, 0x0000042c, 0x0000044c,
+ 0x00001f2f, 0x00001f27, 0x00000051, 0x00000071,
+ 0x0000a752, 0x0000a753, 0x0001e903, 0x0001e925,
+ 0x00001f8d, 0x020001ee, 0x0000212b, 0x000000e5,
+ 0x00001f87, 0x020001dc, 0x00001c87, 0x00000463,
+ 0x00001f59, 0x00001f51, 0x000118b1, 0x000118d1,
+ 0x0000212a, 0x0000006b, 0x00010406, 0x0001042e,
+ 0x00000472, 0x00000473, 0x00001fc4, 0x02000270,
+ 0x0000abac, 0x000013dc, 0x0000abba, 0x000013ea,
+ 0x00001ee2, 0x00001ee3, 0x00000547, 0x00000577,
+ 0x00000534, 0x00000564, 0x0000a644, 0x0000a645,
+ 0x0001e900, 0x0001e922, 0x00001f1c, 0x00001f14,
+ 0x00001f92, 0x020001fd, 0x00010ca1, 0x00010ce1,
+ 0x000104c6, 0x000104ee, 0x0000a79c, 0x0000a79d,
+ 0x0000020e, 0x0000020f, 0x00000417, 0x00000437,
+ 0x00002c72, 0x00002c73, 0x0001e91b, 0x0001e93d,
+ 0x000024c1, 0x000024db, 0x00002c82, 0x00002c83,
+ 0x00001ea0, 0x00001ea1, 0x000003cf, 0x000003d7,
+ 0x00000196, 0x00000269, 0x00001f8a, 0x020001e5,
+ 0x0000013b, 0x0000013c, 0x00010c83, 0x00010cc3,
+ 0x0000040b, 0x0000045b, 0x0000a75a, 0x0000a75b,
+ 0x0000048a, 0x0000048b, 0x00000388, 0x000003ad,
+ 0x00000222, 0x00000223, 0x000001f1, 0x000001f3,
+ 0x000001b7, 0x00000292, 0x000118a9, 0x000118c9,
+ 0x0001e90e, 0x0001e930, 0x0000a77e, 0x0000a77f,
+ 0x00002ca8, 0x00002ca9, 0x00001fa8, 0x0200023f,
+ 0x0000ab99, 0x000013c9, 0x0000aba3, 0x000013d3,
+ 0x000024cb, 0x000024e5, 0x000010a0, 0x00002d00,
+ 0x00002c18, 0x00002c48, 0x000104b1, 0x000104d9,
+ 0x00010420, 0x00010448, 0x000003fd, 0x0000037b,
+ 0x000003fe, 0x0000037c, 0x00002ca2, 0x00002ca3,
+ 0x0000046c, 0x0000046d, 0x00000508, 0x00000509,
+ 0x0000038c, 0x000003cc, 0x00001ff8, 0x00001f78,
+ 0x0001040d, 0x00010435, 0x00000412, 0x00000432,
+ 0x00001ef2, 0x00001ef3, 0x00000476, 0x00000477,
+ 0x00002c12, 0x00002c42, 0x0000018b, 0x0000018c,
+ 0x000010b7, 0x00002d17, 0x000003f1, 0x000003c1,
+ 0x00010407, 0x0001042f, 0x0000ab7a, 0x000013aa,
+ 0x0000040a, 0x0000045a, 0x000001d7, 0x000001d8,
+ 0x0000049c, 0x0000049d, 0x0001041c, 0x00010444,
+ 0x00001e84, 0x00001e85, 0x000000d1, 0x000000f1,
+ 0x00001ee8, 0x00001ee9, 0x00001e66, 0x00001e67,
+ 0x00000191, 0x00000192, 0x0000a640, 0x0000a641,
+ 0x00001fd2, 0x0300027d, 0x000010ab, 0x00002d0b,
+ 0x0000ab97, 0x000013c7, 0x00000052, 0x00000072,
+ 0x00010c95, 0x00010cd5, 0x0000a68a, 0x0000a68b,
+ 0x00000514, 0x00000515, 0x00001e42, 0x00001e43,
+ 0x00000132, 0x00000133, 0x0000010a, 0x0000010b,
+ 0x00001f2e, 0x00001f26, 0x00001e32, 0x00001e33,
+ 0x00002cc0, 0x00002cc1, 0x00000202, 0x00000203,
+ 0x00000204, 0x00000205, 0x000010b0, 0x00002d10,
+ 0x00010ca6, 0x00010ce6, 0x000000dd, 0x000000fd,
+ 0x000024b9, 0x000024d3, 0x00001e60, 0x00001e61,
+ 0x000004e8, 0x000004e9, 0x0000050c, 0x0000050d,
+ 0x0000a66c, 0x0000a66d, 0x0000015a, 0x0000015b,
+ 0x0000abb4, 0x000013e4, 0x0000ab79, 0x000013a9,
+ 0x00010c91, 0x00010cd1, 0x00010c9b, 0x00010cdb,
+ 0x000004fe, 0x000004ff, 0x000010b4, 0x00002d14,
+ 0x00000041, 0x00000061, 0x000000c6, 0x000000e6,
+ 0x00001ed2, 0x00001ed3, 0x00001ea4, 0x00001ea5,
+ 0x000118ae, 0x000118ce, 0x0000216d, 0x0000217d,
+ 0x0001e91a, 0x0001e93c, 0x00000420, 0x00000440,
+ 0x0001040f, 0x00010437, 0x00002cb6, 0x00002cb7,
+ 0x00010c9d, 0x00010cdd, 0x000010c4, 0x00002d24,
+ 0x00001e92, 0x00001e93, 0x00001e68, 0x00001e69,
+ 0x00000149, 0x02000195, 0x00000122, 0x00000123,
+ 0x0001e920, 0x0001e942, 0x000001e8, 0x000001e9,
+ 0x000118bb, 0x000118db, 0x00010cad, 0x00010ced,
+ 0x000001f8, 0x000001f9, 0x00001fea, 0x00001f7a,
+ 0x00002c29, 0x00002c59, 0x00001c88, 0x0000a64b,
+ 0x000024b7, 0x000024d1, 0x00002cbe, 0x00002cbf,
+ 0x00002c16, 0x00002c46, 0x00002cde, 0x00002cdf,
+ 0x00000174, 0x00000175, 0x00000156, 0x00000157,
+ 0x00002c06, 0x00002c36, 0x0001e916, 0x0001e938,
+ 0x0000ab91, 0x000013c1, 0x0000a744, 0x0000a745,
+ 0x0000a742, 0x0000a743, 0x0000053c, 0x0000056c,
+ 0x000004d0, 0x000004d1, 0x0000abb8, 0x000013e8,
+ 0x00001fa9, 0x02000242, 0x00002cd8, 0x00002cd9,
+ 0x0000ab87, 0x000013b7, 0x000118a4, 0x000118c4,
+ 0x000010bb, 0x00002d1b, 0x00000194, 0x00000263,
+ 0x00000423, 0x00000443, 0x00000046, 0x00000066,
+ 0x0000ab96, 0x000013c6, 0x0000a684, 0x0000a685,
+ 0x00000241, 0x00000242, 0x00002c27, 0x00002c57,
+ 0x00000128, 0x00000129, 0x0000040e, 0x0000045e,
+ 0x0000050a, 0x0000050b, 0x00001f93, 0x02000200,
+ 0x00000540, 0x00000570, 0x00000224, 0x00000225,
+ 0x000000cb, 0x000000eb, 0x000010a7, 0x00002d07,
+ 0x00001f4c, 0x00001f44, 0x00002c70, 0x00000252,
+ 0x0000ab9f, 0x000013cf, 0x00001e46, 0x00001e47,
+ 0x00000546, 0x00000576, 0x00001e22, 0x00001e23,
+ 0x00000176, 0x00000177, 0x0000014c, 0x0000014d,
+ 0x00010408, 0x00010430, 0x00001f29, 0x00001f21,
+ 0x0000aba8, 0x000013d8, 0x000003a9, 0x000003c9,
+ 0x0000a7ad, 0x0000026c, 0x0000019f, 0x00000275,
+ 0x00000512, 0x00000513, 0x00010c8a, 0x00010cca,
+ 0x000024be, 0x000024d8, 0x00000216, 0x00000217,
+ 0x000118a8, 0x000118c8, 0x0000054f, 0x0000057f,
+ 0x0000a698, 0x0000a699, 0x00002c26, 0x00002c56,
+ 0x00001f3d, 0x00001f35, 0x0000ff38, 0x0000ff58,
+ 0x00000550, 0x00000580, 0x00010c84, 0x00010cc4,
+ 0x0000a73a, 0x0000a73b, 0x00002c6b, 0x00002c6c,
+ 0x000104d1, 0x000104f9, 0x0000019d, 0x00000272,
+ 0x000000db, 0x000000fb, 0x00002c92, 0x00002c93,
+ 0x0001e915, 0x0001e937, 0x000118b7, 0x000118d7,
+ 0x00000139, 0x0000013a, 0x0000a7a2, 0x0000a7a3,
+ 0x00001fc2, 0x0200026a, 0x0000004f, 0x0000006f,
+ 0x00001fe9, 0x00001fe1, 0x00000220, 0x0000019e,
+ 0x00001e0c, 0x00001e0d, 0x00002c20, 0x00002c50,
+ 0x00000168, 0x00000169, 0x00000152, 0x00000153,
+ 0x00001e6c, 0x00001e6d, 0x0000fb06, 0x020002c5,
+ 0x000024c0, 0x000024da, 0x0000a728, 0x0000a729,
+ 0x00001f54, 0x030001bf, 0x000004ac, 0x000004ad,
+ 0x000104bf, 0x000104e7, 0x0000017d, 0x0000017e,
+ 0x00000243, 0x00000180, 0x000024cd, 0x000024e7,
+ 0x00000494, 0x00000495, 0x00000556, 0x00000586,
+ 0x0000a696, 0x0000a697, 0x000010b3, 0x00002d13,
+ 0x0000a7b4, 0x0000a7b5, 0x00001fad, 0x0200024e,
+ 0x0000ab71, 0x000013a1, 0x00001ef4, 0x00001ef5,
+ 0x000003a0, 0x000003c0, 0x00000413, 0x00000433,
+ 0x00002c23, 0x00002c53, 0x000104d3, 0x000104fb,
+ 0x00000187, 0x00000188, 0x000104b0, 0x000104d8,
+ 0x000118ab, 0x000118cb, 0x0000039c, 0x000003bc,
+ 0x00000210, 0x00000211, 0x0000a68c, 0x0000a68d,
+ 0x00001f97, 0x0200020c, 0x00001f9e, 0x02000221,
+ 0x00000057, 0x00000077, 0x00001f4a, 0x00001f42,
+ 0x00001e62, 0x00001e63, 0x000004b0, 0x000004b1,
+ 0x00002c1f, 0x00002c4f, 0x000104b7, 0x000104df,
+ 0x00000158, 0x00000159, 0x0000fb16, 0x020002d1,
+ 0x0000a64a, 0x0000a64b, 0x00002168, 0x00002178,
+ 0x00000393, 0x000003b3, 0x0000052e, 0x0000052f,
+ 0x00000470, 0x00000471, 0x000000cc, 0x000000ec,
+ 0x000024ba, 0x000024d4, 0x000024ca, 0x000024e4,
+ 0x00001e52, 0x00001e53, 0x000118b4, 0x000118d4,
+ 0x000001f6, 0x00000195, 0x0000ff21, 0x0000ff41,
+ 0x0000fb01, 0x020002b4, 0x0001041d, 0x00010445,
+ 0x00000058, 0x00000078, 0x000104ce, 0x000104f6,
+ 0x0000a750, 0x0000a751, 0x00001e30, 0x00001e31,
+ 0x0000053e, 0x0000056e, 0x0001e901, 0x0001e923,
+ 0x000000d4, 0x000000f4, 0x00002c96, 0x00002c97,
+ 0x00002167, 0x00002177, 0x00002126, 0x000003c9,
+ 0x0000ff26, 0x0000ff46, 0x000010c1, 0x00002d21,
+ 0x00001fb6, 0x02000260, 0x0000ab95, 0x000013c5,
+ 0x0000ab7b, 0x000013ab, 0x000000c7, 0x000000e7,
+ 0x00001e6a, 0x00001e6b, 0x00001efc, 0x00001efd,
+ 0x000004f2, 0x000004f3, 0x000104d2, 0x000104fa,
+ 0x00001f28, 0x00001f20, 0x00002c94, 0x00002c95,
+ 0x0000a648, 0x0000a649, 0x00000411, 0x00000431,
+ 0x000104b8, 0x000104e0, 0x0001e921, 0x0001e943,
+ 0x00001ffb, 0x00001f7d, 0x000004dc, 0x000004dd,
+ 0x0000abb9, 0x000013e9, 0x000024b6, 0x000024d0,
+ 0x00002cc2, 0x00002cc3, 0x00002c1e, 0x00002c4e,
+ 0x00000548, 0x00000578, 0x000010a3, 0x00002d03,
+ 0x00001f68, 0x00001f60, 0x000000d9, 0x000000f9,
+ 0x000003f7, 0x000003f8, 0x000024c9, 0x000024e3,
+ 0x000104ba, 0x000104e2, 0x00000246, 0x00000247,
+ 0x00000425, 0x00000445, 0x000104cf, 0x000104f7,
+ 0x0000abb2, 0x000013e2, 0x00010cae, 0x00010cee,
+ 0x00001e98, 0x020001ac, 0x00001fdb, 0x00001f77,
+ 0x00001eaa, 0x00001eab, 0x0000ff31, 0x0000ff51,
+ 0x000010ac, 0x00002d0c, 0x00001f81, 0x020001ca,
+ 0x00010425, 0x0001044d, 0x000104cc, 0x000104f4,
+ 0x00001e02, 0x00001e03, 0x00000404, 0x00000454,
+ 0x0000038a, 0x000003af, 0x00000533, 0x00000563,
+ 0x0000011a, 0x0000011b, 0x00001ff3, 0x020002a1,
+ 0x00001eea, 0x00001eeb, 0x0000ab8f, 0x000013bf,
+ 0x00002c88, 0x00002c89, 0x000001fa, 0x000001fb,
+ 0x00001fe8, 0x00001fe0, 0x000118a2, 0x000118c2,
+ 0x000000d3, 0x000000f3, 0x00000053, 0x00000073,
+ 0x0000a756, 0x0000a757, 0x000118a5, 0x000118c5,
+ 0x0000ff2d, 0x0000ff4d, 0x0000a664, 0x0000a665,
+ 0x0000a75c, 0x0000a75d, 0x00001f5b, 0x00001f53,
+ 0x00001e3a, 0x00001e3b, 0x0000ab75, 0x000013a5,
+ 0x0000a746, 0x0000a747, 0x0000023e, 0x00002c66,
+ 0x0000049e, 0x0000049f, 0x00002c6f, 0x00000250,
+ 0x00000160, 0x00000161, 0x00001e10, 0x00001e11,
+ 0x00001f39, 0x00001f31, 0x00002cd4, 0x00002cd5,
+ 0x000104b6, 0x000104de, 0x00002ceb, 0x00002cec,
+ 0x0000042a, 0x0000044a, 0x0000042e, 0x0000044e,
+ 0x00000042, 0x00000062, 0x000001a0, 0x000001a1,
+ 0x00001f91, 0x020001fa, 0x0000a76a, 0x0000a76b,
+ 0x000004fc, 0x000004fd, 0x00000120, 0x00000121,
+ 0x00010ca4, 0x00010ce4, 0x0000013d, 0x0000013e,
+ 0x00001ede, 0x00001edf, 0x000118b9, 0x000118d9,
+ 0x00001c83, 0x00000441, 0x00002ca6, 0x00002ca7,
+ 0x000010bc, 0x00002d1c, 0x00001fc7, 0x03000276,
+ 0x00000228, 0x00000229, 0x000024b8, 0x000024d2,
+ 0x000010c2, 0x00002d22, 0x00000542, 0x00000572,
+ 0x000004b2, 0x000004b3, 0x0000ff36, 0x0000ff56,
+ 0x0000014a, 0x0000014b, 0x00001f3e, 0x00001f36,
+ 0x00001f2c, 0x00001f24, 0x00002c17, 0x00002c47,
+ 0x00001e72, 0x00001e73, 0x00000397, 0x000003b7,
+ 0x00010c92, 0x00010cd2, 0x0000047e, 0x0000047f,
+ 0x00002ced, 0x00002cee, 0x000024c2, 0x000024dc,
+ 0x000010c0, 0x00002d20, 0x00002166, 0x00002176,
+ 0x00002c7e, 0x0000023f, 0x000001d5, 0x000001d6,
+ 0x0000018e, 0x000001dd, 0x00001fc8, 0x00001f72,
+ 0x00010417, 0x0001043f, 0x00000047, 0x00000067,
+ 0x00001f52, 0x030001bb, 0x0000a75e, 0x0000a75f,
+ 0x00002c0c, 0x00002c3c, 0x00002cc4, 0x00002cc5,
+ 0x000104b9, 0x000104e1, 0x0000022e, 0x0000022f,
+ 0x00001f98, 0x0200020f, 0x00002cc8, 0x00002cc9,
+ 0x00001e36, 0x00001e37, 0x000010b8, 0x00002d18,
+ 0x000000c5, 0x000000e5, 0x00001f83, 0x020001d0,
+ 0x00010423, 0x0001044b, 0x000001e6, 0x000001e7,
+ 0x00001f69, 0x00001f61, 0x00001e16, 0x00001e17,
+ 0x0000ab85, 0x000013b5, 0x00000166, 0x00000167,
+ 0x00000386, 0x000003ac, 0x000003f5, 0x000003b5,
+ 0x00000232, 0x00000233, 0x00010caf, 0x00010cef,
+ 0x00002cba, 0x00002cbb, 0x00001e74, 0x00001e75,
+ 0x00000524, 0x00000525, 0x00002c13, 0x00002c43,
+ 0x000104c0, 0x000104e8, 0x0000ab8c, 0x000013bc,
+ 0x00001e8e, 0x00001e8f, 0x00000490, 0x00000491,
+ 0x00001fa7, 0x0200023c, 0x000001ae, 0x00000288,
+ 0x000001b5, 0x000001b6, 0x0000fb03, 0x030002ba,
+ 0x00010415, 0x0001043d, 0x0000abbd, 0x000013ed,
+ 0x0000020a, 0x0000020b, 0x000003a6, 0x000003c6,
+ 0x000004c1, 0x000004c2, 0x000004d8, 0x000004d9,
+ 0x00001e82, 0x00001e83, 0x000000df, 0x0200018f,
+ 0x0001e902, 0x0001e924, 0x000000c3, 0x000000e3,
+ 0x0001e90d, 0x0001e92f, 0x00010400, 0x00010428,
+ 0x000001c8, 0x000001c9, 0x00000421, 0x00000441,
+ 0x0000ab80, 0x000013b0, 0x00010ca0, 0x00010ce0,
+ 0x00001ed8, 0x00001ed9, 0x0000a7a4, 0x0000a7a5,
+ 0x00000500, 0x00000501, 0x00000389, 0x000003ae,
+ 0x00000150, 0x00000151, 0x0000011e, 0x0000011f,
+ 0x00001f19, 0x00001f11, 0x0000ab8a, 0x000013ba,
+ 0x0000216a, 0x0000217a, 0x000104be, 0x000104e6,
+ 0x000118b0, 0x000118d0, 0x00001ffa, 0x00001f7c,
+ 0x00001e2a, 0x00001e2b, 0x00002c08, 0x00002c38,
+ 0x0000a760, 0x0000a761, 0x0000017b, 0x0000017c,
+ 0x000004f6, 0x000004f7, 0x00001e88, 0x00001e89,
+ 0x0000ff25, 0x0000ff45, 0x0001e911, 0x0001e933,
+ 0x000024ce, 0x000024e8, 0x000000c1, 0x000000e1,
+ 0x0000a7ab, 0x0000025c, 0x00002c63, 0x00001d7d,
+ 0x0000047a, 0x0000047b, 0x00000428, 0x00000448,
+ 0x0001e91e, 0x0001e940, 0x000104b5, 0x000104dd,
+ 0x0000fb17, 0x020002d4, 0x000003f9, 0x000003f2,
+ 0x00000426, 0x00000446, 0x0000a782, 0x0000a783,
+ 0x00001fd9, 0x00001fd1, 0x00001fb2, 0x02000257,
+ 0x00001f89, 0x020001e2, 0x00010424, 0x0001044c,
+ 0x00000218, 0x00000219, 0x0000a792, 0x0000a793,
+ 0x0000039e, 0x000003be, 0x0000054e, 0x0000057e,
+ 0x0000011c, 0x0000011d, 0x00000118, 0x00000119,
+ 0x000010a8, 0x00002d08, 0x0001e919, 0x0001e93b,
+ 0x00010c99, 0x00010cd9, 0x00002165, 0x00002175,
+ 0x00000208, 0x00000209, 0x00001fe3, 0x03000290,
+ 0x00001e7c, 0x00001e7d, 0x00000480, 0x00000481,
+ 0x0001e905, 0x0001e927, 0x00001eac, 0x00001ead,
+ 0x000004be, 0x000004bf, 0x000004d4, 0x000004d5,
+ 0x0000a666, 0x0000a667, 0x0000015c, 0x0000015d,
+ 0x00000345, 0x000003b9, 0x000001a6, 0x00000280,
+ 0x0000ff30, 0x0000ff50, 0x0000a7ac, 0x00000261,
+ 0x0000a736, 0x0000a737, 0x0001041e, 0x00010446,
+ 0x00001e70, 0x00001e71, 0x000000c4, 0x000000e4,
+ 0x000003ee, 0x000003ef, 0x00002132, 0x0000214e,
+ 0x000004ae, 0x000004af, 0x00001e38, 0x00001e39,
+ 0x000010c7, 0x00002d27, 0x00001fae, 0x02000251,
+ 0x00001fac, 0x0200024b, 0x00000043, 0x00000063,
+ 0x00002c9c, 0x00002c9d, 0x00001e1a, 0x00001e1b,
+ 0x000004a2, 0x000004a3, 0x0000046e, 0x0000046f,
+ 0x00000531, 0x00000561, 0x00000114, 0x00000115,
+ 0x00001f1a, 0x00001f12, 0x00001eec, 0x00001eed,
+ 0x0000048e, 0x0000048f, 0x000001ea, 0x000001eb,
+ 0x00001c82, 0x0000043e, 0x00001fec, 0x00001fe5,
+ 0x00010403, 0x0001042b, 0x0000aba1, 0x000013d1,
+ 0x0000004a, 0x0000006a, 0x00001e4a, 0x00001e4b,
+ 0x00000555, 0x00000585, 0x0000ff39, 0x0000ff59,
+ 0x0000a660, 0x0000a661, 0x0001e917, 0x0001e939,
+ 0x00001f9f, 0x02000224, 0x00002c7f, 0x00000240,
+ 0x00002cd0, 0x00002cd1, 0x00002cce, 0x00002ccf,
+ 0x00000392, 0x000003b2, 0x000003a5, 0x000003c5,
+ 0x000104c5, 0x000104ed, 0x0000abae, 0x000013de,
+ 0x00001ef6, 0x00001ef7, 0x00002c2e, 0x00002c5e,
+ 0x00000478, 0x00000479, 0x00010c9a, 0x00010cda,
+ 0x000010bf, 0x00002d1f, 0x00001fa4, 0x02000233,
+ 0x0000053a, 0x0000056a, 0x0000004e, 0x0000006e,
+ 0x00000141, 0x00000142, 0x00001f5d, 0x00001f55,
+ 0x0000a768, 0x0000a769, 0x0000040c, 0x0000045c,
+ 0x0000012e, 0x0000012f, 0x000003fa, 0x000003fb,
+ 0x00001eb0, 0x00001eb1, 0x00000245, 0x0000028c,
+ 0x0000216b, 0x0000217b, 0x00010c8b, 0x00010ccb,
+ 0x000010b2, 0x00002d12, 0x00001fe4, 0x02000294,
+ 0x000118a1, 0x000118c1, 0x00002cc6, 0x00002cc7,
+ 0x0000a7a8, 0x0000a7a9, 0x00002cac, 0x00002cad,
+ 0x00001e9e, 0x020001b5, 0x000118ba, 0x000118da,
+ 0x0000ff29, 0x0000ff49, 0x0000014e, 0x0000014f,
+ 0x00001eb4, 0x00001eb5, 0x00001f0d, 0x00001f05,
+ 0x00010c94, 0x00010cd4, 0x0000a7b2, 0x0000029d,
+ 0x0001e90a, 0x0001e92c, 0x00010ca9, 0x00010ce9,
+ 0x000104bd, 0x000104e5, 0x000104c2, 0x000104ea,
+ 0x000024c3, 0x000024dd, 0x00001e97, 0x020001a9,
+ 0x000104b3, 0x000104db, 0x0000ff32, 0x0000ff52,
+ 0x0000a69a, 0x0000a69b, 0x00001fe7, 0x0300029a,
+ 0x00001fbc, 0x02000267, 0x0001040e, 0x00010436,
+ 0x0000ab74, 0x000013a4, 0x0000a7b6, 0x0000a7b7,
+ 0x000003d8, 0x000003d9, 0x00001e3c, 0x00001e3d,
+ 0x0000a68e, 0x0000a68f, 0x00000106, 0x00000107,
+ 0x000118ac, 0x000118cc, 0x00001f85, 0x020001d6,
+ 0x000003e2, 0x000003e3, 0x000004f0, 0x000004f1,
+ 0x00001f9c, 0x0200021b, 0x000001b3, 0x000001b4,
+ 0x00001e80, 0x00001e81, 0x0000aba5, 0x000013d5,
+ 0x00000050, 0x00000070, 0x00001e1c, 0x00001e1d,
+ 0x00001e0a, 0x00001e0b, 0x00002cd6, 0x00002cd7,
+ 0x0000a652, 0x0000a653, 0x00002cda, 0x00002cdb,
+ 0x00002cbc, 0x00002cbd, 0x0000041b, 0x0000043b,
+ 0x0000038f, 0x000003ce, 0x0000a7a6, 0x0000a7a7,
+ 0x00002c2b, 0x00002c5b, 0x000001cb, 0x000001cc,
+ 0x0000ab9a, 0x000013ca, 0x000001f0, 0x02000198,
+ 0x000003b0, 0x0300019f, 0x00001f90, 0x020001f7,
+ 0x0000021a, 0x0000021b, 0x000004ec, 0x000004ed,
+ 0x0000a738, 0x0000a739, 0x0000ff27, 0x0000ff47,
+ 0x00002c14, 0x00002c44, 0x0001e906, 0x0001e928,
+ 0x00001fa3, 0x02000230, 0x00010c86, 0x00010cc6,
+ 0x0000041a, 0x0000043a, 0x00000504, 0x00000505,
+ 0x000104c4, 0x000104ec, 0x00000104, 0x00000105,
+ 0x00001e7a, 0x00001e7b, 0x00001f48, 0x00001f40,
+ 0x00002c8a, 0x00002c8b, 0x00002c11, 0x00002c41,
+ 0x00001f9a, 0x02000215, 0x00001fa1, 0x0200022a,
+ 0x00001fb3, 0x0200025a, 0x0000ab8e, 0x000013be,
+ 0x0000ab94, 0x000013c4, 0x00001ec0, 0x00001ec1,
+ 0x00001e04, 0x00001e05, 0x00000539, 0x00000569,
+ 0x0000a658, 0x0000a659, 0x0001e90f, 0x0001e931,
+ 0x00000126, 0x00000127, 0x00000535, 0x00000565,
+ 0x00002c07, 0x00002c37, 0x000004aa, 0x000004ab,
+ 0x00001e34, 0x00001e35, 0x00002c15, 0x00002c45,
+ 0x00000462, 0x00000463, 0x0000ab98, 0x000013c8,
+ 0x00000184, 0x00000185, 0x000024c5, 0x000024df,
+ 0x00001e50, 0x00001e51, 0x00002c90, 0x00002c91,
+ 0x00000147, 0x00000148, 0x0000ff23, 0x0000ff43,
+ 0x00001f2b, 0x00001f23, 0x0001041b, 0x00010443,
+ 0x00000049, 0x00000069, 0x00001efe, 0x00001eff,
+ 0x0001040c, 0x00010434, 0x00000401, 0x00000451,
+ 0x000004c5, 0x000004c6, 0x0000048c, 0x0000048d,
+ 0x000000de, 0x000000fe, 0x00001f4b, 0x00001f43,
+ 0x00001e12, 0x00001e13, 0x00000522, 0x00000523,
+ 0x00001ece, 0x00001ecf, 0x00000230, 0x00000231,
+ 0x00001fbe, 0x000003b9, 0x0000ab8d, 0x000013bd,
+ 0x0000ab81, 0x000013b1, 0x0000a798, 0x0000a799,
+ 0x00002c8c, 0x00002c8d, 0x00000498, 0x00000499,
+ 0x00001e40, 0x00001e41, 0x000013fa, 0x000013f2,
+ 0x000003e0, 0x000003e1, 0x00001efa, 0x00001efb,
+ 0x00001e26, 0x00001e27, 0x00001f88, 0x020001df,
+ 0x0000a72c, 0x0000a72d, 0x000004b8, 0x000004b9,
+ 0x00001fbb, 0x00001f71, 0x0000a79e, 0x0000a79f,
+ 0x00000418, 0x00000438, 0x00010404, 0x0001042c,
+ 0x0000a780, 0x0000a781, 0x000118b6, 0x000118d6,
+ 0x0000050e, 0x0000050f, 0x00000172, 0x00000173,
+ 0x00002c0b, 0x00002c3b, 0x00001f09, 0x00001f01,
+ 0x000013f9, 0x000013f1, 0x00010ca8, 0x00010ce8,
+ 0x00001c81, 0x00000434, 0x0000a732, 0x0000a733,
+ 0x00002163, 0x00002173, 0x00002c09, 0x00002c39,
+ 0x000001ca, 0x000001cc, 0x00002ca0, 0x00002ca1,
+ 0x00001e96, 0x020001a6, 0x00000506, 0x00000507,
+ 0x00002cb0, 0x00002cb1, 0x00000186, 0x00000254,
+ 0x00001fe2, 0x0300028c, 0x00000496, 0x00000497,
+ 0x00010427, 0x0001044f, 0x00000054, 0x00000074,
+ 0x0000a79a, 0x0000a79b, 0x0000054c, 0x0000057c,
+ 0x0001e91f, 0x0001e941, 0x0001041a, 0x00010442,
+ 0x00001ec2, 0x00001ec3, 0x0000ab7e, 0x000013ae,
+ 0x0000037f, 0x000003f3, 0x00000460, 0x00000461,
+ 0x000104bb, 0x000104e3, 0x00002c62, 0x0000026b,
+ 0x00002c80, 0x00002c81, 0x00001ff2, 0x0200029e,
+ 0x00000407, 0x00000457, 0x00001e5c, 0x00001e5d,
+ 0x00001f3f, 0x00001f37, 0x000004de, 0x000004df,
+ 0x0000ff33, 0x0000ff53, 0x00000170, 0x00000171,
+ 0x00001f6d, 0x00001f65, 0x000003e6, 0x000003e7,
+ 0x00000415, 0x00000435, 0x00010c82, 0x00010cc2,
+ 0x0000a74c, 0x0000a74d, 0x0000a72e, 0x0000a72f,
+ 0x00002160, 0x00002170, 0x000000c8, 0x000000e8,
+ 0x0000abbf, 0x000013ef, 0x00001e9b, 0x00001e61,
+ 0x00002ca4, 0x00002ca5, 0x00010c87, 0x00010cc7,
+ 0x00000543, 0x00000573, 0x000010bd, 0x00002d1d,
+ 0x00001fa2, 0x0200022d, 0x0001041f, 0x00010447,
+ 0x00000044, 0x00000064, 0x0000aba2, 0x000013d2,
+ 0x00001e9a, 0x020001b2, 0x0000a76c, 0x0000a76d,
+ 0x000004ee, 0x000004ef, 0x00000130, 0x02000192,
+ 0x0001e910, 0x0001e932, 0x000024cf, 0x000024e9,
+ 0x00001edc, 0x00001edd, 0x00002c04, 0x00002c34,
+ 0x00001eae, 0x00001eaf, 0x0000018f, 0x00000259,
+ 0x00001fe6, 0x02000297, 0x00001f82, 0x020001cd,
+ 0x0000023b, 0x0000023c, 0x0000ab84, 0x000013b4,
+ 0x00001eda, 0x00001edb, 0x0001e918, 0x0001e93a,
+ 0x0000ab7c, 0x000013ac, 0x00000400, 0x00000450,
+ 0x0000041d, 0x0000043d, 0x0001e912, 0x0001e934,
+ 0x00001e44, 0x00001e45, 0x0001e908, 0x0001e92a,
+ 0x00000248, 0x00000249, 0x0000a724, 0x0000a725,
+ 0x00002c25, 0x00002c55, 0x000004a0, 0x000004a1,
+ 0x000000cf, 0x000000ef, 0x00000056, 0x00000076,
+ 0x00002c00, 0x00002c30, 0x00000179, 0x0000017a,
+ 0x000001e2, 0x000001e3, 0x000001ac, 0x000001ad,
+ 0x00001fba, 0x00001f70, 0x00001f96, 0x02000209,
+ 0x00010419, 0x00010441, 0x00000402, 0x00000452,
+ 0x00001f8e, 0x020001f1, 0x0000a764, 0x0000a765,
+ 0x0000ab8b, 0x000013bb, 0x00000419, 0x00000439,
+ 0x000001d9, 0x000001da, 0x00001ef8, 0x00001ef9,
+ 0x00002c0e, 0x00002c3e, 0x000118bc, 0x000118dc,
+ 0x000118a3, 0x000118c3, 0x000010ae, 0x00002d0e,
+ 0x000010c5, 0x00002d25, 0x00000518, 0x00000519,
+ 0x0000aba9, 0x000013d9, 0x0000ab77, 0x000013a7,
+ 0x000024cc, 0x000024e6, 0x000004bc, 0x000004bd,
+ 0x00000510, 0x00000511, 0x0000a650, 0x0000a651,
+ 0x00000405, 0x00000455, 0x00001fc6, 0x02000273,
+ 0x0000fb04, 0x030002be, 0x0000ab89, 0x000013b9,
+ 0x00000244, 0x00000289, 0x0000a682, 0x0000a683,
+ 0x000004e2, 0x000004e3, 0x0000040d, 0x0000045d,
+ 0x00001eca, 0x00001ecb, 0x0001e909, 0x0001e92b,
+ 0x00001e06, 0x00001e07, 0x000003a4, 0x000003c4,
+ 0x00000528, 0x00000529, 0x0000a694, 0x0000a695,
+ 0x0000ff22, 0x0000ff42, 0x00001e78, 0x00001e79,
+ 0x00010411, 0x00010439, 0x0000ab70, 0x000013a0,
+ 0x00010cb1, 0x00010cf1, 0x0000a754, 0x0000a755,
+ 0x0000a77b, 0x0000a77c, 0x000004e6, 0x000004e7,
+ 0x0000016a, 0x0000016b, 0x00001ef0, 0x00001ef1,
+ 0x00001fd6, 0x02000285, 0x00001ed0, 0x00001ed1,
+ 0x0000053d, 0x0000056d, 0x00001e2e, 0x00001e2f,
+ 0x000010b9, 0x00002d19, 0x000010a1, 0x00002d01,
+ 0x0000abaf, 0x000013df, 0x0000005a, 0x0000007a,
+ 0x00010c90, 0x00010cd0, 0x00001f9b, 0x02000218,
+ 0x00000537, 0x00000567, 0x0000a668, 0x0000a669,
+ 0x000001c4, 0x000001c6, 0x0000012c, 0x0000012d,
+ 0x000024c8, 0x000024e2, 0x00010ca5, 0x00010ce5,
+ 0x000118aa, 0x000118ca, 0x00002161, 0x00002171,
+ 0x000003ec, 0x000003ed, 0x00000370, 0x00000371,
+ 0x00001ec8, 0x00001ec9, 0x000004cd, 0x000004ce,
+ 0x00001e0e, 0x00001e0f, 0x00002c9a, 0x00002c9b,
+ 0x000003e4, 0x000003e5, 0x000001bc, 0x000001bd,
+ 0x00000182, 0x00000183, 0x00001f3c, 0x00001f34,
+ 0x00010401, 0x00010429, 0x000013f8, 0x000013f0,
+ 0x00010cb2, 0x00010cf2, 0x00002c28, 0x00002c58,
+ 0x00002c22, 0x00002c52, 0x000004c3, 0x000004c4,
+ 0x0000fb15, 0x020002ce, 0x0000ab9e, 0x000013ce,
+ 0x00001e4e, 0x00001e4f, 0x000004f4, 0x000004f5,
+ 0x00000376, 0x00000377, 0x00000492, 0x00000493,
+ 0x0000ff2a, 0x0000ff4a, 0x00001fb4, 0x0200025d,
+ 0x0000ab9b, 0x000013cb, 0x00010426, 0x0001044e,
+ 0x00001eb8, 0x00001eb9, 0x0000a790, 0x0000a791,
+ 0x0001e91c, 0x0001e93e, 0x0000052c, 0x0000052d,
+ 0x00000162, 0x00000163, 0x000001e0, 0x000001e1,
+ 0x00002c03, 0x00002c33, 0x000003a3, 0x000003c3,
+ 0x0000049a, 0x0000049b, 0x000003f0, 0x000003ba,
+ 0x00000200, 0x00000201, 0x00001ff4, 0x020002a4,
+ 0x00010422, 0x0001044a, 0x0000ab90, 0x000013c0,
+ 0x00002ccc, 0x00002ccd, 0x00002cd2, 0x00002cd3,
+ 0x0000a642, 0x0000a643, 0x00001e86, 0x00001e87,
+ 0x000010be, 0x00002d1e, 0x00001f6c, 0x00001f64,
+ 0x0000fb05, 0x020002c2, 0x0000ff2c, 0x0000ff4c,
+ 0x00010414, 0x0001043c, 0x00001e1e, 0x00001e1f,
+ 0x00002c84, 0x00002c85, 0x00002c6d, 0x00000251,
+ 0x000000d6, 0x000000f6, 0x000000d2, 0x000000f2,
+ 0x00000214, 0x00000215, 0x000118b5, 0x000118d5,
+ 0x000003c2, 0x000003c3, 0x00001e5a, 0x00001e5b,
+ 0x00002cb2, 0x00002cb3, 0x000010a5, 0x00002d05,
+ 0x0000042b, 0x0000044b, 0x00000045, 0x00000065,
+ 0x00001f4d, 0x00001f45, 0x00000394, 0x000003b4,
+ 0x00000554, 0x00000584, 0x00002c69, 0x00002c6a,
+ 0x0000a77d, 0x00001d79, 0x00000116, 0x00000117,
+ 0x0000022a, 0x0000022b, 0x00001e20, 0x00001e21,
+ 0x00000410, 0x00000430, 0x0001e907, 0x0001e929,
+ 0x000104b4, 0x000104dc, 0x00001fb7, 0x03000263,
+ 0x00000526, 0x00000527, 0x000000d5, 0x000000f5,
+ 0x0000004c, 0x0000006c, 0x00001e8a, 0x00001e8b,
+ 0x00000468, 0x00000469, 0x0001040a, 0x00010432,
+ 0x0000a662, 0x0000a663, 0x0000a656, 0x0000a657,
+ 0x000003e8, 0x000003e9, 0x0000004b, 0x0000006b,
+ 0x00002ce2, 0x00002ce3, 0x00001fd8, 0x00001fd0,
+ 0x0000a762, 0x0000a763, 0x00000532, 0x00000562,
+ 0x00010416, 0x0001043e, 0x000000ce, 0x000000ee,
+ 0x000024c6, 0x000024e0, 0x00001ea6, 0x00001ea7,
+ 0x00002c2c, 0x00002c5c, 0x0000ff28, 0x0000ff48,
+ 0x0000ff34, 0x0000ff54, 0x00001fa6, 0x02000239,
+ 0x00001f9d, 0x0200021e, 0x00000048, 0x00000068,
+ 0x0000aba4, 0x000013d4, 0x00001e18, 0x00001e19,
+ 0x0000053b, 0x0000056b, 0x00000502, 0x00000503,
+ 0x0000010e, 0x0000010f, 0x000001c5, 0x000001c6,
+ 0x000003a1, 0x000003c1, 0x00000181, 0x00000253,
+ 0x000118bd, 0x000118dd, 0x00001e14, 0x00001e15,
+ 0x000001fe, 0x000001ff, 0x00000466, 0x00000467,
+ 0x00001fca, 0x00001f74, 0x00001f8b, 0x020001e8,
+ 0x0000a78b, 0x0000a78c, 0x000003da, 0x000003db,
+ 0x00010c97, 0x00010cd7, 0x00000538, 0x00000568,
+ 0x0000016c, 0x0000016d, 0x00002c0a, 0x00002c3a,
+ 0x000013fd, 0x000013f5, 0x00001f0b, 0x00001f03,
+ 0x0000051a, 0x0000051b, 0x0000a74a, 0x0000a74b,
+ 0x0000a722, 0x0000a723, 0x000118a0, 0x000118c0,
+ 0x000104c3, 0x000104eb, 0x000000ca, 0x000000ea,
+ 0x000001cd, 0x000001ce, 0x0000ab82, 0x000013b2,
+ 0x000004e0, 0x000004e1, 0x00002c98, 0x00002c99,
+ 0x000001f7, 0x000001bf, 0x000004b4, 0x000004b5,
+ 0x0000fb00, 0x020002b1, 0x000000c9, 0x000000e9,
+ 0x000003d5, 0x000003c6, 0x00010c8f, 0x00010ccf,
+ 0x0000a766, 0x0000a767, 0x0000ab92, 0x000013c2,
+ 0x00000124, 0x00000125, 0x00000108, 0x00000109,
+ 0x00001e58, 0x00001e59, 0x00002caa, 0x00002cab,
+ 0x00010cac, 0x00010cec, 0x00000424, 0x00000444,
+ 0x000001f2, 0x000001f3, 0x000000b5, 0x000003bc,
+ 0x00010c8e, 0x00010cce, 0x0000abad, 0x000013dd,
+ 0x000000cd, 0x000000ed, 0x00001e48, 0x00001e49,
+ 0x0000a7aa, 0x00000266, 0x000003d0, 0x000003b2,
+ 0x0000a654, 0x0000a655, 0x000010a2, 0x00002d02,
+ 0x00001feb, 0x00001f7b, 0x00001f0a, 0x00001f02,
+ 0x0000ab86, 0x000013b6, 0x0000a73e, 0x0000a73f,
+ 0x0000023a, 0x00002c65, 0x00002cae, 0x00002caf,
+ 0x00000390, 0x0300019b, 0x000000c0, 0x000000e0,
+ 0x00001e6e, 0x00001e6f, 0x00001fcb, 0x00001f75,
+ 0x000004d2, 0x000004d3, 0x000003ff, 0x0000037d,
+ 0x00000398, 0x000003b8, 0x0000a65a, 0x0000a65b,
+ 0x00001f80, 0x020001c7, 0x00010413, 0x0001043b,
+ 0x00000059, 0x00000079, 0x00001c86, 0x0000044a,
+ 0x0000a7b1, 0x00000287, 0x000001e4, 0x000001e5,
+ 0x000004d6, 0x000004d7, 0x00000100, 0x00000101,
+ 0x000000d8, 0x000000f8, 0x00010caa, 0x00010cea,
+ 0x000118af, 0x000118cf, 0x0000aba6, 0x000013d6,
+ 0x000001b1, 0x0000028a, 0x00000055, 0x00000075,
+ 0x00001ebe, 0x00001ebf, 0x0000abaa, 0x000013da,
+ 0x0000abb6, 0x000013e6, 0x000024c4, 0x000024de,
+ 0x0000a7a0, 0x0000a7a1, 0x000004a6, 0x000004a7,
+ 0x0000a64c, 0x0000a64d, 0x00000193, 0x00000260,
+ 0x00001f3b, 0x00001f33, 0x000003f4, 0x000003b8,
+ 0x000004ea, 0x000004eb, 0x0000039f, 0x000003bf,
+ 0x00010405, 0x0001042d, 0x000004ba, 0x000004bb,
+ 0x00001fc3, 0x0200026d, 0x00002c10, 0x00002c40,
+ 0x00001c80, 0x00000432, 0x00001f1d, 0x00001f15,
+ 0x00000587, 0x020001a3, 0x0000054d, 0x0000057d,
+ 0x00010c9e, 0x00010cde, 0x0000ff2f, 0x0000ff4f,
+ 0x00001fa5, 0x02000236, 0x00001fab, 0x02000248,
+ 0x00010c85, 0x00010cc5, 0x000104d0, 0x000104f8,
+ 0x00000408, 0x00000458, 0x0000040f, 0x0000045f,
+ 0x000003d6, 0x000003c0, 0x00010402, 0x0001042a,
+ 0x00001c85, 0x00000442, 0x0000021c, 0x0000021d,
+ 0x000118ad, 0x000118cd, 0x00001eba, 0x00001ebb,
+ 0x000003de, 0x000003df, 0x0000018a, 0x00000257,
+ 0x00001fb8, 0x00001fb0, 0x00002cb8, 0x00002cb9,
+ 0x0001040b, 0x00010433, 0x00001ee4, 0x00001ee5,
+ 0x00002c6e, 0x00000271, 0x0000ab88, 0x000013b8,
+ 0x0000051c, 0x0000051d, 0x00010409, 0x00010431,
+ 0x0000a686, 0x0000a687, 0x00001f6a, 0x00001f62,
+ 0x000118a7, 0x000118c7, 0x0000216e, 0x0000217e,
+ 0x0000021e, 0x0000021f, 0x00001f8c, 0x020001eb,
+ 0x000104c1, 0x000104e9, 0x0000ab93, 0x000013c3,
+ 0x0000abb5, 0x000013e5, 0x00000143, 0x00000144,
+ 0x00001e7e, 0x00001e7f, 0x00000552, 0x00000582,
+ 0x00000545, 0x00000575, 0x00000178, 0x000000ff,
+ 0x00000226, 0x00000227, 0x0000039a, 0x000003ba,
+ 0x0000020c, 0x0000020d, 0x00010c93, 0x00010cd3,
+ 0x0000a74e, 0x0000a74f, 0x0000a734, 0x0000a735,
+ 0x000004b6, 0x000004b7, 0x000104cb, 0x000104f3,
+ 0x0000ff2e, 0x0000ff4e, 0x00001ed4, 0x00001ed5,
+ 0x0000053f, 0x0000056f, 0x0000041f, 0x0000043f,
+ 0x00000395, 0x000003b5, 0x00010c98, 0x00010cd8,
+ 0x000010a9, 0x00002d09, 0x0000abb1, 0x000013e1,
+ 0x0000ab78, 0x000013a8, 0x0000a78d, 0x00000265,
+ 0x0000a796, 0x0000a797, 0x00001e76, 0x00001e77,
+ 0x0000041c, 0x0000043c, 0x0001e914, 0x0001e936,
+ 0x0000010c, 0x0000010d, 0x00001f18, 0x00001f10,
+ 0x0001e904, 0x0001e926, 0x00002162, 0x00002172,
+ 0x000003ea, 0x000003eb, 0x000001f4, 0x000001f5,
+ 0x00000536, 0x00000566, 0x00001f95, 0x02000206,
+ 0x00010412, 0x0001043a, 0x00001ea2, 0x00001ea3,
+ 0x00001ee0, 0x00001ee1, 0x0000024c, 0x0000024d,
+ 0x0000ff37, 0x0000ff57, 0x0000ff2b, 0x0000ff4b,
+ 0x00001f6f, 0x00001f67, 0x0000039d, 0x000003bd,
+ 0x000001a2, 0x000001a3, 0x0000a680, 0x0000a681,
+ 0x0000a740, 0x0000a741, 0x00002c1a, 0x00002c4a,
+ 0x0000ab7f, 0x000013af, 0x000000dc, 0x000000fc,
+ 0x000000da, 0x000000fa, 0x0000004d, 0x0000006d,
+ 0x00000520, 0x00000521, 0x0000ab7d, 0x000013ad,
+ 0x00000541, 0x00000571, 0x000001ee, 0x000001ef,
+ 0x000010af, 0x00002d0f, 0x00001fc9, 0x00001f73,
+ 0x00010421, 0x00010449, 0x000003a8, 0x000003c8,
+ 0x00002cf2, 0x00002cf3, 0x0000054a, 0x0000057a,
+ 0x00002c24, 0x00002c54, 0x0000012a, 0x0000012b,
+ 0x0000fb14, 0x020002cb, 0x00001fd7, 0x03000288,
+ 0x0000046a, 0x0000046b, 0x000004a4, 0x000004a5,
+ 0x00010c8c, 0x00010ccc, 0x000001fc, 0x000001fd,
+ 0x000010ba, 0x00002d1a, 0x00001f49, 0x00001f41,
+ 0x0000abbe, 0x000013ee, 0x0000a758, 0x0000a759,
+ 0x00001e5e, 0x00001e5f, 0x00002cb4, 0x00002cb5,
+ 0x0000ff24, 0x0000ff44, 0x0000016e, 0x0000016f,
+ 0x00000145, 0x00000146, 0x00001f38, 0x00001f30,
+ 0x000003ab, 0x000003cb, 0x00000403, 0x00000453,
+ 0x0001e90b, 0x0001e92d, 0x0000a726, 0x0000a727,
+ 0x0000ab83, 0x000013b3, 0x000104c9, 0x000104f1,
+ 0x00000414, 0x00000434, 0x00001e90, 0x00001e91,
+ 0x00001e8c, 0x00001e8d, 0x00010c81, 0x00010cc1,
+ 0x000104ca, 0x000104f2, 0x000001b2, 0x0000028b,
+ 0x00001fa0, 0x02000227, 0x00001ec6, 0x00001ec7,
+ 0x000001ec, 0x000001ed, 0x0000ab9c, 0x000013cc,
+ 0x00001e94, 0x00001e95, 0x0000019c, 0x0000026f,
+ 0x00002c75, 0x00002c76, 0x00002c2d, 0x00002c5d,
+ 0x000001a9, 0x00000283, 0x00001e56, 0x00001e57,
+ 0x00001e4c, 0x00001e4d, 0x000118be, 0x000118de,
+ 0x000104c8, 0x000104f0, 0x0000a690, 0x0000a691,
+ 0x00001fb9, 0x00001fb1, 0x00001f6b, 0x00001f63,
+ 0x0000abab, 0x000013db, 0x000118b8, 0x000118d8,
+ 0x00002c02, 0x00002c32, 0x00001fcc, 0x0200027a,
+ 0x000104b2, 0x000104da, 0x00000112, 0x00000113,
+ 0x000010a4, 0x00002d04, 0x00010cab, 0x00010ceb,
+ 0x00010c9f, 0x00010cdf, 0x00002c19, 0x00002c49,
+ 0x0000024a, 0x0000024b, 0x00002c67, 0x00002c68,
+ 0x00010ca3, 0x00010ce3, 0x000004c7, 0x000004c8,
+ 0x0000abb0, 0x000013e0, 0x00001eb2, 0x00001eb3,
+ 0x00000372, 0x00000373, 0x00001ecc, 0x00001ecd,
+ 0x0000039b, 0x000003bb, 0x000003dc, 0x000003dd,
+ 0x00000198, 0x00000199, 0x000004cb, 0x000004cc,
+ 0x00000416, 0x00000436, 0x00010ca2, 0x00010ce2,
+ 0x0000a76e, 0x0000a76f, 0x00001f0e, 0x00001f06,
+ 0x00002c9e, 0x00002c9f, 0x000004e4, 0x000004e5,
+ 0x00000102, 0x00000103, 0x00001e28, 0x00001e29,
+ 0x00001e54, 0x00001e55, 0x000118a6, 0x000118c6,
+ 0x0000041e, 0x0000043e, 0x000001de, 0x000001df,
+ 0x00001fda, 0x00001f76, 0x00001faa, 0x02000245,
+ 0x0000ff3a, 0x0000ff5a, 0x0000abb7, 0x000013e7,
+ 0x00001f0c, 0x00001f04, 0x0000054b, 0x0000057b,
+ 0x000010a6, 0x00002d06, 0x0000a64e, 0x0000a64f,
+ 0x000010cd, 0x00002d2d, 0x00000399, 0x000003b9,
+ 0x0000fb02, 0x020002b7, 0x000104bc, 0x000104e4,
+ 0x00002164, 0x00002174, 0x00000206, 0x00000207,
+ 0x00002c1d, 0x00002c4d, 0x0000042f, 0x0000044f,
+ 0x000001a7, 0x000001a8, 0x000024bc, 0x000024d6,
+ 0x000001af, 0x000001b0, 0x00001f86, 0x020001d9,
+ 0x00000544, 0x00000574, 0x0000a692, 0x0000a693,
+ 0x0000a73c, 0x0000a73d, 0x00001f2d, 0x00001f25,
+ 0x00001ff7, 0x030002aa, 0x0000ab72, 0x000013a2,
+ 0x00010cb0, 0x00010cf0, 0x00002c21, 0x00002c51,
+ 0x00002c01, 0x00002c31, 0x00002c0d, 0x00002c3d,
+ 0x000004c9, 0x000004ca, 0x00010418, 0x00010440,
+ 0x00001ec4, 0x00001ec5, 0x0000aba0, 0x000013d0,
+ 0x00010c80, 0x00010cc0, 0x00000396, 0x000003b6,
+ 0x000001d1, 0x000001d2, 0x00001f99, 0x02000212,
+ 0x0000ab9d, 0x000013cd, 0x0000051e, 0x0000051f,
+ 0x000024bf, 0x000024d9, 0x00001f1b, 0x00001f13,
+ 0x00000464, 0x00000465, 0x0000052a, 0x0000052b,
+ 0x00000136, 0x00000137, 0x00001f2a, 0x00001f22,
+ 0x00002cdc, 0x00002cdd, 0x0001e913, 0x0001e935,
+ 0x0000216c, 0x0000217c, 0x00001f56, 0x030001c3,
+ 0x00001c84, 0x00000442, 0x00001ffc, 0x020002ae,
+ 0x0000aba7, 0x000013d7, 0x0000abbb, 0x000013eb,
+ 0x00001e08, 0x00001e09, 0x00001e24, 0x00001e25,
+ 0x00000553, 0x00000583, 0x0000a688, 0x0000a689,
+ 0x000010b6, 0x00002d16, 0x00001f6e, 0x00001f66,
+ 0x00001f5f, 0x00001f57, 0x0000a7b0, 0x0000029e,
+ 0x00010c8d, 0x00010ccd, 0x0000023d, 0x0000019a,
+ 0x00001f94, 0x02000203, 0x000003aa, 0x000003ca,
+ 0x000104cd, 0x000104f5, 0x00010c88, 0x00010cc8,
+ 0x00002c8e, 0x00002c8f, 0x000118b3, 0x000118d3,
+ 0x0000024e, 0x0000024f, 0x00001f08, 0x00001f00,
+ 0x000010c3, 0x00002d23, 0x000010ad, 0x00002d0d,
+ 0x00000429, 0x00000449, 0x00010c9c, 0x00010cdc,
+ 0x00002c86, 0x00002c87, 0x00002c64, 0x0000027d,
+ 0x00002ce0, 0x00002ce1, 0x0001e91d, 0x0001e93f,
+ 0x0000a65e, 0x0000a65f, 0x00000134, 0x00000135,
+ 0x00001f8f, 0x020001f4, 0x0000ab76, 0x000013a6,
+ 0x0000038e, 0x000003cd, 0x00001e64, 0x00001e65,
+ 0x00002cca, 0x00002ccb, 0x00001ff9, 0x00001f79,
+ 0x0000013f, 0x00000140, 0x00001e00, 0x00001e01,
+ 0x000024c7, 0x000024e1, 0x00000212, 0x00000213,
+ 0x00000551, 0x00000581, 0x0000ff35, 0x0000ff55,
+ 0x00000154, 0x00000155, 0x0000015e, 0x0000015f,
+ 0x000004da, 0x000004db, 0x00000391, 0x000003b1,
+ 0x000003a7, 0x000003c7, 0x0000a748, 0x0000a749,
+ 0x0000216f, 0x0000217f, 0x000004a8, 0x000004a9,
+ 0x00010410, 0x00010438, 0x000000d0, 0x000000f0,
+ 0x000003d1, 0x000003b8, 0x00002c0f, 0x00002c3f,
+ 0x00002183, 0x00002184, 0x00010c96, 0x00010cd6,
+ 0x000010b5, 0x00002d15, 0x000010aa, 0x00002d0a,
+ 0x00001ff6, 0x020002a7, 0x0000ab73, 0x000013a3,
+ 0x00000164, 0x00000165, 0x0000a786, 0x0000a787,
+ 0x00000422, 0x00000442, 0x000001db, 0x000001dc,
+ 0x000013fc, 0x000013f4, 0x00000110, 0x00000111,
+ 0x000001cf, 0x000001d0, 0x00001ea8, 0x00001ea9,
+ 0x000118bf, 0x000118df, 0x0000a646, 0x0000a647,
+ 0x00001fd3, 0x03000281, 0x000004fa, 0x000004fb,
+ 0x00000474, 0x00000475, 0x000118b2, 0x000118d2,
+ 0x000024bb, 0x000024d5, 0x000024bd, 0x000024d7,
+ 0x00000516, 0x00000517, 0x0000abbc, 0x000013ec,
+ 0x0000a65c, 0x0000a65d, 0x00002c1b, 0x00002c4b,
+ 0x00001f50, 0x020001b8
+};
-static const unsigned int _uccase_map[] = {
- 0x00000041, 0x00000061, 0x00000041,
- 0x00000042, 0x00000062, 0x00000042,
- 0x00000043, 0x00000063, 0x00000043,
- 0x00000044, 0x00000064, 0x00000044,
- 0x00000045, 0x00000065, 0x00000045,
- 0x00000046, 0x00000066, 0x00000046,
- 0x00000047, 0x00000067, 0x00000047,
- 0x00000048, 0x00000068, 0x00000048,
- 0x00000049, 0x00000069, 0x00000049,
- 0x0000004a, 0x0000006a, 0x0000004a,
- 0x0000004b, 0x0000006b, 0x0000004b,
- 0x0000004c, 0x0000006c, 0x0000004c,
- 0x0000004d, 0x0000006d, 0x0000004d,
- 0x0000004e, 0x0000006e, 0x0000004e,
- 0x0000004f, 0x0000006f, 0x0000004f,
- 0x00000050, 0x00000070, 0x00000050,
- 0x00000051, 0x00000071, 0x00000051,
- 0x00000052, 0x00000072, 0x00000052,
- 0x00000053, 0x00000073, 0x00000053,
- 0x00000054, 0x00000074, 0x00000054,
- 0x00000055, 0x00000075, 0x00000055,
- 0x00000056, 0x00000076, 0x00000056,
- 0x00000057, 0x00000077, 0x00000057,
- 0x00000058, 0x00000078, 0x00000058,
- 0x00000059, 0x00000079, 0x00000059,
- 0x0000005a, 0x0000007a, 0x0000005a,
- 0x000000c0, 0x000000e0, 0x000000c0,
- 0x000000c1, 0x000000e1, 0x000000c1,
- 0x000000c2, 0x000000e2, 0x000000c2,
- 0x000000c3, 0x000000e3, 0x000000c3,
- 0x000000c4, 0x000000e4, 0x000000c4,
- 0x000000c5, 0x000000e5, 0x000000c5,
- 0x000000c6, 0x000000e6, 0x000000c6,
- 0x000000c7, 0x000000e7, 0x000000c7,
- 0x000000c8, 0x000000e8, 0x000000c8,
- 0x000000c9, 0x000000e9, 0x000000c9,
- 0x000000ca, 0x000000ea, 0x000000ca,
- 0x000000cb, 0x000000eb, 0x000000cb,
- 0x000000cc, 0x000000ec, 0x000000cc,
- 0x000000cd, 0x000000ed, 0x000000cd,
- 0x000000ce, 0x000000ee, 0x000000ce,
- 0x000000cf, 0x000000ef, 0x000000cf,
- 0x000000d0, 0x000000f0, 0x000000d0,
- 0x000000d1, 0x000000f1, 0x000000d1,
- 0x000000d2, 0x000000f2, 0x000000d2,
- 0x000000d3, 0x000000f3, 0x000000d3,
- 0x000000d4, 0x000000f4, 0x000000d4,
- 0x000000d5, 0x000000f5, 0x000000d5,
- 0x000000d6, 0x000000f6, 0x000000d6,
- 0x000000d8, 0x000000f8, 0x000000d8,
- 0x000000d9, 0x000000f9, 0x000000d9,
- 0x000000da, 0x000000fa, 0x000000da,
- 0x000000db, 0x000000fb, 0x000000db,
- 0x000000dc, 0x000000fc, 0x000000dc,
- 0x000000dd, 0x000000fd, 0x000000dd,
- 0x000000de, 0x000000fe, 0x000000de,
- 0x00000100, 0x00000101, 0x00000100,
- 0x00000102, 0x00000103, 0x00000102,
- 0x00000104, 0x00000105, 0x00000104,
- 0x00000106, 0x00000107, 0x00000106,
- 0x00000108, 0x00000109, 0x00000108,
- 0x0000010a, 0x0000010b, 0x0000010a,
- 0x0000010c, 0x0000010d, 0x0000010c,
- 0x0000010e, 0x0000010f, 0x0000010e,
- 0x00000110, 0x00000111, 0x00000110,
- 0x00000112, 0x00000113, 0x00000112,
- 0x00000114, 0x00000115, 0x00000114,
- 0x00000116, 0x00000117, 0x00000116,
- 0x00000118, 0x00000119, 0x00000118,
- 0x0000011a, 0x0000011b, 0x0000011a,
- 0x0000011c, 0x0000011d, 0x0000011c,
- 0x0000011e, 0x0000011f, 0x0000011e,
- 0x00000120, 0x00000121, 0x00000120,
- 0x00000122, 0x00000123, 0x00000122,
- 0x00000124, 0x00000125, 0x00000124,
- 0x00000126, 0x00000127, 0x00000126,
- 0x00000128, 0x00000129, 0x00000128,
- 0x0000012a, 0x0000012b, 0x0000012a,
- 0x0000012c, 0x0000012d, 0x0000012c,
- 0x0000012e, 0x0000012f, 0x0000012e,
- 0x00000130, 0x00000069, 0x00000130,
- 0x00000132, 0x00000133, 0x00000132,
- 0x00000134, 0x00000135, 0x00000134,
- 0x00000136, 0x00000137, 0x00000136,
- 0x00000139, 0x0000013a, 0x00000139,
- 0x0000013b, 0x0000013c, 0x0000013b,
- 0x0000013d, 0x0000013e, 0x0000013d,
- 0x0000013f, 0x00000140, 0x0000013f,
- 0x00000141, 0x00000142, 0x00000141,
- 0x00000143, 0x00000144, 0x00000143,
- 0x00000145, 0x00000146, 0x00000145,
- 0x00000147, 0x00000148, 0x00000147,
- 0x0000014a, 0x0000014b, 0x0000014a,
- 0x0000014c, 0x0000014d, 0x0000014c,
- 0x0000014e, 0x0000014f, 0x0000014e,
- 0x00000150, 0x00000151, 0x00000150,
- 0x00000152, 0x00000153, 0x00000152,
- 0x00000154, 0x00000155, 0x00000154,
- 0x00000156, 0x00000157, 0x00000156,
- 0x00000158, 0x00000159, 0x00000158,
- 0x0000015a, 0x0000015b, 0x0000015a,
- 0x0000015c, 0x0000015d, 0x0000015c,
- 0x0000015e, 0x0000015f, 0x0000015e,
- 0x00000160, 0x00000161, 0x00000160,
- 0x00000162, 0x00000163, 0x00000162,
- 0x00000164, 0x00000165, 0x00000164,
- 0x00000166, 0x00000167, 0x00000166,
- 0x00000168, 0x00000169, 0x00000168,
- 0x0000016a, 0x0000016b, 0x0000016a,
- 0x0000016c, 0x0000016d, 0x0000016c,
- 0x0000016e, 0x0000016f, 0x0000016e,
- 0x00000170, 0x00000171, 0x00000170,
- 0x00000172, 0x00000173, 0x00000172,
- 0x00000174, 0x00000175, 0x00000174,
- 0x00000176, 0x00000177, 0x00000176,
- 0x00000178, 0x000000ff, 0x00000178,
- 0x00000179, 0x0000017a, 0x00000179,
- 0x0000017b, 0x0000017c, 0x0000017b,
- 0x0000017d, 0x0000017e, 0x0000017d,
- 0x00000181, 0x00000253, 0x00000181,
- 0x00000182, 0x00000183, 0x00000182,
- 0x00000184, 0x00000185, 0x00000184,
- 0x00000186, 0x00000254, 0x00000186,
- 0x00000187, 0x00000188, 0x00000187,
- 0x00000189, 0x00000256, 0x00000189,
- 0x0000018a, 0x00000257, 0x0000018a,
- 0x0000018b, 0x0000018c, 0x0000018b,
- 0x0000018e, 0x000001dd, 0x0000018e,
- 0x0000018f, 0x00000259, 0x0000018f,
- 0x00000190, 0x0000025b, 0x00000190,
- 0x00000191, 0x00000192, 0x00000191,
- 0x00000193, 0x00000260, 0x00000193,
- 0x00000194, 0x00000263, 0x00000194,
- 0x00000196, 0x00000269, 0x00000196,
- 0x00000197, 0x00000268, 0x00000197,
- 0x00000198, 0x00000199, 0x00000198,
- 0x0000019c, 0x0000026f, 0x0000019c,
- 0x0000019d, 0x00000272, 0x0000019d,
- 0x0000019f, 0x00000275, 0x0000019f,
- 0x000001a0, 0x000001a1, 0x000001a0,
- 0x000001a2, 0x000001a3, 0x000001a2,
- 0x000001a4, 0x000001a5, 0x000001a4,
- 0x000001a6, 0x00000280, 0x000001a6,
- 0x000001a7, 0x000001a8, 0x000001a7,
- 0x000001a9, 0x00000283, 0x000001a9,
- 0x000001ac, 0x000001ad, 0x000001ac,
- 0x000001ae, 0x00000288, 0x000001ae,
- 0x000001af, 0x000001b0, 0x000001af,
- 0x000001b1, 0x0000028a, 0x000001b1,
- 0x000001b2, 0x0000028b, 0x000001b2,
- 0x000001b3, 0x000001b4, 0x000001b3,
- 0x000001b5, 0x000001b6, 0x000001b5,
- 0x000001b7, 0x00000292, 0x000001b7,
- 0x000001b8, 0x000001b9, 0x000001b8,
- 0x000001bc, 0x000001bd, 0x000001bc,
- 0x000001c4, 0x000001c6, 0x000001c5,
- 0x000001c7, 0x000001c9, 0x000001c8,
- 0x000001ca, 0x000001cc, 0x000001cb,
- 0x000001cd, 0x000001ce, 0x000001cd,
- 0x000001cf, 0x000001d0, 0x000001cf,
- 0x000001d1, 0x000001d2, 0x000001d1,
- 0x000001d3, 0x000001d4, 0x000001d3,
- 0x000001d5, 0x000001d6, 0x000001d5,
- 0x000001d7, 0x000001d8, 0x000001d7,
- 0x000001d9, 0x000001da, 0x000001d9,
- 0x000001db, 0x000001dc, 0x000001db,
- 0x000001de, 0x000001df, 0x000001de,
- 0x000001e0, 0x000001e1, 0x000001e0,
- 0x000001e2, 0x000001e3, 0x000001e2,
- 0x000001e4, 0x000001e5, 0x000001e4,
- 0x000001e6, 0x000001e7, 0x000001e6,
- 0x000001e8, 0x000001e9, 0x000001e8,
- 0x000001ea, 0x000001eb, 0x000001ea,
- 0x000001ec, 0x000001ed, 0x000001ec,
- 0x000001ee, 0x000001ef, 0x000001ee,
- 0x000001f1, 0x000001f3, 0x000001f2,
- 0x000001f4, 0x000001f5, 0x000001f4,
- 0x000001f6, 0x00000195, 0x000001f6,
- 0x000001f7, 0x000001bf, 0x000001f7,
- 0x000001f8, 0x000001f9, 0x000001f8,
- 0x000001fa, 0x000001fb, 0x000001fa,
- 0x000001fc, 0x000001fd, 0x000001fc,
- 0x000001fe, 0x000001ff, 0x000001fe,
- 0x00000200, 0x00000201, 0x00000200,
- 0x00000202, 0x00000203, 0x00000202,
- 0x00000204, 0x00000205, 0x00000204,
- 0x00000206, 0x00000207, 0x00000206,
- 0x00000208, 0x00000209, 0x00000208,
- 0x0000020a, 0x0000020b, 0x0000020a,
- 0x0000020c, 0x0000020d, 0x0000020c,
- 0x0000020e, 0x0000020f, 0x0000020e,
- 0x00000210, 0x00000211, 0x00000210,
- 0x00000212, 0x00000213, 0x00000212,
- 0x00000214, 0x00000215, 0x00000214,
- 0x00000216, 0x00000217, 0x00000216,
- 0x00000218, 0x00000219, 0x00000218,
- 0x0000021a, 0x0000021b, 0x0000021a,
- 0x0000021c, 0x0000021d, 0x0000021c,
- 0x0000021e, 0x0000021f, 0x0000021e,
- 0x00000220, 0x0000019e, 0x00000220,
- 0x00000222, 0x00000223, 0x00000222,
- 0x00000224, 0x00000225, 0x00000224,
- 0x00000226, 0x00000227, 0x00000226,
- 0x00000228, 0x00000229, 0x00000228,
- 0x0000022a, 0x0000022b, 0x0000022a,
- 0x0000022c, 0x0000022d, 0x0000022c,
- 0x0000022e, 0x0000022f, 0x0000022e,
- 0x00000230, 0x00000231, 0x00000230,
- 0x00000232, 0x00000233, 0x00000232,
- 0x0000023a, 0x00002c65, 0x0000023a,
- 0x0000023b, 0x0000023c, 0x0000023b,
- 0x0000023d, 0x0000019a, 0x0000023d,
- 0x0000023e, 0x00002c66, 0x0000023e,
- 0x00000241, 0x00000242, 0x00000241,
- 0x00000243, 0x00000180, 0x00000243,
- 0x00000244, 0x00000289, 0x00000244,
- 0x00000245, 0x0000028c, 0x00000245,
- 0x00000246, 0x00000247, 0x00000246,
- 0x00000248, 0x00000249, 0x00000248,
- 0x0000024a, 0x0000024b, 0x0000024a,
- 0x0000024c, 0x0000024d, 0x0000024c,
- 0x0000024e, 0x0000024f, 0x0000024e,
- 0x00000370, 0x00000371, 0x00000370,
- 0x00000372, 0x00000373, 0x00000372,
- 0x00000376, 0x00000377, 0x00000376,
- 0x0000037f, 0x000003f3, 0x0000037f,
- 0x00000386, 0x000003ac, 0x00000386,
- 0x00000388, 0x000003ad, 0x00000388,
- 0x00000389, 0x000003ae, 0x00000389,
- 0x0000038a, 0x000003af, 0x0000038a,
- 0x0000038c, 0x000003cc, 0x0000038c,
- 0x0000038e, 0x000003cd, 0x0000038e,
- 0x0000038f, 0x000003ce, 0x0000038f,
- 0x00000391, 0x000003b1, 0x00000391,
- 0x00000392, 0x000003b2, 0x00000392,
- 0x00000393, 0x000003b3, 0x00000393,
- 0x00000394, 0x000003b4, 0x00000394,
- 0x00000395, 0x000003b5, 0x00000395,
- 0x00000396, 0x000003b6, 0x00000396,
- 0x00000397, 0x000003b7, 0x00000397,
- 0x00000398, 0x000003b8, 0x00000398,
- 0x00000399, 0x000003b9, 0x00000399,
- 0x0000039a, 0x000003ba, 0x0000039a,
- 0x0000039b, 0x000003bb, 0x0000039b,
- 0x0000039c, 0x000003bc, 0x0000039c,
- 0x0000039d, 0x000003bd, 0x0000039d,
- 0x0000039e, 0x000003be, 0x0000039e,
- 0x0000039f, 0x000003bf, 0x0000039f,
- 0x000003a0, 0x000003c0, 0x000003a0,
- 0x000003a1, 0x000003c1, 0x000003a1,
- 0x000003a3, 0x000003c3, 0x000003a3,
- 0x000003a4, 0x000003c4, 0x000003a4,
- 0x000003a5, 0x000003c5, 0x000003a5,
- 0x000003a6, 0x000003c6, 0x000003a6,
- 0x000003a7, 0x000003c7, 0x000003a7,
- 0x000003a8, 0x000003c8, 0x000003a8,
- 0x000003a9, 0x000003c9, 0x000003a9,
- 0x000003aa, 0x000003ca, 0x000003aa,
- 0x000003ab, 0x000003cb, 0x000003ab,
- 0x000003cf, 0x000003d7, 0x000003cf,
- 0x000003d8, 0x000003d9, 0x000003d8,
- 0x000003da, 0x000003db, 0x000003da,
- 0x000003dc, 0x000003dd, 0x000003dc,
- 0x000003de, 0x000003df, 0x000003de,
- 0x000003e0, 0x000003e1, 0x000003e0,
- 0x000003e2, 0x000003e3, 0x000003e2,
- 0x000003e4, 0x000003e5, 0x000003e4,
- 0x000003e6, 0x000003e7, 0x000003e6,
- 0x000003e8, 0x000003e9, 0x000003e8,
- 0x000003ea, 0x000003eb, 0x000003ea,
- 0x000003ec, 0x000003ed, 0x000003ec,
- 0x000003ee, 0x000003ef, 0x000003ee,
- 0x000003f4, 0x000003b8, 0x000003f4,
- 0x000003f7, 0x000003f8, 0x000003f7,
- 0x000003f9, 0x000003f2, 0x000003f9,
- 0x000003fa, 0x000003fb, 0x000003fa,
- 0x000003fd, 0x0000037b, 0x000003fd,
- 0x000003fe, 0x0000037c, 0x000003fe,
- 0x000003ff, 0x0000037d, 0x000003ff,
- 0x00000400, 0x00000450, 0x00000400,
- 0x00000401, 0x00000451, 0x00000401,
- 0x00000402, 0x00000452, 0x00000402,
- 0x00000403, 0x00000453, 0x00000403,
- 0x00000404, 0x00000454, 0x00000404,
- 0x00000405, 0x00000455, 0x00000405,
- 0x00000406, 0x00000456, 0x00000406,
- 0x00000407, 0x00000457, 0x00000407,
- 0x00000408, 0x00000458, 0x00000408,
- 0x00000409, 0x00000459, 0x00000409,
- 0x0000040a, 0x0000045a, 0x0000040a,
- 0x0000040b, 0x0000045b, 0x0000040b,
- 0x0000040c, 0x0000045c, 0x0000040c,
- 0x0000040d, 0x0000045d, 0x0000040d,
- 0x0000040e, 0x0000045e, 0x0000040e,
- 0x0000040f, 0x0000045f, 0x0000040f,
- 0x00000410, 0x00000430, 0x00000410,
- 0x00000411, 0x00000431, 0x00000411,
- 0x00000412, 0x00000432, 0x00000412,
- 0x00000413, 0x00000433, 0x00000413,
- 0x00000414, 0x00000434, 0x00000414,
- 0x00000415, 0x00000435, 0x00000415,
- 0x00000416, 0x00000436, 0x00000416,
- 0x00000417, 0x00000437, 0x00000417,
- 0x00000418, 0x00000438, 0x00000418,
- 0x00000419, 0x00000439, 0x00000419,
- 0x0000041a, 0x0000043a, 0x0000041a,
- 0x0000041b, 0x0000043b, 0x0000041b,
- 0x0000041c, 0x0000043c, 0x0000041c,
- 0x0000041d, 0x0000043d, 0x0000041d,
- 0x0000041e, 0x0000043e, 0x0000041e,
- 0x0000041f, 0x0000043f, 0x0000041f,
- 0x00000420, 0x00000440, 0x00000420,
- 0x00000421, 0x00000441, 0x00000421,
- 0x00000422, 0x00000442, 0x00000422,
- 0x00000423, 0x00000443, 0x00000423,
- 0x00000424, 0x00000444, 0x00000424,
- 0x00000425, 0x00000445, 0x00000425,
- 0x00000426, 0x00000446, 0x00000426,
- 0x00000427, 0x00000447, 0x00000427,
- 0x00000428, 0x00000448, 0x00000428,
- 0x00000429, 0x00000449, 0x00000429,
- 0x0000042a, 0x0000044a, 0x0000042a,
- 0x0000042b, 0x0000044b, 0x0000042b,
- 0x0000042c, 0x0000044c, 0x0000042c,
- 0x0000042d, 0x0000044d, 0x0000042d,
- 0x0000042e, 0x0000044e, 0x0000042e,
- 0x0000042f, 0x0000044f, 0x0000042f,
- 0x00000460, 0x00000461, 0x00000460,
- 0x00000462, 0x00000463, 0x00000462,
- 0x00000464, 0x00000465, 0x00000464,
- 0x00000466, 0x00000467, 0x00000466,
- 0x00000468, 0x00000469, 0x00000468,
- 0x0000046a, 0x0000046b, 0x0000046a,
- 0x0000046c, 0x0000046d, 0x0000046c,
- 0x0000046e, 0x0000046f, 0x0000046e,
- 0x00000470, 0x00000471, 0x00000470,
- 0x00000472, 0x00000473, 0x00000472,
- 0x00000474, 0x00000475, 0x00000474,
- 0x00000476, 0x00000477, 0x00000476,
- 0x00000478, 0x00000479, 0x00000478,
- 0x0000047a, 0x0000047b, 0x0000047a,
- 0x0000047c, 0x0000047d, 0x0000047c,
- 0x0000047e, 0x0000047f, 0x0000047e,
- 0x00000480, 0x00000481, 0x00000480,
- 0x0000048a, 0x0000048b, 0x0000048a,
- 0x0000048c, 0x0000048d, 0x0000048c,
- 0x0000048e, 0x0000048f, 0x0000048e,
- 0x00000490, 0x00000491, 0x00000490,
- 0x00000492, 0x00000493, 0x00000492,
- 0x00000494, 0x00000495, 0x00000494,
- 0x00000496, 0x00000497, 0x00000496,
- 0x00000498, 0x00000499, 0x00000498,
- 0x0000049a, 0x0000049b, 0x0000049a,
- 0x0000049c, 0x0000049d, 0x0000049c,
- 0x0000049e, 0x0000049f, 0x0000049e,
- 0x000004a0, 0x000004a1, 0x000004a0,
- 0x000004a2, 0x000004a3, 0x000004a2,
- 0x000004a4, 0x000004a5, 0x000004a4,
- 0x000004a6, 0x000004a7, 0x000004a6,
- 0x000004a8, 0x000004a9, 0x000004a8,
- 0x000004aa, 0x000004ab, 0x000004aa,
- 0x000004ac, 0x000004ad, 0x000004ac,
- 0x000004ae, 0x000004af, 0x000004ae,
- 0x000004b0, 0x000004b1, 0x000004b0,
- 0x000004b2, 0x000004b3, 0x000004b2,
- 0x000004b4, 0x000004b5, 0x000004b4,
- 0x000004b6, 0x000004b7, 0x000004b6,
- 0x000004b8, 0x000004b9, 0x000004b8,
- 0x000004ba, 0x000004bb, 0x000004ba,
- 0x000004bc, 0x000004bd, 0x000004bc,
- 0x000004be, 0x000004bf, 0x000004be,
- 0x000004c0, 0x000004cf, 0x000004c0,
- 0x000004c1, 0x000004c2, 0x000004c1,
- 0x000004c3, 0x000004c4, 0x000004c3,
- 0x000004c5, 0x000004c6, 0x000004c5,
- 0x000004c7, 0x000004c8, 0x000004c7,
- 0x000004c9, 0x000004ca, 0x000004c9,
- 0x000004cb, 0x000004cc, 0x000004cb,
- 0x000004cd, 0x000004ce, 0x000004cd,
- 0x000004d0, 0x000004d1, 0x000004d0,
- 0x000004d2, 0x000004d3, 0x000004d2,
- 0x000004d4, 0x000004d5, 0x000004d4,
- 0x000004d6, 0x000004d7, 0x000004d6,
- 0x000004d8, 0x000004d9, 0x000004d8,
- 0x000004da, 0x000004db, 0x000004da,
- 0x000004dc, 0x000004dd, 0x000004dc,
- 0x000004de, 0x000004df, 0x000004de,
- 0x000004e0, 0x000004e1, 0x000004e0,
- 0x000004e2, 0x000004e3, 0x000004e2,
- 0x000004e4, 0x000004e5, 0x000004e4,
- 0x000004e6, 0x000004e7, 0x000004e6,
- 0x000004e8, 0x000004e9, 0x000004e8,
- 0x000004ea, 0x000004eb, 0x000004ea,
- 0x000004ec, 0x000004ed, 0x000004ec,
- 0x000004ee, 0x000004ef, 0x000004ee,
- 0x000004f0, 0x000004f1, 0x000004f0,
- 0x000004f2, 0x000004f3, 0x000004f2,
- 0x000004f4, 0x000004f5, 0x000004f4,
- 0x000004f6, 0x000004f7, 0x000004f6,
- 0x000004f8, 0x000004f9, 0x000004f8,
- 0x000004fa, 0x000004fb, 0x000004fa,
- 0x000004fc, 0x000004fd, 0x000004fc,
- 0x000004fe, 0x000004ff, 0x000004fe,
- 0x00000500, 0x00000501, 0x00000500,
- 0x00000502, 0x00000503, 0x00000502,
- 0x00000504, 0x00000505, 0x00000504,
- 0x00000506, 0x00000507, 0x00000506,
- 0x00000508, 0x00000509, 0x00000508,
- 0x0000050a, 0x0000050b, 0x0000050a,
- 0x0000050c, 0x0000050d, 0x0000050c,
- 0x0000050e, 0x0000050f, 0x0000050e,
- 0x00000510, 0x00000511, 0x00000510,
- 0x00000512, 0x00000513, 0x00000512,
- 0x00000514, 0x00000515, 0x00000514,
- 0x00000516, 0x00000517, 0x00000516,
- 0x00000518, 0x00000519, 0x00000518,
- 0x0000051a, 0x0000051b, 0x0000051a,
- 0x0000051c, 0x0000051d, 0x0000051c,
- 0x0000051e, 0x0000051f, 0x0000051e,
- 0x00000520, 0x00000521, 0x00000520,
- 0x00000522, 0x00000523, 0x00000522,
- 0x00000524, 0x00000525, 0x00000524,
- 0x00000526, 0x00000527, 0x00000526,
- 0x00000528, 0x00000529, 0x00000528,
- 0x0000052a, 0x0000052b, 0x0000052a,
- 0x0000052c, 0x0000052d, 0x0000052c,
- 0x0000052e, 0x0000052f, 0x0000052e,
- 0x00000531, 0x00000561, 0x00000531,
- 0x00000532, 0x00000562, 0x00000532,
- 0x00000533, 0x00000563, 0x00000533,
- 0x00000534, 0x00000564, 0x00000534,
- 0x00000535, 0x00000565, 0x00000535,
- 0x00000536, 0x00000566, 0x00000536,
- 0x00000537, 0x00000567, 0x00000537,
- 0x00000538, 0x00000568, 0x00000538,
- 0x00000539, 0x00000569, 0x00000539,
- 0x0000053a, 0x0000056a, 0x0000053a,
- 0x0000053b, 0x0000056b, 0x0000053b,
- 0x0000053c, 0x0000056c, 0x0000053c,
- 0x0000053d, 0x0000056d, 0x0000053d,
- 0x0000053e, 0x0000056e, 0x0000053e,
- 0x0000053f, 0x0000056f, 0x0000053f,
- 0x00000540, 0x00000570, 0x00000540,
- 0x00000541, 0x00000571, 0x00000541,
- 0x00000542, 0x00000572, 0x00000542,
- 0x00000543, 0x00000573, 0x00000543,
- 0x00000544, 0x00000574, 0x00000544,
- 0x00000545, 0x00000575, 0x00000545,
- 0x00000546, 0x00000576, 0x00000546,
- 0x00000547, 0x00000577, 0x00000547,
- 0x00000548, 0x00000578, 0x00000548,
- 0x00000549, 0x00000579, 0x00000549,
- 0x0000054a, 0x0000057a, 0x0000054a,
- 0x0000054b, 0x0000057b, 0x0000054b,
- 0x0000054c, 0x0000057c, 0x0000054c,
- 0x0000054d, 0x0000057d, 0x0000054d,
- 0x0000054e, 0x0000057e, 0x0000054e,
- 0x0000054f, 0x0000057f, 0x0000054f,
- 0x00000550, 0x00000580, 0x00000550,
- 0x00000551, 0x00000581, 0x00000551,
- 0x00000552, 0x00000582, 0x00000552,
- 0x00000553, 0x00000583, 0x00000553,
- 0x00000554, 0x00000584, 0x00000554,
- 0x00000555, 0x00000585, 0x00000555,
- 0x00000556, 0x00000586, 0x00000556,
- 0x000010a0, 0x00002d00, 0x000010a0,
- 0x000010a1, 0x00002d01, 0x000010a1,
- 0x000010a2, 0x00002d02, 0x000010a2,
- 0x000010a3, 0x00002d03, 0x000010a3,
- 0x000010a4, 0x00002d04, 0x000010a4,
- 0x000010a5, 0x00002d05, 0x000010a5,
- 0x000010a6, 0x00002d06, 0x000010a6,
- 0x000010a7, 0x00002d07, 0x000010a7,
- 0x000010a8, 0x00002d08, 0x000010a8,
- 0x000010a9, 0x00002d09, 0x000010a9,
- 0x000010aa, 0x00002d0a, 0x000010aa,
- 0x000010ab, 0x00002d0b, 0x000010ab,
- 0x000010ac, 0x00002d0c, 0x000010ac,
- 0x000010ad, 0x00002d0d, 0x000010ad,
- 0x000010ae, 0x00002d0e, 0x000010ae,
- 0x000010af, 0x00002d0f, 0x000010af,
- 0x000010b0, 0x00002d10, 0x000010b0,
- 0x000010b1, 0x00002d11, 0x000010b1,
- 0x000010b2, 0x00002d12, 0x000010b2,
- 0x000010b3, 0x00002d13, 0x000010b3,
- 0x000010b4, 0x00002d14, 0x000010b4,
- 0x000010b5, 0x00002d15, 0x000010b5,
- 0x000010b6, 0x00002d16, 0x000010b6,
- 0x000010b7, 0x00002d17, 0x000010b7,
- 0x000010b8, 0x00002d18, 0x000010b8,
- 0x000010b9, 0x00002d19, 0x000010b9,
- 0x000010ba, 0x00002d1a, 0x000010ba,
- 0x000010bb, 0x00002d1b, 0x000010bb,
- 0x000010bc, 0x00002d1c, 0x000010bc,
- 0x000010bd, 0x00002d1d, 0x000010bd,
- 0x000010be, 0x00002d1e, 0x000010be,
- 0x000010bf, 0x00002d1f, 0x000010bf,
- 0x000010c0, 0x00002d20, 0x000010c0,
- 0x000010c1, 0x00002d21, 0x000010c1,
- 0x000010c2, 0x00002d22, 0x000010c2,
- 0x000010c3, 0x00002d23, 0x000010c3,
- 0x000010c4, 0x00002d24, 0x000010c4,
- 0x000010c5, 0x00002d25, 0x000010c5,
- 0x000010c7, 0x00002d27, 0x000010c7,
- 0x000010cd, 0x00002d2d, 0x000010cd,
- 0x000013a0, 0x0000ab70, 0x000013a0,
- 0x000013a1, 0x0000ab71, 0x000013a1,
- 0x000013a2, 0x0000ab72, 0x000013a2,
- 0x000013a3, 0x0000ab73, 0x000013a3,
- 0x000013a4, 0x0000ab74, 0x000013a4,
- 0x000013a5, 0x0000ab75, 0x000013a5,
- 0x000013a6, 0x0000ab76, 0x000013a6,
- 0x000013a7, 0x0000ab77, 0x000013a7,
- 0x000013a8, 0x0000ab78, 0x000013a8,
- 0x000013a9, 0x0000ab79, 0x000013a9,
- 0x000013aa, 0x0000ab7a, 0x000013aa,
- 0x000013ab, 0x0000ab7b, 0x000013ab,
- 0x000013ac, 0x0000ab7c, 0x000013ac,
- 0x000013ad, 0x0000ab7d, 0x000013ad,
- 0x000013ae, 0x0000ab7e, 0x000013ae,
- 0x000013af, 0x0000ab7f, 0x000013af,
- 0x000013b0, 0x0000ab80, 0x000013b0,
- 0x000013b1, 0x0000ab81, 0x000013b1,
- 0x000013b2, 0x0000ab82, 0x000013b2,
- 0x000013b3, 0x0000ab83, 0x000013b3,
- 0x000013b4, 0x0000ab84, 0x000013b4,
- 0x000013b5, 0x0000ab85, 0x000013b5,
- 0x000013b6, 0x0000ab86, 0x000013b6,
- 0x000013b7, 0x0000ab87, 0x000013b7,
- 0x000013b8, 0x0000ab88, 0x000013b8,
- 0x000013b9, 0x0000ab89, 0x000013b9,
- 0x000013ba, 0x0000ab8a, 0x000013ba,
- 0x000013bb, 0x0000ab8b, 0x000013bb,
- 0x000013bc, 0x0000ab8c, 0x000013bc,
- 0x000013bd, 0x0000ab8d, 0x000013bd,
- 0x000013be, 0x0000ab8e, 0x000013be,
- 0x000013bf, 0x0000ab8f, 0x000013bf,
- 0x000013c0, 0x0000ab90, 0x000013c0,
- 0x000013c1, 0x0000ab91, 0x000013c1,
- 0x000013c2, 0x0000ab92, 0x000013c2,
- 0x000013c3, 0x0000ab93, 0x000013c3,
- 0x000013c4, 0x0000ab94, 0x000013c4,
- 0x000013c5, 0x0000ab95, 0x000013c5,
- 0x000013c6, 0x0000ab96, 0x000013c6,
- 0x000013c7, 0x0000ab97, 0x000013c7,
- 0x000013c8, 0x0000ab98, 0x000013c8,
- 0x000013c9, 0x0000ab99, 0x000013c9,
- 0x000013ca, 0x0000ab9a, 0x000013ca,
- 0x000013cb, 0x0000ab9b, 0x000013cb,
- 0x000013cc, 0x0000ab9c, 0x000013cc,
- 0x000013cd, 0x0000ab9d, 0x000013cd,
- 0x000013ce, 0x0000ab9e, 0x000013ce,
- 0x000013cf, 0x0000ab9f, 0x000013cf,
- 0x000013d0, 0x0000aba0, 0x000013d0,
- 0x000013d1, 0x0000aba1, 0x000013d1,
- 0x000013d2, 0x0000aba2, 0x000013d2,
- 0x000013d3, 0x0000aba3, 0x000013d3,
- 0x000013d4, 0x0000aba4, 0x000013d4,
- 0x000013d5, 0x0000aba5, 0x000013d5,
- 0x000013d6, 0x0000aba6, 0x000013d6,
- 0x000013d7, 0x0000aba7, 0x000013d7,
- 0x000013d8, 0x0000aba8, 0x000013d8,
- 0x000013d9, 0x0000aba9, 0x000013d9,
- 0x000013da, 0x0000abaa, 0x000013da,
- 0x000013db, 0x0000abab, 0x000013db,
- 0x000013dc, 0x0000abac, 0x000013dc,
- 0x000013dd, 0x0000abad, 0x000013dd,
- 0x000013de, 0x0000abae, 0x000013de,
- 0x000013df, 0x0000abaf, 0x000013df,
- 0x000013e0, 0x0000abb0, 0x000013e0,
- 0x000013e1, 0x0000abb1, 0x000013e1,
- 0x000013e2, 0x0000abb2, 0x000013e2,
- 0x000013e3, 0x0000abb3, 0x000013e3,
- 0x000013e4, 0x0000abb4, 0x000013e4,
- 0x000013e5, 0x0000abb5, 0x000013e5,
- 0x000013e6, 0x0000abb6, 0x000013e6,
- 0x000013e7, 0x0000abb7, 0x000013e7,
- 0x000013e8, 0x0000abb8, 0x000013e8,
- 0x000013e9, 0x0000abb9, 0x000013e9,
- 0x000013ea, 0x0000abba, 0x000013ea,
- 0x000013eb, 0x0000abbb, 0x000013eb,
- 0x000013ec, 0x0000abbc, 0x000013ec,
- 0x000013ed, 0x0000abbd, 0x000013ed,
- 0x000013ee, 0x0000abbe, 0x000013ee,
- 0x000013ef, 0x0000abbf, 0x000013ef,
- 0x000013f0, 0x000013f8, 0x000013f0,
- 0x000013f1, 0x000013f9, 0x000013f1,
- 0x000013f2, 0x000013fa, 0x000013f2,
- 0x000013f3, 0x000013fb, 0x000013f3,
- 0x000013f4, 0x000013fc, 0x000013f4,
- 0x000013f5, 0x000013fd, 0x000013f5,
- 0x00001e00, 0x00001e01, 0x00001e00,
- 0x00001e02, 0x00001e03, 0x00001e02,
- 0x00001e04, 0x00001e05, 0x00001e04,
- 0x00001e06, 0x00001e07, 0x00001e06,
- 0x00001e08, 0x00001e09, 0x00001e08,
- 0x00001e0a, 0x00001e0b, 0x00001e0a,
- 0x00001e0c, 0x00001e0d, 0x00001e0c,
- 0x00001e0e, 0x00001e0f, 0x00001e0e,
- 0x00001e10, 0x00001e11, 0x00001e10,
- 0x00001e12, 0x00001e13, 0x00001e12,
- 0x00001e14, 0x00001e15, 0x00001e14,
- 0x00001e16, 0x00001e17, 0x00001e16,
- 0x00001e18, 0x00001e19, 0x00001e18,
- 0x00001e1a, 0x00001e1b, 0x00001e1a,
- 0x00001e1c, 0x00001e1d, 0x00001e1c,
- 0x00001e1e, 0x00001e1f, 0x00001e1e,
- 0x00001e20, 0x00001e21, 0x00001e20,
- 0x00001e22, 0x00001e23, 0x00001e22,
- 0x00001e24, 0x00001e25, 0x00001e24,
- 0x00001e26, 0x00001e27, 0x00001e26,
- 0x00001e28, 0x00001e29, 0x00001e28,
- 0x00001e2a, 0x00001e2b, 0x00001e2a,
- 0x00001e2c, 0x00001e2d, 0x00001e2c,
- 0x00001e2e, 0x00001e2f, 0x00001e2e,
- 0x00001e30, 0x00001e31, 0x00001e30,
- 0x00001e32, 0x00001e33, 0x00001e32,
- 0x00001e34, 0x00001e35, 0x00001e34,
- 0x00001e36, 0x00001e37, 0x00001e36,
- 0x00001e38, 0x00001e39, 0x00001e38,
- 0x00001e3a, 0x00001e3b, 0x00001e3a,
- 0x00001e3c, 0x00001e3d, 0x00001e3c,
- 0x00001e3e, 0x00001e3f, 0x00001e3e,
- 0x00001e40, 0x00001e41, 0x00001e40,
- 0x00001e42, 0x00001e43, 0x00001e42,
- 0x00001e44, 0x00001e45, 0x00001e44,
- 0x00001e46, 0x00001e47, 0x00001e46,
- 0x00001e48, 0x00001e49, 0x00001e48,
- 0x00001e4a, 0x00001e4b, 0x00001e4a,
- 0x00001e4c, 0x00001e4d, 0x00001e4c,
- 0x00001e4e, 0x00001e4f, 0x00001e4e,
- 0x00001e50, 0x00001e51, 0x00001e50,
- 0x00001e52, 0x00001e53, 0x00001e52,
- 0x00001e54, 0x00001e55, 0x00001e54,
- 0x00001e56, 0x00001e57, 0x00001e56,
- 0x00001e58, 0x00001e59, 0x00001e58,
- 0x00001e5a, 0x00001e5b, 0x00001e5a,
- 0x00001e5c, 0x00001e5d, 0x00001e5c,
- 0x00001e5e, 0x00001e5f, 0x00001e5e,
- 0x00001e60, 0x00001e61, 0x00001e60,
- 0x00001e62, 0x00001e63, 0x00001e62,
- 0x00001e64, 0x00001e65, 0x00001e64,
- 0x00001e66, 0x00001e67, 0x00001e66,
- 0x00001e68, 0x00001e69, 0x00001e68,
- 0x00001e6a, 0x00001e6b, 0x00001e6a,
- 0x00001e6c, 0x00001e6d, 0x00001e6c,
- 0x00001e6e, 0x00001e6f, 0x00001e6e,
- 0x00001e70, 0x00001e71, 0x00001e70,
- 0x00001e72, 0x00001e73, 0x00001e72,
- 0x00001e74, 0x00001e75, 0x00001e74,
- 0x00001e76, 0x00001e77, 0x00001e76,
- 0x00001e78, 0x00001e79, 0x00001e78,
- 0x00001e7a, 0x00001e7b, 0x00001e7a,
- 0x00001e7c, 0x00001e7d, 0x00001e7c,
- 0x00001e7e, 0x00001e7f, 0x00001e7e,
- 0x00001e80, 0x00001e81, 0x00001e80,
- 0x00001e82, 0x00001e83, 0x00001e82,
- 0x00001e84, 0x00001e85, 0x00001e84,
- 0x00001e86, 0x00001e87, 0x00001e86,
- 0x00001e88, 0x00001e89, 0x00001e88,
- 0x00001e8a, 0x00001e8b, 0x00001e8a,
- 0x00001e8c, 0x00001e8d, 0x00001e8c,
- 0x00001e8e, 0x00001e8f, 0x00001e8e,
- 0x00001e90, 0x00001e91, 0x00001e90,
- 0x00001e92, 0x00001e93, 0x00001e92,
- 0x00001e94, 0x00001e95, 0x00001e94,
- 0x00001e9e, 0x000000df, 0x00001e9e,
- 0x00001ea0, 0x00001ea1, 0x00001ea0,
- 0x00001ea2, 0x00001ea3, 0x00001ea2,
- 0x00001ea4, 0x00001ea5, 0x00001ea4,
- 0x00001ea6, 0x00001ea7, 0x00001ea6,
- 0x00001ea8, 0x00001ea9, 0x00001ea8,
- 0x00001eaa, 0x00001eab, 0x00001eaa,
- 0x00001eac, 0x00001ead, 0x00001eac,
- 0x00001eae, 0x00001eaf, 0x00001eae,
- 0x00001eb0, 0x00001eb1, 0x00001eb0,
- 0x00001eb2, 0x00001eb3, 0x00001eb2,
- 0x00001eb4, 0x00001eb5, 0x00001eb4,
- 0x00001eb6, 0x00001eb7, 0x00001eb6,
- 0x00001eb8, 0x00001eb9, 0x00001eb8,
- 0x00001eba, 0x00001ebb, 0x00001eba,
- 0x00001ebc, 0x00001ebd, 0x00001ebc,
- 0x00001ebe, 0x00001ebf, 0x00001ebe,
- 0x00001ec0, 0x00001ec1, 0x00001ec0,
- 0x00001ec2, 0x00001ec3, 0x00001ec2,
- 0x00001ec4, 0x00001ec5, 0x00001ec4,
- 0x00001ec6, 0x00001ec7, 0x00001ec6,
- 0x00001ec8, 0x00001ec9, 0x00001ec8,
- 0x00001eca, 0x00001ecb, 0x00001eca,
- 0x00001ecc, 0x00001ecd, 0x00001ecc,
- 0x00001ece, 0x00001ecf, 0x00001ece,
- 0x00001ed0, 0x00001ed1, 0x00001ed0,
- 0x00001ed2, 0x00001ed3, 0x00001ed2,
- 0x00001ed4, 0x00001ed5, 0x00001ed4,
- 0x00001ed6, 0x00001ed7, 0x00001ed6,
- 0x00001ed8, 0x00001ed9, 0x00001ed8,
- 0x00001eda, 0x00001edb, 0x00001eda,
- 0x00001edc, 0x00001edd, 0x00001edc,
- 0x00001ede, 0x00001edf, 0x00001ede,
- 0x00001ee0, 0x00001ee1, 0x00001ee0,
- 0x00001ee2, 0x00001ee3, 0x00001ee2,
- 0x00001ee4, 0x00001ee5, 0x00001ee4,
- 0x00001ee6, 0x00001ee7, 0x00001ee6,
- 0x00001ee8, 0x00001ee9, 0x00001ee8,
- 0x00001eea, 0x00001eeb, 0x00001eea,
- 0x00001eec, 0x00001eed, 0x00001eec,
- 0x00001eee, 0x00001eef, 0x00001eee,
- 0x00001ef0, 0x00001ef1, 0x00001ef0,
- 0x00001ef2, 0x00001ef3, 0x00001ef2,
- 0x00001ef4, 0x00001ef5, 0x00001ef4,
- 0x00001ef6, 0x00001ef7, 0x00001ef6,
- 0x00001ef8, 0x00001ef9, 0x00001ef8,
- 0x00001efa, 0x00001efb, 0x00001efa,
- 0x00001efc, 0x00001efd, 0x00001efc,
- 0x00001efe, 0x00001eff, 0x00001efe,
- 0x00001f08, 0x00001f00, 0x00001f08,
- 0x00001f09, 0x00001f01, 0x00001f09,
- 0x00001f0a, 0x00001f02, 0x00001f0a,
- 0x00001f0b, 0x00001f03, 0x00001f0b,
- 0x00001f0c, 0x00001f04, 0x00001f0c,
- 0x00001f0d, 0x00001f05, 0x00001f0d,
- 0x00001f0e, 0x00001f06, 0x00001f0e,
- 0x00001f0f, 0x00001f07, 0x00001f0f,
- 0x00001f18, 0x00001f10, 0x00001f18,
- 0x00001f19, 0x00001f11, 0x00001f19,
- 0x00001f1a, 0x00001f12, 0x00001f1a,
- 0x00001f1b, 0x00001f13, 0x00001f1b,
- 0x00001f1c, 0x00001f14, 0x00001f1c,
- 0x00001f1d, 0x00001f15, 0x00001f1d,
- 0x00001f28, 0x00001f20, 0x00001f28,
- 0x00001f29, 0x00001f21, 0x00001f29,
- 0x00001f2a, 0x00001f22, 0x00001f2a,
- 0x00001f2b, 0x00001f23, 0x00001f2b,
- 0x00001f2c, 0x00001f24, 0x00001f2c,
- 0x00001f2d, 0x00001f25, 0x00001f2d,
- 0x00001f2e, 0x00001f26, 0x00001f2e,
- 0x00001f2f, 0x00001f27, 0x00001f2f,
- 0x00001f38, 0x00001f30, 0x00001f38,
- 0x00001f39, 0x00001f31, 0x00001f39,
- 0x00001f3a, 0x00001f32, 0x00001f3a,
- 0x00001f3b, 0x00001f33, 0x00001f3b,
- 0x00001f3c, 0x00001f34, 0x00001f3c,
- 0x00001f3d, 0x00001f35, 0x00001f3d,
- 0x00001f3e, 0x00001f36, 0x00001f3e,
- 0x00001f3f, 0x00001f37, 0x00001f3f,
- 0x00001f48, 0x00001f40, 0x00001f48,
- 0x00001f49, 0x00001f41, 0x00001f49,
- 0x00001f4a, 0x00001f42, 0x00001f4a,
- 0x00001f4b, 0x00001f43, 0x00001f4b,
- 0x00001f4c, 0x00001f44, 0x00001f4c,
- 0x00001f4d, 0x00001f45, 0x00001f4d,
- 0x00001f59, 0x00001f51, 0x00001f59,
- 0x00001f5b, 0x00001f53, 0x00001f5b,
- 0x00001f5d, 0x00001f55, 0x00001f5d,
- 0x00001f5f, 0x00001f57, 0x00001f5f,
- 0x00001f68, 0x00001f60, 0x00001f68,
- 0x00001f69, 0x00001f61, 0x00001f69,
- 0x00001f6a, 0x00001f62, 0x00001f6a,
- 0x00001f6b, 0x00001f63, 0x00001f6b,
- 0x00001f6c, 0x00001f64, 0x00001f6c,
- 0x00001f6d, 0x00001f65, 0x00001f6d,
- 0x00001f6e, 0x00001f66, 0x00001f6e,
- 0x00001f6f, 0x00001f67, 0x00001f6f,
- 0x00001fb8, 0x00001fb0, 0x00001fb8,
- 0x00001fb9, 0x00001fb1, 0x00001fb9,
- 0x00001fba, 0x00001f70, 0x00001fba,
- 0x00001fbb, 0x00001f71, 0x00001fbb,
- 0x00001fc8, 0x00001f72, 0x00001fc8,
- 0x00001fc9, 0x00001f73, 0x00001fc9,
- 0x00001fca, 0x00001f74, 0x00001fca,
- 0x00001fcb, 0x00001f75, 0x00001fcb,
- 0x00001fd8, 0x00001fd0, 0x00001fd8,
- 0x00001fd9, 0x00001fd1, 0x00001fd9,
- 0x00001fda, 0x00001f76, 0x00001fda,
- 0x00001fdb, 0x00001f77, 0x00001fdb,
- 0x00001fe8, 0x00001fe0, 0x00001fe8,
- 0x00001fe9, 0x00001fe1, 0x00001fe9,
- 0x00001fea, 0x00001f7a, 0x00001fea,
- 0x00001feb, 0x00001f7b, 0x00001feb,
- 0x00001fec, 0x00001fe5, 0x00001fec,
- 0x00001ff8, 0x00001f78, 0x00001ff8,
- 0x00001ff9, 0x00001f79, 0x00001ff9,
- 0x00001ffa, 0x00001f7c, 0x00001ffa,
- 0x00001ffb, 0x00001f7d, 0x00001ffb,
- 0x00002126, 0x000003c9, 0x00002126,
- 0x0000212a, 0x0000006b, 0x0000212a,
- 0x0000212b, 0x000000e5, 0x0000212b,
- 0x00002132, 0x0000214e, 0x00002132,
- 0x00002160, 0x00002170, 0x00002160,
- 0x00002161, 0x00002171, 0x00002161,
- 0x00002162, 0x00002172, 0x00002162,
- 0x00002163, 0x00002173, 0x00002163,
- 0x00002164, 0x00002174, 0x00002164,
- 0x00002165, 0x00002175, 0x00002165,
- 0x00002166, 0x00002176, 0x00002166,
- 0x00002167, 0x00002177, 0x00002167,
- 0x00002168, 0x00002178, 0x00002168,
- 0x00002169, 0x00002179, 0x00002169,
- 0x0000216a, 0x0000217a, 0x0000216a,
- 0x0000216b, 0x0000217b, 0x0000216b,
- 0x0000216c, 0x0000217c, 0x0000216c,
- 0x0000216d, 0x0000217d, 0x0000216d,
- 0x0000216e, 0x0000217e, 0x0000216e,
- 0x0000216f, 0x0000217f, 0x0000216f,
- 0x00002183, 0x00002184, 0x00002183,
- 0x000024b6, 0x000024d0, 0x000024b6,
- 0x000024b7, 0x000024d1, 0x000024b7,
- 0x000024b8, 0x000024d2, 0x000024b8,
- 0x000024b9, 0x000024d3, 0x000024b9,
- 0x000024ba, 0x000024d4, 0x000024ba,
- 0x000024bb, 0x000024d5, 0x000024bb,
- 0x000024bc, 0x000024d6, 0x000024bc,
- 0x000024bd, 0x000024d7, 0x000024bd,
- 0x000024be, 0x000024d8, 0x000024be,
- 0x000024bf, 0x000024d9, 0x000024bf,
- 0x000024c0, 0x000024da, 0x000024c0,
- 0x000024c1, 0x000024db, 0x000024c1,
- 0x000024c2, 0x000024dc, 0x000024c2,
- 0x000024c3, 0x000024dd, 0x000024c3,
- 0x000024c4, 0x000024de, 0x000024c4,
- 0x000024c5, 0x000024df, 0x000024c5,
- 0x000024c6, 0x000024e0, 0x000024c6,
- 0x000024c7, 0x000024e1, 0x000024c7,
- 0x000024c8, 0x000024e2, 0x000024c8,
- 0x000024c9, 0x000024e3, 0x000024c9,
- 0x000024ca, 0x000024e4, 0x000024ca,
- 0x000024cb, 0x000024e5, 0x000024cb,
- 0x000024cc, 0x000024e6, 0x000024cc,
- 0x000024cd, 0x000024e7, 0x000024cd,
- 0x000024ce, 0x000024e8, 0x000024ce,
- 0x000024cf, 0x000024e9, 0x000024cf,
- 0x00002c00, 0x00002c30, 0x00002c00,
- 0x00002c01, 0x00002c31, 0x00002c01,
- 0x00002c02, 0x00002c32, 0x00002c02,
- 0x00002c03, 0x00002c33, 0x00002c03,
- 0x00002c04, 0x00002c34, 0x00002c04,
- 0x00002c05, 0x00002c35, 0x00002c05,
- 0x00002c06, 0x00002c36, 0x00002c06,
- 0x00002c07, 0x00002c37, 0x00002c07,
- 0x00002c08, 0x00002c38, 0x00002c08,
- 0x00002c09, 0x00002c39, 0x00002c09,
- 0x00002c0a, 0x00002c3a, 0x00002c0a,
- 0x00002c0b, 0x00002c3b, 0x00002c0b,
- 0x00002c0c, 0x00002c3c, 0x00002c0c,
- 0x00002c0d, 0x00002c3d, 0x00002c0d,
- 0x00002c0e, 0x00002c3e, 0x00002c0e,
- 0x00002c0f, 0x00002c3f, 0x00002c0f,
- 0x00002c10, 0x00002c40, 0x00002c10,
- 0x00002c11, 0x00002c41, 0x00002c11,
- 0x00002c12, 0x00002c42, 0x00002c12,
- 0x00002c13, 0x00002c43, 0x00002c13,
- 0x00002c14, 0x00002c44, 0x00002c14,
- 0x00002c15, 0x00002c45, 0x00002c15,
- 0x00002c16, 0x00002c46, 0x00002c16,
- 0x00002c17, 0x00002c47, 0x00002c17,
- 0x00002c18, 0x00002c48, 0x00002c18,
- 0x00002c19, 0x00002c49, 0x00002c19,
- 0x00002c1a, 0x00002c4a, 0x00002c1a,
- 0x00002c1b, 0x00002c4b, 0x00002c1b,
- 0x00002c1c, 0x00002c4c, 0x00002c1c,
- 0x00002c1d, 0x00002c4d, 0x00002c1d,
- 0x00002c1e, 0x00002c4e, 0x00002c1e,
- 0x00002c1f, 0x00002c4f, 0x00002c1f,
- 0x00002c20, 0x00002c50, 0x00002c20,
- 0x00002c21, 0x00002c51, 0x00002c21,
- 0x00002c22, 0x00002c52, 0x00002c22,
- 0x00002c23, 0x00002c53, 0x00002c23,
- 0x00002c24, 0x00002c54, 0x00002c24,
- 0x00002c25, 0x00002c55, 0x00002c25,
- 0x00002c26, 0x00002c56, 0x00002c26,
- 0x00002c27, 0x00002c57, 0x00002c27,
- 0x00002c28, 0x00002c58, 0x00002c28,
- 0x00002c29, 0x00002c59, 0x00002c29,
- 0x00002c2a, 0x00002c5a, 0x00002c2a,
- 0x00002c2b, 0x00002c5b, 0x00002c2b,
- 0x00002c2c, 0x00002c5c, 0x00002c2c,
- 0x00002c2d, 0x00002c5d, 0x00002c2d,
- 0x00002c2e, 0x00002c5e, 0x00002c2e,
- 0x00002c60, 0x00002c61, 0x00002c60,
- 0x00002c62, 0x0000026b, 0x00002c62,
- 0x00002c63, 0x00001d7d, 0x00002c63,
- 0x00002c64, 0x0000027d, 0x00002c64,
- 0x00002c67, 0x00002c68, 0x00002c67,
- 0x00002c69, 0x00002c6a, 0x00002c69,
- 0x00002c6b, 0x00002c6c, 0x00002c6b,
- 0x00002c6d, 0x00000251, 0x00002c6d,
- 0x00002c6e, 0x00000271, 0x00002c6e,
- 0x00002c6f, 0x00000250, 0x00002c6f,
- 0x00002c70, 0x00000252, 0x00002c70,
- 0x00002c72, 0x00002c73, 0x00002c72,
- 0x00002c75, 0x00002c76, 0x00002c75,
- 0x00002c7e, 0x0000023f, 0x00002c7e,
- 0x00002c7f, 0x00000240, 0x00002c7f,
- 0x00002c80, 0x00002c81, 0x00002c80,
- 0x00002c82, 0x00002c83, 0x00002c82,
- 0x00002c84, 0x00002c85, 0x00002c84,
- 0x00002c86, 0x00002c87, 0x00002c86,
- 0x00002c88, 0x00002c89, 0x00002c88,
- 0x00002c8a, 0x00002c8b, 0x00002c8a,
- 0x00002c8c, 0x00002c8d, 0x00002c8c,
- 0x00002c8e, 0x00002c8f, 0x00002c8e,
- 0x00002c90, 0x00002c91, 0x00002c90,
- 0x00002c92, 0x00002c93, 0x00002c92,
- 0x00002c94, 0x00002c95, 0x00002c94,
- 0x00002c96, 0x00002c97, 0x00002c96,
- 0x00002c98, 0x00002c99, 0x00002c98,
- 0x00002c9a, 0x00002c9b, 0x00002c9a,
- 0x00002c9c, 0x00002c9d, 0x00002c9c,
- 0x00002c9e, 0x00002c9f, 0x00002c9e,
- 0x00002ca0, 0x00002ca1, 0x00002ca0,
- 0x00002ca2, 0x00002ca3, 0x00002ca2,
- 0x00002ca4, 0x00002ca5, 0x00002ca4,
- 0x00002ca6, 0x00002ca7, 0x00002ca6,
- 0x00002ca8, 0x00002ca9, 0x00002ca8,
- 0x00002caa, 0x00002cab, 0x00002caa,
- 0x00002cac, 0x00002cad, 0x00002cac,
- 0x00002cae, 0x00002caf, 0x00002cae,
- 0x00002cb0, 0x00002cb1, 0x00002cb0,
- 0x00002cb2, 0x00002cb3, 0x00002cb2,
- 0x00002cb4, 0x00002cb5, 0x00002cb4,
- 0x00002cb6, 0x00002cb7, 0x00002cb6,
- 0x00002cb8, 0x00002cb9, 0x00002cb8,
- 0x00002cba, 0x00002cbb, 0x00002cba,
- 0x00002cbc, 0x00002cbd, 0x00002cbc,
- 0x00002cbe, 0x00002cbf, 0x00002cbe,
- 0x00002cc0, 0x00002cc1, 0x00002cc0,
- 0x00002cc2, 0x00002cc3, 0x00002cc2,
- 0x00002cc4, 0x00002cc5, 0x00002cc4,
- 0x00002cc6, 0x00002cc7, 0x00002cc6,
- 0x00002cc8, 0x00002cc9, 0x00002cc8,
- 0x00002cca, 0x00002ccb, 0x00002cca,
- 0x00002ccc, 0x00002ccd, 0x00002ccc,
- 0x00002cce, 0x00002ccf, 0x00002cce,
- 0x00002cd0, 0x00002cd1, 0x00002cd0,
- 0x00002cd2, 0x00002cd3, 0x00002cd2,
- 0x00002cd4, 0x00002cd5, 0x00002cd4,
- 0x00002cd6, 0x00002cd7, 0x00002cd6,
- 0x00002cd8, 0x00002cd9, 0x00002cd8,
- 0x00002cda, 0x00002cdb, 0x00002cda,
- 0x00002cdc, 0x00002cdd, 0x00002cdc,
- 0x00002cde, 0x00002cdf, 0x00002cde,
- 0x00002ce0, 0x00002ce1, 0x00002ce0,
- 0x00002ce2, 0x00002ce3, 0x00002ce2,
- 0x00002ceb, 0x00002cec, 0x00002ceb,
- 0x00002ced, 0x00002cee, 0x00002ced,
- 0x00002cf2, 0x00002cf3, 0x00002cf2,
- 0x0000a640, 0x0000a641, 0x0000a640,
- 0x0000a642, 0x0000a643, 0x0000a642,
- 0x0000a644, 0x0000a645, 0x0000a644,
- 0x0000a646, 0x0000a647, 0x0000a646,
- 0x0000a648, 0x0000a649, 0x0000a648,
- 0x0000a64a, 0x0000a64b, 0x0000a64a,
- 0x0000a64c, 0x0000a64d, 0x0000a64c,
- 0x0000a64e, 0x0000a64f, 0x0000a64e,
- 0x0000a650, 0x0000a651, 0x0000a650,
- 0x0000a652, 0x0000a653, 0x0000a652,
- 0x0000a654, 0x0000a655, 0x0000a654,
- 0x0000a656, 0x0000a657, 0x0000a656,
- 0x0000a658, 0x0000a659, 0x0000a658,
- 0x0000a65a, 0x0000a65b, 0x0000a65a,
- 0x0000a65c, 0x0000a65d, 0x0000a65c,
- 0x0000a65e, 0x0000a65f, 0x0000a65e,
- 0x0000a660, 0x0000a661, 0x0000a660,
- 0x0000a662, 0x0000a663, 0x0000a662,
- 0x0000a664, 0x0000a665, 0x0000a664,
- 0x0000a666, 0x0000a667, 0x0000a666,
- 0x0000a668, 0x0000a669, 0x0000a668,
- 0x0000a66a, 0x0000a66b, 0x0000a66a,
- 0x0000a66c, 0x0000a66d, 0x0000a66c,
- 0x0000a680, 0x0000a681, 0x0000a680,
- 0x0000a682, 0x0000a683, 0x0000a682,
- 0x0000a684, 0x0000a685, 0x0000a684,
- 0x0000a686, 0x0000a687, 0x0000a686,
- 0x0000a688, 0x0000a689, 0x0000a688,
- 0x0000a68a, 0x0000a68b, 0x0000a68a,
- 0x0000a68c, 0x0000a68d, 0x0000a68c,
- 0x0000a68e, 0x0000a68f, 0x0000a68e,
- 0x0000a690, 0x0000a691, 0x0000a690,
- 0x0000a692, 0x0000a693, 0x0000a692,
- 0x0000a694, 0x0000a695, 0x0000a694,
- 0x0000a696, 0x0000a697, 0x0000a696,
- 0x0000a698, 0x0000a699, 0x0000a698,
- 0x0000a69a, 0x0000a69b, 0x0000a69a,
- 0x0000a722, 0x0000a723, 0x0000a722,
- 0x0000a724, 0x0000a725, 0x0000a724,
- 0x0000a726, 0x0000a727, 0x0000a726,
- 0x0000a728, 0x0000a729, 0x0000a728,
- 0x0000a72a, 0x0000a72b, 0x0000a72a,
- 0x0000a72c, 0x0000a72d, 0x0000a72c,
- 0x0000a72e, 0x0000a72f, 0x0000a72e,
- 0x0000a732, 0x0000a733, 0x0000a732,
- 0x0000a734, 0x0000a735, 0x0000a734,
- 0x0000a736, 0x0000a737, 0x0000a736,
- 0x0000a738, 0x0000a739, 0x0000a738,
- 0x0000a73a, 0x0000a73b, 0x0000a73a,
- 0x0000a73c, 0x0000a73d, 0x0000a73c,
- 0x0000a73e, 0x0000a73f, 0x0000a73e,
- 0x0000a740, 0x0000a741, 0x0000a740,
- 0x0000a742, 0x0000a743, 0x0000a742,
- 0x0000a744, 0x0000a745, 0x0000a744,
- 0x0000a746, 0x0000a747, 0x0000a746,
- 0x0000a748, 0x0000a749, 0x0000a748,
- 0x0000a74a, 0x0000a74b, 0x0000a74a,
- 0x0000a74c, 0x0000a74d, 0x0000a74c,
- 0x0000a74e, 0x0000a74f, 0x0000a74e,
- 0x0000a750, 0x0000a751, 0x0000a750,
- 0x0000a752, 0x0000a753, 0x0000a752,
- 0x0000a754, 0x0000a755, 0x0000a754,
- 0x0000a756, 0x0000a757, 0x0000a756,
- 0x0000a758, 0x0000a759, 0x0000a758,
- 0x0000a75a, 0x0000a75b, 0x0000a75a,
- 0x0000a75c, 0x0000a75d, 0x0000a75c,
- 0x0000a75e, 0x0000a75f, 0x0000a75e,
- 0x0000a760, 0x0000a761, 0x0000a760,
- 0x0000a762, 0x0000a763, 0x0000a762,
- 0x0000a764, 0x0000a765, 0x0000a764,
- 0x0000a766, 0x0000a767, 0x0000a766,
- 0x0000a768, 0x0000a769, 0x0000a768,
- 0x0000a76a, 0x0000a76b, 0x0000a76a,
- 0x0000a76c, 0x0000a76d, 0x0000a76c,
- 0x0000a76e, 0x0000a76f, 0x0000a76e,
- 0x0000a779, 0x0000a77a, 0x0000a779,
- 0x0000a77b, 0x0000a77c, 0x0000a77b,
- 0x0000a77d, 0x00001d79, 0x0000a77d,
- 0x0000a77e, 0x0000a77f, 0x0000a77e,
- 0x0000a780, 0x0000a781, 0x0000a780,
- 0x0000a782, 0x0000a783, 0x0000a782,
- 0x0000a784, 0x0000a785, 0x0000a784,
- 0x0000a786, 0x0000a787, 0x0000a786,
- 0x0000a78b, 0x0000a78c, 0x0000a78b,
- 0x0000a78d, 0x00000265, 0x0000a78d,
- 0x0000a790, 0x0000a791, 0x0000a790,
- 0x0000a792, 0x0000a793, 0x0000a792,
- 0x0000a796, 0x0000a797, 0x0000a796,
- 0x0000a798, 0x0000a799, 0x0000a798,
- 0x0000a79a, 0x0000a79b, 0x0000a79a,
- 0x0000a79c, 0x0000a79d, 0x0000a79c,
- 0x0000a79e, 0x0000a79f, 0x0000a79e,
- 0x0000a7a0, 0x0000a7a1, 0x0000a7a0,
- 0x0000a7a2, 0x0000a7a3, 0x0000a7a2,
- 0x0000a7a4, 0x0000a7a5, 0x0000a7a4,
- 0x0000a7a6, 0x0000a7a7, 0x0000a7a6,
- 0x0000a7a8, 0x0000a7a9, 0x0000a7a8,
- 0x0000a7aa, 0x00000266, 0x0000a7aa,
- 0x0000a7ab, 0x0000025c, 0x0000a7ab,
- 0x0000a7ac, 0x00000261, 0x0000a7ac,
- 0x0000a7ad, 0x0000026c, 0x0000a7ad,
- 0x0000a7ae, 0x0000026a, 0x0000a7ae,
- 0x0000a7b0, 0x0000029e, 0x0000a7b0,
- 0x0000a7b1, 0x00000287, 0x0000a7b1,
- 0x0000a7b2, 0x0000029d, 0x0000a7b2,
- 0x0000a7b3, 0x0000ab53, 0x0000a7b3,
- 0x0000a7b4, 0x0000a7b5, 0x0000a7b4,
- 0x0000a7b6, 0x0000a7b7, 0x0000a7b6,
- 0x0000ff21, 0x0000ff41, 0x0000ff21,
- 0x0000ff22, 0x0000ff42, 0x0000ff22,
- 0x0000ff23, 0x0000ff43, 0x0000ff23,
- 0x0000ff24, 0x0000ff44, 0x0000ff24,
- 0x0000ff25, 0x0000ff45, 0x0000ff25,
- 0x0000ff26, 0x0000ff46, 0x0000ff26,
- 0x0000ff27, 0x0000ff47, 0x0000ff27,
- 0x0000ff28, 0x0000ff48, 0x0000ff28,
- 0x0000ff29, 0x0000ff49, 0x0000ff29,
- 0x0000ff2a, 0x0000ff4a, 0x0000ff2a,
- 0x0000ff2b, 0x0000ff4b, 0x0000ff2b,
- 0x0000ff2c, 0x0000ff4c, 0x0000ff2c,
- 0x0000ff2d, 0x0000ff4d, 0x0000ff2d,
- 0x0000ff2e, 0x0000ff4e, 0x0000ff2e,
- 0x0000ff2f, 0x0000ff4f, 0x0000ff2f,
- 0x0000ff30, 0x0000ff50, 0x0000ff30,
- 0x0000ff31, 0x0000ff51, 0x0000ff31,
- 0x0000ff32, 0x0000ff52, 0x0000ff32,
- 0x0000ff33, 0x0000ff53, 0x0000ff33,
- 0x0000ff34, 0x0000ff54, 0x0000ff34,
- 0x0000ff35, 0x0000ff55, 0x0000ff35,
- 0x0000ff36, 0x0000ff56, 0x0000ff36,
- 0x0000ff37, 0x0000ff57, 0x0000ff37,
- 0x0000ff38, 0x0000ff58, 0x0000ff38,
- 0x0000ff39, 0x0000ff59, 0x0000ff39,
- 0x0000ff3a, 0x0000ff5a, 0x0000ff3a,
- 0x00010400, 0x00010428, 0x00010400,
- 0x00010401, 0x00010429, 0x00010401,
- 0x00010402, 0x0001042a, 0x00010402,
- 0x00010403, 0x0001042b, 0x00010403,
- 0x00010404, 0x0001042c, 0x00010404,
- 0x00010405, 0x0001042d, 0x00010405,
- 0x00010406, 0x0001042e, 0x00010406,
- 0x00010407, 0x0001042f, 0x00010407,
- 0x00010408, 0x00010430, 0x00010408,
- 0x00010409, 0x00010431, 0x00010409,
- 0x0001040a, 0x00010432, 0x0001040a,
- 0x0001040b, 0x00010433, 0x0001040b,
- 0x0001040c, 0x00010434, 0x0001040c,
- 0x0001040d, 0x00010435, 0x0001040d,
- 0x0001040e, 0x00010436, 0x0001040e,
- 0x0001040f, 0x00010437, 0x0001040f,
- 0x00010410, 0x00010438, 0x00010410,
- 0x00010411, 0x00010439, 0x00010411,
- 0x00010412, 0x0001043a, 0x00010412,
- 0x00010413, 0x0001043b, 0x00010413,
- 0x00010414, 0x0001043c, 0x00010414,
- 0x00010415, 0x0001043d, 0x00010415,
- 0x00010416, 0x0001043e, 0x00010416,
- 0x00010417, 0x0001043f, 0x00010417,
- 0x00010418, 0x00010440, 0x00010418,
- 0x00010419, 0x00010441, 0x00010419,
- 0x0001041a, 0x00010442, 0x0001041a,
- 0x0001041b, 0x00010443, 0x0001041b,
- 0x0001041c, 0x00010444, 0x0001041c,
- 0x0001041d, 0x00010445, 0x0001041d,
- 0x0001041e, 0x00010446, 0x0001041e,
- 0x0001041f, 0x00010447, 0x0001041f,
- 0x00010420, 0x00010448, 0x00010420,
- 0x00010421, 0x00010449, 0x00010421,
- 0x00010422, 0x0001044a, 0x00010422,
- 0x00010423, 0x0001044b, 0x00010423,
- 0x00010424, 0x0001044c, 0x00010424,
- 0x00010425, 0x0001044d, 0x00010425,
- 0x00010426, 0x0001044e, 0x00010426,
- 0x00010427, 0x0001044f, 0x00010427,
- 0x000104b0, 0x000104d8, 0x000104b0,
- 0x000104b1, 0x000104d9, 0x000104b1,
- 0x000104b2, 0x000104da, 0x000104b2,
- 0x000104b3, 0x000104db, 0x000104b3,
- 0x000104b4, 0x000104dc, 0x000104b4,
- 0x000104b5, 0x000104dd, 0x000104b5,
- 0x000104b6, 0x000104de, 0x000104b6,
- 0x000104b7, 0x000104df, 0x000104b7,
- 0x000104b8, 0x000104e0, 0x000104b8,
- 0x000104b9, 0x000104e1, 0x000104b9,
- 0x000104ba, 0x000104e2, 0x000104ba,
- 0x000104bb, 0x000104e3, 0x000104bb,
- 0x000104bc, 0x000104e4, 0x000104bc,
- 0x000104bd, 0x000104e5, 0x000104bd,
- 0x000104be, 0x000104e6, 0x000104be,
- 0x000104bf, 0x000104e7, 0x000104bf,
- 0x000104c0, 0x000104e8, 0x000104c0,
- 0x000104c1, 0x000104e9, 0x000104c1,
- 0x000104c2, 0x000104ea, 0x000104c2,
- 0x000104c3, 0x000104eb, 0x000104c3,
- 0x000104c4, 0x000104ec, 0x000104c4,
- 0x000104c5, 0x000104ed, 0x000104c5,
- 0x000104c6, 0x000104ee, 0x000104c6,
- 0x000104c7, 0x000104ef, 0x000104c7,
- 0x000104c8, 0x000104f0, 0x000104c8,
- 0x000104c9, 0x000104f1, 0x000104c9,
- 0x000104ca, 0x000104f2, 0x000104ca,
- 0x000104cb, 0x000104f3, 0x000104cb,
- 0x000104cc, 0x000104f4, 0x000104cc,
- 0x000104cd, 0x000104f5, 0x000104cd,
- 0x000104ce, 0x000104f6, 0x000104ce,
- 0x000104cf, 0x000104f7, 0x000104cf,
- 0x000104d0, 0x000104f8, 0x000104d0,
- 0x000104d1, 0x000104f9, 0x000104d1,
- 0x000104d2, 0x000104fa, 0x000104d2,
- 0x000104d3, 0x000104fb, 0x000104d3,
- 0x00010c80, 0x00010cc0, 0x00010c80,
- 0x00010c81, 0x00010cc1, 0x00010c81,
- 0x00010c82, 0x00010cc2, 0x00010c82,
- 0x00010c83, 0x00010cc3, 0x00010c83,
- 0x00010c84, 0x00010cc4, 0x00010c84,
- 0x00010c85, 0x00010cc5, 0x00010c85,
- 0x00010c86, 0x00010cc6, 0x00010c86,
- 0x00010c87, 0x00010cc7, 0x00010c87,
- 0x00010c88, 0x00010cc8, 0x00010c88,
- 0x00010c89, 0x00010cc9, 0x00010c89,
- 0x00010c8a, 0x00010cca, 0x00010c8a,
- 0x00010c8b, 0x00010ccb, 0x00010c8b,
- 0x00010c8c, 0x00010ccc, 0x00010c8c,
- 0x00010c8d, 0x00010ccd, 0x00010c8d,
- 0x00010c8e, 0x00010cce, 0x00010c8e,
- 0x00010c8f, 0x00010ccf, 0x00010c8f,
- 0x00010c90, 0x00010cd0, 0x00010c90,
- 0x00010c91, 0x00010cd1, 0x00010c91,
- 0x00010c92, 0x00010cd2, 0x00010c92,
- 0x00010c93, 0x00010cd3, 0x00010c93,
- 0x00010c94, 0x00010cd4, 0x00010c94,
- 0x00010c95, 0x00010cd5, 0x00010c95,
- 0x00010c96, 0x00010cd6, 0x00010c96,
- 0x00010c97, 0x00010cd7, 0x00010c97,
- 0x00010c98, 0x00010cd8, 0x00010c98,
- 0x00010c99, 0x00010cd9, 0x00010c99,
- 0x00010c9a, 0x00010cda, 0x00010c9a,
- 0x00010c9b, 0x00010cdb, 0x00010c9b,
- 0x00010c9c, 0x00010cdc, 0x00010c9c,
- 0x00010c9d, 0x00010cdd, 0x00010c9d,
- 0x00010c9e, 0x00010cde, 0x00010c9e,
- 0x00010c9f, 0x00010cdf, 0x00010c9f,
- 0x00010ca0, 0x00010ce0, 0x00010ca0,
- 0x00010ca1, 0x00010ce1, 0x00010ca1,
- 0x00010ca2, 0x00010ce2, 0x00010ca2,
- 0x00010ca3, 0x00010ce3, 0x00010ca3,
- 0x00010ca4, 0x00010ce4, 0x00010ca4,
- 0x00010ca5, 0x00010ce5, 0x00010ca5,
- 0x00010ca6, 0x00010ce6, 0x00010ca6,
- 0x00010ca7, 0x00010ce7, 0x00010ca7,
- 0x00010ca8, 0x00010ce8, 0x00010ca8,
- 0x00010ca9, 0x00010ce9, 0x00010ca9,
- 0x00010caa, 0x00010cea, 0x00010caa,
- 0x00010cab, 0x00010ceb, 0x00010cab,
- 0x00010cac, 0x00010cec, 0x00010cac,
- 0x00010cad, 0x00010ced, 0x00010cad,
- 0x00010cae, 0x00010cee, 0x00010cae,
- 0x00010caf, 0x00010cef, 0x00010caf,
- 0x00010cb0, 0x00010cf0, 0x00010cb0,
- 0x00010cb1, 0x00010cf1, 0x00010cb1,
- 0x00010cb2, 0x00010cf2, 0x00010cb2,
- 0x000118a0, 0x000118c0, 0x000118a0,
- 0x000118a1, 0x000118c1, 0x000118a1,
- 0x000118a2, 0x000118c2, 0x000118a2,
- 0x000118a3, 0x000118c3, 0x000118a3,
- 0x000118a4, 0x000118c4, 0x000118a4,
- 0x000118a5, 0x000118c5, 0x000118a5,
- 0x000118a6, 0x000118c6, 0x000118a6,
- 0x000118a7, 0x000118c7, 0x000118a7,
- 0x000118a8, 0x000118c8, 0x000118a8,
- 0x000118a9, 0x000118c9, 0x000118a9,
- 0x000118aa, 0x000118ca, 0x000118aa,
- 0x000118ab, 0x000118cb, 0x000118ab,
- 0x000118ac, 0x000118cc, 0x000118ac,
- 0x000118ad, 0x000118cd, 0x000118ad,
- 0x000118ae, 0x000118ce, 0x000118ae,
- 0x000118af, 0x000118cf, 0x000118af,
- 0x000118b0, 0x000118d0, 0x000118b0,
- 0x000118b1, 0x000118d1, 0x000118b1,
- 0x000118b2, 0x000118d2, 0x000118b2,
- 0x000118b3, 0x000118d3, 0x000118b3,
- 0x000118b4, 0x000118d4, 0x000118b4,
- 0x000118b5, 0x000118d5, 0x000118b5,
- 0x000118b6, 0x000118d6, 0x000118b6,
- 0x000118b7, 0x000118d7, 0x000118b7,
- 0x000118b8, 0x000118d8, 0x000118b8,
- 0x000118b9, 0x000118d9, 0x000118b9,
- 0x000118ba, 0x000118da, 0x000118ba,
- 0x000118bb, 0x000118db, 0x000118bb,
- 0x000118bc, 0x000118dc, 0x000118bc,
- 0x000118bd, 0x000118dd, 0x000118bd,
- 0x000118be, 0x000118de, 0x000118be,
- 0x000118bf, 0x000118df, 0x000118bf,
- 0x0001e900, 0x0001e922, 0x0001e900,
- 0x0001e901, 0x0001e923, 0x0001e901,
- 0x0001e902, 0x0001e924, 0x0001e902,
- 0x0001e903, 0x0001e925, 0x0001e903,
- 0x0001e904, 0x0001e926, 0x0001e904,
- 0x0001e905, 0x0001e927, 0x0001e905,
- 0x0001e906, 0x0001e928, 0x0001e906,
- 0x0001e907, 0x0001e929, 0x0001e907,
- 0x0001e908, 0x0001e92a, 0x0001e908,
- 0x0001e909, 0x0001e92b, 0x0001e909,
- 0x0001e90a, 0x0001e92c, 0x0001e90a,
- 0x0001e90b, 0x0001e92d, 0x0001e90b,
- 0x0001e90c, 0x0001e92e, 0x0001e90c,
- 0x0001e90d, 0x0001e92f, 0x0001e90d,
- 0x0001e90e, 0x0001e930, 0x0001e90e,
- 0x0001e90f, 0x0001e931, 0x0001e90f,
- 0x0001e910, 0x0001e932, 0x0001e910,
- 0x0001e911, 0x0001e933, 0x0001e911,
- 0x0001e912, 0x0001e934, 0x0001e912,
- 0x0001e913, 0x0001e935, 0x0001e913,
- 0x0001e914, 0x0001e936, 0x0001e914,
- 0x0001e915, 0x0001e937, 0x0001e915,
- 0x0001e916, 0x0001e938, 0x0001e916,
- 0x0001e917, 0x0001e939, 0x0001e917,
- 0x0001e918, 0x0001e93a, 0x0001e918,
- 0x0001e919, 0x0001e93b, 0x0001e919,
- 0x0001e91a, 0x0001e93c, 0x0001e91a,
- 0x0001e91b, 0x0001e93d, 0x0001e91b,
- 0x0001e91c, 0x0001e93e, 0x0001e91c,
- 0x0001e91d, 0x0001e93f, 0x0001e91d,
- 0x0001e91e, 0x0001e940, 0x0001e91e,
- 0x0001e91f, 0x0001e941, 0x0001e91f,
- 0x0001e920, 0x0001e942, 0x0001e920,
- 0x0001e921, 0x0001e943, 0x0001e921,
- 0x00000061, 0x00000041, 0x00000041,
- 0x00000062, 0x00000042, 0x00000042,
- 0x00000063, 0x00000043, 0x00000043,
- 0x00000064, 0x00000044, 0x00000044,
- 0x00000065, 0x00000045, 0x00000045,
- 0x00000066, 0x00000046, 0x00000046,
- 0x00000067, 0x00000047, 0x00000047,
- 0x00000068, 0x00000048, 0x00000048,
- 0x00000069, 0x00000049, 0x00000049,
- 0x0000006a, 0x0000004a, 0x0000004a,
- 0x0000006b, 0x0000004b, 0x0000004b,
- 0x0000006c, 0x0000004c, 0x0000004c,
- 0x0000006d, 0x0000004d, 0x0000004d,
- 0x0000006e, 0x0000004e, 0x0000004e,
- 0x0000006f, 0x0000004f, 0x0000004f,
- 0x00000070, 0x00000050, 0x00000050,
- 0x00000071, 0x00000051, 0x00000051,
- 0x00000072, 0x00000052, 0x00000052,
- 0x00000073, 0x00000053, 0x00000053,
- 0x00000074, 0x00000054, 0x00000054,
- 0x00000075, 0x00000055, 0x00000055,
- 0x00000076, 0x00000056, 0x00000056,
- 0x00000077, 0x00000057, 0x00000057,
- 0x00000078, 0x00000058, 0x00000058,
- 0x00000079, 0x00000059, 0x00000059,
- 0x0000007a, 0x0000005a, 0x0000005a,
- 0x000000b5, 0x0000039c, 0x0000039c,
- 0x000000e0, 0x000000c0, 0x000000c0,
- 0x000000e1, 0x000000c1, 0x000000c1,
- 0x000000e2, 0x000000c2, 0x000000c2,
- 0x000000e3, 0x000000c3, 0x000000c3,
- 0x000000e4, 0x000000c4, 0x000000c4,
- 0x000000e5, 0x000000c5, 0x000000c5,
- 0x000000e6, 0x000000c6, 0x000000c6,
- 0x000000e7, 0x000000c7, 0x000000c7,
- 0x000000e8, 0x000000c8, 0x000000c8,
- 0x000000e9, 0x000000c9, 0x000000c9,
- 0x000000ea, 0x000000ca, 0x000000ca,
- 0x000000eb, 0x000000cb, 0x000000cb,
- 0x000000ec, 0x000000cc, 0x000000cc,
- 0x000000ed, 0x000000cd, 0x000000cd,
- 0x000000ee, 0x000000ce, 0x000000ce,
- 0x000000ef, 0x000000cf, 0x000000cf,
- 0x000000f0, 0x000000d0, 0x000000d0,
- 0x000000f1, 0x000000d1, 0x000000d1,
- 0x000000f2, 0x000000d2, 0x000000d2,
- 0x000000f3, 0x000000d3, 0x000000d3,
- 0x000000f4, 0x000000d4, 0x000000d4,
- 0x000000f5, 0x000000d5, 0x000000d5,
- 0x000000f6, 0x000000d6, 0x000000d6,
- 0x000000f8, 0x000000d8, 0x000000d8,
- 0x000000f9, 0x000000d9, 0x000000d9,
- 0x000000fa, 0x000000da, 0x000000da,
- 0x000000fb, 0x000000db, 0x000000db,
- 0x000000fc, 0x000000dc, 0x000000dc,
- 0x000000fd, 0x000000dd, 0x000000dd,
- 0x000000fe, 0x000000de, 0x000000de,
- 0x000000ff, 0x00000178, 0x00000178,
- 0x00000101, 0x00000100, 0x00000100,
- 0x00000103, 0x00000102, 0x00000102,
- 0x00000105, 0x00000104, 0x00000104,
- 0x00000107, 0x00000106, 0x00000106,
- 0x00000109, 0x00000108, 0x00000108,
- 0x0000010b, 0x0000010a, 0x0000010a,
- 0x0000010d, 0x0000010c, 0x0000010c,
- 0x0000010f, 0x0000010e, 0x0000010e,
- 0x00000111, 0x00000110, 0x00000110,
- 0x00000113, 0x00000112, 0x00000112,
- 0x00000115, 0x00000114, 0x00000114,
- 0x00000117, 0x00000116, 0x00000116,
- 0x00000119, 0x00000118, 0x00000118,
- 0x0000011b, 0x0000011a, 0x0000011a,
- 0x0000011d, 0x0000011c, 0x0000011c,
- 0x0000011f, 0x0000011e, 0x0000011e,
- 0x00000121, 0x00000120, 0x00000120,
- 0x00000123, 0x00000122, 0x00000122,
- 0x00000125, 0x00000124, 0x00000124,
- 0x00000127, 0x00000126, 0x00000126,
- 0x00000129, 0x00000128, 0x00000128,
- 0x0000012b, 0x0000012a, 0x0000012a,
- 0x0000012d, 0x0000012c, 0x0000012c,
- 0x0000012f, 0x0000012e, 0x0000012e,
- 0x00000131, 0x00000049, 0x00000049,
- 0x00000133, 0x00000132, 0x00000132,
- 0x00000135, 0x00000134, 0x00000134,
- 0x00000137, 0x00000136, 0x00000136,
- 0x0000013a, 0x00000139, 0x00000139,
- 0x0000013c, 0x0000013b, 0x0000013b,
- 0x0000013e, 0x0000013d, 0x0000013d,
- 0x00000140, 0x0000013f, 0x0000013f,
- 0x00000142, 0x00000141, 0x00000141,
- 0x00000144, 0x00000143, 0x00000143,
- 0x00000146, 0x00000145, 0x00000145,
- 0x00000148, 0x00000147, 0x00000147,
- 0x0000014b, 0x0000014a, 0x0000014a,
- 0x0000014d, 0x0000014c, 0x0000014c,
- 0x0000014f, 0x0000014e, 0x0000014e,
- 0x00000151, 0x00000150, 0x00000150,
- 0x00000153, 0x00000152, 0x00000152,
- 0x00000155, 0x00000154, 0x00000154,
- 0x00000157, 0x00000156, 0x00000156,
- 0x00000159, 0x00000158, 0x00000158,
- 0x0000015b, 0x0000015a, 0x0000015a,
- 0x0000015d, 0x0000015c, 0x0000015c,
- 0x0000015f, 0x0000015e, 0x0000015e,
- 0x00000161, 0x00000160, 0x00000160,
- 0x00000163, 0x00000162, 0x00000162,
- 0x00000165, 0x00000164, 0x00000164,
- 0x00000167, 0x00000166, 0x00000166,
- 0x00000169, 0x00000168, 0x00000168,
- 0x0000016b, 0x0000016a, 0x0000016a,
- 0x0000016d, 0x0000016c, 0x0000016c,
- 0x0000016f, 0x0000016e, 0x0000016e,
- 0x00000171, 0x00000170, 0x00000170,
- 0x00000173, 0x00000172, 0x00000172,
- 0x00000175, 0x00000174, 0x00000174,
- 0x00000177, 0x00000176, 0x00000176,
- 0x0000017a, 0x00000179, 0x00000179,
- 0x0000017c, 0x0000017b, 0x0000017b,
- 0x0000017e, 0x0000017d, 0x0000017d,
- 0x0000017f, 0x00000053, 0x00000053,
- 0x00000180, 0x00000243, 0x00000243,
- 0x00000183, 0x00000182, 0x00000182,
- 0x00000185, 0x00000184, 0x00000184,
- 0x00000188, 0x00000187, 0x00000187,
- 0x0000018c, 0x0000018b, 0x0000018b,
- 0x00000192, 0x00000191, 0x00000191,
- 0x00000195, 0x000001f6, 0x000001f6,
- 0x00000199, 0x00000198, 0x00000198,
- 0x0000019a, 0x0000023d, 0x0000023d,
- 0x0000019e, 0x00000220, 0x00000220,
- 0x000001a1, 0x000001a0, 0x000001a0,
- 0x000001a3, 0x000001a2, 0x000001a2,
- 0x000001a5, 0x000001a4, 0x000001a4,
- 0x000001a8, 0x000001a7, 0x000001a7,
- 0x000001ad, 0x000001ac, 0x000001ac,
- 0x000001b0, 0x000001af, 0x000001af,
- 0x000001b4, 0x000001b3, 0x000001b3,
- 0x000001b6, 0x000001b5, 0x000001b5,
- 0x000001b9, 0x000001b8, 0x000001b8,
- 0x000001bd, 0x000001bc, 0x000001bc,
- 0x000001bf, 0x000001f7, 0x000001f7,
- 0x000001c6, 0x000001c4, 0x000001c5,
- 0x000001c9, 0x000001c7, 0x000001c8,
- 0x000001cc, 0x000001ca, 0x000001cb,
- 0x000001ce, 0x000001cd, 0x000001cd,
- 0x000001d0, 0x000001cf, 0x000001cf,
- 0x000001d2, 0x000001d1, 0x000001d1,
- 0x000001d4, 0x000001d3, 0x000001d3,
- 0x000001d6, 0x000001d5, 0x000001d5,
- 0x000001d8, 0x000001d7, 0x000001d7,
- 0x000001da, 0x000001d9, 0x000001d9,
- 0x000001dc, 0x000001db, 0x000001db,
- 0x000001dd, 0x0000018e, 0x0000018e,
- 0x000001df, 0x000001de, 0x000001de,
- 0x000001e1, 0x000001e0, 0x000001e0,
- 0x000001e3, 0x000001e2, 0x000001e2,
- 0x000001e5, 0x000001e4, 0x000001e4,
- 0x000001e7, 0x000001e6, 0x000001e6,
- 0x000001e9, 0x000001e8, 0x000001e8,
- 0x000001eb, 0x000001ea, 0x000001ea,
- 0x000001ed, 0x000001ec, 0x000001ec,
- 0x000001ef, 0x000001ee, 0x000001ee,
- 0x000001f3, 0x000001f1, 0x000001f2,
- 0x000001f5, 0x000001f4, 0x000001f4,
- 0x000001f9, 0x000001f8, 0x000001f8,
- 0x000001fb, 0x000001fa, 0x000001fa,
- 0x000001fd, 0x000001fc, 0x000001fc,
- 0x000001ff, 0x000001fe, 0x000001fe,
- 0x00000201, 0x00000200, 0x00000200,
- 0x00000203, 0x00000202, 0x00000202,
- 0x00000205, 0x00000204, 0x00000204,
- 0x00000207, 0x00000206, 0x00000206,
- 0x00000209, 0x00000208, 0x00000208,
- 0x0000020b, 0x0000020a, 0x0000020a,
- 0x0000020d, 0x0000020c, 0x0000020c,
- 0x0000020f, 0x0000020e, 0x0000020e,
- 0x00000211, 0x00000210, 0x00000210,
- 0x00000213, 0x00000212, 0x00000212,
- 0x00000215, 0x00000214, 0x00000214,
- 0x00000217, 0x00000216, 0x00000216,
- 0x00000219, 0x00000218, 0x00000218,
- 0x0000021b, 0x0000021a, 0x0000021a,
- 0x0000021d, 0x0000021c, 0x0000021c,
- 0x0000021f, 0x0000021e, 0x0000021e,
- 0x00000223, 0x00000222, 0x00000222,
- 0x00000225, 0x00000224, 0x00000224,
- 0x00000227, 0x00000226, 0x00000226,
- 0x00000229, 0x00000228, 0x00000228,
- 0x0000022b, 0x0000022a, 0x0000022a,
- 0x0000022d, 0x0000022c, 0x0000022c,
- 0x0000022f, 0x0000022e, 0x0000022e,
- 0x00000231, 0x00000230, 0x00000230,
- 0x00000233, 0x00000232, 0x00000232,
- 0x0000023c, 0x0000023b, 0x0000023b,
- 0x0000023f, 0x00002c7e, 0x00002c7e,
- 0x00000240, 0x00002c7f, 0x00002c7f,
- 0x00000242, 0x00000241, 0x00000241,
- 0x00000247, 0x00000246, 0x00000246,
- 0x00000249, 0x00000248, 0x00000248,
- 0x0000024b, 0x0000024a, 0x0000024a,
- 0x0000024d, 0x0000024c, 0x0000024c,
- 0x0000024f, 0x0000024e, 0x0000024e,
- 0x00000250, 0x00002c6f, 0x00002c6f,
- 0x00000251, 0x00002c6d, 0x00002c6d,
- 0x00000252, 0x00002c70, 0x00002c70,
- 0x00000253, 0x00000181, 0x00000181,
- 0x00000254, 0x00000186, 0x00000186,
- 0x00000256, 0x00000189, 0x00000189,
- 0x00000257, 0x0000018a, 0x0000018a,
- 0x00000259, 0x0000018f, 0x0000018f,
- 0x0000025b, 0x00000190, 0x00000190,
- 0x0000025c, 0x0000a7ab, 0x0000a7ab,
- 0x00000260, 0x00000193, 0x00000193,
- 0x00000261, 0x0000a7ac, 0x0000a7ac,
- 0x00000263, 0x00000194, 0x00000194,
- 0x00000265, 0x0000a78d, 0x0000a78d,
- 0x00000266, 0x0000a7aa, 0x0000a7aa,
- 0x00000268, 0x00000197, 0x00000197,
- 0x00000269, 0x00000196, 0x00000196,
- 0x0000026a, 0x0000a7ae, 0x0000a7ae,
- 0x0000026b, 0x00002c62, 0x00002c62,
- 0x0000026c, 0x0000a7ad, 0x0000a7ad,
- 0x0000026f, 0x0000019c, 0x0000019c,
- 0x00000271, 0x00002c6e, 0x00002c6e,
- 0x00000272, 0x0000019d, 0x0000019d,
- 0x00000275, 0x0000019f, 0x0000019f,
- 0x0000027d, 0x00002c64, 0x00002c64,
- 0x00000280, 0x000001a6, 0x000001a6,
- 0x00000283, 0x000001a9, 0x000001a9,
- 0x00000287, 0x0000a7b1, 0x0000a7b1,
- 0x00000288, 0x000001ae, 0x000001ae,
- 0x00000289, 0x00000244, 0x00000244,
- 0x0000028a, 0x000001b1, 0x000001b1,
- 0x0000028b, 0x000001b2, 0x000001b2,
- 0x0000028c, 0x00000245, 0x00000245,
- 0x00000292, 0x000001b7, 0x000001b7,
- 0x0000029d, 0x0000a7b2, 0x0000a7b2,
- 0x0000029e, 0x0000a7b0, 0x0000a7b0,
- 0x00000345, 0x00000399, 0x00000399,
- 0x00000371, 0x00000370, 0x00000370,
- 0x00000373, 0x00000372, 0x00000372,
- 0x00000377, 0x00000376, 0x00000376,
- 0x0000037b, 0x000003fd, 0x000003fd,
- 0x0000037c, 0x000003fe, 0x000003fe,
- 0x0000037d, 0x000003ff, 0x000003ff,
- 0x000003ac, 0x00000386, 0x00000386,
- 0x000003ad, 0x00000388, 0x00000388,
- 0x000003ae, 0x00000389, 0x00000389,
- 0x000003af, 0x0000038a, 0x0000038a,
- 0x000003b1, 0x00000391, 0x00000391,
- 0x000003b2, 0x00000392, 0x00000392,
- 0x000003b3, 0x00000393, 0x00000393,
- 0x000003b4, 0x00000394, 0x00000394,
- 0x000003b5, 0x00000395, 0x00000395,
- 0x000003b6, 0x00000396, 0x00000396,
- 0x000003b7, 0x00000397, 0x00000397,
- 0x000003b8, 0x00000398, 0x00000398,
- 0x000003b9, 0x00000399, 0x00000399,
- 0x000003ba, 0x0000039a, 0x0000039a,
- 0x000003bb, 0x0000039b, 0x0000039b,
- 0x000003bc, 0x0000039c, 0x0000039c,
- 0x000003bd, 0x0000039d, 0x0000039d,
- 0x000003be, 0x0000039e, 0x0000039e,
- 0x000003bf, 0x0000039f, 0x0000039f,
- 0x000003c0, 0x000003a0, 0x000003a0,
- 0x000003c1, 0x000003a1, 0x000003a1,
- 0x000003c2, 0x000003a3, 0x000003a3,
- 0x000003c3, 0x000003a3, 0x000003a3,
- 0x000003c4, 0x000003a4, 0x000003a4,
- 0x000003c5, 0x000003a5, 0x000003a5,
- 0x000003c6, 0x000003a6, 0x000003a6,
- 0x000003c7, 0x000003a7, 0x000003a7,
- 0x000003c8, 0x000003a8, 0x000003a8,
- 0x000003c9, 0x000003a9, 0x000003a9,
- 0x000003ca, 0x000003aa, 0x000003aa,
- 0x000003cb, 0x000003ab, 0x000003ab,
- 0x000003cc, 0x0000038c, 0x0000038c,
- 0x000003cd, 0x0000038e, 0x0000038e,
- 0x000003ce, 0x0000038f, 0x0000038f,
- 0x000003d0, 0x00000392, 0x00000392,
- 0x000003d1, 0x00000398, 0x00000398,
- 0x000003d5, 0x000003a6, 0x000003a6,
- 0x000003d6, 0x000003a0, 0x000003a0,
- 0x000003d7, 0x000003cf, 0x000003cf,
- 0x000003d9, 0x000003d8, 0x000003d8,
- 0x000003db, 0x000003da, 0x000003da,
- 0x000003dd, 0x000003dc, 0x000003dc,
- 0x000003df, 0x000003de, 0x000003de,
- 0x000003e1, 0x000003e0, 0x000003e0,
- 0x000003e3, 0x000003e2, 0x000003e2,
- 0x000003e5, 0x000003e4, 0x000003e4,
- 0x000003e7, 0x000003e6, 0x000003e6,
- 0x000003e9, 0x000003e8, 0x000003e8,
- 0x000003eb, 0x000003ea, 0x000003ea,
- 0x000003ed, 0x000003ec, 0x000003ec,
- 0x000003ef, 0x000003ee, 0x000003ee,
- 0x000003f0, 0x0000039a, 0x0000039a,
- 0x000003f1, 0x000003a1, 0x000003a1,
- 0x000003f2, 0x000003f9, 0x000003f9,
- 0x000003f3, 0x0000037f, 0x0000037f,
- 0x000003f5, 0x00000395, 0x00000395,
- 0x000003f8, 0x000003f7, 0x000003f7,
- 0x000003fb, 0x000003fa, 0x000003fa,
- 0x00000430, 0x00000410, 0x00000410,
- 0x00000431, 0x00000411, 0x00000411,
- 0x00000432, 0x00000412, 0x00000412,
- 0x00000433, 0x00000413, 0x00000413,
- 0x00000434, 0x00000414, 0x00000414,
- 0x00000435, 0x00000415, 0x00000415,
- 0x00000436, 0x00000416, 0x00000416,
- 0x00000437, 0x00000417, 0x00000417,
- 0x00000438, 0x00000418, 0x00000418,
- 0x00000439, 0x00000419, 0x00000419,
- 0x0000043a, 0x0000041a, 0x0000041a,
- 0x0000043b, 0x0000041b, 0x0000041b,
- 0x0000043c, 0x0000041c, 0x0000041c,
- 0x0000043d, 0x0000041d, 0x0000041d,
- 0x0000043e, 0x0000041e, 0x0000041e,
- 0x0000043f, 0x0000041f, 0x0000041f,
- 0x00000440, 0x00000420, 0x00000420,
- 0x00000441, 0x00000421, 0x00000421,
- 0x00000442, 0x00000422, 0x00000422,
- 0x00000443, 0x00000423, 0x00000423,
- 0x00000444, 0x00000424, 0x00000424,
- 0x00000445, 0x00000425, 0x00000425,
- 0x00000446, 0x00000426, 0x00000426,
- 0x00000447, 0x00000427, 0x00000427,
- 0x00000448, 0x00000428, 0x00000428,
- 0x00000449, 0x00000429, 0x00000429,
- 0x0000044a, 0x0000042a, 0x0000042a,
- 0x0000044b, 0x0000042b, 0x0000042b,
- 0x0000044c, 0x0000042c, 0x0000042c,
- 0x0000044d, 0x0000042d, 0x0000042d,
- 0x0000044e, 0x0000042e, 0x0000042e,
- 0x0000044f, 0x0000042f, 0x0000042f,
- 0x00000450, 0x00000400, 0x00000400,
- 0x00000451, 0x00000401, 0x00000401,
- 0x00000452, 0x00000402, 0x00000402,
- 0x00000453, 0x00000403, 0x00000403,
- 0x00000454, 0x00000404, 0x00000404,
- 0x00000455, 0x00000405, 0x00000405,
- 0x00000456, 0x00000406, 0x00000406,
- 0x00000457, 0x00000407, 0x00000407,
- 0x00000458, 0x00000408, 0x00000408,
- 0x00000459, 0x00000409, 0x00000409,
- 0x0000045a, 0x0000040a, 0x0000040a,
- 0x0000045b, 0x0000040b, 0x0000040b,
- 0x0000045c, 0x0000040c, 0x0000040c,
- 0x0000045d, 0x0000040d, 0x0000040d,
- 0x0000045e, 0x0000040e, 0x0000040e,
- 0x0000045f, 0x0000040f, 0x0000040f,
- 0x00000461, 0x00000460, 0x00000460,
- 0x00000463, 0x00000462, 0x00000462,
- 0x00000465, 0x00000464, 0x00000464,
- 0x00000467, 0x00000466, 0x00000466,
- 0x00000469, 0x00000468, 0x00000468,
- 0x0000046b, 0x0000046a, 0x0000046a,
- 0x0000046d, 0x0000046c, 0x0000046c,
- 0x0000046f, 0x0000046e, 0x0000046e,
- 0x00000471, 0x00000470, 0x00000470,
- 0x00000473, 0x00000472, 0x00000472,
- 0x00000475, 0x00000474, 0x00000474,
- 0x00000477, 0x00000476, 0x00000476,
- 0x00000479, 0x00000478, 0x00000478,
- 0x0000047b, 0x0000047a, 0x0000047a,
- 0x0000047d, 0x0000047c, 0x0000047c,
- 0x0000047f, 0x0000047e, 0x0000047e,
- 0x00000481, 0x00000480, 0x00000480,
- 0x0000048b, 0x0000048a, 0x0000048a,
- 0x0000048d, 0x0000048c, 0x0000048c,
- 0x0000048f, 0x0000048e, 0x0000048e,
- 0x00000491, 0x00000490, 0x00000490,
- 0x00000493, 0x00000492, 0x00000492,
- 0x00000495, 0x00000494, 0x00000494,
- 0x00000497, 0x00000496, 0x00000496,
- 0x00000499, 0x00000498, 0x00000498,
- 0x0000049b, 0x0000049a, 0x0000049a,
- 0x0000049d, 0x0000049c, 0x0000049c,
- 0x0000049f, 0x0000049e, 0x0000049e,
- 0x000004a1, 0x000004a0, 0x000004a0,
- 0x000004a3, 0x000004a2, 0x000004a2,
- 0x000004a5, 0x000004a4, 0x000004a4,
- 0x000004a7, 0x000004a6, 0x000004a6,
- 0x000004a9, 0x000004a8, 0x000004a8,
- 0x000004ab, 0x000004aa, 0x000004aa,
- 0x000004ad, 0x000004ac, 0x000004ac,
- 0x000004af, 0x000004ae, 0x000004ae,
- 0x000004b1, 0x000004b0, 0x000004b0,
- 0x000004b3, 0x000004b2, 0x000004b2,
- 0x000004b5, 0x000004b4, 0x000004b4,
- 0x000004b7, 0x000004b6, 0x000004b6,
- 0x000004b9, 0x000004b8, 0x000004b8,
- 0x000004bb, 0x000004ba, 0x000004ba,
- 0x000004bd, 0x000004bc, 0x000004bc,
- 0x000004bf, 0x000004be, 0x000004be,
- 0x000004c2, 0x000004c1, 0x000004c1,
- 0x000004c4, 0x000004c3, 0x000004c3,
- 0x000004c6, 0x000004c5, 0x000004c5,
- 0x000004c8, 0x000004c7, 0x000004c7,
- 0x000004ca, 0x000004c9, 0x000004c9,
- 0x000004cc, 0x000004cb, 0x000004cb,
- 0x000004ce, 0x000004cd, 0x000004cd,
- 0x000004cf, 0x000004c0, 0x000004c0,
- 0x000004d1, 0x000004d0, 0x000004d0,
- 0x000004d3, 0x000004d2, 0x000004d2,
- 0x000004d5, 0x000004d4, 0x000004d4,
- 0x000004d7, 0x000004d6, 0x000004d6,
- 0x000004d9, 0x000004d8, 0x000004d8,
- 0x000004db, 0x000004da, 0x000004da,
- 0x000004dd, 0x000004dc, 0x000004dc,
- 0x000004df, 0x000004de, 0x000004de,
- 0x000004e1, 0x000004e0, 0x000004e0,
- 0x000004e3, 0x000004e2, 0x000004e2,
- 0x000004e5, 0x000004e4, 0x000004e4,
- 0x000004e7, 0x000004e6, 0x000004e6,
- 0x000004e9, 0x000004e8, 0x000004e8,
- 0x000004eb, 0x000004ea, 0x000004ea,
- 0x000004ed, 0x000004ec, 0x000004ec,
- 0x000004ef, 0x000004ee, 0x000004ee,
- 0x000004f1, 0x000004f0, 0x000004f0,
- 0x000004f3, 0x000004f2, 0x000004f2,
- 0x000004f5, 0x000004f4, 0x000004f4,
- 0x000004f7, 0x000004f6, 0x000004f6,
- 0x000004f9, 0x000004f8, 0x000004f8,
- 0x000004fb, 0x000004fa, 0x000004fa,
- 0x000004fd, 0x000004fc, 0x000004fc,
- 0x000004ff, 0x000004fe, 0x000004fe,
- 0x00000501, 0x00000500, 0x00000500,
- 0x00000503, 0x00000502, 0x00000502,
- 0x00000505, 0x00000504, 0x00000504,
- 0x00000507, 0x00000506, 0x00000506,
- 0x00000509, 0x00000508, 0x00000508,
- 0x0000050b, 0x0000050a, 0x0000050a,
- 0x0000050d, 0x0000050c, 0x0000050c,
- 0x0000050f, 0x0000050e, 0x0000050e,
- 0x00000511, 0x00000510, 0x00000510,
- 0x00000513, 0x00000512, 0x00000512,
- 0x00000515, 0x00000514, 0x00000514,
- 0x00000517, 0x00000516, 0x00000516,
- 0x00000519, 0x00000518, 0x00000518,
- 0x0000051b, 0x0000051a, 0x0000051a,
- 0x0000051d, 0x0000051c, 0x0000051c,
- 0x0000051f, 0x0000051e, 0x0000051e,
- 0x00000521, 0x00000520, 0x00000520,
- 0x00000523, 0x00000522, 0x00000522,
- 0x00000525, 0x00000524, 0x00000524,
- 0x00000527, 0x00000526, 0x00000526,
- 0x00000529, 0x00000528, 0x00000528,
- 0x0000052b, 0x0000052a, 0x0000052a,
- 0x0000052d, 0x0000052c, 0x0000052c,
- 0x0000052f, 0x0000052e, 0x0000052e,
- 0x00000561, 0x00000531, 0x00000531,
- 0x00000562, 0x00000532, 0x00000532,
- 0x00000563, 0x00000533, 0x00000533,
- 0x00000564, 0x00000534, 0x00000534,
- 0x00000565, 0x00000535, 0x00000535,
- 0x00000566, 0x00000536, 0x00000536,
- 0x00000567, 0x00000537, 0x00000537,
- 0x00000568, 0x00000538, 0x00000538,
- 0x00000569, 0x00000539, 0x00000539,
- 0x0000056a, 0x0000053a, 0x0000053a,
- 0x0000056b, 0x0000053b, 0x0000053b,
- 0x0000056c, 0x0000053c, 0x0000053c,
- 0x0000056d, 0x0000053d, 0x0000053d,
- 0x0000056e, 0x0000053e, 0x0000053e,
- 0x0000056f, 0x0000053f, 0x0000053f,
- 0x00000570, 0x00000540, 0x00000540,
- 0x00000571, 0x00000541, 0x00000541,
- 0x00000572, 0x00000542, 0x00000542,
- 0x00000573, 0x00000543, 0x00000543,
- 0x00000574, 0x00000544, 0x00000544,
- 0x00000575, 0x00000545, 0x00000545,
- 0x00000576, 0x00000546, 0x00000546,
- 0x00000577, 0x00000547, 0x00000547,
- 0x00000578, 0x00000548, 0x00000548,
- 0x00000579, 0x00000549, 0x00000549,
- 0x0000057a, 0x0000054a, 0x0000054a,
- 0x0000057b, 0x0000054b, 0x0000054b,
- 0x0000057c, 0x0000054c, 0x0000054c,
- 0x0000057d, 0x0000054d, 0x0000054d,
- 0x0000057e, 0x0000054e, 0x0000054e,
- 0x0000057f, 0x0000054f, 0x0000054f,
- 0x00000580, 0x00000550, 0x00000550,
- 0x00000581, 0x00000551, 0x00000551,
- 0x00000582, 0x00000552, 0x00000552,
- 0x00000583, 0x00000553, 0x00000553,
- 0x00000584, 0x00000554, 0x00000554,
- 0x00000585, 0x00000555, 0x00000555,
- 0x00000586, 0x00000556, 0x00000556,
- 0x000013f8, 0x000013f0, 0x000013f0,
- 0x000013f9, 0x000013f1, 0x000013f1,
- 0x000013fa, 0x000013f2, 0x000013f2,
- 0x000013fb, 0x000013f3, 0x000013f3,
- 0x000013fc, 0x000013f4, 0x000013f4,
- 0x000013fd, 0x000013f5, 0x000013f5,
- 0x00001c80, 0x00000412, 0x00000412,
- 0x00001c81, 0x00000414, 0x00000414,
- 0x00001c82, 0x0000041e, 0x0000041e,
- 0x00001c83, 0x00000421, 0x00000421,
- 0x00001c84, 0x00000422, 0x00000422,
- 0x00001c85, 0x00000422, 0x00000422,
- 0x00001c86, 0x0000042a, 0x0000042a,
- 0x00001c87, 0x00000462, 0x00000462,
- 0x00001c88, 0x0000a64a, 0x0000a64a,
- 0x00001d79, 0x0000a77d, 0x0000a77d,
- 0x00001d7d, 0x00002c63, 0x00002c63,
- 0x00001e01, 0x00001e00, 0x00001e00,
- 0x00001e03, 0x00001e02, 0x00001e02,
- 0x00001e05, 0x00001e04, 0x00001e04,
- 0x00001e07, 0x00001e06, 0x00001e06,
- 0x00001e09, 0x00001e08, 0x00001e08,
- 0x00001e0b, 0x00001e0a, 0x00001e0a,
- 0x00001e0d, 0x00001e0c, 0x00001e0c,
- 0x00001e0f, 0x00001e0e, 0x00001e0e,
- 0x00001e11, 0x00001e10, 0x00001e10,
- 0x00001e13, 0x00001e12, 0x00001e12,
- 0x00001e15, 0x00001e14, 0x00001e14,
- 0x00001e17, 0x00001e16, 0x00001e16,
- 0x00001e19, 0x00001e18, 0x00001e18,
- 0x00001e1b, 0x00001e1a, 0x00001e1a,
- 0x00001e1d, 0x00001e1c, 0x00001e1c,
- 0x00001e1f, 0x00001e1e, 0x00001e1e,
- 0x00001e21, 0x00001e20, 0x00001e20,
- 0x00001e23, 0x00001e22, 0x00001e22,
- 0x00001e25, 0x00001e24, 0x00001e24,
- 0x00001e27, 0x00001e26, 0x00001e26,
- 0x00001e29, 0x00001e28, 0x00001e28,
- 0x00001e2b, 0x00001e2a, 0x00001e2a,
- 0x00001e2d, 0x00001e2c, 0x00001e2c,
- 0x00001e2f, 0x00001e2e, 0x00001e2e,
- 0x00001e31, 0x00001e30, 0x00001e30,
- 0x00001e33, 0x00001e32, 0x00001e32,
- 0x00001e35, 0x00001e34, 0x00001e34,
- 0x00001e37, 0x00001e36, 0x00001e36,
- 0x00001e39, 0x00001e38, 0x00001e38,
- 0x00001e3b, 0x00001e3a, 0x00001e3a,
- 0x00001e3d, 0x00001e3c, 0x00001e3c,
- 0x00001e3f, 0x00001e3e, 0x00001e3e,
- 0x00001e41, 0x00001e40, 0x00001e40,
- 0x00001e43, 0x00001e42, 0x00001e42,
- 0x00001e45, 0x00001e44, 0x00001e44,
- 0x00001e47, 0x00001e46, 0x00001e46,
- 0x00001e49, 0x00001e48, 0x00001e48,
- 0x00001e4b, 0x00001e4a, 0x00001e4a,
- 0x00001e4d, 0x00001e4c, 0x00001e4c,
- 0x00001e4f, 0x00001e4e, 0x00001e4e,
- 0x00001e51, 0x00001e50, 0x00001e50,
- 0x00001e53, 0x00001e52, 0x00001e52,
- 0x00001e55, 0x00001e54, 0x00001e54,
- 0x00001e57, 0x00001e56, 0x00001e56,
- 0x00001e59, 0x00001e58, 0x00001e58,
- 0x00001e5b, 0x00001e5a, 0x00001e5a,
- 0x00001e5d, 0x00001e5c, 0x00001e5c,
- 0x00001e5f, 0x00001e5e, 0x00001e5e,
- 0x00001e61, 0x00001e60, 0x00001e60,
- 0x00001e63, 0x00001e62, 0x00001e62,
- 0x00001e65, 0x00001e64, 0x00001e64,
- 0x00001e67, 0x00001e66, 0x00001e66,
- 0x00001e69, 0x00001e68, 0x00001e68,
- 0x00001e6b, 0x00001e6a, 0x00001e6a,
- 0x00001e6d, 0x00001e6c, 0x00001e6c,
- 0x00001e6f, 0x00001e6e, 0x00001e6e,
- 0x00001e71, 0x00001e70, 0x00001e70,
- 0x00001e73, 0x00001e72, 0x00001e72,
- 0x00001e75, 0x00001e74, 0x00001e74,
- 0x00001e77, 0x00001e76, 0x00001e76,
- 0x00001e79, 0x00001e78, 0x00001e78,
- 0x00001e7b, 0x00001e7a, 0x00001e7a,
- 0x00001e7d, 0x00001e7c, 0x00001e7c,
- 0x00001e7f, 0x00001e7e, 0x00001e7e,
- 0x00001e81, 0x00001e80, 0x00001e80,
- 0x00001e83, 0x00001e82, 0x00001e82,
- 0x00001e85, 0x00001e84, 0x00001e84,
- 0x00001e87, 0x00001e86, 0x00001e86,
- 0x00001e89, 0x00001e88, 0x00001e88,
- 0x00001e8b, 0x00001e8a, 0x00001e8a,
- 0x00001e8d, 0x00001e8c, 0x00001e8c,
- 0x00001e8f, 0x00001e8e, 0x00001e8e,
- 0x00001e91, 0x00001e90, 0x00001e90,
- 0x00001e93, 0x00001e92, 0x00001e92,
- 0x00001e95, 0x00001e94, 0x00001e94,
- 0x00001e9b, 0x00001e60, 0x00001e60,
- 0x00001ea1, 0x00001ea0, 0x00001ea0,
- 0x00001ea3, 0x00001ea2, 0x00001ea2,
- 0x00001ea5, 0x00001ea4, 0x00001ea4,
- 0x00001ea7, 0x00001ea6, 0x00001ea6,
- 0x00001ea9, 0x00001ea8, 0x00001ea8,
- 0x00001eab, 0x00001eaa, 0x00001eaa,
- 0x00001ead, 0x00001eac, 0x00001eac,
- 0x00001eaf, 0x00001eae, 0x00001eae,
- 0x00001eb1, 0x00001eb0, 0x00001eb0,
- 0x00001eb3, 0x00001eb2, 0x00001eb2,
- 0x00001eb5, 0x00001eb4, 0x00001eb4,
- 0x00001eb7, 0x00001eb6, 0x00001eb6,
- 0x00001eb9, 0x00001eb8, 0x00001eb8,
- 0x00001ebb, 0x00001eba, 0x00001eba,
- 0x00001ebd, 0x00001ebc, 0x00001ebc,
- 0x00001ebf, 0x00001ebe, 0x00001ebe,
- 0x00001ec1, 0x00001ec0, 0x00001ec0,
- 0x00001ec3, 0x00001ec2, 0x00001ec2,
- 0x00001ec5, 0x00001ec4, 0x00001ec4,
- 0x00001ec7, 0x00001ec6, 0x00001ec6,
- 0x00001ec9, 0x00001ec8, 0x00001ec8,
- 0x00001ecb, 0x00001eca, 0x00001eca,
- 0x00001ecd, 0x00001ecc, 0x00001ecc,
- 0x00001ecf, 0x00001ece, 0x00001ece,
- 0x00001ed1, 0x00001ed0, 0x00001ed0,
- 0x00001ed3, 0x00001ed2, 0x00001ed2,
- 0x00001ed5, 0x00001ed4, 0x00001ed4,
- 0x00001ed7, 0x00001ed6, 0x00001ed6,
- 0x00001ed9, 0x00001ed8, 0x00001ed8,
- 0x00001edb, 0x00001eda, 0x00001eda,
- 0x00001edd, 0x00001edc, 0x00001edc,
- 0x00001edf, 0x00001ede, 0x00001ede,
- 0x00001ee1, 0x00001ee0, 0x00001ee0,
- 0x00001ee3, 0x00001ee2, 0x00001ee2,
- 0x00001ee5, 0x00001ee4, 0x00001ee4,
- 0x00001ee7, 0x00001ee6, 0x00001ee6,
- 0x00001ee9, 0x00001ee8, 0x00001ee8,
- 0x00001eeb, 0x00001eea, 0x00001eea,
- 0x00001eed, 0x00001eec, 0x00001eec,
- 0x00001eef, 0x00001eee, 0x00001eee,
- 0x00001ef1, 0x00001ef0, 0x00001ef0,
- 0x00001ef3, 0x00001ef2, 0x00001ef2,
- 0x00001ef5, 0x00001ef4, 0x00001ef4,
- 0x00001ef7, 0x00001ef6, 0x00001ef6,
- 0x00001ef9, 0x00001ef8, 0x00001ef8,
- 0x00001efb, 0x00001efa, 0x00001efa,
- 0x00001efd, 0x00001efc, 0x00001efc,
- 0x00001eff, 0x00001efe, 0x00001efe,
- 0x00001f00, 0x00001f08, 0x00001f08,
- 0x00001f01, 0x00001f09, 0x00001f09,
- 0x00001f02, 0x00001f0a, 0x00001f0a,
- 0x00001f03, 0x00001f0b, 0x00001f0b,
- 0x00001f04, 0x00001f0c, 0x00001f0c,
- 0x00001f05, 0x00001f0d, 0x00001f0d,
- 0x00001f06, 0x00001f0e, 0x00001f0e,
- 0x00001f07, 0x00001f0f, 0x00001f0f,
- 0x00001f10, 0x00001f18, 0x00001f18,
- 0x00001f11, 0x00001f19, 0x00001f19,
- 0x00001f12, 0x00001f1a, 0x00001f1a,
- 0x00001f13, 0x00001f1b, 0x00001f1b,
- 0x00001f14, 0x00001f1c, 0x00001f1c,
- 0x00001f15, 0x00001f1d, 0x00001f1d,
- 0x00001f20, 0x00001f28, 0x00001f28,
- 0x00001f21, 0x00001f29, 0x00001f29,
- 0x00001f22, 0x00001f2a, 0x00001f2a,
- 0x00001f23, 0x00001f2b, 0x00001f2b,
- 0x00001f24, 0x00001f2c, 0x00001f2c,
- 0x00001f25, 0x00001f2d, 0x00001f2d,
- 0x00001f26, 0x00001f2e, 0x00001f2e,
- 0x00001f27, 0x00001f2f, 0x00001f2f,
- 0x00001f30, 0x00001f38, 0x00001f38,
- 0x00001f31, 0x00001f39, 0x00001f39,
- 0x00001f32, 0x00001f3a, 0x00001f3a,
- 0x00001f33, 0x00001f3b, 0x00001f3b,
- 0x00001f34, 0x00001f3c, 0x00001f3c,
- 0x00001f35, 0x00001f3d, 0x00001f3d,
- 0x00001f36, 0x00001f3e, 0x00001f3e,
- 0x00001f37, 0x00001f3f, 0x00001f3f,
- 0x00001f40, 0x00001f48, 0x00001f48,
- 0x00001f41, 0x00001f49, 0x00001f49,
- 0x00001f42, 0x00001f4a, 0x00001f4a,
- 0x00001f43, 0x00001f4b, 0x00001f4b,
- 0x00001f44, 0x00001f4c, 0x00001f4c,
- 0x00001f45, 0x00001f4d, 0x00001f4d,
- 0x00001f51, 0x00001f59, 0x00001f59,
- 0x00001f53, 0x00001f5b, 0x00001f5b,
- 0x00001f55, 0x00001f5d, 0x00001f5d,
- 0x00001f57, 0x00001f5f, 0x00001f5f,
- 0x00001f60, 0x00001f68, 0x00001f68,
- 0x00001f61, 0x00001f69, 0x00001f69,
- 0x00001f62, 0x00001f6a, 0x00001f6a,
- 0x00001f63, 0x00001f6b, 0x00001f6b,
- 0x00001f64, 0x00001f6c, 0x00001f6c,
- 0x00001f65, 0x00001f6d, 0x00001f6d,
- 0x00001f66, 0x00001f6e, 0x00001f6e,
- 0x00001f67, 0x00001f6f, 0x00001f6f,
- 0x00001f70, 0x00001fba, 0x00001fba,
- 0x00001f71, 0x00001fbb, 0x00001fbb,
- 0x00001f72, 0x00001fc8, 0x00001fc8,
- 0x00001f73, 0x00001fc9, 0x00001fc9,
- 0x00001f74, 0x00001fca, 0x00001fca,
- 0x00001f75, 0x00001fcb, 0x00001fcb,
- 0x00001f76, 0x00001fda, 0x00001fda,
- 0x00001f77, 0x00001fdb, 0x00001fdb,
- 0x00001f78, 0x00001ff8, 0x00001ff8,
- 0x00001f79, 0x00001ff9, 0x00001ff9,
- 0x00001f7a, 0x00001fea, 0x00001fea,
- 0x00001f7b, 0x00001feb, 0x00001feb,
- 0x00001f7c, 0x00001ffa, 0x00001ffa,
- 0x00001f7d, 0x00001ffb, 0x00001ffb,
- 0x00001f80, 0x00001f88, 0x00001f88,
- 0x00001f81, 0x00001f89, 0x00001f89,
- 0x00001f82, 0x00001f8a, 0x00001f8a,
- 0x00001f83, 0x00001f8b, 0x00001f8b,
- 0x00001f84, 0x00001f8c, 0x00001f8c,
- 0x00001f85, 0x00001f8d, 0x00001f8d,
- 0x00001f86, 0x00001f8e, 0x00001f8e,
- 0x00001f87, 0x00001f8f, 0x00001f8f,
- 0x00001f90, 0x00001f98, 0x00001f98,
- 0x00001f91, 0x00001f99, 0x00001f99,
- 0x00001f92, 0x00001f9a, 0x00001f9a,
- 0x00001f93, 0x00001f9b, 0x00001f9b,
- 0x00001f94, 0x00001f9c, 0x00001f9c,
- 0x00001f95, 0x00001f9d, 0x00001f9d,
- 0x00001f96, 0x00001f9e, 0x00001f9e,
- 0x00001f97, 0x00001f9f, 0x00001f9f,
- 0x00001fa0, 0x00001fa8, 0x00001fa8,
- 0x00001fa1, 0x00001fa9, 0x00001fa9,
- 0x00001fa2, 0x00001faa, 0x00001faa,
- 0x00001fa3, 0x00001fab, 0x00001fab,
- 0x00001fa4, 0x00001fac, 0x00001fac,
- 0x00001fa5, 0x00001fad, 0x00001fad,
- 0x00001fa6, 0x00001fae, 0x00001fae,
- 0x00001fa7, 0x00001faf, 0x00001faf,
- 0x00001fb0, 0x00001fb8, 0x00001fb8,
- 0x00001fb1, 0x00001fb9, 0x00001fb9,
- 0x00001fb3, 0x00001fbc, 0x00001fbc,
- 0x00001fbe, 0x00000399, 0x00000399,
- 0x00001fc3, 0x00001fcc, 0x00001fcc,
- 0x00001fd0, 0x00001fd8, 0x00001fd8,
- 0x00001fd1, 0x00001fd9, 0x00001fd9,
- 0x00001fe0, 0x00001fe8, 0x00001fe8,
- 0x00001fe1, 0x00001fe9, 0x00001fe9,
- 0x00001fe5, 0x00001fec, 0x00001fec,
- 0x00001ff3, 0x00001ffc, 0x00001ffc,
- 0x0000214e, 0x00002132, 0x00002132,
- 0x00002170, 0x00002160, 0x00002160,
- 0x00002171, 0x00002161, 0x00002161,
- 0x00002172, 0x00002162, 0x00002162,
- 0x00002173, 0x00002163, 0x00002163,
- 0x00002174, 0x00002164, 0x00002164,
- 0x00002175, 0x00002165, 0x00002165,
- 0x00002176, 0x00002166, 0x00002166,
- 0x00002177, 0x00002167, 0x00002167,
- 0x00002178, 0x00002168, 0x00002168,
- 0x00002179, 0x00002169, 0x00002169,
- 0x0000217a, 0x0000216a, 0x0000216a,
- 0x0000217b, 0x0000216b, 0x0000216b,
- 0x0000217c, 0x0000216c, 0x0000216c,
- 0x0000217d, 0x0000216d, 0x0000216d,
- 0x0000217e, 0x0000216e, 0x0000216e,
- 0x0000217f, 0x0000216f, 0x0000216f,
- 0x00002184, 0x00002183, 0x00002183,
- 0x000024d0, 0x000024b6, 0x000024b6,
- 0x000024d1, 0x000024b7, 0x000024b7,
- 0x000024d2, 0x000024b8, 0x000024b8,
- 0x000024d3, 0x000024b9, 0x000024b9,
- 0x000024d4, 0x000024ba, 0x000024ba,
- 0x000024d5, 0x000024bb, 0x000024bb,
- 0x000024d6, 0x000024bc, 0x000024bc,
- 0x000024d7, 0x000024bd, 0x000024bd,
- 0x000024d8, 0x000024be, 0x000024be,
- 0x000024d9, 0x000024bf, 0x000024bf,
- 0x000024da, 0x000024c0, 0x000024c0,
- 0x000024db, 0x000024c1, 0x000024c1,
- 0x000024dc, 0x000024c2, 0x000024c2,
- 0x000024dd, 0x000024c3, 0x000024c3,
- 0x000024de, 0x000024c4, 0x000024c4,
- 0x000024df, 0x000024c5, 0x000024c5,
- 0x000024e0, 0x000024c6, 0x000024c6,
- 0x000024e1, 0x000024c7, 0x000024c7,
- 0x000024e2, 0x000024c8, 0x000024c8,
- 0x000024e3, 0x000024c9, 0x000024c9,
- 0x000024e4, 0x000024ca, 0x000024ca,
- 0x000024e5, 0x000024cb, 0x000024cb,
- 0x000024e6, 0x000024cc, 0x000024cc,
- 0x000024e7, 0x000024cd, 0x000024cd,
- 0x000024e8, 0x000024ce, 0x000024ce,
- 0x000024e9, 0x000024cf, 0x000024cf,
- 0x00002c30, 0x00002c00, 0x00002c00,
- 0x00002c31, 0x00002c01, 0x00002c01,
- 0x00002c32, 0x00002c02, 0x00002c02,
- 0x00002c33, 0x00002c03, 0x00002c03,
- 0x00002c34, 0x00002c04, 0x00002c04,
- 0x00002c35, 0x00002c05, 0x00002c05,
- 0x00002c36, 0x00002c06, 0x00002c06,
- 0x00002c37, 0x00002c07, 0x00002c07,
- 0x00002c38, 0x00002c08, 0x00002c08,
- 0x00002c39, 0x00002c09, 0x00002c09,
- 0x00002c3a, 0x00002c0a, 0x00002c0a,
- 0x00002c3b, 0x00002c0b, 0x00002c0b,
- 0x00002c3c, 0x00002c0c, 0x00002c0c,
- 0x00002c3d, 0x00002c0d, 0x00002c0d,
- 0x00002c3e, 0x00002c0e, 0x00002c0e,
- 0x00002c3f, 0x00002c0f, 0x00002c0f,
- 0x00002c40, 0x00002c10, 0x00002c10,
- 0x00002c41, 0x00002c11, 0x00002c11,
- 0x00002c42, 0x00002c12, 0x00002c12,
- 0x00002c43, 0x00002c13, 0x00002c13,
- 0x00002c44, 0x00002c14, 0x00002c14,
- 0x00002c45, 0x00002c15, 0x00002c15,
- 0x00002c46, 0x00002c16, 0x00002c16,
- 0x00002c47, 0x00002c17, 0x00002c17,
- 0x00002c48, 0x00002c18, 0x00002c18,
- 0x00002c49, 0x00002c19, 0x00002c19,
- 0x00002c4a, 0x00002c1a, 0x00002c1a,
- 0x00002c4b, 0x00002c1b, 0x00002c1b,
- 0x00002c4c, 0x00002c1c, 0x00002c1c,
- 0x00002c4d, 0x00002c1d, 0x00002c1d,
- 0x00002c4e, 0x00002c1e, 0x00002c1e,
- 0x00002c4f, 0x00002c1f, 0x00002c1f,
- 0x00002c50, 0x00002c20, 0x00002c20,
- 0x00002c51, 0x00002c21, 0x00002c21,
- 0x00002c52, 0x00002c22, 0x00002c22,
- 0x00002c53, 0x00002c23, 0x00002c23,
- 0x00002c54, 0x00002c24, 0x00002c24,
- 0x00002c55, 0x00002c25, 0x00002c25,
- 0x00002c56, 0x00002c26, 0x00002c26,
- 0x00002c57, 0x00002c27, 0x00002c27,
- 0x00002c58, 0x00002c28, 0x00002c28,
- 0x00002c59, 0x00002c29, 0x00002c29,
- 0x00002c5a, 0x00002c2a, 0x00002c2a,
- 0x00002c5b, 0x00002c2b, 0x00002c2b,
- 0x00002c5c, 0x00002c2c, 0x00002c2c,
- 0x00002c5d, 0x00002c2d, 0x00002c2d,
- 0x00002c5e, 0x00002c2e, 0x00002c2e,
- 0x00002c61, 0x00002c60, 0x00002c60,
- 0x00002c65, 0x0000023a, 0x0000023a,
- 0x00002c66, 0x0000023e, 0x0000023e,
- 0x00002c68, 0x00002c67, 0x00002c67,
- 0x00002c6a, 0x00002c69, 0x00002c69,
- 0x00002c6c, 0x00002c6b, 0x00002c6b,
- 0x00002c73, 0x00002c72, 0x00002c72,
- 0x00002c76, 0x00002c75, 0x00002c75,
- 0x00002c81, 0x00002c80, 0x00002c80,
- 0x00002c83, 0x00002c82, 0x00002c82,
- 0x00002c85, 0x00002c84, 0x00002c84,
- 0x00002c87, 0x00002c86, 0x00002c86,
- 0x00002c89, 0x00002c88, 0x00002c88,
- 0x00002c8b, 0x00002c8a, 0x00002c8a,
- 0x00002c8d, 0x00002c8c, 0x00002c8c,
- 0x00002c8f, 0x00002c8e, 0x00002c8e,
- 0x00002c91, 0x00002c90, 0x00002c90,
- 0x00002c93, 0x00002c92, 0x00002c92,
- 0x00002c95, 0x00002c94, 0x00002c94,
- 0x00002c97, 0x00002c96, 0x00002c96,
- 0x00002c99, 0x00002c98, 0x00002c98,
- 0x00002c9b, 0x00002c9a, 0x00002c9a,
- 0x00002c9d, 0x00002c9c, 0x00002c9c,
- 0x00002c9f, 0x00002c9e, 0x00002c9e,
- 0x00002ca1, 0x00002ca0, 0x00002ca0,
- 0x00002ca3, 0x00002ca2, 0x00002ca2,
- 0x00002ca5, 0x00002ca4, 0x00002ca4,
- 0x00002ca7, 0x00002ca6, 0x00002ca6,
- 0x00002ca9, 0x00002ca8, 0x00002ca8,
- 0x00002cab, 0x00002caa, 0x00002caa,
- 0x00002cad, 0x00002cac, 0x00002cac,
- 0x00002caf, 0x00002cae, 0x00002cae,
- 0x00002cb1, 0x00002cb0, 0x00002cb0,
- 0x00002cb3, 0x00002cb2, 0x00002cb2,
- 0x00002cb5, 0x00002cb4, 0x00002cb4,
- 0x00002cb7, 0x00002cb6, 0x00002cb6,
- 0x00002cb9, 0x00002cb8, 0x00002cb8,
- 0x00002cbb, 0x00002cba, 0x00002cba,
- 0x00002cbd, 0x00002cbc, 0x00002cbc,
- 0x00002cbf, 0x00002cbe, 0x00002cbe,
- 0x00002cc1, 0x00002cc0, 0x00002cc0,
- 0x00002cc3, 0x00002cc2, 0x00002cc2,
- 0x00002cc5, 0x00002cc4, 0x00002cc4,
- 0x00002cc7, 0x00002cc6, 0x00002cc6,
- 0x00002cc9, 0x00002cc8, 0x00002cc8,
- 0x00002ccb, 0x00002cca, 0x00002cca,
- 0x00002ccd, 0x00002ccc, 0x00002ccc,
- 0x00002ccf, 0x00002cce, 0x00002cce,
- 0x00002cd1, 0x00002cd0, 0x00002cd0,
- 0x00002cd3, 0x00002cd2, 0x00002cd2,
- 0x00002cd5, 0x00002cd4, 0x00002cd4,
- 0x00002cd7, 0x00002cd6, 0x00002cd6,
- 0x00002cd9, 0x00002cd8, 0x00002cd8,
- 0x00002cdb, 0x00002cda, 0x00002cda,
- 0x00002cdd, 0x00002cdc, 0x00002cdc,
- 0x00002cdf, 0x00002cde, 0x00002cde,
- 0x00002ce1, 0x00002ce0, 0x00002ce0,
- 0x00002ce3, 0x00002ce2, 0x00002ce2,
- 0x00002cec, 0x00002ceb, 0x00002ceb,
- 0x00002cee, 0x00002ced, 0x00002ced,
- 0x00002cf3, 0x00002cf2, 0x00002cf2,
- 0x00002d00, 0x000010a0, 0x000010a0,
- 0x00002d01, 0x000010a1, 0x000010a1,
- 0x00002d02, 0x000010a2, 0x000010a2,
- 0x00002d03, 0x000010a3, 0x000010a3,
- 0x00002d04, 0x000010a4, 0x000010a4,
- 0x00002d05, 0x000010a5, 0x000010a5,
- 0x00002d06, 0x000010a6, 0x000010a6,
- 0x00002d07, 0x000010a7, 0x000010a7,
- 0x00002d08, 0x000010a8, 0x000010a8,
- 0x00002d09, 0x000010a9, 0x000010a9,
- 0x00002d0a, 0x000010aa, 0x000010aa,
- 0x00002d0b, 0x000010ab, 0x000010ab,
- 0x00002d0c, 0x000010ac, 0x000010ac,
- 0x00002d0d, 0x000010ad, 0x000010ad,
- 0x00002d0e, 0x000010ae, 0x000010ae,
- 0x00002d0f, 0x000010af, 0x000010af,
- 0x00002d10, 0x000010b0, 0x000010b0,
- 0x00002d11, 0x000010b1, 0x000010b1,
- 0x00002d12, 0x000010b2, 0x000010b2,
- 0x00002d13, 0x000010b3, 0x000010b3,
- 0x00002d14, 0x000010b4, 0x000010b4,
- 0x00002d15, 0x000010b5, 0x000010b5,
- 0x00002d16, 0x000010b6, 0x000010b6,
- 0x00002d17, 0x000010b7, 0x000010b7,
- 0x00002d18, 0x000010b8, 0x000010b8,
- 0x00002d19, 0x000010b9, 0x000010b9,
- 0x00002d1a, 0x000010ba, 0x000010ba,
- 0x00002d1b, 0x000010bb, 0x000010bb,
- 0x00002d1c, 0x000010bc, 0x000010bc,
- 0x00002d1d, 0x000010bd, 0x000010bd,
- 0x00002d1e, 0x000010be, 0x000010be,
- 0x00002d1f, 0x000010bf, 0x000010bf,
- 0x00002d20, 0x000010c0, 0x000010c0,
- 0x00002d21, 0x000010c1, 0x000010c1,
- 0x00002d22, 0x000010c2, 0x000010c2,
- 0x00002d23, 0x000010c3, 0x000010c3,
- 0x00002d24, 0x000010c4, 0x000010c4,
- 0x00002d25, 0x000010c5, 0x000010c5,
- 0x00002d27, 0x000010c7, 0x000010c7,
- 0x00002d2d, 0x000010cd, 0x000010cd,
- 0x0000a641, 0x0000a640, 0x0000a640,
- 0x0000a643, 0x0000a642, 0x0000a642,
- 0x0000a645, 0x0000a644, 0x0000a644,
- 0x0000a647, 0x0000a646, 0x0000a646,
- 0x0000a649, 0x0000a648, 0x0000a648,
- 0x0000a64b, 0x0000a64a, 0x0000a64a,
- 0x0000a64d, 0x0000a64c, 0x0000a64c,
- 0x0000a64f, 0x0000a64e, 0x0000a64e,
- 0x0000a651, 0x0000a650, 0x0000a650,
- 0x0000a653, 0x0000a652, 0x0000a652,
- 0x0000a655, 0x0000a654, 0x0000a654,
- 0x0000a657, 0x0000a656, 0x0000a656,
- 0x0000a659, 0x0000a658, 0x0000a658,
- 0x0000a65b, 0x0000a65a, 0x0000a65a,
- 0x0000a65d, 0x0000a65c, 0x0000a65c,
- 0x0000a65f, 0x0000a65e, 0x0000a65e,
- 0x0000a661, 0x0000a660, 0x0000a660,
- 0x0000a663, 0x0000a662, 0x0000a662,
- 0x0000a665, 0x0000a664, 0x0000a664,
- 0x0000a667, 0x0000a666, 0x0000a666,
- 0x0000a669, 0x0000a668, 0x0000a668,
- 0x0000a66b, 0x0000a66a, 0x0000a66a,
- 0x0000a66d, 0x0000a66c, 0x0000a66c,
- 0x0000a681, 0x0000a680, 0x0000a680,
- 0x0000a683, 0x0000a682, 0x0000a682,
- 0x0000a685, 0x0000a684, 0x0000a684,
- 0x0000a687, 0x0000a686, 0x0000a686,
- 0x0000a689, 0x0000a688, 0x0000a688,
- 0x0000a68b, 0x0000a68a, 0x0000a68a,
- 0x0000a68d, 0x0000a68c, 0x0000a68c,
- 0x0000a68f, 0x0000a68e, 0x0000a68e,
- 0x0000a691, 0x0000a690, 0x0000a690,
- 0x0000a693, 0x0000a692, 0x0000a692,
- 0x0000a695, 0x0000a694, 0x0000a694,
- 0x0000a697, 0x0000a696, 0x0000a696,
- 0x0000a699, 0x0000a698, 0x0000a698,
- 0x0000a69b, 0x0000a69a, 0x0000a69a,
- 0x0000a723, 0x0000a722, 0x0000a722,
- 0x0000a725, 0x0000a724, 0x0000a724,
- 0x0000a727, 0x0000a726, 0x0000a726,
- 0x0000a729, 0x0000a728, 0x0000a728,
- 0x0000a72b, 0x0000a72a, 0x0000a72a,
- 0x0000a72d, 0x0000a72c, 0x0000a72c,
- 0x0000a72f, 0x0000a72e, 0x0000a72e,
- 0x0000a733, 0x0000a732, 0x0000a732,
- 0x0000a735, 0x0000a734, 0x0000a734,
- 0x0000a737, 0x0000a736, 0x0000a736,
- 0x0000a739, 0x0000a738, 0x0000a738,
- 0x0000a73b, 0x0000a73a, 0x0000a73a,
- 0x0000a73d, 0x0000a73c, 0x0000a73c,
- 0x0000a73f, 0x0000a73e, 0x0000a73e,
- 0x0000a741, 0x0000a740, 0x0000a740,
- 0x0000a743, 0x0000a742, 0x0000a742,
- 0x0000a745, 0x0000a744, 0x0000a744,
- 0x0000a747, 0x0000a746, 0x0000a746,
- 0x0000a749, 0x0000a748, 0x0000a748,
- 0x0000a74b, 0x0000a74a, 0x0000a74a,
- 0x0000a74d, 0x0000a74c, 0x0000a74c,
- 0x0000a74f, 0x0000a74e, 0x0000a74e,
- 0x0000a751, 0x0000a750, 0x0000a750,
- 0x0000a753, 0x0000a752, 0x0000a752,
- 0x0000a755, 0x0000a754, 0x0000a754,
- 0x0000a757, 0x0000a756, 0x0000a756,
- 0x0000a759, 0x0000a758, 0x0000a758,
- 0x0000a75b, 0x0000a75a, 0x0000a75a,
- 0x0000a75d, 0x0000a75c, 0x0000a75c,
- 0x0000a75f, 0x0000a75e, 0x0000a75e,
- 0x0000a761, 0x0000a760, 0x0000a760,
- 0x0000a763, 0x0000a762, 0x0000a762,
- 0x0000a765, 0x0000a764, 0x0000a764,
- 0x0000a767, 0x0000a766, 0x0000a766,
- 0x0000a769, 0x0000a768, 0x0000a768,
- 0x0000a76b, 0x0000a76a, 0x0000a76a,
- 0x0000a76d, 0x0000a76c, 0x0000a76c,
- 0x0000a76f, 0x0000a76e, 0x0000a76e,
- 0x0000a77a, 0x0000a779, 0x0000a779,
- 0x0000a77c, 0x0000a77b, 0x0000a77b,
- 0x0000a77f, 0x0000a77e, 0x0000a77e,
- 0x0000a781, 0x0000a780, 0x0000a780,
- 0x0000a783, 0x0000a782, 0x0000a782,
- 0x0000a785, 0x0000a784, 0x0000a784,
- 0x0000a787, 0x0000a786, 0x0000a786,
- 0x0000a78c, 0x0000a78b, 0x0000a78b,
- 0x0000a791, 0x0000a790, 0x0000a790,
- 0x0000a793, 0x0000a792, 0x0000a792,
- 0x0000a797, 0x0000a796, 0x0000a796,
- 0x0000a799, 0x0000a798, 0x0000a798,
- 0x0000a79b, 0x0000a79a, 0x0000a79a,
- 0x0000a79d, 0x0000a79c, 0x0000a79c,
- 0x0000a79f, 0x0000a79e, 0x0000a79e,
- 0x0000a7a1, 0x0000a7a0, 0x0000a7a0,
- 0x0000a7a3, 0x0000a7a2, 0x0000a7a2,
- 0x0000a7a5, 0x0000a7a4, 0x0000a7a4,
- 0x0000a7a7, 0x0000a7a6, 0x0000a7a6,
- 0x0000a7a9, 0x0000a7a8, 0x0000a7a8,
- 0x0000a7b5, 0x0000a7b4, 0x0000a7b4,
- 0x0000a7b7, 0x0000a7b6, 0x0000a7b6,
- 0x0000ab53, 0x0000a7b3, 0x0000a7b3,
- 0x0000ab70, 0x000013a0, 0x000013a0,
- 0x0000ab71, 0x000013a1, 0x000013a1,
- 0x0000ab72, 0x000013a2, 0x000013a2,
- 0x0000ab73, 0x000013a3, 0x000013a3,
- 0x0000ab74, 0x000013a4, 0x000013a4,
- 0x0000ab75, 0x000013a5, 0x000013a5,
- 0x0000ab76, 0x000013a6, 0x000013a6,
- 0x0000ab77, 0x000013a7, 0x000013a7,
- 0x0000ab78, 0x000013a8, 0x000013a8,
- 0x0000ab79, 0x000013a9, 0x000013a9,
- 0x0000ab7a, 0x000013aa, 0x000013aa,
- 0x0000ab7b, 0x000013ab, 0x000013ab,
- 0x0000ab7c, 0x000013ac, 0x000013ac,
- 0x0000ab7d, 0x000013ad, 0x000013ad,
- 0x0000ab7e, 0x000013ae, 0x000013ae,
- 0x0000ab7f, 0x000013af, 0x000013af,
- 0x0000ab80, 0x000013b0, 0x000013b0,
- 0x0000ab81, 0x000013b1, 0x000013b1,
- 0x0000ab82, 0x000013b2, 0x000013b2,
- 0x0000ab83, 0x000013b3, 0x000013b3,
- 0x0000ab84, 0x000013b4, 0x000013b4,
- 0x0000ab85, 0x000013b5, 0x000013b5,
- 0x0000ab86, 0x000013b6, 0x000013b6,
- 0x0000ab87, 0x000013b7, 0x000013b7,
- 0x0000ab88, 0x000013b8, 0x000013b8,
- 0x0000ab89, 0x000013b9, 0x000013b9,
- 0x0000ab8a, 0x000013ba, 0x000013ba,
- 0x0000ab8b, 0x000013bb, 0x000013bb,
- 0x0000ab8c, 0x000013bc, 0x000013bc,
- 0x0000ab8d, 0x000013bd, 0x000013bd,
- 0x0000ab8e, 0x000013be, 0x000013be,
- 0x0000ab8f, 0x000013bf, 0x000013bf,
- 0x0000ab90, 0x000013c0, 0x000013c0,
- 0x0000ab91, 0x000013c1, 0x000013c1,
- 0x0000ab92, 0x000013c2, 0x000013c2,
- 0x0000ab93, 0x000013c3, 0x000013c3,
- 0x0000ab94, 0x000013c4, 0x000013c4,
- 0x0000ab95, 0x000013c5, 0x000013c5,
- 0x0000ab96, 0x000013c6, 0x000013c6,
- 0x0000ab97, 0x000013c7, 0x000013c7,
- 0x0000ab98, 0x000013c8, 0x000013c8,
- 0x0000ab99, 0x000013c9, 0x000013c9,
- 0x0000ab9a, 0x000013ca, 0x000013ca,
- 0x0000ab9b, 0x000013cb, 0x000013cb,
- 0x0000ab9c, 0x000013cc, 0x000013cc,
- 0x0000ab9d, 0x000013cd, 0x000013cd,
- 0x0000ab9e, 0x000013ce, 0x000013ce,
- 0x0000ab9f, 0x000013cf, 0x000013cf,
- 0x0000aba0, 0x000013d0, 0x000013d0,
- 0x0000aba1, 0x000013d1, 0x000013d1,
- 0x0000aba2, 0x000013d2, 0x000013d2,
- 0x0000aba3, 0x000013d3, 0x000013d3,
- 0x0000aba4, 0x000013d4, 0x000013d4,
- 0x0000aba5, 0x000013d5, 0x000013d5,
- 0x0000aba6, 0x000013d6, 0x000013d6,
- 0x0000aba7, 0x000013d7, 0x000013d7,
- 0x0000aba8, 0x000013d8, 0x000013d8,
- 0x0000aba9, 0x000013d9, 0x000013d9,
- 0x0000abaa, 0x000013da, 0x000013da,
- 0x0000abab, 0x000013db, 0x000013db,
- 0x0000abac, 0x000013dc, 0x000013dc,
- 0x0000abad, 0x000013dd, 0x000013dd,
- 0x0000abae, 0x000013de, 0x000013de,
- 0x0000abaf, 0x000013df, 0x000013df,
- 0x0000abb0, 0x000013e0, 0x000013e0,
- 0x0000abb1, 0x000013e1, 0x000013e1,
- 0x0000abb2, 0x000013e2, 0x000013e2,
- 0x0000abb3, 0x000013e3, 0x000013e3,
- 0x0000abb4, 0x000013e4, 0x000013e4,
- 0x0000abb5, 0x000013e5, 0x000013e5,
- 0x0000abb6, 0x000013e6, 0x000013e6,
- 0x0000abb7, 0x000013e7, 0x000013e7,
- 0x0000abb8, 0x000013e8, 0x000013e8,
- 0x0000abb9, 0x000013e9, 0x000013e9,
- 0x0000abba, 0x000013ea, 0x000013ea,
- 0x0000abbb, 0x000013eb, 0x000013eb,
- 0x0000abbc, 0x000013ec, 0x000013ec,
- 0x0000abbd, 0x000013ed, 0x000013ed,
- 0x0000abbe, 0x000013ee, 0x000013ee,
- 0x0000abbf, 0x000013ef, 0x000013ef,
- 0x0000ff41, 0x0000ff21, 0x0000ff21,
- 0x0000ff42, 0x0000ff22, 0x0000ff22,
- 0x0000ff43, 0x0000ff23, 0x0000ff23,
- 0x0000ff44, 0x0000ff24, 0x0000ff24,
- 0x0000ff45, 0x0000ff25, 0x0000ff25,
- 0x0000ff46, 0x0000ff26, 0x0000ff26,
- 0x0000ff47, 0x0000ff27, 0x0000ff27,
- 0x0000ff48, 0x0000ff28, 0x0000ff28,
- 0x0000ff49, 0x0000ff29, 0x0000ff29,
- 0x0000ff4a, 0x0000ff2a, 0x0000ff2a,
- 0x0000ff4b, 0x0000ff2b, 0x0000ff2b,
- 0x0000ff4c, 0x0000ff2c, 0x0000ff2c,
- 0x0000ff4d, 0x0000ff2d, 0x0000ff2d,
- 0x0000ff4e, 0x0000ff2e, 0x0000ff2e,
- 0x0000ff4f, 0x0000ff2f, 0x0000ff2f,
- 0x0000ff50, 0x0000ff30, 0x0000ff30,
- 0x0000ff51, 0x0000ff31, 0x0000ff31,
- 0x0000ff52, 0x0000ff32, 0x0000ff32,
- 0x0000ff53, 0x0000ff33, 0x0000ff33,
- 0x0000ff54, 0x0000ff34, 0x0000ff34,
- 0x0000ff55, 0x0000ff35, 0x0000ff35,
- 0x0000ff56, 0x0000ff36, 0x0000ff36,
- 0x0000ff57, 0x0000ff37, 0x0000ff37,
- 0x0000ff58, 0x0000ff38, 0x0000ff38,
- 0x0000ff59, 0x0000ff39, 0x0000ff39,
- 0x0000ff5a, 0x0000ff3a, 0x0000ff3a,
- 0x00010428, 0x00010400, 0x00010400,
- 0x00010429, 0x00010401, 0x00010401,
- 0x0001042a, 0x00010402, 0x00010402,
- 0x0001042b, 0x00010403, 0x00010403,
- 0x0001042c, 0x00010404, 0x00010404,
- 0x0001042d, 0x00010405, 0x00010405,
- 0x0001042e, 0x00010406, 0x00010406,
- 0x0001042f, 0x00010407, 0x00010407,
- 0x00010430, 0x00010408, 0x00010408,
- 0x00010431, 0x00010409, 0x00010409,
- 0x00010432, 0x0001040a, 0x0001040a,
- 0x00010433, 0x0001040b, 0x0001040b,
- 0x00010434, 0x0001040c, 0x0001040c,
- 0x00010435, 0x0001040d, 0x0001040d,
- 0x00010436, 0x0001040e, 0x0001040e,
- 0x00010437, 0x0001040f, 0x0001040f,
- 0x00010438, 0x00010410, 0x00010410,
- 0x00010439, 0x00010411, 0x00010411,
- 0x0001043a, 0x00010412, 0x00010412,
- 0x0001043b, 0x00010413, 0x00010413,
- 0x0001043c, 0x00010414, 0x00010414,
- 0x0001043d, 0x00010415, 0x00010415,
- 0x0001043e, 0x00010416, 0x00010416,
- 0x0001043f, 0x00010417, 0x00010417,
- 0x00010440, 0x00010418, 0x00010418,
- 0x00010441, 0x00010419, 0x00010419,
- 0x00010442, 0x0001041a, 0x0001041a,
- 0x00010443, 0x0001041b, 0x0001041b,
- 0x00010444, 0x0001041c, 0x0001041c,
- 0x00010445, 0x0001041d, 0x0001041d,
- 0x00010446, 0x0001041e, 0x0001041e,
- 0x00010447, 0x0001041f, 0x0001041f,
- 0x00010448, 0x00010420, 0x00010420,
- 0x00010449, 0x00010421, 0x00010421,
- 0x0001044a, 0x00010422, 0x00010422,
- 0x0001044b, 0x00010423, 0x00010423,
- 0x0001044c, 0x00010424, 0x00010424,
- 0x0001044d, 0x00010425, 0x00010425,
- 0x0001044e, 0x00010426, 0x00010426,
- 0x0001044f, 0x00010427, 0x00010427,
- 0x000104d8, 0x000104b0, 0x000104b0,
- 0x000104d9, 0x000104b1, 0x000104b1,
- 0x000104da, 0x000104b2, 0x000104b2,
- 0x000104db, 0x000104b3, 0x000104b3,
- 0x000104dc, 0x000104b4, 0x000104b4,
- 0x000104dd, 0x000104b5, 0x000104b5,
- 0x000104de, 0x000104b6, 0x000104b6,
- 0x000104df, 0x000104b7, 0x000104b7,
- 0x000104e0, 0x000104b8, 0x000104b8,
- 0x000104e1, 0x000104b9, 0x000104b9,
- 0x000104e2, 0x000104ba, 0x000104ba,
- 0x000104e3, 0x000104bb, 0x000104bb,
- 0x000104e4, 0x000104bc, 0x000104bc,
- 0x000104e5, 0x000104bd, 0x000104bd,
- 0x000104e6, 0x000104be, 0x000104be,
- 0x000104e7, 0x000104bf, 0x000104bf,
- 0x000104e8, 0x000104c0, 0x000104c0,
- 0x000104e9, 0x000104c1, 0x000104c1,
- 0x000104ea, 0x000104c2, 0x000104c2,
- 0x000104eb, 0x000104c3, 0x000104c3,
- 0x000104ec, 0x000104c4, 0x000104c4,
- 0x000104ed, 0x000104c5, 0x000104c5,
- 0x000104ee, 0x000104c6, 0x000104c6,
- 0x000104ef, 0x000104c7, 0x000104c7,
- 0x000104f0, 0x000104c8, 0x000104c8,
- 0x000104f1, 0x000104c9, 0x000104c9,
- 0x000104f2, 0x000104ca, 0x000104ca,
- 0x000104f3, 0x000104cb, 0x000104cb,
- 0x000104f4, 0x000104cc, 0x000104cc,
- 0x000104f5, 0x000104cd, 0x000104cd,
- 0x000104f6, 0x000104ce, 0x000104ce,
- 0x000104f7, 0x000104cf, 0x000104cf,
- 0x000104f8, 0x000104d0, 0x000104d0,
- 0x000104f9, 0x000104d1, 0x000104d1,
- 0x000104fa, 0x000104d2, 0x000104d2,
- 0x000104fb, 0x000104d3, 0x000104d3,
- 0x00010cc0, 0x00010c80, 0x00010c80,
- 0x00010cc1, 0x00010c81, 0x00010c81,
- 0x00010cc2, 0x00010c82, 0x00010c82,
- 0x00010cc3, 0x00010c83, 0x00010c83,
- 0x00010cc4, 0x00010c84, 0x00010c84,
- 0x00010cc5, 0x00010c85, 0x00010c85,
- 0x00010cc6, 0x00010c86, 0x00010c86,
- 0x00010cc7, 0x00010c87, 0x00010c87,
- 0x00010cc8, 0x00010c88, 0x00010c88,
- 0x00010cc9, 0x00010c89, 0x00010c89,
- 0x00010cca, 0x00010c8a, 0x00010c8a,
- 0x00010ccb, 0x00010c8b, 0x00010c8b,
- 0x00010ccc, 0x00010c8c, 0x00010c8c,
- 0x00010ccd, 0x00010c8d, 0x00010c8d,
- 0x00010cce, 0x00010c8e, 0x00010c8e,
- 0x00010ccf, 0x00010c8f, 0x00010c8f,
- 0x00010cd0, 0x00010c90, 0x00010c90,
- 0x00010cd1, 0x00010c91, 0x00010c91,
- 0x00010cd2, 0x00010c92, 0x00010c92,
- 0x00010cd3, 0x00010c93, 0x00010c93,
- 0x00010cd4, 0x00010c94, 0x00010c94,
- 0x00010cd5, 0x00010c95, 0x00010c95,
- 0x00010cd6, 0x00010c96, 0x00010c96,
- 0x00010cd7, 0x00010c97, 0x00010c97,
- 0x00010cd8, 0x00010c98, 0x00010c98,
- 0x00010cd9, 0x00010c99, 0x00010c99,
- 0x00010cda, 0x00010c9a, 0x00010c9a,
- 0x00010cdb, 0x00010c9b, 0x00010c9b,
- 0x00010cdc, 0x00010c9c, 0x00010c9c,
- 0x00010cdd, 0x00010c9d, 0x00010c9d,
- 0x00010cde, 0x00010c9e, 0x00010c9e,
- 0x00010cdf, 0x00010c9f, 0x00010c9f,
- 0x00010ce0, 0x00010ca0, 0x00010ca0,
- 0x00010ce1, 0x00010ca1, 0x00010ca1,
- 0x00010ce2, 0x00010ca2, 0x00010ca2,
- 0x00010ce3, 0x00010ca3, 0x00010ca3,
- 0x00010ce4, 0x00010ca4, 0x00010ca4,
- 0x00010ce5, 0x00010ca5, 0x00010ca5,
- 0x00010ce6, 0x00010ca6, 0x00010ca6,
- 0x00010ce7, 0x00010ca7, 0x00010ca7,
- 0x00010ce8, 0x00010ca8, 0x00010ca8,
- 0x00010ce9, 0x00010ca9, 0x00010ca9,
- 0x00010cea, 0x00010caa, 0x00010caa,
- 0x00010ceb, 0x00010cab, 0x00010cab,
- 0x00010cec, 0x00010cac, 0x00010cac,
- 0x00010ced, 0x00010cad, 0x00010cad,
- 0x00010cee, 0x00010cae, 0x00010cae,
- 0x00010cef, 0x00010caf, 0x00010caf,
- 0x00010cf0, 0x00010cb0, 0x00010cb0,
- 0x00010cf1, 0x00010cb1, 0x00010cb1,
- 0x00010cf2, 0x00010cb2, 0x00010cb2,
- 0x000118c0, 0x000118a0, 0x000118a0,
- 0x000118c1, 0x000118a1, 0x000118a1,
- 0x000118c2, 0x000118a2, 0x000118a2,
- 0x000118c3, 0x000118a3, 0x000118a3,
- 0x000118c4, 0x000118a4, 0x000118a4,
- 0x000118c5, 0x000118a5, 0x000118a5,
- 0x000118c6, 0x000118a6, 0x000118a6,
- 0x000118c7, 0x000118a7, 0x000118a7,
- 0x000118c8, 0x000118a8, 0x000118a8,
- 0x000118c9, 0x000118a9, 0x000118a9,
- 0x000118ca, 0x000118aa, 0x000118aa,
- 0x000118cb, 0x000118ab, 0x000118ab,
- 0x000118cc, 0x000118ac, 0x000118ac,
- 0x000118cd, 0x000118ad, 0x000118ad,
- 0x000118ce, 0x000118ae, 0x000118ae,
- 0x000118cf, 0x000118af, 0x000118af,
- 0x000118d0, 0x000118b0, 0x000118b0,
- 0x000118d1, 0x000118b1, 0x000118b1,
- 0x000118d2, 0x000118b2, 0x000118b2,
- 0x000118d3, 0x000118b3, 0x000118b3,
- 0x000118d4, 0x000118b4, 0x000118b4,
- 0x000118d5, 0x000118b5, 0x000118b5,
- 0x000118d6, 0x000118b6, 0x000118b6,
- 0x000118d7, 0x000118b7, 0x000118b7,
- 0x000118d8, 0x000118b8, 0x000118b8,
- 0x000118d9, 0x000118b9, 0x000118b9,
- 0x000118da, 0x000118ba, 0x000118ba,
- 0x000118db, 0x000118bb, 0x000118bb,
- 0x000118dc, 0x000118bc, 0x000118bc,
- 0x000118dd, 0x000118bd, 0x000118bd,
- 0x000118de, 0x000118be, 0x000118be,
- 0x000118df, 0x000118bf, 0x000118bf,
- 0x0001e922, 0x0001e900, 0x0001e900,
- 0x0001e923, 0x0001e901, 0x0001e901,
- 0x0001e924, 0x0001e902, 0x0001e902,
- 0x0001e925, 0x0001e903, 0x0001e903,
- 0x0001e926, 0x0001e904, 0x0001e904,
- 0x0001e927, 0x0001e905, 0x0001e905,
- 0x0001e928, 0x0001e906, 0x0001e906,
- 0x0001e929, 0x0001e907, 0x0001e907,
- 0x0001e92a, 0x0001e908, 0x0001e908,
- 0x0001e92b, 0x0001e909, 0x0001e909,
- 0x0001e92c, 0x0001e90a, 0x0001e90a,
- 0x0001e92d, 0x0001e90b, 0x0001e90b,
- 0x0001e92e, 0x0001e90c, 0x0001e90c,
- 0x0001e92f, 0x0001e90d, 0x0001e90d,
- 0x0001e930, 0x0001e90e, 0x0001e90e,
- 0x0001e931, 0x0001e90f, 0x0001e90f,
- 0x0001e932, 0x0001e910, 0x0001e910,
- 0x0001e933, 0x0001e911, 0x0001e911,
- 0x0001e934, 0x0001e912, 0x0001e912,
- 0x0001e935, 0x0001e913, 0x0001e913,
- 0x0001e936, 0x0001e914, 0x0001e914,
- 0x0001e937, 0x0001e915, 0x0001e915,
- 0x0001e938, 0x0001e916, 0x0001e916,
- 0x0001e939, 0x0001e917, 0x0001e917,
- 0x0001e93a, 0x0001e918, 0x0001e918,
- 0x0001e93b, 0x0001e919, 0x0001e919,
- 0x0001e93c, 0x0001e91a, 0x0001e91a,
- 0x0001e93d, 0x0001e91b, 0x0001e91b,
- 0x0001e93e, 0x0001e91c, 0x0001e91c,
- 0x0001e93f, 0x0001e91d, 0x0001e91d,
- 0x0001e940, 0x0001e91e, 0x0001e91e,
- 0x0001e941, 0x0001e91f, 0x0001e91f,
- 0x0001e942, 0x0001e920, 0x0001e920,
- 0x0001e943, 0x0001e921, 0x0001e921,
- 0x000001c5, 0x000001c4, 0x000001c6,
- 0x000001c8, 0x000001c7, 0x000001c9,
- 0x000001cb, 0x000001ca, 0x000001cc,
- 0x000001f2, 0x000001f1, 0x000001f3,
- 0x00001f88, 0x00001f88, 0x00001f80,
- 0x00001f89, 0x00001f89, 0x00001f81,
- 0x00001f8a, 0x00001f8a, 0x00001f82,
- 0x00001f8b, 0x00001f8b, 0x00001f83,
- 0x00001f8c, 0x00001f8c, 0x00001f84,
- 0x00001f8d, 0x00001f8d, 0x00001f85,
- 0x00001f8e, 0x00001f8e, 0x00001f86,
- 0x00001f8f, 0x00001f8f, 0x00001f87,
- 0x00001f98, 0x00001f98, 0x00001f90,
- 0x00001f99, 0x00001f99, 0x00001f91,
- 0x00001f9a, 0x00001f9a, 0x00001f92,
- 0x00001f9b, 0x00001f9b, 0x00001f93,
- 0x00001f9c, 0x00001f9c, 0x00001f94,
- 0x00001f9d, 0x00001f9d, 0x00001f95,
- 0x00001f9e, 0x00001f9e, 0x00001f96,
- 0x00001f9f, 0x00001f9f, 0x00001f97,
- 0x00001fa8, 0x00001fa8, 0x00001fa0,
- 0x00001fa9, 0x00001fa9, 0x00001fa1,
- 0x00001faa, 0x00001faa, 0x00001fa2,
- 0x00001fab, 0x00001fab, 0x00001fa3,
- 0x00001fac, 0x00001fac, 0x00001fa4,
- 0x00001fad, 0x00001fad, 0x00001fa5,
- 0x00001fae, 0x00001fae, 0x00001fa6,
- 0x00001faf, 0x00001faf, 0x00001fa7,
- 0x00001fbc, 0x00001fbc, 0x00001fb3,
- 0x00001fcc, 0x00001fcc, 0x00001fc3,
- 0x00001ffc, 0x00001ffc, 0x00001ff3
+static const unsigned _uccase_extra_table[] = {
+ 0x00001f88, 0x00001f08, 0x00000399, 0x00001f89,
+ 0x00001f09, 0x00000399, 0x00001f8a, 0x00001f0a,
+ 0x00000399, 0x00001f8b, 0x00001f0b, 0x00000399,
+ 0x00001f8c, 0x00001f0c, 0x00000399, 0x00001f8d,
+ 0x00001f0d, 0x00000399, 0x00001f8e, 0x00001f0e,
+ 0x00000399, 0x00001f8f, 0x00001f0f, 0x00000399,
+ 0x00001f98, 0x00001f28, 0x00000399, 0x00001f99,
+ 0x00001f29, 0x00000399, 0x00001f9a, 0x00001f2a,
+ 0x00000399, 0x00001f9b, 0x00001f2b, 0x00000399,
+ 0x00001f9c, 0x00001f2c, 0x00000399, 0x00001f9d,
+ 0x00001f2d, 0x00000399, 0x00001f9e, 0x00001f2e,
+ 0x00000399, 0x00001f9f, 0x00001f2f, 0x00000399,
+ 0x00001fa8, 0x00001f68, 0x00000399, 0x00001fa9,
+ 0x00001f69, 0x00000399, 0x00001faa, 0x00001f6a,
+ 0x00000399, 0x00001fab, 0x00001f6b, 0x00000399,
+ 0x00001fac, 0x00001f6c, 0x00000399, 0x00001fad,
+ 0x00001f6d, 0x00000399, 0x00001fae, 0x00001f6e,
+ 0x00000399, 0x00001faf, 0x00001f6f, 0x00000399,
+ 0x00001fbc, 0x00000391, 0x00000399, 0x00001fcc,
+ 0x00000397, 0x00000399, 0x00001ffc, 0x000003a9,
+ 0x00000399, 0x000000df, 0x00000053, 0x00000053,
+ 0x0000fb00, 0x00000046, 0x00000046, 0x0000fb01,
+ 0x00000046, 0x00000049, 0x0000fb02, 0x00000046,
+ 0x0000004c, 0x0000fb03, 0x00000046, 0x00000046,
+ 0x00000049, 0x0000fb04, 0x00000046, 0x00000046,
+ 0x0000004c, 0x0000fb05, 0x00000053, 0x00000054,
+ 0x0000fb06, 0x00000053, 0x00000054, 0x00000587,
+ 0x00000535, 0x00000552, 0x0000fb13, 0x00000544,
+ 0x00000546, 0x0000fb14, 0x00000544, 0x00000535,
+ 0x0000fb15, 0x00000544, 0x0000053b, 0x0000fb16,
+ 0x0000054e, 0x00000546, 0x0000fb17, 0x00000544,
+ 0x0000053d, 0x00000149, 0x000002bc, 0x0000004e,
+ 0x00000390, 0x00000399, 0x00000308, 0x00000301,
+ 0x000003b0, 0x000003a5, 0x00000308, 0x00000301,
+ 0x000001f0, 0x0000004a, 0x0000030c, 0x00001e96,
+ 0x00000048, 0x00000331, 0x00001e97, 0x00000054,
+ 0x00000308, 0x00001e98, 0x00000057, 0x0000030a,
+ 0x00001e99, 0x00000059, 0x0000030a, 0x00001e9a,
+ 0x00000041, 0x000002be, 0x00001f50, 0x000003a5,
+ 0x00000313, 0x00001f52, 0x000003a5, 0x00000313,
+ 0x00000300, 0x00001f54, 0x000003a5, 0x00000313,
+ 0x00000301, 0x00001f56, 0x000003a5, 0x00000313,
+ 0x00000342, 0x00001fb6, 0x00000391, 0x00000342,
+ 0x00001fc6, 0x00000397, 0x00000342, 0x00001fd2,
+ 0x00000399, 0x00000308, 0x00000300, 0x00001fd3,
+ 0x00000399, 0x00000308, 0x00000301, 0x00001fd6,
+ 0x00000399, 0x00000342, 0x00001fd7, 0x00000399,
+ 0x00000308, 0x00000342, 0x00001fe2, 0x000003a5,
+ 0x00000308, 0x00000300, 0x00001fe3, 0x000003a5,
+ 0x00000308, 0x00000301, 0x00001fe4, 0x000003a1,
+ 0x00000313, 0x00001fe6, 0x000003a5, 0x00000342,
+ 0x00001fe7, 0x000003a5, 0x00000308, 0x00000342,
+ 0x00001ff6, 0x000003a9, 0x00000342, 0x00001f88,
+ 0x00001f08, 0x00000399, 0x00001f89, 0x00001f09,
+ 0x00000399, 0x00001f8a, 0x00001f0a, 0x00000399,
+ 0x00001f8b, 0x00001f0b, 0x00000399, 0x00001f8c,
+ 0x00001f0c, 0x00000399, 0x00001f8d, 0x00001f0d,
+ 0x00000399, 0x00001f8e, 0x00001f0e, 0x00000399,
+ 0x00001f8f, 0x00001f0f, 0x00000399, 0x00001f98,
+ 0x00001f28, 0x00000399, 0x00001f99, 0x00001f29,
+ 0x00000399, 0x00001f9a, 0x00001f2a, 0x00000399,
+ 0x00001f9b, 0x00001f2b, 0x00000399, 0x00001f9c,
+ 0x00001f2c, 0x00000399, 0x00001f9d, 0x00001f2d,
+ 0x00000399, 0x00001f9e, 0x00001f2e, 0x00000399,
+ 0x00001f9f, 0x00001f2f, 0x00000399, 0x00001fa8,
+ 0x00001f68, 0x00000399, 0x00001fa9, 0x00001f69,
+ 0x00000399, 0x00001faa, 0x00001f6a, 0x00000399,
+ 0x00001fab, 0x00001f6b, 0x00000399, 0x00001fac,
+ 0x00001f6c, 0x00000399, 0x00001fad, 0x00001f6d,
+ 0x00000399, 0x00001fae, 0x00001f6e, 0x00000399,
+ 0x00001faf, 0x00001f6f, 0x00000399, 0x00001fbc,
+ 0x00000391, 0x00000399, 0x00001fcc, 0x00000397,
+ 0x00000399, 0x00001ffc, 0x000003a9, 0x00000399,
+ 0x00001fb2, 0x00001fba, 0x00000399, 0x00001fb4,
+ 0x00000386, 0x00000399, 0x00001fc2, 0x00001fca,
+ 0x00000399, 0x00001fc4, 0x00000389, 0x00000399,
+ 0x00001ff2, 0x00001ffa, 0x00000399, 0x00001ff4,
+ 0x0000038f, 0x00000399, 0x00001fb7, 0x00000391,
+ 0x00000342, 0x00000399, 0x00001fc7, 0x00000397,
+ 0x00000342, 0x00000399, 0x00001ff7, 0x000003a9,
+ 0x00000342, 0x00000399, 0x00000069, 0x00000069,
+ 0x00000307, 0x000000df, 0x00000053, 0x00000073,
+ 0x0000fb00, 0x00000046, 0x00000066, 0x0000fb01,
+ 0x00000046, 0x00000069, 0x0000fb02, 0x00000046,
+ 0x0000006c, 0x0000fb03, 0x00000046, 0x00000066,
+ 0x00000069, 0x0000fb04, 0x00000046, 0x00000066,
+ 0x0000006c, 0x0000fb05, 0x00000053, 0x00000074,
+ 0x0000fb06, 0x00000053, 0x00000074, 0x00000587,
+ 0x00000535, 0x00000582, 0x0000fb13, 0x00000544,
+ 0x00000576, 0x0000fb14, 0x00000544, 0x00000565,
+ 0x0000fb15, 0x00000544, 0x0000056b, 0x0000fb16,
+ 0x0000054e, 0x00000576, 0x0000fb17, 0x00000544,
+ 0x0000056d, 0x00001fb2, 0x00001fba, 0x00000345,
+ 0x00001fb4, 0x00000386, 0x00000345, 0x00001fc2,
+ 0x00001fca, 0x00000345, 0x00001fc4, 0x00000389,
+ 0x00000345, 0x00001ff2, 0x00001ffa, 0x00000345,
+ 0x00001ff4, 0x0000038f, 0x00000345, 0x00001fb7,
+ 0x00000391, 0x00000342, 0x00000345, 0x00001fc7,
+ 0x00000397, 0x00000342, 0x00000345, 0x00001ff7,
+ 0x000003a9, 0x00000342, 0x00000345, 0x000000df,
+ 0x00000073, 0x00000073, 0x00000130, 0x00000069,
+ 0x00000307, 0x00000149, 0x000002bc, 0x0000006e,
+ 0x000001f0, 0x0000006a, 0x0000030c, 0x00000390,
+ 0x000003b9, 0x00000308, 0x00000301, 0x000003b0,
+ 0x000003c5, 0x00000308, 0x00000301, 0x00000587,
+ 0x00000565, 0x00000582, 0x00001e96, 0x00000068,
+ 0x00000331, 0x00001e97, 0x00000074, 0x00000308,
+ 0x00001e98, 0x00000077, 0x0000030a, 0x00001e99,
+ 0x00000079, 0x0000030a, 0x00001e9a, 0x00000061,
+ 0x000002be, 0x000000df, 0x00000073, 0x00000073,
+ 0x00001f50, 0x000003c5, 0x00000313, 0x00001f52,
+ 0x000003c5, 0x00000313, 0x00000300, 0x00001f54,
+ 0x000003c5, 0x00000313, 0x00000301, 0x00001f56,
+ 0x000003c5, 0x00000313, 0x00000342, 0x00001f80,
+ 0x00001f00, 0x000003b9, 0x00001f81, 0x00001f01,
+ 0x000003b9, 0x00001f82, 0x00001f02, 0x000003b9,
+ 0x00001f83, 0x00001f03, 0x000003b9, 0x00001f84,
+ 0x00001f04, 0x000003b9, 0x00001f85, 0x00001f05,
+ 0x000003b9, 0x00001f86, 0x00001f06, 0x000003b9,
+ 0x00001f87, 0x00001f07, 0x000003b9, 0x00001f80,
+ 0x00001f00, 0x000003b9, 0x00001f81, 0x00001f01,
+ 0x000003b9, 0x00001f82, 0x00001f02, 0x000003b9,
+ 0x00001f83, 0x00001f03, 0x000003b9, 0x00001f84,
+ 0x00001f04, 0x000003b9, 0x00001f85, 0x00001f05,
+ 0x000003b9, 0x00001f86, 0x00001f06, 0x000003b9,
+ 0x00001f87, 0x00001f07, 0x000003b9, 0x00001f90,
+ 0x00001f20, 0x000003b9, 0x00001f91, 0x00001f21,
+ 0x000003b9, 0x00001f92, 0x00001f22, 0x000003b9,
+ 0x00001f93, 0x00001f23, 0x000003b9, 0x00001f94,
+ 0x00001f24, 0x000003b9, 0x00001f95, 0x00001f25,
+ 0x000003b9, 0x00001f96, 0x00001f26, 0x000003b9,
+ 0x00001f97, 0x00001f27, 0x000003b9, 0x00001f90,
+ 0x00001f20, 0x000003b9, 0x00001f91, 0x00001f21,
+ 0x000003b9, 0x00001f92, 0x00001f22, 0x000003b9,
+ 0x00001f93, 0x00001f23, 0x000003b9, 0x00001f94,
+ 0x00001f24, 0x000003b9, 0x00001f95, 0x00001f25,
+ 0x000003b9, 0x00001f96, 0x00001f26, 0x000003b9,
+ 0x00001f97, 0x00001f27, 0x000003b9, 0x00001fa0,
+ 0x00001f60, 0x000003b9, 0x00001fa1, 0x00001f61,
+ 0x000003b9, 0x00001fa2, 0x00001f62, 0x000003b9,
+ 0x00001fa3, 0x00001f63, 0x000003b9, 0x00001fa4,
+ 0x00001f64, 0x000003b9, 0x00001fa5, 0x00001f65,
+ 0x000003b9, 0x00001fa6, 0x00001f66, 0x000003b9,
+ 0x00001fa7, 0x00001f67, 0x000003b9, 0x00001fa0,
+ 0x00001f60, 0x000003b9, 0x00001fa1, 0x00001f61,
+ 0x000003b9, 0x00001fa2, 0x00001f62, 0x000003b9,
+ 0x00001fa3, 0x00001f63, 0x000003b9, 0x00001fa4,
+ 0x00001f64, 0x000003b9, 0x00001fa5, 0x00001f65,
+ 0x000003b9, 0x00001fa6, 0x00001f66, 0x000003b9,
+ 0x00001fa7, 0x00001f67, 0x000003b9, 0x00001fb2,
+ 0x00001f70, 0x000003b9, 0x00001fb3, 0x000003b1,
+ 0x000003b9, 0x00001fb4, 0x000003ac, 0x000003b9,
+ 0x00001fb6, 0x000003b1, 0x00000342, 0x00001fb7,
+ 0x000003b1, 0x00000342, 0x000003b9, 0x00001fb3,
+ 0x000003b1, 0x000003b9, 0x00001fc2, 0x00001f74,
+ 0x000003b9, 0x00001fc3, 0x000003b7, 0x000003b9,
+ 0x00001fc4, 0x000003ae, 0x000003b9, 0x00001fc6,
+ 0x000003b7, 0x00000342, 0x00001fc7, 0x000003b7,
+ 0x00000342, 0x000003b9, 0x00001fc3, 0x000003b7,
+ 0x000003b9, 0x00001fd2, 0x000003b9, 0x00000308,
+ 0x00000300, 0x00001fd3, 0x000003b9, 0x00000308,
+ 0x00000301, 0x00001fd6, 0x000003b9, 0x00000342,
+ 0x00001fd7, 0x000003b9, 0x00000308, 0x00000342,
+ 0x00001fe2, 0x000003c5, 0x00000308, 0x00000300,
+ 0x00001fe3, 0x000003c5, 0x00000308, 0x00000301,
+ 0x00001fe4, 0x000003c1, 0x00000313, 0x00001fe6,
+ 0x000003c5, 0x00000342, 0x00001fe7, 0x000003c5,
+ 0x00000308, 0x00000342, 0x00001ff2, 0x00001f7c,
+ 0x000003b9, 0x00001ff3, 0x000003c9, 0x000003b9,
+ 0x00001ff4, 0x000003ce, 0x000003b9, 0x00001ff6,
+ 0x000003c9, 0x00000342, 0x00001ff7, 0x000003c9,
+ 0x00000342, 0x000003b9, 0x00001ff3, 0x000003c9,
+ 0x000003b9, 0x0000fb00, 0x00000066, 0x00000066,
+ 0x0000fb01, 0x00000066, 0x00000069, 0x0000fb02,
+ 0x00000066, 0x0000006c, 0x0000fb03, 0x00000066,
+ 0x00000066, 0x00000069, 0x0000fb04, 0x00000066,
+ 0x00000066, 0x0000006c, 0x0000fb05, 0x00000073,
+ 0x00000074, 0x0000fb06, 0x00000073, 0x00000074,
+ 0x0000fb13, 0x00000574, 0x00000576, 0x0000fb14,
+ 0x00000574, 0x00000565, 0x0000fb15, 0x00000574,
+ 0x0000056b, 0x0000fb16, 0x0000057e, 0x00000576,
+ 0x0000fb17, 0x00000574, 0x0000056d
};
diff --git a/ext/mysqli/TODO b/ext/mysqli/TODO
deleted file mode 100644
index c241b9b704..0000000000
--- a/ext/mysqli/TODO
+++ /dev/null
@@ -1,2 +0,0 @@
-- documentation
-- ini-settings
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c
index d1588f1439..63065b5e90 100644
--- a/ext/mysqli/mysqli.c
+++ b/ext/mysqli/mysqli.c
@@ -424,8 +424,7 @@ HashTable *mysqli_object_get_debug_info(zval *object, int *is_temp)
HashTable *retval, *props = obj->prop_handler;
mysqli_prop_handler *entry;
- ALLOC_HASHTABLE(retval);
- ZEND_INIT_SYMTABLE_EX(retval, zend_hash_num_elements(props) + 1, 0);
+ retval = zend_new_array(zend_hash_num_elements(props) + 1);
ZEND_HASH_FOREACH_PTR(props, entry) {
zval rv, member;
@@ -568,12 +567,10 @@ PHP_MINIT_FUNCTION(mysqli)
REGISTER_INI_ENTRIES();
#ifndef MYSQLI_USE_MYSQLND
-#if MYSQL_VERSION_ID >= 40000
if (mysql_server_init(0, NULL, NULL)) {
return FAILURE;
}
#endif
-#endif
memcpy(&mysqli_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
mysqli_object_handlers.offset = XtOffsetOf(mysqli_object, zo);
@@ -691,9 +688,7 @@ PHP_MINIT_FUNCTION(mysqli)
REGISTER_LONG_CONSTANT("MYSQLI_OPT_CONNECT_TIMEOUT", MYSQL_OPT_CONNECT_TIMEOUT, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("MYSQLI_OPT_LOCAL_INFILE", MYSQL_OPT_LOCAL_INFILE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("MYSQLI_INIT_COMMAND", MYSQL_INIT_COMMAND, CONST_CS | CONST_PERSISTENT);
-#if MYSQL_VERSION_ID > 40101 || defined(MYSQLI_USE_MYSQLND)
REGISTER_LONG_CONSTANT("MYSQLI_OPT_READ_TIMEOUT", MYSQL_OPT_READ_TIMEOUT, CONST_CS | CONST_PERSISTENT);
-#endif
#if defined(MYSQLI_USE_MYSQLND)
REGISTER_LONG_CONSTANT("MYSQLI_OPT_NET_CMD_BUFFER_SIZE", MYSQLND_OPT_NET_CMD_BUFFER_SIZE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("MYSQLI_OPT_NET_READ_BUFFER_SIZE", MYSQLND_OPT_NET_READ_BUFFER_SIZE, CONST_CS | CONST_PERSISTENT);
@@ -885,7 +880,6 @@ PHP_MINIT_FUNCTION(mysqli)
PHP_MSHUTDOWN_FUNCTION(mysqli)
{
#ifndef MYSQLI_USE_MYSQLND
-#if MYSQL_VERSION_ID >= 40000
#ifdef PHP_WIN32
zend_ulong client_ver = mysql_get_client_version();
/*
@@ -899,7 +893,6 @@ PHP_MSHUTDOWN_FUNCTION(mysqli)
mysql_server_end();
#endif
#endif
-#endif
zend_hash_destroy(&mysqli_driver_properties);
zend_hash_destroy(&mysqli_result_properties);
@@ -917,7 +910,7 @@ PHP_MSHUTDOWN_FUNCTION(mysqli)
*/
PHP_RINIT_FUNCTION(mysqli)
{
-#if !defined(MYSQLI_USE_MYSQLND) && defined(ZTS) && MYSQL_VERSION_ID >= 40000
+#if !defined(MYSQLI_USE_MYSQLND) && defined(ZTS)
if (mysql_thread_init()) {
return FAILURE;
}
@@ -954,7 +947,7 @@ PHP_RSHUTDOWN_FUNCTION(mysqli)
{
/* check persistent connections, move used to free */
-#if !defined(MYSQLI_USE_MYSQLND) && defined(ZTS) && MYSQL_VERSION_ID >= 40000
+#if !defined(MYSQLI_USE_MYSQLND) && defined(ZTS)
mysql_thread_end();
#endif
if (MyG(error_msg)) {
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c
index de1d806f0f..2c9915111d 100644
--- a/ext/mysqli/mysqli_api.c
+++ b/ext/mysqli/mysqli_api.c
@@ -1714,14 +1714,12 @@ static int mysqli_options_get_option_zval_type(int option)
#ifdef MYSQL_OPT_PROTOCOL
case MYSQL_OPT_PROTOCOL:
#endif /* MySQL 4.1.0 */
-#if MYSQL_VERSION_ID > 40101 || defined(MYSQLI_USE_MYSQLND)
case MYSQL_OPT_READ_TIMEOUT:
case MYSQL_OPT_WRITE_TIMEOUT:
case MYSQL_OPT_GUESS_CONNECTION:
case MYSQL_OPT_USE_EMBEDDED_CONNECTION:
case MYSQL_OPT_USE_REMOTE_CONNECTION:
case MYSQL_SECURE_AUTH:
-#endif
#ifdef MYSQL_OPT_RECONNECT
case MYSQL_OPT_RECONNECT:
#endif /* MySQL 5.0.13 */
diff --git a/ext/mysqli/mysqli_priv.h b/ext/mysqli/mysqli_priv.h
index 34c7a74779..cd9a8081ec 100644
--- a/ext/mysqli/mysqli_priv.h
+++ b/ext/mysqli/mysqli_priv.h
@@ -33,7 +33,7 @@
#define HAVE_MYSQLI_GET_CHARSET
#endif
-#if defined(MYSQLND_VERSION_ID) || (MYSQL_VERSION_ID > 40112 && MYSQL_VERSION_ID < 50000) || MYSQL_VERSION_ID > 50005
+#if defined(MYSQLND_VERSION_ID) || MYSQL_VERSION_ID > 50005
#define HAVE_MYSQLI_SET_CHARSET
#endif
diff --git a/ext/mysqli/package.xml b/ext/mysqli/package.xml
deleted file mode 100644
index bfeeb71850..0000000000
--- a/ext/mysqli/package.xml
+++ /dev/null
@@ -1,116 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>mysqli</name>
- <summary>MySQLi - new MySQL interface for PHP 5 and MySQL 4.1+</summary>
- <maintainers>
- <maintainer>
- <user>georg</user>
- <name>Georg Richter</name>
- <email>georg@php.net</email>
- <role>lead</role>
- </maintainer>
- <maintainer>
- <user>zak</user>
- <name>Zak Greant</name>
- <email>zak@php.net</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <description>
-MySQLi is a rewrite of the original MySQL extension ...
- </description>
- <license>PHP</license>
- <release>
- <state>beta</state>
- <version>5.0.0rc1</version>
- <date>2004-03-19</date>
- <notes>
-package.xml added to support installation using pear installer
- </notes>
- <configureoptions>
- <configureoption name="with-mysqli" default="autodetect" prompt="path to mysql_config tool?"/>
- <configureoption name="enable-embedded-mysqli" default="no" prompt="embedd mysql server into PHP?"/>
- </configureoptions>
- <filelist>
- <file role="src" name="config.m4"/>
- <file role="src" name="config.w32"/>
- <file role="src" name="mysqli.c"/>
- <file role="src" name="mysqli_api.c"/>
- <file role="src" name="mysqli_fe.c"/>
- <file role="src" name="mysqli_nonapi.c"/>
- <file role="src" name="mysqli_prop.c"/>
- <file role="src" name="mysqli_repl.c"/>
- <file role="src" name="mysqli_report.c"/>
- <file role="src" name="php_mysqli.h"/>
- <file role="doc" name="CREDITS"/>
- <file role="test" name="tests/001.phpt"/>
- <file role="test" name="tests/002.phpt"/>
- <file role="test" name="tests/003.phpt"/>
- <file role="test" name="tests/004.phpt"/>
- <file role="test" name="tests/005.phpt"/>
- <file role="test" name="tests/006.phpt"/>
- <file role="test" name="tests/007.phpt"/>
- <file role="test" name="tests/008.phpt"/>
- <file role="test" name="tests/009.phpt"/>
- <file role="test" name="tests/010.phpt"/>
- <file role="test" name="tests/011.phpt"/>
- <file role="test" name="tests/012.phpt"/>
- <file role="test" name="tests/013.phpt"/>
- <file role="test" name="tests/014.phpt"/>
- <file role="test" name="tests/015.phpt"/>
- <file role="test" name="tests/016.phpt"/>
- <file role="test" name="tests/017.phpt"/>
- <file role="test" name="tests/018.phpt"/>
- <file role="test" name="tests/019.phpt"/>
- <file role="test" name="tests/020.phpt"/>
- <file role="test" name="tests/021.phpt"/>
- <file role="test" name="tests/022.phpt"/>
- <file role="test" name="tests/023.phpt"/>
- <file role="test" name="tests/024.phpt"/>
- <file role="test" name="tests/025.phpt"/>
- <file role="test" name="tests/026.phpt"/>
- <file role="test" name="tests/027.phpt"/>
- <file role="test" name="tests/028.phpt"/>
- <file role="test" name="tests/029.phpt"/>
- <file role="test" name="tests/030.phpt"/>
- <file role="test" name="tests/031.phpt"/>
- <file role="test" name="tests/032.phpt"/>
- <file role="test" name="tests/033.phpt"/>
- <file role="test" name="tests/034.phpt"/>
- <file role="test" name="tests/035.phpt"/>
- <file role="test" name="tests/036.phpt"/>
- <file role="test" name="tests/037.phpt"/>
- <file role="test" name="tests/038.phpt"/>
- <file role="test" name="tests/039.phpt"/>
- <file role="test" name="tests/040.phpt"/>
- <file role="test" name="tests/041.phpt"/>
- <file role="test" name="tests/042.phpt"/>
- <file role="test" name="tests/043.phpt"/>
- <file role="test" name="tests/044.phpt"/>
- <file role="test" name="tests/045.phpt"/>
- <file role="test" name="tests/046.phpt"/>
- <file role="test" name="tests/047.phpt"/>
- <file role="test" name="tests/048.phpt"/>
- <file role="test" name="tests/049.phpt"/>
- <file role="test" name="tests/050.phpt"/>
- <file role="test" name="tests/051.phpt"/>
- <file role="test" name="tests/052.phpt"/>
- <file role="test" name="tests/053.phpt"/>
- <file role="test" name="tests/054.phpt"/>
- <file role="test" name="tests/055.phpt"/>
- <file role="test" name="tests/056.phpt"/>
- <file role="test" name="tests/057.phpt"/>
- <file role="test" name="tests/058.phpt"/>
- <file role="test" name="tests/059.phpt"/>
- <file role="test" name="tests/060.phpt"/>
- <file role="test" name="tests/connect.inc"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5" />
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c
index 8f9c9797e1..9d951746f8 100644
--- a/ext/mysqlnd/mysqlnd_wireprotocol.c
+++ b/ext/mysqlnd/mysqlnd_wireprotocol.c
@@ -538,7 +538,7 @@ size_t php_mysqlnd_auth_write(void * _packet)
DBG_RETURN(0);
}
- int1store(p, packet->auth_data_len);
+ int1store(p, (int8_t)packet->auth_data_len);
++p;
/*!!!!! is the buffer big enough ??? */
if (sizeof(buffer) < (packet->auth_data_len + (p - buffer))) {
diff --git a/ext/odbc/birdstep.c b/ext/odbc/birdstep.c
deleted file mode 100644
index 18aa62b22f..0000000000
--- a/ext/odbc/birdstep.c
+++ /dev/null
@@ -1,709 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2017 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.01 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_01.txt |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: Nikolay P. Romanyuk <mag@redcom.ru> |
- +----------------------------------------------------------------------+
- */
-
-/* $Id$ */
-
-/*
- * TODO:
- * birdstep_fetch_into(),
- * Check all on real life apps.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "php.h"
-
-#if WIN32
-# include "config.w32.h"
-# ifdef PHP_EXPORTS
-# define PHPAPI __declspec(dllexport)
-# else
-# define PHPAPI __declspec(dllimport)
-# endif
-#else
-# include <php_config.h>
-# define PHPAPI
-# define THREAD_LS
-#endif
-
-#ifdef HAVE_BIRDSTEP
-#include "php_birdstep.h"
-#include "ext/standard/info.h"
-#include "php_ini.h"
-
-/* {{{ arginfo */
-ZEND_BEGIN_ARG_INFO_EX(arginfo_birdstep_connect, 0, 0, 3)
- ZEND_ARG_INFO(0, server)
- ZEND_ARG_INFO(0, user)
- ZEND_ARG_INFO(0, pass)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_birdstep_close, 0, 0, 1)
- ZEND_ARG_INFO(0, id)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_birdstep_exec, 0, 0, 2)
- ZEND_ARG_INFO(0, index)
- ZEND_ARG_INFO(0, exec_str)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_birdstep_fetch, 0, 0, 1)
- ZEND_ARG_INFO(0, index)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_birdstep_result, 0, 0, 2)
- ZEND_ARG_INFO(0, index)
- ZEND_ARG_INFO(0, col)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_birdstep_freeresult, 0, 0, 1)
- ZEND_ARG_INFO(0, index)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_birdstep_autocommit, 0, 0, 1)
- ZEND_ARG_INFO(0, index)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_birdstep_off_autocommit, 0, 0, 1)
- ZEND_ARG_INFO(0, index)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_birdstep_commit, 0, 0, 1)
- ZEND_ARG_INFO(0, index)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_birdstep_rollback, 0, 0, 1)
- ZEND_ARG_INFO(0, index)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_birdstep_fieldname, 0, 0, 2)
- ZEND_ARG_INFO(0, index)
- ZEND_ARG_INFO(0, col)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_birdstep_fieldnum, 0, 0, 1)
- ZEND_ARG_INFO(0, index)
-ZEND_END_ARG_INFO()
-/* }}} */
-
-const zend_function_entry birdstep_functions[] = {
- PHP_FE(birdstep_connect, arginfo_birdstep_connect)
- PHP_FE(birdstep_close, arginfo_birdstep_close)
- PHP_FE(birdstep_exec, arginfo_birdstep_exec)
- PHP_FE(birdstep_fetch, arginfo_birdstep_fetch)
- PHP_FE(birdstep_result, arginfo_birdstep_result)
- PHP_FE(birdstep_freeresult, arginfo_birdstep_freeresult)
- PHP_FE(birdstep_autocommit, arginfo_birdstep_autocommit)
- PHP_FE(birdstep_off_autocommit, arginfo_birdstep_off_autocommit)
- PHP_FE(birdstep_commit, arginfo_birdstep_commit)
- PHP_FE(birdstep_rollback, arginfo_birdstep_rollback)
- PHP_FE(birdstep_fieldnum, arginfo_birdstep_fieldnum)
- PHP_FE(birdstep_fieldname, arginfo_birdstep_fieldname)
-/*
- * Temporary Function aliases until the next major upgrade to PHP.
- * These should allow users to continue to use their current scripts,
- * but should in reality warn the user that this functionality is
- * deprecated.
- */
- PHP_FALIAS(velocis_connect, birdstep_connect, arginfo_birdstep_connect)
- PHP_FALIAS(velocis_close, birdstep_close, arginfo_birdstep_close)
- PHP_FALIAS(velocis_exec, birdstep_exec, arginfo_birdstep_exec)
- PHP_FALIAS(velocis_fetch, birdstep_fetch, arginfo_birdstep_fetch)
- PHP_FALIAS(velocis_result, birdstep_result, arginfo_birdstep_result)
- PHP_FALIAS(velocis_freeresult, birdstep_freeresult, arginfo_birdstep_freeresult)
- PHP_FALIAS(velocis_autocommit, birdstep_autocommit, arginfo_birdstep_autocommit)
- PHP_FALIAS(velocis_off_autocommit, birdstep_off_autocommit, arginfo_birdstep_off_autocommit)
- PHP_FALIAS(velocis_commit, birdstep_commit, arginfo_birdstep_commit)
- PHP_FALIAS(velocis_rollback, birdstep_rollback, arginfo_birdstep_rollback)
- PHP_FALIAS(velocis_fieldnum, birdstep_fieldnum, arginfo_birdstep_fieldnum)
- PHP_FALIAS(velocis_fieldname, birdstep_fieldname, arginfo_birdstep_fieldname)
-/* End temporary aliases */
- PHP_FE_END
-};
-
-zend_module_entry birdstep_module_entry = {
- STANDARD_MODULE_HEADER,
- "birdstep",
- birdstep_functions,
- PHP_MINIT(birdstep),
- PHP_MSHUTDOWN(birdstep),
- PHP_RINIT(birdstep),
- NULL,
- PHP_MINFO(birdstep),
- PHP_BIRDSTEP_VERSION,
- STANDARD_MODULE_PROPERTIES
-};
-
-#ifdef COMPILE_DL_ODBC
-ZEND_GET_MODULE(birdstep)
-#endif
-
-THREAD_LS birdstep_module php_birdstep_module;
-THREAD_LS static HENV henv;
-
-#define PHP_GET_BIRDSTEP_RES_IDX(id) if (!(res = birdstep_find_result(list, id))) { php_error_docref(NULL, E_WARNING, "Birdstep: Not result index (%ld)", id); RETURN_FALSE; }
-#define PHP_BIRDSTEP_CHK_LNK(id) if (!(conn = birdstep_find_conn(list, id))) { php_error_docref(NULL, E_WARNING, "Birdstep: Not connection index (%ld)", id); RETURN_FALSE; }
-
-
-static void _close_birdstep_link(zend_rsrc_list_entry *rsrc)
-{
- VConn *conn = (VConn *)rsrc->ptr;
-
- if ( conn ) {
- efree(conn);
- }
-}
-
-static void _free_birdstep_result(zend_rsrc_list_entry *rsrc)
-{
- Vresult *res = (Vresult *)rsrc->ptr;
-
- if ( res && res->values ) {
- register int i;
- for ( i=0; i < res->numcols; i++ ) {
- if ( res->values[i].value )
- efree(res->values[i].value);
- }
- efree(res->values);
- }
- if ( res ) {
- efree(res);
- }
-}
-
-PHP_MINIT_FUNCTION(birdstep)
-{
- SQLAllocEnv(&henv);
-
- if ( cfg_get_long("birdstep.max_links",&php_birdstep_module.max_links) == FAILURE ) {
- php_birdstep_module.max_links = -1;
- }
- php_birdstep_module.num_links = 0;
- php_birdstep_module.le_link = zend_register_list_destructors_ex(_close_birdstep_link, NULL, "birdstep link", module_number);
- php_birdstep_module.le_result = zend_register_list_destructors_ex(_free_birdstep_result, NULL, "birdstep result", module_number);
-
- return SUCCESS;
-}
-
-PHP_RINIT_FUNCTION(birdstep)
-{
- return SUCCESS;
-}
-
-
-PHP_MINFO_FUNCTION(birdstep)
-{
- php_info_print_table_start();
- php_info_print_table_row(2, "RAIMA Birdstep Support", "enabled" );
- php_info_print_table_end();
-}
-
-PHP_MSHUTDOWN_FUNCTION(birdstep)
-{
- SQLFreeEnv(henv);
- return SUCCESS;
-}
-
-/* Some internal functions. Connections and result manupulate */
-
-static int birdstep_add_conn(HashTable *list,VConn *conn,HDBC hdbc)
-{
- int ind;
-
- ind = zend_list_insert(conn,php_birdstep_module.le_link);
- conn->hdbc = hdbc;
- conn->index = ind;
-
- return(ind);
-}
-
-static VConn * birdstep_find_conn(HashTable *list,int ind)
-{
- VConn *conn;
- int type;
-
- conn = zend_list_find(ind,&type);
- if ( !conn || type != php_birdstep_module.le_link ) {
- return(NULL);
- }
- return(conn);
-}
-
-static void birdstep_del_conn(HashTable *list,int ind)
-{
- zend_list_delete(ind);
-}
-
-static int birdstep_add_result(HashTable *list,Vresult *res,VConn *conn)
-{
- int ind;
-
- ind = zend_list_insert(res,php_birdstep_module.le_result);
- res->conn = conn;
- res->index = ind;
-
- return(ind);
-}
-
-static Vresult * birdstep_find_result(HashTable *list,int ind)
-{
- Vresult *res;
- int type;
-
- res = zend_list_find(ind,&type);
- if ( !res || type != php_birdstep_module.le_result ) {
- return(NULL);
- }
- return(res);
-}
-
-static void birdstep_del_result(HashTable *list,int ind)
-{
- zend_list_delete(ind);
-}
-
-/* Users functions */
-
-/* {{{ proto int birdstep_connect(string server, string user, string pass)
- */
-PHP_FUNCTION(birdstep_connect)
-{
- char *serv, *user, *pass;
- size_t serv_len, user_len, pass_len;
- RETCODE stat;
- HDBC hdbc;
- VConn *new;
- zend_long ind;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "sss", &serv, &serv_len, &user, &user_len, &pass, &pass_len) == FAILURE) {
- return;
- }
-
- if ( php_birdstep_module.max_links != -1 && php_birdstep_module.num_links == php_birdstep_module.max_links ) {
- php_error_docref(NULL, E_WARNING, "Birdstep: Too many open connections (%d)",php_birdstep_module.num_links);
- RETURN_FALSE;
- }
-
- stat = SQLAllocConnect(henv,&hdbc);
- if ( stat != SQL_SUCCESS ) {
- php_error_docref(NULL, E_WARNING, "Birdstep: Could not allocate connection handle");
- RETURN_FALSE;
- }
- stat = SQLConnect(hdbc, serv, SQL_NTS, user, SQL_NTS, pass, SQL_NTS);
- if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) {
- php_error_docref(NULL, E_WARNING, "Birdstep: Could not connect to server \"%s\" for %s", serv, user);
- SQLFreeConnect(hdbc);
- RETURN_FALSE;
- }
- new = (VConn *)emalloc(sizeof(VConn));
- ind = birdstep_add_conn(list,new,hdbc);
- php_birdstep_module.num_links++;
- RETURN_LONG(ind);
-}
-/* }}} */
-
-/* {{{ proto bool birdstep_close(int id)
- */
-PHP_FUNCTION(birdstep_close)
-{
- zend_long id;
- VConn *conn;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &id) == FAILURE) {
- return;
- }
-
- PHP_BIRDSTEP_CHK_LNK(id);
-
- SQLDisconnect(conn->hdbc);
- SQLFreeConnect(conn->hdbc);
- birdstep_del_conn(list, id);
- php_birdstep_module.num_links--;
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto int birdstep_exec(int index, string exec_str)
- */
-PHP_FUNCTION(birdstep_exec)
-{
- char *query;
- zend_long ind;
- size_t query_len, indx;
- VConn *conn;
- Vresult *res;
- RETCODE stat;
- SWORD cols,i,colnamelen;
- SDWORD rows,coldesc;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &ind, &query, &query_len) == FAILURE) {
- return;
- }
-
- PHP_BIRDSTEP_CHK_LNK(ind);
-
- res = (Vresult *)emalloc(sizeof(Vresult));
- stat = SQLAllocStmt(conn->hdbc,&res->hstmt);
- if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) {
- php_error_docref(NULL, E_WARNING, "Birdstep: SQLAllocStmt return %d",stat);
- efree(res);
- RETURN_FALSE;
- }
- stat = SQLExecDirect(res->hstmt,query,SQL_NTS);
- if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) {
- php_error_docref(NULL, E_WARNING, "Birdstep: Cannot execute \"%s\" query",query);
- SQLFreeStmt(res->hstmt,SQL_DROP);
- efree(res);
- RETURN_FALSE;
- }
- /* Success query */
- stat = SQLNumResultCols(res->hstmt,&cols);
- if ( stat != SQL_SUCCESS ) {
- php_error_docref(NULL, E_WARNING, "Birdstep: SQLNumResultCols return %d",stat);
- SQLFreeStmt(res->hstmt,SQL_DROP);
- efree(res);
- RETURN_FALSE;
- }
- if ( !cols ) { /* Was INSERT, UPDATE, DELETE, etc. query */
- stat = SQLRowCount(res->hstmt,&rows);
- if ( stat != SQL_SUCCESS ) {
- php_error_docref(NULL, E_WARNING, "Birdstep: SQLNumResultCols return %d",stat);
- SQLFreeStmt(res->hstmt,SQL_DROP);
- efree(res);
- RETURN_FALSE;
- }
- SQLFreeStmt(res->hstmt,SQL_DROP);
- efree(res);
- RETURN_LONG(rows);
- } else { /* Was SELECT query */
- res->values = (VResVal *)safe_emalloc(sizeof(VResVal), cols, 0);
- res->numcols = cols;
- for ( i = 0; i < cols; i++ ) {
- SQLColAttributes(res->hstmt,i+1,SQL_COLUMN_NAME,
- res->values[i].name,sizeof(res->values[i].name),
- &colnamelen,NULL);
- SQLColAttributes(res->hstmt,i+1,SQL_COLUMN_TYPE,
- NULL,0,NULL,&res->values[i].valtype);
- switch ( res->values[i].valtype ) {
- case SQL_LONGVARBINARY:
- case SQL_LONGVARCHAR:
- res->values[i].value = NULL;
- continue;
- default:
- break;
- }
- SQLColAttributes(res->hstmt,i+1,SQL_COLUMN_DISPLAY_SIZE,
- NULL,0,NULL,&coldesc);
- res->values[i].value = (char *)emalloc(coldesc+1);
- SQLBindCol(res->hstmt,i+1,SQL_C_CHAR, res->values[i].value,coldesc+1, &res->values[i].vallen);
- }
- }
- res->fetched = 0;
- indx = birdstep_add_result(list,res,conn);
- RETURN_LONG(indx);
-}
-/* }}} */
-
-/* {{{ proto bool birdstep_fetch(int index)
- */
-PHP_FUNCTION(birdstep_fetch)
-{
- zend_long ind;
- Vresult *res;
- RETCODE stat;
- UDWORD row;
- UWORD RowStat[1];
-
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &ind) == FAILURE) {
- return;
- }
-
- PHP_GET_BIRDSTEP_RES_IDX(ind);
-
- stat = SQLExtendedFetch(res->hstmt,SQL_FETCH_NEXT,1,&row,RowStat);
- if ( stat == SQL_NO_DATA_FOUND ) {
- SQLFreeStmt(res->hstmt,SQL_DROP);
- birdstep_del_result(list,Z_LVAL_PP(ind));
- RETURN_FALSE;
- }
- if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) {
- php_error_docref(NULL, E_WARNING, "Birdstep: SQLFetch return error");
- SQLFreeStmt(res->hstmt,SQL_DROP);
- birdstep_del_result(list,Z_LVAL_PP(ind));
- RETURN_FALSE;
- }
- res->fetched = 1;
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto mixed birdstep_result(int index, mixed col)
- */
-PHP_FUNCTION(birdstep_result)
-{
- zval **col;
- zend_long ind;
- Vresult *res;
- RETCODE stat;
- int i,sql_c_type;
- UDWORD row;
- UWORD RowStat[1];
- SWORD indx = -1;
- char *field = NULL;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "lZ", &ind, &col) == FAILURE) {
- return;
- }
-
- PHP_GET_BIRDSTEP_RES_IDX(ind);
-
- if ( Z_TYPE_PP(col) == IS_STRING ) {
- field = Z_STRVAL_PP(col);
- } else {
- convert_to_long_ex(col);
- indx = Z_LVAL_PP(col);
- }
- if ( field ) {
- for ( i = 0; i < res->numcols; i++ ) {
- if ( !strcasecmp(res->values[i].name,field)) {
- indx = i;
- break;
- }
- }
- if ( indx < 0 ) {
- php_error_docref(NULL, E_WARNING, "Field %s not found",field);
- RETURN_FALSE;
- }
- } else {
- if ( indx < 0 || indx >= res->numcols ) {
- php_error_docref(NULL, E_WARNING, "Birdstep: Field index not in range");
- RETURN_FALSE;
- }
- }
- if ( !res->fetched ) {
- stat = SQLExtendedFetch(res->hstmt,SQL_FETCH_NEXT,1,&row,RowStat);
- if ( stat == SQL_NO_DATA_FOUND ) {
- SQLFreeStmt(res->hstmt,SQL_DROP);
- birdstep_del_result(list,Z_LVAL_PP(ind));
- RETURN_FALSE;
- }
- if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) {
- php_error_docref(NULL, E_WARNING, "Birdstep: SQLFetch return error");
- SQLFreeStmt(res->hstmt,SQL_DROP);
- birdstep_del_result(list,Z_LVAL_PP(ind));
- RETURN_FALSE;
- }
- res->fetched = 1;
- }
- switch ( res->values[indx].valtype ) {
- case SQL_LONGVARBINARY:
- sql_c_type = SQL_C_BINARY;
- goto l1;
- case SQL_LONGVARCHAR:
- sql_c_type = SQL_C_CHAR;
-l1:
- if ( !res->values[indx].value ) {
- res->values[indx].value = emalloc(4096);
- }
- stat = SQLGetData(res->hstmt,indx+1,sql_c_type,
- res->values[indx].value,4095,&res->values[indx].vallen);
- if ( stat == SQL_NO_DATA_FOUND ) {
- SQLFreeStmt(res->hstmt,SQL_DROP);
- birdstep_del_result(list,Z_LVAL_PP(ind));
- RETURN_FALSE;
- }
- if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) {
- php_error_docref(NULL, E_WARNING, "Birdstep: SQLGetData return error");
- SQLFreeStmt(res->hstmt,SQL_DROP);
- birdstep_del_result(list,Z_LVAL_PP(ind));
- RETURN_FALSE;
- }
- if ( res->values[indx].valtype == SQL_LONGVARCHAR ) {
- RETURN_STRING(res->values[indx].value,TRUE);
- } else {
- RETURN_LONG((zend_long)res->values[indx].value);
- }
- default:
- if ( res->values[indx].value != NULL ) {
- RETURN_STRING(res->values[indx].value,TRUE);
- }
- }
-}
-/* }}} */
-
-/* {{{ proto bool birdstep_freeresult(int index)
- */
-PHP_FUNCTION(birdstep_freeresult)
-{
- zend_long ind;
- Vresult *res;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &ind) == FAILURE) {
- return;
- }
-
- PHP_GET_BIRDSTEP_RES_IDX(ind);
-
- SQLFreeStmt(res->hstmt,SQL_DROP);
- birdstep_del_result(list, ind);
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool birdstep_autocommit(int index)
- */
-PHP_FUNCTION(birdstep_autocommit)
-{
- zend_long id;
- RETCODE stat;
- VConn *conn;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &id) == FAILURE) {
- return;
- }
-
- PHP_BIRDSTEP_CHK_LNK(id);
-
- stat = SQLSetConnectOption(conn->hdbc,SQL_AUTOCOMMIT,SQL_AUTOCOMMIT_ON);
- if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) {
- php_error_docref(NULL, E_WARNING, "Birdstep: Set autocommit_on option failure");
- RETURN_FALSE;
- }
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool birdstep_off_autocommit(int index)
- */
-PHP_FUNCTION(birdstep_off_autocommit)
-{
- zend_long id;
- RETCODE stat;
- VConn *conn;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &id) == FAILURE) {
- return;
- }
-
- PHP_BIRDSTEP_CHK_LNK(id);
-
- stat = SQLSetConnectOption(conn->hdbc,SQL_AUTOCOMMIT,SQL_AUTOCOMMIT_OFF);
- if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) {
- php_error_docref(NULL, E_WARNING, "Birdstep: Set autocommit_off option failure");
- RETURN_FALSE;
- }
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool birdstep_commit(int index)
- */
-PHP_FUNCTION(birdstep_commit)
-{
- zend_long id;
- RETCODE stat;
- VConn *conn;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &id) == FAILURE) {
- return;
- }
-
- PHP_BIRDSTEP_CHK_LNK(id)
-
- stat = SQLTransact(NULL,conn->hdbc,SQL_COMMIT);
- if ( stat != SQL_SUCCESS ) {
- php_error_docref(NULL, E_WARNING, "Birdstep: Commit failure");
- RETURN_FALSE;
- }
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool birdstep_rollback(int index)
- */
-PHP_FUNCTION(birdstep_rollback)
-{
- zend_long id;
- RETCODE stat;
- VConn *conn;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &id) == FAILURE) {
- return;
- }
-
- PHP_BIRDSTEP_CHK_LNK(id);
-
- stat = SQLTransact(NULL,conn->hdbc,SQL_ROLLBACK);
- if ( stat != SQL_SUCCESS ) {
- php_error_docref(NULL, E_WARNING, "Birdstep: Rollback failure");
- RETURN_FALSE;
- }
- RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto string birdstep_fieldname(int index, int col)
- */
-PHP_FUNCTION(birdstep_fieldname)
-{
- zend_long ind, col;
- Vresult *res;
- SWORD indx;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &ind, &col) == FAILURE) {
- return;
- }
-
- PHP_GET_BIRDSTEP_RES_IDX(ind);
-
- indx = col;
- if ( indx < 0 || indx >= res->numcols ) {
- php_error_docref(NULL, E_WARNING, "Birdstep: Field index not in range");
- RETURN_FALSE;
- }
- RETURN_STRING(res->values[indx].name,TRUE);
-}
-/* }}} */
-
-/* {{{ proto int birdstep_fieldnum(int index)
- */
-PHP_FUNCTION(birdstep_fieldnum)
-{
- zend_long ind;
- Vresult *res;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &ind) == FAILURE) {
- return;
- }
-
- PHP_GET_BIRDSTEP_RES_IDX(ind);
-
- RETURN_LONG(res->numcols);
-}
-/* }}} */
-
-#endif /* HAVE_BIRDSTEP */
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- */
diff --git a/ext/odbc/config.m4 b/ext/odbc/config.m4
index ecee15fd1c..fab38019a3 100644
--- a/ext/odbc/config.m4
+++ b/ext/odbc/config.m4
@@ -220,28 +220,6 @@ You need to source your DB2 environment before running PHP configure:
fi
if test -z "$ODBC_TYPE"; then
-PHP_ARG_WITH(ODBCRouter,,
-[ --with-ODBCRouter[=DIR] Include ODBCRouter.com support [/usr]])
-
- AC_MSG_CHECKING(for ODBCRouter.com support)
- if test "$PHP_ODBCROUTER" != "no"; then
- if test "$PHP_ODBCROUTER" = "yes"; then
- PHP_ODBCROUTER=/usr
- fi
- ODBC_INCDIR=$PHP_ODBCROUTER/include
- ODBC_LIBDIR=$PHP_ODBCROUTER/lib
- ODBC_LFLAGS=-L$ODBC_LIBDIR
- ODBC_INCLUDE=-I$ODBC_INCDIR
- ODBC_LIBS=-lodbcsdk
- ODBC_TYPE=ODBCRouter
- AC_DEFINE(HAVE_ODBC_ROUTER,1,[ ])
- AC_MSG_RESULT([$ext_output])
- else
- AC_MSG_RESULT(no)
- fi
-fi
-
-if test -z "$ODBC_TYPE"; then
PHP_ARG_WITH(empress,,
[ --with-empress[=DIR] Include Empress support [\$EMPRESSPATH]
(Empress Version >= 8.60 required)])
@@ -309,55 +287,6 @@ PHP_ARG_WITH(empress-bcs,,
fi
if test -z "$ODBC_TYPE"; then
-PHP_ARG_WITH(birdstep,,
-[ --with-birdstep[=DIR] Include Birdstep support [/usr/local/birdstep]])
-
- AC_MSG_CHECKING(for Birdstep support)
- if test "$PHP_BIRDSTEP" != "no"; then
- if test "$PHP_BIRDSTEP" = "yes"; then
- ODBC_INCDIR=/usr/local/birdstep/include
- ODBC_LIBDIR=/usr/local/birdstep/lib
- else
- ODBC_INCDIR=$PHP_BIRDSTEP/include
- ODBC_LIBDIR=$PHP_BIRDSTEP/$PHP_LIBDIR
- fi
-
- case $host_alias in
- *aix*[)]
- AC_DEFINE(AIX,1,[ ]);;
- *hpux*[)]
- AC_DEFINE(HPUX,1,[ ]);;
- *linux*[)]
- AC_DEFINE(LINUX,1,[ ]);;
- *qnx*[)]
- AC_DEFINE(NEUTRINO,1,[ ]);;
- i?86-*-solaris*[)]
- AC_DEFINE(ISOLARIS,1,[ ]);;
- sparc-*-solaris*[)]
- AC_DEFINE(SOLARIS,1,[ ]);;
- *unixware*[)]
- AC_DEFINE(UNIXWARE,1,[ ]);;
- esac
-
- ODBC_INCLUDE=-I$ODBC_INCDIR
- ODBC_TYPE=birdstep
- ODBC_LFLAGS=-L$ODBC_LIBDIR
- ODBC_LIBS="-lCadm -lCdict -lCenc -lCrdm -lCrpc -lCrdbc -lCrm -lCuapi -lutil"
-
- if test -f "$ODBC_LIBDIR/libCrdbc32.$SHLIB_SUFFIX_NAME"; then
- ODBC_LIBS="-lCrdbc32 -lCadm32 -lCncp32 -lCrm32 -lCsql32 -lCdict32 -lCrdm32 -lCrpc32 -lutil"
- elif test -f "$ODBC_LIBDIR/libCrdbc.$SHLIB_SUFFIX_NAME"; then
- ODBC_LIBS="-lCrdbc -lCadm -lCncp -lCrm -lCsql -lCdict -lCrdm -lCrpc -lutil"
- fi
-
- AC_DEFINE(HAVE_BIRDSTEP,1,[ ])
- AC_MSG_RESULT([$ext_output])
- else
- AC_MSG_RESULT(no)
- fi
-fi
-
-if test -z "$ODBC_TYPE"; then
PHP_ARG_WITH(custom-odbc,,
[ --with-custom-odbc[=DIR] Include user defined ODBC support. DIR is ODBC install base
directory [/usr/local]. Make sure to define CUSTOM_ODBC_LIBS and
@@ -536,7 +465,7 @@ dnl
if test -n "$ODBC_TYPE"; then
if test "$ODBC_TYPE" != "dbmaker"; then
PHP_EVAL_LIBLINE([$ODBC_LFLAGS $ODBC_LIBS], ODBC_SHARED_LIBADD)
- if test "$ODBC_TYPE" != "birdstep" && test "$ODBC_TYPE" != "solid"; then
+ if test "$ODBC_TYPE" != "solid"; then
AC_DEFINE(HAVE_SQLDATASOURCES,1,[ ])
fi
fi
diff --git a/ext/odbc/php_birdstep.h b/ext/odbc/php_birdstep.h
deleted file mode 100644
index 43787ca478..0000000000
--- a/ext/odbc/php_birdstep.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2017 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 3.01 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_01.txt |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: Nikolay P. Romanyuk <mag@redcom.ru> |
- +----------------------------------------------------------------------+
-*/
-
-/* $Id$ */
-
-#ifndef PHP_BIRDSTEP_H
-#define PHP_BIRDSTEP_H
-
-#if defined(HAVE_BIRDSTEP) && !HAVE_UODBC
-#define UNIX
-#include <sql.h>
-#include <sqlext.h>
-
-#include "php_version.h"
-#define PHP_BIRDSTEP_VERSION PHP_VERSION
-
-typedef struct VConn {
- HDBC hdbc;
- zend_long index;
-} VConn;
-
-typedef struct {
- char name[32];
- char *value;
- zend_long vallen;
- SDWORD valtype;
-} VResVal;
-
-typedef struct Vresult {
- HSTMT hstmt;
- VConn *conn;
- zend_long index;
- VResVal *values;
- zend_long numcols;
- int fetched;
-} Vresult;
-
-typedef struct {
- zend_long num_links;
- zend_long max_links;
- int le_link,le_result;
-} birdstep_module;
-
-extern zend_module_entry birdstep_module_entry;
-#define birdstep_module_ptr &birdstep_module_entry
-
-/* birdstep.c functions */
-PHP_MINIT_FUNCTION(birdstep);
-PHP_RINIT_FUNCTION(birdstep);
-PHP_MINFO_FUNCTION(birdstep);
-PHP_MSHUTDOWN_FUNCTION(birdstep);
-
-PHP_FUNCTION(birdstep_connect);
-PHP_FUNCTION(birdstep_close);
-PHP_FUNCTION(birdstep_exec);
-PHP_FUNCTION(birdstep_fetch);
-PHP_FUNCTION(birdstep_result);
-PHP_FUNCTION(birdstep_freeresult);
-PHP_FUNCTION(birdstep_autocommit);
-PHP_FUNCTION(birdstep_off_autocommit);
-PHP_FUNCTION(birdstep_commit);
-PHP_FUNCTION(birdstep_rollback);
-PHP_FUNCTION(birdstep_fieldnum);
-PHP_FUNCTION(birdstep_fieldname);
-
-extern birdstep_module php_birdstep_module;
-
-#else
-
-#define birdstep_module_ptr NULL
-
-#endif /* HAVE_BIRDSTEP */
-#endif /* PHP_BIRDSTEP_H */
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- */
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index bfaa0b89ac..010eaa6a18 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -15,7 +15,7 @@
| Authors: Stig Sæther Bakken <ssb@php.net> |
| Andreas Karajannis <Andreas.Karajannis@gmd.de> |
| Frank M. Kromann <frank@kromann.info> Support for DB/2 CLI |
- | Kevin N. Shallow <kshallow@tampabay.rr.com> Birdstep Support|
+ | Kevin N. Shallow <kshallow@tampabay.rr.com> |
| Daniel R. Kalowsky <kalowsky@php.net> |
+----------------------------------------------------------------------+
*/
@@ -258,7 +258,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_odbc_primarykeys, 0, 0, 4)
ZEND_END_ARG_INFO()
#if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) && !defined(HAVE_SOLID_35)
-#if !defined(HAVE_BIRDSTEP)
ZEND_BEGIN_ARG_INFO_EX(arginfo_odbc_procedurecolumns, 0, 0, 1)
ZEND_ARG_INFO(0, connection_id)
ZEND_ARG_INFO(0, qualifier)
@@ -266,7 +265,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_odbc_procedurecolumns, 0, 0, 1)
ZEND_ARG_INFO(0, proc)
ZEND_ARG_INFO(0, column)
ZEND_END_ARG_INFO()
-#endif
ZEND_BEGIN_ARG_INFO_EX(arginfo_odbc_procedures, 0, 0, 1)
ZEND_ARG_INFO(0, connection_id)
@@ -305,7 +303,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_odbc_statistics, 0, 0, 6)
ZEND_ARG_INFO(0, accuracy)
ZEND_END_ARG_INFO()
-#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) &&!defined(HAVE_SOLID_35) && !defined(HAVE_BIRDSTEP)
+#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) &&!defined(HAVE_SOLID_35)
ZEND_BEGIN_ARG_INFO_EX(arginfo_odbc_tableprivileges, 0, 0, 4)
ZEND_ARG_INFO(0, connection_id)
ZEND_ARG_INFO(0, qualifier)
@@ -370,17 +368,15 @@ const zend_function_entry odbc_functions[] = {
PHP_FE(odbc_statistics, arginfo_odbc_statistics)
PHP_FE(odbc_tables, arginfo_odbc_tables)
PHP_FE(odbc_primarykeys, arginfo_odbc_primarykeys)
-#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) &&!defined(HAVE_SOLID_35) && !defined(HAVE_BIRDSTEP) /* not supported now */
+#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) &&!defined(HAVE_SOLID_35) /* not supported now */
PHP_FE(odbc_columnprivileges, arginfo_odbc_columnprivileges)
PHP_FE(odbc_tableprivileges, arginfo_odbc_tableprivileges)
#endif
#if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) && !defined(HAVE_SOLID_35) /* not supported */
PHP_FE(odbc_foreignkeys, arginfo_odbc_foreignkeys)
PHP_FE(odbc_procedures, arginfo_odbc_procedures)
-#if !defined(HAVE_BIRDSTEP)
PHP_FE(odbc_procedurecolumns, arginfo_odbc_procedurecolumns)
#endif
-#endif
PHP_FALIAS(odbc_do, odbc_exec, arginfo_odbc_exec)
PHP_FALIAS(odbc_field_precision, odbc_field_len, arginfo_odbc_field_len)
PHP_FE_END
@@ -2447,45 +2443,6 @@ int odbc_sqlconnect(odbc_connection **conn, char *db, char *uid, char *pwd, int
SQLSetConnectOption((*conn)->hdbc, SQL_TRANSLATE_OPTION,
SQL_SOLID_XLATOPT_NOCNV);
#endif
-#ifdef HAVE_ODBC_ROUTER
- {
-#define CONNSTRSIZE 2048
- char *lpszConnStr = emalloc(CONNSTRSIZE);
- if (lpszConnStr && db) {
- short cbszConnStr;
- if (strstr(db, ";")) {
- /* the caller has apparently passed a connection-string */
- if (strstr(db, "uid") || strstr(db, "UID")) {
- uid = NULL;
- }
- if (strstr(db, "pwd") || strstr(db, "PWD")) {
- pwd = NULL;
- }
- strlcpy( lpszConnStr, db, CONNSTRSIZE);
- }
- else {
- strcpy(lpszConnStr, "DSN=");
- strlcat(lpszConnStr, db, CONNSTRSIZE);
- }
- if (uid) {
- if (uid[0]) {
- strlcat(lpszConnStr, ";UID=", CONNSTRSIZE);
- strlcat(lpszConnStr, uid, CONNSTRSIZE);
- strlcat(lpszConnStr, ";", CONNSTRSIZE);
- }
- if (pwd) {
- if (pwd[0]) {
- strlcat(lpszConnStr, "PWD=", CONNSTRSIZE);
- strlcat(lpszConnStr, pwd, CONNSTRSIZE);
- strlcat(lpszConnStr, ";", CONNSTRSIZE);
- }
- }
- }
- rc = SQLDriverConnect((*conn)->hdbc, NULL, lpszConnStr, SQL_NTS, lpszConnStr, CONNSTRSIZE, &cbszConnStr, SQL_DRIVER_NOPROMPT);
- efree(lpszConnStr);
- }
- }
-#else
#ifdef HAVE_OPENLINK
{
char dsnbuf[1024];
@@ -2540,7 +2497,6 @@ int odbc_sqlconnect(odbc_connection **conn, char *db, char *uid, char *pwd, int
rc = SQLConnect((*conn)->hdbc, db, SQL_NTS, uid, SQL_NTS, pwd, SQL_NTS);
#endif
#endif
-#endif
if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
odbc_sql_error(*conn, SQL_NULL_HSTMT, "SQLConnect");
SQLFreeConnect((*conn)->hdbc);
@@ -3289,7 +3245,7 @@ PHP_FUNCTION(odbc_columns)
}
/* }}} */
-#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) && !defined(HAVE_SOLID_35) && !defined(HAVE_BIRDSTEP)
+#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) && !defined(HAVE_SOLID_35)
/* {{{ proto resource odbc_columnprivileges(resource connection_id, string catalog, string schema, string table, string column)
Returns a result identifier that can be used to fetch a list of columns and associated privileges for the specified table */
PHP_FUNCTION(odbc_columnprivileges)
@@ -3558,7 +3514,7 @@ PHP_FUNCTION(odbc_primarykeys)
}
/* }}} */
-#if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) && !defined(HAVE_SOLID_35) && !defined(HAVE_BIRDSTEP)
+#if !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) && !defined(HAVE_SOLID_35)
/* {{{ proto resource odbc_procedurecolumns(resource connection_id [, string qualifier, string owner, string proc, string column])
Returns a result identifier containing the list of input and output parameters, as well as the columns that make up the result set for the specified procedures */
PHP_FUNCTION(odbc_procedurecolumns)
@@ -3838,7 +3794,7 @@ PHP_FUNCTION(odbc_statistics)
}
/* }}} */
-#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) && !defined(HAVE_SOLID_35) && !defined(HAVE_BIRDSTEP)
+#if !defined(HAVE_DBMAKER) && !defined(HAVE_SOLID) && !defined(HAVE_SOLID_30) && !defined(HAVE_SOLID_35)
/* {{{ proto resource odbc_tableprivileges(resource connection_id, string qualifier, string owner, string name)
Returns a result identifier containing a list of tables and the privileges associated with each table */
PHP_FUNCTION(odbc_tableprivileges)
diff --git a/ext/odbc/php_odbc.h b/ext/odbc/php_odbc.h
index b55f43b3ce..ee5f6da295 100644
--- a/ext/odbc/php_odbc.h
+++ b/ext/odbc/php_odbc.h
@@ -14,7 +14,7 @@
+----------------------------------------------------------------------+
| Authors: Stig Sæther Bakken <ssb@php.net> |
| Andreas Karajannis <Andreas.Karajannis@gmd.de> |
- | Kevin N. Shallow <kshallow@tampabay.rr.com> (Birdstep) |
+ | Kevin N. Shallow <kshallow@tampabay.rr.com> |
+----------------------------------------------------------------------+
*/
@@ -35,7 +35,7 @@ extern zend_module_entry odbc_module_entry;
#include "php_version.h"
#define PHP_ODBC_VERSION PHP_VERSION
-#if defined(HAVE_DBMAKER) || defined(PHP_WIN32) || defined(HAVE_IBMDB2) || defined(HAVE_UNIXODBC) || defined(HAVE_BIRDSTEP) || defined(HAVE_IODBC)
+#if defined(HAVE_DBMAKER) || defined(PHP_WIN32) || defined(HAVE_IBMDB2) || defined(HAVE_UNIXODBC) || defined(HAVE_IODBC)
# define PHP_ODBC_HAVE_FETCH_HASH 1
#endif
diff --git a/ext/odbc/php_odbc_includes.h b/ext/odbc/php_odbc_includes.h
index 43d3360966..4dbb188c41 100644
--- a/ext/odbc/php_odbc_includes.h
+++ b/ext/odbc/php_odbc_includes.h
@@ -14,7 +14,7 @@
+----------------------------------------------------------------------+
| Authors: Stig Sæther Bakken <ssb@php.net> |
| Andreas Karajannis <Andreas.Karajannis@gmd.de> |
- | Kevin N. Shallow <kshallow@tampabay.rr.com> (Birdstep) |
+ | Kevin N. Shallow <kshallow@tampabay.rr.com> |
+----------------------------------------------------------------------+
*/
@@ -39,9 +39,7 @@
# include <cli0defs.h>
# include <cli0env.h>
#elif defined(HAVE_SOLID_35)
-# if !defined(PHP_WIN32)
-# include <sqlunix.h>
-# endif /* end: #if !defined(PHP_WIN32) */
+# include <sqlunix.h>
# include <sqltypes.h>
# include <sqlucode.h>
# include <sqlext.h>
@@ -121,20 +119,6 @@ PHP_FUNCTION(solid_fetch_prev);
#include <sqlext.h>
#define HAVE_SQL_EXTENDED_FETCH 1
-#elif defined(HAVE_ODBC_ROUTER) /* ODBCRouter.com */
-
-#ifdef CHAR
-#undef CHAR
-#endif
-
-#ifdef SQLCHAR
-#undef SQLCHAR
-#endif
-
-#define ODBC_TYPE "ODBCRouter"
-#include <odbcsdk.h>
-#undef HAVE_SQL_EXTENDED_FETCH
-
#elif defined(HAVE_OPENLINK) /* OpenLink ODBC drivers */
#define ODBC_TYPE "Openlink"
@@ -150,23 +134,6 @@ PHP_FUNCTION(solid_fetch_prev);
#define SQLUSMALLINT UWORD
#endif
-#elif defined(HAVE_BIRDSTEP) /* Raima Birdstep */
-
-#define ODBC_TYPE "Birdstep"
-#define UNIX
-/*
- * Extended Fetch in the Birdstep ODBC API is incapable of returning zend_long varchar (memo) fields.
- * So the following line has been commented-out to accommodate. - KNS
- *
- * #define HAVE_SQL_EXTENDED_FETCH 1
- */
-#include <sql.h>
-#include <sqlext.h>
-#define SQLINTEGER SDWORD
-#define SQLSMALLINT SWORD
-#define SQLUSMALLINT UWORD
-
-
#elif defined(HAVE_DBMAKER) /* DBMaker */
#define ODBC_TYPE "DBMaker"
diff --git a/ext/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass.c
index 738e283806..8d99418efd 100644
--- a/ext/opcache/Optimizer/block_pass.c
+++ b/ext/opcache/Optimizer/block_pass.c
@@ -1750,6 +1750,8 @@ static void zend_t_usage(zend_cfg *cfg, zend_op_array *op_array, zend_bitset use
switch (opline->opcode) {
case ZEND_POST_INC:
case ZEND_POST_DEC:
+ case ZEND_POST_INC_OBJ:
+ case ZEND_POST_DEC_OBJ:
opline->opcode -= 2;
opline->result_type = IS_UNUSED;
break;
diff --git a/ext/opcache/Optimizer/compact_literals.c b/ext/opcache/Optimizer/compact_literals.c
index 0b98da054d..a8457c9405 100644
--- a/ext/opcache/Optimizer/compact_literals.c
+++ b/ext/opcache/Optimizer/compact_literals.c
@@ -422,7 +422,6 @@ void zend_optimizer_compact_literals(zend_op_array *op_array, zend_optimizer_ctx
}
break;
case IS_STRING:
- case IS_CONSTANT:
if (info[i].flags & LITERAL_MAY_MERGE) {
if (info[i].flags & LITERAL_EX_OBJ) {
int key_len = sizeof("$this->") - 1 + Z_STRLEN(op_array->literals[i]);
diff --git a/ext/opcache/Optimizer/compact_vars.c b/ext/opcache/Optimizer/compact_vars.c
index caf121942d..7bcf0b8a28 100644
--- a/ext/opcache/Optimizer/compact_vars.c
+++ b/ext/opcache/Optimizer/compact_vars.c
@@ -20,99 +20,114 @@
#include "Optimizer/zend_optimizer_internal.h"
#include "zend_bitset.h"
-/* This pass removes all CVs that are completely unused. It does *not* merge any CVs.
+/* This pass removes all CVs and temporaries that are completely unused. It does *not* merge any CVs or TMPs.
* This pass does not operate on SSA form anymore. */
void zend_optimizer_compact_vars(zend_op_array *op_array) {
int i;
ALLOCA_FLAG(use_heap1);
ALLOCA_FLAG(use_heap2);
- uint32_t used_cvs_len = zend_bitset_len(op_array->last_var);
- zend_bitset used_cvs = ZEND_BITSET_ALLOCA(used_cvs_len, use_heap1);
- uint32_t *cv_map = do_alloca(op_array->last_var * sizeof(uint32_t), use_heap2);
- uint32_t num_cvs, tmp_offset;
+ uint32_t used_vars_len = zend_bitset_len(op_array->last_var + op_array->T);
+ zend_bitset used_vars = ZEND_BITSET_ALLOCA(used_vars_len, use_heap1);
+ uint32_t *vars_map = do_alloca((op_array->last_var + op_array->T) * sizeof(uint32_t), use_heap2);
+ uint32_t num_cvs, num_tmps;
/* Determine which CVs are used */
- zend_bitset_clear(used_cvs, used_cvs_len);
+ zend_bitset_clear(used_vars, used_vars_len);
for (i = 0; i < op_array->last; i++) {
zend_op *opline = &op_array->opcodes[i];
- if (opline->op1_type == IS_CV) {
- zend_bitset_incl(used_cvs, VAR_NUM(opline->op1.var));
+ if (opline->op1_type & (IS_CV|IS_VAR|IS_TMP_VAR)) {
+ zend_bitset_incl(used_vars, VAR_NUM(opline->op1.var));
}
- if (opline->op2_type == IS_CV) {
- zend_bitset_incl(used_cvs, VAR_NUM(opline->op2.var));
+ if (opline->op2_type & (IS_CV|IS_VAR|IS_TMP_VAR)) {
+ zend_bitset_incl(used_vars, VAR_NUM(opline->op2.var));
}
- if (opline->result_type == IS_CV) {
- zend_bitset_incl(used_cvs, VAR_NUM(opline->result.var));
+ if (opline->result_type & (IS_CV|IS_VAR|IS_TMP_VAR)) {
+ zend_bitset_incl(used_vars, VAR_NUM(opline->result.var));
+ if (opline->opcode == ZEND_ROPE_INIT) {
+ uint32_t num = ((opline->extended_value * sizeof(zend_string*)) + (sizeof(zval) - 1)) / sizeof(zval);
+ while (num > 1) {
+ num--;
+ zend_bitset_incl(used_vars, VAR_NUM(opline->result.var) + num);
+ }
+ }
}
}
num_cvs = 0;
for (i = 0; i < op_array->last_var; i++) {
- if (zend_bitset_in(used_cvs, i)) {
- cv_map[i] = num_cvs++;
+ if (zend_bitset_in(used_vars, i)) {
+ vars_map[i] = num_cvs++;
+ } else {
+ vars_map[i] = (uint32_t) -1;
+ }
+ }
+
+ num_tmps = 0;
+ for (i = op_array->last_var; i < op_array->last_var + op_array->T; i++) {
+ if (zend_bitset_in(used_vars, i)) {
+ vars_map[i] = num_cvs + num_tmps++;
} else {
- cv_map[i] = (uint32_t) -1;
+ vars_map[i] = (uint32_t) -1;
}
}
- free_alloca(used_cvs, use_heap1);
- if (num_cvs == op_array->last_var) {
- free_alloca(cv_map, use_heap2);
+ free_alloca(used_vars, use_heap1);
+ if (num_cvs == op_array->last_var && num_tmps == op_array->T) {
+ free_alloca(vars_map, use_heap2);
return;
}
- ZEND_ASSERT(num_cvs < op_array->last_var);
- tmp_offset = op_array->last_var - num_cvs;
+ ZEND_ASSERT(num_cvs <= op_array->last_var);
+ ZEND_ASSERT(num_tmps <= op_array->T);
/* Update CV and TMP references in opcodes */
for (i = 0; i < op_array->last; i++) {
zend_op *opline = &op_array->opcodes[i];
- if (opline->op1_type == IS_CV) {
- opline->op1.var = NUM_VAR(cv_map[VAR_NUM(opline->op1.var)]);
- } else if (opline->op1_type & (IS_VAR|IS_TMP_VAR)) {
- opline->op1.var -= sizeof(zval) * tmp_offset;
+ if (opline->op1_type & (IS_CV|IS_VAR|IS_TMP_VAR)) {
+ opline->op1.var = NUM_VAR(vars_map[VAR_NUM(opline->op1.var)]);
}
- if (opline->op2_type == IS_CV) {
- opline->op2.var = NUM_VAR(cv_map[VAR_NUM(opline->op2.var)]);
- } else if (opline->op2_type & (IS_VAR|IS_TMP_VAR)) {
- opline->op2.var -= sizeof(zval) * tmp_offset;
+ if (opline->op2_type & (IS_CV|IS_VAR|IS_TMP_VAR)) {
+ opline->op2.var = NUM_VAR(vars_map[VAR_NUM(opline->op2.var)]);
}
- if (opline->result_type == IS_CV) {
- opline->result.var = NUM_VAR(cv_map[VAR_NUM(opline->result.var)]);
- } else if (opline->result_type & (IS_VAR|IS_TMP_VAR)) {
- opline->result.var -= sizeof(zval) * tmp_offset;
+ if (opline->result_type & (IS_CV|IS_VAR|IS_TMP_VAR)) {
+ opline->result.var = NUM_VAR(vars_map[VAR_NUM(opline->result.var)]);
}
}
/* Update TMP references in live ranges */
if (op_array->live_range) {
for (i = 0; i < op_array->last_live_range; i++) {
- op_array->live_range[i].var -= sizeof(zval) * tmp_offset;
+ op_array->live_range[i].var =
+ (op_array->live_range[i].var & ZEND_LIVE_MASK) |
+ NUM_VAR(vars_map[VAR_NUM(op_array->live_range[i].var & ~ZEND_LIVE_MASK)]);
}
}
/* Update CV name table */
- if (num_cvs) {
- zend_string **names = safe_emalloc(sizeof(zend_string *), num_cvs, 0);
- for (i = 0; i < op_array->last_var; i++) {
- if (cv_map[i] != (uint32_t) -1) {
- names[cv_map[i]] = op_array->vars[i];
- } else {
+ if (num_cvs != op_array->last_var) {
+ if (num_cvs) {
+ zend_string **names = safe_emalloc(sizeof(zend_string *), num_cvs, 0);
+ for (i = 0; i < op_array->last_var; i++) {
+ if (vars_map[i] != (uint32_t) -1) {
+ names[vars_map[i]] = op_array->vars[i];
+ } else {
+ zend_string_release(op_array->vars[i]);
+ }
+ }
+ efree(op_array->vars);
+ op_array->vars = names;
+ } else {
+ for (i = 0; i < op_array->last_var; i++) {
zend_string_release(op_array->vars[i]);
}
+ efree(op_array->vars);
+ op_array->vars = NULL;
}
- efree(op_array->vars);
- op_array->vars = names;
- } else {
- for (i = 0; i < op_array->last_var; i++) {
- zend_string_release(op_array->vars[i]);
- }
- efree(op_array->vars);
- op_array->vars = NULL;
+ op_array->last_var = num_cvs;
}
- op_array->last_var = num_cvs;
+ op_array->T = num_tmps;
- free_alloca(cv_map, use_heap2);
+ free_alloca(vars_map, use_heap2);
}
diff --git a/ext/opcache/Optimizer/dce.c b/ext/opcache/Optimizer/dce.c
index e2a70f9c6f..099a597998 100644
--- a/ext/opcache/Optimizer/dce.c
+++ b/ext/opcache/Optimizer/dce.c
@@ -13,6 +13,7 @@
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Nikita Popov <nikic@php.net> |
+ | Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
@@ -42,6 +43,8 @@
* zend_may_throw().
* * We often cannot DCE assignments and unsets while guaranteeing that dtors run in the same
* order. There is an optimization option to allow reordering of dtor effects.
+ * * The algorithm is able to eliminate dead modifications of non-escaping arrays
+ * and objects as well as dead arrays and objects allocations.
*/
typedef struct {
@@ -120,6 +123,8 @@ static inline zend_bool may_have_side_effects(
case ZEND_ISSET_ISEMPTY_VAR:
case ZEND_FETCH_IS:
case ZEND_IN_ARRAY:
+ case ZEND_FUNC_NUM_ARGS:
+ case ZEND_FUNC_GET_ARGS:
/* No side effects */
return 0;
case ZEND_JMP:
@@ -166,7 +171,9 @@ static inline zend_bool may_have_side_effects(
return 1;
}
if (!reorder_dtor_effects) {
- if (opline->op2_type != IS_CONST && (OP2_INFO() & MAY_HAVE_DTOR)) {
+ if (opline->op2_type != IS_CONST
+ && (OP2_INFO() & MAY_HAVE_DTOR)
+ && ssa->vars[ssa_op->op2_use].escape_state != ESCAPE_STATE_NO_ESCAPE) {
/* DCE might shorten lifetime */
return 1;
}
@@ -204,11 +211,34 @@ static inline zend_bool may_have_side_effects(
case ZEND_ASSIGN_BW_AND:
case ZEND_ASSIGN_BW_XOR:
case ZEND_ASSIGN_POW:
- if (opline->extended_value) {
- /* ASSIGN_DIM has no side-effect, but we can't deal with OP_DATA anyway */
+ return is_bad_mod(ssa, ssa_op->op1_use, ssa_op->op1_def)
+ || (opline->extended_value
+ && ssa->vars[ssa_op->op1_def].escape_state != ESCAPE_STATE_NO_ESCAPE);
+ case ZEND_ASSIGN_DIM:
+ case ZEND_ASSIGN_OBJ:
+ if (is_bad_mod(ssa, ssa_op->op1_use, ssa_op->op1_def)
+ || ssa->vars[ssa_op->op1_def].escape_state != ESCAPE_STATE_NO_ESCAPE) {
return 1;
}
- return is_bad_mod(ssa, ssa_op->op1_use, ssa_op->op1_def);
+ if (!reorder_dtor_effects) {
+ opline++;
+ ssa_op++;
+ if (opline->op1_type != IS_CONST
+ && (OP1_INFO() & MAY_HAVE_DTOR)) {
+ /* DCE might shorten lifetime */
+ return 1;
+ }
+ }
+ return 0;
+ case ZEND_PRE_INC_OBJ:
+ case ZEND_PRE_DEC_OBJ:
+ case ZEND_POST_INC_OBJ:
+ case ZEND_POST_DEC_OBJ:
+ if (is_bad_mod(ssa, ssa_op->op1_use, ssa_op->op1_def)
+ || ssa->vars[ssa_op->op1_def].escape_state != ESCAPE_STATE_NO_ESCAPE) {
+ return 1;
+ }
+ return 0;
default:
/* For everything we didn't handle, assume a side-effect */
return 1;
@@ -394,112 +424,6 @@ static zend_bool dce_instr(context *ctx, zend_op *opline, zend_ssa_op *ssa_op) {
return 1;
}
-// TODO Move this somewhere else (CFG simplification?)
-static int simplify_jumps(zend_ssa *ssa, zend_op_array *op_array) {
- int removed_ops = 0;
- zend_basic_block *block;
- FOREACH_BLOCK(block) {
- int block_num = block - ssa->cfg.blocks;
- zend_op *opline = &op_array->opcodes[block->start + block->len - 1];
- zend_ssa_op *ssa_op = &ssa->ops[block->start + block->len - 1];
- zval *op1;
-
- if (block->len == 0) {
- continue;
- }
-
- /* Convert jump-and-set into jump if result is not used */
- switch (opline->opcode) {
- case ZEND_JMPZ_EX:
- ZEND_ASSERT(ssa_op->result_def >= 0);
- if (ssa->vars[ssa_op->result_def].use_chain < 0
- && ssa->vars[ssa_op->result_def].phi_use_chain == NULL) {
- opline->opcode = ZEND_JMPZ;
- opline->result_type = IS_UNUSED;
- zend_ssa_remove_result_def(ssa, ssa_op);
- }
- break;
- case ZEND_JMPNZ_EX:
- case ZEND_JMP_SET:
- ZEND_ASSERT(ssa_op->result_def >= 0);
- if (ssa->vars[ssa_op->result_def].use_chain < 0
- && ssa->vars[ssa_op->result_def].phi_use_chain == NULL) {
- opline->opcode = ZEND_JMPNZ;
- opline->result_type = IS_UNUSED;
- zend_ssa_remove_result_def(ssa, ssa_op);
- }
- break;
- }
-
- /* Convert jump-and-set to QM_ASSIGN/BOOL if the "else" branch is not taken. */
- switch (opline->opcode) {
- case ZEND_JMPZ_EX:
- case ZEND_JMPNZ_EX:
- if (block->successors_count == 1 && block->successors[0] != block_num + 1) {
- opline->opcode = ZEND_BOOL;
- }
- break;
- case ZEND_JMP_SET:
- case ZEND_COALESCE:
- if (block->successors_count == 1 && block->successors[0] != block_num + 1) {
- opline->opcode = ZEND_QM_ASSIGN;
- }
- break;
- }
-
- if (opline->op1_type != IS_CONST) {
- continue;
- }
-
- /* Convert constant conditional jump to unconditional jump */
- op1 = &ZEND_OP1_LITERAL(opline);
- switch (opline->opcode) {
- case ZEND_JMPZ:
- if (!zend_is_true(op1)) {
- literal_dtor(op1);
- opline->op1_type = IS_UNUSED;
- opline->op1.num = opline->op2.num;
- opline->opcode = ZEND_JMP;
- } else {
- MAKE_NOP(opline);
- removed_ops++;
- }
- break;
- case ZEND_JMPNZ:
- if (zend_is_true(op1)) {
- literal_dtor(op1);
- opline->op1_type = IS_UNUSED;
- opline->op1.num = opline->op2.num;
- opline->opcode = ZEND_JMP;
- } else {
- MAKE_NOP(opline);
- removed_ops++;
- }
- break;
- case ZEND_COALESCE:
- ZEND_ASSERT(ssa_op->result_def >= 0);
- if (ssa->vars[ssa_op->result_def].use_chain >= 0
- || ssa->vars[ssa_op->result_def].phi_use_chain != NULL) {
- break;
- }
-
- zend_ssa_remove_result_def(ssa, ssa_op);
- if (Z_TYPE_P(op1) != IS_NULL) {
- literal_dtor(op1);
- opline->op1_type = IS_UNUSED;
- opline->op1.num = opline->op2.num;
- opline->opcode = ZEND_JMP;
- opline->result_type = IS_UNUSED;
- } else {
- MAKE_NOP(opline);
- removed_ops++;
- }
- break;
- }
- } FOREACH_BLOCK_END();
- return removed_ops;
-}
-
static inline int get_common_phi_source(zend_ssa *ssa, zend_ssa_phi *phi) {
int common_source = -1;
int source;
@@ -649,6 +573,8 @@ int dce_optimize_op_array(zend_op_array *op_array, zend_ssa *ssa, zend_bool reor
/* Mark reacable instruction without side effects as dead */
int b = ssa->cfg.blocks_count;
while (b > 0) {
+ int op_data = -1;
+
b--;
zend_basic_block *block = &ssa->cfg.blocks[b];
if (!(block->flags & ZEND_BB_REACHABLE)) {
@@ -658,17 +584,39 @@ int dce_optimize_op_array(zend_op_array *op_array, zend_ssa *ssa, zend_bool reor
while (i > block->start) {
i--;
+ if (op_array->opcodes[i].opcode == ZEND_OP_DATA) {
+ op_data = i;
+ continue;
+ }
+
if (zend_bitset_in(ctx.instr_worklist, i)) {
zend_bitset_excl(ctx.instr_worklist, i);
add_operands_to_worklists(&ctx, &op_array->opcodes[i], &ssa->ops[i], 0);
+ if (op_data >= 0) {
+ add_operands_to_worklists(&ctx, &op_array->opcodes[op_data], &ssa->ops[op_data], 0);
+ }
} else if (may_have_side_effects(op_array, ssa, &op_array->opcodes[i], &ssa->ops[i], ctx.reorder_dtor_effects)
|| zend_may_throw(&op_array->opcodes[i], op_array, ssa)
|| (has_varargs && may_break_varargs(op_array, ssa, &ssa->ops[i]))) {
- add_operands_to_worklists(&ctx, &op_array->opcodes[i], &ssa->ops[i], 0);
+ if (op_array->opcodes[i].opcode == ZEND_NEW
+ && op_array->opcodes[i+1].opcode == ZEND_DO_FCALL
+ && ssa->ops[i].result_def >= 0
+ && ssa->vars[ssa->ops[i].result_def].escape_state == ESCAPE_STATE_NO_ESCAPE) {
+ zend_bitset_incl(ctx.instr_dead, i);
+ zend_bitset_incl(ctx.instr_dead, i+1);
+ } else {
+ add_operands_to_worklists(&ctx, &op_array->opcodes[i], &ssa->ops[i], 0);
+ if (op_data >= 0) {
+ add_operands_to_worklists(&ctx, &op_array->opcodes[op_data], &ssa->ops[op_data], 0);
+ }
+ }
} else {
zend_bitset_incl(ctx.instr_dead, i);
+ if (op_data >= 0) {
+ zend_bitset_incl(ctx.instr_dead, op_data);
+ }
}
-
+ op_data = -1;
}
}
@@ -678,6 +626,10 @@ int dce_optimize_op_array(zend_op_array *op_array, zend_ssa *ssa, zend_bool reor
while ((i = zend_bitset_pop_first(ctx.instr_worklist, ctx.instr_worklist_len)) >= 0) {
zend_bitset_excl(ctx.instr_dead, i);
add_operands_to_worklists(&ctx, &op_array->opcodes[i], &ssa->ops[i], 1);
+ if (i < op_array->last && op_array->opcodes[i+1].opcode == ZEND_OP_DATA) {
+ zend_bitset_excl(ctx.instr_dead, i+1);
+ add_operands_to_worklists(&ctx, &op_array->opcodes[i+1], &ssa->ops[i+1], 1);
+ }
}
while ((i = zend_bitset_pop_first(ctx.phi_worklist, ctx.phi_worklist_len)) >= 0) {
zend_bitset_excl(ctx.phi_dead, i);
@@ -719,7 +671,5 @@ int dce_optimize_op_array(zend_op_array *op_array, zend_ssa *ssa, zend_bool reor
}
} FOREACH_PHI_END();
- removed_ops += simplify_jumps(ssa, op_array);
-
return removed_ops;
}
diff --git a/ext/opcache/Optimizer/dfa_pass.c b/ext/opcache/Optimizer/dfa_pass.c
index 02f8410700..733c99ce7a 100644
--- a/ext/opcache/Optimizer/dfa_pass.c
+++ b/ext/opcache/Optimizer/dfa_pass.c
@@ -115,6 +115,10 @@ int zend_dfa_analyze_op_array(zend_op_array *op_array, zend_optimizer_ctx *ctx,
return FAILURE;
}
+ if (zend_ssa_escape_analysis(ctx->script, op_array, ssa) != SUCCESS) {
+ return FAILURE;
+ }
+
if (ctx->debug_level & ZEND_DUMP_DFA_SSA_VARS) {
zend_dump_ssa_variables(op_array, ssa, 0);
}
@@ -399,8 +403,7 @@ int zend_dfa_optimize_calls(zend_op_array *op_array, zend_ssa *ssa)
zend_ulong idx;
ZVAL_TRUE(&tmp);
- dst = emalloc(sizeof(HashTable));
- zend_hash_init(dst, zend_hash_num_elements(src), NULL, ZVAL_PTR_DTOR, 0);
+ dst = zend_new_array(zend_hash_num_elements(src));
if (strict) {
ZEND_HASH_FOREACH_VAL(src, val) {
if (Z_TYPE_P(val) == IS_STRING) {
@@ -471,11 +474,160 @@ int zend_dfa_optimize_calls(zend_op_array *op_array, zend_ssa *ssa)
return removed_ops;
}
+static zend_always_inline void take_successor_0(zend_ssa *ssa, int block_num, zend_basic_block *block)
+{
+ if (block->successors_count == 2) {
+ if (block->successors[1] != block->successors[0]) {
+ zend_ssa_remove_predecessor(ssa, block_num, block->successors[1]);
+ }
+ block->successors_count = 1;
+ }
+}
+
+static zend_always_inline void take_successor_1(zend_ssa *ssa, int block_num, zend_basic_block *block)
+{
+ if (block->successors_count == 2) {
+ if (block->successors[1] != block->successors[0]) {
+ zend_ssa_remove_predecessor(ssa, block_num, block->successors[0]);
+ block->successors[0] = block->successors[1];
+ }
+ block->successors_count = 1;
+ }
+}
+
+static void compress_block(zend_op_array *op_array, zend_basic_block *block)
+{
+ while (block->len > 0) {
+ zend_op *opline = &op_array->opcodes[block->start + block->len - 1];
+
+ if (opline->opcode == ZEND_NOP
+ && (block->len == 1 || !zend_is_smart_branch(opline - 1))) {
+ block->len--;
+ } else {
+ break;
+ }
+ }
+}
+
+static void zend_ssa_replace_control_link(zend_op_array *op_array, zend_ssa *ssa, int from, int to, int new_to)
+{
+ zend_basic_block *src = &ssa->cfg.blocks[from];
+ zend_basic_block *old = &ssa->cfg.blocks[to];
+ zend_basic_block *dst = &ssa->cfg.blocks[new_to];
+ int *predecessors = &ssa->cfg.predecessors[dst->predecessor_offset];
+ int dup = 0;
+ int i;
+ zend_op *opline;
+
+ for (i = 0; i < src->successors_count; i++) {
+ if (src->successors[i] == to) {
+ src->successors[i] = new_to;
+ }
+ }
+
+ if (src->len > 0) {
+ opline = op_array->opcodes + src->start + src->len - 1;
+ switch (opline->opcode) {
+ case ZEND_JMP:
+ case ZEND_FAST_CALL:
+ ZEND_ASSERT(ZEND_OP1_JMP_ADDR(opline) == op_array->opcodes + old->start);
+ ZEND_SET_OP_JMP_ADDR(opline, opline->op1, op_array->opcodes + dst->start);
+ break;
+ case ZEND_JMPZNZ:
+ if (ZEND_OFFSET_TO_OPLINE_NUM(op_array, opline, opline->extended_value) == old->start) {
+ opline->extended_value = ZEND_OPLINE_NUM_TO_OFFSET(op_array, opline, dst->start);
+ }
+ /* break missing intentionally */
+ case ZEND_JMPZ:
+ case ZEND_JMPNZ:
+ case ZEND_JMPZ_EX:
+ case ZEND_JMPNZ_EX:
+ case ZEND_FE_RESET_R:
+ case ZEND_FE_RESET_RW:
+ case ZEND_JMP_SET:
+ case ZEND_COALESCE:
+ case ZEND_ASSERT_CHECK:
+ if (ZEND_OP2_JMP_ADDR(opline) == op_array->opcodes + old->start) {
+ ZEND_SET_OP_JMP_ADDR(opline, opline->op2, op_array->opcodes + dst->start);
+ }
+ break;
+ case ZEND_CATCH:
+ if (!opline->result.num) {
+ if (ZEND_OFFSET_TO_OPLINE_NUM(op_array, opline, opline->extended_value) == old->start) {
+ opline->extended_value = ZEND_OPLINE_NUM_TO_OFFSET(op_array, opline, dst->start);
+ }
+ }
+ break;
+ case ZEND_DECLARE_ANON_CLASS:
+ case ZEND_DECLARE_ANON_INHERITED_CLASS:
+ case ZEND_FE_FETCH_R:
+ case ZEND_FE_FETCH_RW:
+ if (ZEND_OFFSET_TO_OPLINE_NUM(op_array, opline, opline->extended_value) == old->start) {
+ opline->extended_value = ZEND_OPLINE_NUM_TO_OFFSET(op_array, opline, dst->start);
+ }
+ break;
+ case ZEND_SWITCH_LONG:
+ case ZEND_SWITCH_STRING:
+ {
+ HashTable *jumptable = Z_ARRVAL(ZEND_OP2_LITERAL(opline));
+ zval *zv;
+ ZEND_HASH_FOREACH_VAL(jumptable, zv) {
+ if (ZEND_OFFSET_TO_OPLINE_NUM(op_array, opline, Z_LVAL_P(zv)) == old->start) {
+ Z_LVAL_P(zv) = ZEND_OPLINE_NUM_TO_OFFSET(op_array, opline, dst->start);
+ }
+ } ZEND_HASH_FOREACH_END();
+ if (ZEND_OFFSET_TO_OPLINE_NUM(op_array, opline, opline->extended_value) == old->start) {
+ opline->extended_value = ZEND_OPLINE_NUM_TO_OFFSET(op_array, opline, dst->start);
+ }
+ break;
+ }
+ }
+ }
+
+ for (i = 0; i < dst->predecessors_count; i++) {
+ if (dup) {
+ predecessors[i] = predecessors[i+1];
+ } else if (predecessors[i] == to) {
+ predecessors[i] = from;
+ } else if (predecessors[i] == from) {
+ dup = 1;
+ dst->predecessors_count--;
+ }
+ }
+}
+
+static void zend_ssa_unlink_block(zend_op_array *op_array, zend_ssa *ssa, zend_basic_block *block, int block_num)
+{
+ if (block->predecessors_count == 1 && ssa->blocks[block_num].phis == NULL) {
+ int *predecessors, i;
+
+ ZEND_ASSERT(block->successors_count == 1);
+ predecessors = &ssa->cfg.predecessors[block->predecessor_offset];
+ for (i = 0; i < block->predecessors_count; i++) {
+ zend_ssa_replace_control_link(op_array, ssa, predecessors[i], block_num, block->successors[0]);
+ }
+ zend_ssa_remove_block(op_array, ssa, block_num);
+ }
+}
+
static int zend_dfa_optimize_jmps(zend_op_array *op_array, zend_ssa *ssa)
{
int removed_ops = 0;
int block_num = 0;
+ for (block_num = 1; block_num < ssa->cfg.blocks_count; block_num++) {
+ zend_basic_block *block = &ssa->cfg.blocks[block_num];
+
+ if (!(block->flags & ZEND_BB_REACHABLE)) {
+ continue;
+ }
+ compress_block(op_array, block);
+ if (block->len == 0) {
+ zend_ssa_unlink_block(op_array, ssa, block, block_num);
+ }
+ }
+
+ block_num = 0;
while (block_num < ssa->cfg.blocks_count
&& !(ssa->cfg.blocks[block_num].flags & ZEND_BB_REACHABLE)) {
block_num++;
@@ -485,7 +637,7 @@ static int zend_dfa_optimize_jmps(zend_op_array *op_array, zend_ssa *ssa)
zend_basic_block *block = &ssa->cfg.blocks[block_num];
uint32_t op_num;
zend_op *opline;
- zend_ssa_op *op;
+ zend_ssa_op *ssa_op;
while (next_block_num < ssa->cfg.blocks_count
&& !(ssa->cfg.blocks[next_block_num].flags & ZEND_BB_REACHABLE)) {
@@ -493,54 +645,215 @@ static int zend_dfa_optimize_jmps(zend_op_array *op_array, zend_ssa *ssa)
}
if (block->len) {
- if (block->successors_count == 2) {
- if (block->successors[0] == block->successors[1]) {
- op_num = block->start + block->len - 1;
- opline = op_array->opcodes + op_num;
- switch (opline->opcode) {
- case ZEND_JMPZ:
- case ZEND_JMPNZ:
- case ZEND_JMPZNZ:
- op = ssa->ops + op_num;
+ op_num = block->start + block->len - 1;
+ opline = op_array->opcodes + op_num;
+ ssa_op = ssa->ops + op_num;
+
+ switch (opline->opcode) {
+ case ZEND_JMP:
+optimize_jmp:
+ if (block->successors[0] == next_block_num) {
+ MAKE_NOP(opline);
+ removed_ops++;
+ goto optimize_nop;
+ }
+ break;
+ case ZEND_JMPZ:
+optimize_jmpz:
+ if (opline->op1_type == IS_CONST) {
+ if (zend_is_true(CT_CONSTANT_EX(op_array, opline->op1.constant))) {
+ MAKE_NOP(opline);
+ removed_ops++;
+ take_successor_1(ssa, block_num, block);
+ goto optimize_nop;
+ } else {
+ opline->opcode = ZEND_JMP;
+ COPY_NODE(opline->op1, opline->op2);
+ take_successor_0(ssa, block_num, block);
+ goto optimize_jmp;
+ }
+ } else {
+ if (block->successors[0] == next_block_num) {
+ take_successor_0(ssa, block_num, block);
+ if (opline->op1_type == IS_CV && (OP1_INFO() & MAY_BE_UNDEF)) {
+ opline->opcode = ZEND_CHECK_VAR;
+ opline->op2.num = 0;
+ } else if (opline->op1_type == IS_CV || !(OP1_INFO() & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_REF))) {
+ zend_ssa_remove_instr(ssa, opline, ssa_op);
+ removed_ops++;
+ goto optimize_nop;
+ } else {
+ opline->opcode = ZEND_FREE;
+ opline->op2.num = 0;
+ }
+ }
+ }
+ break;
+ case ZEND_JMPNZ:
+optimize_jmpnz:
+ if (opline->op1_type == IS_CONST) {
+ if (zend_is_true(CT_CONSTANT_EX(op_array, opline->op1.constant))) {
+ opline->opcode = ZEND_JMP;
+ COPY_NODE(opline->op1, opline->op2);
+ take_successor_0(ssa, block_num, block);
+ goto optimize_jmp;
+ } else {
+ MAKE_NOP(opline);
+ removed_ops++;
+ take_successor_1(ssa, block_num, block);
+ goto optimize_nop;
+ }
+ } else {
+ ZEND_ASSERT(block->successors_count == 2);
+ if (block->successors[0] == next_block_num) {
+ take_successor_0(ssa, block_num, block);
+ if (opline->op1_type == IS_CV && (OP1_INFO() & MAY_BE_UNDEF)) {
+ opline->opcode = ZEND_CHECK_VAR;
+ opline->op2.num = 0;
+ } else if (opline->op1_type == IS_CV || !(OP1_INFO() & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_REF))) {
+ zend_ssa_remove_instr(ssa, opline, ssa_op);
+ removed_ops++;
+ goto optimize_nop;
+ } else {
+ opline->opcode = ZEND_FREE;
+ opline->op2.num = 0;
+ }
+ }
+ }
+ break;
+ case ZEND_JMPZNZ:
+ if (opline->op1_type == IS_CONST) {
+ if (zend_is_true(CT_CONSTANT_EX(op_array, opline->op1.constant))) {
+ zend_op *target_opline = ZEND_OFFSET_TO_OPLINE(opline, opline->extended_value);
+ ZEND_SET_OP_JMP_ADDR(opline, opline->op1, target_opline);
+ take_successor_1(ssa, block_num, block);
+ } else {
+ zend_op *target_opline = ZEND_OP2_JMP_ADDR(opline);
+ ZEND_SET_OP_JMP_ADDR(opline, opline->op1, target_opline);
+ take_successor_0(ssa, block_num, block);
+ }
+ opline->op1_type = IS_UNUSED;
+ opline->extended_value = 0;
+ opline->opcode = ZEND_JMP;
+ goto optimize_jmp;
+ } else {
+ ZEND_ASSERT(block->successors_count == 2);
+ if (block->successors[0] == block->successors[1]) {
+ take_successor_0(ssa, block_num, block);
if (block->successors[0] == next_block_num) {
- if (opline->op1_type & (IS_CV|IS_CONST)) {
- zend_ssa_remove_instr(ssa, opline, op);
- if (op->op1_use >= 0) {
- zend_ssa_unlink_use_chain(ssa, op_num, op->op1_use);
- op->op1_use = -1;
- op->op1_use_chain = -1;
- }
- MAKE_NOP(opline);
+ if (opline->op1_type == IS_CV && (OP1_INFO() & MAY_BE_UNDEF)) {
+ opline->opcode = ZEND_CHECK_VAR;
+ opline->op2.num = 0;
+ } else if (opline->op1_type == IS_CV || !(OP1_INFO() & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_REF))) {
+ zend_ssa_remove_instr(ssa, opline, ssa_op);
removed_ops++;
+ goto optimize_nop;
} else {
opline->opcode = ZEND_FREE;
opline->op2.num = 0;
}
- } else {
- if (opline->op1_type & (IS_CV|IS_CONST)) {
- if (op->op1_use >= 0) {
- zend_ssa_unlink_use_chain(ssa, op_num, op->op1_use);
- op->op1_use = -1;
- op->op1_use_chain = -1;
- }
- opline->opcode = ZEND_JMP;
- opline->op1_type = IS_UNUSED;
- opline->op1.num = opline->op2.num;
+ } else if ((opline->op1_type == IS_CV && !(OP1_INFO() & MAY_BE_UNDEF)) || !(OP1_INFO() & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_REF))) {
+ ZEND_ASSERT(ssa_op->op1_use >= 0);
+ zend_ssa_unlink_use_chain(ssa, op_num, ssa_op->op1_use);
+ ssa_op->op1_use = -1;
+ ssa_op->op1_use_chain = -1;
+ opline->opcode = ZEND_JMP;
+ opline->op1_type = IS_UNUSED;
+ opline->op1.num = opline->op2.num;
+ goto optimize_jmp;
+ }
+ }
+ }
+ break;
+ case ZEND_JMPZ_EX:
+ if (ssa->vars[ssa_op->result_def].use_chain < 0
+ && ssa->vars[ssa_op->result_def].phi_use_chain == NULL) {
+ opline->opcode = ZEND_JMPZ;
+ opline->result_type = IS_UNUSED;
+ zend_ssa_remove_result_def(ssa, ssa_op);
+ goto optimize_jmpz;
+ } else if (opline->op1_type == IS_CONST) {
+ if (zend_is_true(CT_CONSTANT_EX(op_array, opline->op1.constant))) {
+ opline->opcode = ZEND_QM_ASSIGN;
+ take_successor_1(ssa, block_num, block);
+ }
+ }
+ break;
+ case ZEND_JMPNZ_EX:
+ if (ssa->vars[ssa_op->result_def].use_chain < 0
+ && ssa->vars[ssa_op->result_def].phi_use_chain == NULL) {
+ opline->opcode = ZEND_JMPNZ;
+ opline->result_type = IS_UNUSED;
+ zend_ssa_remove_result_def(ssa, ssa_op);
+ goto optimize_jmpnz;
+ } else if (opline->op1_type == IS_CONST) {
+ if (!zend_is_true(CT_CONSTANT_EX(op_array, opline->op1.constant))) {
+ opline->opcode = ZEND_QM_ASSIGN;
+ take_successor_1(ssa, block_num, block);
+ }
+ }
+ break;
+ case ZEND_JMP_SET:
+ if (ssa->vars[ssa_op->result_def].use_chain < 0
+ && ssa->vars[ssa_op->result_def].phi_use_chain == NULL) {
+ opline->opcode = ZEND_JMPNZ;
+ opline->result_type = IS_UNUSED;
+ zend_ssa_remove_result_def(ssa, ssa_op);
+ goto optimize_jmpnz;
+ } else if (opline->op1_type == IS_CONST) {
+ if (!zend_is_true(CT_CONSTANT_EX(op_array, opline->op1.constant))) {
+ MAKE_NOP(opline);
+ removed_ops++;
+ take_successor_1(ssa, block_num, block);
+ goto optimize_nop;
+ }
+ }
+ break;
+ case ZEND_COALESCE:
+ if (opline->op1_type == IS_CONST) {
+ if (Z_TYPE_P(CT_CONSTANT_EX(op_array, opline->op1.constant)) == IS_NULL) {
+ MAKE_NOP(opline);
+ removed_ops++;
+ take_successor_1(ssa, block_num, block);
+ goto optimize_nop;
+ } else {
+ zend_ssa_var *var = &ssa->vars[ssa_op->result_def];
+ if (var->use_chain < 0 && var->phi_use_chain == NULL) {
+ ssa_op->result_def = -1;
+ if (opline->result_type & (IS_TMP_VAR|IS_VAR)) {
+ zend_optimizer_remove_live_range_ex(op_array, opline->result.var, var->definition);
}
+ zend_ssa_unlink_use_chain(ssa, opline - op_array->opcodes, ssa_op->op1_use);
+ ssa_op->op1_use = -1;
+ ssa_op->op1_use_chain = -1;
+ opline->opcode = ZEND_JMP;
+ COPY_NODE(opline->op1, opline->op2);
+ take_successor_0(ssa, block_num, block);
+ goto optimize_jmp;
}
- break;
- default:
- break;
+ }
}
- }
- } else if (block->successors_count == 1 && block->successors[0] == next_block_num) {
- op_num = block->start + block->len - 1;
- opline = op_array->opcodes + op_num;
- if (opline->opcode == ZEND_JMP) {
- MAKE_NOP(opline);
- removed_ops++;
- }
- }
+ break;
+ case ZEND_NOP:
+optimize_nop:
+ compress_block(op_array, block);
+ if (block->len == 0) {
+ if (block_num > 0) {
+ zend_ssa_unlink_block(op_array, ssa, block, block_num);
+ /* backtrack to previous basic block */
+ do {
+ block_num--;
+ } while (block_num >= 0
+ && !(ssa->cfg.blocks[block_num].flags & ZEND_BB_REACHABLE));
+ if (block_num >= 0) {
+ continue;
+ }
+ }
+ }
+ break;
+ default:
+ break;
+ }
}
block_num = next_block_num;
@@ -591,6 +904,9 @@ void zend_dfa_optimize_op_array(zend_op_array *op_array, zend_optimizer_ctx *ctx
if (dce_optimize_op_array(op_array, ssa, 0)) {
remove_nops = 1;
}
+ if (zend_dfa_optimize_jmps(op_array, ssa)) {
+ remove_nops = 1;
+ }
if (ctx->debug_level & ZEND_DUMP_AFTER_PASS_14) {
zend_dump_op_array(op_array, ZEND_DUMP_SSA, "after dce pass", ssa);
}
diff --git a/ext/opcache/Optimizer/escape_analysis.c b/ext/opcache/Optimizer/escape_analysis.c
new file mode 100644
index 0000000000..fa9d48fd3b
--- /dev/null
+++ b/ext/opcache/Optimizer/escape_analysis.c
@@ -0,0 +1,566 @@
+/*
+ +----------------------------------------------------------------------+
+ | Zend OPcache, Escape Analysis |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1998-2017 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Authors: Dmitry Stogov <dmitry@zend.com> |
+ +----------------------------------------------------------------------+
+*/
+
+#include "php.h"
+#include "Optimizer/zend_optimizer.h"
+#include "Optimizer/zend_optimizer_internal.h"
+#include "zend_bitset.h"
+#include "zend_cfg.h"
+#include "zend_ssa.h"
+#include "zend_inference.h"
+#include "zend_dump.h"
+
+/*
+ * T. Kotzmann and H. Mossenbock. Escape analysis in the context of dynamic
+ * compilation and deoptimization. In Proceedings of the International
+ * Conference on Virtual Execution Environments, pages 111-120, Chicago,
+ * June 2005
+ */
+
+static zend_always_inline void union_find_init(int *parent, int *size, int count) /* {{{ */
+{
+ int i;
+
+ for (i = 0; i < count; i++) {
+ parent[i] = i;
+ size[i] = 1;
+ }
+}
+/* }}} */
+
+static zend_always_inline int union_find_root(int *parent, int i) /* {{{ */
+{
+ int p = parent[i];
+
+ while (i != p) {
+ p = parent[p];
+ parent[i] = p;
+ i = p;
+ p = parent[i];
+ }
+ return i;
+}
+/* }}} */
+
+static zend_always_inline void union_find_unite(int *parent, int *size, int i, int j) /* {{{ */
+{
+ int r1 = union_find_root(parent, i);
+ int r2 = union_find_root(parent, j);
+
+ if (r1 != r2) {
+ if (size[r1] < size[r2]) {
+ parent[r1] = r2;
+ size[r2] += size[r1];
+ } else {
+ parent[r2] = r1;
+ size[r1] += size[r2];
+ }
+ }
+}
+/* }}} */
+
+static int zend_build_equi_escape_sets(int *parent, zend_op_array *op_array, zend_ssa *ssa) /* {{{ */
+{
+ zend_ssa_var *ssa_vars = ssa->vars;
+ int ssa_vars_count = ssa->vars_count;
+ zend_ssa_phi *p;
+ int i, j;
+ int *size;
+ ALLOCA_FLAG(use_heap)
+
+ size = do_alloca(sizeof(int) * ssa_vars_count, use_heap);
+ if (!size) {
+ return FAILURE;
+ }
+ union_find_init(parent, size, ssa_vars_count);
+
+ for (i = 0; i < ssa_vars_count; i++) {
+ if (ssa_vars[i].definition_phi) {
+ p = ssa_vars[i].definition_phi;
+ if (p->pi >= 0) {
+ union_find_unite(parent, size, i, p->sources[0]);
+ } else {
+ for (j = 0; j < ssa->cfg.blocks[p->block].predecessors_count; j++) {
+ union_find_unite(parent, size, i, p->sources[j]);
+ }
+ }
+ } else if (ssa_vars[i].definition >= 0) {
+ int def = ssa_vars[i].definition;
+ zend_ssa_op *op = ssa->ops + def;
+ zend_op *opline = op_array->opcodes + def;
+
+ if (op->op1_def >= 0) {
+ if (op->op1_use >= 0) {
+ if (opline->opcode != ZEND_ASSIGN) {
+ union_find_unite(parent, size, op->op1_def, op->op1_use);
+ }
+ }
+ if (opline->opcode == ZEND_ASSIGN && op->op2_use >= 0) {
+ union_find_unite(parent, size, op->op1_def, op->op2_use);
+ }
+ }
+ if (op->op2_def >= 0) {
+ if (op->op2_use >= 0) {
+ union_find_unite(parent, size, op->op2_def, op->op2_use);
+ }
+ }
+ if (op->result_def >= 0) {
+ if (op->result_use >= 0) {
+ if (opline->opcode != ZEND_QM_ASSIGN) {
+ union_find_unite(parent, size, op->result_def, op->result_use);
+ }
+ }
+ if (opline->opcode == ZEND_QM_ASSIGN && op->op1_use >= 0) {
+ union_find_unite(parent, size, op->result_def, op->op1_use);
+ }
+ if (opline->opcode == ZEND_ASSIGN && op->op2_use >= 0) {
+ union_find_unite(parent, size, op->result_def, op->op2_use);
+ }
+ if (opline->opcode == ZEND_ASSIGN && op->op1_def >= 0) {
+ union_find_unite(parent, size, op->result_def, op->op1_def);
+ }
+ }
+ }
+ }
+
+ for (i = 0; i < ssa_vars_count; i++) {
+ parent[i] = union_find_root(parent, i);
+ }
+
+ free_alloca(size, use_heap);
+
+ return SUCCESS;
+}
+/* }}} */
+
+static inline zend_class_entry *get_class_entry(const zend_script *script, zend_string *lcname) /* {{{ */
+{
+ zend_class_entry *ce = script ? zend_hash_find_ptr(&script->class_table, lcname) : NULL;
+ if (ce) {
+ return ce;
+ }
+
+ ce = zend_hash_find_ptr(CG(class_table), lcname);
+ if (ce && ce->type == ZEND_INTERNAL_CLASS) {
+ return ce;
+ }
+
+ return NULL;
+}
+/* }}} */
+
+static int is_allocation_def(zend_op_array *op_array, zend_ssa *ssa, int def, int var, const zend_script *script) /* {{{ */
+{
+ zend_ssa_op *op = ssa->ops + def;
+ zend_op *opline = op_array->opcodes + def;
+
+ if (op->result_def == var) {
+ switch (opline->opcode) {
+ case ZEND_INIT_ARRAY:
+ return 1;
+ case ZEND_NEW:
+ /* objects with destructors should escape */
+ if (opline->op1_type == IS_CONST) {
+ zend_class_entry *ce = get_class_entry(script, Z_STR_P(CRT_CONSTANT_EX(op_array, opline, opline->op1, ssa->rt_constants)+1));
+ if (ce && !ce->create_object && !ce->constructor &&
+ !ce->destructor && !ce->__get && !ce->__set &&
+ !(ce->ce_flags & ZEND_ACC_INHERITED)) {
+ return 1;
+ }
+ }
+ break;
+ case ZEND_QM_ASSIGN:
+ if (opline->op1_type == IS_CONST
+ && Z_TYPE_P(CRT_CONSTANT_EX(op_array, opline, opline->op1, ssa->rt_constants)) == IS_ARRAY) {
+ return 1;
+ }
+ if (opline->op1_type == IS_CV && (OP1_INFO() & MAY_BE_ARRAY)) {
+ return 1;
+ }
+ break;
+ case ZEND_ASSIGN:
+ if (opline->op1_type == IS_CV && (OP1_INFO() & MAY_BE_ARRAY)) {
+ return 1;
+ }
+ break;
+ }
+ } else if (op->op1_def == var) {
+ switch (opline->opcode) {
+ case ZEND_ASSIGN:
+ if (opline->op2_type == IS_CONST
+ && Z_TYPE_P(CRT_CONSTANT_EX(op_array, opline, opline->op2, ssa->rt_constants)) == IS_ARRAY) {
+ return 1;
+ }
+ if (opline->op2_type == IS_CV && (OP2_INFO() & MAY_BE_ARRAY)) {
+ return 1;
+ }
+ break;
+ case ZEND_ASSIGN_DIM:
+ case ZEND_ASSIGN_OBJ:
+ if (OP1_INFO() & (MAY_BE_UNDEF | MAY_BE_NULL | MAY_BE_FALSE)) {
+ /* implicit object/array allocation */
+ return 1;
+ }
+ break;
+ }
+ }
+
+ return 0;
+}
+/* }}} */
+
+static int is_local_def(zend_op_array *op_array, zend_ssa *ssa, int def, int var, const zend_script *script) /* {{{ */
+{
+ zend_ssa_op *op = ssa->ops + def;
+ zend_op *opline = op_array->opcodes + def;
+
+ if (op->result_def == var) {
+ switch (opline->opcode) {
+ case ZEND_INIT_ARRAY:
+ case ZEND_ADD_ARRAY_ELEMENT:
+ case ZEND_QM_ASSIGN:
+ case ZEND_ASSIGN:
+ return 1;
+ case ZEND_NEW:
+ /* objects with destructors should escape */
+ if (opline->op1_type == IS_CONST) {
+ zend_class_entry *ce = get_class_entry(script, Z_STR_P(CRT_CONSTANT_EX(op_array, opline, opline->op1, ssa->rt_constants)+1));
+ if (ce && !ce->create_object && !ce->constructor &&
+ !ce->destructor && !ce->__get && !ce->__set &&
+ !(ce->ce_flags & ZEND_ACC_INHERITED)) {
+ return 1;
+ }
+ }
+ break;
+ }
+ } else if (op->op1_def == var) {
+ switch (opline->opcode) {
+ case ZEND_ASSIGN:
+ return 1;
+ case ZEND_ASSIGN_DIM:
+ case ZEND_ASSIGN_OBJ:
+ return 1;
+ case ZEND_ASSIGN_ADD:
+ case ZEND_ASSIGN_SUB:
+ case ZEND_ASSIGN_MUL:
+ case ZEND_ASSIGN_DIV:
+ case ZEND_ASSIGN_MOD:
+ case ZEND_ASSIGN_SL:
+ case ZEND_ASSIGN_SR:
+ case ZEND_ASSIGN_CONCAT:
+ case ZEND_ASSIGN_BW_OR:
+ case ZEND_ASSIGN_BW_AND:
+ case ZEND_ASSIGN_BW_XOR:
+ case ZEND_ASSIGN_POW:
+ return (opline->extended_value != 0);
+ case ZEND_PRE_INC_OBJ:
+ case ZEND_PRE_DEC_OBJ:
+ case ZEND_POST_INC_OBJ:
+ case ZEND_POST_DEC_OBJ:
+ return 1;
+ }
+ }
+
+ return 0;
+}
+/* }}} */
+
+static int is_escape_use(zend_op_array *op_array, zend_ssa *ssa, int use, int var) /* {{{ */
+{
+ zend_ssa_op *op = ssa->ops + use;
+ zend_op *opline = op_array->opcodes + use;
+
+ if (op->op1_use == var) {
+ switch (opline->opcode) {
+ case ZEND_ASSIGN:
+ /* no_val */
+ break;
+ case ZEND_QM_ASSIGN:
+ if (opline->op1_type == IS_CV) {
+ if (OP1_INFO() & MAY_BE_OBJECT) {
+ /* object aliasing */
+ return 1;
+ }
+ }
+ break;
+ case ZEND_ISSET_ISEMPTY_DIM_OBJ:
+ case ZEND_ISSET_ISEMPTY_PROP_OBJ:
+ case ZEND_FETCH_DIM_R:
+ case ZEND_FETCH_OBJ_R:
+ case ZEND_FETCH_DIM_IS:
+ case ZEND_FETCH_OBJ_IS:
+ break;
+ case ZEND_ASSIGN_ADD:
+ case ZEND_ASSIGN_SUB:
+ case ZEND_ASSIGN_MUL:
+ case ZEND_ASSIGN_DIV:
+ case ZEND_ASSIGN_MOD:
+ case ZEND_ASSIGN_SL:
+ case ZEND_ASSIGN_SR:
+ case ZEND_ASSIGN_CONCAT:
+ case ZEND_ASSIGN_BW_OR:
+ case ZEND_ASSIGN_BW_AND:
+ case ZEND_ASSIGN_BW_XOR:
+ case ZEND_ASSIGN_POW:
+ if (!opline->extended_value) {
+ return 1;
+ }
+ /* break missing intentionally */
+ case ZEND_ASSIGN_DIM:
+ case ZEND_ASSIGN_OBJ:
+ break;
+ case ZEND_PRE_INC_OBJ:
+ case ZEND_PRE_DEC_OBJ:
+ case ZEND_POST_INC_OBJ:
+ case ZEND_POST_DEC_OBJ:
+ break;
+ case ZEND_INIT_ARRAY:
+ case ZEND_ADD_ARRAY_ELEMENT:
+ if (opline->extended_value & ZEND_ARRAY_ELEMENT_REF) {
+ return 1;
+ }
+ if (OP1_INFO() & MAY_BE_OBJECT) {
+ /* object aliasing */
+ return 1;
+ }
+ /* reference dependencies processed separately */
+ break;
+ case ZEND_OP_DATA:
+ if ((opline-1)->opcode != ZEND_ASSIGN_DIM
+ && (opline-1)->opcode != ZEND_ASSIGN_OBJ) {
+ return 1;
+ }
+ if (OP1_INFO() & MAY_BE_OBJECT) {
+ /* object aliasing */
+ return 1;
+ }
+ opline--;
+ op--;
+ if (opline->op1_type != IS_CV
+ || (OP1_INFO() & MAY_BE_REF)
+ || (op->op1_def >= 0 && ssa->vars[op->op1_def].alias)) {
+ /* asignment into escaping structure */
+ return 1;
+ }
+ /* reference dependencies processed separately */
+ break;
+ default:
+ return 1;
+ }
+ }
+
+ if (op->op2_use == var) {
+ switch (opline->opcode) {
+ case ZEND_ASSIGN:
+ if (opline->op1_type != IS_CV
+ || (OP1_INFO() & MAY_BE_REF)
+ || (op->op1_def >= 0 && ssa->vars[op->op1_def].alias)) {
+ /* asignment into escaping variable */
+ return 1;
+ }
+ if (opline->op2_type == IS_CV || opline->result_type != IS_UNUSED) {
+ if (OP2_INFO() & MAY_BE_OBJECT) {
+ /* object aliasing */
+ return 1;
+ }
+ }
+ break;
+ default:
+ return 1;
+ }
+ }
+
+ if (op->result_use == var) {
+ switch (opline->opcode) {
+ case ZEND_ASSIGN:
+ case ZEND_QM_ASSIGN:
+ case ZEND_INIT_ARRAY:
+ case ZEND_ADD_ARRAY_ELEMENT:
+ break;
+ default:
+ return 1;
+ }
+ }
+
+ return 0;
+}
+/* }}} */
+
+int zend_ssa_escape_analysis(const zend_script *script, zend_op_array *op_array, zend_ssa *ssa) /* {{{ */
+{
+ zend_ssa_var *ssa_vars = ssa->vars;
+ int ssa_vars_count = ssa->vars_count;
+ int i, root, use;
+ int *ees;
+ zend_bool has_allocations;
+ int num_non_escaped;
+ ALLOCA_FLAG(use_heap)
+
+ if (!ssa_vars) {
+ return SUCCESS;
+ }
+
+ has_allocations = 0;
+ for (i = op_array->last_var; i < ssa_vars_count; i++) {
+ if (ssa_vars[i].definition >= 0
+ && (ssa->var_info[i].type & (MAY_BE_ARRAY|MAY_BE_OBJECT))
+ && is_allocation_def(op_array, ssa, ssa_vars[i].definition, i, script)) {
+ has_allocations = 1;
+ break;
+ }
+ }
+ if (!has_allocations) {
+ return SUCCESS;
+ }
+
+
+ /* 1. Build EES (Equi-Esape Sets) */
+ ees = do_alloca(sizeof(int) * ssa_vars_count, use_heap);
+ if (!ees) {
+ return FAILURE;
+ }
+
+ if (zend_build_equi_escape_sets(ees, op_array, ssa) != SUCCESS) {
+ return FAILURE;
+ }
+
+ /* 2. Identify Allocations */
+ num_non_escaped = 0;
+ for (i = op_array->last_var; i < ssa_vars_count; i++) {
+ root = ees[i];
+ if (ssa_vars[root].escape_state > ESCAPE_STATE_NO_ESCAPE) {
+ /* already escape. skip */
+ } else if (ssa_vars[i].alias && (ssa->var_info[i].type & MAY_BE_REF)) {
+ if (ssa_vars[root].escape_state == ESCAPE_STATE_NO_ESCAPE) {
+ num_non_escaped--;
+ }
+ ssa_vars[root].escape_state = ESCAPE_STATE_GLOBAL_ESCAPE;
+ } else if (ssa_vars[i].definition >= 0
+ && (ssa->var_info[i].type & (MAY_BE_ARRAY|MAY_BE_OBJECT))) {
+ if (!is_local_def(op_array, ssa, ssa_vars[i].definition, i, script)) {
+ if (ssa_vars[root].escape_state == ESCAPE_STATE_NO_ESCAPE) {
+ num_non_escaped--;
+ }
+ ssa_vars[root].escape_state = ESCAPE_STATE_GLOBAL_ESCAPE;
+ } else if (ssa_vars[root].escape_state == ESCAPE_STATE_UNKNOWN
+ && is_allocation_def(op_array, ssa, ssa_vars[i].definition, i, script)) {
+ ssa_vars[root].escape_state = ESCAPE_STATE_NO_ESCAPE;
+ num_non_escaped++;
+ }
+ }
+ }
+
+ /* 3. Mark escaped EES */
+ if (num_non_escaped) {
+ for (i = 0; i < ssa_vars_count; i++) {
+ if (ssa_vars[i].use_chain >= 0) {
+ root = ees[i];
+ if (ssa_vars[root].escape_state == ESCAPE_STATE_NO_ESCAPE) {
+ FOREACH_USE(ssa_vars + i, use) {
+ if (is_escape_use(op_array, ssa, use, i)) {
+ ssa_vars[root].escape_state = ESCAPE_STATE_GLOBAL_ESCAPE;
+ num_non_escaped--;
+ if (num_non_escaped == 0) {
+ i = ssa_vars_count;
+ }
+ break;
+ }
+ } FOREACH_USE_END();
+ }
+ }
+ }
+ }
+
+ /* 4. Process referential dependencies */
+ if (num_non_escaped) {
+ zend_bool changed;
+
+ do {
+ changed = 0;
+ for (i = 0; i < ssa_vars_count; i++) {
+ if (ssa_vars[i].use_chain >= 0) {
+ root = ees[i];
+ if (ssa_vars[root].escape_state == ESCAPE_STATE_NO_ESCAPE) {
+ FOREACH_USE(ssa_vars + i, use) {
+ zend_ssa_op *op = ssa->ops + use;
+ zend_op *opline = op_array->opcodes + use;
+ int enclosing_root;
+
+ if (opline->opcode == ZEND_OP_DATA &&
+ ((opline-1)->opcode == ZEND_ASSIGN_DIM ||
+ (opline-1)->opcode == ZEND_ASSIGN_OBJ) &&
+ op->op1_use == i &&
+ (op-1)->op1_use >= 0) {
+ enclosing_root = ees[(op-1)->op1_use];
+ } else if ((opline->opcode == ZEND_INIT_ARRAY ||
+ opline->opcode == ZEND_ADD_ARRAY_ELEMENT) &&
+ op->op1_use == i &&
+ op->result_def >= 0) {
+ enclosing_root = ees[op->result_def];
+ } else {
+ continue;
+ }
+
+ if (ssa_vars[enclosing_root].escape_state == ESCAPE_STATE_UNKNOWN ||
+ ssa_vars[enclosing_root].escape_state > ssa_vars[root].escape_state) {
+ if (ssa_vars[enclosing_root].escape_state == ESCAPE_STATE_UNKNOWN) {
+ ssa_vars[root].escape_state = ESCAPE_STATE_GLOBAL_ESCAPE;
+ } else {
+ ssa_vars[root].escape_state = ssa_vars[enclosing_root].escape_state;
+ }
+ if (ssa_vars[root].escape_state == ESCAPE_STATE_GLOBAL_ESCAPE) {
+ num_non_escaped--;
+ if (num_non_escaped == 0) {
+ i = ssa_vars_count;
+ changed = 0;
+ } else {
+ changed = 1;
+ }
+ break;
+ } else {
+ changed = 1;
+ }
+ }
+ } FOREACH_USE_END();
+ }
+ }
+ }
+ } while (changed);
+ }
+
+ /* 5. Propagate values of escape sets to variables */
+ for (i = 0; i < ssa_vars_count; i++) {
+ root = ees[i];
+ if (i != root) {
+ ssa_vars[i].escape_state = ssa_vars[root].escape_state;
+ }
+ }
+
+ free_alloca(ees, use_heap);
+
+ return SUCCESS;
+}
+/* }}} */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * indent-tabs-mode: t
+ * End:
+ */
diff --git a/ext/opcache/Optimizer/optimize_func_calls.c b/ext/opcache/Optimizer/optimize_func_calls.c
index 5f3dc35dff..81d62ca171 100644
--- a/ext/opcache/Optimizer/optimize_func_calls.c
+++ b/ext/opcache/Optimizer/optimize_func_calls.c
@@ -123,7 +123,7 @@ static void zend_try_inline_call(zend_op_array *op_array, zend_op *fcall, zend_o
i = fcall->extended_value;
do {
- if (Z_CONSTANT_P(RT_CONSTANT(&func->op_array, func->op_array.opcodes[i].op2))) {
+ if (Z_TYPE_P(RT_CONSTANT(&func->op_array.opcodes[i], func->op_array.opcodes[i].op2)) == IS_CONSTANT_AST) {
return;
}
i++;
@@ -133,7 +133,7 @@ static void zend_try_inline_call(zend_op_array *op_array, zend_op *fcall, zend_o
if (RETURN_VALUE_USED(opline)) {
zval zv;
- ZVAL_DUP(&zv, RT_CONSTANT(&func->op_array, ret_opline->op1));
+ ZVAL_DUP(&zv, RT_CONSTANT(ret_opline, ret_opline->op1));
opline->opcode = ZEND_QM_ASSIGN;
opline->op1_type = IS_CONST;
opline->op1.constant = zend_optimizer_add_literal(op_array, &zv);
diff --git a/ext/opcache/Optimizer/pass1_5.c b/ext/opcache/Optimizer/pass1_5.c
index 7697fb1943..9f28019013 100644
--- a/ext/opcache/Optimizer/pass1_5.c
+++ b/ext/opcache/Optimizer/pass1_5.c
@@ -35,8 +35,6 @@
#include "zend_execute.h"
#include "zend_vm.h"
-#define ZEND_IS_CONSTANT_TYPE(t) ((t) == IS_CONSTANT)
-
void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx)
{
int i = 0;
@@ -305,11 +303,10 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx)
(Z_ACCESS_FLAGS(cc->value) & ZEND_ACC_PPP_MASK) == ZEND_ACC_PUBLIC) {
c = &cc->value;
if (Z_TYPE_P(c) == IS_CONSTANT_AST) {
- break;
- }
- if (ZEND_IS_CONSTANT_TYPE(Z_TYPE_P(c))) {
- if (!zend_optimizer_get_persistent_constant(Z_STR_P(c), &t, 1) ||
- ZEND_IS_CONSTANT_TYPE(Z_TYPE(t))) {
+ zend_ast *ast = Z_ASTVAL_P(c);
+ if (ast->kind != ZEND_AST_CONSTANT
+ || !zend_optimizer_get_persistent_constant(zend_ast_get_constant_name(ast), &t, 1)
+ || Z_TYPE(t) == IS_CONSTANT_AST) {
break;
}
} else {
diff --git a/ext/opcache/Optimizer/pass3.c b/ext/opcache/Optimizer/pass3.c
index 975a9ebebb..0461ed9434 100644
--- a/ext/opcache/Optimizer/pass3.c
+++ b/ext/opcache/Optimizer/pass3.c
@@ -427,6 +427,8 @@ continue_jmpznz_optimization:
}
break;
+ case ZEND_POST_INC_OBJ:
+ case ZEND_POST_DEC_OBJ:
case ZEND_POST_INC:
case ZEND_POST_DEC: {
/* POST_INC, FREE => PRE_INC */
diff --git a/ext/opcache/Optimizer/sccp.c b/ext/opcache/Optimizer/sccp.c
index c6aeebc96d..347e1cc77a 100644
--- a/ext/opcache/Optimizer/sccp.c
+++ b/ext/opcache/Optimizer/sccp.c
@@ -13,6 +13,7 @@
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Nikita Popov <nikic@php.net> |
+ | Dmitry Stogov <dmitry@zend.com> |
+----------------------------------------------------------------------+
*/
@@ -21,6 +22,7 @@
#include "ZendAccelerator.h"
#include "Optimizer/zend_optimizer_internal.h"
#include "Optimizer/zend_call_graph.h"
+#include "Optimizer/zend_inference.h"
#include "Optimizer/scdf.h"
#include "Optimizer/zend_dump.h"
#include "ext/standard/php_string.h"
@@ -64,6 +66,12 @@
* b) Otherwise, if we branch on TOP none of the successors are feasible.
* c) Otherwise (we branch on a constant), the feasible successors are marked based on the constant
* (usually only one successor will be feasible).
+ *
+ * The original SCCP algorithm is extended with ability to propagate constant array
+ * elements and object properties. The extension is based on a variation of Array
+ * SSA form and its application to Spare Constant Propagation, described at
+ * "Array SSA Form" by Vivek Sarkar, Kathleen Knobe and Stephen Fink in chapter
+ * 16 of the SSA book.
*/
#if 0
@@ -80,14 +88,42 @@ typedef struct _sccp_ctx {
zval bot;
} sccp_ctx;
-#define TOP ((zend_uchar)-1)
+#define TOP ((zend_uchar)-1)
#define BOT ((zend_uchar)-2)
+#define PARTIAL_ARRAY ((zend_uchar)-3)
+#define PARTIAL_OBJECT ((zend_uchar)-4)
#define IS_TOP(zv) (Z_TYPE_P(zv) == TOP)
#define IS_BOT(zv) (Z_TYPE_P(zv) == BOT)
+#define IS_PARTIAL_ARRAY(zv) (Z_TYPE_P(zv) == PARTIAL_ARRAY)
+#define IS_PARTIAL_OBJECT(zv) (Z_TYPE_P(zv) == PARTIAL_OBJECT)
#define MAKE_TOP(zv) (Z_TYPE_INFO_P(zv) = TOP)
#define MAKE_BOT(zv) (Z_TYPE_INFO_P(zv) = BOT)
+static void empty_partial_array(zval *zv)
+{
+ Z_TYPE_INFO_P(zv) = PARTIAL_ARRAY | (IS_TYPE_REFCOUNTED << Z_TYPE_FLAGS_SHIFT);
+ Z_ARR_P(zv) = zend_new_array(8);
+}
+
+static void dup_partial_array(zval *dst, zval *src)
+{
+ Z_TYPE_INFO_P(dst) = PARTIAL_ARRAY | (IS_TYPE_REFCOUNTED << Z_TYPE_FLAGS_SHIFT);
+ Z_ARR_P(dst) = zend_array_dup(Z_ARR_P(src));
+}
+
+static void empty_partial_object(zval *zv)
+{
+ Z_TYPE_INFO_P(zv) = PARTIAL_OBJECT | (IS_TYPE_REFCOUNTED << Z_TYPE_FLAGS_SHIFT);
+ Z_ARR_P(zv) = zend_new_array(8);
+}
+
+static void dup_partial_object(zval *dst, zval *src)
+{
+ Z_TYPE_INFO_P(dst) = PARTIAL_OBJECT | (IS_TYPE_REFCOUNTED << Z_TYPE_FLAGS_SHIFT);
+ Z_ARR_P(dst) = zend_array_dup(Z_ARR_P(src));
+}
+
static inline zend_bool value_known(zval *zv) {
return !IS_TOP(zv) && !IS_BOT(zv);
}
@@ -102,7 +138,7 @@ static void set_value(scdf_ctx *scdf, sccp_ctx *ctx, int var, zval *new) {
if (IS_BOT(new)) {
SCP_DEBUG("Lowering var %d to BOT\n", var);
- } else {
+ } else if (!IS_PARTIAL_ARRAY(new) && !IS_PARTIAL_OBJECT(new)) {
SCP_DEBUG("Lowering var %d to %Z\n", var, new);
}
@@ -113,6 +149,17 @@ static void set_value(scdf_ctx *scdf, sccp_ctx *ctx, int var, zval *new) {
return;
}
+ /* Always replace PARTIAL_(ARRAY|OBJECT), as new maybe changed by join_partial_(arrays|object) */
+ if (IS_PARTIAL_ARRAY(new) || IS_PARTIAL_OBJECT(new)) {
+ if (Z_TYPE_P(value) != Z_TYPE_P(new)
+ || zend_hash_num_elements(Z_ARR_P(new)) != zend_hash_num_elements(Z_ARR_P(value))) {
+ zval_ptr_dtor_nogc(value);
+ ZVAL_COPY(value, new);
+ scdf_add_to_worklist(scdf, var);
+ }
+ return;
+ }
+
#if ZEND_DEBUG
ZEND_ASSERT(zend_is_identical(value, new));
#endif
@@ -234,93 +281,6 @@ static zend_bool try_replace_op1(
zval zv;
ZVAL_COPY(&zv, value);
if (zend_optimizer_update_op1_const(ctx->scdf.op_array, opline, &zv)) {
- /* Reconstruct SSA */
- int num;
- zend_basic_block *block;
-
- switch (opline->opcode) {
- case ZEND_JMPZ:
- if (zend_is_true(&zv)) {
- MAKE_NOP(opline);
- num = ctx->scdf.ssa->cfg.map[opline - ctx->scdf.op_array->opcodes];
- block = &ctx->scdf.ssa->cfg.blocks[num];
- if (block->successors_count == 2) {
- if (block->successors[1] != block->successors[0]) {
- zend_ssa_remove_predecessor(ctx->scdf.ssa, num, block->successors[0]);
- }
- block->successors_count = 1;
- block->successors[0] = block->successors[1];
- }
- } else {
- opline->opcode = ZEND_JMP;
- COPY_NODE(opline->op1, opline->op2);
- num = ctx->scdf.ssa->cfg.map[opline - ctx->scdf.op_array->opcodes];
- block = &ctx->scdf.ssa->cfg.blocks[num];
- if (block->successors_count == 2) {
- if (block->successors[1] != block->successors[0]) {
- zend_ssa_remove_predecessor(ctx->scdf.ssa, num, block->successors[1]);
- }
- block->successors_count = 1;
- }
- }
- break;
- case ZEND_JMPNZ:
- if (zend_is_true(&zv)) {
- opline->opcode = ZEND_JMP;
- COPY_NODE(opline->op1, opline->op2);
- num = ctx->scdf.ssa->cfg.map[opline - ctx->scdf.op_array->opcodes];
- block = &ctx->scdf.ssa->cfg.blocks[num];
- if (block->successors_count == 2) {
- if (block->successors[1] != block->successors[0]) {
- zend_ssa_remove_predecessor(ctx->scdf.ssa, num, block->successors[1]);
- }
- block->successors_count = 1;
- }
- } else {
- MAKE_NOP(opline);
- num = ctx->scdf.ssa->cfg.map[opline - ctx->scdf.op_array->opcodes];
- block = &ctx->scdf.ssa->cfg.blocks[num];
- if (block->successors_count == 2) {
- if (block->successors[1] != block->successors[0]) {
- zend_ssa_remove_predecessor(ctx->scdf.ssa, num, block->successors[0]);
- }
- block->successors_count = 1;
- block->successors[0] = block->successors[1];
- }
- }
- break;
- case ZEND_JMPZNZ:
- if (zend_is_true(&zv)) {
- zend_op *target_opline = ZEND_OFFSET_TO_OPLINE(opline, opline->extended_value);
- ZEND_SET_OP_JMP_ADDR(opline, opline->op1, target_opline);
- num = ctx->scdf.ssa->cfg.map[opline - ctx->scdf.op_array->opcodes];
- block = &ctx->scdf.ssa->cfg.blocks[num];
- if (block->successors_count == 2) {
- if (block->successors[1] != block->successors[0]) {
- zend_ssa_remove_predecessor(ctx->scdf.ssa, num, block->successors[0]);
- }
- block->successors_count = 1;
- block->successors[0] = block->successors[1];
- }
- } else {
- zend_op *target_opline = ZEND_OP2_JMP_ADDR(opline);
- ZEND_SET_OP_JMP_ADDR(opline, opline->op1, target_opline);
- num = ctx->scdf.ssa->cfg.map[opline - ctx->scdf.op_array->opcodes];
- block = &ctx->scdf.ssa->cfg.blocks[num];
- if (block->successors_count == 2) {
- if (block->successors[1] != block->successors[0]) {
- zend_ssa_remove_predecessor(ctx->scdf.ssa, num, block->successors[1]);
- }
- block->successors_count = 1;
- }
- }
- opline->op1_type = IS_UNUSED;
- opline->extended_value = 0;
- opline->opcode = ZEND_JMP;
- break;
- default:
- break;
- }
return 1;
} else {
// TODO: check the following special cases ???
@@ -398,9 +358,9 @@ static inline int fetch_array_elem(zval **result, zval *op1, zval *op2) {
}
static inline int ct_eval_fetch_dim(zval *result, zval *op1, zval *op2, int support_strings) {
- if (Z_TYPE_P(op1) == IS_ARRAY) {
+ if (Z_TYPE_P(op1) == IS_ARRAY || IS_PARTIAL_ARRAY(op1)) {
zval *value;
- if (fetch_array_elem(&value, op1, op2) == SUCCESS && value) {
+ if (fetch_array_elem(&value, op1, op2) == SUCCESS && value && !IS_BOT(value)) {
ZVAL_COPY(result, value);
return SUCCESS;
}
@@ -418,11 +378,14 @@ static inline int ct_eval_fetch_dim(zval *result, zval *op1, zval *op2, int supp
}
static inline int ct_eval_isset_dim(zval *result, uint32_t extended_value, zval *op1, zval *op2) {
- if (Z_TYPE_P(op1) == IS_ARRAY) {
+ if (Z_TYPE_P(op1) == IS_ARRAY || IS_PARTIAL_ARRAY(op1)) {
zval *value;
if (fetch_array_elem(&value, op1, op2) == FAILURE) {
return FAILURE;
}
+ if (IS_PARTIAL_ARRAY(op1) && (!value || IS_BOT(value))) {
+ return FAILURE;
+ }
if (extended_value & ZEND_ISSET) {
ZVAL_BOOL(result, value && Z_TYPE_P(value) != IS_NULL);
} else {
@@ -439,6 +402,35 @@ static inline int ct_eval_isset_dim(zval *result, uint32_t extended_value, zval
}
}
+static inline int ct_eval_del_array_elem(zval *result, zval *key) {
+ ZEND_ASSERT(IS_PARTIAL_ARRAY(result));
+
+ switch (Z_TYPE_P(key)) {
+ case IS_NULL:
+ zend_hash_del(Z_ARR_P(result), ZSTR_EMPTY_ALLOC());
+ break;
+ case IS_FALSE:
+ zend_hash_index_del(Z_ARR_P(result), 0);
+ break;
+ case IS_TRUE:
+ zend_hash_index_del(Z_ARR_P(result), 1);
+ break;
+ case IS_LONG:
+ zend_hash_index_del(Z_ARR_P(result), Z_LVAL_P(key));
+ break;
+ case IS_DOUBLE:
+ zend_hash_index_del(Z_ARR_P(result), zend_dval_to_lval(Z_DVAL_P(key)));
+ break;
+ case IS_STRING:
+ zend_symtable_del(Z_ARR_P(result), Z_STR_P(key));
+ break;
+ default:
+ return FAILURE;
+ }
+
+ return SUCCESS;
+}
+
static inline int ct_eval_add_array_elem(zval *result, zval *value, zval *key) {
if (!key) {
if ((value = zend_hash_next_index_insert(Z_ARR_P(result), value))) {
@@ -483,6 +475,7 @@ static inline int ct_eval_assign_dim(zval *result, zval *value, zval *key) {
array_init(result);
/* break missing intentionally */
case IS_ARRAY:
+ case PARTIAL_ARRAY:
return ct_eval_add_array_elem(result, value, key);
case IS_STRING:
// TODO Before enabling this case, make sure ARRAY_DIM result op is correct
@@ -514,9 +507,95 @@ static inline int ct_eval_assign_dim(zval *result, zval *value, zval *key) {
}
}
+static inline int fetch_obj_prop(zval **result, zval *op1, zval *op2) {
+ switch (Z_TYPE_P(op2)) {
+ case IS_STRING:
+ *result = zend_symtable_find(Z_ARR_P(op1), Z_STR_P(op2));
+ return SUCCESS;
+ default:
+ return FAILURE;
+ }
+}
+
+static inline int ct_eval_fetch_obj(zval *result, zval *op1, zval *op2) {
+ if (IS_PARTIAL_OBJECT(op1)) {
+ zval *value;
+ if (fetch_obj_prop(&value, op1, op2) == SUCCESS && value && !IS_BOT(value)) {
+ ZVAL_COPY(result, value);
+ return SUCCESS;
+ }
+ }
+ return FAILURE;
+}
+
+static inline int ct_eval_isset_obj(zval *result, uint32_t extended_value, zval *op1, zval *op2) {
+ if (IS_PARTIAL_OBJECT(op1)) {
+ zval *value;
+ if (fetch_obj_prop(&value, op1, op2) == FAILURE) {
+ return FAILURE;
+ }
+ if (!value || IS_BOT(value)) {
+ return FAILURE;
+ }
+ if (extended_value & ZEND_ISSET) {
+ ZVAL_BOOL(result, value && Z_TYPE_P(value) != IS_NULL);
+ } else {
+ ZEND_ASSERT(extended_value & ZEND_ISEMPTY);
+ ZVAL_BOOL(result, !value || !zend_is_true(value));
+ }
+ return SUCCESS;
+ } else {
+ ZVAL_BOOL(result, extended_value != ZEND_ISSET);
+ return SUCCESS;
+ }
+}
+
+static inline int ct_eval_del_obj_prop(zval *result, zval *key) {
+ ZEND_ASSERT(IS_PARTIAL_OBJECT(result));
+
+ switch (Z_TYPE_P(key)) {
+ case IS_STRING:
+ zend_symtable_del(Z_ARR_P(result), Z_STR_P(key));
+ break;
+ default:
+ return FAILURE;
+ }
+
+ return SUCCESS;
+}
+
+static inline int ct_eval_add_obj_prop(zval *result, zval *value, zval *key) {
+ switch (Z_TYPE_P(key)) {
+ case IS_STRING:
+ value = zend_symtable_update(Z_ARR_P(result), Z_STR_P(key), value);
+ break;
+ default:
+ return FAILURE;
+ }
+
+ Z_TRY_ADDREF_P(value);
+ return SUCCESS;
+}
+
+static inline int ct_eval_assign_obj(zval *result, zval *value, zval *key) {
+ switch (Z_TYPE_P(result)) {
+ case IS_NULL:
+ case IS_FALSE:
+ empty_partial_object(result);
+ /* break missing intentionally */
+ case PARTIAL_OBJECT:
+ return ct_eval_add_obj_prop(result, value, key);
+ default:
+ return FAILURE;
+ }
+}
+
static inline int ct_eval_incdec(zval *result, zend_uchar opcode, zval *op1) {
ZVAL_COPY(result, op1);
- if (opcode == ZEND_PRE_INC || opcode == ZEND_POST_INC) {
+ if (opcode == ZEND_PRE_INC
+ || opcode == ZEND_POST_INC
+ || opcode == ZEND_PRE_INC_OBJ
+ || opcode == ZEND_POST_INC_OBJ) {
increment_function(result);
} else {
decrement_function(result);
@@ -856,7 +935,7 @@ static inline int ct_eval_func_call(
#define SET_RESULT_BOT(op) SET_RESULT(op, &ctx->bot)
#define SET_RESULT_TOP(op) SET_RESULT(op, &ctx->top)
-#define SKIP_IF_TOP(op) if (IS_TOP(op)) break;
+#define SKIP_IF_TOP(op) if (IS_TOP(op)) return;
static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_op) {
sccp_ctx *ctx = (sccp_ctx *) scdf;
@@ -897,11 +976,170 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o
}
break;
case ZEND_ASSIGN_DIM:
+ {
+ zval *data = get_op1_value(ctx, opline+1, ssa_op+1);
+
/* If $a in $a[$b]=$c is UNDEF, treat it like NULL. There is no warning. */
if ((ctx->scdf.ssa->var_info[ssa_op->op1_use].type & MAY_BE_ANY) == 0) {
op1 = &EG(uninitialized_zval);
}
- break;
+
+ if (IS_BOT(op1)) {
+ SET_RESULT_BOT(result);
+ SET_RESULT_BOT(op1);
+ return;
+ }
+
+ SKIP_IF_TOP(op1);
+ SKIP_IF_TOP(data);
+ if (op2) {
+ SKIP_IF_TOP(op2);
+ }
+
+ if (op2 && IS_BOT(op2)) {
+ /* Update of unknown index */
+ SET_RESULT_BOT(result);
+ if (ssa_op->op1_def >= 0
+ && ctx->scdf.ssa->vars[ssa_op->op1_def].escape_state == ESCAPE_STATE_NO_ESCAPE) {
+ empty_partial_array(&zv);
+ SET_RESULT(op1, &zv);
+ zval_ptr_dtor_nogc(&zv);
+ } else {
+ SET_RESULT_BOT(op1);
+ }
+ return;
+ }
+
+ if (IS_BOT(data)) {
+
+ SET_RESULT_BOT(result);
+ if ((IS_PARTIAL_ARRAY(op1)
+ || Z_TYPE_P(op1) == IS_NULL
+ || Z_TYPE_P(op1) == IS_FALSE
+ || Z_TYPE_P(op1) == IS_ARRAY)
+ && ssa_op->op1_def >= 0
+ && ctx->scdf.ssa->vars[ssa_op->op1_def].escape_state == ESCAPE_STATE_NO_ESCAPE) {
+
+ if (Z_TYPE_P(op1) == IS_NULL || Z_TYPE_P(op1) == IS_FALSE) {
+ empty_partial_array(&zv);
+ } else {
+ dup_partial_array(&zv, op1);
+ }
+
+ if (!op2) {
+ /* We can't add NEXT element into partial array (skip it) */
+ SET_RESULT(op1, &zv);
+ } else if (ct_eval_del_array_elem(&zv, op2) == SUCCESS) {
+ SET_RESULT(op1, &zv);
+ } else {
+ SET_RESULT_BOT(op1);
+ }
+
+ zval_ptr_dtor_nogc(&zv);
+ } else {
+ SET_RESULT_BOT(op1);
+ }
+
+ } else {
+
+ if (IS_PARTIAL_ARRAY(op1)) {
+ dup_partial_array(&zv, op1);
+ } else {
+ ZVAL_DUP(&zv, op1);
+ }
+
+ if (!op2 && IS_PARTIAL_ARRAY(&zv)) {
+ /* We can't add NEXT element into partial array (skip it) */
+ SET_RESULT(result, data);
+ SET_RESULT(op1, &zv);
+ } else if (ct_eval_assign_dim(&zv, data, op2) == SUCCESS) {
+ SET_RESULT(result, data);
+ SET_RESULT(op1, &zv);
+ } else {
+ SET_RESULT_BOT(result);
+ SET_RESULT_BOT(op1);
+ }
+
+ zval_ptr_dtor_nogc(&zv);
+ }
+ return;
+ }
+
+ case ZEND_ASSIGN_OBJ:
+ if (ssa_op->op1_def >= 0
+ && ctx->scdf.ssa->vars[ssa_op->op1_def].escape_state == ESCAPE_STATE_NO_ESCAPE) {
+ zval *data = get_op1_value(ctx, opline+1, ssa_op+1);
+
+ /* If $a in $a->foo=$c is UNDEF, treat it like NULL. There is no warning. */
+ if ((ctx->scdf.ssa->var_info[ssa_op->op1_use].type & MAY_BE_ANY) == 0) {
+ op1 = &EG(uninitialized_zval);
+ }
+
+ if (IS_BOT(op1)) {
+ SET_RESULT_BOT(result);
+ SET_RESULT_BOT(op1);
+ return;
+ }
+
+ SKIP_IF_TOP(op1);
+ SKIP_IF_TOP(data);
+ SKIP_IF_TOP(op2);
+
+ if (IS_BOT(op2)) {
+ /* Update of unknown property */
+ SET_RESULT_BOT(result);
+ empty_partial_object(&zv);
+ SET_RESULT(op1, &zv);
+ zval_ptr_dtor_nogc(&zv);
+ return;
+ }
+
+ if (IS_BOT(data)) {
+ SET_RESULT_BOT(result);
+ if (IS_PARTIAL_OBJECT(op1)
+ || Z_TYPE_P(op1) == IS_NULL
+ || Z_TYPE_P(op1) == IS_FALSE) {
+
+ if (Z_TYPE_P(op1) == IS_NULL || Z_TYPE_P(op1) == IS_FALSE) {
+ empty_partial_object(&zv);
+ } else {
+ dup_partial_object(&zv, op1);
+ }
+
+ if (ct_eval_del_obj_prop(&zv, op2) == SUCCESS) {
+ SET_RESULT(op1, &zv);
+ } else {
+ SET_RESULT_BOT(op1);
+ }
+ zval_ptr_dtor_nogc(&zv);
+ } else {
+ SET_RESULT_BOT(op1);
+ }
+
+ } else {
+
+ if (IS_PARTIAL_OBJECT(op1)) {
+ dup_partial_object(&zv, op1);
+ } else {
+ ZVAL_COPY(&zv, op1);
+ }
+
+ if (ct_eval_assign_obj(&zv, data, op2) == SUCCESS) {
+ SET_RESULT(result, data);
+ SET_RESULT(op1, &zv);
+ } else {
+ SET_RESULT_BOT(result);
+ SET_RESULT_BOT(op1);
+ }
+
+ zval_ptr_dtor_nogc(&zv);
+ }
+ } else {
+ SET_RESULT_BOT(result);
+ SET_RESULT_BOT(op1);
+ }
+ return;
+
case ZEND_SEND_VAL:
case ZEND_SEND_VAR:
{
@@ -921,6 +1159,113 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o
ssa_op = &ctx->scdf.ssa->ops[opline - ctx->scdf.op_array->opcodes];
break;
}
+ case ZEND_INIT_ARRAY:
+ case ZEND_ADD_ARRAY_ELEMENT:
+ {
+ zval *result = NULL;
+
+ if (opline->opcode == ZEND_ADD_ARRAY_ELEMENT) {
+ result = &ctx->values[ssa_op->result_use];
+ if (IS_BOT(result)) {
+ SET_RESULT_BOT(result);
+ SET_RESULT_BOT(op1);
+ return;
+ }
+ SKIP_IF_TOP(result);
+ }
+
+ if (op1) {
+ SKIP_IF_TOP(op1);
+ }
+
+ if (op2) {
+ SKIP_IF_TOP(op2);
+ }
+
+ /* We want to avoid keeping around intermediate arrays for each SSA variable in the
+ * ADD_ARRAY_ELEMENT chain. We do this by only keeping the array on the last opcode
+ * and use a NULL value everywhere else. */
+ if (Z_TYPE(ctx->values[ssa_op->result_def]) == IS_NULL) {
+ return;
+ }
+
+ if (op2 && IS_BOT(op2)) {
+ /* Update of unknown index */
+ SET_RESULT_BOT(op1);
+ if (ssa_op->result_def >= 0
+ && ctx->scdf.ssa->vars[ssa_op->result_def].escape_state == ESCAPE_STATE_NO_ESCAPE) {
+ empty_partial_array(&zv);
+ SET_RESULT(result, &zv);
+ zval_ptr_dtor_nogc(&zv);
+ } else {
+ SET_RESULT_BOT(result);
+ }
+ return;
+ }
+
+ if ((op1 && IS_BOT(op1))
+ || (opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
+
+ SET_RESULT_BOT(op1);
+ if (ssa_op->result_def >= 0
+ && ctx->scdf.ssa->vars[ssa_op->result_def].escape_state == ESCAPE_STATE_NO_ESCAPE) {
+ if (!result) {
+ empty_partial_array(&zv);
+ } else {
+ Z_TYPE_INFO_P(result) = PARTIAL_ARRAY | (IS_TYPE_REFCOUNTED << Z_TYPE_FLAGS_SHIFT);
+ ZVAL_COPY_VALUE(&zv, result);
+ ZVAL_NULL(result);
+ }
+ if (!op2) {
+ /* We can't add NEXT element into partial array (skip it) */
+ SET_RESULT(result, &zv);
+ } else if (ct_eval_del_array_elem(&zv, op2) == SUCCESS) {
+ SET_RESULT(result, &zv);
+ } else {
+ SET_RESULT_BOT(result);
+ }
+ zval_ptr_dtor_nogc(&zv);
+ } else {
+ /* If any operand is BOT, mark the result as BOT right away.
+ * Exceptions to this rule are handled above. */
+ SET_RESULT_BOT(result);
+ }
+
+ } else {
+ if (result) {
+ ZVAL_COPY_VALUE(&zv, result);
+ ZVAL_NULL(result);
+ } else {
+ array_init(&zv);
+ }
+
+ if (op1) {
+ if (!op2 && IS_PARTIAL_ARRAY(&zv)) {
+ /* We can't add NEXT element into partial array (skip it) */
+ SET_RESULT(result, &zv);
+ } else if (ct_eval_add_array_elem(&zv, op1, op2) == SUCCESS) {
+ SET_RESULT(result, &zv);
+ } else {
+ SET_RESULT_BOT(result);
+ }
+ } else {
+ SET_RESULT(result, &zv);
+ }
+
+ zval_ptr_dtor_nogc(&zv);
+ }
+ return;
+ }
+ case ZEND_NEW:
+ if (ssa_op->result_def >= 0
+ && ctx->scdf.ssa->vars[ssa_op->result_def].escape_state == ESCAPE_STATE_NO_ESCAPE) {
+ empty_partial_object(&zv);
+ SET_RESULT(result, &zv);
+ zval_ptr_dtor_nogc(&zv);
+ } else {
+ SET_RESULT_BOT(result);
+ }
+ return;
}
if ((op1 && IS_BOT(op1)) || (op2 && IS_BOT(op2))) {
@@ -976,21 +1321,126 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o
case ZEND_ASSIGN_BW_AND:
case ZEND_ASSIGN_BW_XOR:
case ZEND_ASSIGN_POW:
- /* Obj/dim compound assign */
- if (opline->extended_value) {
- SET_RESULT_BOT(op1);
- SET_RESULT_BOT(result);
- break;
+ if (op1) {
+ SKIP_IF_TOP(op1);
+ }
+ if (op2) {
+ SKIP_IF_TOP(op2);
}
+ if (!opline->extended_value) {
+ if (zend_optimizer_eval_binary_op(&zv, zend_compound_assign_to_binary_op(opline->opcode), op1, op2) == SUCCESS) {
+ SET_RESULT(op1, &zv);
+ SET_RESULT(result, &zv);
+ zval_ptr_dtor_nogc(&zv);
+ break;
+ }
+ } else if (opline->extended_value == ZEND_ASSIGN_DIM) {
+ if ((IS_PARTIAL_ARRAY(op1) || Z_TYPE_P(op1) == IS_ARRAY)
+ && ssa_op->op1_def >= 0
+ && ctx->scdf.ssa->vars[ssa_op->op1_def].escape_state == ESCAPE_STATE_NO_ESCAPE
+ && op2) {
+ zval tmp;
+ zval *data = get_op1_value(ctx, opline+1, ssa_op+1);
+
+ SKIP_IF_TOP(data);
+
+ if (ct_eval_fetch_dim(&tmp, op1, op2, 0) == SUCCESS) {
+ if (IS_BOT(data)) {
+ dup_partial_array(&zv, op1);
+ ct_eval_del_array_elem(&zv, op2);
+ } else {
+ if (zend_optimizer_eval_binary_op(&tmp, zend_compound_assign_to_binary_op(opline->opcode), &tmp, data) != SUCCESS) {
+ SET_RESULT_BOT(result);
+ SET_RESULT_BOT(op1);
+ zval_ptr_dtor_nogc(&tmp);
+ break;
+ }
- SKIP_IF_TOP(op1);
- SKIP_IF_TOP(op2);
+ if (IS_PARTIAL_ARRAY(op1)) {
+ dup_partial_array(&zv, op1);
+ } else {
+ ZVAL_DUP(&zv, op1);
+ }
+ }
- if (zend_optimizer_eval_binary_op(&zv, zend_compound_assign_to_binary_op(opline->opcode), op1, op2) == SUCCESS) {
- SET_RESULT(op1, &zv);
- SET_RESULT(result, &zv);
- zval_ptr_dtor_nogc(&zv);
- break;
+ if (ct_eval_assign_dim(&zv, &tmp, op2) == SUCCESS) {
+ SET_RESULT(result, &tmp);
+ SET_RESULT(op1, &zv);
+ zval_ptr_dtor_nogc(&tmp);
+ zval_ptr_dtor_nogc(&zv);
+ break;
+ }
+ zval_ptr_dtor_nogc(&tmp);
+ zval_ptr_dtor_nogc(&zv);
+ }
+ }
+ } else if (opline->extended_value == ZEND_ASSIGN_OBJ) {
+ if (op1 && IS_PARTIAL_OBJECT(op1)
+ && ssa_op->op1_def >= 0
+ && ctx->scdf.ssa->vars[ssa_op->op1_def].escape_state == ESCAPE_STATE_NO_ESCAPE) {
+ zval tmp;
+ zval *data = get_op1_value(ctx, opline+1, ssa_op+1);
+
+ SKIP_IF_TOP(data);
+
+ if (ct_eval_fetch_obj(&tmp, op1, op2) == SUCCESS) {
+ if (IS_BOT(data)) {
+ dup_partial_object(&zv, op1);
+ ct_eval_del_obj_prop(&zv, op2);
+ } else {
+ if (zend_optimizer_eval_binary_op(&tmp, zend_compound_assign_to_binary_op(opline->opcode), &tmp, data) != SUCCESS) {
+ SET_RESULT_BOT(result);
+ SET_RESULT_BOT(op1);
+ zval_ptr_dtor_nogc(&tmp);
+ break;
+ }
+
+ dup_partial_object(&zv, op1);
+ }
+
+ if (ct_eval_assign_obj(&zv, &tmp, op2) == SUCCESS) {
+ SET_RESULT(result, &tmp);
+ SET_RESULT(op1, &zv);
+ zval_ptr_dtor_nogc(&tmp);
+ zval_ptr_dtor_nogc(&zv);
+ break;
+ }
+ zval_ptr_dtor_nogc(&tmp);
+ zval_ptr_dtor_nogc(&zv);
+ }
+ }
+ }
+ SET_RESULT_BOT(result);
+ SET_RESULT_BOT(op1);
+ break;
+ case ZEND_PRE_INC_OBJ:
+ case ZEND_PRE_DEC_OBJ:
+ case ZEND_POST_INC_OBJ:
+ case ZEND_POST_DEC_OBJ:
+ if (op1) {
+ SKIP_IF_TOP(op1);
+ SKIP_IF_TOP(op2);
+ if (IS_PARTIAL_OBJECT(op1)
+ && ssa_op->op1_def >= 0
+ && ctx->scdf.ssa->vars[ssa_op->op1_def].escape_state == ESCAPE_STATE_NO_ESCAPE) {
+ zval tmp1, tmp2;
+
+ if (ct_eval_fetch_obj(&tmp1, op1, op2) == SUCCESS
+ && ct_eval_incdec(&tmp2, opline->opcode, &tmp1) == SUCCESS) {
+
+ dup_partial_object(&zv, op1);
+ ct_eval_assign_obj(&zv, &tmp2, op2);
+ if (opline->opcode == ZEND_PRE_INC_OBJ
+ || opline->opcode == ZEND_PRE_DEC_OBJ) {
+ SET_RESULT(result, &tmp2);
+ } else {
+ SET_RESULT(result, &tmp1);
+ }
+ SET_RESULT(op1, &zv);
+ zval_ptr_dtor_nogc(&zv);
+ break;
+ }
+ }
}
SET_RESULT_BOT(op1);
SET_RESULT_BOT(result);
@@ -1097,6 +1547,33 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o
}
SET_RESULT_BOT(result);
break;
+ case ZEND_FETCH_OBJ_R:
+ case ZEND_FETCH_OBJ_IS:
+ if (op1) {
+ SKIP_IF_TOP(op1);
+ SKIP_IF_TOP(op2);
+
+ if (ct_eval_fetch_obj(&zv, op1, op2) == SUCCESS) {
+ SET_RESULT(result, &zv);
+ zval_ptr_dtor_nogc(&zv);
+ break;
+ }
+ }
+ SET_RESULT_BOT(result);
+ break;
+ case ZEND_ISSET_ISEMPTY_PROP_OBJ:
+ if (op1) {
+ SKIP_IF_TOP(op1);
+ SKIP_IF_TOP(op2);
+
+ if (ct_eval_isset_obj(&zv, opline->extended_value, op1, op2) == SUCCESS) {
+ SET_RESULT(result, &zv);
+ zval_ptr_dtor_nogc(&zv);
+ break;
+ }
+ }
+ SET_RESULT_BOT(result);
+ break;
case ZEND_QM_ASSIGN:
case ZEND_JMP_SET:
case ZEND_COALESCE:
@@ -1152,80 +1629,6 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o
}
SET_RESULT_BOT(result);
break;
- case ZEND_INIT_ARRAY:
- case ZEND_ADD_ARRAY_ELEMENT:
- {
- zval *result = NULL;
- if (opline->extended_value & ZEND_ARRAY_ELEMENT_REF) {
- SET_RESULT_BOT(result);
- SET_RESULT_BOT(op1);
- break;
- }
-
- if (opline->opcode == ZEND_ADD_ARRAY_ELEMENT) {
- result = &ctx->values[ssa_op->result_use];
- if (IS_BOT(result)) {
- SET_RESULT_BOT(result);
- break;
- }
- SKIP_IF_TOP(result);
- }
-
- SKIP_IF_TOP(op1);
- if (op2) {
- SKIP_IF_TOP(op2);
- }
-
- /* We want to avoid keeping around intermediate arrays for each SSA variable in the
- * ADD_ARRAY_ELEMENT chain. We do this by only keeping the array on the last opcode
- * and use a NULL value everywhere else. */
- if (Z_TYPE(ctx->values[ssa_op->result_def]) == IS_NULL) {
- break;
- }
-
- if (result) {
- ZVAL_COPY_VALUE(&zv, result);
- ZVAL_NULL(result);
- } else {
- array_init(&zv);
- }
-
- if (ct_eval_add_array_elem(&zv, op1, op2) == SUCCESS) {
- SET_RESULT(result, &zv);
- zval_ptr_dtor_nogc(&zv);
- break;
- }
- SET_RESULT_BOT(result);
- zval_ptr_dtor_nogc(&zv);
- break;
- }
- case ZEND_ASSIGN_DIM:
- {
- zval *data = get_op1_value(ctx, opline+1, ssa_op+1);
- if (IS_BOT(data)) {
- SET_RESULT_BOT(op1);
- SET_RESULT_BOT(result);
- break;
- }
-
- SKIP_IF_TOP(data);
- SKIP_IF_TOP(op1);
- if (op2) {
- SKIP_IF_TOP(op2);
- }
-
- ZVAL_DUP(&zv, op1);
- if (ct_eval_assign_dim(&zv, data, op2) == SUCCESS) {
- SET_RESULT(result, data);
- SET_RESULT(op1, &zv);
- zval_ptr_dtor_nogc(&zv);
- break;
- }
- SET_RESULT_BOT(result);
- SET_RESULT_BOT(op1);
- zval_ptr_dtor_nogc(&zv);
- break;
- }
case ZEND_DO_ICALL:
{
zend_call_info *call;
@@ -1358,7 +1761,7 @@ static void sccp_mark_feasible_successors(
break;
case ZEND_FE_RESET_R:
case ZEND_FE_RESET_RW:
- if (Z_TYPE_P(op1) != IS_ARRAY) {
+ if (Z_TYPE_P(op1) != IS_ARRAY && !IS_PARTIAL_ARRAY(op1)) {
scdf_mark_edge_feasible(scdf, block_num, block->successors[0]);
scdf_mark_edge_feasible(scdf, block_num, block->successors[1]);
return;
@@ -1374,7 +1777,63 @@ static void sccp_mark_feasible_successors(
scdf_mark_edge_feasible(scdf, block_num, block->successors[s]);
}
-static void join_phi_values(zval *a, zval *b) {
+static void join_hash_tables(HashTable *ret, HashTable *ht1, HashTable *ht2)
+{
+ zend_ulong index;
+ zend_string *key;
+ zval *val1, *val2;
+
+ ZEND_HASH_FOREACH_KEY_VAL(ht1, index, key, val1) {
+ if (key) {
+ val2 = zend_hash_find(ht2, key);
+ } else {
+ val2 = zend_hash_index_find(ht2, index);
+ }
+ if (val2 && zend_is_identical(val1, val2)) {
+ if (key) {
+ val1 = zend_hash_add_new(ret, key, val1);
+ } else {
+ val1 = zend_hash_index_add_new(ret, index, val1);
+ }
+ Z_TRY_ADDREF_P(val1);
+ }
+ } ZEND_HASH_FOREACH_END();
+}
+
+static int join_partial_arrays(zval *a, zval *b)
+{
+ zval ret;
+
+ if ((Z_TYPE_P(a) != IS_ARRAY && !IS_PARTIAL_ARRAY(a))
+ || (Z_TYPE_P(b) != IS_ARRAY && !IS_PARTIAL_ARRAY(b))) {
+ return FAILURE;
+ }
+
+ empty_partial_array(&ret);
+ join_hash_tables(Z_ARRVAL(ret), Z_ARRVAL_P(a), Z_ARRVAL_P(b));
+ zval_ptr_dtor_nogc(a);
+ ZVAL_COPY_VALUE(a, &ret);
+
+ return SUCCESS;
+}
+
+static int join_partial_objects(zval *a, zval *b)
+{
+ zval ret;
+
+ if (!IS_PARTIAL_OBJECT(a) || !IS_PARTIAL_OBJECT(b)) {
+ return FAILURE;
+ }
+
+ empty_partial_object(&ret);
+ join_hash_tables(Z_ARRVAL(ret), Z_ARRVAL_P(a), Z_ARRVAL_P(b));
+ zval_ptr_dtor_nogc(a);
+ ZVAL_COPY_VALUE(a, &ret);
+
+ return SUCCESS;
+}
+
+static void join_phi_values(zval *a, zval *b, zend_bool escape) {
if (IS_BOT(a) || IS_TOP(b)) {
return;
}
@@ -1383,9 +1842,26 @@ static void join_phi_values(zval *a, zval *b) {
ZVAL_COPY(a, b);
return;
}
- if (IS_BOT(b) || !zend_is_identical(a, b)) {
+ if (IS_BOT(b)) {
zval_ptr_dtor_nogc(a);
MAKE_BOT(a);
+ return;
+ }
+ if (IS_PARTIAL_ARRAY(a) || IS_PARTIAL_ARRAY(b)) {
+ if (escape || join_partial_arrays(a, b) != SUCCESS) {
+ zval_ptr_dtor_nogc(a);
+ MAKE_BOT(a);
+ }
+ } else if (IS_PARTIAL_OBJECT(a) || IS_PARTIAL_OBJECT(b)) {
+ if (escape || join_partial_objects(a, b) != SUCCESS) {
+ zval_ptr_dtor_nogc(a);
+ MAKE_BOT(a);
+ }
+ } else if (!zend_is_identical(a, b)) {
+ if (escape || join_partial_arrays(a, b) != SUCCESS) {
+ zval_ptr_dtor_nogc(a);
+ MAKE_BOT(a);
+ }
}
}
@@ -1404,14 +1880,14 @@ static void sccp_visit_phi(scdf_ctx *scdf, zend_ssa_phi *phi) {
if (phi->pi >= 0) {
ZEND_ASSERT(phi->sources[0] >= 0);
if (scdf_is_edge_feasible(scdf, phi->pi, phi->block)) {
- join_phi_values(&result, &ctx->values[phi->sources[0]]);
+ join_phi_values(&result, &ctx->values[phi->sources[0]], ssa->vars[phi->ssa_var].escape_state != ESCAPE_STATE_NO_ESCAPE);
}
} else {
for (i = 0; i < block->predecessors_count; i++) {
ZEND_ASSERT(phi->sources[i] >= 0);
if (scdf_is_edge_feasible(scdf, predecessors[i], phi->block)) {
SCP_DEBUG("val, ");
- join_phi_values(&result, &ctx->values[phi->sources[i]]);
+ join_phi_values(&result, &ctx->values[phi->sources[i]], ssa->vars[phi->ssa_var].escape_state != ESCAPE_STATE_NO_ESCAPE);
} else {
SCP_DEBUG("--, ");
}
@@ -1461,6 +1937,237 @@ static zval *value_from_type_and_range(sccp_ctx *ctx, int var_num, zval *tmp) {
return NULL;
}
+/* Call instruction -> remove opcodes that are part of the call */
+static int remove_call(sccp_ctx *ctx, zend_op *opline, zend_ssa_op *ssa_op)
+{
+ zend_ssa *ssa = ctx->scdf.ssa;
+ zend_op_array *op_array = ctx->scdf.op_array;
+ zend_call_info *call;
+ int i;
+
+ ZEND_ASSERT(ctx->call_map);
+ call = ctx->call_map[opline - op_array->opcodes];
+ ZEND_ASSERT(call);
+ ZEND_ASSERT(call->caller_call_opline == opline);
+ zend_ssa_remove_instr(ssa, opline, ssa_op);
+ zend_ssa_remove_instr(ssa, call->caller_init_opline,
+ &ssa->ops[call->caller_init_opline - op_array->opcodes]);
+
+ for (i = 0; i < call->num_args; i++) {
+ zend_ssa_remove_instr(ssa, call->arg_info[i].opline,
+ &ssa->ops[call->arg_info[i].opline - op_array->opcodes]);
+ }
+
+ // TODO: remove call_info completely???
+ call->callee_func = NULL;
+
+ return call->num_args + 2;
+}
+
+/* This is a basic DCE pass we run after SCCP. It only works on those instructions those result
+ * value(s) were determined by SCCP. It removes dead computational instructions and converts
+ * CV-affecting instructions into CONST ASSIGNs. This basic DCE is performed for multiple reasons:
+ * a) During operand replacement we eliminate FREEs. The corresponding computational instructions
+ * must be removed to avoid leaks. This way SCCP can run independently of the full DCE pass.
+ * b) The main DCE pass relies on type analysis to determine whether instructions have side-effects
+ * and can't be DCEd. This means that it will not be able collect all instructions rendered dead
+ * by SCCP, because they may have potentially side-effecting types, but the actual values are
+ * not. As such doing DCE here will allow us to eliminate more dead code in combination.
+ * c) The ordinary DCE pass cannot collect dead calls. However SCCP can result in dead calls, which
+ * we need to collect.
+ * d) The ordinary DCE pass cannot collect construction of dead non-escaping arrays and objects.
+ */
+static int try_remove_definition(sccp_ctx *ctx, int var_num, zend_ssa_var *var, zval *value)
+{
+ zend_ssa *ssa = ctx->scdf.ssa;
+ zend_op_array *op_array = ctx->scdf.op_array;
+ int removed_ops = 0;
+
+ if (var->definition >= 0) {
+ zend_op *opline = &op_array->opcodes[var->definition];
+ zend_ssa_op *ssa_op = &ssa->ops[var->definition];
+
+ if (opline->opcode == ZEND_ASSIGN) {
+ /* Leave assigns to DCE (due to dtor effects) */
+ return 0;
+ }
+
+ if (ssa_op->result_def == var_num) {
+ if (ssa_op->op1_def >= 0
+ || ssa_op->op2_def >= 0) {
+ /* we cannot remove instruction that defines other varibales */
+ return 0;
+ } else if (opline->opcode == ZEND_JMPZ_EX
+ || opline->opcode == ZEND_JMPNZ_EX
+ || opline->opcode == ZEND_JMP_SET
+ || opline->opcode == ZEND_COALESCE
+ || opline->opcode == ZEND_FE_RESET_R
+ || opline->opcode == ZEND_FE_RESET_RW
+ || opline->opcode == ZEND_FE_FETCH_R
+ || opline->opcode == ZEND_FE_FETCH_RW
+ || opline->opcode == ZEND_NEW) {
+ /* we cannot simple remove jump instructions */
+ return 0;
+ } else if (var->use_chain >= 0
+ || var->phi_use_chain != NULL) {
+ if (value
+ && opline->result_type & (IS_VAR|IS_TMP_VAR)
+ && opline->opcode != ZEND_QM_ASSIGN
+ && opline->opcode != ZEND_ROPE_INIT
+ && opline->opcode != ZEND_ROPE_ADD
+ && opline->opcode != ZEND_INIT_ARRAY
+ && opline->opcode != ZEND_ADD_ARRAY_ELEMENT) {
+ /* Replace with QM_ASSIGN */
+ zend_uchar old_type = opline->result_type;
+ uint32_t old_var = opline->result.var;
+
+ ssa_op->result_def = -1;
+ zend_optimizer_remove_live_range_ex(op_array, opline->result.var, var->definition);
+ if (opline->opcode == ZEND_DO_ICALL) {
+ removed_ops = remove_call(ctx, opline, ssa_op) - 1;
+ } else {
+ zend_ssa_remove_instr(ssa, opline, ssa_op);
+ }
+ ssa_op->result_def = var_num;
+ opline->opcode = ZEND_QM_ASSIGN;
+ opline->result_type = old_type;
+ opline->result.var = old_var;
+ Z_TRY_ADDREF_P(value);
+ zend_optimizer_update_op1_const(ctx->scdf.op_array, opline, value);
+ }
+ return 0;
+ } else {
+ if (opline->result_type & (IS_TMP_VAR|IS_VAR)) {
+ zend_optimizer_remove_live_range_ex(op_array, opline->result.var, var->definition);
+ }
+ zend_ssa_remove_result_def(ssa, ssa_op);
+ if (opline->opcode == ZEND_DO_ICALL) {
+ removed_ops = remove_call(ctx, opline, ssa_op);
+ } else {
+ zend_ssa_remove_instr(ssa, opline, ssa_op);
+ removed_ops++;
+ }
+ }
+ } else if (ssa_op->op1_def == var_num) {
+ /* Compound assign or incdec -> convert to direct ASSIGN */
+
+ if (!value) {
+ /* In some cases zend_may_throw() may be avoided */
+ switch (opline->opcode) {
+ case ZEND_ASSIGN_DIM:
+ case ZEND_ASSIGN_OBJ:
+ case ZEND_ASSIGN_ADD:
+ case ZEND_ASSIGN_SUB:
+ case ZEND_ASSIGN_MUL:
+ case ZEND_ASSIGN_DIV:
+ case ZEND_ASSIGN_MOD:
+ case ZEND_ASSIGN_SL:
+ case ZEND_ASSIGN_SR:
+ case ZEND_ASSIGN_CONCAT:
+ case ZEND_ASSIGN_BW_OR:
+ case ZEND_ASSIGN_BW_AND:
+ case ZEND_ASSIGN_BW_XOR:
+ case ZEND_ASSIGN_POW:
+ if ((ssa_op->op2_use >= 0 && !value_known(&ctx->values[ssa_op->op2_use]))
+ || ((ssa_op+1)->op1_use >= 0 &&!value_known(&ctx->values[(ssa_op+1)->op1_use]))) {
+ return 0;
+ }
+ break;
+ case ZEND_PRE_INC_OBJ:
+ case ZEND_PRE_DEC_OBJ:
+ case ZEND_POST_INC_OBJ:
+ case ZEND_POST_DEC_OBJ:
+ if (ssa_op->op2_use >= 0 && !value_known(&ctx->values[ssa_op->op2_use])) {
+ return 0;
+ }
+ break;
+ default:
+ if (zend_may_throw(opline, op_array, ssa)) {
+ return 0;
+ }
+ break;
+ }
+ }
+
+ /* Mark result unused, if possible */
+ if (ssa_op->result_def >= 0) {
+ if (ssa->vars[ssa_op->result_def].use_chain < 0
+ && ssa->vars[ssa_op->result_def].phi_use_chain == NULL) {
+ if (opline->result_type & (IS_TMP_VAR|IS_VAR)) {
+ zend_optimizer_remove_live_range_ex(op_array, opline->result.var, var->definition);
+ }
+ zend_ssa_remove_result_def(ssa, ssa_op);
+ opline->result_type = IS_UNUSED;
+ } else if (opline->opcode != ZEND_PRE_INC &&
+ opline->opcode != ZEND_PRE_DEC) {
+ /* op1_def and result_def are different */
+ return removed_ops;
+ }
+ }
+
+ /* Destroy previous op2 */
+ if (opline->op2_type == IS_CONST) {
+ literal_dtor(&ZEND_OP2_LITERAL(opline));
+ } else if (ssa_op->op2_use >= 0) {
+ if (ssa_op->op2_use != ssa_op->op1_use) {
+ zend_ssa_unlink_use_chain(ssa, var->definition, ssa_op->op2_use);
+ }
+ ssa_op->op2_use = -1;
+ ssa_op->op2_use_chain = -1;
+ }
+
+ /* Remove OP_DATA opcode */
+ switch (opline->opcode) {
+ case ZEND_ASSIGN_DIM:
+ case ZEND_ASSIGN_OBJ:
+ removed_ops++;
+ zend_ssa_remove_instr(ssa, opline + 1, ssa_op + 1);
+ break;
+ case ZEND_ASSIGN_ADD:
+ case ZEND_ASSIGN_SUB:
+ case ZEND_ASSIGN_MUL:
+ case ZEND_ASSIGN_DIV:
+ case ZEND_ASSIGN_MOD:
+ case ZEND_ASSIGN_SL:
+ case ZEND_ASSIGN_SR:
+ case ZEND_ASSIGN_CONCAT:
+ case ZEND_ASSIGN_BW_OR:
+ case ZEND_ASSIGN_BW_AND:
+ case ZEND_ASSIGN_BW_XOR:
+ case ZEND_ASSIGN_POW:
+ if (opline->extended_value) {
+ removed_ops++;
+ zend_ssa_remove_instr(ssa, opline + 1, ssa_op + 1);
+ }
+ break;
+ default:
+ break;
+ }
+
+ if (value) {
+ /* Convert to ASSIGN */
+ opline->opcode = ZEND_ASSIGN;
+ opline->op2_type = IS_CONST;
+ opline->op2.constant = zend_optimizer_add_literal(op_array, value);
+ Z_TRY_ADDREF_P(value);
+ } else {
+ /* Remove dead array or object construction */
+ removed_ops++;
+ if (var->use_chain >= 0 || var->phi_use_chain != NULL) {
+ zend_ssa_rename_var_uses(ssa, ssa_op->op1_def, ssa_op->op1_use, 1);
+ }
+ zend_ssa_remove_op1_def(ssa, ssa_op);
+ zend_ssa_remove_instr(ssa, opline, ssa_op);
+ }
+ }
+ } else if (var->definition_phi
+ && var->use_chain < 0
+ && var->phi_use_chain == NULL) {
+ zend_ssa_remove_phi(ssa, var->definition_phi);
+ }
+ return removed_ops;
+}
+
/* This will try to replace uses of SSA variables we have determined to be constant. Not all uses
* can be replaced, because some instructions don't accept constant operands or only accept them
* if they have a certain type. */
@@ -1478,7 +2185,17 @@ static int replace_constant_operands(sccp_ctx *ctx) {
zval *value;
int use;
- if (value_known(&ctx->values[i])) {
+ if (IS_PARTIAL_ARRAY(&ctx->values[i])
+ || IS_PARTIAL_OBJECT(&ctx->values[i])) {
+ if (!Z_DELREF(ctx->values[i])) {
+ zend_array_destroy(Z_ARR(ctx->values[i]));
+ }
+ MAKE_BOT(&ctx->values[i]);
+ if ((var->use_chain < 0 && var->phi_use_chain == NULL) || var->no_val) {
+ removed_ops += try_remove_definition(ctx, i, var, NULL);
+ }
+ continue;
+ } else if (value_known(&ctx->values[i])) {
value = &ctx->values[i];
} else {
value = value_from_type_and_range(ctx, i, &tmp);
@@ -1513,108 +2230,8 @@ static int replace_constant_operands(sccp_ctx *ctx) {
}
} FOREACH_USE_END();
- /* This is a basic DCE pass we run after SCCP. It only works on those instructions those result
- * value(s) were determined by SCCP. It removes dead computational instructions and converts
- * CV-affecting instructions into CONST ASSIGNs. This basic DCE is performed for multiple reasons:
- * a) During operand replacement we eliminate FREEs. The corresponding computational instructions
- * must be removed to avoid leaks. This way SCCP can run independently of the full DCE pass.
- * b) The main DCE pass relies on type analysis to determine whether instructions have side-effects
- * and can't be DCEd. This means that it will not be able collect all instructions rendered dead
- * by SCCP, because they may have potentially side-effecting types, but the actual values are
- * not. As such doing DCE here will allow us to eliminate more dead code in combination.
- * c) The ordinary DCE pass cannot collect dead calls. However SCCP can result in dead calls, which
- * we need to collect. */
-
- if (var->definition >= 0 && value_known(&ctx->values[i])) {
- zend_op *opline = &op_array->opcodes[var->definition];
- zend_ssa_op *ssa_op = &ssa->ops[var->definition];
- if (opline->opcode == ZEND_ASSIGN) {
- /* Leave assigns to DCE (due to dtor effects) */
- continue;
- }
-
- if (ssa_op->result_def == i
- && ssa_op->op1_def < 0
- && ssa_op->op2_def < 0
- && var->use_chain < 0
- && var->phi_use_chain == NULL) {
- if (opline->opcode == ZEND_DO_ICALL) {
- /* Call instruction -> remove opcodes that are part of the call */
- zend_call_info *call;
- int i;
-
- ZEND_ASSERT(ctx->call_map);
- call = ctx->call_map[var->definition];
- ZEND_ASSERT(call);
- ZEND_ASSERT(call->caller_call_opline == opline);
- if (opline->result_type & (IS_TMP_VAR|IS_VAR)) {
- zend_optimizer_remove_live_range_ex(op_array, opline->result.var, var->definition);
- }
- zend_ssa_remove_result_def(ssa, ssa_op);
- zend_ssa_remove_instr(ssa, opline, ssa_op);
- zend_ssa_remove_instr(ssa, call->caller_init_opline,
- &ssa->ops[call->caller_init_opline - op_array->opcodes]);
-
- for (i = 0; i < call->num_args; i++) {
- zend_ssa_remove_instr(ssa, call->arg_info[i].opline,
- &ssa->ops[call->arg_info[i].opline - op_array->opcodes]);
- }
- removed_ops = call->num_args + 2;
-
- // TODO: remove call_info completely???
- call->callee_func = NULL;
- } else {
- /* Ordinary computational instruction -> remove it */
- if (opline->result_type & (IS_TMP_VAR|IS_VAR)) {
- zend_optimizer_remove_live_range_ex(op_array, opline->result.var, var->definition);
- }
- zend_ssa_remove_result_def(ssa, ssa_op);
- zend_ssa_remove_instr(ssa, opline, ssa_op);
- removed_ops++;
- }
- } else if (ssa_op->op1_def == i) {
- /* Compound assign or incdec -> convert to direct ASSIGN */
-
- /* Destroy previous op2 */
- if (opline->op2_type == IS_CONST) {
- literal_dtor(&ZEND_OP2_LITERAL(opline));
- } else if (ssa_op->op2_use >= 0) {
- if (ssa_op->op2_use != ssa_op->op1_use) {
- zend_ssa_unlink_use_chain(ssa, var->definition, ssa_op->op2_use);
- }
- ssa_op->op2_use = -1;
- ssa_op->op2_use_chain = -1;
- }
-
- /* Mark result unused, if possible */
- if (ssa_op->result_def >= 0
- && ssa->vars[ssa_op->result_def].use_chain < 0
- && ssa->vars[ssa_op->result_def].phi_use_chain == NULL) {
- if (opline->result_type & (IS_TMP_VAR|IS_VAR)) {
- zend_optimizer_remove_live_range_ex(op_array, opline->result.var, var->definition);
- }
- zend_ssa_remove_result_def(ssa, ssa_op);
- opline->result_type = IS_UNUSED;
- }
-
- /* Remove OP_DATA opcode */
- if (opline->opcode == ZEND_ASSIGN_DIM) {
- removed_ops++;
- zend_ssa_remove_instr(ssa, opline + 1, ssa_op + 1);
- }
-
- /* Convert to ASSIGN */
- opline->opcode = ZEND_ASSIGN;
- opline->op2_type = IS_CONST;
- opline->op2.constant = zend_optimizer_add_literal(op_array, value);
- Z_TRY_ADDREF_P(value);
- }
- }
- if (var->definition_phi
- && value_known(&ctx->values[i])
- && var->use_chain < 0
- && var->phi_use_chain == NULL) {
- zend_ssa_remove_phi(ssa, var->definition_phi);
+ if (value_known(&ctx->values[i])) {
+ removed_ops += try_remove_definition(ctx, i, var, value);
}
}
@@ -1667,6 +2284,39 @@ int sccp_optimize_op_array(zend_optimizer_ctx *ctx, zend_op_array *op_array, zen
scdf_init(ctx, &sccp.scdf, op_array, ssa);
scdf_solve(&sccp.scdf, "SCCP");
+ if (ctx->debug_level & ZEND_DUMP_SCCP) {
+ int i, first = 1;
+
+ for (i = op_array->last_var; i < ssa->vars_count; i++) {
+ zval *zv = &sccp.values[i];
+
+ if (IS_TOP(zv) || IS_BOT(zv)) {
+ continue;
+ }
+ if (first) {
+ first = 0;
+ fprintf(stderr, "\nSCCP Values for \"");
+ zend_dump_op_array_name(op_array);
+ fprintf(stderr, "\":\n");
+ }
+ fprintf(stderr, " #%d.", i);
+ zend_dump_var(op_array, IS_CV, ssa->vars[i].var);
+ if (IS_PARTIAL_ARRAY(zv)) {
+ fprintf(stderr, " = [");
+ zend_dump_ht(Z_ARRVAL_P(zv));
+ fprintf(stderr, "]");
+ } else if (IS_PARTIAL_OBJECT(zv)) {
+ fprintf(stderr, " = {");
+ zend_dump_ht(Z_ARRVAL_P(zv));
+ fprintf(stderr, "}");
+ } else {
+ fprintf(stderr, " =");
+ zend_dump_const(zv);
+ }
+ fprintf(stderr, "\n");
+ }
+ }
+
removed_ops += scdf_remove_unreachable_blocks(&sccp.scdf);
removed_ops += replace_constant_operands(&sccp);
diff --git a/ext/opcache/Optimizer/zend_cfg.c b/ext/opcache/Optimizer/zend_cfg.c
index 8276bec051..2c1c0a7185 100644
--- a/ext/opcache/Optimizer/zend_cfg.c
+++ b/ext/opcache/Optimizer/zend_cfg.c
@@ -296,7 +296,7 @@ int zend_build_cfg(zend_arena **arena, const zend_op_array *op_array, uint32_t b
cfg->split_at_live_ranges = (build_flags & ZEND_CFG_SPLIT_AT_LIVE_RANGES) != 0;
cfg->split_at_calls = (build_flags & ZEND_CFG_STACKLESS) != 0;
- cfg->split_at_recv = (build_flags & ZEND_CFG_RECV_ENTRY) != 0 && (op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS) == 0;
+ cfg->split_at_recv = (build_flags & ZEND_CFG_RECV_ENTRY) != 0;
cfg->map = block_map = zend_arena_calloc(arena, op_array->last, sizeof(uint32_t));
diff --git a/ext/opcache/Optimizer/zend_cfg.h b/ext/opcache/Optimizer/zend_cfg.h
index c93308f3e4..90872e2ef1 100644
--- a/ext/opcache/Optimizer/zend_cfg.h
+++ b/ext/opcache/Optimizer/zend_cfg.h
@@ -109,15 +109,15 @@ typedef struct _zend_cfg {
#define ZEND_CALL_TREE (1<<23)
#define ZEND_SSA_USE_CV_RESULTS (1<<22)
-#define CRT_CONSTANT_EX(op_array, node, rt_constants) \
+#define CRT_CONSTANT_EX(op_array, opline, node, rt_constants) \
((rt_constants) ? \
- RT_CONSTANT(op_array, (node)) \
+ RT_CONSTANT(opline, (node)) \
: \
CT_CONSTANT_EX(op_array, (node).constant) \
)
#define CRT_CONSTANT(node) \
- CRT_CONSTANT_EX(op_array, node, (build_flags & ZEND_RT_CONSTANTS))
+ CRT_CONSTANT_EX(op_array, opline, node, (build_flags & ZEND_RT_CONSTANTS))
#define RETURN_VALUE_USED(opline) \
((opline)->result_type != IS_UNUSED)
diff --git a/ext/opcache/Optimizer/zend_dfg.c b/ext/opcache/Optimizer/zend_dfg.c
index 3b4c9bb478..49be85c6b8 100644
--- a/ext/opcache/Optimizer/zend_dfg.c
+++ b/ext/opcache/Optimizer/zend_dfg.c
@@ -128,6 +128,10 @@ int zend_build_dfg(const zend_op_array *op_array, const zend_cfg *cfg, zend_dfg
case ZEND_FETCH_OBJ_FUNC_ARG:
case ZEND_FETCH_OBJ_UNSET:
case ZEND_VERIFY_RETURN_TYPE:
+ case ZEND_PRE_INC_OBJ:
+ case ZEND_PRE_DEC_OBJ:
+ case ZEND_POST_INC_OBJ:
+ case ZEND_POST_DEC_OBJ:
op1_def:
/* `def` always come along with dtor or separation,
* thus the origin var info might be also `use`d in the feature(CG) */
diff --git a/ext/opcache/Optimizer/zend_dump.c b/ext/opcache/Optimizer/zend_dump.c
index 924f7bb6a8..ac13187624 100644
--- a/ext/opcache/Optimizer/zend_dump.c
+++ b/ext/opcache/Optimizer/zend_dump.c
@@ -25,7 +25,30 @@
#include "zend_call_graph.h"
#include "zend_dump.h"
-static void zend_dump_const(const zval *zv)
+void zend_dump_ht(HashTable *ht)
+{
+ zend_ulong index;
+ zend_string *key;
+ zval *val;
+ int first = 1;
+
+ ZEND_HASH_FOREACH_KEY_VAL(ht, index, key, val) {
+ if (first) {
+ first = 0;
+ } else {
+ fprintf(stderr, ", ");
+ }
+ if (key) {
+ fprintf(stderr, "\"%s\"", ZSTR_VAL(key));
+ } else {
+ fprintf(stderr, ZEND_LONG_FMT, index);
+ }
+ fprintf(stderr, " =>");
+ zend_dump_const(val);
+ } ZEND_HASH_FOREACH_END();
+}
+
+void zend_dump_const(const zval *zv)
{
switch (Z_TYPE_P(zv)) {
case IS_NULL:
@@ -320,9 +343,12 @@ static void zend_dump_ssa_var(const zend_op_array *op_array, const zend_ssa *ssa
zend_dump_var(op_array, (var_num < op_array->last_var ? IS_CV : var_type), var_num);
if (ssa_var_num >= 0 && ssa->vars) {
- if (ssa_var_num >= 0 && ssa->vars[ssa_var_num].no_val) {
+ if (ssa->vars[ssa_var_num].no_val) {
fprintf(stderr, " NOVAL");
}
+ if (ssa->vars[ssa_var_num].escape_state == ESCAPE_STATE_NO_ESCAPE) {
+ fprintf(stderr, " NOESC");
+ }
if (ssa->var_info) {
zend_dump_ssa_var_info(ssa, ssa_var_num, dump_flags);
if (ssa->var_info[ssa_var_num].has_range) {
@@ -429,9 +455,6 @@ static void zend_dump_op(const zend_op_array *op_array, const zend_basic_block *
if (opline->extended_value & IS_CONSTANT_UNQUALIFIED) {
fprintf(stderr, " (unqualified)");
}
- if (opline->extended_value & IS_CONSTANT_CLASS) {
- fprintf(stderr, " (__class__)");
- }
if (opline->extended_value & IS_CONSTANT_IN_NAMESPACE) {
fprintf(stderr, " (in-namespace)");
}
@@ -542,7 +565,7 @@ static void zend_dump_op(const zend_op_array *op_array, const zend_basic_block *
}
if (opline->op1_type == IS_CONST) {
- zend_dump_const(CRT_CONSTANT_EX(op_array, opline->op1, (dump_flags & ZEND_DUMP_RT_CONSTANTS)));
+ zend_dump_const(CRT_CONSTANT_EX(op_array, opline, opline->op1, (dump_flags & ZEND_DUMP_RT_CONSTANTS)));
} else if (opline->op1_type & (IS_CV|IS_VAR|IS_TMP_VAR)) {
if (ssa && ssa->ops) {
int ssa_var_num = ssa->ops[opline - op_array->opcodes].op1_use;
@@ -578,7 +601,7 @@ static void zend_dump_op(const zend_op_array *op_array, const zend_basic_block *
}
if (opline->op2_type == IS_CONST) {
- zval *op = CRT_CONSTANT_EX(op_array, opline->op2, (dump_flags & ZEND_DUMP_RT_CONSTANTS));
+ zval *op = CRT_CONSTANT_EX(op_array, opline, opline->op2, (dump_flags & ZEND_DUMP_RT_CONSTANTS));
if (opline->opcode == ZEND_SWITCH_LONG || opline->opcode == ZEND_SWITCH_STRING) {
HashTable *jumptable = Z_ARRVAL_P(op);
zend_string *key;
@@ -644,7 +667,7 @@ static void zend_dump_op(const zend_op_array *op_array, const zend_basic_block *
}
}
if (opline->result_type == IS_CONST) {
- zend_dump_const(CRT_CONSTANT_EX(op_array, opline->result, (dump_flags & ZEND_DUMP_RT_CONSTANTS)));
+ zend_dump_const(CRT_CONSTANT_EX(op_array, opline, opline->result, (dump_flags & ZEND_DUMP_RT_CONSTANTS)));
} else if (ssa && ssa->ops && ssa->ops[opline - op_array->opcodes].result_use >= 0) {
if (opline->result_type & (IS_CV|IS_VAR|IS_TMP_VAR)) {
if (ssa && ssa->ops) {
@@ -800,7 +823,7 @@ static void zend_dump_block_header(const zend_cfg *cfg, const zend_op_array *op_
}
}
-static void zend_dump_op_array_name(const zend_op_array *op_array)
+void zend_dump_op_array_name(const zend_op_array *op_array)
{
zend_func_info *func_info = NULL;
diff --git a/ext/opcache/Optimizer/zend_dump.h b/ext/opcache/Optimizer/zend_dump.h
index 11646d9a82..ff159a9dc9 100644
--- a/ext/opcache/Optimizer/zend_dump.h
+++ b/ext/opcache/Optimizer/zend_dump.h
@@ -37,6 +37,9 @@ void zend_dump_phi_placement(const zend_op_array *op_array, const zend_ssa *ssa)
void zend_dump_variables(const zend_op_array *op_array);
void zend_dump_ssa_variables(const zend_op_array *op_array, const zend_ssa *ssa, uint32_t dump_flags);
void zend_dump_var(const zend_op_array *op_array, zend_uchar var_type, int var_num);
+void zend_dump_op_array_name(const zend_op_array *op_array);
+void zend_dump_const(const zval *zv);
+void zend_dump_ht(HashTable *ht);
END_EXTERN_C()
diff --git a/ext/opcache/Optimizer/zend_func_info.c b/ext/opcache/Optimizer/zend_func_info.c
index 5fdb61e84f..957d53864e 100644
--- a/ext/opcache/Optimizer/zend_func_info.c
+++ b/ext/opcache/Optimizer/zend_func_info.c
@@ -13,6 +13,7 @@
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Dmitry Stogov <dmitry@zend.com> |
+ | Xinchen Hui <laruence@php.net> |
+----------------------------------------------------------------------+
*/
@@ -61,9 +62,8 @@ typedef struct _func_info_t {
static uint32_t zend_strlen_info(const zend_call_info *call_info, const zend_ssa *ssa)
{
- if (call_info->caller_init_opline->extended_value == (uint32_t)call_info->num_args &&
- call_info->num_args == 1) {
-
+ ZEND_ASSERT(call_info->caller_init_opline->extended_value == (uint32_t)call_info->num_args);
+ if (call_info->num_args == 1) {
uint32_t tmp = 0;
if (call_info->arg_info[0].opline) {
uint32_t arg_info = _ssa_op1_info(call_info->caller_op_array, ssa, call_info->arg_info[0].opline);
@@ -87,8 +87,8 @@ static uint32_t zend_strlen_info(const zend_call_info *call_info, const zend_ssa
static uint32_t zend_dechex_info(const zend_call_info *call_info, const zend_ssa *ssa)
{
- if (call_info->caller_init_opline->extended_value == (uint32_t)call_info->num_args &&
- call_info->num_args == 1) {
+ ZEND_ASSERT(call_info->caller_init_opline->extended_value == (uint32_t)call_info->num_args);
+ if (call_info->num_args == 1) {
return MAY_BE_RC1 | MAY_BE_STRING;
} else {
/* warning, and returns NULL */
@@ -98,8 +98,8 @@ static uint32_t zend_dechex_info(const zend_call_info *call_info, const zend_ssa
static uint32_t zend_range_info(const zend_call_info *call_info, const zend_ssa *ssa)
{
- if (call_info->caller_init_opline->extended_value == (uint32_t)call_info->num_args &&
- (call_info->num_args == 2 || call_info->num_args == 3)) {
+ ZEND_ASSERT(call_info->caller_init_opline->extended_value == (uint32_t)call_info->num_args);
+ if (call_info->num_args == 2 || call_info->num_args == 3) {
uint32_t t1 = _ssa_op1_info(call_info->caller_op_array, ssa, call_info->arg_info[0].opline);
uint32_t t2 = _ssa_op1_info(call_info->caller_op_array, ssa, call_info->arg_info[1].opline);
@@ -131,8 +131,8 @@ static uint32_t zend_range_info(const zend_call_info *call_info, const zend_ssa
static uint32_t zend_is_type_info(const zend_call_info *call_info, const zend_ssa *ssa)
{
- if (call_info->caller_init_opline->extended_value == (uint32_t)call_info->num_args &&
- call_info->num_args == 1) {
+ ZEND_ASSERT(call_info->caller_init_opline->extended_value == (uint32_t)call_info->num_args);
+ if (call_info->num_args == 1) {
return MAY_BE_FALSE | MAY_BE_TRUE;
} else {
return MAY_BE_FALSE | MAY_BE_TRUE | FUNC_MAY_WARN;
@@ -141,8 +141,8 @@ static uint32_t zend_is_type_info(const zend_call_info *call_info, const zend_ss
static uint32_t zend_l_ss_info(const zend_call_info *call_info, const zend_ssa *ssa)
{
- if (call_info->caller_init_opline->extended_value == (uint32_t)call_info->num_args &&
- call_info->num_args == 2) {
+ ZEND_ASSERT(call_info->caller_init_opline->extended_value == (uint32_t)call_info->num_args);
+ if (call_info->num_args == 2) {
uint32_t arg1_info = _ssa_op1_info(call_info->caller_op_array, ssa, call_info->arg_info[0].opline);
uint32_t arg2_info = _ssa_op1_info(call_info->caller_op_array, ssa, call_info->arg_info[1].opline);
@@ -166,8 +166,8 @@ static uint32_t zend_l_ss_info(const zend_call_info *call_info, const zend_ssa *
static uint32_t zend_lb_ssn_info(const zend_call_info *call_info, const zend_ssa *ssa)
{
- if (call_info->caller_init_opline->extended_value == (uint32_t)call_info->num_args &&
- call_info->num_args == 3) {
+ ZEND_ASSERT(call_info->caller_init_opline->extended_value == (uint32_t)call_info->num_args);
+ if (call_info->num_args == 3) {
uint32_t arg1_info = _ssa_op1_info(call_info->caller_op_array, ssa, call_info->arg_info[0].opline);
uint32_t arg2_info = _ssa_op1_info(call_info->caller_op_array, ssa, call_info->arg_info[1].opline);
uint32_t arg3_info = _ssa_op1_info(call_info->caller_op_array, ssa, call_info->arg_info[2].opline);
@@ -193,8 +193,8 @@ static uint32_t zend_lb_ssn_info(const zend_call_info *call_info, const zend_ssa
static uint32_t zend_b_s_info(const zend_call_info *call_info, const zend_ssa *ssa)
{
- if (call_info->caller_init_opline->extended_value == (uint32_t)call_info->num_args &&
- call_info->num_args == 1) {
+ ZEND_ASSERT(call_info->caller_init_opline->extended_value == (uint32_t)call_info->num_args);
+ if (call_info->num_args == 1) {
uint32_t arg1_info = _ssa_op1_info(call_info->caller_op_array, ssa, call_info->arg_info[0].opline);
uint32_t tmp = 0;
@@ -249,14 +249,15 @@ static const func_info_t func_infos[] = {
F0("trait_exists", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
FC("function_exists", zend_b_s_info), // TODO: inline
F0("class_alias", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F1("get_included_files", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
+ I1("get_included_files", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
F0("trigger_error", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
F0("user_error", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
FN("set_error_handler", MAY_BE_NULL | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_OBJECT | MAY_BE_OBJECT),
- I0("restore_error_handler", MAY_BE_NULL | MAY_BE_TRUE),
- F1("get_declared_traits", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
- F1("get_declared_classes", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
- F1("get_declared_interfaces", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
+ I0("restore_error_handler", MAY_BE_TRUE),
+ I0("restore_exception_handler", MAY_BE_TRUE),
+ I1("get_declared_traits", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
+ I1("get_declared_classes", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
+ I1("get_declared_interfaces", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
F1("get_defined_functions", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ARRAY),
I1("get_defined_vars", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF),
FN("create_function", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_STRING),
@@ -302,10 +303,10 @@ static const func_info_t func_infos[] = {
F0("phpinfo", MAY_BE_NULL | MAY_BE_TRUE),
F1("phpversion", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F0("phpcredits", MAY_BE_NULL | MAY_BE_TRUE),
- F1("php_sapi_name", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ I1("php_sapi_name", MAY_BE_FALSE | MAY_BE_STRING),
F1("php_uname", MAY_BE_NULL | MAY_BE_STRING),
- F1("php_ini_scanned_files", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F1("php_ini_loaded_file", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ I1("php_ini_scanned_files", MAY_BE_FALSE | MAY_BE_STRING),
+ I1("php_ini_loaded_file", MAY_BE_FALSE | MAY_BE_STRING),
F0("strnatcmp", MAY_BE_NULL | MAY_BE_LONG),
F0("strnatcasecmp", MAY_BE_NULL | MAY_BE_LONG),
F0("substr_count", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
@@ -364,7 +365,7 @@ static const func_info_t func_infos[] = {
FN("implode", MAY_BE_NULL | MAY_BE_STRING),
FN("join", MAY_BE_NULL | MAY_BE_STRING),
FN("setlocale", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F1("localeconv", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
+ F1("localeconv", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
#if HAVE_NL_LANGINFO
F1("nl_langinfo", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
#endif
@@ -418,7 +419,7 @@ static const func_info_t func_infos[] = {
F0("getrandmax", MAY_BE_NULL | MAY_BE_LONG),
F0("mt_rand", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
F0("mt_srand", MAY_BE_NULL),
- F0("mt_getrandmax", MAY_BE_NULL | MAY_BE_LONG),
+ I0("mt_getrandmax", MAY_BE_LONG),
#if HAVE_GETSERVBYNAME
F0("getservbyname", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
#endif
@@ -431,11 +432,11 @@ static const func_info_t func_infos[] = {
#if HAVE_GETPROTOBYNUMBER
F1("getprotobynumber", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
#endif
- F0("getmyuid", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
- F0("getmygid", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
- F0("getmypid", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
- F0("getmyinode", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
- F0("getlastmod", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F0("getmyuid", MAY_BE_FALSE | MAY_BE_LONG),
+ F0("getmygid", MAY_BE_FALSE | MAY_BE_LONG),
+ F0("getmypid", MAY_BE_FALSE | MAY_BE_LONG),
+ F0("getmyinode", MAY_BE_FALSE | MAY_BE_LONG),
+ F0("getlastmod", MAY_BE_FALSE | MAY_BE_LONG),
F1("base64_decode", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("base64_encode", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("password_hash", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
@@ -498,7 +499,7 @@ static const func_info_t func_infos[] = {
#endif
F1("getopt", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_FALSE | MAY_BE_ARRAY_OF_TRUE | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
#ifdef HAVE_GETLOADAVG
- F1("sys_getloadavg", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_DOUBLE),
+ F1("sys_getloadavg", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_DOUBLE),
#endif
#ifdef HAVE_GETTIMEOFDAY
F1("microtime", MAY_BE_NULL | MAY_BE_DOUBLE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG | MAY_BE_STRING),
@@ -513,16 +514,16 @@ static const func_info_t func_infos[] = {
F1("quoted_printable_decode", MAY_BE_NULL | MAY_BE_STRING),
F1("quoted_printable_encode", MAY_BE_NULL | MAY_BE_STRING),
F1("convert_cyr_string", MAY_BE_NULL | MAY_BE_STRING),
- F1("get_current_user", MAY_BE_NULL | MAY_BE_STRING),
+ I1("get_current_user", MAY_BE_STRING),
F0("set_time_limit", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
F0("header_register_callback", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
F1("get_cfg_var", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
- F0("magic_quotes_runtime", MAY_BE_NULL | MAY_BE_FALSE),
- F0("set_magic_quotes_runtime", MAY_BE_NULL | MAY_BE_FALSE),
- F0("get_magic_quotes_gpc", MAY_BE_NULL | MAY_BE_FALSE),
- F0("get_magic_quotes_runtime", MAY_BE_NULL | MAY_BE_FALSE),
+ I0("magic_quotes_runtime", MAY_BE_FALSE),
+ I0("set_magic_quotes_runtime", MAY_BE_FALSE),
+ I0("get_magic_quotes_gpc", MAY_BE_FALSE),
+ I0("get_magic_quotes_runtime", MAY_BE_FALSE),
F0("error_log", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F1("error_get_last", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
+ I1("error_get_last", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING),
FN("call_user_func", UNKNOWN_INFO),
FN("call_user_func_array", UNKNOWN_INFO),
FN("call_user_method", UNKNOWN_INFO),
@@ -549,7 +550,7 @@ static const func_info_t func_infos[] = {
FN("ini_set", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("ini_alter", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F0("ini_restore", MAY_BE_NULL),
- F1("get_include_path", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ I1("get_include_path", MAY_BE_FALSE | MAY_BE_STRING),
F1("set_include_path", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F0("restore_include_path", MAY_BE_NULL),
F0("setcookie", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
@@ -557,7 +558,7 @@ static const func_info_t func_infos[] = {
F0("header", MAY_BE_NULL),
F0("header_remove", MAY_BE_NULL),
F0("headers_sent", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F1("headers_list", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
+ F1("headers_list", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
F0("http_response_code", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
F0("connection_aborted", MAY_BE_LONG),
F0("connection_status", MAY_BE_LONG),
@@ -573,9 +574,9 @@ static const func_info_t func_infos[] = {
F1("gethostbyname", MAY_BE_NULL | MAY_BE_STRING),
F1("gethostbynamel", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
#ifdef HAVE_GETHOSTNAME
- F1("gethostname", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("gethostname", MAY_BE_FALSE | MAY_BE_STRING),
#endif
-#if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !(defined(__BEOS__)))
+#if defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC
F0("dns_check_record", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
F0("checkdnsrr", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
# if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS
@@ -631,7 +632,7 @@ static const func_info_t func_infos[] = {
F0("rename", MAY_BE_FALSE | MAY_BE_TRUE),
F0("copy", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
F1("tempnam", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F1("tmpfile", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F1("tmpfile", MAY_BE_FALSE | MAY_BE_RESOURCE),
F1("file", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
F1("file_get_contents", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F0("file_put_contents", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
@@ -679,8 +680,8 @@ static const func_info_t func_infos[] = {
F0("stream_register_wrapper", MAY_BE_FALSE | MAY_BE_TRUE),
F0("stream_wrapper_unregister", MAY_BE_FALSE | MAY_BE_TRUE),
F0("stream_wrapper_restore", MAY_BE_FALSE | MAY_BE_TRUE),
- F1("stream_get_wrappers", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
- F1("stream_get_transports", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
+ F1("stream_get_wrappers", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
+ F1("stream_get_transports", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
F1("stream_resolve_include_path", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F0("stream_is_local", MAY_BE_FALSE | MAY_BE_TRUE),
F1("get_headers", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
@@ -689,7 +690,7 @@ static const func_info_t func_infos[] = {
F0("socket_set_timeout", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
#endif
F1("socket_get_status", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY),
-#if (!defined(__BEOS__) && HAVE_REALPATH) || defined(ZTS)
+#if HAVE_REALPATH || defined(ZTS)
F1("realpath", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
#endif
#ifdef HAVE_FNMATCH
@@ -707,7 +708,7 @@ static const func_info_t func_infos[] = {
#if defined(HAVE_CHROOT) && !defined(ZTS) && ENABLE_CHROOT_FUNC
F0("chroot", MAY_BE_FALSE | MAY_BE_TRUE),
#endif
- F1("getcwd", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("getcwd", MAY_BE_FALSE | MAY_BE_STRING),
F0("rewinddir", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
F1("readdir", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("dir", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_OBJECT),
@@ -750,14 +751,14 @@ static const func_info_t func_infos[] = {
F0("disk_total_space", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_DOUBLE),
F0("disk_free_space", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_DOUBLE),
F0("diskfreespace", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_DOUBLE),
- F0("realpath_cache_size", MAY_BE_NULL | MAY_BE_LONG),
- F1("realpath_cache_get", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ARRAY),
+ I0("realpath_cache_size", MAY_BE_LONG),
+ I1("realpath_cache_get", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ARRAY),
F0("mail", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
F0("ezmlm_hash", MAY_BE_NULL | MAY_BE_LONG),
#ifdef HAVE_SYSLOG_H
F0("openlog", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
F0("syslog", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F0("closelog", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("closelog", MAY_BE_TRUE),
#endif
F0("lcg_value", MAY_BE_DOUBLE),
F1("metaphone", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
@@ -859,7 +860,7 @@ static const func_info_t func_infos[] = {
F0("ftok", MAY_BE_NULL | MAY_BE_LONG),
#endif
F1("str_rot13", MAY_BE_NULL | MAY_BE_STRING),
- F1("stream_get_filters", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
+ I1("stream_get_filters", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
F0("stream_filter_register", MAY_BE_FALSE | MAY_BE_TRUE),
F1("stream_bucket_make_writeable", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_OBJECT),
F1("stream_bucket_prepend", MAY_BE_FALSE | MAY_BE_OBJECT),
@@ -867,7 +868,7 @@ static const func_info_t func_infos[] = {
F1("stream_bucket_new", MAY_BE_FALSE | MAY_BE_OBJECT),
F0("output_add_rewrite_var", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
F0("output_reset_rewrite_vars", MAY_BE_FALSE),
- F1("sys_get_temp_dir", MAY_BE_NULL | MAY_BE_STRING),
+ I1("sys_get_temp_dir", MAY_BE_STRING),
/* ext/date */
F0("strtotime", MAY_BE_FALSE | MAY_BE_LONG),
@@ -1008,6 +1009,107 @@ static const func_info_t func_infos[] = {
F1("mysql_tablename", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("mysql_table_name", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ /* ext/mysqli */
+ F1("mysqli_connect", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F0("mysqli_close", MAY_BE_NULL | MAY_BE_TRUE),
+ I1("mysqli_connect_error", MAY_BE_NULL | MAY_BE_STRING),
+ I0("mysqli_connect_errno", MAY_BE_LONG),
+ F1("mysqli_get_client_stats", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_STRING),
+ F1("mysqli_error_list", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_ARRAY),
+ F1("mysqli_get_links_stats", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG),
+ F1("mysqli_query", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_RESOURCE),
+ F0("mysqli_multi_query", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("mysqli_set_charset", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("mysqli_get_charset", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY),
+ F0("mysqli_begin_transaction", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("mysqli_savepoint", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("mysqli_release_savepoint", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("mysqli_fetch_array", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY),
+ F1("mysqli_fetch_assoc", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY),
+ F1("mysqli_fetch_all", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY),
+ F1("mysqli_fetch_object", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_OBJECT),
+ F0("mysqli_free_result", MAY_BE_NULL),
+ F0("mysqli_affected_rows", MAY_BE_NULL | MAY_BE_LONG),
+ F0("mysqli_autocommit", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("mysqli_stmt_bind_param", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("mysqli_stmt_bind_result", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("mysqli_change_user", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("mysqli_character_set_name", MAY_BE_NULL | MAY_BE_STRING),
+ F0("mysqli_commit", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("mysqli_data_seek", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("mysqli_debug", MAY_BE_NULL | MAY_BE_TRUE),
+ F0("mysqli_dump_debug_info", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("mysqli_errno", MAY_BE_NULL | MAY_BE_LONG),
+ F1("mysqli_error", MAY_BE_NULL | MAY_BE_STRING),
+ F0("mysqli_stmt_execute", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("mysqli_poll", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F1("mysqli_reap_async_query", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_RESOURCE),
+ F1("mysqli_stmt_get_result", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F1("mysqli_get_warnings", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F1("mysqli_stmt_error_list", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_ARRAY),
+ F1("mysqli_stmt_get_warnings", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F0("mysqli_stmt_fetch", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("mysqli_fetch_field", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_OBJECT),
+ F1("mysqli_fetch_fields", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_OBJECT),
+ F1("mysqli_fetch_field_direct", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_OBJECT),
+ F1("mysqli_fetch_lengths", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG),
+ F1("mysqli_fetch_row", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_ANY),
+ F0("mysqli_field_count", MAY_BE_NULL | MAY_BE_LONG),
+ F0("mysqli_field_seek", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("mysqli_field_tell", MAY_BE_NULL | MAY_BE_LONG),
+ I1("mysqli_get_client_info", MAY_BE_STRING),
+ I0("mysqli_get_client_version", MAY_BE_LONG),
+ F1("mysqli_get_host_info", MAY_BE_NULL | MAY_BE_STRING),
+ F0("mysqli_get_proto_info", MAY_BE_NULL | MAY_BE_LONG),
+ F1("mysqli_get_server_info", MAY_BE_NULL | MAY_BE_STRING),
+ F0("mysqli_get_server_version", MAY_BE_NULL | MAY_BE_LONG),
+ F1("mysqli_info", MAY_BE_NULL | MAY_BE_STRING),
+ F1("mysqli_init", MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F0("mysqli_insert_id", MAY_BE_NULL | MAY_BE_LONG),
+ F0("mysqli_kill", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("mysqli_more_results", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("mysqli_next_result", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("mysqli_stmt_more_results", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("mysqli_stmt_next_result", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("mysqli_num_fields", MAY_BE_NULL | MAY_BE_LONG),
+ F0("mysqli_num_rows", MAY_BE_NULL | MAY_BE_LONG),
+ F0("mysqli_options", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("mysqli_ping", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("mysqli_prepare", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F0("mysqli_real_connect", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("mysqli_real_query", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("mysqli_real_escape_string", MAY_BE_NULL | MAY_BE_STRING),
+ F0("mysqli_rollback", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("mysqli_stmt_send_long_data", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("mysqli_stmt_affected_rows", MAY_BE_NULL | MAY_BE_LONG),
+ F0("mysqli_stmt_close", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("mysqli_stmt_data_seek", MAY_BE_NULL | MAY_BE_FALSE),
+ F0("mysqli_stmt_field_count", MAY_BE_NULL | MAY_BE_LONG),
+ F0("mysqli_stmt_free_result", MAY_BE_NULL),
+ F0("mysqli_stmt_insert_id", MAY_BE_NULL | MAY_BE_LONG),
+ F0("mysqli_stmt_param_count", MAY_BE_NULL | MAY_BE_LONG),
+ F0("mysqli_stmt_reset", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("mysqli_stmt_num_rows", MAY_BE_NULL | MAY_BE_LONG),
+ F0("mysqli_select_db", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("mysqli_sqlstate", MAY_BE_NULL | MAY_BE_STRING),
+ F0("mysqli_ssl_set", MAY_BE_NULL | MAY_BE_TRUE),
+ F1("mysqli_stat", MAY_BE_NULL | MAY_BE_STRING),
+ F0("mysqli_refresh", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("mysqli_stmt_attr_set", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("mysqli_stmt_attr_get", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F0("mysqli_stmt_errno", MAY_BE_NULL | MAY_BE_LONG),
+ F1("mysqli_stmt_error", MAY_BE_NULL | MAY_BE_STRING),
+ F1("mysqli_stmt_init", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F0("mysqli_stmt_prepare", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("mysqli_stmt_result_metadata", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F0("mysqli_stmt_store_result", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("mysqli_stmt_sqlstate", MAY_BE_NULL | MAY_BE_STRING),
+ F1("mysqli_store_result", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F0("mysqli_thread_id", MAY_BE_NULL | MAY_BE_LONG),
+ I0("mysqli_thread_safe", MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("mysqli_use_result", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F0("mysqli_warning_count", MAY_BE_NULL | MAY_BE_LONG),
+
/* ext/curl */
F1("curl_init", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
F1("curl_copy_handle", MAY_BE_NULL | MAY_BE_RESOURCE),
@@ -1025,7 +1127,7 @@ static const func_info_t func_infos[] = {
F1("curl_escape", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("curl_unescape", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F0("curl_pause", MAY_BE_NULL | MAY_BE_LONG),
- F1("curl_multi_init", MAY_BE_NULL | MAY_BE_RESOURCE),
+ F1("curl_multi_init", MAY_BE_RESOURCE),
F0("curl_multi_add_handle", MAY_BE_NULL | MAY_BE_LONG),
F0("curl_multi_remove_handle", MAY_BE_NULL | MAY_BE_LONG),
F0("curl_multi_select", MAY_BE_NULL | MAY_BE_LONG),
@@ -1034,7 +1136,7 @@ static const func_info_t func_infos[] = {
F1("curl_multi_info_read", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_RESOURCE),
F0("curl_multi_close", MAY_BE_NULL),
F0("curl_multi_setopt", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
- F1("curl_share_init", MAY_BE_NULL | MAY_BE_RESOURCE),
+ I1("curl_share_init", MAY_BE_RESOURCE),
F0("curl_share_close", MAY_BE_NULL),
F0("curl_share_setopt", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
F1("curl_file_create", MAY_BE_OBJECT),
@@ -1068,7 +1170,7 @@ static const func_info_t func_infos[] = {
F1("mb_strimwidth", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("mb_convert_encoding", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY),
F1("mb_detect_encoding", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F1("mb_list_encodings", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
+ I1("mb_list_encodings", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
F1("mb_encoding_aliases", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
F1("mb_convert_kana", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("mb_encode_mimeheader", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
@@ -1127,8 +1229,8 @@ static const func_info_t func_infos[] = {
/* ext/json */
F1("json_encode", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("json_decode", MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY),
- F0("json_last_error", MAY_BE_NULL | MAY_BE_LONG),
- F1("json_last_error_msg", MAY_BE_NULL | MAY_BE_STRING),
+ I0("json_last_error", MAY_BE_LONG),
+ I1("json_last_error_msg", MAY_BE_STRING),
/* ext/xml */
FN("xml_parser_create", MAY_BE_FALSE | MAY_BE_RESOURCE),
@@ -1180,7 +1282,7 @@ static const func_info_t func_infos[] = {
F1("gzdecode", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("zlib_encode", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("zlib_decode", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F1("zlib_get_coding_type", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ I1("zlib_get_coding_type", MAY_BE_FALSE | MAY_BE_STRING),
F1("ob_gzhandler", MAY_BE_FALSE | MAY_BE_STRING),
/* ext/hash */
@@ -1199,8 +1301,386 @@ static const func_info_t func_infos[] = {
F1("mhash_keygen_s2k", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F0("mhash_get_block_size", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
F1("mhash_get_hash_name", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
- F0("mhash_count", MAY_BE_NULL | MAY_BE_LONG),
+ I0("mhash_count", MAY_BE_LONG),
F1("mhash", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+
+ /* ext/sodium */
+ F0("sodium_memzero", MAY_BE_NULL),
+ F0("sodium_increment", MAY_BE_NULL),
+ F0("sodium_add", MAY_BE_NULL),
+ F0("sodium_memcmp", MAY_BE_NULL | MAY_BE_LONG),
+ F1("sodium_crypto_shorthash", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_crypto_secretbox", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_crypto_secretbox_open", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("sodium_crypto_generichash", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_crypto_generichash_init", MAY_BE_NULL | MAY_BE_STRING),
+ F0("sodium_crypto_generichash_update", MAY_BE_NULL | MAY_BE_TRUE),
+ F1("sodium_crypto_generichash_final", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_crypto_box_keypair", MAY_BE_STRING),
+ F1("sodium_crypto_box_seed_keypair", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_crypto_box_secretkey", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_crypto_box_publickey", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_crypto_box", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_crypto_box_open", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("sodium_crypto_box_seal", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_crypto_box_seal_open", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("sodium_crypto_sign_keypair", MAY_BE_STRING),
+ F1("sodium_crypto_sign_seed_keypair", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_crypto_sign_secretkey", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_crypto_sign_publickey", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_crypto_sign", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_crypto_sign_open", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("sodium_crypto_sign_detached", MAY_BE_NULL | MAY_BE_STRING),
+ F0("sodium_crypto_sign_verify_detached", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("sodium_crypto_stream", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_crypto_stream_xor", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_crypto_pwhash", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_crypto_pwhash_str", MAY_BE_NULL | MAY_BE_STRING),
+ F0("sodium_crypto_pwhash_str_verify", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("sodium_crypto_aead_aes256gcm_encrypt", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_crypto_aead_aes256gcm_decrypt", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("sodium_bin2hex", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_hex2bin", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_crypto_scalarmult", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_crypto_kx_seed_keypair", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_crypto_kx_keypair", MAY_BE_STRING),
+ F1("sodium_crypto_kx_secretkey", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_crypto_kx_publickey", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_crypto_kx_client_session_keys", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
+ F1("sodium_crypto_kx_server_session_keys", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
+ F1("sodium_crypto_auth", MAY_BE_NULL | MAY_BE_STRING),
+ F0("sodium_crypto_auth_verify", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("sodium_compare", MAY_BE_NULL | MAY_BE_LONG),
+ F1("sodium_crypto_aead_aes256gcm_keygen", MAY_BE_STRING),
+ F1("sodium_crypto_auth_keygen", MAY_BE_STRING),
+ F1("sodium_crypto_generichash_keygen", MAY_BE_STRING),
+ F1("sodium_crypto_kdf_keygen", MAY_BE_STRING),
+ F1("sodium_crypto_secretbox_keygen", MAY_BE_STRING),
+ F1("sodium_crypto_shorthash_keygen", MAY_BE_STRING),
+ F1("sodium_crypto_stream_keygen", MAY_BE_STRING),
+ F1("sodium_crypto_kdf_derive_from_key", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_pad", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_unpad", MAY_BE_NULL | MAY_BE_STRING),
+
+ F1("sodium_crypto_box_keypair_from_secretkey_and_publickey", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_crypto_box_publickey_from_secretkey", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_crypto_sign_keypair_from_secretkey_and_publickey", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_crypto_sign_publickey_from_secretkey", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_crypto_pwhash_scryptsalsa208sha256", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_crypto_pwhash_scryptsalsa208sha256_str", MAY_BE_NULL | MAY_BE_STRING),
+ F0("sodium_crypto_pwhash_scryptsalsa208sha256_str_verify", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("sodium_crypto_aead_aes256gcm_is_available", MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("sodium_crypto_sign_ed25519_sk_to_curve25519", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_crypto_sign_ed25519_pk_to_curve25519", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_crypto_aead_chacha20poly1305_encrypt", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_crypto_aead_chacha20poly1305_decrypt", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("sodium_crypto_aead_chacha20poly1305_ietf_encrypt", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_crypto_aead_chacha20poly1305_ietf_decrypt", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("sodium_crypto_aead_xchacha20poly1305_ietf_encrypt", MAY_BE_NULL | MAY_BE_STRING),
+ F1("sodium_crypto_aead_xchacha20poly1305_ietf_decrypt", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("sodium_crypto_aead_chacha20poly1305_keygen", MAY_BE_STRING),
+ F1("sodium_crypto_aead_chacha20poly1305_ietf_keygen", MAY_BE_STRING),
+ F1("sodium_crypto_aead_xchacha20poly1305_ietf_keygen", MAY_BE_STRING),
+
+ /* ext/session */
+ F0("session_set_cookie_params", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ I1("session_get_cookie_params", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY),
+ F1("session_name", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("session_module_name", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F0("session_set_save_handler", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("session_save_path", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ FN("session_id", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F0("session_regenerate_id", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("session_create_id", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("session_cache_limiter", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F0("session_cache_expire", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ I1("session_encode", MAY_BE_FALSE | MAY_BE_STRING),
+ F0("session_decode", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("session_start", MAY_BE_FALSE | MAY_BE_TRUE),
+ I0("session_destroy", MAY_BE_FALSE | MAY_BE_TRUE),
+ I0("session_unset", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("session_gc", MAY_BE_FALSE | MAY_BE_LONG),
+ F0("session_write_close", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("session_abort", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("session_reset", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("session_status", MAY_BE_NULL | MAY_BE_LONG),
+ I0("session_register_shutdown", MAY_BE_NULL),
+
+ /* ext/pgsql */
+ F1("pg_connect", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F1("pg_pconnect", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F0("pg_connect_poll", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F0("pg_close", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("pg_dbname", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("pg_last_error", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("pg_options", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("pg_port", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("pg_tty", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("pg_host", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("pg_version", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_STRING),
+ F1("pg_parameter_status", MAY_BE_FALSE | MAY_BE_STRING),
+ F0("pg_ping", MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("pg_query", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F1("pg_query_params", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F1("pg_prepare", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F1("pg_execute", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F0("pg_num_rows", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F0("pg_num_fields", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F0("pg_affected_rows", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ FN("pg_last_notice", UNKNOWN_INFO),
+ F1("pg_field_table", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_STRING),
+ F1("pg_field_name", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F0("pg_field_size", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F1("pg_field_type", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("pg_field_type_oid", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_STRING),
+ F0("pg_field_num", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F1("pg_fetch_result", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("pg_fetch_row", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_NULL | MAY_BE_ARRAY_OF_STRING),
+ F1("pg_fetch_assoc", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_NULL | MAY_BE_ARRAY_OF_STRING),
+ F1("pg_fetch_array", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_NULL | MAY_BE_ARRAY_OF_STRING),
+ F1("pg_fetch_object", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_OBJECT),
+ F1("pg_fetch_all", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_ARRAY),
+ F1("pg_fetch_all_columns", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_NULL | MAY_BE_ARRAY_OF_STRING),
+ F0("pg_result_seek", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("pg_field_prtlen", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F0("pg_field_is_null", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F0("pg_free_result", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("pg_last_oid", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_STRING),
+ F0("pg_trace", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("pg_untrace", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("pg_lo_create", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_STRING),
+ F0("pg_lo_unlink", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("pg_lo_open", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F1("pg_lo_read", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F0("pg_lo_write", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F0("pg_lo_read_all", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F1("pg_lo_import", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_STRING),
+ F0("pg_lo_export", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("pg_lo_seek", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("pg_lo_tell", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F0("pg_lo_truncate", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("pg_set_error_verbosity", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F0("pg_set_client_encoding", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F0("pg_end_copy", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("pg_put_line", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("pg_copy_to", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
+ F0("pg_copy_from", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("pg_escape_string", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("pg_escape_bytea", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("pg_unescape_bytea", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("pg_escape_literal", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("pg_escape_identifier", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("pg_result_error", MAY_BE_FALSE | MAY_BE_STRING),
+ F1("pg_result_error_field", MAY_BE_FALSE | MAY_BE_STRING),
+ F0("pg_connection_status", MAY_BE_FALSE | MAY_BE_LONG),
+ F0("pg_transaction_status", MAY_BE_FALSE | MAY_BE_LONG),
+ F0("pg_connection_reset", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("pg_cancel_query", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("pg_connection_busy", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("pg_send_query", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_LONG),
+ F0("pg_send_query_params", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_LONG),
+ F0("pg_send_prepare", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_LONG),
+ F0("pg_send_execute", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_LONG),
+ F1("pg_get_result", MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F1("pg_result_status", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG | MAY_BE_STRING),
+ F1("pg_get_notify", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY),
+ F0("pg_get_pid", MAY_BE_FALSE | MAY_BE_LONG),
+ F1("pg_socket", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F0("pg_consume_input", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("pg_flush", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_LONG),
+ F1("pg_meta_data", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ARRAY),
+ F1("pg_convert", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY),
+ F1("pg_insert", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_RESOURCE | MAY_BE_STRING),
+ F1("pg_update", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_STRING),
+ F1("pg_delete", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_STRING),
+ F1("pg_select", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_STRING),
+
+ /* ext/bcmath */
+ F1("bcadd", MAY_BE_NULL | MAY_BE_STRING),
+ F1("bcsub", MAY_BE_NULL | MAY_BE_STRING),
+ F1("bcmul", MAY_BE_NULL | MAY_BE_STRING),
+ F1("bcdiv", MAY_BE_NULL | MAY_BE_STRING),
+ F1("bcmod", MAY_BE_NULL | MAY_BE_STRING),
+ F1("bcpowmod", MAY_BE_NULL | MAY_BE_STRING),
+ F1("bcpow", MAY_BE_NULL | MAY_BE_STRING),
+ F1("bcsqrt", MAY_BE_NULL | MAY_BE_STRING),
+ F0("bccomp", MAY_BE_NULL | MAY_BE_LONG),
+ F0("bcscale", MAY_BE_NULL | MAY_BE_TRUE),
+
+ /* ext/exif */
+ F1("exif_tagname", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("exif_read_data", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY),
+ F1("exif_thumbnail", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F0("exif_imagetype", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+
+ /* ext/filter */
+ F0("filter_has_var", MAY_BE_FALSE | MAY_BE_TRUE),
+ FN("filter_input", UNKNOWN_INFO),
+ FN("filter_var", UNKNOWN_INFO),
+ F1("filter_input_array", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY),
+ F1("filter_var_array", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY),
+ I1("filter_list", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
+ F0("filter_id", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+
+ /* ext/gettext */
+ F1("textdomain", MAY_BE_NULL | MAY_BE_STRING),
+ F1("gettext", MAY_BE_NULL | MAY_BE_STRING),
+ F1("_", MAY_BE_NULL | MAY_BE_STRING),
+ F1("dgettext", MAY_BE_NULL | MAY_BE_STRING),
+ F1("dcgettext", MAY_BE_NULL | MAY_BE_STRING),
+ F1("bindtextdomain", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+#if HAVE_NGETTEXT
+ F1("ngettext", MAY_BE_NULL | MAY_BE_STRING),
+#endif
+#if HAVE_DNGETTEXT
+ F1("dcngettext", MAY_BE_NULL | MAY_BE_STRING),
+#endif
+#if HAVE_BIND_TEXTDOMAIN_CODESET
+ F1("bind_textdomain_codeset", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+#endif
+
+ /* ext/ctype */
+ F0("ctype_alnum", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("ctype_alpha", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("ctype_cntrl", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("ctype_digit", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("ctype_lower", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("ctype_graph", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("ctype_print", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("ctype_punct", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("ctype_space", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("ctype_upper", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("ctype_xdigit", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+
+ /* ext/fileinfo */
+ F1("finfo_open", MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F0("finfo_close", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("finfo_set_flags", MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("finfo_file", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("finfo_buffer", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+ F1("mime_content_type", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
+
+ /* ext/gd */
+ F1("gd_info", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_FALSE | MAY_BE_ARRAY_OF_TRUE),
+ F0("imageloadfont", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F0("imagesetstyle", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("imagecreatetruecolor", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F0("imageistruecolor", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagetruecolortopalette", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagepalettetotruecolor", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagecolormatch", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagesetthickness", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagefilledellipse", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagefilledarc", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagealphablending", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagesavealpha", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagelayereffect", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagecolorallocatealpha", MAY_BE_FALSE | MAY_BE_LONG),
+ F0("imagecolorresolvealpha", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F0("imagecolorclosestalpha", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F0("imagecolorexactalpha", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F0("imagecopyresampled", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+#ifdef PHP_WIN32
+ F1("imagegrabwindow", MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F1("imagegrabscreen", MAY_BE_FALSE | MAY_BE_RESOURCE),
+#endif
+ F1("imagerotate", MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F0("imagesettile", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagesetbrush", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("imagecreate", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ I0("imagetypes", MAY_BE_LONG),
+ F1("imagecreatefromstring", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F1("imagecreatefromgif", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+#ifdef HAVE_GD_JPG
+ F1("imagecreatefromjpeg", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F0("imagejpeg", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("jpeg2wbmp", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+#endif
+#ifdef HAVE_GD_PNG
+ F1("imagecreatefrompng", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F0("imagepng", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("png2wbmp", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+#endif
+#ifdef HAVE_GD_WEBP
+ F1("imagecreatefromwebp", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F0("imagewebp", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+#endif
+ F1("imagecreatefromxbm", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+#if defined(HAVE_GD_XPM)
+ F1("imagecreatefromxpm", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+#endif
+ F1("imagecreatefromwbmp", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F1("imagecreatefromgd", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F1("imagecreatefromgd2", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F1("imagecreatefromgd2part", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+#if defined(HAVE_GD_BMP)
+ F1("imagecreatefrombmp", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F0("imagebmp", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+#endif
+ F0("imagexbm", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagegif", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagewbmp", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagegd", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagegd2", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagedestroy", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("magecolorallocate", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F0("imagepalettecopy", MAY_BE_NULL | MAY_BE_FALSE),
+ F0("imagecolorat", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F0("imagecolorclosest", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F0("imagecolorclosesthwb", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F0("imagecolordeallocate", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagecolorresolve", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F0("imagecolorexact", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F0("imagecolorset", MAY_BE_NULL | MAY_BE_FALSE),
+ F1("imagecolorsforindex", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG),
+ F0("imagegammacorrect", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagesetpixel", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imageline", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagedashedline", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagerectangle", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagefilledrectangle", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagearc", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imageellipse", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagefilltoborder", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagefill", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagecolorstotal", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F0("imagecolortransparent", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F0("imageinterlace", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F0("imagepolygon", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imageopenpolygon", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagefilledpolygon", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagefontwidth", MAY_BE_NULL | MAY_BE_LONG),
+ F0("imagefontheight", MAY_BE_NULL | MAY_BE_LONG),
+ F0("imagechar", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagecharup", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagestring", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagestringup", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagecopy", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagecopymerge", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagecopymergegray", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagecopyresized", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagesx", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F0("imagesy", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
+ F0("imagesetclip", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("imagegetclip", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG),
+ F1("imageftbbox", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG),
+ F1("imagefttext", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG),
+ F1("imagettfbbox", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG),
+ F1("imagettftext", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG),
+ F0("image2wbmp", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imagefilter", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imageconvolution", MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imageflip", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F0("imageantialias", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("imagecrop", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F1("imagecropauto", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F1("imagescale", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F1("imageaffine", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_RESOURCE),
+ F1("imageaffinematrixget", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_DOUBLE),
+ F1("imageaffinematrixconcat", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_DOUBLE),
+ F0("imagesetinterpolation", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
+ F1("imageresolution", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG),
+
};
static HashTable func_info;
@@ -1213,11 +1693,19 @@ uint32_t zend_get_func_info(const zend_call_info *call_info, const zend_ssa *ssa
if (call_info->callee_func->type == ZEND_INTERNAL_FUNCTION) {
func_info_t *info;
- if ((info = zend_hash_find_ptr(&func_info, Z_STR_P(CRT_CONSTANT_EX(call_info->caller_op_array, call_info->caller_init_opline->op2, ssa->rt_constants)))) != NULL) {
+ if ((info = zend_hash_find_ptr(&func_info, Z_STR_P(CRT_CONSTANT_EX(call_info->caller_op_array, call_info->caller_init_opline, call_info->caller_init_opline->op2, ssa->rt_constants)))) != NULL) {
if (UNEXPECTED(zend_optimizer_is_disabled_func(info->name, info->name_len))) {
ret = MAY_BE_NULL;
} else if (info->info_func) {
ret = info->info_func(call_info, ssa);
+ } else if (/*call_info->callee_func->common.arg_info && */
+ call_info->callee_func->common.num_args == 0 &&
+ call_info->callee_func->common.required_num_args == 0) {
+ if (call_info->num_args == 0) {
+ ret = info->info;
+ } else {
+ ret = FUNC_MAY_WARN | MAY_BE_NULL;
+ }
} else {
ret = info->info;
}
diff --git a/ext/opcache/Optimizer/zend_inference.c b/ext/opcache/Optimizer/zend_inference.c
index e108b7a4dd..7bb906d4a6 100644
--- a/ext/opcache/Optimizer/zend_inference.c
+++ b/ext/opcache/Optimizer/zend_inference.c
@@ -2565,6 +2565,28 @@ static int zend_update_type_info(const zend_op_array *op_array,
UPDATE_SSA_TYPE(tmp, ssa_ops[i].op1_def);
}
break;
+ case ZEND_PRE_INC_OBJ:
+ case ZEND_PRE_DEC_OBJ:
+ case ZEND_POST_INC_OBJ:
+ case ZEND_POST_DEC_OBJ:
+ if (opline->op1_type == IS_CV) {
+ tmp = t1;
+ if (t1 & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE)) {
+ tmp &= ~(MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE);
+ tmp |= MAY_BE_OBJECT | MAY_BE_RC1 | MAY_BE_RCN;
+ }
+ if (tmp & MAY_BE_OBJECT) {
+ tmp |= MAY_BE_RC1 | MAY_BE_RCN;
+ }
+ UPDATE_SSA_TYPE(tmp, ssa_ops[i].op1_def);
+ COPY_SSA_OBJ_TYPE(ssa_ops[i].op1_use, ssa_ops[i].op1_def);
+ }
+ if (ssa_ops[i].result_def >= 0) {
+ // TODO: ???
+ tmp = MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF;
+ UPDATE_SSA_TYPE(tmp, ssa_ops[i].result_def);
+ }
+ break;
case ZEND_ASSIGN:
if (opline->op2_type == IS_CV && ssa_ops[i].op2_def >= 0) {
tmp = t2;
@@ -2726,7 +2748,7 @@ static int zend_update_type_info(const zend_op_array *op_array,
if (arg_info) {
tmp = zend_fetch_arg_info(script, arg_info, &ce);
if (opline->opcode == ZEND_RECV_INIT &&
- Z_CONSTANT_P(CRT_CONSTANT_EX(op_array, opline->op2, ssa->rt_constants))) {
+ Z_TYPE_P(CRT_CONSTANT_EX(op_array, opline, opline->op2, ssa->rt_constants)) == IS_CONSTANT_AST) {
/* The constant may resolve to NULL */
tmp |= MAY_BE_NULL;
}
@@ -2774,7 +2796,7 @@ static int zend_update_type_info(const zend_op_array *op_array,
case ZEND_DECLARE_ANON_CLASS:
case ZEND_DECLARE_ANON_INHERITED_CLASS:
UPDATE_SSA_TYPE(MAY_BE_CLASS, ssa_ops[i].result_def);
- if (script && (ce = zend_hash_find_ptr(&script->class_table, Z_STR_P(CRT_CONSTANT_EX(op_array, opline->op1, ssa->rt_constants)))) != NULL) {
+ if (script && (ce = zend_hash_find_ptr(&script->class_table, Z_STR_P(CRT_CONSTANT_EX(op_array, opline, opline->op1, ssa->rt_constants)))) != NULL) {
UPDATE_SSA_OBJ_TYPE(ce, 0, ssa_ops[i].result_def);
}
break;
@@ -2802,7 +2824,7 @@ static int zend_update_type_info(const zend_op_array *op_array,
break;
}
} else if (opline->op2_type == IS_CONST) {
- zval *zv = CRT_CONSTANT_EX(op_array, opline->op2, ssa->rt_constants);
+ zval *zv = CRT_CONSTANT_EX(op_array, opline, opline->op2, ssa->rt_constants);
if (Z_TYPE_P(zv) == IS_STRING) {
ce = get_class_entry(script, Z_STR_P(zv+1));
UPDATE_SSA_OBJ_TYPE(ce, 0, ssa_ops[i].result_def);
@@ -2816,7 +2838,7 @@ static int zend_update_type_info(const zend_op_array *op_array,
case ZEND_NEW:
tmp = MAY_BE_RC1|MAY_BE_RCN|MAY_BE_OBJECT;
if (opline->op1_type == IS_CONST &&
- (ce = get_class_entry(script, Z_STR_P(CRT_CONSTANT_EX(op_array, opline->op1, ssa->rt_constants)+1))) != NULL) {
+ (ce = get_class_entry(script, Z_STR_P(CRT_CONSTANT_EX(op_array, opline, opline->op1, ssa->rt_constants)+1))) != NULL) {
UPDATE_SSA_OBJ_TYPE(ce, 0, ssa_ops[i].result_def);
} else if ((t1 & MAY_BE_CLASS) && ssa_ops[i].op1_use >= 0 && ssa_var_info[ssa_ops[i].op1_use].ce) {
UPDATE_SSA_OBJ_TYPE(ssa_var_info[ssa_ops[i].op1_use].ce, ssa_var_info[ssa_ops[i].op1_use].is_instanceof, ssa_ops[i].result_def);
@@ -3467,7 +3489,7 @@ static zend_bool can_convert_to_double(
ZVAL_COPY_VALUE(&orig_op1, value);
ZVAL_DOUBLE(&dval_op1, (double) Z_LVAL_P(value));
} else if (opline->op1_type == IS_CONST) {
- zval *zv = CRT_CONSTANT_EX(op_array, opline->op1, ssa->rt_constants);
+ zval *zv = CRT_CONSTANT_EX(op_array, opline, opline->op1, ssa->rt_constants);
if (Z_TYPE_P(zv) == IS_LONG || Z_TYPE_P(zv) == IS_DOUBLE) {
ZVAL_COPY_VALUE(&orig_op1, zv);
ZVAL_COPY_VALUE(&dval_op1, zv);
@@ -3480,7 +3502,7 @@ static zend_bool can_convert_to_double(
ZVAL_COPY_VALUE(&orig_op2, value);
ZVAL_DOUBLE(&dval_op2, (double) Z_LVAL_P(value));
} else if (opline->op2_type == IS_CONST) {
- zval *zv = CRT_CONSTANT_EX(op_array, opline->op2, ssa->rt_constants);
+ zval *zv = CRT_CONSTANT_EX(op_array, opline, opline->op2, ssa->rt_constants);
if (Z_TYPE_P(zv) == IS_LONG || Z_TYPE_P(zv) == IS_DOUBLE) {
ZVAL_COPY_VALUE(&orig_op2, zv);
ZVAL_COPY_VALUE(&dval_op2, zv);
@@ -3562,7 +3584,7 @@ static int zend_type_narrowing(const zend_op_array *op_array, const zend_script
* doubles instead, in the hope that we'll narrow long|double to double. */
if (opline->opcode == ZEND_ASSIGN && opline->result_type == IS_UNUSED &&
opline->op1_type == IS_CV && opline->op2_type == IS_CONST) {
- zval *value = CRT_CONSTANT_EX(op_array, opline->op2, ssa->rt_constants);
+ zval *value = CRT_CONSTANT_EX(op_array, opline, opline->op2, ssa->rt_constants);
zend_bitset_clear(visited, bitset_len);
if (can_convert_to_double(op_array, ssa, v, value, visited)) {
@@ -3714,7 +3736,7 @@ void zend_func_return_info(const zend_op_array *op_array,
}
if (opline->op1_type == IS_CONST) {
- zval *zv = CRT_CONSTANT_EX(op_array, opline->op1, info->ssa.rt_constants);
+ zval *zv = CRT_CONSTANT_EX(op_array, opline, opline->op1, info->ssa.rt_constants);
if (Z_TYPE_P(zv) == IS_NULL) {
if (tmp_has_range < 0) {
@@ -4044,6 +4066,8 @@ int zend_may_throw(const zend_op *opline, zend_op_array *op_array, zend_ssa *ssa
case ZEND_SWITCH_STRING:
case ZEND_ISSET_ISEMPTY_VAR:
case ZEND_ISSET_ISEMPTY_CV:
+ case ZEND_FUNC_NUM_ARGS:
+ case ZEND_FUNC_GET_ARGS:
return 0;
case ZEND_INIT_FCALL:
/* can't throw, because call is resolved at compile time */
@@ -4180,8 +4204,50 @@ int zend_may_throw(const zend_op *opline, zend_op_array *op_array, zend_ssa *ssa
case ZEND_UNSET_VAR:
return (t1 & (MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_ARRAY_OF_OBJECT|MAY_BE_ARRAY_OF_RESOURCE|MAY_BE_ARRAY_OF_ARRAY));
case ZEND_ASSIGN_DIM:
+ if ((opline+1)->op1_type == IS_CV) {
+ if (_ssa_op1_info(op_array, ssa, opline+1) & MAY_BE_UNDEF) {
+ return 1;
+ }
+ }
return (t1 & (MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_TRUE|MAY_BE_STRING|MAY_BE_LONG|MAY_BE_DOUBLE)) || opline->op2_type == IS_UNUSED ||
(t2 & (MAY_BE_UNDEF|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE));
+ case ZEND_ASSIGN_OBJ:
+ if (t1 & (MAY_BE_ANY-(MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_OBJECT))) {
+ return 1;
+ }
+ if (ssa->ops[opline - op_array->opcodes].op1_use) {
+ zend_ssa_var_info *var_info = ssa->var_info + ssa->ops[opline - op_array->opcodes].op1_use;
+ zend_class_entry *ce = var_info->ce;
+
+ if (var_info->is_instanceof ||
+ !ce || ce->create_object || ce->__get || ce->__set ||
+ (ce->ce_flags & ZEND_ACC_INHERITED)) {
+ return 1;
+ }
+
+ if (op_array->scope != ce && ce->default_properties_count) {
+ zend_property_info *prop_info;
+
+ if (opline->op2_type == IS_CONST) {
+ prop_info = zend_hash_find_ptr(&ce->properties_info,
+ Z_STR_P(CRT_CONSTANT_EX(op_array, opline, opline->op2, ssa->rt_constants)));
+ if (prop_info && !(prop_info->flags & ZEND_ACC_PUBLIC)) {
+ return 1;
+ }
+ } else {
+ if (t2 & (MAY_BE_ANY-MAY_BE_STRING)) {
+ return 1;
+ }
+ ZEND_HASH_FOREACH_PTR(&ce->properties_info, prop_info) {
+ if (!(prop_info->flags & ZEND_ACC_PUBLIC)) {
+ return 1;
+ }
+ } ZEND_HASH_FOREACH_END();
+ }
+ }
+ return 0;
+ }
+ return 1;
case ZEND_ROPE_INIT:
case ZEND_ROPE_ADD:
case ZEND_ROPE_END:
@@ -4194,7 +4260,7 @@ int zend_may_throw(const zend_op *opline, zend_op_array *op_array, zend_ssa *ssa
case ZEND_COUNT:
return (t1 & MAY_BE_ANY) != MAY_BE_ARRAY;
case ZEND_RECV_INIT:
- if (Z_CONSTANT_P(CRT_CONSTANT_EX(op_array, opline->op2, ssa->rt_constants))) {
+ if (Z_TYPE_P(CRT_CONSTANT_EX(op_array, opline, opline->op2, ssa->rt_constants)) == IS_CONSTANT_AST) {
return 1;
}
if (op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS) {
diff --git a/ext/opcache/Optimizer/zend_inference.h b/ext/opcache/Optimizer/zend_inference.h
index c10946a638..6bd9706fa8 100644
--- a/ext/opcache/Optimizer/zend_inference.h
+++ b/ext/opcache/Optimizer/zend_inference.h
@@ -40,7 +40,7 @@
static zend_always_inline zend_bool _ssa_##opN##_has_range(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline) \
{ \
if (opline->opN##_type == IS_CONST) { \
- zval *zv = CRT_CONSTANT_EX(op_array, opline->opN, ssa->rt_constants); \
+ zval *zv = CRT_CONSTANT_EX(op_array, opline, opline->opN, ssa->rt_constants); \
return (Z_TYPE_P(zv) == IS_LONG || Z_TYPE_P(zv) == IS_TRUE || Z_TYPE_P(zv) == IS_FALSE || Z_TYPE_P(zv) == IS_NULL); \
} else { \
return (opline->opN##_type != IS_UNUSED && \
@@ -56,7 +56,7 @@
static zend_always_inline zend_long _ssa_##opN##_min_range(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline) \
{ \
if (opline->opN##_type == IS_CONST) { \
- zval *zv = CRT_CONSTANT_EX(op_array, opline->opN, ssa->rt_constants); \
+ zval *zv = CRT_CONSTANT_EX(op_array, opline, opline->opN, ssa->rt_constants); \
if (Z_TYPE_P(zv) == IS_LONG) { \
return Z_LVAL_P(zv); \
} else if (Z_TYPE_P(zv) == IS_TRUE) { \
@@ -80,7 +80,7 @@
static zend_always_inline zend_long _ssa_##opN##_max_range(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline) \
{ \
if (opline->opN##_type == IS_CONST) { \
- zval *zv = CRT_CONSTANT_EX(op_array, opline->opN, ssa->rt_constants); \
+ zval *zv = CRT_CONSTANT_EX(op_array, opline, opline->opN, ssa->rt_constants); \
if (Z_TYPE_P(zv) == IS_LONG) { \
return Z_LVAL_P(zv); \
} else if (Z_TYPE_P(zv) == IS_TRUE) { \
@@ -104,7 +104,7 @@
static zend_always_inline char _ssa_##opN##_range_underflow(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline) \
{ \
if (opline->opN##_type == IS_CONST) { \
- zval *zv = CRT_CONSTANT_EX(op_array, opline->opN, ssa->rt_constants); \
+ zval *zv = CRT_CONSTANT_EX(op_array, opline, opline->opN, ssa->rt_constants); \
if (Z_TYPE_P(zv) == IS_LONG || Z_TYPE_P(zv) == IS_TRUE || Z_TYPE_P(zv) == IS_FALSE || Z_TYPE_P(zv) == IS_NULL) { \
return 0; \
} \
@@ -122,7 +122,7 @@
static zend_always_inline char _ssa_##opN##_range_overflow(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline) \
{ \
if (opline->opN##_type == IS_CONST) { \
- zval *zv = CRT_CONSTANT_EX(op_array, opline->opN, ssa->rt_constants); \
+ zval *zv = CRT_CONSTANT_EX(op_array, opline, opline->opN, ssa->rt_constants); \
if (Z_TYPE_P(zv) == IS_LONG || Z_TYPE_P(zv) == IS_TRUE || Z_TYPE_P(zv) == IS_FALSE || Z_TYPE_P(zv) == IS_NULL) { \
return 0; \
} \
@@ -159,9 +159,7 @@ DEFINE_SSA_OP_RANGE_OVERFLOW(op2)
#define OP2_RANGE_OVERFLOW() (_ssa_op2_range_overflow (op_array, ssa, opline))
static zend_always_inline uint32_t _const_op_type(const zval *zv) {
- if (Z_TYPE_P(zv) == IS_CONSTANT) {
- return MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY;
- } else if (Z_TYPE_P(zv) == IS_CONSTANT_AST) {
+ if (Z_TYPE_P(zv) == IS_CONSTANT_AST) {
return MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY;
} else if (Z_TYPE_P(zv) == IS_ARRAY) {
HashTable *ht = Z_ARRVAL_P(zv);
@@ -209,7 +207,7 @@ static zend_always_inline uint32_t get_ssa_var_info(const zend_ssa *ssa, int ssa
static zend_always_inline uint32_t _ssa_##opN##_info(const zend_op_array *op_array, const zend_ssa *ssa, const zend_op *opline) \
{ \
if (opline->opN##_type == IS_CONST) { \
- return _const_op_type(CRT_CONSTANT_EX(op_array, opline->opN, ssa->rt_constants)); \
+ return _const_op_type(CRT_CONSTANT_EX(op_array, opline, opline->opN, ssa->rt_constants)); \
} else { \
return get_ssa_var_info(ssa, ssa->ops ? ssa->ops[opline - op_array->opcodes].opN##_use : -1); \
} \
diff --git a/ext/opcache/Optimizer/zend_optimizer.c b/ext/opcache/Optimizer/zend_optimizer.c
index f55aa41428..14a618af7c 100644
--- a/ext/opcache/Optimizer/zend_optimizer.c
+++ b/ext/opcache/Optimizer/zend_optimizer.c
@@ -812,7 +812,7 @@ void zend_optimizer_shift_jump(zend_op_array *op_array, zend_op *opline, uint32_
static zend_class_entry *get_class_entry_from_op1(
zend_script *script, zend_op_array *op_array, zend_op *opline, zend_bool rt_constants) {
if (opline->op1_type == IS_CONST) {
- zval *op1 = CRT_CONSTANT_EX(op_array, opline->op1, rt_constants);
+ zval *op1 = CRT_CONSTANT_EX(op_array, opline, opline->op1, rt_constants);
if (Z_TYPE_P(op1) == IS_STRING) {
zend_string *class_name = Z_STR_P(op1 + 1);
zend_class_entry *ce;
@@ -839,7 +839,7 @@ static zend_class_entry *get_class_entry_from_op1(
zend_function *zend_optimizer_get_called_func(
zend_script *script, zend_op_array *op_array, zend_op *opline, zend_bool rt_constants)
{
-#define GET_OP(op) CRT_CONSTANT_EX(op_array, opline->op, rt_constants)
+#define GET_OP(op) CRT_CONSTANT_EX(op_array, opline, opline->op, rt_constants)
switch (opline->opcode) {
case ZEND_INIT_FCALL:
{
@@ -1081,28 +1081,88 @@ static void zend_revert_pass_two(zend_op_array *op_array)
end = opline + op_array->last;
while (opline < end) {
if (opline->op1_type == IS_CONST) {
- ZEND_PASS_TWO_UNDO_CONSTANT(op_array, opline->op1);
+ ZEND_PASS_TWO_UNDO_CONSTANT(op_array, opline, opline->op1);
}
if (opline->op2_type == IS_CONST) {
- ZEND_PASS_TWO_UNDO_CONSTANT(op_array, opline->op2);
+ ZEND_PASS_TWO_UNDO_CONSTANT(op_array, opline, opline->op2);
}
opline++;
}
+#if !ZEND_USE_ABS_CONST_ADDR
+ if (op_array->literals) {
+ zval *literals = emalloc(sizeof(zval) * op_array->last_literal);
+ memcpy(literals, op_array->literals, sizeof(zval) * op_array->last_literal);
+ op_array->literals = literals;
+ }
+#endif
}
static void zend_redo_pass_two(zend_op_array *op_array)
{
zend_op *opline, *end;
+#if ZEND_USE_ABS_JMP_ADDR && !ZEND_USE_ABS_CONST_ADDR
+ zend_op *old_opcodes = op_array->opcodes;
+#endif
+
+#if !ZEND_USE_ABS_CONST_ADDR
+ if (op_array->last_literal) {
+ op_array->opcodes = (zend_op *) erealloc(op_array->opcodes,
+ ZEND_MM_ALIGNED_SIZE_EX(sizeof(zend_op) * op_array->last, 16) +
+ sizeof(zval) * op_array->last_literal);
+ memcpy(((char*)op_array->opcodes) + ZEND_MM_ALIGNED_SIZE_EX(sizeof(zend_op) * op_array->last, 16),
+ op_array->literals, sizeof(zval) * op_array->last_literal);
+ efree(op_array->literals);
+ op_array->literals = (zval*)(((char*)op_array->opcodes) + ZEND_MM_ALIGNED_SIZE_EX(sizeof(zend_op) * op_array->last, 16));
+ } else {
+ if (op_array->literals) {
+ efree(op_array->literals);
+ }
+ op_array->literals = NULL;
+ }
+#endif
opline = op_array->opcodes;
end = opline + op_array->last;
while (opline < end) {
if (opline->op1_type == IS_CONST) {
- ZEND_PASS_TWO_UPDATE_CONSTANT(op_array, opline->op1);
+ ZEND_PASS_TWO_UPDATE_CONSTANT(op_array, opline, opline->op1);
}
if (opline->op2_type == IS_CONST) {
- ZEND_PASS_TWO_UPDATE_CONSTANT(op_array, opline->op2);
+ ZEND_PASS_TWO_UPDATE_CONSTANT(op_array, opline, opline->op2);
+ }
+#if ZEND_USE_ABS_JMP_ADDR && !ZEND_USE_ABS_CONST_ADDR
+ if (op_array->fn_flags & ZEND_ACC_DONE_PASS_TWO) {
+ /* fix jumps to point to new array */
+ switch (opline->opcode) {
+ case ZEND_JMP:
+ case ZEND_FAST_CALL:
+ opline->op1.jmp_addr = &op_array->opcodes[opline->op1.jmp_addr - old_opcodes];
+ break;
+ case ZEND_JMPZNZ:
+ /* relative extended_value don't have to be changed */
+ /* break omitted intentionally */
+ case ZEND_JMPZ:
+ case ZEND_JMPNZ:
+ case ZEND_JMPZ_EX:
+ case ZEND_JMPNZ_EX:
+ case ZEND_JMP_SET:
+ case ZEND_COALESCE:
+ case ZEND_FE_RESET_R:
+ case ZEND_FE_RESET_RW:
+ case ZEND_ASSERT_CHECK:
+ opline->op2.jmp_addr = &op_array->opcodes[opline->op2.jmp_addr - old_opcodes];
+ break;
+ case ZEND_DECLARE_ANON_CLASS:
+ case ZEND_DECLARE_ANON_INHERITED_CLASS:
+ case ZEND_FE_FETCH_R:
+ case ZEND_FE_FETCH_RW:
+ case ZEND_SWITCH_LONG:
+ case ZEND_SWITCH_STRING:
+ /* relative extended_value don't have to be changed */
+ break;
+ }
}
+#endif
ZEND_VM_SET_OPCODE_HANDLER(opline);
opline++;
}
@@ -1112,6 +1172,26 @@ static void zend_redo_pass_two(zend_op_array *op_array)
static void zend_redo_pass_two_ex(zend_op_array *op_array, zend_ssa *ssa)
{
zend_op *opline, *end;
+#if ZEND_USE_ABS_JMP_ADDR && !ZEND_USE_ABS_CONST_ADDR
+ zend_op *old_opcodes = op_array->opcodes;
+#endif
+
+#if !ZEND_USE_ABS_CONST_ADDR
+ if (op_array->last_literal) {
+ op_array->opcodes = (zend_op *) erealloc(op_array->opcodes,
+ ZEND_MM_ALIGNED_SIZE_EX(sizeof(zend_op) * op_array->last, 16) +
+ sizeof(zval) * op_array->last_literal);
+ memcpy(((char*)op_array->opcodes) + ZEND_MM_ALIGNED_SIZE_EX(sizeof(zend_op) * op_array->last, 16),
+ op_array->literals, sizeof(zval) * op_array->last_literal);
+ efree(op_array->literals);
+ op_array->literals = (zval*)(((char*)op_array->opcodes) + ZEND_MM_ALIGNED_SIZE_EX(sizeof(zend_op) * op_array->last, 16));
+ } else {
+ if (op_array->literals) {
+ efree(op_array->literals);
+ }
+ op_array->literals = NULL;
+ }
+#endif
opline = op_array->opcodes;
end = opline + op_array->last;
@@ -1126,11 +1206,44 @@ static void zend_redo_pass_two_ex(zend_op_array *op_array, zend_ssa *ssa)
((ssa->ops[opline - op_array->opcodes].op1_def >= 0) ? (OP1_DEF_INFO() & (MAY_BE_UNDEF|MAY_BE_ANY|MAY_BE_REF|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_KEY_ANY)) : MAY_BE_ANY) :
(opline->result_type == IS_UNUSED ? 0 : (RES_INFO() & (MAY_BE_UNDEF|MAY_BE_ANY|MAY_BE_REF|MAY_BE_ARRAY_OF_ANY|MAY_BE_ARRAY_KEY_ANY))));
if (opline->op1_type == IS_CONST) {
- ZEND_PASS_TWO_UPDATE_CONSTANT(op_array, opline->op1);
+ ZEND_PASS_TWO_UPDATE_CONSTANT(op_array, opline, opline->op1);
}
if (opline->op2_type == IS_CONST) {
- ZEND_PASS_TWO_UPDATE_CONSTANT(op_array, opline->op2);
+ ZEND_PASS_TWO_UPDATE_CONSTANT(op_array, opline, opline->op2);
+ }
+#if ZEND_USE_ABS_JMP_ADDR && !ZEND_USE_ABS_CONST_ADDR
+ if (op_array->fn_flags & ZEND_ACC_DONE_PASS_TWO) {
+ /* fix jumps to point to new array */
+ switch (opline->opcode) {
+ case ZEND_JMP:
+ case ZEND_FAST_CALL:
+ opline->op1.jmp_addr = &op_array->opcodes[opline->op1.jmp_addr - old_opcodes];
+ break;
+ case ZEND_JMPZNZ:
+ /* relative extended_value don't have to be changed */
+ /* break omitted intentionally */
+ case ZEND_JMPZ:
+ case ZEND_JMPNZ:
+ case ZEND_JMPZ_EX:
+ case ZEND_JMPNZ_EX:
+ case ZEND_JMP_SET:
+ case ZEND_COALESCE:
+ case ZEND_FE_RESET_R:
+ case ZEND_FE_RESET_RW:
+ case ZEND_ASSERT_CHECK:
+ opline->op2.jmp_addr = &op_array->opcodes[opline->op2.jmp_addr - old_opcodes];
+ break;
+ case ZEND_DECLARE_ANON_CLASS:
+ case ZEND_DECLARE_ANON_INHERITED_CLASS:
+ case ZEND_FE_FETCH_R:
+ case ZEND_FE_FETCH_RW:
+ case ZEND_SWITCH_LONG:
+ case ZEND_SWITCH_STRING:
+ /* relative extended_value don't have to be changed */
+ break;
+ }
}
+#endif
opline++;
}
}
@@ -1160,7 +1273,7 @@ static void zend_adjust_fcall_stack_size(zend_op_array *op_array, zend_optimizer
if (opline->opcode == ZEND_INIT_FCALL) {
func = zend_hash_find_ptr(
&ctx->script->function_table,
- Z_STR_P(RT_CONSTANT(op_array, opline->op2)));
+ Z_STR_P(RT_CONSTANT(opline, opline->op2)));
if (func) {
opline->op1.num = zend_vm_calc_used_stack(opline->extended_value, func);
}
diff --git a/ext/opcache/Optimizer/zend_optimizer.h b/ext/opcache/Optimizer/zend_optimizer.h
index 93354448ef..b471274fe6 100644
--- a/ext/opcache/Optimizer/zend_optimizer.h
+++ b/ext/opcache/Optimizer/zend_optimizer.h
@@ -77,6 +77,7 @@
#define ZEND_DUMP_DFA_PHI (1<<26)
#define ZEND_DUMP_DFA_SSA (1<<27)
#define ZEND_DUMP_DFA_SSA_VARS (1<<28)
+#define ZEND_DUMP_SCCP (1<<29)
typedef struct _zend_script {
zend_string *filename;
diff --git a/ext/opcache/Optimizer/zend_optimizer_internal.h b/ext/opcache/Optimizer/zend_optimizer_internal.h
index aa37456b2b..1ab0fb5c04 100644
--- a/ext/opcache/Optimizer/zend_optimizer_internal.h
+++ b/ext/opcache/Optimizer/zend_optimizer_internal.h
@@ -114,5 +114,6 @@ void zend_optimizer_shift_jump(zend_op_array *op_array, zend_op *opline, uint32_
zend_uchar zend_compound_assign_to_binary_op(zend_uchar opcode);
int sccp_optimize_op_array(zend_optimizer_ctx *ctx, zend_op_array *op_arrya, zend_ssa *ssa, zend_call_info **call_map);
int dce_optimize_op_array(zend_op_array *op_array, zend_ssa *ssa, zend_bool reorder_dtor_effects);
+int zend_ssa_escape_analysis(const zend_script *script, zend_op_array *op_array, zend_ssa *ssa);
#endif
diff --git a/ext/opcache/Optimizer/zend_ssa.c b/ext/opcache/Optimizer/zend_ssa.c
index 422813f0e8..3d2de2ccd4 100644
--- a/ext/opcache/Optimizer/zend_ssa.c
+++ b/ext/opcache/Optimizer/zend_ssa.c
@@ -188,14 +188,14 @@ static int find_adjusted_tmp_var(const zend_op_array *op_array, uint32_t build_f
}
} else if (op->opcode == ZEND_ADD) {
if (op->op1_type == IS_CV && op->op2_type == IS_CONST) {
- zv = CRT_CONSTANT(op->op2);
+ zv = CRT_CONSTANT_EX(op_array, op, op->op2, (build_flags & ZEND_RT_CONSTANTS));
if (Z_TYPE_P(zv) == IS_LONG
&& Z_LVAL_P(zv) != ZEND_LONG_MIN) {
*adjustment = -Z_LVAL_P(zv);
return EX_VAR_TO_NUM(op->op1.var);
}
} else if (op->op2_type == IS_CV && op->op1_type == IS_CONST) {
- zv = CRT_CONSTANT(op->op1);
+ zv = CRT_CONSTANT_EX(op_array, op, op->op1, (build_flags & ZEND_RT_CONSTANTS));
if (Z_TYPE_P(zv) == IS_LONG
&& Z_LVAL_P(zv) != ZEND_LONG_MIN) {
*adjustment = -Z_LVAL_P(zv);
@@ -204,7 +204,7 @@ static int find_adjusted_tmp_var(const zend_op_array *op_array, uint32_t build_f
}
} else if (op->opcode == ZEND_SUB) {
if (op->op1_type == IS_CV && op->op2_type == IS_CONST) {
- zv = CRT_CONSTANT(op->op2);
+ zv = CRT_CONSTANT_EX(op_array, op, op->op2, (build_flags & ZEND_RT_CONSTANTS));
if (Z_TYPE_P(zv) == IS_LONG) {
*adjustment = Z_LVAL_P(zv);
return EX_VAR_TO_NUM(op->op1.var);
@@ -298,7 +298,7 @@ static void place_essa_pis(
} else if (var1 >= 0 && var2 < 0) {
zend_long add_val2 = 0;
if ((opline-1)->op2_type == IS_CONST) {
- zval *zv = CRT_CONSTANT((opline-1)->op2);
+ zval *zv = CRT_CONSTANT_EX(op_array, (opline-1), (opline-1)->op2, (build_flags & ZEND_RT_CONSTANTS));
if (Z_TYPE_P(zv) == IS_LONG) {
add_val2 = Z_LVAL_P(zv);
@@ -320,9 +320,9 @@ static void place_essa_pis(
} else if (var1 < 0 && var2 >= 0) {
zend_long add_val1 = 0;
if ((opline-1)->op1_type == IS_CONST) {
- zval *zv = CRT_CONSTANT((opline-1)->op1);
+ zval *zv = CRT_CONSTANT_EX(op_array, (opline-1), (opline-1)->op1, (build_flags & ZEND_RT_CONSTANTS));
if (Z_TYPE_P(zv) == IS_LONG) {
- add_val1 = Z_LVAL_P(CRT_CONSTANT((opline-1)->op1));
+ add_val1 = Z_LVAL_P(CRT_CONSTANT_EX(op_array, (opline-1), (opline-1)->op1, (build_flags & ZEND_RT_CONSTANTS)));
} else if (Z_TYPE_P(zv) == IS_FALSE) {
add_val1 = 0;
} else if (Z_TYPE_P(zv) == IS_TRUE) {
@@ -468,10 +468,10 @@ static void place_essa_pis(
uint32_t type_mask;
if ((opline-1)->op1_type == IS_CV && (opline-1)->op2_type == IS_CONST) {
var = EX_VAR_TO_NUM((opline-1)->op1.var);
- val = CRT_CONSTANT((opline-1)->op2);
+ val = CRT_CONSTANT_EX(op_array, (opline-1), (opline-1)->op2, (build_flags & ZEND_RT_CONSTANTS));
} else if ((opline-1)->op1_type == IS_CONST && (opline-1)->op2_type == IS_CV) {
var = EX_VAR_TO_NUM((opline-1)->op2.var);
- val = CRT_CONSTANT((opline-1)->op1);
+ val = CRT_CONSTANT_EX(op_array, (opline-1), (opline-1)->op1, (build_flags & ZEND_RT_CONSTANTS));
} else {
continue;
}
@@ -502,7 +502,7 @@ static void place_essa_pis(
opline->op1.var == (opline-1)->result.var && (opline-1)->op1_type == IS_CV &&
(opline-1)->op2_type == IS_CONST) {
int var = EX_VAR_TO_NUM((opline-1)->op1.var);
- zend_string *lcname = Z_STR_P(CRT_CONSTANT((opline-1)->op2) + 1);
+ zend_string *lcname = Z_STR_P(CRT_CONSTANT_EX(op_array, (opline-1), (opline-1)->op2, (build_flags & ZEND_RT_CONSTANTS)) + 1);
zend_class_entry *ce = script ? zend_hash_find_ptr(&script->class_table, lcname) : NULL;
if (!ce) {
ce = zend_hash_find_ptr(CG(class_table), lcname);
@@ -644,6 +644,17 @@ static int zend_ssa_rename(const zend_op_array *op_array, uint32_t build_flags,
//NEW_SSA_VAR(next->op1.var)
}
break;
+ case ZEND_PRE_INC_OBJ:
+ case ZEND_PRE_DEC_OBJ:
+ case ZEND_POST_INC_OBJ:
+ case ZEND_POST_DEC_OBJ:
+ if (opline->op1_type == IS_CV) {
+ ssa_ops[k].op1_def = ssa_vars_count;
+ var[EX_VAR_TO_NUM(opline->op1.var)] = ssa_vars_count;
+ ssa_vars_count++;
+ //NEW_SSA_VAR(opline->op1.var)
+ }
+ break;
case ZEND_ADD_ARRAY_ELEMENT:
ssa_ops[k].result_use = var[EX_VAR_TO_NUM(opline->result.var)];
case ZEND_INIT_ARRAY:
diff --git a/ext/opcache/Optimizer/zend_ssa.h b/ext/opcache/Optimizer/zend_ssa.h
index 61c4e38c6b..97be2b93b0 100644
--- a/ext/opcache/Optimizer/zend_ssa.h
+++ b/ext/opcache/Optimizer/zend_ssa.h
@@ -99,6 +99,13 @@ typedef enum _zend_ssa_alias_kind {
HTTP_RESPONSE_HEADER_ALIAS
} zend_ssa_alias_kind;
+typedef enum _zend_ssa_escape_state {
+ ESCAPE_STATE_UNKNOWN,
+ ESCAPE_STATE_NO_ESCAPE,
+ ESCAPE_STATE_FUNCTION_ESCAPE,
+ ESCAPE_STATE_GLOBAL_ESCAPE
+} zend_ssa_escape_state;
+
typedef struct _zend_ssa_var {
int var; /* original var number; op.var for CVs and following numbers for VARs and TMP_VARs */
int scc; /* strongly connected component */
@@ -110,6 +117,7 @@ typedef struct _zend_ssa_var {
unsigned int no_val : 1; /* value doesn't mater (used as op1 in ZEND_ASSIGN) */
unsigned int scc_entry : 1;
unsigned int alias : 2; /* value may be changed indirectly */
+ unsigned int escape_state : 2;
} zend_ssa_var;
typedef struct _zend_ssa_var_info {
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index 32db2ca9e9..78dc60366a 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -114,7 +114,7 @@ zend_bool fallback_process = 0; /* process uses file cache fallback */
static zend_op_array *(*accelerator_orig_compile_file)(zend_file_handle *file_handle, int type);
static int (*accelerator_orig_zend_stream_open_function)(const char *filename, zend_file_handle *handle );
-static zend_string *(*accelerator_orig_zend_resolve_path)(const char *filename, int filename_len);
+static zend_string *(*accelerator_orig_zend_resolve_path)(const char *filename, size_t filename_len);
static zif_handler orig_chdir = NULL;
static ZEND_INI_MH((*orig_include_path_on_modify)) = NULL;
@@ -1015,7 +1015,7 @@ int validate_timestamp_and_record_ex(zend_persistent_script *persistent_script,
/* Instead of resolving full real path name each time we need to identify file,
* we create a key that consist from requested file name, current working
* directory, current include_path, etc */
-char *accel_make_persistent_key(const char *path, int path_length, int *key_len)
+char *accel_make_persistent_key(const char *path, size_t path_length, int *key_len)
{
int key_length;
@@ -1171,7 +1171,7 @@ char *accel_make_persistent_key(const char *path, int path_length, int *key_len)
return (char*)path;
}
-int zend_accel_invalidate(const char *filename, int filename_len, zend_bool force)
+int zend_accel_invalidate(const char *filename, size_t filename_len, zend_bool force)
{
zend_string *realpath;
zend_persistent_script *persistent_script;
@@ -2018,7 +2018,7 @@ static int persistent_stream_open_function(const char *filename, zend_file_handl
}
/* zend_resolve_path() replacement for PHP 5.3 and above */
-static zend_string* persistent_zend_resolve_path(const char *filename, int filename_len)
+static zend_string* persistent_zend_resolve_path(const char *filename, size_t filename_len)
{
if (ZCG(enabled) && accel_startup_ok &&
(ZCG(counted) || ZCSG(accelerator_enabled)) &&
@@ -2319,8 +2319,6 @@ static inline int accel_find_sapi(void)
"cli-server",
"cgi-fcgi",
"fpm-fcgi",
- "isapi",
- "apache2filter",
"apache2handler",
"litespeed",
"uwsgi",
@@ -2598,7 +2596,7 @@ static int accel_startup(zend_extension *extension)
strcmp(sapi_module.name, "cli") == 0) {
zps_startup_failure("Opcode Caching is disabled for CLI", NULL, accelerator_remove_cb);
} else {
- zps_startup_failure("Opcode Caching is only supported in Apache, ISAPI, FPM, FastCGI and LiteSpeed SAPIs", NULL, accelerator_remove_cb);
+ zps_startup_failure("Opcode Caching is only supported in Apache, FPM, FastCGI and LiteSpeed SAPIs", NULL, accelerator_remove_cb);
}
return SUCCESS;
}
diff --git a/ext/opcache/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h
index 17b6f8da52..5c22415d88 100644
--- a/ext/opcache/ZendAccelerator.h
+++ b/ext/opcache/ZendAccelerator.h
@@ -310,11 +310,11 @@ void zend_accel_schedule_restart_if_necessary(zend_accel_restart_reason reason);
accel_time_t zend_get_file_handle_timestamp(zend_file_handle *file_handle, size_t *size);
int validate_timestamp_and_record(zend_persistent_script *persistent_script, zend_file_handle *file_handle);
int validate_timestamp_and_record_ex(zend_persistent_script *persistent_script, zend_file_handle *file_handle);
-int zend_accel_invalidate(const char *filename, int filename_len, zend_bool force);
+int zend_accel_invalidate(const char *filename, size_t filename_len, zend_bool force);
int accelerator_shm_read_lock(void);
void accelerator_shm_read_unlock(void);
-char *accel_make_persistent_key(const char *path, int path_length, int *key_len);
+char *accel_make_persistent_key(const char *path, size_t path_length, int *key_len);
zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type);
#define IS_ACCEL_INTERNED(str) \
diff --git a/ext/opcache/config.m4 b/ext/opcache/config.m4
index 7b500f023d..8098f3d885 100644
--- a/ext/opcache/config.m4
+++ b/ext/opcache/config.m4
@@ -413,6 +413,7 @@ fi
Optimizer/sccp.c \
Optimizer/scdf.c \
Optimizer/dce.c \
+ Optimizer/escape_analysis.c \
Optimizer/compact_vars.c \
Optimizer/zend_dump.c,
shared,,-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1,,yes)
diff --git a/ext/opcache/config.w32 b/ext/opcache/config.w32
index f32834e878..8a33fd906c 100644
--- a/ext/opcache/config.w32
+++ b/ext/opcache/config.w32
@@ -23,7 +23,7 @@ if (PHP_OPCACHE != "no") {
zend_shared_alloc.c \
shared_alloc_win32.c", true, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
- ADD_SOURCES(configure_module_dirname + "/Optimizer", "zend_optimizer.c pass1_5.c pass2.c pass3.c optimize_func_calls.c block_pass.c optimize_temp_vars_5.c nop_removal.c compact_literals.c zend_cfg.c zend_dfg.c dfa_pass.c zend_ssa.c zend_inference.c zend_func_info.c zend_call_graph.c sccp.c scdf.c dce.c compact_vars.c zend_dump.c", "opcache", "OptimizerObj");
+ ADD_SOURCES(configure_module_dirname + "/Optimizer", "zend_optimizer.c pass1_5.c pass2.c pass3.c optimize_func_calls.c block_pass.c optimize_temp_vars_5.c nop_removal.c compact_literals.c zend_cfg.c zend_dfg.c dfa_pass.c zend_ssa.c zend_inference.c zend_func_info.c zend_call_graph.c sccp.c scdf.c dce.c escape_analysis.c compact_vars.c zend_dump.c", "opcache", "OptimizerObj");
ADD_FLAG('CFLAGS_OPCACHE', "/I " + configure_module_dirname);
diff --git a/ext/opcache/tests/jmp_elim_002.phpt b/ext/opcache/tests/jmp_elim_002.phpt
new file mode 100644
index 0000000000..e396ca0a9d
--- /dev/null
+++ b/ext/opcache/tests/jmp_elim_002.phpt
@@ -0,0 +1,38 @@
+--TEST--
+Incorrect empty basic block elimination
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function wp_get_archives( $args = '' ) {
+ $defaults = array(
+ 'type' => 'monthly', 'limit' => '',
+ 'format' => 'html', 'before' => '',
+ 'after' => '', 'show_post_count' => false,
+ 'echo' => 1, 'order' => 'DESC',
+ );
+
+ $r = wp_parse_args( $args, $defaults );
+
+ if ( ! empty( $r['limit'] ) ) {
+ $r['limit'] = absint( $r['limit'] );
+ $r['limit'] = ' LIMIT ' . $r['limit'];
+ }
+
+ $archive_date_format_over_ride = 0;
+ $archive_day_date_format = 'Y/m/d';
+
+ if (!$archive_date_format_over_ride ) {
+ $archive_day_date_format = get_option( 'date_format' );
+ }
+
+ if ( $r['echo'] ) {
+ echo $output;
+ } else {
+ return $output;
+ }
+}
+?>
+OK
+--EXPECT--
+OK
diff --git a/ext/opcache/tests/jmp_elim_003.phpt b/ext/opcache/tests/jmp_elim_003.phpt
new file mode 100644
index 0000000000..55be9632ba
--- /dev/null
+++ b/ext/opcache/tests/jmp_elim_003.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Incorrect empty basic block elimination
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class A {
+ public static function test($args = array()) {
+ if (!function_exists( 'stream_socket_client'))
+ return false;
+
+ $is_ssl = isset( $args['ssl'] ) && $args['ssl'];
+
+ if ($is_ssl) {
+ if (!extension_loaded( 'openssl'))
+ return false;
+ if (!function_exists('openssl_x509_parse'))
+ return false;
+ }
+
+ return apply_filters('use_streams_transport', true, $args);
+ }
+}
+?>
+OK
+--EXPECT--
+OK
diff --git a/ext/opcache/tests/opt/dce_001.phpt b/ext/opcache/tests/opt/dce_001.phpt
new file mode 100644
index 0000000000..475dc8191c
--- /dev/null
+++ b/ext/opcache/tests/opt/dce_001.phpt
@@ -0,0 +1,31 @@
+--TEST--
+DCE 001: Remove dead computation after constants propagation
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+opcache.opt_debug_level=0x20000
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function foo(string $s1, string $s2, string $s3, string $s4) {
+ $x = ($s1 . $s2) . ($s3 . $s4);
+ $x = 0;
+ return $x;
+}
+?>
+--EXPECTF--
+$_main: ; (lines=1, args=0, vars=0, tmps=0)
+ ; (after optimizer)
+ ; %sdce_001.php:1-8
+L0 (8): RETURN int(1)
+
+foo: ; (lines=5, args=4, vars=4, tmps=0)
+ ; (after optimizer)
+ ; %sdce_001.php:2-6
+L0 (2): CV0($s1) = RECV 1
+L1 (2): CV1($s2) = RECV 2
+L2 (2): CV2($s3) = RECV 3
+L3 (2): CV3($s4) = RECV 4
+L4 (5): RETURN int(0)
diff --git a/ext/opcache/tests/opt/dce_002.phpt b/ext/opcache/tests/opt/dce_002.phpt
new file mode 100644
index 0000000000..0d71a7d809
--- /dev/null
+++ b/ext/opcache/tests/opt/dce_002.phpt
@@ -0,0 +1,34 @@
+--TEST--
+DCE 002: func_get_args() disables deletion of assignments to parameter variables
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+opcache.opt_debug_level=0x20000
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function foo(int $a) {
+ $a = 10;
+ $b = 20;
+ $x = func_get_args();
+ $a = 30;
+ $b = 40;
+ return $x;
+}
+?>
+--EXPECTF--
+$_main: ; (lines=1, args=0, vars=0, tmps=0)
+ ; (after optimizer)
+ ; %sdce_002.php:1-11
+L0 (11): RETURN int(1)
+
+foo: ; (lines=5, args=1, vars=2, tmps=0)
+ ; (after optimizer)
+ ; %sdce_002.php:2-9
+L0 (2): CV0($a) = RECV 1
+L1 (3): CV0($a) = QM_ASSIGN int(10)
+L2 (5): CV1($x) = FUNC_GET_ARGS
+L3 (6): CV0($a) = QM_ASSIGN int(30)
+L4 (8): RETURN CV1($x)
diff --git a/ext/opcache/tests/opt/dce_003.phpt b/ext/opcache/tests/opt/dce_003.phpt
new file mode 100644
index 0000000000..ce453c0ca3
--- /dev/null
+++ b/ext/opcache/tests/opt/dce_003.phpt
@@ -0,0 +1,28 @@
+--TEST--
+DCE 003: Assignment elimination (without FREE)
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+opcache.opt_debug_level=0x20000
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function foo($a) {
+ $b = $a += 3;
+ return $a;
+}
+?>
+--EXPECTF--
+$_main: ; (lines=1, args=0, vars=0, tmps=0)
+ ; (after optimizer)
+ ; %sdce_003.php:1-7
+L0 (7): RETURN int(1)
+
+foo: ; (lines=3, args=1, vars=1, tmps=0)
+ ; (after optimizer)
+ ; %sdce_003.php:2-5
+L0 (2): CV0($a) = RECV 1
+L1 (3): ASSIGN_ADD CV0($a) int(3)
+L2 (4): RETURN CV0($a)
diff --git a/ext/opcache/tests/opt/dce_004.phpt b/ext/opcache/tests/opt/dce_004.phpt
new file mode 100644
index 0000000000..795c938c2c
--- /dev/null
+++ b/ext/opcache/tests/opt/dce_004.phpt
@@ -0,0 +1,30 @@
+--TEST--
+DCE 004: Elimination of assignment to non-escaping arrays
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+opcache.opt_debug_level=0x20000
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function foo(int $x, int $y) {
+ $a = [$x];
+ $a[1] = $y;
+ $a = $y;
+ return $a;
+}
+--EXPECTF--
+$_main: ; (lines=1, args=0, vars=0, tmps=0)
+ ; (after optimizer)
+ ; %sdce_004.php:1-8
+L0 (8): RETURN int(1)
+
+foo: ; (lines=4, args=2, vars=3, tmps=0)
+ ; (after optimizer)
+ ; %sdce_004.php:2-7
+L0 (2): CV0($x) = RECV 1
+L1 (2): CV1($y) = RECV 2
+L2 (5): CV2($a) = QM_ASSIGN CV1($y)
+L3 (6): RETURN CV2($a)
diff --git a/ext/opcache/tests/opt/dce_005.phpt b/ext/opcache/tests/opt/dce_005.phpt
new file mode 100644
index 0000000000..b7f5437a20
--- /dev/null
+++ b/ext/opcache/tests/opt/dce_005.phpt
@@ -0,0 +1,28 @@
+--TEST--
+DCE 005: Elimination of assignment to non-escaping objects (can't remove NEW yet)
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+opcache.opt_debug_level=0x20000
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class A {
+}
+function foo(int $x) {
+ $a = new A;
+ $a->foo = $x;
+}
+--EXPECTF--
+$_main: ; (lines=1, args=0, vars=0, tmps=0)
+ ; (after optimizer)
+ ; %sdce_005.php:1-8
+L0 (8): RETURN int(1)
+
+foo: ; (lines=2, args=1, vars=1, tmps=0)
+ ; (after optimizer)
+ ; %sdce_005.php:4-7
+L0 (4): CV0($x) = RECV 1
+L1 (7): RETURN null
diff --git a/ext/opcache/tests/opt/dce_006.phpt b/ext/opcache/tests/opt/dce_006.phpt
new file mode 100644
index 0000000000..debac5e731
--- /dev/null
+++ b/ext/opcache/tests/opt/dce_006.phpt
@@ -0,0 +1,39 @@
+--TEST--
+DCE 006: Objects with destructors escape
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+opcache.opt_debug_level=0x20000
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class A {
+ function __destruct() {}
+}
+function foo(int $x) {
+ $a = new A;
+ $a->foo = $x;
+}
+--EXPECTF--
+$_main: ; (lines=1, args=0, vars=0, tmps=0)
+ ; (after optimizer)
+ ; %sdce_006.php:1-9
+L0 (9): RETURN int(1)
+
+foo: ; (lines=7, args=1, vars=2, tmps=1)
+ ; (after optimizer)
+ ; %sdce_006.php:5-8
+L0 (5): CV0($x) = RECV 1
+L1 (6): V2 = NEW 0 string("A")
+L2 (6): DO_FCALL
+L3 (6): CV1($a) = QM_ASSIGN V2
+L4 (7): ASSIGN_OBJ CV1($a) string("foo")
+L5 (7): OP_DATA CV0($x)
+L6 (8): RETURN null
+
+A::__destruct: ; (lines=1, args=0, vars=0, tmps=0)
+ ; (after optimizer)
+ ; %sdce_006.php:3-3
+L0 (3): RETURN null
diff --git a/ext/opcache/tests/opt/dce_007.phpt b/ext/opcache/tests/opt/dce_007.phpt
new file mode 100644
index 0000000000..ce601705c5
--- /dev/null
+++ b/ext/opcache/tests/opt/dce_007.phpt
@@ -0,0 +1,28 @@
+--TEST--
+DCE 007: Escaping of enclosed arrays doesn't prevent removal of enclosing array
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+opcache.opt_debug_level=0x20000
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function esc($x) {
+ $a = [$x];
+ $b = [$a];
+ return $a;
+}
+--EXPECTF--
+$_main: ; (lines=1, args=0, vars=0, tmps=0)
+ ; (after optimizer)
+ ; %sdce_007.php:1-7
+L0 (7): RETURN int(1)
+
+esc: ; (lines=3, args=1, vars=2, tmps=0)
+ ; (after optimizer)
+ ; %sdce_007.php:2-6
+L0 (2): CV0($x) = RECV 1
+L1 (3): CV1($a) = INIT_ARRAY 1 (packed) CV0($x) NEXT
+L2 (5): RETURN CV1($a)
diff --git a/ext/opcache/tests/opt/dce_008.phpt b/ext/opcache/tests/opt/dce_008.phpt
new file mode 100644
index 0000000000..f1a29d4d8e
--- /dev/null
+++ b/ext/opcache/tests/opt/dce_008.phpt
@@ -0,0 +1,29 @@
+--TEST--
+DCE 008: Escaping of enclosed arrays doesn't prevent removal of enclosing array
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+opcache.opt_debug_level=0x20000
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function esc(int $x) {
+ $a[0] = $x;
+ $b[0] = $a;
+ return $a;
+}
+--EXPECTF--
+$_main: ; (lines=1, args=0, vars=0, tmps=0)
+ ; (after optimizer)
+ ; %sdce_008.php:1-7
+L0 (7): RETURN int(1)
+
+esc: ; (lines=4, args=1, vars=2, tmps=0)
+ ; (after optimizer)
+ ; %sdce_008.php:2-6
+L0 (2): CV0($x) = RECV 1
+L1 (3): ASSIGN_DIM CV1($a) int(0)
+L2 (3): OP_DATA CV0($x)
+L3 (5): RETURN CV1($a)
diff --git a/ext/opcache/tests/opt/sccp_001.phpt b/ext/opcache/tests/opt/sccp_001.phpt
new file mode 100644
index 0000000000..9b2421a632
--- /dev/null
+++ b/ext/opcache/tests/opt/sccp_001.phpt
@@ -0,0 +1,28 @@
+--TEST--
+SCCP 001: Constant propagation
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+opcache.opt_debug_level=0x20000
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function foo() {
+ $a = 1;
+ $b = $a + 2;
+ $a += $b;
+ return $a;
+}
+?>
+--EXPECTF--
+$_main: ; (lines=1, args=0, vars=0, tmps=0)
+ ; (after optimizer)
+ ; %ssccp_001.php:1-9
+L0 (9): RETURN int(1)
+
+foo: ; (lines=1, args=0, vars=0, tmps=0)
+ ; (after optimizer)
+ ; %ssccp_001.php:2-7
+L0 (6): RETURN int(4)
diff --git a/ext/opcache/tests/opt/sccp_002.phpt b/ext/opcache/tests/opt/sccp_002.phpt
new file mode 100644
index 0000000000..748358c894
--- /dev/null
+++ b/ext/opcache/tests/opt/sccp_002.phpt
@@ -0,0 +1,36 @@
+--TEST--
+SCCP 002: Conditional Constant Propagation of non-escaping array elements
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+opcache.opt_debug_level=0x20000
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function foo(int $x) {
+ $a = [$x];
+ $i = 1;
+ $c = $i < 2;
+ if ($c) {
+ $k = 2 * $i;
+ $a[$k] = $i;
+ echo $a[$k];
+ }
+ echo $a[2];
+}
+?>
+--EXPECTF--
+$_main: ; (lines=1, args=0, vars=0, tmps=0)
+ ; (after optimizer)
+ ; %ssccp_002.php:1-14
+L0 (14): RETURN int(1)
+
+foo: ; (lines=4, args=1, vars=1, tmps=0)
+ ; (after optimizer)
+ ; %ssccp_002.php:2-12
+L0 (2): CV0($x) = RECV 1
+L1 (9): ECHO int(1)
+L2 (11): ECHO int(1)
+L3 (12): RETURN null
diff --git a/ext/opcache/tests/opt/sccp_003.phpt b/ext/opcache/tests/opt/sccp_003.phpt
new file mode 100644
index 0000000000..555c8efb75
--- /dev/null
+++ b/ext/opcache/tests/opt/sccp_003.phpt
@@ -0,0 +1,35 @@
+--TEST--
+SCCP 003: Conditional Constant Propagation of non-escaping array elements
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+opcache.opt_debug_level=0x20000
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function foo() {
+ $a = [1,2,3];
+ $i = 1;
+ $c = $i < 2;
+ if ($c) {
+ $k = 2 * $i;
+ $a[$k] = $i;
+ echo $a[$k];
+ }
+ echo $a[2];
+}
+?>
+--EXPECTF--
+$_main: ; (lines=1, args=0, vars=0, tmps=0)
+ ; (after optimizer)
+ ; %ssccp_003.php:1-14
+L0 (14): RETURN int(1)
+
+foo: ; (lines=3, args=0, vars=0, tmps=0)
+ ; (after optimizer)
+ ; %ssccp_003.php:2-12
+L0 (9): ECHO int(1)
+L1 (11): ECHO int(1)
+L2 (12): RETURN null
diff --git a/ext/opcache/tests/opt/sccp_004.phpt b/ext/opcache/tests/opt/sccp_004.phpt
new file mode 100644
index 0000000000..05987f6660
--- /dev/null
+++ b/ext/opcache/tests/opt/sccp_004.phpt
@@ -0,0 +1,39 @@
+--TEST--
+SCCP 004: Conditional Constant Propagation of non-escaping array elements
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+opcache.opt_debug_level=0x20000
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function foo(int $x) {
+ $a = [1,2,3];
+ $a[2] = $x;
+ $i = 1;
+ $c = $i < 2;
+ if ($c) {
+ $k = 2 * $i;
+ $a[$k] = $i;
+// $a[$k]++;
+ echo isset($a[$k]);
+// $a[$k] += 5;
+ }
+ echo $a[2];
+}
+?>
+--EXPECTF--
+$_main: ; (lines=1, args=0, vars=0, tmps=0)
+ ; (after optimizer)
+ ; %ssccp_004.php:1-17
+L0 (17): RETURN int(1)
+
+foo: ; (lines=4, args=1, vars=1, tmps=0)
+ ; (after optimizer)
+ ; %ssccp_004.php:2-15
+L0 (2): CV0($x) = RECV 1
+L1 (11): ECHO bool(true)
+L2 (14): ECHO int(1)
+L3 (15): RETURN null
diff --git a/ext/opcache/tests/opt/sccp_005.phpt b/ext/opcache/tests/opt/sccp_005.phpt
new file mode 100644
index 0000000000..aeef1beb96
--- /dev/null
+++ b/ext/opcache/tests/opt/sccp_005.phpt
@@ -0,0 +1,28 @@
+--TEST--
+SCCP 005: Conditional Constant Propagation of non-escaping array elements
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+opcache.opt_debug_level=0x20000
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function foo(int $x) {
+ $a = [1,2,$x];
+ echo $a[1];
+}
+?>
+--EXPECTF--
+$_main: ; (lines=1, args=0, vars=0, tmps=0)
+ ; (after optimizer)
+ ; %ssccp_005.php:1-7
+L0 (7): RETURN int(1)
+
+foo: ; (lines=3, args=1, vars=1, tmps=0)
+ ; (after optimizer)
+ ; %ssccp_005.php:2-5
+L0 (2): CV0($x) = RECV 1
+L1 (4): ECHO int(2)
+L2 (5): RETURN null
diff --git a/ext/opcache/tests/opt/sccp_006.phpt b/ext/opcache/tests/opt/sccp_006.phpt
new file mode 100644
index 0000000000..e8f10ef064
--- /dev/null
+++ b/ext/opcache/tests/opt/sccp_006.phpt
@@ -0,0 +1,35 @@
+--TEST--
+SCCP 006: Conditional Constant Propagation of non-escaping array elements
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+opcache.opt_debug_level=0x20000
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function foo(int $x) {
+ $a = ["a"=>1,"a"=>2,"a"=>$x];
+ echo $a["a"];
+}
+?>
+--EXPECTF--
+$_main: ; (lines=1, args=0, vars=0, tmps=0)
+ ; (after optimizer)
+ ; %ssccp_006.php:1-7
+L0 (7): RETURN int(1)
+
+foo: ; (lines=8, args=1, vars=2, tmps=1)
+ ; (after optimizer)
+ ; %ssccp_006.php:2-5
+L0 (2): CV0($x) = RECV 1
+L1 (3): T2 = INIT_ARRAY 3 int(1) string("a")
+L2 (3): T2 = ADD_ARRAY_ELEMENT int(2) string("a")
+L3 (3): T2 = ADD_ARRAY_ELEMENT CV0($x) string("a")
+L4 (3): CV1($a) = QM_ASSIGN T2
+L5 (4): V2 = FETCH_DIM_R CV1($a) string("a")
+L6 (4): ECHO V2
+L7 (5): RETURN null
+LIVE RANGES:
+ 2: L2 - L4 (tmp/var)
diff --git a/ext/opcache/tests/opt/sccp_007.phpt b/ext/opcache/tests/opt/sccp_007.phpt
new file mode 100644
index 0000000000..027f1c7281
--- /dev/null
+++ b/ext/opcache/tests/opt/sccp_007.phpt
@@ -0,0 +1,32 @@
+--TEST--
+SCCP 007: Conditional Constant Propagation of non-escaping array elements
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+opcache.opt_debug_level=0x20000
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function foo(int $x) {
+ if ($x) {
+ $a = [0,1];
+ } else {
+ $a = [0,2];
+ }
+ echo $a[0];
+}
+?>
+--EXPECTF--
+$_main: ; (lines=1, args=0, vars=0, tmps=0)
+ ; (after optimizer)
+ ; %ssccp_007.php:1-11
+L0 (11): RETURN int(1)
+
+foo: ; (lines=3, args=1, vars=1, tmps=0)
+ ; (after optimizer)
+ ; %ssccp_007.php:2-9
+L0 (2): CV0($x) = RECV 1
+L1 (8): ECHO int(0)
+L2 (9): RETURN null
diff --git a/ext/opcache/tests/opt/sccp_008.phpt b/ext/opcache/tests/opt/sccp_008.phpt
new file mode 100644
index 0000000000..d5ff3ae681
--- /dev/null
+++ b/ext/opcache/tests/opt/sccp_008.phpt
@@ -0,0 +1,37 @@
+--TEST--
+SCCP 008: Conditional Constant Propagation of non-escaping array elements
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+opcache.opt_debug_level=0x20000
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function foo(int $x) {
+ if ($x) {
+ $a = [0,1];
+ } else {
+ $a = [0,2];
+ }
+ echo $a[1];
+}
+?>
+--EXPECTF--
+$_main: ; (lines=1, args=0, vars=0, tmps=0)
+ ; (after optimizer)
+ ; %ssccp_008.php:1-11
+L0 (11): RETURN int(1)
+
+foo: ; (lines=8, args=1, vars=2, tmps=1)
+ ; (after optimizer)
+ ; %ssccp_008.php:2-9
+L0 (2): CV0($x) = RECV 1
+L1 (3): JMPZ CV0($x) L4
+L2 (4): CV1($a) = QM_ASSIGN array(...)
+L3 (4): JMP L5
+L4 (6): CV1($a) = QM_ASSIGN array(...)
+L5 (8): V2 = FETCH_DIM_R CV1($a) int(1)
+L6 (8): ECHO V2
+L7 (9): RETURN null
diff --git a/ext/opcache/tests/opt/sccp_009.phpt b/ext/opcache/tests/opt/sccp_009.phpt
new file mode 100644
index 0000000000..2f32cb8276
--- /dev/null
+++ b/ext/opcache/tests/opt/sccp_009.phpt
@@ -0,0 +1,29 @@
+--TEST--
+SCCP 009: Conditional Constant Propagation of non-escaping array elements
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+opcache.opt_debug_level=0x20000
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function foo(int $x) {
+ $a[0] = $x;
+ $a[1] = 2;
+ echo $a[1];
+}
+?>
+--EXPECTF--
+$_main: ; (lines=1, args=0, vars=0, tmps=0)
+ ; (after optimizer)
+ ; %ssccp_009.php:1-8
+L0 (8): RETURN int(1)
+
+foo: ; (lines=3, args=1, vars=1, tmps=0)
+ ; (after optimizer)
+ ; %ssccp_009.php:2-6
+L0 (2): CV0($x) = RECV 1
+L1 (5): ECHO int(2)
+L2 (6): RETURN null
diff --git a/ext/opcache/tests/opt/sccp_010.phpt b/ext/opcache/tests/opt/sccp_010.phpt
new file mode 100644
index 0000000000..298c65efd7
--- /dev/null
+++ b/ext/opcache/tests/opt/sccp_010.phpt
@@ -0,0 +1,36 @@
+--TEST--
+SCCP 010: Conditional Constant Propagation of non-escaping object properties
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+opcache.opt_debug_level=0x20000
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function foo() {
+ $o = new stdClass();
+ $o->foo = 0;
+ $i = 1;
+ $c = $i < 2;
+ if ($c) {
+ $k = 2 * $i;
+ $o->foo = $i;
+ echo $o->foo;
+ }
+ echo $o->foo;
+}
+?>
+--EXPECTF--
+$_main: ; (lines=1, args=0, vars=0, tmps=0)
+ ; (after optimizer)
+ ; %ssccp_010.php:1-15
+L0 (15): RETURN int(1)
+
+foo: ; (lines=3, args=0, vars=0, tmps=0)
+ ; (after optimizer)
+ ; %ssccp_010.php:2-13
+L0 (10): ECHO int(1)
+L1 (12): ECHO int(1)
+L2 (13): RETURN null
diff --git a/ext/opcache/tests/opt/sccp_011.phpt b/ext/opcache/tests/opt/sccp_011.phpt
new file mode 100644
index 0000000000..2d817310d5
--- /dev/null
+++ b/ext/opcache/tests/opt/sccp_011.phpt
@@ -0,0 +1,35 @@
+--TEST--
+SCCP 011: Conditional Constant Propagation of non-escaping object properties
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+opcache.opt_debug_level=0x20000
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function foo(int $x) {
+ $o = new stdClass;
+ if ($x) {
+ $o->foo = 0;
+ $o->bar = 1;
+ } else {
+ $o->foo = 0;
+ $o->bar = 2;
+ }
+ echo $o->foo;
+}
+?>
+--EXPECTF--
+$_main: ; (lines=1, args=0, vars=0, tmps=0)
+ ; (after optimizer)
+ ; %ssccp_011.php:1-14
+L0 (14): RETURN int(1)
+
+foo: ; (lines=3, args=1, vars=1, tmps=0)
+ ; (after optimizer)
+ ; %ssccp_011.php:2-12
+L0 (2): CV0($x) = RECV 1
+L1 (11): ECHO int(0)
+L2 (12): RETURN null
diff --git a/ext/opcache/tests/opt/sccp_012.phpt b/ext/opcache/tests/opt/sccp_012.phpt
new file mode 100644
index 0000000000..3380331922
--- /dev/null
+++ b/ext/opcache/tests/opt/sccp_012.phpt
@@ -0,0 +1,38 @@
+--TEST--
+SCCP 012: Conditional Constant Propagation of non-escaping object properties
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+opcache.opt_debug_level=0x20000
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function foo() {
+ $o = new stdClass();
+ $o->foo = 0;
+ $i = 1;
+ $c = $i < 2;
+ if ($c) {
+ $k = 2 * $i;
+ $o->foo = $i;
+ echo $o->foo;
+ }
+ $o->foo += 2;
+ $o->foo++;
+ echo $o->foo;
+}
+?>
+--EXPECTF--
+$_main: ; (lines=1, args=0, vars=0, tmps=0)
+ ; (after optimizer)
+ ; %ssccp_012.php:1-17
+L0 (17): RETURN int(1)
+
+foo: ; (lines=3, args=0, vars=0, tmps=0)
+ ; (after optimizer)
+ ; %ssccp_012.php:2-15
+L0 (10): ECHO int(1)
+L1 (14): ECHO int(4)
+L2 (15): RETURN null
diff --git a/ext/opcache/tests/opt/sccp_013.phpt b/ext/opcache/tests/opt/sccp_013.phpt
new file mode 100644
index 0000000000..d421743e18
--- /dev/null
+++ b/ext/opcache/tests/opt/sccp_013.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SCCP 013: Conditional Constant Propagation of non-escaping array elements on PHI
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function loadEntities($entity_information) {
+ $entity_types = [];
+ foreach ($entity_information as $info) {
+ $entity_types[$info] = 1;
+ }
+ var_dump((bool)($entity_types[$info]));
+}
+
+loadEntities(array("first", "second"));
+?>
+--EXPECT--
+bool(true)
diff --git a/ext/opcache/tests/opt/sccp_014.phpt b/ext/opcache/tests/opt/sccp_014.phpt
new file mode 100644
index 0000000000..76592ea444
--- /dev/null
+++ b/ext/opcache/tests/opt/sccp_014.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SCCP 014: Conditional Constant Propagation of non-escaping object properties on PHI
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function loadEntities($entity_information) {
+ $entity_types = new StdClass();
+ $entity_types->a = 1;
+ foreach ($entity_information as $info) {
+ $entity_types->a = 0;
+ }
+ var_dump((bool)($entity_types->a));
+}
+
+loadEntities(array("first", "second"));
+?>
+--EXPECT--
+bool(false)
diff --git a/ext/opcache/tests/opt/sccp_015.phpt b/ext/opcache/tests/opt/sccp_015.phpt
new file mode 100644
index 0000000000..3e229fef00
--- /dev/null
+++ b/ext/opcache/tests/opt/sccp_015.phpt
@@ -0,0 +1,26 @@
+--TEST--
+SCCP 015: Conditional Constant Propagation of non-escaping object properties on PHI and Rewinding
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function loadEntities($entity_information) {
+ $entity_types = new StdClass();
+ $entity_types->b = 0;
+ foreach ($entity_information as $ex) {
+ var_dump((bool)$entity_types->b);
+ foreach ($entity_information as $info) {
+ $entity_types->b = 1;
+ }
+ }
+}
+
+loadEntities(array("first", "second"));
+?>
+--EXPECT--
+bool(false)
+bool(true)
diff --git a/ext/opcache/tests/opt/sccp_016.phpt b/ext/opcache/tests/opt/sccp_016.phpt
new file mode 100644
index 0000000000..0af0d64ab2
--- /dev/null
+++ b/ext/opcache/tests/opt/sccp_016.phpt
@@ -0,0 +1,21 @@
+--TEST--
+SCCP 016: Used constant instructions should be replaced with QM_ASSIGN
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+opcache.opt_debug_level=0x20000
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+return isset($undef) || php_sapi_name() == php_sapi_name();
+?>
+--EXPECTF--
+$_main: ; (lines=4, args=0, vars=1, tmps=1)
+ ; (after optimizer)
+ ; %ssccp_016.php:1-4
+L0 (2): T1 = ISSET_ISEMPTY_CV (isset) CV0($undef)
+L1 (2): T1 = JMPNZ_EX T1 L3
+L2 (2): T1 = QM_ASSIGN bool(true)
+L3 (2): RETURN T1
diff --git a/ext/opcache/tests/opt/sccp_017.phpt b/ext/opcache/tests/opt/sccp_017.phpt
new file mode 100644
index 0000000000..eb2694769c
--- /dev/null
+++ b/ext/opcache/tests/opt/sccp_017.phpt
@@ -0,0 +1,30 @@
+--TEST--
+SCCP 017: Array assignemnt
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+opcache.opt_debug_level=0x20000
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function foo(int $x) {
+ $a[0] = 5;
+ $a[1] = $x;
+ $b = $a;
+ $b[0] = 42;
+ return $a[0];
+}
+?>
+--EXPECTF--
+$_main: ; (lines=1, args=0, vars=0, tmps=0)
+ ; (after optimizer)
+ ; %ssccp_017.php:1-10
+L0 (10): RETURN int(1)
+
+foo: ; (lines=2, args=1, vars=1, tmps=0)
+ ; (after optimizer)
+ ; %ssccp_017.php:2-8
+L0 (2): CV0($x) = RECV 1
+L1 (7): RETURN int(5)
diff --git a/ext/opcache/tests/opt/sccp_018.phpt b/ext/opcache/tests/opt/sccp_018.phpt
new file mode 100644
index 0000000000..66a4b6ca15
--- /dev/null
+++ b/ext/opcache/tests/opt/sccp_018.phpt
@@ -0,0 +1,23 @@
+--TEST--
+SCCP 018: Object assignemnt
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+;opcache.opt_debug_level=0x20000
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function foo() {
+ $a = new stdClass;
+ $b = $a;
+ $a->x = 5;
+ $b->x = 42;
+ echo $a->x;
+ echo "\n";
+}
+foo();
+?>
+--EXPECT--
+42
diff --git a/ext/opcache/tests/opt/sccp_019.phpt b/ext/opcache/tests/opt/sccp_019.phpt
new file mode 100644
index 0000000000..eb2a431b55
--- /dev/null
+++ b/ext/opcache/tests/opt/sccp_019.phpt
@@ -0,0 +1,29 @@
+--TEST--
+SCCP 019: Array assignemnt
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+opcache.opt_debug_level=0x20000
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function foo(int $x) {
+ $a[0] = 5;
+ $a[1] = $x;
+ $b = $a;
+ return $b[0];
+}
+?>
+--EXPECTF--
+$_main: ; (lines=1, args=0, vars=0, tmps=0)
+ ; (after optimizer)
+ ; %ssccp_019.php:1-9
+L0 (9): RETURN int(1)
+
+foo: ; (lines=2, args=1, vars=1, tmps=0)
+ ; (after optimizer)
+ ; %ssccp_019.php:2-7
+L0 (2): CV0($x) = RECV 1
+L1 (6): RETURN int(5)
diff --git a/ext/opcache/tests/opt/sccp_020.phpt b/ext/opcache/tests/opt/sccp_020.phpt
new file mode 100644
index 0000000000..41c694a591
--- /dev/null
+++ b/ext/opcache/tests/opt/sccp_020.phpt
@@ -0,0 +1,22 @@
+--TEST--
+SCCP 020: Object assignemnt
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+;opcache.opt_debug_level=0x20000
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function foo() {
+ $b = $a = new stdClass;
+ $a->x = 5;
+ $b->x = 42;
+ echo $a->x;
+ echo "\n";
+}
+foo();
+?>
+--EXPECT--
+42
diff --git a/ext/opcache/tests/opt/sccp_021.phpt b/ext/opcache/tests/opt/sccp_021.phpt
new file mode 100644
index 0000000000..38d93d2264
--- /dev/null
+++ b/ext/opcache/tests/opt/sccp_021.phpt
@@ -0,0 +1,30 @@
+--TEST--
+SCCP 021: Memleak
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+;opcache.opt_debug_level=0x20000
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class A {
+ public function memleak($num_tokens) {
+ $queries = array();
+ for ( $i = 0; $i < $num_tokens; ++$i ) {
+ if ( 0 < $i )
+ $queries[$i] = $queries[$i - 1] . '&';
+ else
+ $queries[$i] = '';
+
+ $queries[$i] .= $query_token;
+ }
+
+ return;
+ }
+}
+?>
+okey
+--EXPECT--
+okey
diff --git a/ext/opcache/tests/opt/sccp_022.phpt b/ext/opcache/tests/opt/sccp_022.phpt
new file mode 100644
index 0000000000..551d705c11
--- /dev/null
+++ b/ext/opcache/tests/opt/sccp_022.phpt
@@ -0,0 +1,39 @@
+--TEST--
+SCCP 022: Invailid types
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.optimization_level=-1
+opcache.opt_debug_level=0x20000
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+function foo(int $x) {
+ $a[0] = $x;
+ $a[1] = 5;
+ echo $a[1];
+ $a->foo = 5;
+ echo $a[1];
+}
+?>
+--EXPECTF--
+$_main: ; (lines=1, args=0, vars=0, tmps=0)
+ ; (after optimizer)
+ ; %ssccp_022.php:1-10
+L0 (10): RETURN int(1)
+
+foo: ; (lines=11, args=1, vars=2, tmps=1)
+ ; (after optimizer)
+ ; %ssccp_022.php:2-8
+L0 (2): CV0($x) = RECV 1
+L1 (3): ASSIGN_DIM CV1($a) int(0)
+L2 (3): OP_DATA CV0($x)
+L3 (4): ASSIGN_DIM CV1($a) int(1)
+L4 (4): OP_DATA int(5)
+L5 (5): ECHO int(5)
+L6 (6): ASSIGN_OBJ CV1($a) string("foo")
+L7 (6): OP_DATA int(5)
+L8 (7): V2 = FETCH_DIM_R CV1($a) int(1)
+L9 (7): ECHO V2
+L10 (8): RETURN null
diff --git a/ext/opcache/tests/opt/skipif.inc b/ext/opcache/tests/opt/skipif.inc
new file mode 100644
index 0000000000..c5a8181039
--- /dev/null
+++ b/ext/opcache/tests/opt/skipif.inc
@@ -0,0 +1,3 @@
+<?php
+ if (!extension_loaded('Zend OPcache')) die('skip Zend OPcache extension not available');
+?>
diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c
index 930bcceaf2..6926798ab6 100644
--- a/ext/opcache/zend_accelerator_util_funcs.c
+++ b/ext/opcache/zend_accelerator_util_funcs.c
@@ -181,7 +181,7 @@ static void zend_hash_clone_constants(HashTable *ht, HashTable *source)
ht->nNumOfElements = source->nNumOfElements;
ht->nNextFreeElement = source->nNextFreeElement;
ht->pDestructor = ZVAL_PTR_DTOR;
- ht->u.flags = (source->u.flags & HASH_FLAG_INITIALIZED) | HASH_FLAG_APPLY_PROTECTION;
+ ht->u.flags = (source->u.flags & HASH_FLAG_INITIALIZED);
ht->nInternalPointer = source->nNumOfElements ? 0 : HT_INVALID_IDX;
if (!(ht->u.flags & HASH_FLAG_INITIALIZED)) {
@@ -378,7 +378,6 @@ static void zend_class_copy_ctor(zend_class_entry **pce)
/* constants table */
zend_hash_clone_constants(&ce->constants_table, &old_ce->constants_table);
- ce->constants_table.u.flags &= ~HASH_FLAG_APPLY_PROTECTION;
/* interfaces aren't really implemented, so we create a new table */
if (ce->num_interfaces) {
diff --git a/ext/opcache/zend_file_cache.c b/ext/opcache/zend_file_cache.c
index fb6827a9fd..2e5f3afdd2 100644
--- a/ext/opcache/zend_file_cache.c
+++ b/ext/opcache/zend_file_cache.c
@@ -266,36 +266,37 @@ static void zend_file_cache_serialize_hash(HashTable *ht,
}
}
-static zend_ast *zend_file_cache_serialize_ast(zend_ast *ast,
- zend_persistent_script *script,
- zend_file_cache_metainfo *info,
- void *buf)
+static void zend_file_cache_serialize_ast(zend_ast *ast,
+ zend_persistent_script *script,
+ zend_file_cache_metainfo *info,
+ void *buf)
{
uint32_t i;
- zend_ast *ret;
-
- SERIALIZE_PTR(ast);
- ret = ast;
- UNSERIALIZE_PTR(ast);
+ zend_ast *tmp;
- if (ast->kind == ZEND_AST_ZVAL) {
+ if (ast->kind == ZEND_AST_ZVAL || ast->kind == ZEND_AST_CONSTANT) {
zend_file_cache_serialize_zval(&((zend_ast_zval*)ast)->val, script, info, buf);
} else if (zend_ast_is_list(ast)) {
zend_ast_list *list = zend_ast_get_list(ast);
for (i = 0; i < list->children; i++) {
- if (list->child[i]) {
- list->child[i] = zend_file_cache_serialize_ast(list->child[i], script, info, buf);
+ if (list->child[i] && !IS_SERIALIZED(list->child[i])) {
+ SERIALIZE_PTR(list->child[i]);
+ tmp = list->child[i];
+ UNSERIALIZE_PTR(tmp);
+ zend_file_cache_serialize_ast(tmp, script, info, buf);
}
}
} else {
uint32_t children = zend_ast_get_num_children(ast);
for (i = 0; i < children; i++) {
- if (ast->child[i]) {
- ast->child[i] = zend_file_cache_serialize_ast(ast->child[i], script, info, buf);
+ if (ast->child[i] && !IS_SERIALIZED(ast->child[i])) {
+ SERIALIZE_PTR(ast->child[i]);
+ tmp = ast->child[i];
+ UNSERIALIZE_PTR(tmp);
+ zend_file_cache_serialize_ast(tmp, script, info, buf);
}
}
}
- return ret;
}
static void zend_file_cache_serialize_zval(zval *zv,
@@ -305,7 +306,6 @@ static void zend_file_cache_serialize_zval(zval *zv,
{
switch (Z_TYPE_P(zv)) {
case IS_STRING:
- case IS_CONSTANT:
if (!IS_SERIALIZED(Z_STR_P(zv))) {
SERIALIZE_STR(Z_STR_P(zv));
}
@@ -337,9 +337,7 @@ static void zend_file_cache_serialize_zval(zval *zv,
SERIALIZE_PTR(Z_AST_P(zv));
ast = Z_AST_P(zv);
UNSERIALIZE_PTR(ast);
- if (!IS_SERIALIZED(ast->ast)) {
- ast->ast = zend_file_cache_serialize_ast(ast->ast, script, info, buf);
- }
+ zend_file_cache_serialize_ast(GC_AST(ast), script, info, buf);
}
break;
}
@@ -406,6 +404,13 @@ static void zend_file_cache_serialize_op_array(zend_op_array *op_arra
if (opline->op2_type == IS_CONST) {
SERIALIZE_PTR(opline->op2.zv);
}
+#else
+ if (opline->op1_type == IS_CONST) {
+ ZEND_PASS_TWO_UNDO_CONSTANT(op_array, opline, opline->op1);
+ }
+ if (opline->op2_type == IS_CONST) {
+ ZEND_PASS_TWO_UNDO_CONSTANT(op_array, opline, opline->op2);
+ }
#endif
#if ZEND_USE_ABS_JMP_ADDR
switch (opline->opcode) {
@@ -880,32 +885,31 @@ static void zend_file_cache_unserialize_hash(HashTable *ht,
}
}
-static zend_ast *zend_file_cache_unserialize_ast(zend_ast *ast,
- zend_persistent_script *script,
- void *buf)
+static void zend_file_cache_unserialize_ast(zend_ast *ast,
+ zend_persistent_script *script,
+ void *buf)
{
uint32_t i;
- UNSERIALIZE_PTR(ast);
-
- if (ast->kind == ZEND_AST_ZVAL) {
+ if (ast->kind == ZEND_AST_ZVAL || ast->kind == ZEND_AST_CONSTANT) {
zend_file_cache_unserialize_zval(&((zend_ast_zval*)ast)->val, script, buf);
} else if (zend_ast_is_list(ast)) {
zend_ast_list *list = zend_ast_get_list(ast);
for (i = 0; i < list->children; i++) {
- if (list->child[i]) {
- list->child[i] = zend_file_cache_unserialize_ast(list->child[i], script, buf);
+ if (list->child[i] && !IS_UNSERIALIZED(list->child[i])) {
+ UNSERIALIZE_PTR(list->child[i]);
+ zend_file_cache_unserialize_ast(list->child[i], script, buf);
}
}
} else {
uint32_t children = zend_ast_get_num_children(ast);
for (i = 0; i < children; i++) {
- if (ast->child[i]) {
- ast->child[i] = zend_file_cache_unserialize_ast(ast->child[i], script, buf);
+ if (ast->child[i] && !IS_UNSERIALIZED(ast->child[i])) {
+ UNSERIALIZE_PTR(ast->child[i]);
+ zend_file_cache_unserialize_ast(ast->child[i], script, buf);
}
}
}
- return ast;
}
static void zend_file_cache_unserialize_zval(zval *zv,
@@ -914,7 +918,6 @@ static void zend_file_cache_unserialize_zval(zval *zv,
{
switch (Z_TYPE_P(zv)) {
case IS_STRING:
- case IS_CONSTANT:
if (!IS_UNSERIALIZED(Z_STR_P(zv))) {
UNSERIALIZE_STR(Z_STR_P(zv));
}
@@ -940,13 +943,8 @@ static void zend_file_cache_unserialize_zval(zval *zv,
break;
case IS_CONSTANT_AST:
if (!IS_UNSERIALIZED(Z_AST_P(zv))) {
- zend_ast_ref *ast;
-
UNSERIALIZE_PTR(Z_AST_P(zv));
- ast = Z_AST_P(zv);
- if (!IS_UNSERIALIZED(ast->ast)) {
- ast->ast = zend_file_cache_unserialize_ast(ast->ast, script, buf);
- }
+ zend_file_cache_unserialize_ast(Z_ASTVAL_P(zv), script, buf);
}
break;
}
@@ -1000,15 +998,22 @@ static void zend_file_cache_unserialize_op_array(zend_op_array *op_arr
opline = op_array->opcodes;
end = opline + op_array->last;
while (opline < end) {
-# if ZEND_USE_ABS_CONST_ADDR
+#if ZEND_USE_ABS_CONST_ADDR
if (opline->op1_type == IS_CONST) {
UNSERIALIZE_PTR(opline->op1.zv);
}
if (opline->op2_type == IS_CONST) {
UNSERIALIZE_PTR(opline->op2.zv);
}
-# endif
-# if ZEND_USE_ABS_JMP_ADDR
+#else
+ if (opline->op1_type == IS_CONST) {
+ ZEND_PASS_TWO_UPDATE_CONSTANT(op_array, opline, opline->op1);
+ }
+ if (opline->op2_type == IS_CONST) {
+ ZEND_PASS_TWO_UPDATE_CONSTANT(op_array, opline, opline->op2);
+ }
+#endif
+#if ZEND_USE_ABS_JMP_ADDR
switch (opline->opcode) {
case ZEND_JMP:
case ZEND_FAST_CALL:
@@ -1037,7 +1042,7 @@ static void zend_file_cache_unserialize_op_array(zend_op_array *op_arr
/* relative extended_value don't have to be changed */
break;
}
-# endif
+#endif
zend_deserialize_opcode_handler(opline);
opline++;
}
diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c
index 30bbfe08d4..dd68305dbd 100644
--- a/ext/opcache/zend_persist.c
+++ b/ext/opcache/zend_persist.c
@@ -249,7 +249,7 @@ static zend_ast *zend_persist_ast(zend_ast *ast)
uint32_t i;
zend_ast *node;
- if (ast->kind == ZEND_AST_ZVAL) {
+ if (ast->kind == ZEND_AST_ZVAL || ast->kind == ZEND_AST_CONSTANT) {
zend_ast_zval *copy = zend_accel_memdup(ast, sizeof(zend_ast_zval));
zend_persist_zval(&copy->val);
node = (zend_ast *) copy;
@@ -273,7 +273,6 @@ static zend_ast *zend_persist_ast(zend_ast *ast)
}
}
- efree(ast);
return node;
}
@@ -283,7 +282,6 @@ static void zend_persist_zval(zval *z)
switch (Z_TYPE_P(z)) {
case IS_STRING:
- case IS_CONSTANT:
zend_accel_store_interned_string(Z_STR_P(z));
Z_TYPE_FLAGS_P(z) &= ~ (IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE);
break;
@@ -305,7 +303,6 @@ static void zend_persist_zval(zval *z)
GC_REFCOUNT(Z_COUNTED_P(z)) = 2;
GC_FLAGS(Z_COUNTED_P(z)) |= IS_ARRAY_IMMUTABLE;
Z_ARRVAL_P(z)->u.flags |= HASH_FLAG_STATIC_KEYS;
- Z_ARRVAL_P(z)->u.flags &= ~HASH_FLAG_APPLY_PROTECTION;
}
}
break;
@@ -322,12 +319,14 @@ static void zend_persist_zval(zval *z)
new_ptr = zend_shared_alloc_get_xlat_entry(Z_AST_P(z));
if (new_ptr) {
Z_AST_P(z) = new_ptr;
- Z_TYPE_FLAGS_P(z) = IS_TYPE_CONSTANT | IS_TYPE_COPYABLE;
+ Z_TYPE_FLAGS_P(z) &= ~ (IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE);
} else {
- zend_accel_store(Z_AST_P(z), sizeof(zend_ast_ref));
- Z_ASTVAL_P(z) = zend_persist_ast(Z_ASTVAL_P(z));
- Z_TYPE_FLAGS_P(z) = IS_TYPE_CONSTANT | IS_TYPE_COPYABLE;
+ zend_ast_ref *old_ref = Z_AST_P(z);
+ Z_ARR_P(z) = zend_accel_memdup(Z_AST_P(z), sizeof(zend_ast_ref));
+ zend_persist_ast(GC_AST(old_ref));
+ Z_TYPE_FLAGS_P(z) &= ~ (IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE);
GC_REFCOUNT(Z_COUNTED_P(z)) = 2;
+ efree(old_ref);
}
break;
}
@@ -374,7 +373,6 @@ static void zend_persist_op_array_ex(zend_op_array *op_array, zend_persistent_sc
GC_REFCOUNT(op_array->static_variables) = 2;
GC_TYPE_INFO(op_array->static_variables) = IS_ARRAY | (IS_ARRAY_IMMUTABLE << 8);
op_array->static_variables->u.flags |= HASH_FLAG_STATIC_KEYS;
- op_array->static_variables->u.flags &= ~HASH_FLAG_APPLY_PROTECTION;
}
}
@@ -396,7 +394,9 @@ static void zend_persist_op_array_ex(zend_op_array *op_array, zend_persistent_sc
zend_persist_zval(p);
p++;
}
+#if ZEND_USE_ABS_CONST_ADDR
efree(orig_literals);
+#endif
}
}
@@ -406,21 +406,35 @@ static void zend_persist_op_array_ex(zend_op_array *op_array, zend_persistent_sc
op_array->opcodes = persist_ptr;
} else {
zend_op *new_opcodes = zend_accel_memdup(op_array->opcodes, sizeof(zend_op) * op_array->last);
-#if ZEND_USE_ABS_CONST_ADDR || ZEND_USE_ABS_JMP_ADDR
zend_op *opline = new_opcodes;
zend_op *end = new_opcodes + op_array->last;
int offset = 0;
for (; opline < end ; opline++, offset++) {
-# if ZEND_USE_ABS_CONST_ADDR
+#if ZEND_USE_ABS_CONST_ADDR
if (opline->op1_type == IS_CONST) {
opline->op1.zv = (zval*)((char*)opline->op1.zv + ((char*)op_array->literals - (char*)orig_literals));
}
if (opline->op2_type == IS_CONST) {
opline->op2.zv = (zval*)((char*)opline->op2.zv + ((char*)op_array->literals - (char*)orig_literals));
}
-# endif
-# if ZEND_USE_ABS_JMP_ADDR
+#else
+ if (opline->op1_type == IS_CONST) {
+ opline->op1.constant =
+ (char*)(op_array->literals +
+ ((zval*)((char*)(op_array->opcodes + (opline - new_opcodes)) +
+ (int32_t)opline->op1.constant) - orig_literals)) -
+ (char*)opline;
+ }
+ if (opline->op2_type == IS_CONST) {
+ opline->op2.constant =
+ (char*)(op_array->literals +
+ ((zval*)((char*)(op_array->opcodes + (opline - new_opcodes)) +
+ (int32_t)opline->op2.constant) - orig_literals)) -
+ (char*)opline;
+ }
+#endif
+#if ZEND_USE_ABS_JMP_ADDR
if (op_array->fn_flags & ZEND_ACC_DONE_PASS_TWO) {
/* fix jumps to point to new array */
switch (opline->opcode) {
@@ -452,9 +466,8 @@ static void zend_persist_op_array_ex(zend_op_array *op_array, zend_persistent_sc
break;
}
}
-# endif
- }
#endif
+ }
efree(op_array->opcodes);
op_array->opcodes = new_opcodes;
diff --git a/ext/opcache/zend_persist_calc.c b/ext/opcache/zend_persist_calc.c
index cb7eb11b7a..0c600daef5 100644
--- a/ext/opcache/zend_persist_calc.c
+++ b/ext/opcache/zend_persist_calc.c
@@ -94,9 +94,9 @@ static void zend_persist_ast_calc(zend_ast *ast)
{
uint32_t i;
- if (ast->kind == ZEND_AST_ZVAL) {
+ if (ast->kind == ZEND_AST_ZVAL || ast->kind == ZEND_AST_CONSTANT) {
ADD_SIZE(sizeof(zend_ast_zval));
- zend_persist_zval_calc(zend_ast_get_zval(ast));
+ zend_persist_zval_calc(&((zend_ast_zval*)(ast))->val);
} else if (zend_ast_is_list(ast)) {
zend_ast_list *list = zend_ast_get_list(ast);
ADD_SIZE(sizeof(zend_ast_list) - sizeof(zend_ast *) + sizeof(zend_ast *) * list->children);
@@ -122,7 +122,6 @@ static void zend_persist_zval_calc(zval *z)
switch (Z_TYPE_P(z)) {
case IS_STRING:
- case IS_CONSTANT:
ADD_INTERNED_STRING(Z_STR_P(z), 0);
if (ZSTR_IS_INTERNED(Z_STR_P(z))) {
Z_TYPE_FLAGS_P(z) &= ~ (IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE);
diff --git a/ext/openssl/tests/openssl_get_cert_locations_basic.phpt b/ext/openssl/tests/openssl_get_cert_locations_basic.phpt
new file mode 100644
index 0000000000..b3992d0a69
--- /dev/null
+++ b/ext/openssl/tests/openssl_get_cert_locations_basic.phpt
@@ -0,0 +1,28 @@
+--TEST--
+openssl_get_cert_locations() tests
+--SKIPIF--
+<?php if (!extension_loaded("openssl")) print "skip"; ?>
+--FILE--
+<?php
+// openssl locations differ per distro.
+var_dump(openssl_get_cert_locations());
+?>
+--EXPECTF--
+array(8) {
+ ["default_cert_file"]=>
+ string(%d) "%s"
+ ["default_cert_file_env"]=>
+ string(%d) "%s"
+ ["default_cert_dir"]=>
+ string(%d) "%s"
+ ["default_cert_dir_env"]=>
+ string(%d) "%s"
+ ["default_private_dir"]=>
+ string(%d) "%s"
+ ["default_default_cert_area"]=>
+ string(%d) "%s"
+ ["ini_cafile"]=>
+ string(%d) ""
+ ["ini_capath"]=>
+ string(%d) ""
+}
diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c
index fe7aeda06d..bb47f3965a 100644
--- a/ext/openssl/xp_ssl.c
+++ b/ext/openssl/xp_ssl.c
@@ -2581,9 +2581,9 @@ static char *php_openssl_get_url_name(const char *resourcename,
}
if (url->host) {
- const char * host = url->host;
+ const char * host = ZSTR_VAL(url->host);
char * url_name = NULL;
- size_t len = strlen(host);
+ size_t len = ZSTR_LEN(url->host);
/* skip trailing dots */
while (len && host[len-1] == '.') {
diff --git a/ext/pcntl/package.xml b/ext/pcntl/package.xml
deleted file mode 100644
index b9127395c2..0000000000
--- a/ext/pcntl/package.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>posix</name>
- <summary>POSIX functions</summary>
- <maintainers>
- <maintainer>
- <user>???</user>
- <name>Kristian Köhntopp</name>
- <email>kris@koehntopp.de</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <description>
-This module contains an interface to those functions defined
-in the IEEE 1003.1 (POSIX.1) standards document which are not
-accessible through other means. POSIX.1 for example defined the
-open(), read(), write() and close() functions, too, which
-traditionally have been part of PHP for a long time. Some more
-system specific functions have not been available before, though,
-and this module tries to remedy this by providing easy access
-to these functions.
- </description>
- <license>PHP</license>
- <release>
- <state>beta</state>
- <version>5.0.0rc1</version>
- <date>2004-03-19</date>
- <notes>
-package.xml added to support installation using pear installer
- </notes>
- <filelist>
- <file role="doc" name="CREDITS"/>
- <file role="src" name="config.m4"/>
- <file role="src" name="posix.c"/>
- <file role="src" name="php_posix.h"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5" />
- <!-- doesn't work yet <dep type="os" rel="has" name="unix"/> -->
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c
index d82fed294a..f9ea76de4f 100644
--- a/ext/pcntl/pcntl.c
+++ b/ext/pcntl/pcntl.c
@@ -622,7 +622,7 @@ PHP_FUNCTION(pcntl_alarm)
#define PHP_RUSAGE_PARA(from, to, field) \
add_assoc_long(to, #field, from.field)
-#if !defined(_OSD_POSIX) && !defined(__BEOS__) /* BS2000 has only a few fields in the rusage struct */
+#ifndef _OSD_POSIX
#define PHP_RUSAGE_SPECIAL(from, to) \
PHP_RUSAGE_PARA(from, to, ru_oublock); \
PHP_RUSAGE_PARA(from, to, ru_inblock); \
diff --git a/ext/pdo/package2.xml b/ext/pdo/package2.xml
deleted file mode 100644
index add5a47fc3..0000000000
--- a/ext/pdo/package2.xml
+++ /dev/null
@@ -1,134 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<package packagerversion="1.4.2" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
-http://pear.php.net/dtd/tasks-1.0.xsd
-http://pear.php.net/dtd/package-2.0
-http://pear.php.net/dtd/package-2.0.xsd">
- <name>PDO</name>
- <channel>pecl.php.net</channel>
- <summary>PHP Data Objects Interface</summary>
- <description>PDO provides a uniform data access interface, sporting advanced features such
-as prepared statements and bound parameters. PDO drivers are dynamically
-loadable and may be developed independently from the core, but still accessed
-using the same API.
-Read the documentation at http://www.php.net/pdo for more information.
- </description>
- <lead>
- <name>Wez Furlong</name>
- <user>wez</user>
- <email>wez@php.net</email>
- <active>yes</active>
- </lead>
- <lead>
- <name>Marcus Boerger</name>
- <user>helly</user>
- <email>helly@php.net</email>
- <active>yes</active>
- </lead>
- <lead>
- <name>Ilia Alshanetsky</name>
- <user>iliaa</user>
- <email>iliaa@php.net</email>
- <active>yes</active>
- </lead>
- <lead>
- <name>George Schlossnagle</name>
- <user>gschlossnagle</user>
- <email>george@omniti.com</email>
- <active>yes</active>
- </lead>
- <date>2006-05-01</date>
- <version>
- <release>1.0.3</release>
- <api>1.0.3</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <license uri="http://www.php.net/license">PHP</license>
- <notes>
-It is highly recommended that you update to PHP 5.1 or higher before using PDO.
-This PECL release corresponds to the PHP 5.1.3 release.
-
-You need to install a PDO database driver to make use of PDO,
-check http://pecl.php.net/package-search.php?pkg_name=PDO
-for a list of available PDO drivers.
-
-If you are running on Windows, you can find a precompiled binary at:
-http://pecl4win.php.net/ext.php/php_pdo.dll
-
-You can find additional PDO drivers at:
-http://pecl4win.php.net
-
-** Changes **
-- Added PDO::PARAM_EVT_* family of constants. (Sara)
-- Fixed bug #37167 (PDO segfaults when throwing exception from the
- fetch handler). (Tony)
-- Fixed memory corruption when PDO::FETCH_LAZY mode is being used. (Ilia)
-- Fixed bug #36222 (errorInfo in PDOException is always NULL). (Ilia)
-- Fixed bug #35797 (segfault on PDOStatement::execute() with
- zend.ze1_compatibility_mode = On). (Tony, Ilia)
-- Fixed bug #35543 (crash when calling non-existing method in extended class). (Tony)
-- Fixed bug #35508 (improved validation of fetch modes). (Tony)
-- Fixed bug #35431 (PDO crashes when using LAZY fetch with fetchAll). (Wez)
-- Fixed bug #35430 (PDO crashes on incorrect FETCH_FUNC use). (Tony)
-
-- Changed PDO_XXX constants to PDO::XXX
-- It is now possible to extend PDO and PDOStatement and override their constructors
-
-- Fixed Bug #35303; PDO::prepare() can cause crashes with invalid parameters
-- Fixed Bug #35135; &quot;new PDOStatement&quot; can cause crashes.
-- Fixed Bug #35293 and PECL Bug #5589; segfault when creating persistent connections
-- Fixed PECL Bug #5010, problem installing headers
-- renamed pdo_drivers() to PDO::getAvailableDrivers()
-- Various fixes when building with SPL
-- PDO::setAttribute(PDO::ATTR_STATEMENT_CLASS) allows you to set your own
- PDOStatement replacement when extending PDO and PDOStatement
-- Fixed Bug #34687; error information from PDO::query() was not always returned
-- Fixed PECL Bug #5750; uri: DSN was not handled correctly
-- Fixed PECL Bug #5589; segfault when persistent connection attempt fails
-- Fixed Bug #34590; User defined PDOStatement class methods are not callable
-- Fixed Bug #34908; FETCH_INTO segfaults without destination object
-- Fixed PECL Bug #5809; PDOStatement::execute(array(...)) modifies args
-- Fixed PECL Bug #5772; FETCH_FUNC cannot call functions with mixed case names
-
-** Note **
-
-You should uninstall and re-install your individual database drivers whenever
-you upgrade the base PDO package, otherwise you will see an error about PDO API
-numbers when you run your PHP scripts.
-
- </notes>
- <contents>
- <dir name="/">
- <file name="config.m4" role="src" />
- <file name="config.w32" role="src" />
- <file name="CREDITS" role="doc" />
- <file name="Makefile.frag" role="src" />
- <file name="pdo.c" role="src" />
- <file name="pdo.php" role="doc" />
- <file name="pdo_dbh.c" role="src" />
- <file name="pdo_sqlstate.c" role="src" />
- <file name="pdo_sql_parser.c" role="src" />
- <file name="pdo_sql_parser.re" role="src" />
- <file name="pdo_stmt.c" role="src" />
- <file name="php_pdo.h" role="src" />
- <file name="php_pdo_driver.h" role="src" />
- <file name="php_pdo_int.h" role="src" />
- <file name="README" role="doc" />
- <file name="TODO" role="doc" />
- </dir> <!-- / -->
- </contents>
- <dependencies>
- <required>
- <php>
- <min>5.0.3</min>
- </php>
- <pearinstaller>
- <min>1.4.0</min>
- </pearinstaller>
- </required>
- </dependencies>
- <providesextension>PDO</providesextension>
- <extsrcrelease />
-</package>
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c
index caf3ff1ef4..d65bf217c4 100644
--- a/ext/pdo/pdo_stmt.c
+++ b/ext/pdo/pdo_stmt.c
@@ -857,8 +857,7 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
case PDO_FETCH_NUM:
case PDO_FETCH_NAMED:
if (!return_all) {
- ZVAL_NEW_ARR(return_value);
- zend_hash_init(Z_ARRVAL_P(return_value), stmt->column_count, NULL, ZVAL_PTR_DTOR, 0);
+ array_init_size(return_value, stmt->column_count);
} else {
array_init(return_value);
}
diff --git a/ext/pdo_dblib/package2.xml b/ext/pdo_dblib/package2.xml
deleted file mode 100644
index 8b726666db..0000000000
--- a/ext/pdo_dblib/package2.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<package packagerversion="1.4.2" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
-http://pear.php.net/dtd/tasks-1.0.xsd
-http://pear.php.net/dtd/package-2.0
-http://pear.php.net/dtd/package-2.0.xsd">
- <name>PDO_DBLIB</name>
- <channel>pecl.php.net</channel>
- <summary>FreeTDS/Sybase/MSSQL driver for PDO</summary>
- <description>This extension provides a FreeTDS/Sybase/MSSQL driver for PDO.
- </description>
- <lead>
- <name>Wez Furlong</name>
- <user>wez</user>
- <email>wez@php.net</email>
- <active>yes</active>
- </lead>
- <lead>
- <name>Frank M. Kromann</name>
- <user>fmk</user>
- <email>fmk@php.net</email>
- <active>yes</active>
- </lead>
- <date>2006-05-01</date>
- <version>
- <release>1.0.1</release>
- <api>1.0.1</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <license uri="http://www.php.net/license">PHP</license>
- <notes>
-- Packaging update; no functional changes in this release
-- Fix Bug #34777; segfault when retrieving non-existent error info
-- Fix Bug #35032; didn&apos;t find FreeTDS includes on some systems
-
-Windows binaries can be found at:
-http://pecl4win.php.net/ext.php/php_pdo_mssql.dll,
-
-however: you are *strongly* recommended to use PDO_ODBC instead of this driver on
-Windows platforms.
-
-
- </notes>
- <contents>
- <dir name="/">
- <file name="config.m4" role="src" />
- <file name="CREDITS" role="doc" />
- <file name="dblib_driver.c" role="src" />
- <file name="dblib_stmt.c" role="src" />
- <file name="pdo_dblib.c" role="src" />
- <file name="php_pdo_dblib.h" role="src" />
- <file name="php_pdo_dblib_int.h" role="src" />
- <file name="README" role="doc" />
- </dir> <!-- / -->
- </contents>
- <dependencies>
- <required>
- <php>
- <min>5.0.3</min>
- </php>
- <pearinstaller>
- <min>1.4.0</min>
- </pearinstaller>
- <package>
- <name>pdo</name>
- <channel>pecl.php.net</channel>
- <min>1.0.3</min>
- <providesextension>PDO</providesextension>
- </package>
- </required>
- </dependencies>
- <providesextension>PDO_DBLIB</providesextension>
- <extsrcrelease />
-</package>
diff --git a/ext/pdo_firebird/firebird_driver.c b/ext/pdo_firebird/firebird_driver.c
index ab2571df3d..83203d7804 100644
--- a/ext/pdo_firebird/firebird_driver.c
+++ b/ext/pdo_firebird/firebird_driver.c
@@ -545,6 +545,9 @@ static int firebird_handle_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *v
info_func(tmp);
ZVAL_STRING(val, tmp);
}
+#ifdef PHP_WIN32
+ FreeLibrary(l);
+#endif
#else
ZVAL_NULL(val);
#endif
diff --git a/ext/pdo_firebird/package2.xml b/ext/pdo_firebird/package2.xml
deleted file mode 100644
index b744d388bc..0000000000
--- a/ext/pdo_firebird/package2.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<package packagerversion="1.4.2" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
-http://pear.php.net/dtd/tasks-1.0.xsd
-http://pear.php.net/dtd/package-2.0
-http://pear.php.net/dtd/package-2.0.xsd">
- <name>PDO_FIREBIRD</name>
- <channel>pecl.php.net</channel>
- <summary>Firebird driver for PDO</summary>
- <description>This extension provides a Firebird driver for PDO. It supports
-all versions of Firebird 2.1 and up.
- </description>
- <lead>
- <name>Ard Biesheuvel</name>
- <user>abies</user>
- <email>abies@php.net</email>
- <active>yes</active>
- </lead>
- <date>2013-09-01</date>
- <version>
- <release>1.0</release>
- <api>1.0</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <license uri="http://www.php.net/license">PHP</license>
- <notes>To compile and run this module, you will need to have the main PDO module and Firebird&apos;s client library installed on your system.
-Hope it works!
- </notes>
- <contents>
- <dir name="/">
- <dir name="tests">
- <file name="connect.phpt" role="test" />
- <file name="ddl.phpt" role="test" />
- <file name="execute.phpt" role="test" />
- </dir> <!-- //tests -->
- <file name="config.m4" role="src" />
- <file name="config.w32" role="src" />
- <file name="CREDITS" role="doc" />
- <file name="firebird_driver.c" role="src" />
- <file name="firebird_statement.c" role="src" />
- <file name="pdo_firebird.c" role="src" />
- <file name="php_pdo_firebird.h" role="src" />
- <file name="php_pdo_firebird_int.h" role="src" />
- </dir> <!-- / -->
- </contents>
- <dependencies>
- <required>
- <php>
- <min>5.3.27</min>
- </php>
- <pearinstaller>
- <min>1.4.0</min>
- </pearinstaller>
- <package>
- <name>pdo</name>
- <channel>pecl.php.net</channel>
- <min>1.0.3</min>
- <providesextension>PDO</providesextension>
- </package>
- </required>
- </dependencies>
- <providesextension>PDO_FIREBIRD</providesextension>
- <extsrcrelease>
- <configureoption name="with-pdo-firebird" prompt="dir" />
- </extsrcrelease>
-</package>
diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c
index de6b1b6d32..ec7d5b8ea7 100644
--- a/ext/pdo_mysql/mysql_driver.c
+++ b/ext/pdo_mysql/mysql_driver.c
@@ -349,11 +349,7 @@ static int mysql_handle_commit(pdo_dbh_t *dbh)
{
PDO_DBG_ENTER("mysql_handle_commit");
PDO_DBG_INF_FMT("dbh=%p", dbh);
-#if MYSQL_VERSION_ID >= 40100 || defined(PDO_USE_MYSQLND)
PDO_DBG_RETURN(0 == mysql_commit(((pdo_mysql_db_handle *)dbh->driver_data)->server));
-#else
- PDO_DBG_RETURN(0 <= mysql_handle_doer(dbh, ZEND_STRL("COMMIT")));
-#endif
}
/* }}} */
@@ -362,11 +358,7 @@ static int mysql_handle_rollback(pdo_dbh_t *dbh)
{
PDO_DBG_ENTER("mysql_handle_rollback");
PDO_DBG_INF_FMT("dbh=%p", dbh);
-#if MYSQL_VERSION_ID >= 40100 || defined(PDO_USE_MYSQLND)
PDO_DBG_RETURN(0 <= mysql_rollback(((pdo_mysql_db_handle *)dbh->driver_data)->server));
-#else
- PDO_DBG_RETURN(0 <= mysql_handle_doer(dbh, ZEND_STRL("ROLLBACK")));
-#endif
}
/* }}} */
@@ -376,15 +368,7 @@ static inline int mysql_handle_autocommit(pdo_dbh_t *dbh)
PDO_DBG_ENTER("mysql_handle_autocommit");
PDO_DBG_INF_FMT("dbh=%p", dbh);
PDO_DBG_INF_FMT("dbh->autocommit=%d", dbh->auto_commit);
-#if MYSQL_VERSION_ID >= 40100 || defined(PDO_USE_MYSQLND)
PDO_DBG_RETURN(0 <= mysql_autocommit(((pdo_mysql_db_handle *)dbh->driver_data)->server, dbh->auto_commit));
-#else
- if (dbh->auto_commit) {
- PDO_DBG_RETURN(0 <= mysql_handle_doer(dbh, ZEND_STRL("SET AUTOCOMMIT=1")));
- } else {
- PDO_DBG_RETURN(0 <= mysql_handle_doer(dbh, ZEND_STRL("SET AUTOCOMMIT=0")));
- }
-#endif
}
/* }}} */
@@ -516,31 +500,13 @@ static int pdo_mysql_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_
static int pdo_mysql_check_liveness(pdo_dbh_t *dbh)
{
pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
-#if MYSQL_VERSION_ID <= 32230
- void (*handler) (int);
- unsigned int my_errno;
-#endif
PDO_DBG_ENTER("pdo_mysql_check_liveness");
PDO_DBG_INF_FMT("dbh=%p", dbh);
-#if MYSQL_VERSION_ID > 32230
if (mysql_ping(H->server)) {
PDO_DBG_RETURN(FAILURE);
}
-#else /* no mysql_ping() */
- handler = signal(SIGPIPE, SIG_IGN);
- mysql_stat(H->server);
- switch (mysql_errno(H->server)) {
- case CR_SERVER_GONE_ERROR:
- case CR_SERVER_LOST:
- signal(SIGPIPE, handler);
- PDO_DBG_RETURN(FAILURE);
- default:
- break;
- }
- signal(SIGPIPE, handler);
-#endif /* end mysql_ping() */
PDO_DBG_RETURN(SUCCESS);
}
/* }}} */
diff --git a/ext/pdo_mysql/package2.xml b/ext/pdo_mysql/package2.xml
deleted file mode 100644
index cee6cc7dea..0000000000
--- a/ext/pdo_mysql/package2.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<package packagerversion="1.4.2" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
-http://pear.php.net/dtd/tasks-1.0.xsd
-http://pear.php.net/dtd/package-2.0
-http://pear.php.net/dtd/package-2.0.xsd">
- <name>PDO_MYSQL</name>
- <channel>pecl.php.net</channel>
- <summary>MySQL driver for PDO</summary>
- <description>This extension provides a MySQL driver for PDO.
- </description>
- <lead>
- <name>George Schlossnagle</name>
- <user>gschlossnagle</user>
- <email>george@omniti.com</email>
- <active>yes</active>
- </lead>
- <lead>
- <name>Ilia Alshanetsky</name>
- <user>iliaa</user>
- <email>iliaa@php.net</email>
- <active>yes</active>
- </lead>
- <lead>
- <name>Wez Furlong</name>
- <user>wez</user>
- <email>wez@php.net</email>
- <active>yes</active>
- </lead>
- <date>2006-05-01</date>
- <version>
- <release>1.0.2</release>
- <api>1.0.2</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <license uri="http://www.php.net/license">PHP</license>
- <notes>
-This PECL release corresponds to PHP 5.1.3.
-
-Added PDO::ATTR_EMULATE_PREPARES which can be used to force use of emulated or
-native prepares. This attribute should can be set on the database handle, and
-will cause subsequent prepares to use emulation.
-
-- Fixed bug #36572 (cannot use native prepared statements with internal
- queries like "show master status") (Ilia)
-- Repackage using package2.xml
-- Fixed Bug #35480 and #35415, crash when using persistent connections.
-- Improved error detection for OPTIMIZE queries
-- Added PDO::MYSQL_ATTR_LOCAL_INFILE, PDO::MYSQL_ATTR_INIT_COMMAND,
- PDO::MYSQL_ATTR_READ_DEFAULT_FILE, PDO::MYSQL_ATTR_READ_DEFAULT_GROUP
-- Improved error reporting when using native prepared statements
-- Fixed PECL Bug #5193: improved bounds checking when calling getColumnMeta()
-- Fixed Bug #34630: improved (emulated) LOB support
-- Fixed Bug #34623: crash when selecting longtext fields
-- Fixed PECL Bug #5802; is_null flag was sticking
-- Fixed PECL Bug #5645; added mysql client library version information to phpinfo() output.
-
-Windows binaries can be found at http://pecl4win.php.net/ext.php/php_pdo_mysql.dll
-
- </notes>
- <contents>
- <dir name="/">
- <file name="config.m4" role="src" />
- <file name="CREDITS" role="doc" />
- <file name="mysql_driver.c" role="src" />
- <file name="mysql_statement.c" role="src" />
- <file name="pdo_mysql.c" role="src" />
- <file name="php_pdo_mysql.h" role="src" />
- <file name="php_pdo_mysql_int.h" role="src" />
- <file name="php_pdo_mysql_sqlstate.h" role="src" />
- </dir> <!-- / -->
- </contents>
- <dependencies>
- <required>
- <php>
- <min>5.0.3</min>
- </php>
- <pearinstaller>
- <min>1.4.0</min>
- </pearinstaller>
- <package>
- <name>pdo</name>
- <channel>pecl.php.net</channel>
- <min>1.0.3</min>
- <providesextension>PDO</providesextension>
- </package>
- </required>
- </dependencies>
- <providesextension>PDO_MYSQL</providesextension>
- <extsrcrelease />
-</package>
diff --git a/ext/pdo_odbc/EXPERIMENTAL b/ext/pdo_odbc/EXPERIMENTAL
deleted file mode 100644
index 139597f9cb..0000000000
--- a/ext/pdo_odbc/EXPERIMENTAL
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/ext/pdo_odbc/package2.xml b/ext/pdo_odbc/package2.xml
deleted file mode 100644
index 3eb99d1416..0000000000
--- a/ext/pdo_odbc/package2.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<package packagerversion="1.4.2" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
-http://pear.php.net/dtd/tasks-1.0.xsd
-http://pear.php.net/dtd/package-2.0
-http://pear.php.net/dtd/package-2.0.xsd">
- <name>PDO_ODBC</name>
- <channel>pecl.php.net</channel>
- <summary>ODBC v3 Interface driver for PDO</summary>
- <description>This extension provides an ODBC v3 driver for PDO. It supports unixODBC
-and IBM DB2 libraries, and will support more in future releases.
- </description>
- <lead>
- <name>Wez Furlong</name>
- <user>wez</user>
- <email>wez@php.net</email>
- <active>yes</active>
- </lead>
- <date>2006-05-01</date>
- <version>
- <release>1.0.1</release>
- <api>1.0.1</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <license uri="http://www.php.net/license">PHP</license>
- <notes>
-- Fixed bug #35552 (crash when pdo_odbc prepare fails). (Wez).
-- Fixed bug #36632 (bad error reporting for pdo_odbc exec UPDATE). (Wez).
-- repackage with package2.xml
-
-You require either IBM DB2 CLI libraries or unixODBC to use this package.
-
-If you are running on windows, you can download the binary from here:
-http://pecl4win.php.net/ext.php/php_pdo_odbc.dll
-
- </notes>
- <contents>
- <dir name="/">
- <file name="config.m4" role="src" />
- <file name="config.w32" role="src" />
- <file name="CREDITS" role="doc" />
- <file name="odbc_driver.c" role="src" />
- <file name="odbc_stmt.c" role="src" />
- <file name="pdo_odbc.c" role="src" />
- <file name="php_pdo_odbc.h" role="src" />
- <file name="php_pdo_odbc_int.h" role="src" />
- </dir> <!-- / -->
- </contents>
- <dependencies>
- <required>
- <php>
- <min>5.0.3</min>
- </php>
- <pearinstaller>
- <min>1.4.0</min>
- </pearinstaller>
- <package>
- <name>pdo</name>
- <channel>pecl.php.net</channel>
- <min>1.0.3</min>
- <providesextension>PDO</providesextension>
- </package>
- </required>
- </dependencies>
- <providesextension>PDO_ODBC</providesextension>
- <extsrcrelease>
- <configureoption name="with-pdo-odbc" prompt="flavour,dir? (just leave blank for help)" />
- </extsrcrelease>
-</package>
diff --git a/ext/pdo_pgsql/package2.xml b/ext/pdo_pgsql/package2.xml
deleted file mode 100644
index e397958a7d..0000000000
--- a/ext/pdo_pgsql/package2.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<package packagerversion="1.4.2" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
-http://pear.php.net/dtd/tasks-1.0.xsd
-http://pear.php.net/dtd/package-2.0
-http://pear.php.net/dtd/package-2.0.xsd">
- <name>PDO_PGSQL</name>
- <channel>pecl.php.net</channel>
- <summary>PostgreSQL driver for PDO</summary>
- <description>This extension provides an PostgreSQL driver for PDO.
- </description>
- <lead>
- <name>Edin Kadribasic</name>
- <user>edink</user>
- <email>edink@php.net</email>
- <active>yes</active>
- </lead>
- <lead>
- <name>Ilia Alshanetsky</name>
- <user>iliaa</user>
- <email>iliaa@php.net</email>
- <active>yes</active>
- </lead>
- <lead>
- <name>Wez Furlong</name>
- <user>wez</user>
- <email>wez@php.net</email>
- <active>yes</active>
- </lead>
- <date>2006-05-01</date>
- <version>
- <release>1.0.2</release>
- <api>1.0.2</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <license uri="http://www.php.net/license">PHP</license>
- <notes>
-This PECL release corresponds to PHP 5.1.3.
-
-- Fixed bug #36727 (segfault in pdo_pgsql bindValue() when no parameters are
- defined). (Tony)
-- Fixed bug #36382 (PDO/PgSQL's getColumnMeta() crashes). (Derick)
-- Fixed bug #36176 (PDO_PGSQL - PDO::exec() does not return number of rows
- affected by the operation). (Ilia)
-- Fixed prepared statement name conflict handling in PDO_PGSQL. (Thies, Ilia)
-- repackage with package2.xml
-- Added PDO::pgsqlLOBCreate(), PDO::pgsqlLOBOpen() and PDO::pgsqlLOBUnlink().
-
-You require PostgreSQL client libraries installed on the machine where you
-intend to build and/or use this package.
-
-If you are running on windows, you can download the binary from here:
-http://pecl4win.php.net/ext.php/php_pdo_pgsql.dll
- </notes>
- <contents>
- <dir name="/">
- <file name="config.m4" role="src" />
- <file name="config.w32" role="src" />
- <file name="CREDITS" role="doc" />
- <file name="pdo_pgsql.c" role="src" />
- <file name="pgsql_driver.c" role="src" />
- <file name="pgsql_statement.c" role="src" />
- <file name="php_pdo_pgsql.h" role="src" />
- <file name="php_pdo_pgsql_int.h" role="src" />
- </dir> <!-- / -->
- </contents>
- <dependencies>
- <required>
- <php>
- <min>5.0.3</min>
- </php>
- <pearinstaller>
- <min>1.4.0</min>
- </pearinstaller>
- <package>
- <name>pdo</name>
- <channel>pecl.php.net</channel>
- <min>1.0.3</min>
- <providesextension>PDO</providesextension>
- </package>
- </required>
- </dependencies>
- <providesextension>PDO_PGSQL</providesextension>
- <extsrcrelease />
-</package>
diff --git a/ext/pdo_sqlite/package2.xml b/ext/pdo_sqlite/package2.xml
deleted file mode 100644
index 9b582292ae..0000000000
--- a/ext/pdo_sqlite/package2.xml
+++ /dev/null
@@ -1,203 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<package packagerversion="1.4.5" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
-http://pear.php.net/dtd/tasks-1.0.xsd
-http://pear.php.net/dtd/package-2.0
-http://pear.php.net/dtd/package-2.0.xsd">
- <name>PDO_SQLITE</name>
- <channel>pecl.php.net</channel>
- <summary>SQLite v3 Interface driver for PDO</summary>
- <description>This extension provides an SQLite v3 driver for PDO.
-SQLite V3 is NOT compatible with the bundled SQLite 2 in PHP 5, but is a significant
-step forwards, featuring complete utf-8 support, native support for blobs,
-native support for prepared statements with bound parameters and improved
-concurrency.
-
- </description>
- <lead>
- <name>Wez Furlong</name>
- <user>wez</user>
- <email>wez@php.net</email>
- <active>yes</active>
- </lead>
- <date>2006-05-01</date>
- <version>
- <release>1.0.1</release>
- <api>1.0.1</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <license uri="http://www.php.net/license">PHP</license>
- <notes>
-- Updated libsqlite in ext/pdo_sqlite to 3.2.8. (Ilia)
-- Upgraded to new package2 format
-- Fixed PECL Bug #5633; build issues
-- Added sqliteCreateFunction() and sqliteCreateAggregate()
-- Fixed PECL Bug #3452; problem when first row of a result set contains a NULL value.
-- Upgraded bundled sqlite to 3.1.3
-- setting PDO_ATTR_TIMEOUT controls the busy timeout
-- Fixed PECL Bug #3391; cannot bind NULL parameters
-- Fixed build problem when building the bundled sqlite library
-
-Windows binary:
-http://pecl4win.php.net/ext.php/php_pdo_sqlite.dll
- </notes>
- <contents>
- <dir name="/">
- <dir name="sqlite">
- <dir name="src">
- <file name="alter.c" role="src" />
- <file name="analyze.c" role="src" />
- <file name="attach.c" role="src" />
- <file name="auth.c" role="src" />
- <file name="btree.c" role="src" />
- <file name="btree.h" role="src" />
- <file name="build.c" role="src" />
- <file name="callback.c" role="src" />
- <file name="date.c" role="src" />
- <file name="delete.c" role="src" />
- <file name="expr.c" role="src" />
- <file name="func.c" role="src" />
- <file name="hash.c" role="src" />
- <file name="hash.h" role="src" />
- <file name="insert.c" role="src" />
- <file name="keywordhash.h" role="src" />
- <file name="legacy.c" role="src" />
- <file name="main.c" role="src" />
- <file name="md5.c" role="src" />
- <file name="opcodes.c" role="src" />
- <file name="opcodes.h" role="src" />
- <file name="os.h" role="src" />
- <file name="os.c" role="src" />
- <file name="os_common.h" role="src" />
- <file name="os_test.c" role="src" />
- <file name="os_test.h" role="src" />
- <file name="os_unix.c" role="src" />
- <file name="os_unix.h" role="src" />
- <file name="os_win.c" role="src" />
- <file name="os_win.h" role="src" />
- <file name="pager.c" role="src" />
- <file name="pager.h" role="src" />
- <file name="parse.c" role="src" />
- <file name="parse.h" role="src" />
- <file name="parse.y" role="src" />
- <file name="pragma.c" role="src" />
- <file name="prepare.c" role="src" />
- <file name="printf.c" role="src" />
- <file name="random.c" role="src" />
- <file name="select.c" role="src" />
- <file name="shell.c" role="src" />
- <file name="sqlite.h.in" role="src" />
- <file name="sqliteInt.h" role="src" />
- <file name="table.c" role="src" />
- <file name="tclsqlite.c" role="src" />
- <file name="test1.c" role="src" />
- <file name="test2.c" role="src" />
- <file name="test3.c" role="src" />
- <file name="test4.c" role="src" />
- <file name="test5.c" role="src" />
- <file name="tokenize.c" role="src" />
- <file name="trigger.c" role="src" />
- <file name="update.c" role="src" />
- <file name="utf.c" role="src" />
- <file name="util.c" role="src" />
- <file name="vacuum.c" role="src" />
- <file name="vdbe.c" role="src" />
- <file name="vdbe.h" role="src" />
- <file name="vdbeapi.c" role="src" />
- <file name="vdbeaux.c" role="src" />
- <file name="vdbefifo.c" role="src" />
- <file name="vdbeInt.h" role="src" />
- <file name="vdbemem.c" role="src" />
- <file name="where.c" role="src" />
- <file name="vtab.c" role="src" />
- <file name="loadext.c" role="src" />
- <file name="complete.c" role="src" />
- <file name="sqlite3ext.h" role="src" />
- <file name="btmutex.c" role="src" />
- <file name="btreeInt.h" role="src" />
- <file name="experimental.c" role="src" />
- <file name="fault.c" role="src" />
- <file name="journal.c" role="src" />
- <file name="limits.h" role="src" />
- <file name="malloc.c" role="src" />
- <file name="mem1.c" role="src" />
- <file name="mutex.c" role="src" />
- <file name="mutex.h" role="src" />
- <file name="mutex_unix.c" role="src" />
- <file name="mutex_w32.c" role="src" />
- <file name="sqliteLimit.h" role="src" />
- <file name="vdbeblob.c" role="src" />
- </dir> <!-- //sqlite/src -->
- <dir name="tool">
- <file name="diffdb.c" role="src" />
- <file name="lemon.c" role="src" />
- <file name="lempar.c" role="src" />
- <file name="memleak.awk" role="src" />
- <file name="memleak2.awk" role="src" />
- <file name="memleak3.tcl" role="src" />
- <file name="mkkeywordhash.c" role="src" />
- <file name="mkopts.tcl" role="src" />
- <file name="opcodeDoc.awk" role="src" />
- <file name="report1.txt" role="src" />
- <file name="showdb.c" role="src" />
- <file name="showjournal.c" role="src" />
- <file name="spaceanal.tcl" role="src" />
- <file name="space_used.tcl" role="src" />
- <file name="speedtest.tcl" role="src" />
- <file name="speedtest2.tcl" role="src" />
- </dir> <!-- //sqlite/tool -->
- <file name="aclocal.m4" role="src" />
- <file name="config.guess" role="src" />
- <file name="config.sub" role="src" />
- <file name="configure" role="src" />
- <file name="configure.ac" role="src" />
- <file name="install-sh" role="src" />
- <file name="ltmain.sh" role="src" />
- <file name="main.mk" role="src" />
- <file name="Makefile.in" role="src" />
- <file name="Makefile.linux-gcc" role="src" />
- <file name="mkdll.sh" role="src" />
- <file name="mkopcodec.awk" role="src" />
- <file name="mkopcodeh.awk" role="src" />
- <file name="mkso.sh" role="src" />
- <file name="publish.sh" role="src" />
- <file name="README" role="src" />
- <file name="spec.template" role="src" />
- <file name="sqlite.1" role="src" />
- <file name="sqlite.pc.in" role="src" />
- <file name="sqlite3.def" role="src" />
- <file name="sqlite3.pc.in" role="src" />
- <file name="VERSION" role="src" />
- </dir> <!-- //sqlite -->
- <file name="config.m4" role="src" />
- <file name="config.w32" role="src" />
- <file name="CREDITS" role="doc" />
- <file name="pdo_sqlite.c" role="src" />
- <file name="php_pdo_sqlite.h" role="src" />
- <file name="php_pdo_sqlite_int.h" role="src" />
- <file name="sqlite_driver.c" role="src" />
- <file name="sqlite_statement.c" role="src" />
- </dir> <!-- / -->
- </contents>
- <dependencies>
- <required>
- <php>
- <min>5.0.3</min>
- </php>
- <pearinstaller>
- <min>1.4.0</min>
- </pearinstaller>
- <package>
- <name>pdo</name>
- <channel>pecl.php.net</channel>
- <min>1.0.3</min>
- <providesextension>PDO</providesextension>
- </package>
- </required>
- </dependencies>
- <providesextension>PDO_SQLITE</providesextension>
- <extsrcrelease />
-</package>
-<!-- vim:se ts=1 sw=1 et: -->
diff --git a/ext/pdo_sqlite/pdo_sqlite.c b/ext/pdo_sqlite/pdo_sqlite.c
index d0eb1823d6..60e1a07afb 100644
--- a/ext/pdo_sqlite/pdo_sqlite.c
+++ b/ext/pdo_sqlite/pdo_sqlite.c
@@ -73,6 +73,11 @@ PHP_MINIT_FUNCTION(pdo_sqlite)
REGISTER_PDO_CLASS_CONST_LONG("SQLITE_DETERMINISTIC", (zend_long)SQLITE_DETERMINISTIC);
#endif
+ REGISTER_PDO_CLASS_CONST_LONG("SQLITE_ATTR_OPEN_FLAGS", (zend_long)PDO_SQLITE_ATTR_OPEN_FLAGS);
+ REGISTER_PDO_CLASS_CONST_LONG("SQLITE_OPEN_READONLY", (zend_long)SQLITE_OPEN_READONLY);
+ REGISTER_PDO_CLASS_CONST_LONG("SQLITE_OPEN_READWRITE", (zend_long)SQLITE_OPEN_READWRITE);
+ REGISTER_PDO_CLASS_CONST_LONG("SQLITE_OPEN_CREATE", (zend_long)SQLITE_OPEN_CREATE);
+
return php_pdo_register_driver(&pdo_sqlite_driver);
}
/* }}} */
diff --git a/ext/pdo_sqlite/php_pdo_sqlite_int.h b/ext/pdo_sqlite/php_pdo_sqlite_int.h
index a390d6497f..1c90416b9f 100644
--- a/ext/pdo_sqlite/php_pdo_sqlite_int.h
+++ b/ext/pdo_sqlite/php_pdo_sqlite_int.h
@@ -75,4 +75,9 @@ extern int _pdo_sqlite_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file,
#define pdo_sqlite_error_stmt(s) _pdo_sqlite_error(stmt->dbh, stmt, __FILE__, __LINE__)
extern struct pdo_stmt_methods sqlite_stmt_methods;
+
+enum {
+ PDO_SQLITE_ATTR_OPEN_FLAGS = PDO_ATTR_DRIVER_SPECIFIC,
+};
+
#endif
diff --git a/ext/pdo_sqlite/sqlite_driver.c b/ext/pdo_sqlite/sqlite_driver.c
index e234406be9..1b4fecae81 100644
--- a/ext/pdo_sqlite/sqlite_driver.c
+++ b/ext/pdo_sqlite/sqlite_driver.c
@@ -791,7 +791,7 @@ static int pdo_sqlite_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* {{
{
pdo_sqlite_db_handle *H;
int i, ret = 0;
- zend_long timeout = 60;
+ zend_long timeout = 60, flags;
char *filename;
H = pecalloc(1, sizeof(pdo_sqlite_db_handle), dbh->is_persistent);
@@ -809,7 +809,14 @@ static int pdo_sqlite_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* {{
goto cleanup;
}
+ flags = pdo_attr_lval(driver_options, PDO_SQLITE_ATTR_OPEN_FLAGS, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE);
+
+#if SQLITE_VERSION_NUMBER >= 3005000
+ i = sqlite3_open_v2(filename, &H->db, flags, NULL);
+#else
i = sqlite3_open(filename, &H->db);
+#endif
+
efree(filename);
if (i != SQLITE_OK) {
diff --git a/ext/pdo_sqlite/tests/pdo_sqlite_open_flags.phpt b/ext/pdo_sqlite/tests/pdo_sqlite_open_flags.phpt
new file mode 100644
index 0000000000..89cb6c89bd
--- /dev/null
+++ b/ext/pdo_sqlite/tests/pdo_sqlite_open_flags.phpt
@@ -0,0 +1,33 @@
+--TEST--
+PDO_sqlite: Testing open flags
+--SKIPIF--
+<?php if (!extension_loaded('pdo_sqlite')) print 'skip not loaded'; ?>
+--FILE--
+<?php
+
+$filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . "pdo_sqlite_open_flags.db";
+
+// Default open flag is read-write|create
+$db = new PDO('sqlite:' . $filename, null, null, [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]);
+
+var_dump($db->exec('CREATE TABLE test1 (id INT);'));
+
+$db = new PDO('sqlite:' . $filename, null, null, [PDO::SQLITE_ATTR_OPEN_FLAGS => PDO::SQLITE_OPEN_READONLY, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]);
+
+var_dump($db->exec('CREATE TABLE test2 (id INT);'));
+?>
+--CLEAN--
+<?php
+$filename = dirname(__FILE__) . DIRECTORY_SEPARATOR . "pdo_sqlite_open_flags.db";
+if (file_exists($filename)) {
+ unlink($filename);
+}
+?>
+--EXPECTF--
+int(0)
+
+Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in %s
+Stack trace:
+%s
+#1 {main}
+ thrown in %s
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 1fe26f78fc..07dcff9cf2 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -1194,6 +1194,24 @@ PHP_MINIT_FUNCTION(pgsql)
REGISTER_LONG_CONSTANT("PGSQL_DIAG_SOURCE_FILE", PG_DIAG_SOURCE_FILE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PGSQL_DIAG_SOURCE_LINE", PG_DIAG_SOURCE_LINE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("PGSQL_DIAG_SOURCE_FUNCTION", PG_DIAG_SOURCE_FUNCTION, CONST_CS | CONST_PERSISTENT);
+#ifdef PG_DIAG_SCHEMA_NAME
+ REGISTER_LONG_CONSTANT("PGSQL_DIAG_SCHEMA_NAME", PG_DIAG_SCHEMA_NAME, CONST_CS | CONST_PERSISTENT);
+#endif
+#ifdef PG_DIAG_TABLE_NAME
+ REGISTER_LONG_CONSTANT("PGSQL_DIAG_TABLE_NAME", PG_DIAG_TABLE_NAME, CONST_CS | CONST_PERSISTENT);
+#endif
+#ifdef PG_DIAG_COLUMN_NAME
+ REGISTER_LONG_CONSTANT("PGSQL_DIAG_COLUMN_NAME", PG_DIAG_COLUMN_NAME, CONST_CS | CONST_PERSISTENT);
+#endif
+#ifdef PG_DIAG_DATATYPE_NAME
+ REGISTER_LONG_CONSTANT("PGSQL_DIAG_DATATYPE_NAME", PG_DIAG_DATATYPE_NAME, CONST_CS | CONST_PERSISTENT);
+#endif
+#ifdef PG_DIAG_CONSTRAINT_NAME
+ REGISTER_LONG_CONSTANT("PGSQL_DIAG_CONSTRAINT_NAME", PG_DIAG_CONSTRAINT_NAME, CONST_CS | CONST_PERSISTENT);
+#endif
+#ifdef PG_DIAG_SEVERITY_NONLOCALIZED
+ REGISTER_LONG_CONSTANT("PGSQL_DIAG_SEVERITY_NONLOCALIZED", PG_DIAG_SEVERITY_NONLOCALIZED, CONST_CS | CONST_PERSISTENT);
+#endif
#endif
/* pg_convert options */
REGISTER_LONG_CONSTANT("PGSQL_CONV_IGNORE_DEFAULT", PGSQL_CONV_IGNORE_DEFAULT, CONST_CS | CONST_PERSISTENT);
diff --git a/ext/pgsql/pgsql.mak b/ext/pgsql/pgsql.mak
deleted file mode 100644
index 908056acfb..0000000000
--- a/ext/pgsql/pgsql.mak
+++ /dev/null
@@ -1,170 +0,0 @@
-# Temporarily here -- later may go into some batch file
-# which will set this as an environment variable
-PROJECT_ROOT = ..\..
-
-# Module details
-MODULE_NAME = phppgsql
-MODULE_DESC = "PHP 4.3 - PostgreSQL Extension"
-VMAJ = 3
-VMIN = 0
-VREV = 0
-
-#include the common settings
-include $(PROJECT_ROOT)/netware/common.mif
-
-# Build type defaults to 'release'
-ifndef BUILD
-BUILD = release
-endif
-
-# Extensions of all input and output files
-.SUFFIXES:
-.SUFFIXES: .nlm .lib .obj .cpp .c .msg .mlc .mdb .xdc .d
-
-# Source files
-C_SRC = pgsql.c \
- start.c
-
-CPP_SRC_NODIR = $(notdir $(CPP_SRC))
-C_SRC_NODIR = $(notdir $(C_SRC))
-SRC_DIR = $(dir $(CPP_SRC) $(C_SRC))
-
-# Library files
-LIBRARY =
-
-# Destination directories and files
-OBJ_DIR = $(BUILD)
-FINAL_DIR = $(BUILD)
-OBJECTS = $(addprefix $(OBJ_DIR)/,$(CPP_SRC_NODIR:.c=.obj) $(C_SRC_NODIR:.c=.obj))
-DEPDS = $(addprefix $(OBJ_DIR)/,$(CPP_SRC_NODIR:.c=.d) $(C_SRC_NODIR:.c=.d))
-
-# Binary file
-ifndef BINARY
- BINARY=$(FINAL_DIR)\$(MODULE_NAME).nlm
-endif
-
-# Compile flags
-C_FLAGS += -c -maxerrors 25 -msgstyle gcc -wchar_t on -bool on -processor Pentium
-C_FLAGS += -nostdinc -nosyspath
-C_FLAGS += -relax_pointers # To remove type-casting errors
-C_FLAGS += -DNETWARE -DZTS -DNEW_LIBC -DUSE_OLD_FUNCTIONS
-C_FLAGS += -D__BIT_TYPES_DEFINED__ -DCOMPILE_DL_PGSQL=1
-C_FLAGS += -I. -I- -I$(PROJECT_ROOT) -I$(PROJECT_ROOT)/main
-C_FLAGS += -I$(PROJECT_ROOT)/ext/standard -I$(PROJECT_ROOT)/netware
-C_FLAGS += -I$(PROJECT_ROOT)/zend -I$(PROJECT_ROOT)/tsrm
-C_FLAGS += -I$(SDK_DIR)/include -I$(MWCIncludes)
-C_FLAGS += -I$(WINSOCK_DIR)/include/nlm -I$(WINSOCK_DIR)/include
-
-
-# Extra stuff based on debug / release builds
-ifeq '$(BUILD)' 'debug'
- SYM_FILE = $(FINAL_DIR)\$(MODULE_NAME).sym
- C_FLAGS += -inline smart -sym on -sym codeview4 -opt off -opt intrinsics -DDEBUGGING -DDKFBPON
- C_FLAGS += -exc cw -DZEND_DEBUG=1
- LD_FLAGS += -sym on -sym codeview4 -osym $(SYM_FILE)
- export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtld.lib
-else
- C_FLAGS += -opt speed -inline on -inline smart -inline auto -sym off -opt intrinsics
- C_FLAGS += -opt level=4 -DZEND_DEBUG=0
- LD_FLAGS += -sym off
- export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtl.lib
-endif
-
-
-# Dependencies
-MODULE = LibC \
- phplib \
- libpq
-IMPORT = @$(SDK_DIR)/imports/libc.imp \
- @$(SDK_DIR)/imports/ws2nlm.imp \
- @$(MPK_DIR)/import/mpkOrg.imp \
- @$(PROJECT_ROOT)/netware/phplib.imp \
- @$(PROJECT_ROOT)/netware/libpq.imp
-EXPORT = ($(MODULE_NAME)) get_module
-API = OutputToScreen
-
-# Virtual paths
-vpath %.cpp .
-vpath %.c . ..\..\netware
-vpath %.obj $(OBJ_DIR)
-
-
-all: prebuild project
-
-.PHONY: all
-
-prebuild:
- @if not exist $(OBJ_DIR) md $(OBJ_DIR)
-
-project: $(BINARY)
- @echo Build complete.
-
-$(OBJ_DIR)/%.d: %.cpp
- @echo Building Dependencies for $(<F)
- @$(CC) -M $< $(C_FLAGS) -o $@
-
-$(OBJ_DIR)/%.d: %.c
- @echo Building Dependencies for $(<F)
- @$(CC) -M $< $(C_FLAGS) -o $@
-
-$(OBJ_DIR)/%.obj: %.cpp
- @echo Compiling $?...
- @$(CC) $< $(C_FLAGS) -o $@
-
-$(OBJ_DIR)/%.obj: %.c
- @echo Compiling $?...
- @$(CC) $< $(C_FLAGS) -o $@
-
-
-$(BINARY): $(OBJECTS)
- @echo Import $(IMPORT) > $(basename $@).def
-ifdef API
- @echo Import $(API) >> $(basename $@).def
-endif
- @echo Module $(MODULE) >> $(basename $@).def
-ifdef EXPORT
- @echo Export $(EXPORT) >> $(basename $@).def
-endif
- @echo AutoUnload >> $(basename $@).def
-ifeq '$(BUILD)' 'debug'
- @echo Debug >> $(basename $@).def
-endif
- @echo Flag_On 0x00000008 >> $(basename $@).def
- @echo Start _LibCPrelude >> $(basename $@).def
- @echo Exit _LibCPostlude >> $(basename $@).def
-
- $(MPKTOOL) $(XDCFLAGS) $(basename $@).xdc
- @echo xdcdata $(basename $@).xdc >> $(basename $@).def
-
- @echo Linking $@...
- @echo $(LD_FLAGS) -commandfile $(basename $@).def > $(basename $@).link
-
- @echo $(LIBRARY) $(OBJECTS) >> $(basename $@).link
-
- @$(LINK) @$(basename $@).link
-
-
-.PHONY: clean
-clean: cleanobj cleanbin
-
-.PHONY: cleand
-cleand:
- @echo Deleting all dependency files...
- -@del "$(OBJ_DIR)\*.d"
-
-.PHONY: cleanobj
-cleanobj:
- @echo Deleting all object files...
- -@del "$(OBJ_DIR)\*.obj"
-
-.PHONY: cleanbin
-cleanbin:
- @echo Deleting binary files...
- -@del "$(FINAL_DIR)\$(MODULE_NAME).nlm"
- @echo Deleting MAP, DEF files, etc....
- -@del "$(FINAL_DIR)\$(MODULE_NAME).map"
- -@del "$(FINAL_DIR)\$(MODULE_NAME).def"
- -@del "$(FINAL_DIR)\$(MODULE_NAME).link"
-ifeq '$(BUILD)' 'debug'
- -@del $(FINAL_DIR)\$(MODULE_NAME).sym
-endif
diff --git a/ext/phar/dirstream.c b/ext/phar/dirstream.c
index cb95cdf0e9..ce37a448f5 100644
--- a/ext/phar/dirstream.c
+++ b/ext/phar/dirstream.c
@@ -319,7 +319,7 @@ php_stream *phar_wrapper_open_dir(php_stream_wrapper *wrapper, const char *path,
/* we must have at the very least phar://alias.phar/ */
if (!resource->scheme || !resource->host || !resource->path) {
if (resource->host && !resource->path) {
- php_stream_wrapper_log_error(wrapper, options, "phar error: no directory in \"%s\", must have at least phar://%s/ for root directory (always use full path to a new phar)", path, resource->host);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: no directory in \"%s\", must have at least phar://%s/ for root directory (always use full path to a new phar)", path, ZSTR_VAL(resource->host));
php_url_free(resource);
return NULL;
}
@@ -328,22 +328,22 @@ php_stream *phar_wrapper_open_dir(php_stream_wrapper *wrapper, const char *path,
return NULL;
}
- if (strcasecmp("phar", resource->scheme)) {
+ if (!zend_string_equals_literal_ci(resource->scheme, "phar")) {
php_url_free(resource);
php_stream_wrapper_log_error(wrapper, options, "phar error: not a phar url \"%s\"", path);
return NULL;
}
- host_len = strlen(resource->host);
+ host_len = ZSTR_LEN(resource->host);
phar_request_initialize();
- internal_file = resource->path + 1; /* strip leading "/" */
+ internal_file = ZSTR_VAL(resource->path) + 1; /* strip leading "/" */
- if (FAILURE == phar_get_archive(&phar, resource->host, host_len, NULL, 0, &error)) {
+ if (FAILURE == phar_get_archive(&phar, ZSTR_VAL(resource->host), host_len, NULL, 0, &error)) {
if (error) {
php_stream_wrapper_log_error(wrapper, options, "%s", error);
efree(error);
} else {
- php_stream_wrapper_log_error(wrapper, options, "phar file \"%s\" is unknown", resource->host);
+ php_stream_wrapper_log_error(wrapper, options, "phar file \"%s\" is unknown", ZSTR_VAL(resource->host));
}
php_url_free(resource);
return NULL;
@@ -446,48 +446,48 @@ int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mo
return 0;
}
- if (strcasecmp("phar", resource->scheme)) {
+ if (!zend_string_equals_literal_ci(resource->scheme, "phar")) {
php_url_free(resource);
php_stream_wrapper_log_error(wrapper, options, "phar error: not a phar stream url \"%s\"", url_from);
return 0;
}
- host_len = strlen(resource->host);
+ host_len = ZSTR_LEN(resource->host);
- if (FAILURE == phar_get_archive(&phar, resource->host, host_len, NULL, 0, &error)) {
- php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\" in phar \"%s\", error retrieving phar information: %s", resource->path+1, resource->host, error);
+ if (FAILURE == phar_get_archive(&phar, ZSTR_VAL(resource->host), host_len, NULL, 0, &error)) {
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\" in phar \"%s\", error retrieving phar information: %s", resource->path+1, ZSTR_VAL(resource->host), error);
efree(error);
php_url_free(resource);
return 0;
}
- if ((e = phar_get_entry_info_dir(phar, resource->path + 1, strlen(resource->path + 1), 2, &error, 1))) {
+ if ((e = phar_get_entry_info_dir(phar, ZSTR_VAL(resource->path) + 1, ZSTR_LEN(resource->path) - 1, 2, &error, 1))) {
/* directory exists, or is a subdirectory of an existing file */
if (e->is_temp_dir) {
efree(e->filename);
efree(e);
}
- php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\" in phar \"%s\", directory already exists", resource->path+1, resource->host);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\" in phar \"%s\", directory already exists", ZSTR_VAL(resource->path)+1, ZSTR_VAL(resource->host));
php_url_free(resource);
return 0;
}
if (error) {
- php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\" in phar \"%s\", %s", resource->path+1, resource->host, error);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\" in phar \"%s\", %s", ZSTR_VAL(resource->path)+1, ZSTR_VAL(resource->host), error);
efree(error);
php_url_free(resource);
return 0;
}
- if (phar_get_entry_info_dir(phar, resource->path + 1, strlen(resource->path + 1), 0, &error, 1)) {
+ if (phar_get_entry_info_dir(phar, ZSTR_VAL(resource->path) + 1, ZSTR_LEN(resource->path) - 1, 0, &error, 1)) {
/* entry exists as a file */
- php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\" in phar \"%s\", file already exists", resource->path+1, resource->host);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\" in phar \"%s\", file already exists", ZSTR_VAL(resource->path)+1, ZSTR_VAL(resource->host));
php_url_free(resource);
return 0;
}
if (error) {
- php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\" in phar \"%s\", %s", resource->path+1, resource->host, error);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot create directory \"%s\" in phar \"%s\", %s", ZSTR_VAL(resource->path)+1, ZSTR_VAL(resource->host), error);
efree(error);
php_url_free(resource);
return 0;
@@ -500,14 +500,14 @@ int phar_wrapper_mkdir(php_stream_wrapper *wrapper, const char *url_from, int mo
entry.is_zip = 1;
}
- entry.filename = estrdup(resource->path + 1);
+ entry.filename = estrdup(ZSTR_VAL(resource->path) + 1);
if (phar->is_tar) {
entry.is_tar = 1;
entry.tar_type = TAR_DIR;
}
- entry.filename_len = strlen(resource->path + 1);
+ entry.filename_len = ZSTR_LEN(resource->path) - 1;
php_url_free(resource);
entry.is_dir = 1;
entry.phar = phar;
@@ -581,29 +581,29 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options
return 0;
}
- if (strcasecmp("phar", resource->scheme)) {
+ if (!zend_string_equals_literal_ci(resource->scheme, "phar")) {
php_url_free(resource);
php_stream_wrapper_log_error(wrapper, options, "phar error: not a phar stream url \"%s\"", url);
return 0;
}
- host_len = strlen(resource->host);
+ host_len = ZSTR_LEN(resource->host);
- if (FAILURE == phar_get_archive(&phar, resource->host, host_len, NULL, 0, &error)) {
- php_stream_wrapper_log_error(wrapper, options, "phar error: cannot remove directory \"%s\" in phar \"%s\", error retrieving phar information: %s", resource->path+1, resource->host, error);
+ if (FAILURE == phar_get_archive(&phar, ZSTR_VAL(resource->host), host_len, NULL, 0, &error)) {
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot remove directory \"%s\" in phar \"%s\", error retrieving phar information: %s", ZSTR_VAL(resource->path)+1, ZSTR_VAL(resource->host), error);
efree(error);
php_url_free(resource);
return 0;
}
- path_len = strlen(resource->path+1);
+ path_len = ZSTR_LEN(resource->path) - 1;
- if (!(entry = phar_get_entry_info_dir(phar, resource->path + 1, path_len, 2, &error, 1))) {
+ if (!(entry = phar_get_entry_info_dir(phar, ZSTR_VAL(resource->path) + 1, path_len, 2, &error, 1))) {
if (error) {
- php_stream_wrapper_log_error(wrapper, options, "phar error: cannot remove directory \"%s\" in phar \"%s\", %s", resource->path+1, resource->host, error);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot remove directory \"%s\" in phar \"%s\", %s", ZSTR_VAL(resource->path)+1, ZSTR_VAL(resource->host), error);
efree(error);
} else {
- php_stream_wrapper_log_error(wrapper, options, "phar error: cannot remove directory \"%s\" in phar \"%s\", directory does not exist", resource->path+1, resource->host);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: cannot remove directory \"%s\" in phar \"%s\", directory does not exist", ZSTR_VAL(resource->path)+1, ZSTR_VAL(resource->host));
}
php_url_free(resource);
return 0;
@@ -615,7 +615,7 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options
zend_hash_move_forward(&phar->manifest)
) {
if (ZSTR_LEN(str_key) > path_len &&
- memcmp(ZSTR_VAL(str_key), resource->path+1, path_len) == 0 &&
+ memcmp(ZSTR_VAL(str_key), ZSTR_VAL(resource->path)+1, path_len) == 0 &&
IS_SLASH(ZSTR_VAL(str_key)[path_len])) {
php_stream_wrapper_log_error(wrapper, options, "phar error: Directory not empty");
if (entry->is_temp_dir) {
@@ -632,7 +632,7 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options
zend_hash_move_forward(&phar->virtual_dirs)) {
if (ZSTR_LEN(str_key) > path_len &&
- memcmp(ZSTR_VAL(str_key), resource->path+1, path_len) == 0 &&
+ memcmp(ZSTR_VAL(str_key), ZSTR_VAL(resource->path)+1, path_len) == 0 &&
IS_SLASH(ZSTR_VAL(str_key)[path_len])) {
php_stream_wrapper_log_error(wrapper, options, "phar error: Directory not empty");
if (entry->is_temp_dir) {
@@ -646,7 +646,7 @@ int phar_wrapper_rmdir(php_stream_wrapper *wrapper, const char *url, int options
}
if (entry->is_temp_dir) {
- zend_hash_str_del(&phar->virtual_dirs, resource->path+1, path_len);
+ zend_hash_str_del(&phar->virtual_dirs, ZSTR_VAL(resource->path)+1, path_len);
efree(entry->filename);
efree(entry);
} else {
diff --git a/ext/phar/package.xml b/ext/phar/package.xml
deleted file mode 100644
index 4a9798e252..0000000000
--- a/ext/phar/package.xml
+++ /dev/null
@@ -1,1452 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<package packagerversion="1.8.2" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
- <name>phar</name>
- <channel>pecl.php.net</channel>
- <summary>allows running of complete applications out of .phar files (like Java .jar files)</summary>
- <description>This is the extension version of PEAR&apos;s PHP_Archive package. Support for
-zlib, bz2 and crc32 is achieved without any dependency other than the external
-zlib or bz2 extension.
-
-.phar files can be read using the phar stream, or with the Phar class. If the SPL extension
-is available, a Phar object can be used as an array to iterate over a phar&apos;s contents
-or to read files directly from the phar.
-
-Phar supports tar and zip file formats as well as the native phar file format, and can also be
-used to create data-only tar and zip archives with the PharData class, even if
-write access is disabled by the phar.readonly ini variable.
-
-Executable phar archives can be created using the streams API or with the Phar class, if
-the phar.readonly ini variable is set to false.
-
-Full support for MD5 and SHA1 signatures is possible. Signatures can be required
-if the ini variable phar.require_hash is set to true. When PECL extension hash is
-available then SHA-256 and SHA-512 signatures are supported as well.
-
-Phar is APC-compatible, the latest APC will cache files within a phar archive, resulting in
-a 6x speedup measured running phpMyAdmin as a phar archive.</description>
- <lead>
- <name>Greg Beaver</name>
- <user>cellog</user>
- <email>cellog@php.net</email>
- <active>yes</active>
- </lead>
- <lead>
- <name>Marcus Boerger</name>
- <user>helly</user>
- <email>helly@php.net</email>
- <active>yes</active>
- </lead>
- <developer>
- <name>Steph Fox</name>
- <user>sfox</user>
- <email>sfox@php.net</email>
- <active>yes</active>
- </developer>
- <date>2009-07-26</date>
- <time>15:41:33</time>
- <version>
- <release>2.0.0</release>
- <api>1.1.1</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <license uri="http://www.php.net/license">PHP License</license>
- <notes>
-BC BREAKING RELEASE
- BC breaks:
- * Phar object Compression API is rewritten. Use Phar::compress() and decompress(),
- Phar::compressFiles()/decompressFiles() and PharFileInfo-&gt;compress()/decompress().
- * phar.extract_list and Phar::getExtractList() are removed
-
-Major feature functionality release
- * phar.cache_list allows web-based phar applications to run at equal or faster than
- their on-disk equivalent [Greg]
- * new default stub allows running of phar-based phars without phar extension [Greg/Steph]
- * add support for tar-based and zip-based phar archives [Greg]
- * add support for OpenSSL-based true signatures [Greg]
- * add support for signatures to tar-based phar archives [Greg]
- * add Phar::isFileFormat() [Greg]
- * add Phar::convertToExecutable(), Phar::convertToData() [Greg]
- * add Phar::compress() [Greg]
- * rename Phar::compressAllFiles() to compressFiles(), uncompressAllFiles() to
- decompressFiles() [Greg]
- * conversion to compressed or to other file formats automatically copies the archive
- to a new extension (i.e. &quot;.phar&quot; to &quot;.phar.tar&quot; or &quot;.tar&quot; to &quot;.tar.gz&quot;) [Steph]
- * add Phar::webPhar() for running a web-based application unmodified
- directly from a phar archive [Greg]
- * file functions (fopen-based and stat-based) can be instructed to only look for
- relative paths within a phar via Phar::interceptFileFuncs()
- * add PharData class to allow manipulation/creation of non-executable tar and zip archives. [Steph]
- non-executable tar/zip manipulation is allowed even when phar.readonly=1 [Greg]
- * paths with . and .. work (phar://blah.phar/a/../b.php =&gt; phar://blah.phar/b.php) [Greg]
- * add support for mkdir()/rmdir() and support for empty directories to phar file format [Greg]
- * add option to compress the entire phar file for phar/tar file format [Greg]
- * implement Phar::isCompressed() returning 0, Phar::GZ or Phar::BZ2 [Greg]
- * implement Phar::copy(string $from, string $to) [Greg]
- * implement Phar::running(), returns path or URL to currently executed phar
- * implement Phar::buildFromIterator(Iterator $it[, string $base_directory]) [Greg]
- * implement Phar::buildFromDirectory(string $base_directory[, string $regex]) [Steph]
- * implement Phar::mount() for mounting external paths or files to locations inside a phar [Greg]
- * add Phar::delete() [Greg]
- * implement Phar::unlinkArchive() [Greg]
-
-Security addition
- * aliases are validated so that they contain no directory separators as intended
- * on conversion to other formats, user-supplied aliases are validated
-
-Changes since 2.0.0RC2:
- fixed PHP Bug #49021: phar tar signature algorithm reports as Unknown (0) in
- getSignature() call
- fixed PHP Bug #49020: phar misinterprets ustar long filename standard
- fixed PHP Bug #49018: phar tar stores long filenames with prefix/name reversed
- fixed PHP Bug #48791: open office files always reported as corrupted
- fixed PHP Bug #48783: make install will fail saying phar file exists
- fixed PHP Bug #48740: PHAR install fails when INSTALL_ROOT is not the final install location
- fixed PHP Bug #48681: openssl signature verification for tar archives broken
- fixed PHP Bug #48377: error message unclear on converting phar with existing file
- fixed isset() on sub-directories (isset(&quot;blah&quot;) if file &quot;blah/foo.php&quot; exists)
-
- make phar work in PHP 6
-Changes since 2.0.0RC1:
- security vulnerability in handling of long tar filenames fixed
- fixed PECL Bug #14646: phar error message unclear with php stream wrappers
- fixed PECL Bug #16338: php_stream_copy_to_stream{,_ex}()
- fixed PHP Bug #48257: PharData throws an exception with non-phar tar
- fixed PHP Bug #47085: rename() returns true even if the file in PHAR does not exist
- fixed PHP Bug #46032: PharData::__construct() - wrong memory read
- fixed PHP Bug #46060: Phar::addEmptyDir() breaks
- fixed PHP Bug #45907: undefined reference to &apos;PHP_SHA512Init&apos;
- fixed PHP Bug #45726: PHP_Archive / Archive.php missing
-Changes since 2.0.0a2: many bugfixes, removal of phar.extract_list, compression API refactored,
- conversion API refactored
-Changes since 2.0.0b1: addition of phar.cache_list, many performance improvements and bugfixes
- implement OpenSSL asynchronous true package signing
- add support for package signing to tar-based archives
- require PHP 5.2.1+
- </notes>
- <contents>
- <dir baseinstalldir="/" name="/">
- <dir name="phar">
- <file name="clicommand.inc" role="src" />
- <file name="directorygraphiterator.inc" role="src" />
- <file name="directorytreeiterator.inc" role="src" />
- <file name="invertedregexiterator.inc" role="src" />
- <file name="phar.inc" role="src" />
- <file name="phar.php" role="src" />
- <file name="pharcommand.inc" role="src" />
- </dir> <!-- /phar -->
- <dir name="tests">
- <dir name="cache_list">
- <dir name="files">
- <file name="blog.phar" role="test" />
- <file name="blog.phar.inc" role="test" />
- <file name="config.xml" role="test" />
- <file name="extracted.inc" role="test" />
- <file name="frontcontroller.phar" role="test" />
- <file name="frontcontroller.phar.inc" role="test" />
- <file name="frontcontroller2.phar" role="test" />
- <file name="frontcontroller2.phar.inc" role="test" />
- <file name="frontcontroller3.phar" role="test" />
- <file name="frontcontroller3.phar.inc" role="test" />
- <file name="frontcontroller4.phar" role="test" />
- <file name="frontcontroller4.phar.inc" role="test" />
- <file name="frontcontroller5.phar" role="test" />
- <file name="frontcontroller5.phar.inc" role="test" />
- <file name="frontcontroller6.phar" role="test" />
- <file name="frontcontroller6.phar.inc" role="test" />
- <file name="frontcontroller7.phar" role="test" />
- <file name="frontcontroller7.phar.inc" role="test" />
- <file name="frontcontroller8.phar" role="test" />
- <file name="frontcontroller8.phar.inc" role="test" />
- <file name="frontcontroller9.phar" role="test" />
- <file name="frontcontroller9.phar.inc" role="test" />
- <file name="frontcontroller10.phar" role="test" />
- <file name="frontcontroller10.phar.inc" role="test" />
- <file name="frontcontroller11.phar" role="test" />
- <file name="frontcontroller11.phar.inc" role="test" />
- <file name="frontcontroller12.phar" role="test" />
- <file name="frontcontroller12.phar.inc" role="test" />
- <file name="frontcontroller13.phar" role="test" />
- <file name="frontcontroller13.phar.inc" role="test" />
- <file name="frontcontroller14.phar" role="test" />
- <file name="frontcontroller14.phar.inc" role="test" />
- <file name="frontcontroller16.phar" role="test" />
- <file name="frontcontroller16.phar.inc" role="test" />
- <file name="frontcontroller17.phar" role="test" />
- <file name="frontcontroller17.phar.inc" role="test" />
- <file name="frontcontroller18.phar" role="test" />
- <file name="frontcontroller18.phar.inc" role="test" />
- <file name="frontcontroller19.phar" role="test" />
- <file name="frontcontroller19.phar.inc" role="test" />
- <file name="md5.phar" role="test" />
- <file name="nophar.phar" role="test" />
- <file name="nophar.phar.inc" role="test" />
- <file name="openssl.phar" role="test" />
- <file name="openssl.phar.pubkey" role="test" />
- <file name="phar_oo_test.inc" role="test" />
- <file name="phar_test.inc" role="test" />
- <file name="private.pem" role="test" />
- <file name="sha1.phar" role="test" />
- <file name="sha256.phar" role="test" />
- <file name="sha512.phar" role="test" />
- <file name="write.phar" role="test" />
- <file name="write.phar.inc" role="test" />
- <file name="write2.phar" role="test" />
- <file name="write2.phar.inc" role="test" />
- <file name="write3.phar" role="test" />
- <file name="write3.phar.inc" role="test" />
- <file name="write4.phar" role="test" />
- <file name="write4.phar.inc" role="test" />
- <file name="write5.phar" role="test" />
- <file name="write5.phar.inc" role="test" />
- <file name="write6.phar" role="test" />
- <file name="write6.phar.inc" role="test" />
- <file name="write7.phar" role="test" />
- <file name="write7.phar.inc" role="test" />
- <file name="write8.phar" role="test" />
- <file name="write8.phar.inc" role="test" />
- <file name="write9.phar" role="test" />
- <file name="write9.phar.inc" role="test" />
- <file name="write10.phar" role="test" />
- <file name="write10.phar.inc" role="test" />
- <file name="write11.phar" role="test" />
- <file name="write11.phar.inc" role="test" />
- <file name="write12.phar" role="test" />
- <file name="write12.phar.inc" role="test" />
- <file name="write13.phar" role="test" />
- <file name="write13.phar.inc" role="test" />
- <file name="write14.phar" role="test" />
- <file name="write14.phar.inc" role="test" />
- <file name="write15.phar" role="test" />
- <file name="write15.phar.inc" role="test" />
- <file name="write16.phar" role="test" />
- <file name="write16.phar.inc" role="test" />
- <file name="write17.phar" role="test" />
- <file name="write17.phar.inc" role="test" />
- <file name="write18.phar" role="test" />
- <file name="write18.phar.inc" role="test" />
- <file name="write19.phar" role="test" />
- <file name="write19.phar.inc" role="test" />
- <file name="write20.phar" role="test" />
- <file name="write20.phar.inc" role="test" />
- <file name="write21.phar" role="test" />
- <file name="write21.phar.inc" role="test" />
- <file name="write22.phar" role="test" />
- <file name="write22.phar.inc" role="test" />
- <file name="write23.phar" role="test" />
- <file name="write23.phar.inc" role="test" />
- <file name="write24.phar" role="test" />
- <file name="write24.phar.inc" role="test" />
- <file name="write25.phar" role="test" />
- <file name="write25.phar.inc" role="test" />
- <file name="zfapp.tgz" role="test" />
- </dir> <!-- /tests/cache_list/files -->
- <file name="copyonwrite1.phar.phpt" role="test" />
- <file name="copyonwrite2.phar.phpt" role="test" />
- <file name="copyonwrite3.phar.phpt" role="test" />
- <file name="copyonwrite4.phar.phpt" role="test" />
- <file name="copyonwrite4a.phpt" role="test" />
- <file name="copyonwrite5.phar.phpt" role="test" />
- <file name="copyonwrite6.phar.phpt" role="test" />
- <file name="copyonwrite7.phar.phpt" role="test" />
- <file name="copyonwrite8.phar.phpt" role="test" />
- <file name="copyonwrite9.phar.phpt" role="test" />
- <file name="copyonwrite10.phar.phpt" role="test" />
- <file name="copyonwrite11.phar.phpt" role="test" />
- <file name="copyonwrite12.phar.phpt" role="test" />
- <file name="copyonwrite13.phar.phpt" role="test" />
- <file name="copyonwrite14.phar.phpt" role="test" />
- <file name="copyonwrite15.phar.phpt" role="test" />
- <file name="copyonwrite16.phar.phpt" role="test" />
- <file name="copyonwrite17.phar.phpt" role="test" />
- <file name="copyonwrite18.phar.phpt" role="test" />
- <file name="copyonwrite19.phar.phpt" role="test" />
- <file name="copyonwrite20.phar.phpt" role="test" />
- <file name="copyonwrite21.phar.phpt" role="test" />
- <file name="copyonwrite22.phar.phpt" role="test" />
- <file name="copyonwrite23.phar.phpt" role="test" />
- <file name="copyonwrite24.phar.phpt" role="test" />
- <file name="copyonwrite25.phar.phpt" role="test" />
- <file name="frontcontroller1.phpt" role="test" />
- <file name="frontcontroller2.phpt" role="test" />
- <file name="frontcontroller3.phpt" role="test" />
- <file name="frontcontroller4.phpt" role="test" />
- <file name="frontcontroller5.phpt" role="test" />
- <file name="frontcontroller6.phpt" role="test" />
- <file name="frontcontroller7.phpt" role="test" />
- <file name="frontcontroller8.phpt" role="test" />
- <file name="frontcontroller9.phpt" role="test" />
- <file name="frontcontroller10.phpt" role="test" />
- <file name="frontcontroller11.phpt" role="test" />
- <file name="frontcontroller12.phpt" role="test" />
- <file name="frontcontroller13.phpt" role="test" />
- <file name="frontcontroller14.phpt" role="test" />
- <file name="frontcontroller15.phpt" role="test" />
- <file name="frontcontroller16.phpt" role="test" />
- <file name="frontcontroller17.phpt" role="test" />
- <file name="frontcontroller18.phpt" role="test" />
- <file name="frontcontroller19.phpt" role="test" />
- <file name="frontcontroller20.phpt" role="test" />
- <file name="frontcontroller21.phpt" role="test" />
- <file name="frontcontroller22.phpt" role="test" />
- <file name="frontcontroller23.phpt" role="test" />
- <file name="frontcontroller24.phpt" role="test" />
- <file name="frontcontroller25.phpt" role="test" />
- <file name="frontcontroller26.phpt" role="test" />
- <file name="frontcontroller27.phpt" role="test" />
- <file name="frontcontroller28.phpt" role="test" />
- <file name="frontcontroller29.phpt" role="test" />
- <file name="frontcontroller30.phpt" role="test" />
- <file name="frontcontroller31.phpt" role="test" />
- <file name="frontcontroller32.phpt" role="test" />
- <file name="frontcontroller33.phpt" role="test" />
- <file name="frontcontroller34.phpt" role="test" />
- </dir> <!-- /tests/cache_list -->
- <dir name="files">
- <file name="blog.phar" role="test" />
- <file name="blog.phar.inc" role="test" />
- <file name="config.xml" role="test" />
- <file name="extracted.inc" role="test" />
- <file name="frontcontroller.phar" role="test" />
- <file name="frontcontroller.phar.inc" role="test" />
- <file name="frontcontroller2.phar" role="test" />
- <file name="frontcontroller2.phar.inc" role="test" />
- <file name="frontcontroller3.phar" role="test" />
- <file name="frontcontroller3.phar.inc" role="test" />
- <file name="frontcontroller4.phar" role="test" />
- <file name="frontcontroller4.phar.inc" role="test" />
- <file name="frontcontroller5.phar" role="test" />
- <file name="frontcontroller5.phar.inc" role="test" />
- <file name="frontcontroller6.phar" role="test" />
- <file name="frontcontroller6.phar.inc" role="test" />
- <file name="frontcontroller7.phar" role="test" />
- <file name="frontcontroller7.phar.inc" role="test" />
- <file name="frontcontroller8.phar" role="test" />
- <file name="frontcontroller8.phar.inc" role="test" />
- <file name="frontcontroller9.phar" role="test" />
- <file name="frontcontroller9.phar.inc" role="test" />
- <file name="frontcontroller10.phar" role="test" />
- <file name="frontcontroller10.phar.inc" role="test" />
- <file name="frontcontroller11.phar" role="test" />
- <file name="frontcontroller11.phar.inc" role="test" />
- <file name="frontcontroller12.phar" role="test" />
- <file name="frontcontroller12.phar.inc" role="test" />
- <file name="frontcontroller13.phar" role="test" />
- <file name="frontcontroller13.phar.inc" role="test" />
- <file name="frontcontroller14.phar" role="test" />
- <file name="frontcontroller14.phar.inc" role="test" />
- <file name="frontcontroller16.phar" role="test" />
- <file name="frontcontroller16.phar.inc" role="test" />
- <file name="frontcontroller17.phar" role="test" />
- <file name="frontcontroller17.phar.inc" role="test" />
- <file name="frontcontroller18.phar" role="test" />
- <file name="frontcontroller18.phar.inc" role="test" />
- <file name="frontcontroller19.phar" role="test" />
- <file name="frontcontroller19.phar.inc" role="test" />
- <file name="include_path.phar" role="test" />
- <file name="include_path.phar.inc" role="test" />
- <file name="include_path2.phar" role="test" />
- <file name="md5.phar" role="test" />
- <file name="nophar.phar" role="test" />
- <file name="nophar.phar.inc" role="test" />
- <file name="notbogus.zip" role="test" />
- <file name="openssl.phar" role="test" />
- <file name="openssl.phar.pubkey" role="test" />
- <file name="phar_oo_test.inc" role="test" />
- <file name="phar_test.inc" role="test" />
- <file name="private.pem" role="test" />
- <file name="sha1.phar" role="test" />
- <file name="sha256.phar" role="test" />
- <file name="sha512.phar" role="test" />
- <file name="zfapp.tgz" role="test" />
- </dir> <!-- /tests/files -->
- <dir name="tar">
- <dir name="files">
- <file name="badalias1.phar.tar" role="test" />
- <file name="badalias2.phar.tar" role="test" />
- <file name="badalias3.phar.tar" role="test" />
- <file name="badalias4.phar.tar" role="test" />
- <file name="badalias5.phar.tar" role="test" />
- <file name="biglink.tar" role="test" />
- <file name="corrupt_tarmaker.php.inc" role="test" />
- <file name="frontcontroller.phar.inc" role="test" />
- <file name="frontcontroller.phar.tar" role="test" />
- <file name="frontcontroller2.phar.inc" role="test" />
- <file name="frontcontroller2.phar.tar" role="test" />
- <file name="frontcontroller3.phar.inc" role="test" />
- <file name="frontcontroller3.phar.tar" role="test" />
- <file name="frontcontroller4.phar.inc" role="test" />
- <file name="frontcontroller4.phar.tar" role="test" />
- <file name="frontcontroller5.phar.inc" role="test" />
- <file name="frontcontroller5.phar.tar" role="test" />
- <file name="frontcontroller6.phar.inc" role="test" />
- <file name="frontcontroller6.phar.tar" role="test" />
- <file name="frontcontroller7.phar.inc" role="test" />
- <file name="frontcontroller7.phar.tar" role="test" />
- <file name="frontcontroller8.phar.inc" role="test" />
- <file name="frontcontroller8.phar.tar" role="test" />
- <file name="frontcontroller9.phar.inc" role="test" />
- <file name="frontcontroller9.phar.tar" role="test" />
- <file name="frontcontroller10.phar.inc" role="test" />
- <file name="frontcontroller10.phar.tar" role="test" />
- <file name="frontcontroller11.phar.inc" role="test" />
- <file name="frontcontroller11.phar.tar" role="test" />
- <file name="frontcontroller12.phar.inc" role="test" />
- <file name="frontcontroller12.phar.tar" role="test" />
- <file name="links.phar.tar" role="test" />
- <file name="links.tar" role="test" />
- <file name="make.dangerous.tar.php.inc" role="test" />
- <file name="make_invalid_tar.php.inc" role="test" />
- <file name="Net_URL-1.0.15.tgz" role="test" />
- <file name="P1-1.0.0.tgz" role="test" />
- <file name="P1-1.0.0.tgz.pubkey" role="test" />
- <file name="subdirlink.tar" role="test" />
- <file name="tarmaker.php.inc" role="test" />
- <file name="tinylink.tar" role="test" />
- <file name="trunc.tar" role="test" />
- </dir> <!-- /tests/tar/files -->
- <file name="033.phpt" role="test" />
- <file name="033a.phpt" role="test" />
- <file name="alias_acrobatics.phpt" role="test" />
- <file name="all.phpt" role="test" />
- <file name="allU.phpt" role="test" />
- <file name="badalias.phpt" role="test" />
- <file name="badchecksum.phpt" role="test" />
- <file name="bignames.phpt" role="test" />
- <file name="bignames_overflow.phpt" role="test" />
- <file name="create_new_and_modify.phpt" role="test" />
- <file name="create_new_phar_b.phpt" role="test" />
- <file name="delete.phpt" role="test" />
- <file name="delete_in_phar.phpt" role="test" />
- <file name="delete_in_phar_b.phpt" role="test" />
- <file name="delete_in_phar_confirm.phpt" role="test" />
- <file name="dir.phpt" role="test" />
- <file name="exists_as_phar.phpt" role="test" />
- <file name="frontcontroller1.phar.phpt" role="test" />
- <file name="frontcontroller2.phar.phpt" role="test" />
- <file name="frontcontroller3.phar.phpt" role="test" />
- <file name="frontcontroller4.phar.phpt" role="test" />
- <file name="frontcontroller5.phar.phpt" role="test" />
- <file name="frontcontroller6.phar.phpt" role="test" />
- <file name="frontcontroller7.phar.phpt" role="test" />
- <file name="frontcontroller8.phar.phpt" role="test" />
- <file name="frontcontroller9.phar.phpt" role="test" />
- <file name="frontcontroller10.phar.phpt" role="test" />
- <file name="frontcontroller11.phar.phpt" role="test" />
- <file name="frontcontroller12.phar.phpt" role="test" />
- <file name="frontcontroller13.phar.phpt" role="test" />
- <file name="frontcontroller14.phar.phpt" role="test" />
- <file name="frontcontroller15.phar.phpt" role="test" />
- <file name="frontcontroller16.phar.phpt" role="test" />
- <file name="frontcontroller17.phar.phpt" role="test" />
- <file name="frontcontroller18.phar.phpt" role="test" />
- <file name="frontcontroller19.phar.phpt" role="test" />
- <file name="frontcontroller20.phar.phpt" role="test" />
- <file name="frontcontroller21.phar.phpt" role="test" />
- <file name="links.phpt" role="test" />
- <file name="links2.phpt" role="test" />
- <file name="links3.phpt" role="test" />
- <file name="links4.phpt" role="test" />
- <file name="links5.phpt" role="test" />
- <file name="links6.phpt" role="test" />
- <file name="open_for_write_existing.phpt" role="test" />
- <file name="open_for_write_existing_b.phpt" role="test" />
- <file name="open_for_write_existing_b_5_2.phpt" role="test" />
- <file name="open_for_write_existing_c.phpt" role="test" />
- <file name="open_for_write_existing_c_5_2.phpt" role="test" />
- <file name="open_for_write_newfile.phpt" role="test" />
- <file name="open_for_write_newfile_b.phpt" role="test" />
- <file name="open_for_write_newfile_b_5_2.phpt" role="test" />
- <file name="open_for_write_newfile_c.phpt" role="test" />
- <file name="open_for_write_newfile_c_5_2.phpt" role="test" />
- <file name="phar_begin_setstub_commit.phpt" role="test" />
- <file name="phar_begin_setstub_commitU.phpt" role="test" />
- <file name="phar_buildfromiterator4.phpt" role="test" />
- <file name="phar_buildfromiterator5.phpt" role="test" />
- <file name="phar_buildfromiterator6.phpt" role="test" />
- <file name="phar_buildfromiterator7.phpt" role="test" />
- <file name="phar_buildfromiterator8.phpt" role="test" />
- <file name="phar_buildfromiterator9.phpt" role="test" />
- <file name="phar_commitwrite.phpt" role="test" />
- <file name="phar_convert_phar.phpt" role="test" />
- <file name="phar_convert_phar2.phpt" role="test" />
- <file name="phar_convert_phar3.phpt" role="test" />
- <file name="phar_convert_phar4.phpt" role="test" />
- <file name="phar_copy.phpt" role="test" />
- <file name="phar_magic.phpt" role="test" />
- <file name="phar_setalias.phpt" role="test" />
- <file name="phar_setalias2.phpt" role="test" />
- <file name="phar_setdefaultstub.phpt" role="test" />
- <file name="phar_setsignaturealgo2.phpt" role="test" />
- <file name="phar_stub.phpt" role="test" />
- <file name="phar_stub_error.phpt" role="test" />
- <file name="refcount1.phpt" role="test" />
- <file name="refcount1_5_2.phpt" role="test" />
- <file name="rename.phpt" role="test" />
- <file name="rename_dir.phpt" role="test" />
- <file name="require_hash.phpt" role="test" />
- <file name="rmdir.phpt" role="test" />
- <file name="tar_001.phpt" role="test" />
- <file name="tar_002.phpt" role="test" />
- <file name="tar_003.phpt" role="test" />
- <file name="tar_004.phpt" role="test" />
- <file name="tar_004U.phpt" role="test" />
- <file name="tar_bz2.phpt" role="test" />
- <file name="tar_bz2U.phpt" role="test" />
- <file name="tar_gzip.phpt" role="test" />
- <file name="tar_gzipU.phpt" role="test" />
- <file name="tar_makebz2.phpt" role="test" />
- <file name="tar_makegz.phpt" role="test" />
- <file name="tar_nohash.phpt" role="test" />
- <file name="tar_nostub.phpt" role="test" />
- <file name="tar_openssl_hash.phpt" role="test" />
- <file name="truncated.phpt" role="test" />
- </dir> <!-- /tests/tar -->
- <dir name="zip">
- <dir name="files">
- <file name="badalias1.phar.zip" role="test" />
- <file name="badalias2.phar.zip" role="test" />
- <file name="badalias3.phar.zip" role="test" />
- <file name="badalias4.phar.zip" role="test" />
- <file name="badalias5.phar.zip" role="test" />
- <file name="bz2_alias.phar.zip" role="test" />
- <file name="bzip2.zip" role="test" />
- <file name="cdir_offset.zip" role="test" />
- <file name="compress_unsup1.zip" role="test" />
- <file name="compress_unsup2.zip" role="test" />
- <file name="compress_unsup3.zip" role="test" />
- <file name="compress_unsup4.zip" role="test" />
- <file name="compress_unsup5.zip" role="test" />
- <file name="compress_unsup6.zip" role="test" />
- <file name="compress_unsup7.zip" role="test" />
- <file name="compress_unsup9.zip" role="test" />
- <file name="compress_unsup10.zip" role="test" />
- <file name="compress_unsup14.zip" role="test" />
- <file name="compress_unsup18.zip" role="test" />
- <file name="compress_unsup19.zip" role="test" />
- <file name="compress_unsup97.zip" role="test" />
- <file name="compress_unsup98.zip" role="test" />
- <file name="compress_unsupunknown.zip" role="test" />
- <file name="corrupt2.php.inc" role="test" />
- <file name="corrupt3.php.inc" role="test" />
- <file name="corrupt_count1.php.inc" role="test" />
- <file name="corrupt_zipmaker.php.inc" role="test" />
- <file name="count1.zip" role="test" />
- <file name="count2.zip" role="test" />
- <file name="disknumber.zip" role="test" />
- <file name="encrypted.zip" role="test" />
- <file name="extralen_toolong.zip" role="test" />
- <file name="filecomment.zip" role="test" />
- <file name="frontcontroller.phar.inc" role="test" />
- <file name="frontcontroller.phar.zip" role="test" />
- <file name="frontcontroller2.phar.inc" role="test" />
- <file name="frontcontroller2.phar.zip" role="test" />
- <file name="frontcontroller3.phar.inc" role="test" />
- <file name="frontcontroller3.phar.zip" role="test" />
- <file name="frontcontroller4.phar.inc" role="test" />
- <file name="frontcontroller4.phar.zip" role="test" />
- <file name="frontcontroller5.phar.inc" role="test" />
- <file name="frontcontroller5.phar.zip" role="test" />
- <file name="frontcontroller6.phar.inc" role="test" />
- <file name="frontcontroller6.phar.zip" role="test" />
- <file name="frontcontroller7.phar.inc" role="test" />
- <file name="frontcontroller7.phar.zip" role="test" />
- <file name="frontcontroller8.phar.inc" role="test" />
- <file name="frontcontroller8.phar.zip" role="test" />
- <file name="frontcontroller9.phar.inc" role="test" />
- <file name="frontcontroller9.phar.zip" role="test" />
- <file name="frontcontroller10.phar.inc" role="test" />
- <file name="frontcontroller10.phar.zip" role="test" />
- <file name="frontcontroller11.phar.inc" role="test" />
- <file name="frontcontroller11.phar.zip" role="test" />
- <file name="frontcontroller12.phar.inc" role="test" />
- <file name="frontcontroller12.phar.zip" role="test" />
- <file name="make_invalid_tar.php.inc" role="test" />
- <file name="metadata.phar.inc" role="test" />
- <file name="metadata.phar.zip" role="test" />
- <file name="nozipend.zip" role="test" />
- <file name="odt.odt" role="test" />
- <file name="stdin.zip" role="test" />
- <file name="test.odt" role="test" />
- <file name="truncfilename.zip" role="test" />
- <file name="zip.zip" role="test" />
- <file name="zipmaker.php.inc" role="test" />
- <file name="zlib_alias.phar.zip" role="test" />
- </dir> <!-- /tests/zip/files -->
- <file name="033.phpt" role="test" />
- <file name="033a.phpt" role="test" />
- <file name="alias_acrobatics.phpt" role="test" />
- <file name="all.phpt" role="test" />
- <file name="allU.phpt" role="test" />
- <file name="badalias.phpt" role="test" />
- <file name="bug48791.phpt" role="test" />
- <file name="bzip2.phpt" role="test" />
- <file name="corrupt_001.phpt" role="test" />
- <file name="corrupt_002.phpt" role="test" />
- <file name="corrupt_003.phpt" role="test" />
- <file name="corrupt_004.phpt" role="test" />
- <file name="corrupt_005.phpt" role="test" />
- <file name="corrupt_006.phpt" role="test" />
- <file name="corrupt_007.phpt" role="test" />
- <file name="corrupt_008.phpt" role="test" />
- <file name="corrupt_009.phpt" role="test" />
- <file name="corrupt_010.phpt" role="test" />
- <file name="create_new_and_modify.phpt" role="test" />
- <file name="create_new_phar_b.phpt" role="test" />
- <file name="delete.phpt" role="test" />
- <file name="delete_in_phar.phpt" role="test" />
- <file name="delete_in_phar_b.phpt" role="test" />
- <file name="delete_in_phar_confirm.phpt" role="test" />
- <file name="dir.phpt" role="test" />
- <file name="exists_as_phar.phpt" role="test" />
- <file name="frontcontroller1.phar.phpt" role="test" />
- <file name="frontcontroller2.phar.phpt" role="test" />
- <file name="frontcontroller3.phar.phpt" role="test" />
- <file name="frontcontroller4.phar.phpt" role="test" />
- <file name="frontcontroller5.phar.phpt" role="test" />
- <file name="frontcontroller6.phar.phpt" role="test" />
- <file name="frontcontroller7.phar.phpt" role="test" />
- <file name="frontcontroller8.phar.phpt" role="test" />
- <file name="frontcontroller9.phar.phpt" role="test" />
- <file name="frontcontroller10.phar.phpt" role="test" />
- <file name="frontcontroller11.phar.phpt" role="test" />
- <file name="frontcontroller12.phar.phpt" role="test" />
- <file name="frontcontroller13.phar.phpt" role="test" />
- <file name="frontcontroller14.phar.phpt" role="test" />
- <file name="frontcontroller15.phar.phpt" role="test" />
- <file name="frontcontroller16.phar.phpt" role="test" />
- <file name="frontcontroller17.phar.phpt" role="test" />
- <file name="frontcontroller18.phar.phpt" role="test" />
- <file name="frontcontroller19.phar.phpt" role="test" />
- <file name="frontcontroller20.phar.phpt" role="test" />
- <file name="frontcontroller21.phar.phpt" role="test" />
- <file name="getalias.phpt" role="test" />
- <file name="largezip.phpt" role="test" />
- <file name="metadata_write_commit.phpt" role="test" />
- <file name="metadata_write_commitU.phpt" role="test" />
- <file name="notphar.phpt" role="test" />
- <file name="odt.phpt" role="test" />
- <file name="open_for_write_existing.phpt" role="test" />
- <file name="open_for_write_existing_b.phpt" role="test" />
- <file name="open_for_write_existing_b_5_2.phpt" role="test" />
- <file name="open_for_write_existing_c.phpt" role="test" />
- <file name="open_for_write_existing_c_5_2.phpt" role="test" />
- <file name="open_for_write_newfile.phpt" role="test" />
- <file name="open_for_write_newfile_b.phpt" role="test" />
- <file name="open_for_write_newfile_b_5_2.phpt" role="test" />
- <file name="open_for_write_newfile_c.phpt" role="test" />
- <file name="open_for_write_newfile_c_5_2.phpt" role="test" />
- <file name="phar_begin_setstub_commit.phpt" role="test" />
- <file name="phar_begin_setstub_commitU.phpt" role="test" />
- <file name="phar_buildfromiterator4.phpt" role="test" />
- <file name="phar_buildfromiterator5.phpt" role="test" />
- <file name="phar_buildfromiterator6.phpt" role="test" />
- <file name="phar_buildfromiterator7.phpt" role="test" />
- <file name="phar_buildfromiterator8.phpt" role="test" />
- <file name="phar_buildfromiterator9.phpt" role="test" />
- <file name="phar_commitwrite.phpt" role="test" />
- <file name="phar_convert_phar.phpt" role="test" />
- <file name="phar_copy.phpt" role="test" />
- <file name="phar_magic.phpt" role="test" />
- <file name="phar_magicU.phpt" role="test" />
- <file name="phar_oo_compressallbz2.phpt" role="test" />
- <file name="phar_oo_compressallgz.phpt" role="test" />
- <file name="phar_setalias.phpt" role="test" />
- <file name="phar_setalias2.phpt" role="test" />
- <file name="phar_setdefaultstub.phpt" role="test" />
- <file name="phar_setsignaturealgo2.phpt" role="test" />
- <file name="phar_stub.phpt" role="test" />
- <file name="phar_stub_error.phpt" role="test" />
- <file name="refcount1.phpt" role="test" />
- <file name="refcount1_5_2.phpt" role="test" />
- <file name="rename.phpt" role="test" />
- <file name="rename_dir.phpt" role="test" />
- <file name="rmdir.phpt" role="test" />
- <file name="unixzip.phpt" role="test" />
- <file name="zlib.phpt" role="test" />
- </dir> <!-- /tests/zip -->
- <file name="001.phpt" role="test" />
- <file name="002.phpt" role="test" />
- <file name="003.phpt" role="test" />
- <file name="003a.phpt" role="test" />
- <file name="004.phpt" role="test" />
- <file name="005.phpt" role="test" />
- <file name="006.phpt" role="test" />
- <file name="007.phpt" role="test" />
- <file name="008.phpt" role="test" />
- <file name="009.phpt" role="test" />
- <file name="010.phpt" role="test" />
- <file name="011.phpt" role="test" />
- <file name="012.phpt" role="test" />
- <file name="013.phpt" role="test" />
- <file name="014.phpt" role="test" />
- <file name="015.phpt" role="test" />
- <file name="015b.phpt" role="test" />
- <file name="016.phpt" role="test" />
- <file name="016b.phpt" role="test" />
- <file name="017.phpt" role="test" />
- <file name="017U.phpt" role="test" />
- <file name="018.phpt" role="test" />
- <file name="018U.phpt" role="test" />
- <file name="019.phpt" role="test" />
- <file name="019b.phpt" role="test" />
- <file name="019bU.phpt" role="test" />
- <file name="019c.phpt" role="test" />
- <file name="019cU.phpt" role="test" />
- <file name="020.phpt" role="test" />
- <file name="021.phpt" role="test" />
- <file name="022.phpt" role="test" />
- <file name="023.phpt" role="test" />
- <file name="024.phpt" role="test" />
- <file name="025.phpt" role="test" />
- <file name="026.phpt" role="test" />
- <file name="027.phpt" role="test" />
- <file name="027U.phpt" role="test" />
- <file name="028.phpt" role="test" />
- <file name="029.phpt" role="test" />
- <file name="030.phpt" role="test" />
- <file name="031.phpt" role="test" />
- <file name="032.phpt" role="test" />
- <file name="033.phpt" role="test" />
- <file name="033a.phpt" role="test" />
- <file name="addfuncs.phpt" role="test" />
- <file name="alias_acrobatics.phpt" role="test" />
- <file name="badparameters.phpt" role="test" />
- <file name="bug13727.phpt" role="test" />
- <file name="bug13786.phpt" role="test" />
- <file name="bug45218_SLOWTEST.phpt" role="test" />
- <file name="bug45218_SLOWTESTU.phpt" role="test" />
- <file name="bug46032.phpt" role="test" />
- <file name="bug46060.phpt" role="test" />
- <file name="bug46178.phpt" role="test" />
- <file name="bug47085.phpt" role="test" />
- <file name="bug48377.2.phpt" role="test" />
- <file name="bug48377.phpt" role="test" />
- <file name="cached_manifest_1.phpt" role="test" />
- <file name="cached_manifest_1U.phpt" role="test" />
- <file name="create_new_and_modify.phpt" role="test" />
- <file name="create_new_phar.phpt" role="test" />
- <file name="create_new_phar_b.phpt" role="test" />
- <file name="create_new_phar_c.phpt" role="test" />
- <file name="create_path_error.phpt" role="test" />
- <file name="delete.phpt" role="test" />
- <file name="delete_in_phar.phpt" role="test" />
- <file name="delete_in_phar_b.phpt" role="test" />
- <file name="delete_in_phar_confirm.phpt" role="test" />
- <file name="dir.phpt" role="test" />
- <file name="fgc_edgecases.phpt" role="test" />
- <file name="file_get_contents.phpt" role="test" />
- <file name="fopen.phpt" role="test" />
- <file name="fopen5.2.phpt" role="test" />
- <file name="fopen_edgecases.phpt" role="test" />
- <file name="fopen_edgecases2.phpt" role="test" />
- <file name="fopen_edgecases2U.phpt" role="test" />
- <file name="front.phar.phpt" role="test" />
- <file name="frontcontroller1.phpt" role="test" />
- <file name="frontcontroller2.phpt" role="test" />
- <file name="frontcontroller3.phpt" role="test" />
- <file name="frontcontroller4.phpt" role="test" />
- <file name="frontcontroller5.phpt" role="test" />
- <file name="frontcontroller6.phpt" role="test" />
- <file name="frontcontroller7.phpt" role="test" />
- <file name="frontcontroller8.phpt" role="test" />
- <file name="frontcontroller9.phpt" role="test" />
- <file name="frontcontroller10.phpt" role="test" />
- <file name="frontcontroller11.phpt" role="test" />
- <file name="frontcontroller12.phpt" role="test" />
- <file name="frontcontroller13.phpt" role="test" />
- <file name="frontcontroller14.phpt" role="test" />
- <file name="frontcontroller15.phpt" role="test" />
- <file name="frontcontroller16.phpt" role="test" />
- <file name="frontcontroller17.phpt" role="test" />
- <file name="frontcontroller18.phpt" role="test" />
- <file name="frontcontroller19.phpt" role="test" />
- <file name="frontcontroller20.phpt" role="test" />
- <file name="frontcontroller21.phpt" role="test" />
- <file name="frontcontroller22.phpt" role="test" />
- <file name="frontcontroller23.phpt" role="test" />
- <file name="frontcontroller24.phpt" role="test" />
- <file name="frontcontroller25.phpt" role="test" />
- <file name="frontcontroller26.phpt" role="test" />
- <file name="frontcontroller27.phpt" role="test" />
- <file name="frontcontroller28.phpt" role="test" />
- <file name="frontcontroller29.phpt" role="test" />
- <file name="frontcontroller30.phpt" role="test" />
- <file name="frontcontroller31.phpt" role="test" />
- <file name="frontcontroller32.phpt" role="test" />
- <file name="frontcontroller33.phpt" role="test" />
- <file name="frontcontroller34.phpt" role="test" />
- <file name="include_path.phpt" role="test" />
- <file name="include_path_advanced.phpt" role="test" />
- <file name="ini_set.phpt" role="test" />
- <file name="ini_set_off.phpt" role="test" />
- <file name="ini_set_offU.phpt" role="test" />
- <file name="invalid_alias.phpt" role="test" />
- <file name="invalid_setstubalias.phpt" role="test" />
- <file name="metadata_read.phpt" role="test" />
- <file name="metadata_readU.phpt" role="test" />
- <file name="metadata_write.phpt" role="test" />
- <file name="metadata_writeU.phpt" role="test" />
- <file name="metadata_write_commit.phpt" role="test" />
- <file name="metadata_write_commitU.phpt" role="test" />
- <file name="mkdir.phpt" role="test" />
- <file name="mounteddir.phpt" role="test" />
- <file name="mounteddirU.phpt" role="test" />
- <file name="nophar.phpt" role="test" />
- <file name="nophar_web.phpt" role="test" />
- <file name="opendir.phpt" role="test" />
- <file name="opendir_edgecases.phpt" role="test" />
- <file name="open_for_write_existing.phpt" role="test" />
- <file name="open_for_write_existing_b.phpt" role="test" />
- <file name="open_for_write_existing_b_5_2.phpt" role="test" />
- <file name="open_for_write_existing_c.phpt" role="test" />
- <file name="open_for_write_existing_c_5_2.phpt" role="test" />
- <file name="open_for_write_newfile.phpt" role="test" />
- <file name="open_for_write_newfile_b.phpt" role="test" />
- <file name="open_for_write_newfile_b_5_2.phpt" role="test" />
- <file name="open_for_write_newfile_c.phpt" role="test" />
- <file name="open_for_write_newfile_c_5_2.phpt" role="test" />
- <file name="pharfileinfo_chmod.phpt" role="test" />
- <file name="pharfileinfo_compression.phpt" role="test" />
- <file name="pharfileinfo_construct.phpt" role="test" />
- <file name="pharfileinfo_destruct.phpt" role="test" />
- <file name="pharfileinfo_getcrc32.phpt" role="test" />
- <file name="pharfileinfo_setmetadata.phpt" role="test" />
- <file name="phar_begin_setstub_commit.phpt" role="test" />
- <file name="phar_begin_setstub_commitU.phpt" role="test" />
- <file name="phar_buildfromdirectory1.phpt" role="test" />
- <file name="phar_buildfromdirectory2.phpt" role="test" />
- <file name="phar_buildfromdirectory3.phpt" role="test" />
- <file name="phar_buildfromdirectory4.phpt" role="test" />
- <file name="phar_buildfromdirectory5.phpt" role="test" />
- <file name="phar_buildfromdirectory6.phpt" role="test" />
- <file name="phar_buildfromiterator1.phpt" role="test" />
- <file name="phar_buildfromiterator2.phpt" role="test" />
- <file name="phar_buildfromiterator3.phpt" role="test" />
- <file name="phar_buildfromiterator4.phpt" role="test" />
- <file name="phar_buildfromiterator5.phpt" role="test" />
- <file name="phar_buildfromiterator6.phpt" role="test" />
- <file name="phar_buildfromiterator7.phpt" role="test" />
- <file name="phar_buildfromiterator8.phpt" role="test" />
- <file name="phar_buildfromiterator9.phpt" role="test" />
- <file name="phar_buildfromiterator10.phpt" role="test" />
- <file name="phar_bz2.phpt" role="test" />
- <file name="phar_commitwrite.phpt" role="test" />
- <file name="phar_construct_invalidurl.phpt" role="test" />
- <file name="phar_convert_again.phpt" role="test" />
- <file name="phar_convert_repeated.phpt" role="test" />
- <file name="phar_convert_repeated_b.phpt" role="test" />
- <file name="phar_convert_tar.phpt" role="test" />
- <file name="phar_convert_tar2.phpt" role="test" />
- <file name="phar_convert_tar3.phpt" role="test" />
- <file name="phar_convert_zip.phpt" role="test" />
- <file name="phar_copy.phpt" role="test" />
- <file name="phar_createdefaultstub.phpt" role="test" />
- <file name="phar_create_in_cwd.phpt" role="test" />
- <file name="phar_ctx_001.phpt" role="test" />
- <file name="phar_decompress.phpt" role="test" />
- <file name="phar_dir_iterate.phpt" role="test" />
- <file name="phar_dotted_path.phpt" role="test" />
- <file name="phar_extract.phpt" role="test" />
- <file name="phar_extract2.phpt" role="test" />
- <file name="phar_extract3.phpt" role="test" />
- <file name="phar_get_supportedcomp1.phpt" role="test" />
- <file name="phar_get_supportedcomp2.phpt" role="test" />
- <file name="phar_get_supportedcomp3.phpt" role="test" />
- <file name="phar_get_supportedcomp4.phpt" role="test" />
- <file name="phar_get_supported_signatures_001.phpt" role="test" />
- <file name="phar_get_supported_signatures_001a.phpt" role="test" />
- <file name="phar_get_supported_signatures_002.phpt" role="test" />
- <file name="phar_get_supported_signatures_002a.phpt" role="test" />
- <file name="phar_gobyebye.phpt" role="test" />
- <file name="phar_gzip.phpt" role="test" />
- <file name="phar_gzipU.phpt" role="test" />
- <file name="phar_isvalidpharfilename.phpt" role="test" />
- <file name="phar_magic.phpt" role="test" />
- <file name="phar_metadata_read.phpt" role="test" />
- <file name="phar_metadata_readU.phpt" role="test" />
- <file name="phar_metadata_write.phpt" role="test" />
- <file name="phar_metadata_writeU.phpt" role="test" />
- <file name="phar_mount.phpt" role="test" />
- <file name="phar_offset_check.phpt" role="test" />
- <file name="phar_offset_get_error.phpt" role="test" />
- <file name="phar_oo_001.phpt" role="test" />
- <file name="phar_oo_001U.phpt" role="test" />
- <file name="phar_oo_002.phpt" role="test" />
- <file name="phar_oo_002U.phpt" role="test" />
- <file name="phar_oo_003.phpt" role="test" />
- <file name="phar_oo_004.phpt" role="test" />
- <file name="phar_oo_004U.phpt" role="test" />
- <file name="phar_oo_005.phpt" role="test" />
- <file name="phar_oo_005U.phpt" role="test" />
- <file name="phar_oo_005_5.2.phpt" role="test" />
- <file name="phar_oo_006.phpt" role="test" />
- <file name="phar_oo_007.phpt" role="test" />
- <file name="phar_oo_008.phpt" role="test" />
- <file name="phar_oo_009.phpt" role="test" />
- <file name="phar_oo_010.phpt" role="test" />
- <file name="phar_oo_011.phpt" role="test" />
- <file name="phar_oo_011b.phpt" role="test" />
- <file name="phar_oo_012.phpt" role="test" />
- <file name="phar_oo_012b.phpt" role="test" />
- <file name="phar_oo_012_confirm.phpt" role="test" />
- <file name="phar_oo_compressallbz2.phpt" role="test" />
- <file name="phar_oo_compressallgz.phpt" role="test" />
- <file name="phar_oo_compressed_001.phpt" role="test" />
- <file name="phar_oo_compressed_001b.phpt" role="test" />
- <file name="phar_oo_compressed_002.phpt" role="test" />
- <file name="phar_oo_compressed_002b.phpt" role="test" />
- <file name="phar_oo_getcontents.phpt" role="test" />
- <file name="phar_oo_getcontentsgz.phpt" role="test" />
- <file name="phar_oo_getmodified.phpt" role="test" />
- <file name="phar_oo_iswriteable.phpt" role="test" />
- <file name="phar_oo_nosig.phpt" role="test" />
- <file name="phar_oo_uncompressall.phpt" role="test" />
- <file name="phar_running.phpt" role="test" />
- <file name="phar_setalias.phpt" role="test" />
- <file name="phar_setalias2.phpt" role="test" />
- <file name="phar_setdefaultstub.phpt" role="test" />
- <file name="phar_setsignaturealgo1.phpt" role="test" />
- <file name="phar_setsignaturealgo2.phpt" role="test" />
- <file name="phar_stub.phpt" role="test" />
- <file name="phar_stub_error.phpt" role="test" />
- <file name="phar_stub_write.phpt" role="test" />
- <file name="phar_stub_write_file.phpt" role="test" />
- <file name="phar_unlinkarchive.phpt" role="test" />
- <file name="phpinfo_001.phpt" role="test" />
- <file name="phpinfo_002.phpt" role="test" />
- <file name="phpinfo_003.phpt" role="test" />
- <file name="phpinfo_004.phpt" role="test" />
- <file name="readfile.phpt" role="test" />
- <file name="readfile_edgecases.phpt" role="test" />
- <file name="readfile_edgecasesU.phpt" role="test" />
- <file name="refcount1.phpt" role="test" />
- <file name="refcount1_5_2.phpt" role="test" />
- <file name="rename.phpt" role="test" />
- <file name="rename_dir.phpt" role="test" />
- <file name="rename_dir_and_mount.phpt" role="test" />
- <file name="rmdir.phpt" role="test" />
- <file name="security.phpt" role="test" />
- <file name="stat.phpt" role="test" />
- <file name="stat2.phpt" role="test" />
- <file name="stat2_5.3.phpt" role="test" />
- <file name="test_alias_unset.phpt" role="test" />
- <file name="test_signaturealgos.phpt" role="test" />
- <file name="test_unset.phpt" role="test" />
- <file name="webphar_compilefail.phpt" role="test" />
- <file name="withphar.phpt" role="test" />
- <file name="withphar_web.phpt" role="test" />
- <file name="zf_test.phpt" role="test" />
- </dir> <!-- /tests -->
- <file name="build_precommand.php" role="php" />
- <file name="config.m4" role="src" />
- <file name="config.w32" role="src" />
- <file name="CREDITS" role="doc" />
- <file name="dirstream.c" role="src" />
- <file name="dirstream.h" role="src" />
- <file name="func_interceptors.c" role="src" />
- <file name="func_interceptors.h" role="src" />
- <file name="gdbhelp" role="data" />
- <file name="LICENSE" role="doc" />
- <file name="Makefile.frag" role="src" />
- <file name="makestub.php" role="php" />
- <file name="phar.c" role="src" />
- <file name="pharzip.h" role="src" />
- <file name="phar_internal.h" role="src" />
- <file name="phar_object.c" role="src" />
- <file name="phar_path_check.c" role="src" />
- <file name="phar_path_check.re" role="src" />
- <file name="php_phar.h" role="src" />
- <file name="shortarc.php" role="php" />
- <file name="stream.c" role="src" />
- <file name="stream.h" role="src" />
- <file name="stub.h" role="src" />
- <file name="tar.c" role="src" />
- <file name="tar.h" role="src" />
- <file name="TODO" role="doc" />
- <file name="util.c" role="src" />
- <file name="zip.c" role="src" />
- </dir> <!-- / -->
- </contents>
- <dependencies>
- <required>
- <php>
- <min>5.2.1</min>
- </php>
- <pearinstaller>
- <min>1.4.3</min>
- </pearinstaller>
- </required>
- <optional>
- <package>
- <name>bz2</name>
- <channel>pecl.php.net</channel>
- <providesextension>bz2</providesextension>
- </package>
- <package>
- <name>hash</name>
- <channel>pecl.php.net</channel>
- <providesextension>hash</providesextension>
- </package>
- <extension>
- <name>spl</name>
- </extension>
- <extension>
- <name>zlib</name>
- </extension>
- </optional>
- </dependencies>
- <providesextension>phar</providesextension>
- <extsrcrelease />
- <changelog>
- <release>
- <version>
- <release>2.0.0</release>
- <api>1.1.1</api>
- </version>
- <stability>
- <release>beta</release>
- <api>beta</api>
- </stability>
- <date>2009-07-26</date>
- <license uri="http://www.php.net/license">PHP License</license>
- <notes>
-BC BREAKING RELEASE
- BC breaks:
- * Phar object Compression API is rewritten. Use Phar::compress() and decompress(),
- Phar::compressFiles()/decompressFiles() and PharFileInfo-&gt;compress()/decompress().
- * phar.extract_list and Phar::getExtractList() are removed
-
-Major feature functionality release
- * phar.cache_list allows web-based phar applications to run at equal or faster than
- their on-disk equivalent [Greg]
- * new default stub allows running of phar-based phars without phar extension [Greg/Steph]
- * add support for tar-based and zip-based phar archives [Greg]
- * add support for OpenSSL-based true signatures [Greg]
- * add support for signatures to tar-based phar archives [Greg]
- * add Phar::isFileFormat() [Greg]
- * add Phar::convertToExecutable(), Phar::convertToData() [Greg]
- * add Phar::compress() [Greg]
- * rename Phar::compressAllFiles() to compressFiles(), uncompressAllFiles() to
- decompressFiles() [Greg]
- * conversion to compressed or to other file formats automatically copies the archive
- to a new extension (i.e. &quot;.phar&quot; to &quot;.phar.tar&quot; or &quot;.tar&quot; to &quot;.tar.gz&quot;) [Steph]
- * add Phar::webPhar() for running a web-based application unmodified
- directly from a phar archive [Greg]
- * file functions (fopen-based and stat-based) can be instructed to only look for
- relative paths within a phar via Phar::interceptFileFuncs()
- * add PharData class to allow manipulation/creation of non-executable tar and zip archives. [Steph]
- non-executable tar/zip manipulation is allowed even when phar.readonly=1 [Greg]
- * paths with . and .. work (phar://blah.phar/a/../b.php =&gt; phar://blah.phar/b.php) [Greg]
- * add support for mkdir()/rmdir() and support for empty directories to phar file format [Greg]
- * add option to compress the entire phar file for phar/tar file format [Greg]
- * implement Phar::isCompressed() returning 0, Phar::GZ or Phar::BZ2 [Greg]
- * implement Phar::copy(string $from, string $to) [Greg]
- * implement Phar::running(), returns path or URL to currently executed phar
- * implement Phar::buildFromIterator(Iterator $it[, string $base_directory]) [Greg]
- * implement Phar::buildFromDirectory(string $base_directory[, string $regex]) [Steph]
- * implement Phar::mount() for mounting external paths or files to locations inside a phar [Greg]
- * add Phar::delete() [Greg]
- * implement Phar::unlinkArchive() [Greg]
-
-Security addition
- * aliases are validated so that they contain no directory separators as intended
- * on conversion to other formats, user-supplied aliases are validated
-
-Changes since 2.0.0RC2:
- fixed PHP Bug #49021: phar tar signature algorithm reports as Unknown (0) in
- getSignature() call
- fixed PHP Bug #49020: phar misinterprets ustar long filename standard
- fixed PHP Bug #49018: phar tar stores long filenames with prefix/name reversed
- fixed PHP Bug #48791: open office files always reported as corrupted
- fixed PHP Bug #48783: make install will fail saying phar file exists
- fixed PHP Bug #48740: PHAR install fails when INSTALL_ROOT is not the final install location
- fixed PHP Bug #48681: openssl signature verification for tar archives broken
- fixed PHP Bug #48377: error message unclear on converting phar with existing file
- fixed isset() on sub-directories (isset(&quot;blah&quot;) if file &quot;blah/foo.php&quot; exists)
-
- make phar work in PHP 6
-Changes since 2.0.0RC1:
- security vulnerability in handling of long tar filenames fixed
- fixed PECL Bug #14646: phar error message unclear with php stream wrappers
- fixed PECL Bug #16338: php_stream_copy_to_stream{,_ex}()
- fixed PHP Bug #48257: PharData throws an exception with non-phar tar
- fixed PHP Bug #47085: rename() returns true even if the file in PHAR does not exist
- fixed PHP Bug #46032: PharData::__construct() - wrong memory read
- fixed PHP Bug #46060: Phar::addEmptyDir() breaks
- fixed PHP Bug #45907: undefined reference to &apos;PHP_SHA512Init&apos;
- fixed PHP Bug #45726: PHP_Archive / Archive.php missing
-Changes since 2.0.0a2: many bugfixes, removal of phar.extract_list, compression API refactored,
- conversion API refactored
-Changes since 2.0.0b1: addition of phar.cache_list, many performance improvements and bugfixes
- implement OpenSSL asynchronous true package signing
- add support for package signing to tar-based archives
- require PHP 5.2.1+
- </notes>
- </release>
- <release>
- <version>
- <release>2.0.0RC2</release>
- <api>1.1.1</api>
- </version>
- <stability>
- <release>beta</release>
- <api>beta</api>
- </stability>
- <date>2009-06-04</date>
- <license uri="http://www.php.net/license">PHP License</license>
- <notes>
-BC BREAKING RELEASE
- BC breaks:
- * Phar object Compression API is rewritten. Use Phar::compress() and decompress(),
- Phar::compressFiles()/decompressFiles() and PharFileInfo-&gt;compress()/decompress().
- * phar.extract_list and Phar::getExtractList() are removed
-
-Major feature functionality release
- * phar.cache_list allows web-based phar applications to run at equal or faster than
- their on-disk equivalent [Greg]
- * new default stub allows running of phar-based phars without phar extension [Greg/Steph]
- * add support for tar-based and zip-based phar archives [Greg]
- * add support for OpenSSL-based true signatures [Greg]
- * add support for signatures to tar-based phar archives [Greg]
- * add Phar::isFileFormat() [Greg]
- * add Phar::convertToExecutable(), Phar::convertToData() [Greg]
- * add Phar::compress() [Greg]
- * rename Phar::compressAllFiles() to compressFiles(), uncompressAllFiles() to
- decompressFiles() [Greg]
- * conversion to compressed or to other file formats automatically copies the archive
- to a new extension (i.e. &quot;.phar&quot; to &quot;.phar.tar&quot; or &quot;.tar&quot; to &quot;.tar.gz&quot;) [Steph]
- * add Phar::webPhar() for running a web-based application unmodified
- directly from a phar archive [Greg]
- * file functions (fopen-based and stat-based) can be instructed to only look for
- relative paths within a phar via Phar::interceptFileFuncs()
- * add PharData class to allow manipulation/creation of non-executable tar and zip archives. [Steph]
- non-executable tar/zip manipulation is allowed even when phar.readonly=1 [Greg]
- * paths with . and .. work (phar://blah.phar/a/../b.php =&gt; phar://blah.phar/b.php) [Greg]
- * add support for mkdir()/rmdir() and support for empty directories to phar file format [Greg]
- * add option to compress the entire phar file for phar/tar file format [Greg]
- * implement Phar::isCompressed() returning 0, Phar::GZ or Phar::BZ2 [Greg]
- * implement Phar::copy(string $from, string $to) [Greg]
- * implement Phar::running(), returns path or URL to currently executed phar
- * implement Phar::buildFromIterator(Iterator $it[, string $base_directory]) [Greg]
- * implement Phar::buildFromDirectory(string $base_directory[, string $regex]) [Steph]
- * implement Phar::mount() for mounting external paths or files to locations inside a phar [Greg]
- * add Phar::delete() [Greg]
- * implement Phar::unlinkArchive() [Greg]
-
-Security addition
- * aliases are validated so that they contain no directory separators as intended
- * on conversion to other formats, user-supplied aliases are validated
-
-Changes since 2.0.0RC1:
- security vulnerability in handling of long tar filenames fixed
- fixed PECL Bug #14646: phar error message unclear with php stream wrappers
- fixed PECL Bug #16338: php_stream_copy_to_stream{,_ex}()
- fixed PHP Bug #48257: PharData throws an exception with non-phar tar
- fixed PHP Bug #47085: rename() returns true even if the file in PHAR does not exist
- fixed PHP Bug #46032: PharData::__construct() - wrong memory read
- fixed PHP Bug #46060: Phar::addEmptyDir() breaks
- fixed PHP Bug #45907: undefined reference to &apos;PHP_SHA512Init&apos;
- fixed PHP Bug #45726: PHP_Archive / Archive.php missing
-Changes since 2.0.0a2: many bugfixes, removal of phar.extract_list, compression API refactored,
- conversion API refactored
-Changes since 2.0.0b1: addition of phar.cache_list, many performance improvements and bugfixes
- implement OpenSSL asynchronous true package signing
- add support for package signing to tar-based archives
- require PHP 5.2.1+
- </notes>
- </release>
- <release>
- <version>
- <release>2.0.0RC1</release>
- <api>1.1.1</api>
- </version>
- <stability>
- <release>beta</release>
- <api>beta</api>
- </stability>
- <date>2008-08-31</date>
- <license uri="http://www.php.net/license">PHP License</license>
- <notes>
-BC BREAKING RELEASE
- BC breaks:
- * Phar object Compression API is rewritten. Use Phar::compress() and decompress(),
- Phar::compressFiles()/decompressFiles() and PharFileInfo-&gt;compress()/decompress().
- * phar.extract_list and Phar::getExtractList() are removed
-
-Major feature functionality release
- * phar.cache_list allows web-based phar applications to run at equal or faster than
- their on-disk equivalent [Greg]
- * new default stub allows running of phar-based phars without phar extension [Greg/Steph]
- * add support for tar-based and zip-based phar archives [Greg]
- * add support for OpenSSL-based true signatures [Greg]
- * add support for signatures to tar-based phar archives [Greg]
- * add Phar::isFileFormat() [Greg]
- * add Phar::convertToExecutable(), Phar::convertToData() [Greg]
- * add Phar::compress() [Greg]
- * rename Phar::compressAllFiles() to compressFiles(), uncompressAllFiles() to
- decompressFiles() [Greg]
- * conversion to compressed or to other file formats automatically copies the archive
- to a new extension (i.e. &quot;.phar&quot; to &quot;.phar.tar&quot; or &quot;.tar&quot; to &quot;.tar.gz&quot;) [Steph]
- * add Phar::webPhar() for running a web-based application unmodified
- directly from a phar archive [Greg]
- * file functions (fopen-based and stat-based) can be instructed to only look for
- relative paths within a phar via Phar::interceptFileFuncs()
- * add PharData class to allow manipulation/creation of non-executable tar and zip archives. [Steph]
- non-executable tar/zip manipulation is allowed even when phar.readonly=1 [Greg]
- * paths with . and .. work (phar://blah.phar/a/../b.php =&gt; phar://blah.phar/b.php) [Greg]
- * add support for mkdir()/rmdir() and support for empty directories to phar file format [Greg]
- * add option to compress the entire phar file for phar/tar file format [Greg]
- * implement Phar::isCompressed() returning 0, Phar::GZ or Phar::BZ2 [Greg]
- * implement Phar::copy(string $from, string $to) [Greg]
- * implement Phar::running(), returns path or URL to currently executed phar
- * implement Phar::buildFromIterator(Iterator $it[, string $base_directory]) [Greg]
- * implement Phar::buildFromDirectory(string $base_directory[, string $regex]) [Steph]
- * implement Phar::mount() for mounting external paths or files to locations inside a phar [Greg]
- * add Phar::delete() [Greg]
- * implement Phar::unlinkArchive() [Greg]
-
-Security addition
- * aliases are validated so that they contain no directory separators as intended
- * on conversion to other formats, user-supplied aliases are validated
-
-Changes since 2.0.0a2: many bugfixes, removal of phar.extract_list, compression API refactored,
- conversion API refactored
-Changes since 2.0.0b1: addition of phar.cache_list, many performance improvements and bugfixes
- implement OpenSSL asynchronous true package signing
- add support for package signing to tar-based archives
- require PHP 5.2.1+
- </notes>
- </release>
- <release>
- <version>
- <release>2.0.0b1</release>
- <api>1.1.1</api>
- </version>
- <stability>
- <release>beta</release>
- <api>beta</api>
- </stability>
- <date>2008-05-12</date>
- <license uri="http://www.php.net/license">PHP License</license>
- <notes>
-BC BREAKING RELEASE
- BC breaks:
- * Phar object Compression API is rewritten. Use Phar::compress() and decompress(),
- Phar::compressFiles()/decompressFiles() and PharFileInfo-&gt;compress()/decompress().
- * phar.extract_list and Phar::getExtractList() are removed
-
-Major feature functionality release
- * new default stub allows running of phar-based phars without phar extension [Greg/Steph]
- * add support for tar-based and zip-based phar archives [Greg]
- * add Phar::isFileFormat() [Greg]
- * add Phar::convertToExecutable(), Phar::convertToData() [Greg]
- * add Phar::compress() [Greg]
- * rename Phar::compressAllFiles() to compressFiles(), uncompressAllFiles() to
- decompressFiles() [Greg]
- * conversion to compressed or to other file formats automatically copies the archive
- to a new extension (i.e. &quot;.phar&quot; to &quot;.phar.tar&quot; or &quot;.tar&quot; to &quot;.tar.gz&quot;) [Steph]
- * add Phar::webPhar() for running a web-based application unmodified
- directly from a phar archive [Greg]
- * file functions (fopen-based and stat-based) can be instructed to only look for
- relative paths within a phar via Phar::interceptFileFuncs()
- * add PharData class to allow manipulation/creation of non-executable tar and zip archives. [Steph]
- non-executable tar/zip manipulation is allowed even when phar.readonly=1 [Greg]
- * paths with . and .. work (phar://blah.phar/a/../b.php =&gt; phar://blah.phar/b.php) [Greg]
- * add support for mkdir()/rmdir() and support for empty directories to phar file format [Greg]
- * add option to compress the entire phar file for phar/tar file format [Greg]
- * implement Phar::isCompressed() returning 0, Phar::GZ or Phar::BZ2 [Greg]
- * implement Phar::copy(string $from, string $to) [Greg]
- * implement Phar::running(), returns path or URL to currently executed phar
- * implement Phar::buildFromIterator(Iterator $it[, string $base_directory]) [Greg]
- * implement Phar::buildFromDirectory(string $base_directory[, string $regex]) [Steph]
- * implement Phar::mount() for mounting external paths or files to locations inside a phar [Greg]
- * add Phar::delete() [Greg]
- * implement Phar::unlinkArchive() [Greg]
-
-Security addition
- * aliases are validated so that they contain no directory separators as intended
- * on conversion to other formats, user-supplied aliases are validated
-
-Changes since 2.0.0a2: many bugfixes, removal of phar.extract_list, compression API refactored,
- conversion API refactored
- </notes>
- </release>
- <release>
- <version>
- <release>2.0.0a2</release>
- <api>1.1.1</api>
- </version>
- <stability>
- <release>alpha</release>
- <api>alpha</api>
- </stability>
- <date>2008-03-27</date>
- <license uri="http://www.php.net/license">PHP License</license>
- <notes>
-Major feature functionality release
- * new default stub allows running of phar-based phars without phar extension [Greg/Steph]
- * add support for tar-based and zip-based phar archives [Greg]
- * add Phar::isTar(), Phar::isZip(), and Phar::isPhar() [Greg]
- * add Phar::convertToTar(), Phar::convertToZip(), and Phar::convertToPhar() [Greg]
- * add Phar::compress() [Greg]
- * conversion to compressed or to other file formats automatically copies the archive
- to a new extension (i.e. &quot;.phar&quot; to &quot;.phar.tar&quot; or &quot;.tar&quot; to &quot;.tar.gz&quot;) [Steph]
- * add Phar::webPhar() for running a web-based application unmodified
- directly from a phar archive [Greg]
- * file functions (fopen-based and stat-based) can be instructed to only look for
- relative paths within a phar via Phar::interceptFileFuncs()
- * add PharData class to allow manipulation/creation of non-executable tar and zip archives. [Steph]
- non-executable tar/zip manipulation is allowed even when phar.readonly=1 [Greg]
- * paths with . and .. work (phar://blah.phar/a/../b.php =&gt; phar://blah.phar/b.php) [Greg]
- * add support for mkdir()/rmdir() and support for empty directories to phar file format [Greg]
- * add option to compress the entire phar file for phar/tar file format [Greg]
- * implement Phar::isCompressed() returning 0, Phar::GZ or Phar::BZ2 [Greg]
- * implement Phar::copy(string $from, string $to) [Greg]
- * implement Phar::buildFromIterator(Iterator $it[, string $base_directory]) [Greg]
- * implement Phar::mount() for mounting external paths or files to locations inside a phar [Greg]
- * add Phar::delete() [Greg]
-
-Changes since 2.0.0a1: fix build in PHP 5.2
- </notes>
- </release>
- <release>
- <version>
- <release>2.0.0a1</release>
- <api>1.1.1</api>
- </version>
- <stability>
- <release>alpha</release>
- <api>alpha</api>
- </stability>
- <date>2008-03-26</date>
- <license uri="http://www.php.net/license">PHP License</license>
- <notes>
-Major feature functionality release
- * new default stub allows running of phar-based phars without phar extension [Greg/Steph]
- * add support for tar-based and zip-based phar archives [Greg]
- * add Phar::isTar(), Phar::isZip(), and Phar::isPhar() [Greg]
- * add Phar::convertToTar(), Phar::convertToZip(), and Phar::convertToPhar() [Greg]
- * add Phar::compress() [Greg]
- * conversion to compressed or to other file formats automatically copies the archive
- to a new extension (i.e. &quot;.phar&quot; to &quot;.phar.tar&quot; or &quot;.tar&quot; to &quot;.tar.gz&quot;) [Steph]
- * add Phar::webPhar() for running a web-based application unmodified
- directly from a phar archive [Greg]
- * file functions (fopen-based and stat-based) can be instructed to only look for
- relative paths within a phar via Phar::interceptFileFuncs()
- * add PharData class to allow manipulation/creation of non-executable tar and zip archives. [Steph]
- non-executable tar/zip manipulation is allowed even when phar.readonly=1 [Greg]
- * paths with . and .. work (phar://blah.phar/a/../b.php =&gt; phar://blah.phar/b.php) [Greg]
- * add support for mkdir()/rmdir() and support for empty directories to phar file format [Greg]
- * add option to compress the entire phar file for phar/tar file format [Greg]
- * implement Phar::isCompressed() returning 0, Phar::GZ or Phar::BZ2 [Greg]
- * implement Phar::copy(string $from, string $to) [Greg]
- * implement Phar::buildFromIterator(Iterator $it[, string $base_directory]) [Greg]
- * implement Phar::mount() for mounting external paths or files to locations inside a phar [Greg]
- * add Phar::delete() [Greg]
- </notes>
- </release>
- <release>
- <version>
- <release>1.2.1</release>
- <api>1.1.0</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <date>2007-08-24</date>
- <license uri="http://www.php.net/license">PHP License</license>
- <notes>
-* add Phar::setAlias() [Greg]
-* fix too many open file handles issue [Greg]
-* fix rename [Greg]
-* add Phar::getAlias() [Marcus]
-* Made -a optional in pack subcommand of phar.phar [Marcus]
-* Fix issue with apache module and extracted archives [Marcus]
-* Send all error messages to stderr in phar.phar [Marcus]
-* Added new subcommands add and delete to phar.phar [Marcus]
-* Made Phar::loadPhar() and Phar::mapPhar() ignore extracted archives [Marcus]
-* Fix issue with compressed entries and uncompressing entries [Marcus]
-* Verify stubs before writing [Marcus]
-* Always use longest stub end to avoid issues with length field [Marcus]
- </notes>
- </release>
- <release>
- <version>
- <release>1.2.0</release>
- <api>1.1.0</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <date>2007-05-18</date>
- <license uri="http://www.php.net/license">PHP License</license>
- <notes>
-* add PharFileInfo::hasMetadata(), PharFileInfo::delMetadata() [Marcus]
-* add Phar::hasMetadata(), Phar::delMetadata() [Marcus]
-* fix Phar::CanWrite() [Marcus]
-* add preliminary phar command (phar.php) [Marcus]
-* add phar command (phar.phar) [Marcus]
-* list all available compression methods using Phar::getSupportedCompression() [Marcus]
-* remove RINIT [Marcus]
- </notes>
- </release>
- <release>
- <version>
- <release>1.1.0</release>
- <api>1.1.0</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <date>2007-04-12</date>
- <license uri="http://www.php.net/license">PHP License</license>
- <notes>
-* implement ability connect a phar file &apos;phar://whatever&apos; to a directory. That way all
- access to that phar archive are directed to the extracted directory. This
- allows to have the installed files and the archive keep the same includes.
- [Marcus]
-* implement SHA-2 (256, 512) support [Marcus]
-* implement setSignatureAlgorithm() and Phar::MD5 Phar::SHA1 Phar::SHA256 Phar::SHA512 Phar::PGP to
- choose the kind of signature to use (PGP falls back to SHA1) [Greg]
- </notes>
- </release>
- <release>
- <version>
- <release>1.0.1</release>
- <api>1.0.1</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <date>2007-03-28</date>
- <license uri="http://www.php.net/license">PHP License</license>
- <notes>
-* Fix return value of unlink() and rename() when used for phar archievs. [Marcus]
- </notes>
- </release>
- <release>
- <version>
- <release>1.0.0</release>
- <api>1.0.0</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <date>2007-03-26</date>
- <license uri="http://www.php.net/license">PHP License</license>
- <notes>
-*BACKWARDS COMPATIBILITY BREAK*
-Rename Phar-&gt;begin/isFlushingToPhar/commit to startBuffering/isBuffering/stopBuffering
-Note that isBuffering() returns the opposite value to isFlushingToPhar()
- </notes>
- </release>
- </changelog>
-</package>
diff --git a/ext/phar/phar.c b/ext/phar/phar.c
index 65ebce0f08..34ba5c692a 100644
--- a/ext/phar/phar.c
+++ b/ext/phar/phar.c
@@ -27,7 +27,7 @@
static void destroy_phar_data(zval *zv);
ZEND_DECLARE_MODULE_GLOBALS(phar)
-zend_string *(*phar_save_resolve_path)(const char *filename, int filename_len);
+zend_string *(*phar_save_resolve_path)(const char *filename, size_t filename_len);
/**
* set's phar->is_writeable based on the current INI value
@@ -2202,9 +2202,9 @@ int phar_split_fname(const char *filename, int filename_len, char **arch, int *a
ext_len = 0;
#ifdef PHP_WIN32
- save = filename;
+ save = (char *)filename;
filename = estrndup(filename, filename_len);
- phar_unixify_path_separators(filename, filename_len);
+ phar_unixify_path_separators((char *)filename, filename_len);
#endif
if (phar_detect_phar_fname_ext(filename, filename_len, &ext_str, &ext_len, executable, for_create, 0) == FAILURE) {
if (ext_len != -1) {
@@ -2218,7 +2218,7 @@ int phar_split_fname(const char *filename, int filename_len, char **arch, int *a
}
#ifdef PHP_WIN32
- efree(filename);
+ efree((char *)filename);
#endif
return FAILURE;
}
@@ -2243,7 +2243,7 @@ int phar_split_fname(const char *filename, int filename_len, char **arch, int *a
}
#ifdef PHP_WIN32
- efree(filename);
+ efree((char *)filename);
#endif
return SUCCESS;
@@ -3249,7 +3249,7 @@ static size_t phar_zend_stream_fsizer(void *handle) /* {{{ */
zend_op_array *(*phar_orig_compile_file)(zend_file_handle *file_handle, int type);
#define phar_orig_zend_open zend_stream_open_function
-static zend_string *phar_resolve_path(const char *filename, int filename_len)
+static zend_string *phar_resolve_path(const char *filename, size_t filename_len)
{
return phar_find_in_include_path((char *) filename, filename_len, NULL);
}
diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c
index c3102039f0..46423246dd 100644
--- a/ext/phar/phar_object.c
+++ b/ext/phar/phar_object.c
@@ -67,7 +67,7 @@ static void phar_mung_server_vars(char *fname, char *entry, int entry_len, char
if (NULL != (stuff = zend_hash_str_find(_SERVER, "PATH_INFO", sizeof("PATH_INFO")-1))) {
path_info = Z_STRVAL_P(stuff);
code = Z_STRLEN_P(stuff);
- if (code > entry_len && !memcmp(path_info, entry, entry_len)) {
+ if (code > (size_t)entry_len && !memcmp(path_info, entry, entry_len)) {
ZVAL_STR(&temp, Z_STR_P(stuff));
ZVAL_STRINGL(stuff, path_info + entry_len, request_uri_len);
zend_hash_str_update(_SERVER, "PHAR_PATH_INFO", sizeof("PHAR_PATH_INFO")-1, &temp);
@@ -4164,7 +4164,7 @@ PHP_METHOD(Phar, delMetadata)
}
/* }}} */
-static int phar_extract_file(zend_bool overwrite, phar_entry_info *entry, char *dest, int dest_len, char **error) /* {{{ */
+static int phar_extract_file(zend_bool overwrite, phar_entry_info *entry, char *dest, size_t dest_len, char **error) /* {{{ */
{
php_stream_statbuf ssb;
size_t len;
@@ -4206,13 +4206,13 @@ static int phar_extract_file(zend_bool overwrite, phar_entry_info *entry, char *
#ifdef PHP_WIN32
/* unixify the path back, otherwise non zip formats might be broken */
{
- int cnt = filename_len;
+ size_t cnt = 0;
do {
if ('\\' == filename[cnt]) {
filename[cnt] = '/';
}
- } while (cnt-- >= 0);
+ } while (cnt++ <= filename_len);
}
#endif
@@ -4433,7 +4433,7 @@ PHP_METHOD(Phar, extractTo)
zend_throw_exception_ex(phar_ce_PharException, 0,
"Phar Error: attempted to extract non-existent file \"%s\" from phar \"%s\"", Z_STRVAL_P(zval_file), phar_obj->archive->fname);
}
- if (FAILURE == phar_extract_file(overwrite, entry, pathto, (int)pathto_len, &error)) {
+ if (FAILURE == phar_extract_file(overwrite, entry, pathto, pathto_len, &error)) {
zend_throw_exception_ex(phar_ce_PharException, 0,
"Extraction from phar \"%s\" failed: %s", phar_obj->archive->fname, error);
efree(error);
@@ -4454,7 +4454,7 @@ PHP_METHOD(Phar, extractTo)
return;
}
- if (FAILURE == phar_extract_file(overwrite, entry, pathto, (int)pathto_len, &error)) {
+ if (FAILURE == phar_extract_file(overwrite, entry, pathto, pathto_len, &error)) {
zend_throw_exception_ex(phar_ce_PharException, 0,
"Extraction from phar \"%s\" failed: %s", phar_obj->archive->fname, error);
efree(error);
@@ -4470,7 +4470,7 @@ all_files:
}
ZEND_HASH_FOREACH_PTR(&phar->manifest, entry) {
- if (FAILURE == phar_extract_file(overwrite, entry, pathto, (int)pathto_len, &error)) {
+ if (FAILURE == phar_extract_file(overwrite, entry, pathto, pathto_len, &error)) {
zend_throw_exception_ex(phar_ce_PharException, 0,
"Extraction from phar \"%s\" failed: %s", phar->fname, error);
efree(error);
diff --git a/ext/phar/stream.c b/ext/phar/stream.c
index 97e1dc6b97..65eabd901b 100644
--- a/ext/phar/stream.c
+++ b/ext/phar/stream.c
@@ -84,19 +84,21 @@ php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const
return NULL;
}
resource = ecalloc(1, sizeof(php_url));
- resource->scheme = estrndup("phar", 4);
- resource->host = arch;
+ resource->scheme = zend_string_init("phar", 4, 0);
+ resource->host = zend_string_init(arch, arch_len, 0);
+ efree(arch);
+ resource->path = zend_string_init(entry, entry_len, 0);
+ efree(entry);
- resource->path = entry;
#if MBO_0
if (resource) {
fprintf(stderr, "Alias: %s\n", alias);
- fprintf(stderr, "Scheme: %s\n", resource->scheme);
+ fprintf(stderr, "Scheme: %s\n", ZSTR_VAL(resource->scheme));
/* fprintf(stderr, "User: %s\n", resource->user);*/
/* fprintf(stderr, "Pass: %s\n", resource->pass ? "***" : NULL);*/
- fprintf(stderr, "Host: %s\n", resource->host);
+ fprintf(stderr, "Host: %s\n", ZSTR_VAL(resource->host));
/* fprintf(stderr, "Port: %d\n", resource->port);*/
- fprintf(stderr, "Path: %s\n", resource->path);
+ fprintf(stderr, "Path: %s\n", ZSTR_VAL(resource->path));
/* fprintf(stderr, "Query: %s\n", resource->query);*/
/* fprintf(stderr, "Fragment: %s\n", resource->fragment);*/
}
@@ -104,7 +106,7 @@ php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const
if (mode[0] == 'w' || (mode[0] == 'r' && mode[1] == '+')) {
phar_archive_data *pphar = NULL, *phar;
- if (PHAR_G(request_init) && PHAR_G(phar_fname_map.u.flags) && NULL == (pphar = zend_hash_str_find_ptr(&(PHAR_G(phar_fname_map)), arch, arch_len))) {
+ if (PHAR_G(request_init) && PHAR_G(phar_fname_map.u.flags) && NULL == (pphar = zend_hash_find_ptr(&(PHAR_G(phar_fname_map)), resource->host))) {
pphar = NULL;
}
if (PHAR_G(readonly) && (!pphar || !pphar->is_data)) {
@@ -114,7 +116,7 @@ php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const
php_url_free(resource);
return NULL;
}
- if (phar_open_or_create_filename(resource->host, arch_len, NULL, 0, 0, options, &phar, &error) == FAILURE)
+ if (phar_open_or_create_filename(ZSTR_VAL(resource->host), ZSTR_LEN(resource->host), NULL, 0, 0, options, &phar, &error) == FAILURE)
{
if (error) {
if (!(options & PHP_STREAM_URL_STAT_QUIET)) {
@@ -127,7 +129,7 @@ php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const
}
if (phar->is_persistent && FAILURE == phar_copy_on_write(&phar)) {
if (error) {
- spprintf(&error, 0, "Cannot open cached phar '%s' as writeable, copy on write failed", resource->host);
+ spprintf(&error, 0, "Cannot open cached phar '%s' as writeable, copy on write failed", ZSTR_VAL(resource->host));
if (!(options & PHP_STREAM_URL_STAT_QUIET)) {
php_stream_wrapper_log_error(wrapper, options, "%s", error);
}
@@ -137,7 +139,7 @@ php_url* phar_parse_url(php_stream_wrapper *wrapper, const char *filename, const
return NULL;
}
} else {
- if (phar_open_from_filename(resource->host, arch_len, NULL, 0, options, NULL, &error) == FAILURE)
+ if (phar_open_from_filename(ZSTR_VAL(resource->host), ZSTR_LEN(resource->host), NULL, 0, options, NULL, &error) == FAILURE)
{
if (error) {
if (!(options & PHP_STREAM_URL_STAT_QUIET)) {
@@ -179,24 +181,24 @@ static php_stream * phar_wrapper_open_url(php_stream_wrapper *wrapper, const cha
return NULL;
}
- if (strcasecmp("phar", resource->scheme)) {
+ if (!zend_string_equals_literal_ci(resource->scheme, "phar")) {
php_url_free(resource);
php_stream_wrapper_log_error(wrapper, options, "phar error: not a phar stream url \"%s\"", path);
return NULL;
}
- host_len = strlen(resource->host);
+ host_len = ZSTR_LEN(resource->host);
phar_request_initialize();
/* strip leading "/" */
- internal_file = estrdup(resource->path + 1);
+ internal_file = estrndup(ZSTR_VAL(resource->path) + 1, ZSTR_LEN(resource->path) - 1);
if (mode[0] == 'w' || (mode[0] == 'r' && mode[1] == '+')) {
- if (NULL == (idata = phar_get_or_create_entry_data(resource->host, host_len, internal_file, strlen(internal_file), mode, 0, &error, 1))) {
+ if (NULL == (idata = phar_get_or_create_entry_data(ZSTR_VAL(resource->host), host_len, internal_file, strlen(internal_file), mode, 0, &error, 1))) {
if (error) {
php_stream_wrapper_log_error(wrapper, options, "%s", error);
efree(error);
} else {
- php_stream_wrapper_log_error(wrapper, options, "phar error: file \"%s\" could not be created in phar \"%s\"", internal_file, resource->host);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: file \"%s\" could not be created in phar \"%s\"", internal_file, ZSTR_VAL(resource->host));
}
efree(internal_file);
php_url_free(resource);
@@ -239,14 +241,14 @@ static php_stream * phar_wrapper_open_url(php_stream_wrapper *wrapper, const cha
} else {
if (!*internal_file && (options & STREAM_OPEN_FOR_INCLUDE)) {
/* retrieve the stub */
- if (FAILURE == phar_get_archive(&phar, resource->host, host_len, NULL, 0, NULL)) {
- php_stream_wrapper_log_error(wrapper, options, "file %s is not a valid phar archive", resource->host);
+ if (FAILURE == phar_get_archive(&phar, ZSTR_VAL(resource->host), host_len, NULL, 0, NULL)) {
+ php_stream_wrapper_log_error(wrapper, options, "file %s is not a valid phar archive", ZSTR_VAL(resource->host));
efree(internal_file);
php_url_free(resource);
return NULL;
}
if (phar->is_tar || phar->is_zip) {
- if ((FAILURE == phar_get_entry_data(&idata, resource->host, host_len, ".phar/stub.php", sizeof(".phar/stub.php")-1, "r", 0, &error, 0)) || !idata) {
+ if ((FAILURE == phar_get_entry_data(&idata, ZSTR_VAL(resource->host), host_len, ".phar/stub.php", sizeof(".phar/stub.php")-1, "r", 0, &error, 0)) || !idata) {
goto idata_error;
}
efree(internal_file);
@@ -284,13 +286,13 @@ static php_stream * phar_wrapper_open_url(php_stream_wrapper *wrapper, const cha
}
}
/* read-only access is allowed to magic files in .phar directory */
- if ((FAILURE == phar_get_entry_data(&idata, resource->host, host_len, internal_file, strlen(internal_file), "r", 0, &error, 0)) || !idata) {
+ if ((FAILURE == phar_get_entry_data(&idata, ZSTR_VAL(resource->host), host_len, internal_file, strlen(internal_file), "r", 0, &error, 0)) || !idata) {
idata_error:
if (error) {
php_stream_wrapper_log_error(wrapper, options, "%s", error);
efree(error);
} else {
- php_stream_wrapper_log_error(wrapper, options, "phar error: \"%s\" is not a file in phar \"%s\"", internal_file, resource->host);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: \"%s\" is not a file in phar \"%s\"", internal_file, ZSTR_VAL(resource->host));
}
efree(internal_file);
php_url_free(resource);
@@ -569,17 +571,17 @@ static int phar_wrapper_stat(php_stream_wrapper *wrapper, const char *url, int f
return FAILURE;
}
- if (strcasecmp("phar", resource->scheme)) {
+ if (!zend_string_equals_literal_ci(resource->scheme, "phar")) {
php_url_free(resource);
return FAILURE;
}
- host_len = strlen(resource->host);
+ host_len = ZSTR_LEN(resource->host);
phar_request_initialize();
- internal_file = resource->path + 1; /* strip leading "/" */
+ internal_file = ZSTR_VAL(resource->path) + 1; /* strip leading "/" */
/* find the phar in our trusty global hash indexed by alias (host of phar://blah.phar/file.whatever) */
- if (FAILURE == phar_get_archive(&phar, resource->host, host_len, NULL, 0, &error)) {
+ if (FAILURE == phar_get_archive(&phar, ZSTR_VAL(resource->host), host_len, NULL, 0, &error)) {
php_url_free(resource);
if (error) {
efree(error);
@@ -679,16 +681,16 @@ static int phar_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int
return 0;
}
- if (strcasecmp("phar", resource->scheme)) {
+ if (!zend_string_equals_literal_ci(resource->scheme, "phar")) {
php_url_free(resource);
php_stream_wrapper_log_error(wrapper, options, "phar error: not a phar stream url \"%s\"", url);
return 0;
}
- host_len = strlen(resource->host);
+ host_len = ZSTR_LEN(resource->host);
phar_request_initialize();
- pphar = zend_hash_str_find_ptr(&(PHAR_G(phar_fname_map)), resource->host, host_len);
+ pphar = zend_hash_find_ptr(&(PHAR_G(phar_fname_map)), resource->host);
if (PHAR_G(readonly) && (!pphar || !pphar->is_data)) {
php_url_free(resource);
php_stream_wrapper_log_error(wrapper, options, "phar error: write operations disabled by the php.ini setting phar.readonly");
@@ -696,9 +698,9 @@ static int phar_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int
}
/* need to copy to strip leading "/", will get touched again */
- internal_file = estrdup(resource->path + 1);
- internal_file_len = strlen(internal_file);
- if (FAILURE == phar_get_entry_data(&idata, resource->host, host_len, internal_file, internal_file_len, "r", 0, &error, 1)) {
+ internal_file = estrndup(ZSTR_VAL(resource->path) + 1, ZSTR_LEN(resource->path) - 1);
+ internal_file_len = ZSTR_LEN(resource->path) - 1;
+ if (FAILURE == phar_get_entry_data(&idata, ZSTR_VAL(resource->host), host_len, internal_file, internal_file_len, "r", 0, &error, 1)) {
/* constraints of fp refcount were not met */
if (error) {
php_stream_wrapper_log_error(wrapper, options, "unlink of \"%s\" failed: %s", url, error);
@@ -715,7 +717,7 @@ static int phar_wrapper_unlink(php_stream_wrapper *wrapper, const char *url, int
}
if (idata->internal_file->fp_refcount > 1) {
/* more than just our fp resource is open for this file */
- php_stream_wrapper_log_error(wrapper, options, "phar error: \"%s\" in phar \"%s\", has open file pointers, cannot unlink", internal_file, resource->host);
+ php_stream_wrapper_log_error(wrapper, options, "phar error: \"%s\" in phar \"%s\", has open file pointers, cannot unlink", internal_file, ZSTR_VAL(resource->host));
efree(internal_file);
php_url_free(resource);
phar_entry_delref(idata);
@@ -748,7 +750,7 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": invalid or non-writable url \"%s\"", url_from, url_to, url_from);
return 0;
}
- if (SUCCESS != phar_get_archive(&pfrom, resource_from->host, strlen(resource_from->host), NULL, 0, &error)) {
+ if (SUCCESS != phar_get_archive(&pfrom, ZSTR_VAL(resource_from->host), ZSTR_LEN(resource_from->host), NULL, 0, &error)) {
pfrom = NULL;
if (error) {
efree(error);
@@ -765,7 +767,7 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": invalid or non-writable url \"%s\"", url_from, url_to, url_to);
return 0;
}
- if (SUCCESS != phar_get_archive(&pto, resource_to->host, strlen(resource_to->host), NULL, 0, &error)) {
+ if (SUCCESS != phar_get_archive(&pto, ZSTR_VAL(resource_to->host), ZSTR_LEN(resource_to->host), NULL, 0, &error)) {
if (error) {
efree(error);
}
@@ -777,7 +779,7 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
return 0;
}
- if (strcmp(resource_from->host, resource_to->host)) {
+ if (!zend_string_equals(resource_from->host, resource_to->host)) {
php_url_free(resource_from);
php_url_free(resource_to);
php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\", not within the same phar archive", url_from, url_to);
@@ -799,23 +801,23 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
return 0;
}
- if (strcasecmp("phar", resource_from->scheme)) {
+ if (!zend_string_equals_literal_ci(resource_from->scheme, "phar")) {
php_url_free(resource_from);
php_url_free(resource_to);
php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": not a phar stream url \"%s\"", url_from, url_to, url_from);
return 0;
}
- if (strcasecmp("phar", resource_to->scheme)) {
+ if (!zend_string_equals_literal_ci(resource_to->scheme, "phar")) {
php_url_free(resource_from);
php_url_free(resource_to);
php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": not a phar stream url \"%s\"", url_from, url_to, url_to);
return 0;
}
- host_len = strlen(resource_from->host);
+ host_len = ZSTR_LEN(resource_from->host);
- if (SUCCESS != phar_get_archive(&phar, resource_from->host, host_len, NULL, 0, &error)) {
+ if (SUCCESS != phar_get_archive(&phar, ZSTR_VAL(resource_from->host), host_len, NULL, 0, &error)) {
php_url_free(resource_from);
php_url_free(resource_to);
php_error_docref(NULL, E_WARNING, "phar error: cannot rename \"%s\" to \"%s\": %s", url_from, url_to, error);
@@ -830,7 +832,7 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
return 0;
}
- if (NULL != (entry = zend_hash_str_find_ptr(&(phar->manifest), resource_from->path+1, strlen(resource_from->path)-1))) {
+ if (NULL != (entry = zend_hash_str_find_ptr(&(phar->manifest), ZSTR_VAL(resource_from->path)+1, ZSTR_LEN(resource_from->path)-1))) {
phar_entry_info new, *source;
/* perform rename magic */
@@ -850,9 +852,9 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
source = entry;
/* add to the manifest, and then store the pointer to the new guy in entry */
- entry = zend_hash_str_add_mem(&(phar->manifest), resource_to->path+1, strlen(resource_to->path)-1, (void **)&new, sizeof(phar_entry_info));
+ entry = zend_hash_str_add_mem(&(phar->manifest), ZSTR_VAL(resource_to->path)+1, ZSTR_LEN(resource_to->path)-1, (void **)&new, sizeof(phar_entry_info));
- entry->filename = estrdup(resource_to->path+1);
+ entry->filename = estrndup(ZSTR_VAL(resource_to->path)+1, ZSTR_LEN(resource_to->path)-1);
if (FAILURE == phar_copy_entry_fp(source, entry, &error)) {
php_url_free(resource_from);
php_url_free(resource_to);
@@ -866,7 +868,7 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
entry->filename_len = strlen(entry->filename);
is_dir = entry->is_dir;
} else {
- is_dir = zend_hash_str_exists(&(phar->virtual_dirs), resource_from->path+1, strlen(resource_from->path)-1);
+ is_dir = zend_hash_str_exists(&(phar->virtual_dirs), ZSTR_VAL(resource_from->path)+1, ZSTR_LEN(resource_from->path)-1);
if (!is_dir) {
/* file does not exist */
php_url_free(resource_from);
@@ -882,19 +884,19 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
Bucket *b;
zend_string *str_key;
zend_string *new_str_key;
- uint32_t from_len = strlen(resource_from->path+1);
- uint32_t to_len = strlen(resource_to->path+1);
+ uint32_t from_len = ZSTR_LEN(resource_from->path) - 1;
+ uint32_t to_len = ZSTR_LEN(resource_to->path) - 1;
ZEND_HASH_FOREACH_BUCKET(&phar->manifest, b) {
str_key = b->key;
entry = Z_PTR(b->val);
if (!entry->is_deleted &&
ZSTR_LEN(str_key) > from_len &&
- memcmp(ZSTR_VAL(str_key), resource_from->path+1, from_len) == 0 &&
+ memcmp(ZSTR_VAL(str_key), ZSTR_VAL(resource_from->path)+1, from_len) == 0 &&
IS_SLASH(ZSTR_VAL(str_key)[from_len])) {
new_str_key = zend_string_alloc(ZSTR_LEN(str_key) + to_len - from_len, 0);
- memcpy(ZSTR_VAL(new_str_key), resource_to->path + 1, to_len);
+ memcpy(ZSTR_VAL(new_str_key), ZSTR_VAL(resource_to->path) + 1, to_len);
memcpy(ZSTR_VAL(new_str_key) + to_len, ZSTR_VAL(str_key) + from_len, ZSTR_LEN(str_key) - from_len);
ZSTR_VAL(new_str_key)[ZSTR_LEN(new_str_key)] = 0;
@@ -915,11 +917,11 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
ZEND_HASH_FOREACH_BUCKET(&phar->virtual_dirs, b) {
str_key = b->key;
if (ZSTR_LEN(str_key) >= from_len &&
- memcmp(ZSTR_VAL(str_key), resource_from->path+1, from_len) == 0 &&
+ memcmp(ZSTR_VAL(str_key), ZSTR_VAL(resource_from->path)+1, from_len) == 0 &&
(ZSTR_LEN(str_key) == from_len || IS_SLASH(ZSTR_VAL(str_key)[from_len]))) {
new_str_key = zend_string_alloc(ZSTR_LEN(str_key) + to_len - from_len, 0);
- memcpy(ZSTR_VAL(new_str_key), resource_to->path + 1, to_len);
+ memcpy(ZSTR_VAL(new_str_key), ZSTR_VAL(resource_to->path) + 1, to_len);
memcpy(ZSTR_VAL(new_str_key) + to_len, ZSTR_VAL(str_key) + from_len, ZSTR_LEN(str_key) - from_len);
ZSTR_VAL(new_str_key)[ZSTR_LEN(new_str_key)] = 0;
@@ -933,11 +935,11 @@ static int phar_wrapper_rename(php_stream_wrapper *wrapper, const char *url_from
ZEND_HASH_FOREACH_BUCKET(&phar->mounted_dirs, b) {
str_key = b->key;
if (ZSTR_LEN(str_key) >= from_len &&
- memcmp(ZSTR_VAL(str_key), resource_from->path+1, from_len) == 0 &&
+ memcmp(ZSTR_VAL(str_key), ZSTR_VAL(resource_from->path)+1, from_len) == 0 &&
(ZSTR_LEN(str_key) == from_len || IS_SLASH(ZSTR_VAL(str_key)[from_len]))) {
new_str_key = zend_string_alloc(ZSTR_LEN(str_key) + to_len - from_len, 0);
- memcpy(ZSTR_VAL(new_str_key), resource_to->path + 1, to_len);
+ memcpy(ZSTR_VAL(new_str_key), ZSTR_VAL(resource_to->path) + 1, to_len);
memcpy(ZSTR_VAL(new_str_key) + to_len, ZSTR_VAL(str_key) + from_len, ZSTR_LEN(str_key) - from_len);
ZSTR_VAL(new_str_key)[ZSTR_LEN(new_str_key)] = 0;
diff --git a/ext/phar/zip.c b/ext/phar/zip.c
index 08417bc07b..573de4f25d 100644
--- a/ext/phar/zip.c
+++ b/ext/phar/zip.c
@@ -167,7 +167,7 @@ int phar_parse_zipfile(php_stream *fp, char *fname, int fname_len, char *alias,
{
phar_zip_dir_end locator;
char buf[sizeof(locator) + 65536];
- size_t size;
+ zend_off_t size;
uint16_t i;
phar_archive_data *mydata = NULL;
phar_entry_info entry = {0};
@@ -199,7 +199,7 @@ int phar_parse_zipfile(php_stream *fp, char *fname, int fname_len, char *alias,
}
while ((p=(char *) memchr(p + 1, 'P', (size_t) (size - (p + 1 - buf)))) != NULL) {
- if ((p - buf) + sizeof(locator) <= size && !memcmp(p + 1, "K\5\6", 3)) {
+ if ((p - buf) + sizeof(locator) <= (size_t)size && !memcmp(p + 1, "K\5\6", 3)) {
memcpy((void *)&locator, (void *) p, sizeof(locator));
if (PHAR_GET_16(locator.centraldisk) != 0 || PHAR_GET_16(locator.disknumber) != 0) {
/* split archives not handled */
diff --git a/ext/posix/package.xml b/ext/posix/package.xml
deleted file mode 100644
index 231c5bee20..0000000000
--- a/ext/posix/package.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>pcntl</name>
- <summary>Process control functions</summary>
- <maintainers>
- <maintainer>
- <user>???</user>
- <name>Jason Greene</name>
- <email>jason@inetgurus.net</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <description>
-Process Control support in PHP implements the Unix style
-of process creation, program execution, signal handling
-and process termination. Process Control should not be
-enabled within a webserver environment and unexpected
-results may happen if any Process Control functions
-are used within a webserver environment.
- </description>
- <license>PHP</license>
- <release>
- <state>beta</state>
- <version>5.0.0rc1</version>
- <date>2004-03-19</date>
- <notes>
-package.xml added to support installation using pear installer
- </notes>
- <filelist>
- <file role="doc" name="CREDITS"/>
- <file role="doc" name="README"/>
- <file role="src" name="config.m4"/>
- <file role="src" name="pcntl.c"/>
- <file role="src" name="php_pcntl.h"/>
- <file role="src" name="php_signal.c"/>
- <file role="src" name="php_signal.h"/>
- <file role="test" name="test-pcntl.php"/>
- <file role="test" name="tests/001.phpt"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5" />
- <!-- doesn't work yet <dep type="os" rel="has" name="unix"/> -->
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/readline/tests/readline_read_history_open_basedir_001.phpt b/ext/readline/tests/readline_read_history_open_basedir_001.phpt
new file mode 100644
index 0000000000..6b8ecce3a9
--- /dev/null
+++ b/ext/readline/tests/readline_read_history_open_basedir_001.phpt
@@ -0,0 +1,17 @@
+--TEST--
+readline_read_history(): Test that open_basedir is respected
+--SKIPIF--
+<?php if (!extension_loaded("readline") || !function_exists('readline_read_history')) die("skip"); ?>
+--INI--
+open_basedir=/tmp/some-sandbox
+--FILE--
+<?php
+
+$name = '/tmp/out-of-sandbox';
+
+var_dump(readline_read_history($name));
+
+?>
+--EXPECTF--
+Warning: readline_read_history(): open_basedir restriction in effect. File(/tmp/out-of-sandbox) is not within the allowed path(s): (/tmp/some-sandbox) in %s on line %d
+bool(false) \ No newline at end of file
diff --git a/ext/readline/tests/readline_write_history_open_basedir_001.phpt b/ext/readline/tests/readline_write_history_open_basedir_001.phpt
new file mode 100644
index 0000000000..bd7880bb9b
--- /dev/null
+++ b/ext/readline/tests/readline_write_history_open_basedir_001.phpt
@@ -0,0 +1,17 @@
+--TEST--
+readline_write_history(): Test that open_basedir is respected
+--SKIPIF--
+<?php if (!extension_loaded("readline") || !function_exists('readline_write_history')) die("skip"); ?>
+--INI--
+open_basedir=/tmp/some-sandbox
+--FILE--
+<?php
+
+$name = '/tmp/out-of-sandbox';
+
+var_dump(readline_write_history($name));
+
+?>
+--EXPECTF--
+Warning: readline_write_history(): open_basedir restriction in effect. File(/tmp/out-of-sandbox) is not within the allowed path(s): (/tmp/some-sandbox) in %s on line %d
+bool(false) \ No newline at end of file
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index a87ecddae4..6a19940686 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -214,7 +214,7 @@ static void _fix_closure_prototype(zend_function *fptr) /* {{{ */
{
/* Actually we are setting proxy function's prototype to null
* as for it, the prototype is an object not a function
- * which could cause serias problems, see #74949 */
+ * which could cause serious problems, see #74949 */
fptr->common.prototype = NULL;
}
/* }}} */
@@ -649,7 +649,7 @@ static void _parameter_string(smart_str *str, zend_function *fptr, struct _zend_
zval zv;
smart_str_appends(str, " = ");
- ZVAL_DUP(&zv, RT_CONSTANT(&fptr->op_array, precv->op2));
+ ZVAL_DUP(&zv, RT_CONSTANT(precv, precv->op2));
if (UNEXPECTED(zval_update_constant_ex(&zv, fptr->common.scope) == FAILURE)) {
zval_ptr_dtor(&zv);
return;
@@ -2805,8 +2805,8 @@ ZEND_METHOD(reflection_parameter, getDefaultValue)
return;
}
- ZVAL_DUP(return_value, RT_CONSTANT(&param->fptr->op_array, precv->op2));
- if (Z_CONSTANT_P(return_value)) {
+ ZVAL_DUP(return_value, RT_CONSTANT(precv, precv->op2));
+ if (Z_TYPE_P(return_value) == IS_CONSTANT_AST) {
zval_update_constant_ex(return_value, param->fptr->common.scope);
}
}
@@ -2829,8 +2829,13 @@ ZEND_METHOD(reflection_parameter, isDefaultValueConstant)
}
precv = _reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAM_PASSTHRU, param);
- if (precv && Z_TYPE_P(RT_CONSTANT(&param->fptr->op_array, precv->op2)) == IS_CONSTANT) {
- RETURN_TRUE;
+ if (precv && Z_TYPE_P(RT_CONSTANT(precv, precv->op2)) == IS_CONSTANT_AST) {
+ zend_ast *ast = Z_ASTVAL_P(RT_CONSTANT(precv, precv->op2));
+
+ if (ast->kind == ZEND_AST_CONSTANT
+ || ast->kind == ZEND_AST_CONSTANT_CLASS) {
+ RETURN_TRUE;
+ }
}
RETURN_FALSE;
@@ -2854,8 +2859,14 @@ ZEND_METHOD(reflection_parameter, getDefaultValueConstantName)
}
precv = _reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAM_PASSTHRU, param);
- if (precv && Z_TYPE_P(RT_CONSTANT(&param->fptr->op_array, precv->op2)) == IS_CONSTANT) {
- RETURN_STR_COPY(Z_STR_P(RT_CONSTANT(&param->fptr->op_array, precv->op2)));
+ if (precv && Z_TYPE_P(RT_CONSTANT(precv, precv->op2)) == IS_CONSTANT_AST) {
+ zend_ast *ast = Z_ASTVAL_P(RT_CONSTANT(precv, precv->op2));
+
+ if (ast->kind == ZEND_AST_CONSTANT) {
+ RETURN_STR_COPY(zend_ast_get_constant_name(ast));
+ } else if (ast->kind == ZEND_AST_CONSTANT_CLASS) {
+ RETURN_STRINGL("__CLASS__", sizeof("__CLASS__")-1);
+ }
}
}
/* }}} */
@@ -3698,7 +3709,7 @@ ZEND_METHOD(reflection_class_constant, getValue)
GET_REFLECTION_OBJECT_PTR(ref);
ZVAL_DUP(return_value, &ref->value);
- if (Z_CONSTANT_P(return_value)) {
+ if (Z_TYPE_P(return_value) == IS_CONSTANT_AST) {
zval_update_constant_ex(return_value, ref->ce);
}
}
@@ -3834,7 +3845,7 @@ static void add_class_vars(zend_class_entry *ce, int statics, zval *return_value
/* this is necessary to make it able to work with default array
* properties, returned to user */
- if (Z_CONSTANT(prop_copy)) {
+ if (Z_TYPE(prop_copy) == IS_CONSTANT_AST) {
if (UNEXPECTED(zval_update_constant_ex(&prop_copy, NULL) != SUCCESS)) {
return;
}
diff --git a/ext/session/package.xml b/ext/session/package.xml
deleted file mode 100644
index 03fcbf66da..0000000000
--- a/ext/session/package.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>session</name>
- <summary>Session handling functions</summary>
- <maintainers>
- <maintainer>
- <user>sascha</user>
- <name>Sascha Schumann</name>
- <email>sas@php.net</email>
- <role>lead</role>
- </maintainer>
- <maintainer>
- <user>andrei</user>
- <name>Andrei Zmievski</name>
- <email>andrei@php.net</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <description>
-Session support in PHP consists of a way to preserve certain data
-across subsequent accesses. This enables you to build more customized
-applications and increase the appeal of your web site.
- </description>
- <license>PHP</license>
- <release>
- <state>beta</state>
- <version>5.0.0rc1</version>
- <date>2004-03-19</date>
- <notes>
-package.xml added to support installation using pear installer
- </notes>
- <filelist>
- <file role="doc" name="CREDITS"/>
- <file role="src" name="config.m4"/>
- <file role="src" name="config.w32"/>
- <file role="src" name="mod_files.c"/>
- <file role="src" name="mod_files.h"/>
- <file role="src" name="mod_files.sh"/>
- <file role="src" name="mod_mm.c"/>
- <file role="src" name="mod_mm.h"/>
- <file role="src" name="mod_user.c"/>
- <file role="src" name="mod_user_class.c"/>
- <file role="src" name="mod_user.h"/>
- <file role="src" name="php_session.h"/>
- <file role="src" name="session.c"/>
- <file role="test" name="tests/001.phpt"/>
- <file role="test" name="tests/002.phpt"/>
- <file role="test" name="tests/bug25745.phpt"/>
- <file role="test" name="tests/001.phpt"/>
- <file role="test" name="tests/002.phpt"/>
- <file role="test" name="tests/003.phpt"/>
- <file role="test" name="tests/004.phpt"/>
- <file role="test" name="tests/005.phpt"/>
- <file role="test" name="tests/006.phpt"/>
- <file role="test" name="tests/007.phpt"/>
- <file role="test" name="tests/008-php4.2.3.phpt"/>
- <file role="test" name="tests/008.phpt"/>
- <file role="test" name="tests/009.phpt"/>
- <file role="test" name="tests/010.phpt"/>
- <file role="test" name="tests/011.phpt"/>
- <file role="test" name="tests/012.phpt"/>
- <file role="test" name="tests/013.phpt"/>
- <file role="test" name="tests/014.phpt"/>
- <file role="test" name="tests/015.phpt"/>
- <file role="test" name="tests/016.phpt"/>
- <file role="test" name="tests/017.phpt"/>
- <file role="test" name="tests/018.phpt"/>
- <file role="test" name="tests/019.phpt"/>
- <file role="test" name="tests/020.phpt"/>
- <file role="test" name="tests/021.phpt"/>
- <file role="test" name="tests/skipif.inc"/>
- <file role="test" name="tests/bug26862.phpt"/>
- <file role="test" name="tests/bug24592.phpt"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5" />
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/session/session.c b/ext/session/session.c
index 2ae78bdf06..a2642807ad 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -770,7 +770,7 @@ static PHP_INI_MH(OnUpdateLazyWrite) /* {{{ */
static PHP_INI_MH(OnUpdateRfc1867Freq) /* {{{ */
{
int tmp;
- tmp = zend_atoi(ZSTR_VAL(new_value), (int)ZSTR_LEN(new_value));
+ tmp = zend_atoi(ZSTR_VAL(new_value), ZSTR_LEN(new_value));
if(tmp < 0) {
php_error_docref(NULL, E_WARNING, "session.upload_progress.freq must be greater than or equal to zero");
return FAILURE;
@@ -2044,6 +2044,11 @@ static PHP_FUNCTION(session_id)
RETURN_FALSE;
}
+ if (name && PS(session_status) == php_session_active) {
+ php_error_docref(NULL, E_WARNING, "Cannot change session id when session is active");
+ RETURN_FALSE;
+ }
+
if (PS(id)) {
/* keep compatibility for "\0" characters ???
* see: ext/session/tests/session_id_error3.phpt */
diff --git a/ext/session/tests/session_id_error2.phpt b/ext/session/tests/session_id_error2.phpt
index 05284e797b..0d256564b6 100644
--- a/ext/session/tests/session_id_error2.phpt
+++ b/ext/session/tests/session_id_error2.phpt
@@ -7,20 +7,20 @@ Test session_id() function : error functionality
ob_start();
-/*
+/*
* Prototype : string session_id([string $id])
* Description : Get and/or set the current session id
- * Source code : ext/session/session.c
+ * Source code : ext/session/session.c
*/
echo "*** Testing session_id() : error functionality ***\n";
-var_dump(session_id());
-var_dump(session_start());
var_dump(session_id("test"));
var_dump(session_id());
var_dump(session_id("1234567890"));
var_dump(session_id());
+var_dump(session_start());
+var_dump(session_id("1234567890"));
var_dump(session_destroy());
var_dump(session_id());
@@ -30,12 +30,13 @@ ob_end_flush();
--EXPECTF--
*** Testing session_id() : error functionality ***
string(0) ""
-bool(true)
-string(%d) "%s"
string(4) "test"
string(4) "test"
string(10) "1234567890"
bool(true)
+
+Warning: session_id(): Cannot change session id when session is active in %s on line %d
+bool(false)
+bool(true)
string(0) ""
Done
-
diff --git a/ext/session/tests/session_id_error3.phpt b/ext/session/tests/session_id_error3.phpt
index fc291389d9..e6404eb70e 100644
--- a/ext/session/tests/session_id_error3.phpt
+++ b/ext/session/tests/session_id_error3.phpt
@@ -15,40 +15,40 @@ ob_start();
echo "*** Testing session_id() : error functionality ***\n";
-@session_start();
var_dump(session_id());
var_dump(session_id("!"));
var_dump(session_id());
+@session_start();
@session_destroy();
-@session_start();
var_dump(session_id());
var_dump(session_id("?><"));
var_dump(session_id());
+@session_start();
@session_destroy();
-@session_start();
var_dump(session_id());
-var_dump(session_id("£$%^&*()"));
+var_dump(session_id("\xa3$%^&*()"));
var_dump(session_id());
+@session_start();
@session_destroy();
-@session_start();
var_dump(session_id());
var_dump(session_id("\r\n"));
var_dump(session_id());
+@session_start();
@session_destroy();
-@session_start();
var_dump(session_id());
var_dump(session_id("\0"));
var_dump(session_id());
+@session_start();
@session_destroy();
-@session_start();
var_dump(session_id());
-var_dump(session_id("¬``@~:{>?><,./[]+--"));
+var_dump(session_id("\xac``@~:{>?><,./[]+--"));
var_dump(session_id());
+@session_start();
@session_destroy();
echo "Done";
@@ -56,24 +56,24 @@ ob_end_flush();
?>
--EXPECTF--
*** Testing session_id() : error functionality ***
-string(%d) "%s"
-string(%d) "%s"
+string(0) ""
+string(0) ""
string(1) "!"
-string(%d) "%s"
-string(%d) "%s"
+string(0) ""
+string(0) ""
string(3) "?><"
-string(%d) "%s"
-string(%d) "%s"
+string(0) ""
+string(0) ""
string(8) "£$%^&*()"
-string(%d) "%s"
-string(%d) "%s"
+string(0) ""
+string(0) ""
string(2) "
"
-string(%d) "%s"
-string(%d) "%s"
string(0) ""
-string(%d) "%s"
-string(%d) "%s"
+string(0) ""
+string(0) ""
+string(0) ""
+string(0) ""
string(19) "¬``@~:{>?><,./[]+--"
Done
diff --git a/ext/shmop/package.xml b/ext/shmop/package.xml
deleted file mode 100644
index 669da64bcf..0000000000
--- a/ext/shmop/package.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>shmop</name>
- <summary>Portable shared memory access</summary>
- <maintainers>
- <maintainer>
- <user>iliaa</user>
- <name>Ilia Alshanetsky</name>
- <email>ilia@prohost.org</email>
- <role>lead</role>
- </maintainer>
- <maintainer>
- <name>Slava Poliakov</name>
- <email>hackie@prohost.org</email>
- <role>developer</role>
- </maintainer>
- </maintainers>
- <description>
- Portable Shared Memory access
- </description>
- <license>PHP</license>
- <release>
- <state>stable</state>
- <version>5.0.0rc1</version>
- <date>2004-03-19</date>
- <notes>
-package.xml added to support installation using pear installer
- </notes>
- <filelist>
- <file role="doc" name="CREDITS"/>
- <file role="doc" name="README"/>
- <file role="src" name="config.m4"/>
- <file role="src" name="config.w32"/>
- <file role="src" name="shmop.c"/>
- <file role="src" name="php_shmop.h"/>
- <file role="test" name="tests/001.phpt"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5" />
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/shmop/package2.xml b/ext/shmop/package2.xml
deleted file mode 100644
index a8b00f371c..0000000000
--- a/ext/shmop/package2.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<package packagerversion="1.4.6" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
-http://pear.php.net/dtd/tasks-1.0.xsd
-http://pear.php.net/dtd/package-2.0
-http://pear.php.net/dtd/package-2.0.xsd">
- <name>shmop</name>
- <channel>pecl.php.net</channel>
- <summary>Portable shared memory access</summary>
- <description>Portable Shared Memory access
- </description>
- <lead>
- <name>Ilia Alshanetsky</name>
- <user>iliaa</user>
- <email>ilia@prohost.org</email>
- <active>yes</active>
- </lead>
- <date>2007-07-03</date>
- <time>19:58:51</time>
- <version>
- <release>5.0.0rc1</release>
- <api>5.0.0rc1</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <license uri="http://www.php.net/license">PHP</license>
- <notes>package.xml added to support installation using pear installer
-
- </notes>
- <contents>
- <dir name="/">
- <dir name="tests">
- <file name="001.phpt" role="test" />
- </dir> <!-- //tests -->
- <file name="config.m4" role="src" />
- <file name="config.w32" role="src" />
- <file name="CREDITS" role="doc" />
- <file name="php_shmop.h" role="src" />
- <file name="README" role="doc" />
- <file name="shmop.c" role="src" />
- </dir> <!-- / -->
- </contents>
- <dependencies>
- <required>
- <php>
- <min>5</min>
- </php>
- <pearinstaller>
- <min>1.4.0b1</min>
- </pearinstaller>
- </required>
- </dependencies>
- <providesextension>shmop</providesextension>
- <extsrcrelease />
-</package>
diff --git a/ext/simplexml/examples/book.php b/ext/simplexml/examples/book.php
deleted file mode 100644
index 0416df861b..0000000000
--- a/ext/simplexml/examples/book.php
+++ /dev/null
@@ -1,8 +0,0 @@
-<?php
-$books = simplexml_load_file('book.xml');
-//var_dump($books);
-$books = $books->book;
-foreach ($books as $book) {
- echo "{$book->title} was written by {$book->author}\n";
-}
-?>
diff --git a/ext/simplexml/examples/book.xml b/ext/simplexml/examples/book.xml
deleted file mode 100644
index ea40508e01..0000000000
--- a/ext/simplexml/examples/book.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<books>
- <book>
- <title>The Grapes of Wrath</title>
- <author>John Steinbeck</author>
- </book>
- <book>
- <title>The Pearl</title>
- <author>John Steinbeck</author>
- </book>
-</books>
diff --git a/ext/simplexml/examples/interop.php b/ext/simplexml/examples/interop.php
deleted file mode 100644
index 9e38ec1110..0000000000
--- a/ext/simplexml/examples/interop.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-$dom = new domDocument;
-$dom->load("book.xml");
-if(!$dom) {
- echo "Error while parsing the document\n";
- exit;
-}
-print "As SimpleXML\n";
-
-$s = simplexml_import_dom($dom);
-$books = $s->book;
-foreach ($books as $book) {
- echo "{$book->title} was written by {$book->author}\n";
-}
-
-print "As DOM \n";
-
-$dom = dom_import_simplexml($s);
-$books = $dom->getElementsByTagName("book");
-foreach ($books as $book) {
- $title = $book->getElementsByTagName("title");
- $author = $book->getElementsByTagName("author");
- echo $title[0]->firstChild->data . " was written by ". $author[0]->firstChild->data . "\n";
-}
-
-
-?>
diff --git a/ext/simplexml/examples/security.php b/ext/simplexml/examples/security.php
deleted file mode 100644
index 17897b3fd7..0000000000
--- a/ext/simplexml/examples/security.php
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
-$s = simplexml_load_file('security.xml');
-echo $s->id;
-$s->id = 20;
-$s->asXML('security.new.xml');
-?>
diff --git a/ext/simplexml/examples/security.xml b/ext/simplexml/examples/security.xml
deleted file mode 100644
index d954a02335..0000000000
--- a/ext/simplexml/examples/security.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0"?>
-<security>
- <id>15</id>
-</security>
diff --git a/ext/simplexml/examples/xpath.php b/ext/simplexml/examples/xpath.php
deleted file mode 100644
index 8fcd9878ab..0000000000
--- a/ext/simplexml/examples/xpath.php
+++ /dev/null
@@ -1,9 +0,0 @@
-<?php
-$books = simplexml_load_file('book.xml');
-
-$xpath_result = $books->xpath("/books/book/title");
-foreach($xpath_result as $entry ) {
- print "$entry \n";
-}
-
-?>
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index 0ec2c86f4a..92d180cf8b 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -1133,14 +1133,12 @@ static HashTable *sxe_get_prop_hash(zval *object, int is_debug) /* {{{ */
sxe = Z_SXEOBJ_P(object);
if (is_debug) {
- ALLOC_HASHTABLE(rv);
- zend_hash_init(rv, 0, NULL, ZVAL_PTR_DTOR, 0);
+ rv = zend_new_array(0);
} else if (sxe->properties) {
zend_hash_clean(sxe->properties);
rv = sxe->properties;
} else {
- ALLOC_HASHTABLE(rv);
- zend_hash_init(rv, 0, NULL, ZVAL_PTR_DTOR, 0);
+ rv = zend_new_array(0);
sxe->properties = rv;
}
diff --git a/ext/skeleton/CREDITS b/ext/skeleton/CREDITS
deleted file mode 100644
index 58fc71019a..0000000000
--- a/ext/skeleton/CREDITS
+++ /dev/null
@@ -1 +0,0 @@
-extname \ No newline at end of file
diff --git a/ext/skeleton/EXPERIMENTAL b/ext/skeleton/EXPERIMENTAL
deleted file mode 100644
index e69de29bb2..0000000000
--- a/ext/skeleton/EXPERIMENTAL
+++ /dev/null
diff --git a/ext/skeleton/config.m4.in b/ext/skeleton/config.m4.in
new file mode 100644
index 0000000000..fe2a1c48ed
--- /dev/null
+++ b/ext/skeleton/config.m4.in
@@ -0,0 +1,7 @@
+PHP_ARG_ENABLE(%EXTNAME%, whether to enable %EXTNAME% support,
+[ --enable-%EXTNAME% Enable %EXTNAME% support], no)
+
+if test "$PHP_%EXTNAMECAPS%" != "no"; then
+ AC_DEFINE(HAVE_%EXTNAMECAPS%, 1, [ Have %EXTNAME% support ])
+ PHP_NEW_EXTENSION(%EXTNAME%, %EXTNAME%.c, $ext_shared)
+fi
diff --git a/ext/skeleton/config.w32.in b/ext/skeleton/config.w32.in
new file mode 100644
index 0000000000..4159262496
--- /dev/null
+++ b/ext/skeleton/config.w32.in
@@ -0,0 +1,7 @@
+ARG_ENABLE('%EXTNAME%', '%EXTNAME% support', 'no');
+
+if (PHP_%EXTNAMECAPS% != 'no') {
+ AC_DEFINE('HAVE_%EXTNAMECAPS%', 1, '%EXTNAME% support enabled');
+
+ EXTENSION('%EXTNAME%', '%EXTNAME%.c', null, '/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');
+} \ No newline at end of file
diff --git a/ext/skeleton/create_stubs b/ext/skeleton/create_stubs
deleted file mode 100755
index fe79d6a29c..0000000000
--- a/ext/skeleton/create_stubs
+++ /dev/null
@@ -1,289 +0,0 @@
-#!/usr/bin/awk -f
-
-function gobble(s, x)
-{
- sub(/^ /, "", line)
- match(line, "^" "(" s ")")
- x = substr(line, 1, RLENGTH)
- line = substr(line, RLENGTH+1)
- return x
-}
-
-function convert(i, j, t)
-{
- type = argtypes[i,j]
- name = argnames[i,j]
- opt = optionals[i,j]
- tabs = x = ""
-
- for (i = 0; i < t; i++) { tabs = tabs "\t" }
-
- if (type == "int" || type == "long") {
- longs = longs "\tzend_long " name ";\n"
- } else if (type == "bool" || type == "boolean") {
- bools = bools "\tzend_bool " name ";\n"
- } else if (type == "double" || type == "float") {
- doubles = doubles "\tdouble " name ";\n"
- } else if (type == "string") {
- strings = strings "\tchar *" name " = NULL;\n"
- ints = ints "\tsize_t " name "_len;\n"
- } else if (type == "array" || type == "object" || type == "mixed") {
- zvals = zvals "\tzval *" name " = NULL;\n"
- } else if (type == "resource" || type == "handle") {
- zvals = zvals "\tzval *" name " = NULL;\n"
- resources = resources "\tif (" name ") {\n" \
- "\t\tZEND_FETCH_RESOURCE(???, ???, " name ", " name "_id, \"???\", ???_rsrc_id);\n\t}\n"
- ints = ints "\tint " name "_id = -1;\n"
- }
-}
-
-function comment(s)
-{
- if (i_know_what_to_do_shut_up_i_dont_need_your_help_mode) {
- return
- } else {
- return s
- }
-}
-
-BEGIN {
- name = "[_A-Za-z][_A-Za-z0-9]*"
- type = "int|long|double|float|string|bool|boolean|array|object|resource|handle|mixed|void"
- spec = "l|l|d|d|s|b|b|a|o|r|r|z|"
- num_funcs = 0
-
-# create a map from type name to the spec
- split(type, type_array, "\|")
- split(spec, spec_array, "\|")
- for (i in type_array) {
- spec_map[type_array[i]] = spec_array[i]
- }
-
- if (xml && xml != "yes") {
- xmldoc = xml
- } else {
- xmldoc = extname "/" extname ".xml"
- }
-
-
- xmlhead = "<?xml version='1.0' encoding='iso-8859-1'?>\n" \
- "<!-- $Id$ -->\n" \
- " <reference id=\"ref." extname "\">\n" \
- " <title> functions</title>\n" \
- " <titleabbrev></titleabbrev>\n\n" \
- " <partintro>\n" \
- " &warn.experimental;\n" \
- " <para>\n" \
- " </para>\n" \
- " </partintro>\n\n";
-
- xmlfoot = " </reference>\n\n" \
- "<!-- Keep this comment at the end of the file\n" \
- "Local variables:\n" \
- "mode: sgml\n" \
- "sgml-omittag:t\n" \
- "sgml-shorttag:t\n" \
- "sgml-minimize-attributes:nil\n" \
- "sgml-always-quote-attributes:t\n" \
- "sgml-indent-step:1\n" \
- "sgml-indent-data:t\n" \
- "indent-tabs-mode:nil\n" \
- "sgml-parent-document:nil\n" \
- "sgml-default-dtd-file:\"../../manual.ced\"\n" \
- "sgml-exposed-tags:nil\n" \
- "sgml-local-catalogs:nil\n" \
- "sgml-local-ecat-files:nil\n" \
- "End:\n" \
- "vim600: syn=xml fen fdm=syntax fdl=2 si\n" \
- "vim: et tw=78 syn=sgml\n" \
- "vi: ts=1 sw=1\n" \
- "-->\n"
-}
-
-{
- args_max = args_min = optional = i = spec_opt = 0
- line = $0
- spec_str = "\""
-
-## php extension must use lower case function names.
-## this will translate any capitalized letter to lowercase
-## and warn the user
- if (match(func_name,"[A-Z]") != 0) {
- printf("NOTICE: lower casing function name '%s'\n",func_name)
- func_name = tolower(func_name)
- }
- func_type = gobble(type);
- func_name = gobble(name);
-
- if (gobble("\\(")) {
- if (gobble("\\[")) optional = 1
- while (arg_type = gobble(type)) {
- arg_name = gobble(name)
- if(arg_type == "void") {
- args_max = 0;
- args_min = 0;
- break;
- } else {
- argtypes[num_funcs,args_max] = arg_type
- argnames[num_funcs,args_max] = arg_name
-
- args_max++
- if (optional) {
- if (!spec_opt) {
- spec_str = spec_str "|"
- spec_opt = 1
- }
- optionals[num_funcs,i] = optional
- } else {
- args_min++
- }
- spec_str = spec_str spec_map[arg_type]
-
- if (x = gobble("\\[")) {
- optional++
- }
-
- y = gobble(",")
- if (!x && y && optional) {
- grouped_optional_param[num_funcs,i] = 1
- }
- i++
- }
- }
- }
-
-# if (x = gobble("\\)")) {
- gobble("\\]* *\\)")
- sub(/^[ \t]+/, "", line)
- fcomments[num_funcs] = line
-# }
-
- spec_str = spec_str "\""
-
- funcs[num_funcs] = func_name
- types[num_funcs] = func_type
- maxargs[num_funcs] = args_max
- minargs[num_funcs] = args_min
- specs[num_funcs] = spec_str
- spec_opts[num_funcs] = spec_opt
-
- num_funcs++
-}
-
-END {
- if (xml) print xmlhead > xmldoc
- for (i = 0; i < num_funcs; i++) {
- compareargc = maxargs[i] - minargs[i]
- closefetch = fetchargs = zvals = xmlparams = funcvals = resources = handleargs = closeopts = ""
- ints = longs = doubles = strings = bools = zvals = ""
-
- proto = "/* {{{ proto " types[i] " " funcs[i] "("
-
- refid = funcs[i]
- gsub(/_/, "-", refid)
- xmlstr = " <refentry id=\"function." refid "\">\n" \
- " <refnamediv>\n" \
- " <refname>" funcs[i] "</refname>\n" \
- " <refpurpose>" fcomments[i] "</refpurpose>\n" \
- " </refnamediv>\n" \
- " <refsect1>\n" \
- " <title>Description</title>\n" \
- " <funcsynopsis>\n" \
- " <funcprototype>\n" \
- " <funcdef>" types[i] " <function>" funcs[i] "</function></funcdef>\n"
-
- if (maxargs[i]>0) {
- fetchargs = "\tif (zend_parse_parameters("
- ints = ints "\tint argc = ZEND_NUM_ARGS();\n"
- fetchargs = fetchargs "argc, " specs[i]
- } else {
- fetchargs = fetchargs "\tif (zend_parse_parameters_none() == FAILURE) {\n\t\treturn;\n\t}"
- xmlparams = xmlparams " <void/>\n"
- }
-
- for (j = 0; j < maxargs[i]; j++) {
-
- fetchargs = fetchargs ", "
-
- fetchargs = fetchargs "&" argnames[i,j]
- if (argtypes[i,j] == "string") {
- fetchargs = fetchargs ", &" argnames[i,j] "_len"
- }
-
- xmlparams = xmlparams " <paramdef>" argtypes[i,j]
- if (j > minargs[i]-1) {
- if (!grouped_optional_param[i,j-1]) {
- if (j > 0) proto = proto " "
- proto = proto "["
- closeopts = closeopts "]"
- }
- xmlparams = xmlparams "\n <parameter><optional>" \
- argnames[i,j] \
- "</optional></parameter>\n </paramdef>\n"
- } else {
- xmlparams = xmlparams \
- " <parameter>" \
- argnames[i,j] \
- "</parameter></paramdef>\n"
- }
-
- if (j > 0) proto = proto ", "
- proto = proto argtypes[i,j] " " argnames[i,j]
-
- convert(i, j, 1)
- }
-
- proto = proto closeopts ")\n " fcomments[i] " */\nPHP_FUNCTION(" funcs[i] ")\n{"
- if (maxargs[i]>0) {
- fetchargs = fetchargs ") == FAILURE)" closefetch " \n\t\treturn;\n"
- }
- funcvals = strings ints longs doubles bools zvals
- xmlstr = xmlstr xmlparams \
- " </funcprototype>\n" \
- " </funcsynopsis>\n" \
- " &warn.experimental.func;\n" \
- " <para>\n" \
- " &warn.undocumented.func;\n" \
- " </para>\n" \
- " </refsect1>\n" \
- " </refentry>\n"
-
- print proto > stubfile
- if (funcvals) print funcvals > stubfile
- if (fetchargs) print fetchargs > stubfile
- if (resources) {
- print resources > stubfile
- if (!stubs) print "" > ( extname "/function_warning" )
- }
- if (!i_know_what_to_do_shut_up_i_dont_need_your_help_mode) {
- print "\tphp_error(E_WARNING, \"" funcs[i] ": not yet implemented\");" > stubfile
- }
- print "}\n/* }}} */\n" > stubfile
-
- if (stubs) {
- h_stubs = h_stubs "PHP_FUNCTION(" funcs[i] ");\n"
- c_stubs = c_stubs "\tPHP_FE(" funcs[i] ",\tNULL)\n"
- } else {
- print "PHP_FUNCTION(" funcs[i] ");" > ( extname "/function_declarations" )
- print "\tPHP_FE(" funcs[i] ",\tNULL)" > ( extname "/function_entries" )
- }
-
- if (xml) print xmlstr > xmldoc
- }
-
- if (stubs) {
- print "\n/* ----------------------------------------------------------- */\n" > stubfile
- print c_stubs > stubfile
- print "\n/* ----------------------------------------------------------- */\n" > stubfile
- print h_stubs > stubfile
- }
-
- if (xml) print xmlfoot > xmldoc
-}
-
-#
-# Local variables:
-# tab-width: 2
-# c-basic-offset: 2
-# End:
-
diff --git a/ext/skeleton/php_skeleton.h b/ext/skeleton/php_skeleton.h
index 1514563a70..542bc91548 100644
--- a/ext/skeleton/php_skeleton.h
+++ b/ext/skeleton/php_skeleton.h
@@ -1,45 +1,16 @@
-/* __header_here__ */
+%HEADER%
-#ifndef PHP_EXTNAME_H
-#define PHP_EXTNAME_H
+#ifndef PHP_%EXTNAMECAPS%_H
+# define PHP_%EXTNAMECAPS%_H
-extern zend_module_entry extname_module_entry;
-#define phpext_extname_ptr &extname_module_entry
+extern zend_module_entry %EXTNAME%_module_entry;
+# define phpext_%EXTNAME%_ptr &%EXTNAME%_module_entry
-#define PHP_EXTNAME_VERSION "0.1.0" /* Replace with version number for your extension */
+# define PHP_%EXTNAMECAPS%_VERSION "0.1.0"
-#ifdef PHP_WIN32
-# define PHP_EXTNAME_API __declspec(dllexport)
-#elif defined(__GNUC__) && __GNUC__ >= 4
-# define PHP_EXTNAME_API __attribute__ ((visibility("default")))
-#else
-# define PHP_EXTNAME_API
-#endif
-
-#ifdef ZTS
-#include "TSRM.h"
-#endif
-
-/*
- Declare any global variables you may need between the BEGIN
- and END macros here:
-
-ZEND_BEGIN_MODULE_GLOBALS(extname)
- zend_long global_value;
- char *global_string;
-ZEND_END_MODULE_GLOBALS(extname)
-*/
-
-/* Always refer to the globals in your function as EXTNAME_G(variable).
- You are encouraged to rename these macros something shorter, see
- examples in any other php module directory.
-*/
-#define EXTNAME_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(extname, v)
-
-#if defined(ZTS) && defined(COMPILE_DL_EXTNAME)
+# if defined(ZTS) && defined(COMPILE_DL_%EXTNAMECAPS%)
ZEND_TSRMLS_CACHE_EXTERN()
-#endif
-
-#endif /* PHP_EXTNAME_H */
+# endif
-/* __footer_here__ */
+#endif /* PHP_%EXTNAMECAPS%_H */
+%FOOTER% \ No newline at end of file
diff --git a/ext/skeleton/skeleton.c b/ext/skeleton/skeleton.c
index 50f3271e20..5e674c15c1 100644
--- a/ext/skeleton/skeleton.c
+++ b/ext/skeleton/skeleton.c
@@ -1,168 +1,103 @@
-/* __header_here__ */
+%HEADER%
#ifdef HAVE_CONFIG_H
-#include "config.h"
+# include "config.h"
#endif
#include "php.h"
-#include "php_ini.h"
#include "ext/standard/info.h"
-#include "php_extname.h"
+#include "php_%EXTNAME%.h"
-/* If you declare any globals in php_extname.h uncomment this:
-ZEND_DECLARE_MODULE_GLOBALS(extname)
-*/
-
-/* True global resources - no need for thread safety here */
-static int le_extname;
-
-/* {{{ PHP_INI
+/* {{{ void %EXTNAME%_test1()
*/
-/* Remove comments and fill if you need to have entries in php.ini
-PHP_INI_BEGIN()
- STD_PHP_INI_ENTRY("extname.global_value", "42", PHP_INI_ALL, OnUpdateLong, global_value, zend_extname_globals, extname_globals)
- STD_PHP_INI_ENTRY("extname.global_string", "foobar", PHP_INI_ALL, OnUpdateString, global_string, zend_extname_globals, extname_globals)
-PHP_INI_END()
-*/
-/* }}} */
-
-/* Remove the following function when you have successfully modified config.m4
- so that your module can be compiled into PHP, it exists only for testing
- purposes. */
-
-/* Every user-visible function in PHP should document itself in the source */
-/* {{{ proto string confirm_extname_compiled(string arg)
- Return a string to confirm that the module is compiled in */
-PHP_FUNCTION(confirm_extname_compiled)
+PHP_FUNCTION(%EXTNAME%_test1)
{
- char *arg = NULL;
- size_t arg_len, len;
- zend_string *strg;
+ ZEND_PARSE_PARAMETERS_NONE();
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &arg, &arg_len) == FAILURE) {
- return;
- }
-
- strg = strpprintf(0, "Congratulations! You have successfully modified ext/%.78s/config.m4. Module %.78s is now compiled into PHP.", "extname", arg);
-
- RETURN_STR(strg);
+ php_printf("The extension %s is loaded and working!\r\n", "%EXTNAME%");
}
/* }}} */
-/* The previous line is meant for vim and emacs, so it can correctly fold and
- unfold functions in source code. See the corresponding marks just before
- function definition, where the functions purpose is also documented. Please
- follow this convention for the convenience of others editing your code.
-*/
-/* __function_stubs_here__ */
-
-/* {{{ php_extname_init_globals
+/* {{{ string %EXTNAME%_test2( [ string $var ] )
*/
-/* Uncomment this function if you have INI entries
-static void php_extname_init_globals(zend_extname_globals *extname_globals)
+PHP_FUNCTION(%EXTNAME%_test2)
{
- extname_globals->global_value = 0;
- extname_globals->global_string = NULL;
-}
-*/
-/* }}} */
+ char *var = "World";
+ size_t var_len = sizeof("World") - 1;
+ zend_string *retval;
-/* {{{ PHP_MINIT_FUNCTION
- */
-PHP_MINIT_FUNCTION(extname)
-{
- /* If you have INI entries, uncomment these lines
- REGISTER_INI_ENTRIES();
- */
- return SUCCESS;
-}
-/* }}} */
+ ZEND_PARSE_PARAMETERS_START(0, 1)
+ Z_PARAM_OPTIONAL
+ Z_PARAM_STRING(var, var_len)
+ ZEND_PARSE_PARAMETERS_END();
-/* {{{ PHP_MSHUTDOWN_FUNCTION
- */
-PHP_MSHUTDOWN_FUNCTION(extname)
-{
- /* uncomment this line if you have INI entries
- UNREGISTER_INI_ENTRIES();
- */
- return SUCCESS;
+ retval = strpprintf(0, "Hello %s", var);
+
+ RETURN_STR(retval);
}
-/* }}} */
+/* }}}*/
-/* Remove if there's nothing to do at request start */
/* {{{ PHP_RINIT_FUNCTION
*/
-PHP_RINIT_FUNCTION(extname)
+PHP_RINIT_FUNCTION(%EXTNAME%)
{
-#if defined(COMPILE_DL_EXTNAME) && defined(ZTS)
+#if defined(ZTS) && defined(COMPILE_DL_%EXTNAMECAPS%)
ZEND_TSRMLS_CACHE_UPDATE();
#endif
- return SUCCESS;
-}
-/* }}} */
-/* Remove if there's nothing to do at request end */
-/* {{{ PHP_RSHUTDOWN_FUNCTION
- */
-PHP_RSHUTDOWN_FUNCTION(extname)
-{
return SUCCESS;
}
/* }}} */
/* {{{ PHP_MINFO_FUNCTION
*/
-PHP_MINFO_FUNCTION(extname)
+PHP_MINFO_FUNCTION(%EXTNAME%)
{
php_info_print_table_start();
- php_info_print_table_header(2, "extname support", "enabled");
+ php_info_print_table_header(2, "%EXTNAME% support", "enabled");
php_info_print_table_end();
-
- /* Remove comments if you have entries in php.ini
- DISPLAY_INI_ENTRIES();
- */
}
/* }}} */
-/* {{{ extname_functions[]
- *
- * Every user visible function must have an entry in extname_functions[].
+/* {{{ arginfo
+ */
+ZEND_BEGIN_ARG_INFO(arginfo_%EXTNAME%_test1, 0)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO(arginfo_%EXTNAME%_test2, 0)
+ ZEND_ARG_INFO(0, str)
+ZEND_END_ARG_INFO()
+/* }}} */
+
+/* {{{ %EXTNAME%_functions[]
*/
-const zend_function_entry extname_functions[] = {
- PHP_FE(confirm_extname_compiled, NULL) /* For testing, remove later. */
- /* __function_entries_here__ */
- PHP_FE_END /* Must be the last line in extname_functions[] */
+const zend_function_entry %EXTNAME%_functions[] = {
+ PHP_FE(%EXTNAME%_test1, arginfo_%EXTNAME%_test1)
+ PHP_FE(%EXTNAME%_test2, arginfo_%EXTNAME%_test2)
+ PHP_FE_END
};
/* }}} */
-/* {{{ extname_module_entry
+/* {{{ %EXTNAME%_module_entry
*/
-zend_module_entry extname_module_entry = {
+zend_module_entry %EXTNAME%_module_entry = {
STANDARD_MODULE_HEADER,
- "extname",
- extname_functions,
- PHP_MINIT(extname),
- PHP_MSHUTDOWN(extname),
- PHP_RINIT(extname), /* Replace with NULL if there's nothing to do at request start */
- PHP_RSHUTDOWN(extname), /* Replace with NULL if there's nothing to do at request end */
- PHP_MINFO(extname),
- PHP_EXTNAME_VERSION,
+ "%EXTNAME%", /* Extension name */
+ %EXTNAME%_functions, /* zend_function_entry */
+ NULL, /* PHP_MINIT - Module initialization */
+ NULL, /* PHP_MSHUTDOWN - Module shutdown */
+ PHP_RINIT(%EXTNAME%), /* PHP_RINIT - Request initialization */
+ NULL, /* PHP_RSHUTDOWN - Request shutdown */
+ PHP_MINFO(%EXTNAME%), /* PHP_MINFO - Module info */
+ PHP_%EXTNAMECAPS%_VERSION, /* Version */
STANDARD_MODULE_PROPERTIES
};
/* }}} */
-#ifdef COMPILE_DL_EXTNAME
-#ifdef ZTS
+#ifdef COMPILE_DL_%EXTNAMECAPS%
+# ifdef ZTS
ZEND_TSRMLS_CACHE_DEFINE()
+# endif
+ZEND_GET_MODULE(%EXTNAME%)
#endif
-ZEND_GET_MODULE(extname)
-#endif
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: noet sw=4 ts=4 fdm=marker
- * vim<600: noet sw=4 ts=4
- */
+%FOOTER% \ No newline at end of file
diff --git a/ext/skeleton/skeleton.php b/ext/skeleton/skeleton.php
deleted file mode 100644
index 91db9d5408..0000000000
--- a/ext/skeleton/skeleton.php
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-$br = (php_sapi_name() == "cli")? "":"<br>";
-
-if(!extension_loaded('extname')) {
- dl('extname.' . PHP_SHLIB_SUFFIX);
-}
-$module = 'extname';
-$functions = get_extension_funcs($module);
-echo "Functions available in the test extension:$br\n";
-foreach($functions as $func) {
- echo $func."$br\n";
-}
-echo "$br\n";
-$function = 'confirm_' . $module . '_compiled';
-if (extension_loaded($module)) {
- $str = $function($module);
-} else {
- $str = "Module $module is not compiled into PHP";
-}
-echo "$str\n";
-?>
diff --git a/ext/skeleton/tests/001.phpt b/ext/skeleton/tests/001.phpt
index 88f5795650..445a914936 100644
--- a/ext/skeleton/tests/001.phpt
+++ b/ext/skeleton/tests/001.phpt
@@ -1,21 +1,14 @@
--TEST--
-Check for extname presence
+Check if %EXTNAME% is loaded
--SKIPIF--
-<?php if (!extension_loaded("extname")) print "skip"; ?>
+<?php
+if (!extension_loaded('%EXTNAME%')) {
+ echo 'skip';
+}
+?>
--FILE--
<?php
-echo "extname 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/README.TESTING for further information on
- writing regression tests
-*/
+echo 'The extension "%EXTNAME%" is available';
?>
--EXPECT--
-extname extension is available
+The extension "%EXTNAME%" is available
diff --git a/ext/skeleton/tests/002.phpt b/ext/skeleton/tests/002.phpt
new file mode 100644
index 0000000000..0147087ace
--- /dev/null
+++ b/ext/skeleton/tests/002.phpt
@@ -0,0 +1,17 @@
+--TEST--
+%EXTNAME%_test1() Basic test
+--SKIPIF--
+<?php
+if (!extension_loaded('%EXTNAME%')) {
+ echo 'skip';
+}
+?>
+--FILE--
+<?php
+$ret = %EXTNAME%_test1();
+
+var_dump($ret);
+?>
+--EXPECT--
+The extension %EXTNAME% is loaded and working!
+NULL
diff --git a/ext/skeleton/tests/003.phpt b/ext/skeleton/tests/003.phpt
new file mode 100644
index 0000000000..d5a0905fa9
--- /dev/null
+++ b/ext/skeleton/tests/003.phpt
@@ -0,0 +1,16 @@
+--TEST--
+%EXTNAME%_test2() Basic test
+--SKIPIF--
+<?php
+if (!extension_loaded('%EXTNAME%')) {
+ echo 'skip';
+}
+?>
+--FILE--
+<?php
+var_dump(%EXTNAME%_test2());
+var_dump(%EXTNAME%_test2('PHP'));
+?>
+--EXPECT--
+string(11) "Hello World"
+string(9) "Hello PHP"
diff --git a/ext/soap/package.xml b/ext/soap/package.xml
deleted file mode 100644
index 32c5b77ff3..0000000000
--- a/ext/soap/package.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!-- do not use the "Type" attribute here, that one is only for
- generated package.xml files -->
-<package>
- <name>ext_soap</name>
- <summary>Provides SOAP Services</summary>
- <description>
- Description of package....
- </description>
- <status>beta</status>
- <maintainers>
- <maintainer>
- <user>rodif_bl</user>
- <name>Brad Lafountain</name>
- <email>rodif_bl@yahoo.com</email>
- <role>lead</role>
- </maintainer>
- <maintainer>
- <user>shane</user>
- <name>Shane Caraveo</name>
- <email>shane@caraveo.com</email>
- <role>lead</role>
- </maintainer>
- <maintainer>
- <user>dmitry</user>
- <name>Dmitry Stogov</name>
- <email>dmitry@zend.com</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <license>PHP</license>
- <release>
- <version>0.1</version>
- <date>2002-07-07</date>
- <state>alpha</state>
- <notes>
- - First official PEAR/PECL release
- </notes>
- </release>
- <filelist>
- <dir name="/">
- <file role="doc">CREDITS</file>
- <file role="doc">EXPERIMENTAL</file>
- <file role="doc">TODO</file>
- <file role="src">config.m4</file>
- <file role="src">php_encoding.c</file>
- <file role="src">php_encoding.h</file>
- <file role="src">php_http.c</file>
- <file role="src">php_http.h</file>
- <file role="src">php_packet_soap.c</file>
- <file role="src">php_packet_soap.h</file>
- <file role="src">php_schema.c</file>
- <file role="src">php_schema.h</file>
- <file role="src">php_sdl.c</file>
- <file role="src">php_sdl.h</file>
- <file role="src">php_soap.h</file>
- <file role="src">php_soap.h</file>
- <file role="src">php_xml.c</file>
- <file role="src">php_xml.h</file>
- <file role="src">soap.c</file>
- </dir>
- </filelist>
-</package>
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c
index a88d14fb1a..16b15698c5 100644
--- a/ext/soap/php_encoding.c
+++ b/ext/soap/php_encoding.c
@@ -149,7 +149,6 @@ encode defaultEncoding[] = {
{{IS_DOUBLE, XSD_FLOAT_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_double, to_xml_double},
{{IS_FALSE, XSD_BOOLEAN_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_bool, to_xml_bool},
{{IS_TRUE, XSD_BOOLEAN_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_bool, to_xml_bool},
- {{IS_CONSTANT, XSD_STRING_STRING, XSD_NAMESPACE, NULL, NULL}, to_zval_string, to_xml_string},
{{IS_ARRAY, SOAP_ENC_ARRAY_STRING, SOAP_1_1_ENC_NAMESPACE, NULL, NULL}, to_zval_array, guess_array_map},
{{IS_OBJECT, SOAP_ENC_OBJECT_STRING, SOAP_1_1_ENC_NAMESPACE, NULL, NULL}, to_zval_object, to_xml_object},
{{IS_ARRAY, SOAP_ENC_ARRAY_STRING, SOAP_1_2_ENC_NAMESPACE, NULL, NULL}, to_zval_array, guess_array_map},
@@ -453,7 +452,7 @@ static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, xml
} else {
if (check_class_map && SOAP_GLOBAL(class_map) && data &&
Z_TYPE_P(data) == IS_OBJECT &&
- !ZEND_HASH_GET_APPLY_COUNT(Z_OBJPROP_P(data))) {
+ !GC_IS_RECURSIVE(Z_OBJPROP_P(data))) {
zend_class_entry *ce = Z_OBJCE_P(data);
zval *tmp;
zend_string *type_name;
@@ -1859,9 +1858,9 @@ static xmlNodePtr to_xml_object(encodeTypePtr type, zval *data, int style, xmlNo
sdlType->encode->details.sdl_type->kind != XSD_TYPEKIND_LIST &&
sdlType->encode->details.sdl_type->kind != XSD_TYPEKIND_UNION) {
- if (prop) ZEND_HASH_INC_APPLY_COUNT(prop);
+ if (prop) {GC_PROTECT_RECURSION(prop);}
xmlParam = master_to_xml(sdlType->encode, data, style, parent);
- if (prop) ZEND_HASH_DEC_APPLY_COUNT(prop);
+ if (prop) {GC_UNPROTECT_RECURSION(prop);}
} else {
zval rv;
zval *tmp = get_zval_property(data, "_", &rv);
diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c
index c0b5f61216..d8d8f95f2b 100644
--- a/ext/soap/php_http.c
+++ b/ext/soap/php_http.c
@@ -179,7 +179,7 @@ static php_stream* http_connect(zval* this_ptr, php_url *phpurl, int use_ssl, ph
port = Z_LVAL_P(proxy_port);
*use_proxy = 1;
} else {
- host = phpurl->host;
+ host = ZSTR_VAL(phpurl->host);
port = phpurl->port;
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "_connection_timeout", sizeof("_connection_timeout")-1)) != NULL &&
@@ -243,18 +243,18 @@ static php_stream* http_connect(zval* this_ptr, php_url *phpurl, int use_ssl, ph
/* Set peer_name or name verification will try to use the proxy server name */
if (!context || (tmp = php_stream_context_get_option(context, "ssl", "peer_name")) == NULL) {
- ZVAL_STRING(&ssl_proxy_peer_name, phpurl->host);
+ ZVAL_STR_COPY(&ssl_proxy_peer_name, phpurl->host);
php_stream_context_set_option(PHP_STREAM_CONTEXT(stream), "ssl", "peer_name", &ssl_proxy_peer_name);
zval_ptr_dtor(&ssl_proxy_peer_name);
}
smart_str_append_const(&soap_headers, "CONNECT ");
- smart_str_appends(&soap_headers, phpurl->host);
+ smart_str_appends(&soap_headers, ZSTR_VAL(phpurl->host));
smart_str_appendc(&soap_headers, ':');
smart_str_append_unsigned(&soap_headers, phpurl->port);
smart_str_append_const(&soap_headers, " HTTP/1.1\r\n");
smart_str_append_const(&soap_headers, "Host: ");
- smart_str_appends(&soap_headers, phpurl->host);
+ smart_str_appends(&soap_headers, ZSTR_VAL(phpurl->host));
if (phpurl->port != 80) {
smart_str_appendc(&soap_headers, ':');
smart_str_append_unsigned(&soap_headers, phpurl->port);
@@ -454,9 +454,9 @@ try_again:
}
use_ssl = 0;
- if (phpurl->scheme != NULL && strcmp(phpurl->scheme, "https") == 0) {
+ if (phpurl->scheme != NULL && zend_string_equals_literal(phpurl->scheme, "https")) {
use_ssl = 1;
- } else if (phpurl->scheme == NULL || strcmp(phpurl->scheme, "http") != 0) {
+ } else if (phpurl->scheme == NULL || !zend_string_equals_literal(phpurl->scheme, "http")) {
php_url_free(phpurl);
if (request != buf) {
zend_string_release(request);
@@ -489,10 +489,10 @@ try_again:
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "httpurl", sizeof("httpurl")-1)) != NULL &&
(orig = (php_url *) zend_fetch_resource_ex(tmp, "httpurl", le_url)) != NULL &&
((use_proxy && !use_ssl) ||
- (((use_ssl && orig->scheme != NULL && strcmp(orig->scheme, "https") == 0) ||
+ (((use_ssl && orig->scheme != NULL && zend_string_equals_literal(orig->scheme, "https")) ||
(!use_ssl && orig->scheme == NULL) ||
- (!use_ssl && strcmp(orig->scheme, "https") != 0)) &&
- strcmp(orig->host, phpurl->host) == 0 &&
+ (!use_ssl && !zend_string_equals_literal(orig->scheme, "https"))) &&
+ strcmp(ZSTR_VAL(orig->host), ZSTR_VAL(phpurl->host)) == 0 &&
orig->port == phpurl->port))) {
} else {
php_stream_close(stream);
@@ -553,24 +553,24 @@ try_again:
smart_str_append_const(&soap_headers, "POST ");
if (use_proxy && !use_ssl) {
- smart_str_appends(&soap_headers, phpurl->scheme);
+ smart_str_appends(&soap_headers, ZSTR_VAL(phpurl->scheme));
smart_str_append_const(&soap_headers, "://");
- smart_str_appends(&soap_headers, phpurl->host);
+ smart_str_appends(&soap_headers, ZSTR_VAL(phpurl->host));
smart_str_appendc(&soap_headers, ':');
smart_str_append_unsigned(&soap_headers, phpurl->port);
}
if (phpurl->path) {
- smart_str_appends(&soap_headers, phpurl->path);
+ smart_str_appends(&soap_headers, ZSTR_VAL(phpurl->path));
} else {
smart_str_appendc(&soap_headers, '/');
}
if (phpurl->query) {
smart_str_appendc(&soap_headers, '?');
- smart_str_appends(&soap_headers, phpurl->query);
+ smart_str_appends(&soap_headers, ZSTR_VAL(phpurl->query));
}
if (phpurl->fragment) {
smart_str_appendc(&soap_headers, '#');
- smart_str_appends(&soap_headers, phpurl->fragment);
+ smart_str_appends(&soap_headers, ZSTR_VAL(phpurl->fragment));
}
if (http_1_1) {
smart_str_append_const(&soap_headers, " HTTP/1.1\r\n");
@@ -578,7 +578,7 @@ try_again:
smart_str_append_const(&soap_headers, " HTTP/1.0\r\n");
}
smart_str_append_const(&soap_headers, "Host: ");
- smart_str_appends(&soap_headers, phpurl->host);
+ smart_str_appends(&soap_headers, ZSTR_VAL(phpurl->host));
if (phpurl->port != (use_ssl?443:80)) {
smart_str_appendc(&soap_headers, ':');
smart_str_append_unsigned(&soap_headers, phpurl->port);
@@ -702,13 +702,13 @@ try_again:
PHP_MD5Init(&md5ctx);
PHP_MD5Update(&md5ctx, (unsigned char*)"POST:", sizeof("POST:")-1);
if (phpurl->path) {
- PHP_MD5Update(&md5ctx, (unsigned char*)phpurl->path, strlen(phpurl->path));
+ PHP_MD5Update(&md5ctx, (unsigned char*)ZSTR_VAL(phpurl->path), ZSTR_LEN(phpurl->path));
} else {
PHP_MD5Update(&md5ctx, (unsigned char*)"/", 1);
}
if (phpurl->query) {
PHP_MD5Update(&md5ctx, (unsigned char*)"?", 1);
- PHP_MD5Update(&md5ctx, (unsigned char*)phpurl->query, strlen(phpurl->query));
+ PHP_MD5Update(&md5ctx, (unsigned char*)ZSTR_VAL(phpurl->query), ZSTR_LEN(phpurl->query));
}
PHP_MD5Final(hash, &md5ctx);
@@ -750,17 +750,17 @@ try_again:
}
smart_str_append_const(&soap_headers, "\", uri=\"");
if (phpurl->path) {
- smart_str_appends(&soap_headers, phpurl->path);
+ smart_str_appends(&soap_headers, ZSTR_VAL(phpurl->path));
} else {
smart_str_appendc(&soap_headers, '/');
}
if (phpurl->query) {
smart_str_appendc(&soap_headers, '?');
- smart_str_appends(&soap_headers, phpurl->query);
+ smart_str_appends(&soap_headers, ZSTR_VAL(phpurl->query));
}
if (phpurl->fragment) {
smart_str_appendc(&soap_headers, '#');
- smart_str_appends(&soap_headers, phpurl->fragment);
+ smart_str_appends(&soap_headers, ZSTR_VAL(phpurl->fragment));
}
if ((tmp = zend_hash_str_find(Z_ARRVAL_P(digest), "qop", sizeof("qop")-1)) != NULL &&
Z_TYPE_P(tmp) == IS_STRING) {
@@ -835,10 +835,10 @@ try_again:
zval *tmp;
if (((tmp = zend_hash_index_find(Z_ARRVAL_P(data), 1)) == NULL ||
Z_TYPE_P(tmp) != IS_STRING ||
- strncmp(phpurl->path?phpurl->path:"/",Z_STRVAL_P(tmp),Z_STRLEN_P(tmp)) == 0) &&
+ strncmp(phpurl->path?ZSTR_VAL(phpurl->path):"/",Z_STRVAL_P(tmp),Z_STRLEN_P(tmp)) == 0) &&
((tmp = zend_hash_index_find(Z_ARRVAL_P(data), 2)) == NULL ||
Z_TYPE_P(tmp) != IS_STRING ||
- in_domain(phpurl->host,Z_STRVAL_P(tmp))) &&
+ in_domain(ZSTR_VAL(phpurl->host),Z_STRVAL_P(tmp))) &&
(use_ssl || (tmp = zend_hash_index_find(Z_ARRVAL_P(data), 3)) == NULL)) {
smart_str_append(&soap_headers, key);
smart_str_appendc(&soap_headers, '=');
@@ -1006,14 +1006,15 @@ try_again:
}
}
if (!zend_hash_index_exists(Z_ARRVAL(zcookie), 1)) {
- char *t = phpurl->path?phpurl->path:"/";
+ char *t = phpurl->path?ZSTR_VAL(phpurl->path):"/";
char *c = strrchr(t, '/');
if (c) {
add_index_stringl(&zcookie, 1, t, c-t);
}
}
if (!zend_hash_index_exists(Z_ARRVAL(zcookie), 2)) {
- add_index_string(&zcookie, 2, phpurl->host);
+ add_index_str(&zcookie, 2, phpurl->host);
+ GC_REFCOUNT(phpurl->host)++;
}
zend_symtable_update(Z_ARRVAL_P(cookies), name.s, &zcookie);
@@ -1108,26 +1109,27 @@ try_again:
zend_string_release(http_body);
efree(loc);
if (new_url->scheme == NULL && new_url->path != NULL) {
- new_url->scheme = phpurl->scheme ? estrdup(phpurl->scheme) : NULL;
- new_url->host = phpurl->host ? estrdup(phpurl->host) : NULL;
+ new_url->scheme = phpurl->scheme ? zend_string_copy(phpurl->scheme) : NULL;
+ new_url->host = phpurl->host ? zend_string_copy(phpurl->host) : NULL;
new_url->port = phpurl->port;
- if (new_url->path && new_url->path[0] != '/') {
+ if (new_url->path && ZSTR_VAL(new_url->path)[0] != '/') {
if (phpurl->path) {
- char *t = phpurl->path;
+ char *t = ZSTR_VAL(phpurl->path);
char *p = strrchr(t, '/');
if (p) {
- char *s = emalloc((p - t) + strlen(new_url->path) + 2);
- strncpy(s, t, (p - t) + 1);
- s[(p - t) + 1] = 0;
- strcat(s, new_url->path);
- efree(new_url->path);
+ zend_string *s = zend_string_alloc((p - t) + ZSTR_LEN(new_url->path) + 2, 0);
+ strncpy(ZSTR_VAL(s), t, (p - t) + 1);
+ ZSTR_VAL(s)[(p - t) + 1] = 0;
+ strcat(ZSTR_VAL(s), ZSTR_VAL(new_url->path));
+ zend_string_release(new_url->path);
new_url->path = s;
}
} else {
- char *s = emalloc(strlen(new_url->path) + 2);
- s[0] = '/'; s[1] = 0;
- strcat(s, new_url->path);
- efree(new_url->path);
+ zend_string *s = zend_string_alloc(ZSTR_LEN(new_url->path) + 2, 0);
+ ZSTR_VAL(s)[0] = '/';
+ ZSTR_VAL(s)[1] = 0;
+ strcat(ZSTR_VAL(s), ZSTR_VAL(new_url->path));
+ zend_string_release(new_url->path);
new_url->path = s;
}
}
@@ -1202,13 +1204,13 @@ try_again:
add_property_zval_ex(this_ptr, "_digest", sizeof("_digest")-1, &digest);
*new_url = *phpurl;
- if (phpurl->scheme) phpurl->scheme = estrdup(phpurl->scheme);
- if (phpurl->user) phpurl->user = estrdup(phpurl->user);
- if (phpurl->pass) phpurl->pass = estrdup(phpurl->pass);
- if (phpurl->host) phpurl->host = estrdup(phpurl->host);
- if (phpurl->path) phpurl->path = estrdup(phpurl->path);
- if (phpurl->query) phpurl->query = estrdup(phpurl->query);
- if (phpurl->fragment) phpurl->fragment = estrdup(phpurl->fragment);
+ if (phpurl->scheme) phpurl->scheme = zend_string_copy(phpurl->scheme);
+ if (phpurl->user) phpurl->user = zend_string_copy(phpurl->user);
+ if (phpurl->pass) phpurl->pass = zend_string_copy(phpurl->pass);
+ if (phpurl->host) phpurl->host = zend_string_copy(phpurl->host);
+ if (phpurl->path) phpurl->path = zend_string_copy(phpurl->path);
+ if (phpurl->query) phpurl->query = zend_string_copy(phpurl->query);
+ if (phpurl->fragment) phpurl->fragment = zend_string_copy(phpurl->fragment);
phpurl = new_url;
efree(auth);
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index 3c7e847964..21deb4ec80 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -813,7 +813,7 @@ PHP_METHOD(SoapParam, SoapParam)
size_t name_length;
zval *this_ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "zs", &data, &name, &name_length) == FAILURE) {
+ if (zend_parse_parameters_throw(ZEND_NUM_ARGS(), "zs", &data, &name, &name_length) == FAILURE) {
return;
}
if (name_length == 0) {
@@ -838,7 +838,7 @@ PHP_METHOD(SoapHeader, SoapHeader)
zend_bool must_understand = 0;
zval *this_ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|zbz", &ns, &ns_len, &name, &name_len, &data, &must_understand, &actor) == FAILURE) {
+ if (zend_parse_parameters_throw(ZEND_NUM_ARGS(), "ss|zbz", &ns, &ns_len, &name, &name_len, &data, &must_understand, &actor) == FAILURE) {
return;
}
if (ns_len == 0) {
@@ -878,7 +878,7 @@ PHP_METHOD(SoapFault, SoapFault)
size_t fault_string_len, fault_actor_len = 0, name_len = 0, fault_code_len = 0;
zval *code = NULL, *details = NULL, *headerfault = NULL, *this_ptr;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "zs|s!z!s!z",
+ if (zend_parse_parameters_throw(ZEND_NUM_ARGS(), "zs|s!z!s!z",
&code,
&fault_string, &fault_string_len,
&fault_actor, &fault_actor_len,
@@ -982,7 +982,7 @@ PHP_METHOD(SoapVar, SoapVar)
char *stype = NULL, *ns = NULL, *name = NULL, *namens = NULL;
size_t stype_len = 0, ns_len = 0, name_len = 0, namens_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "z!z|ssss", &data, &type, &stype, &stype_len, &ns, &ns_len, &name, &name_len, &namens, &namens_len) == FAILURE) {
+ if (zend_parse_parameters_throw(ZEND_NUM_ARGS(), "z!z|ssss", &data, &type, &stype, &stype_len, &ns, &ns_len, &name, &name_len, &namens, &namens_len) == FAILURE) {
return;
}
@@ -1134,8 +1134,8 @@ PHP_METHOD(SoapServer, SoapServer)
SOAP_SERVER_BEGIN_CODE();
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "z|a", &wsdl, &options) == FAILURE) {
- php_error_docref(NULL, E_ERROR, "Invalid parameters");
+ if (zend_parse_parameters_throw(ZEND_NUM_ARGS(), "z|a", &wsdl, &options) == FAILURE) {
+ return;
}
if (Z_TYPE_P(wsdl) != IS_STRING && Z_TYPE_P(wsdl) != IS_NULL) {
@@ -1223,8 +1223,7 @@ PHP_METHOD(SoapServer, SoapServer)
service->version = version;
service->type = SOAP_FUNCTIONS;
service->soap_functions.functions_all = FALSE;
- service->soap_functions.ft = emalloc(sizeof(HashTable));
- zend_hash_init(service->soap_functions.ft, 0, NULL, ZVAL_PTR_DTOR, 0);
+ service->soap_functions.ft = zend_new_array(0);
if (Z_TYPE_P(wsdl) != IS_NULL) {
service->sdl = get_sdl(getThis(), Z_STRVAL_P(wsdl), cache_wsdl);
@@ -1415,8 +1414,7 @@ PHP_METHOD(SoapServer, addFunction)
if (service->soap_functions.ft == NULL) {
service->soap_functions.functions_all = FALSE;
- service->soap_functions.ft = emalloc(sizeof(HashTable));
- zend_hash_init(service->soap_functions.ft, zend_hash_num_elements(Z_ARRVAL_P(function_name)), NULL, ZVAL_PTR_DTOR, 0);
+ service->soap_functions.ft = zend_new_array(zend_hash_num_elements(Z_ARRVAL_P(function_name)));
}
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(function_name), tmp_function) {
@@ -1455,8 +1453,7 @@ PHP_METHOD(SoapServer, addFunction)
}
if (service->soap_functions.ft == NULL) {
service->soap_functions.functions_all = FALSE;
- service->soap_functions.ft = emalloc(sizeof(HashTable));
- zend_hash_init(service->soap_functions.ft, 0, NULL, ZVAL_PTR_DTOR, 0);
+ service->soap_functions.ft = zend_new_array(0);
}
ZVAL_STR_COPY(&function_copy, f->common.function_name);
@@ -2310,8 +2307,8 @@ PHP_METHOD(SoapClient, SoapClient)
SOAP_CLIENT_BEGIN_CODE();
- if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "z|a", &wsdl, &options) == FAILURE) {
- php_error_docref(NULL, E_ERROR, "Invalid parameters");
+ if (zend_parse_parameters_throw(ZEND_NUM_ARGS(), "z|a", &wsdl, &options) == FAILURE) {
+ return;
}
if (Z_TYPE_P(wsdl) != IS_STRING && Z_TYPE_P(wsdl) != IS_NULL) {
@@ -2888,8 +2885,7 @@ PHP_METHOD(SoapClient, __call)
free_soap_headers = 0;
} else if (Z_TYPE_P(headers) == IS_OBJECT &&
instanceof_function(Z_OBJCE_P(headers), soap_header_class_entry)) {
- soap_headers = emalloc(sizeof(HashTable));
- zend_hash_init(soap_headers, 0, NULL, ZVAL_PTR_DTOR, 0);
+ soap_headers = zend_new_array(0);
zend_hash_next_index_insert(soap_headers, headers);
Z_ADDREF_P(headers);
free_soap_headers = 1;
diff --git a/ext/soap/tests/bug70211.phpt b/ext/soap/tests/bug70211.phpt
index 8346b35ab7..2d7124376b 100644
--- a/ext/soap/tests/bug70211.phpt
+++ b/ext/soap/tests/bug70211.phpt
@@ -16,7 +16,7 @@ function ptr2str($ptr)
}
$sf = new SoapFault('1', 'string', 'detail', 'header','line', str_repeat("A",232).ptr2str($addr));
-$ob = unserialize("a:3:{i:0;".serialize($sf).'i:1;r:12;i:2;r:10;}');
+$ob = unserialize("a:3:{i:0;".serialize($sf).'i:1;R:12;i:2;R:10;}');
var_dump($ob[1]);
?>
diff --git a/ext/soap/tests/fault001.phpt b/ext/soap/tests/fault001.phpt
new file mode 100644
index 0000000000..221641dc09
--- /dev/null
+++ b/ext/soap/tests/fault001.phpt
@@ -0,0 +1,13 @@
+--TEST--
+is_soap_fault 1: test against null
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+var_dump(is_soap_fault(null));
+$fault = new SoapFault("code", "message");
+var_dump(is_soap_fault($fault));
+?>
+--EXPECT--
+bool(false)
+bool(true)
diff --git a/ext/sockets/package.xml b/ext/sockets/package.xml
deleted file mode 100644
index 5fa67d9939..0000000000
--- a/ext/sockets/package.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>sockets</name>
- <summary>Socket functions</summary>
- <maintainers>
- <maintainer>
- <user>???</user>
- <name>Chris Vandomelen</name>
- <email>chrisv@b0rked.dhs.org</email>
- <role>lead</role>
- </maintainer>
- <maintainer>
- <user>sterling</user>
- <name>Sterling Hughes</name>
- <email>sterling@php.net</email>
- <role>lead</role>
- </maintainer>
- <maintainer>
- <user>jason</user>
- <name>Jason Greene</name>
- <email>jason@php.net</email>
- <role>lead</role>
- </maintainer>
- <maintainer>
- <user>???</user>
- <name>Daniel Beulshausen</name>
- <email>daniel@php4win.de</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <description>
-The socket extension implements a low-level interface to the socket
-communication functions based on the popular BSD sockets, providing
-the possibility to act as a socket server as well as a client.
- </description>
- <license>PHP</license>
- <release>
- <state>beta</state>
- <version>5.0.0rc1</version>
- <date>2004-03-19</date>
- <notes>
-package.xml added to support installation using pear installer
- </notes>
- <filelist>
- <file role="doc" name="CREDITS"/>
- <file role="src" name="config.m4"/>
- <file role="src" name="config.w32"/>
- <file role="src" name="php_sockets.h"/>
- <file role="src" name="php_sockets_win.c"/>
- <file role="src" name="php_sockets_win.h"/>
- <file role="src" name="sockets.c"/>
- <file role="src" name="unix_socket_constants.h"/>
- <file role="src" name="win32_socket_constants.h"/>
- <file role="test" name="tests/ipv4loop.phpt"/>
- <file role="test" name="tests/ipv6loop.phpt"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5" />
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/spl/package.xml b/ext/spl/package.xml
deleted file mode 100755
index 372aaecd9f..0000000000
--- a/ext/spl/package.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>SPL</name>
- <summary>Standard PHP Library</summary>
- <maintainers>
- <maintainer>
- <user>helly</user>
- <name>Marcus Boerger</name>
- <email>helly@php.net</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <description>
-SPL is a collection of interfaces and classes that are meant to solve
-standard problems.
- </description>
- <license>PHP</license>
- <release>
- <state>stable</state>
- <version>0.1-dev</version>
- <date>TBA</date>
- <filelist>
- <file role="src" name="config.m4"/>
- <file role="src" name="php_spl.c"/>
- <file role="src" name="php_spl.h"/>
- <file role="src" name="spl_array.c"/>
- <file role="src" name="spl_array.h"/>
- <file role="src" name="spl_directory.c"/>
- <file role="src" name="spl_directory.h"/>
- <file role="src" name="spl_engine.c"/>
- <file role="src" name="spl_engine.h"/>
- <file role="src" name="spl_functions.c"/>
- <file role="src" name="spl_functions.h"/>
- <file role="src" name="spl_iterators.c"/>
- <file role="src" name="spl_iterators.h"/>
- <file role="doc" name="CREDITS"/>
- <file role="doc" name="README"/>
- <file role="doc" name="TODO"/>
- <file role="doc" name="spl.php"/>
- <file role="test" name="tests/array_iterator.phpt"/>
- <file role="test" name="tests/array_object.phpt"/>
- <dir name="examples">
- <file role="doc" name="autoload.inc"/>
- <file role="doc" name="cachingiterator.inc"/>
- <file role="doc" name="cachingrecursiveiterator.inc"/>
- <file role="doc" name="dba_array.php"/>
- <file role="doc" name="dba_dump.php"/>
- <file role="doc" name="dba_reader.inc"/>
- <file role="doc" name="directoryfilterdots.inc"/>
- <file role="doc" name="directorygraphiterator.inc"/>
- <file role="doc" name="directorytree.inc"/>
- <file role="doc" name="directorytree.php"/>
- <file role="doc" name="directorytreeiterator.inc"/>
- <file role="doc" name="findfile.php"/>
- <file role="doc" name="filteriterator.inc"/>
- <file role="doc" name="ini_groups.php"/>
- <file role="doc" name="key_filter.inc"/>
- <file role="doc" name="limititerator.inc"/>
- <file role="doc" name="parentiterator.inc"/>
- <file role="doc" name="recursiveiterator.inc"/>
- <file role="doc" name="recursiveiteratoriterator.inc"/>
- <file role="doc" name="searchiterator.inc"/>
- <file role="doc" name="seekableiterator.inc"/>
- <file role="doc" name="tree.php"/>
- </dir>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5"/>
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index a45197114a..672f40e469 100644
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -845,8 +845,7 @@ static HashTable* spl_array_get_debug_info(zval *obj, int *is_temp) /* {{{ */
HashTable *debug_info;
*is_temp = 1;
- ALLOC_HASHTABLE(debug_info);
- ZEND_INIT_SYMTABLE_EX(debug_info, zend_hash_num_elements(intern->std.properties) + 1, 0);
+ debug_info = zend_new_array(zend_hash_num_elements(intern->std.properties) + 1);
zend_hash_copy(debug_info, intern->std.properties, (copy_ctor_func_t) zval_add_ref);
storage = &intern->array;
diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c
index 049b517c46..943b5174a2 100644
--- a/ext/spl/spl_directory.c
+++ b/ext/spl/spl_directory.c
@@ -99,6 +99,8 @@ static void spl_filesystem_object_destroy_object(zend_object *object) /* {{{ */
}
}
break;
+ default:
+ break;
}
} /* }}} */
@@ -1235,7 +1237,7 @@ FileInfoFunction(isLink, FS_IS_LINK)
SPL_METHOD(SplFileInfo, getLinkTarget)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
- int ret;
+ ssize_t ret;
char buff[MAXPATHLEN];
zend_error_handling error_handling;
@@ -1277,7 +1279,7 @@ SPL_METHOD(SplFileInfo, getLinkTarget)
}
/* }}} */
-#if (!defined(__BEOS__) && HAVE_REALPATH) || defined(ZTS)
+#if HAVE_REALPATH || defined(ZTS)
/* {{{ proto string SplFileInfo::getRealPath()
Return the resolved path */
SPL_METHOD(SplFileInfo, getRealPath)
@@ -1945,7 +1947,7 @@ static const zend_function_entry spl_SplFileInfo_functions[] = {
SPL_ME(SplFileInfo, isDir, arginfo_splfileinfo_void, ZEND_ACC_PUBLIC)
SPL_ME(SplFileInfo, isLink, arginfo_splfileinfo_void, ZEND_ACC_PUBLIC)
SPL_ME(SplFileInfo, getLinkTarget, arginfo_splfileinfo_void, ZEND_ACC_PUBLIC)
-#if (!defined(__BEOS__) && HAVE_REALPATH) || defined(ZTS)
+#if HAVE_REALPATH || defined(ZTS)
SPL_ME(SplFileInfo, getRealPath, arginfo_splfileinfo_void, ZEND_ACC_PUBLIC)
#endif
SPL_ME(SplFileInfo, getFileInfo, arginfo_info_optinalFileClass, ZEND_ACC_PUBLIC)
diff --git a/ext/spl/spl_dllist.c b/ext/spl/spl_dllist.c
index c7ac6cecd0..fac5007be2 100644
--- a/ext/spl/spl_dllist.c
+++ b/ext/spl/spl_dllist.c
@@ -506,8 +506,7 @@ static HashTable* spl_dllist_object_get_debug_info(zval *obj, int *is_temp) /* {
rebuild_object_properties(&intern->std);
}
- ALLOC_HASHTABLE(debug_info);
- zend_hash_init(debug_info, 1, NULL, ZVAL_PTR_DTOR, 0);
+ debug_info = zend_new_array(1);
zend_hash_copy(debug_info, intern->std.properties, (copy_ctor_func_t) zval_add_ref);
pnstr = spl_gen_private_prop_name(spl_ce_SplDoublyLinkedList, "flags", sizeof("flags")-1);
diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c
index 06e4773677..3b179c523f 100644
--- a/ext/spl/spl_heap.c
+++ b/ext/spl/spl_heap.c
@@ -490,8 +490,7 @@ static HashTable* spl_heap_object_get_debug_info_helper(zend_class_entry *ce, zv
rebuild_object_properties(&intern->std);
}
- ALLOC_HASHTABLE(debug_info);
- ZEND_INIT_SYMTABLE_EX(debug_info, zend_hash_num_elements(intern->std.properties) + 1, 0);
+ debug_info = zend_new_array(zend_hash_num_elements(intern->std.properties) + 1);
zend_hash_copy(debug_info, intern->std.properties, (copy_ctor_func_t) zval_add_ref);
pnstr = spl_gen_private_prop_name(ce, "flags", sizeof("flags")-1);
diff --git a/ext/spl/spl_observer.c b/ext/spl/spl_observer.c
index de33bd5a6b..e9dc418b53 100644
--- a/ext/spl/spl_observer.c
+++ b/ext/spl/spl_observer.c
@@ -295,8 +295,7 @@ static HashTable* spl_object_storage_debug_info(zval *obj, int *is_temp) /* {{{
props = Z_OBJPROP_P(obj);
- ALLOC_HASHTABLE(debug_info);
- ZEND_INIT_SYMTABLE_EX(debug_info, zend_hash_num_elements(props) + 1, 0);
+ debug_info = zend_new_array(zend_hash_num_elements(props) + 1);
zend_hash_copy(debug_info, props, (copy_ctor_func_t)zval_add_ref);
array_init(&storage);
@@ -570,12 +569,13 @@ SPL_METHOD(SplObjectStorage, count)
}
if (mode == COUNT_RECURSIVE) {
- zend_long ret = zend_hash_num_elements(&intern->storage);
- zval *element;
+ zend_long ret;
- ZEND_HASH_FOREACH_VAL(&intern->storage, element) {
- ret += php_count_recursive(element, mode);
- } ZEND_HASH_FOREACH_END();
+ if (mode != COUNT_RECURSIVE) {
+ ret = zend_hash_num_elements(&intern->storage);
+ } else {
+ ret = php_count_recursive(&intern->storage);
+ }
RETURN_LONG(ret);
return;
diff --git a/ext/sqlite3/tests/sqlite3_busyTimeout.phpt b/ext/sqlite3/tests/sqlite3_busyTimeout.phpt
new file mode 100644
index 0000000000..3c7c2dc41a
--- /dev/null
+++ b/ext/sqlite3/tests/sqlite3_busyTimeout.phpt
@@ -0,0 +1,20 @@
+--TEST--
+public bool SQLite3::busyTimeout ( int $msecs );
+--CREDITS--
+marcosptf - <marcosptf@yahoo.com.br> - @phpsp - sao paulo - br
+--XFAILIF--
+<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
+--FILE--
+<?php
+require_once(dirname(__FILE__) . '/new_db.inc');
+var_dump($db->busyTimeout(0));
+var_dump($db->busyTimeout(null));
+var_dump($db->busyTimeout(-1000));
+var_dump($db->busyTimeout(1000));
+$db->close();
+?>
+--EXPECT--
+bool(true)
+bool(true)
+bool(true)
+bool(true)
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 9ddbf1f3bf..50ca1d2c40 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -743,30 +743,29 @@ PHP_FUNCTION(ksort)
}
/* }}} */
-PHPAPI zend_long php_count_recursive(zval *array, zend_long mode) /* {{{ */
+PHPAPI zend_long php_count_recursive(HashTable *ht) /* {{{ */
{
zend_long cnt = 0;
zval *element;
- if (Z_TYPE_P(array) == IS_ARRAY) {
- if (Z_ARRVAL_P(array)->u.v.nApplyCount > 1) {
+ if (!(GC_FLAGS(ht) & GC_IMMUTABLE)) {
+ if (GC_IS_RECURSIVE(ht)) {
php_error_docref(NULL, E_WARNING, "recursion detected");
return 0;
}
+ GC_PROTECT_RECURSION(ht);
+ }
- cnt = zend_array_count(Z_ARRVAL_P(array));
- if (mode == COUNT_RECURSIVE) {
- if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(array))) {
- Z_ARRVAL_P(array)->u.v.nApplyCount++;
- }
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(array), element) {
- ZVAL_DEREF(element);
- cnt += php_count_recursive(element, COUNT_RECURSIVE);
- } ZEND_HASH_FOREACH_END();
- if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(array))) {
- Z_ARRVAL_P(array)->u.v.nApplyCount--;
- }
+ cnt = zend_array_count(ht);
+ ZEND_HASH_FOREACH_VAL(ht, element) {
+ ZVAL_DEREF(element);
+ if (Z_TYPE_P(element) == IS_ARRAY) {
+ cnt += php_count_recursive(Z_ARRVAL_P(element));
}
+ } ZEND_HASH_FOREACH_END();
+
+ if (!(GC_FLAGS(ht) & GC_IMMUTABLE)) {
+ GC_UNPROTECT_RECURSION(ht);
}
return cnt;
@@ -794,12 +793,10 @@ PHP_FUNCTION(count)
RETURN_LONG(0);
break;
case IS_ARRAY:
- cnt = zend_array_count(Z_ARRVAL_P(array));
- if (mode == COUNT_RECURSIVE) {
- ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(array), element) {
- ZVAL_DEREF(element);
- cnt += php_count_recursive(element, COUNT_RECURSIVE);
- } ZEND_HASH_FOREACH_END();
+ if (mode != COUNT_RECURSIVE) {
+ cnt = zend_array_count(Z_ARRVAL_P(array));
+ } else {
+ cnt = php_count_recursive(Z_ARRVAL_P(array));
}
RETURN_LONG(cnt);
break;
@@ -1431,7 +1428,7 @@ static int php_array_walk(zval *array, zval *userdata, int recursive) /* {{{ */
ZVAL_DEREF(zv);
SEPARATE_ARRAY(zv);
thash = Z_ARRVAL_P(zv);
- if (thash->u.v.nApplyCount > 1) {
+ if (GC_IS_RECURSIVE(thash)) {
php_error_docref(NULL, E_WARNING, "recursion detected");
result = FAILURE;
break;
@@ -1442,12 +1439,12 @@ static int php_array_walk(zval *array, zval *userdata, int recursive) /* {{{ */
orig_array_walk_fci_cache = BG(array_walk_fci_cache);
Z_ADDREF(ref);
- thash->u.v.nApplyCount++;
+ GC_PROTECT_RECURSION(thash);
result = php_array_walk(zv, userdata, recursive);
if (Z_TYPE_P(Z_REFVAL(ref)) == IS_ARRAY && thash == Z_ARRVAL_P(Z_REFVAL(ref))) {
/* If the hashtable changed in the meantime, we'll "leak" this apply count
* increment -- our reference to thash is no longer valid. */
- thash->u.v.nApplyCount--;
+ GC_UNPROTECT_RECURSION(thash);
}
zval_ptr_dtor(&ref);
@@ -2577,19 +2574,18 @@ static void php_compact_var(HashTable *eg_active_symbol_table, zval *return_valu
}
}
} else if (Z_TYPE_P(entry) == IS_ARRAY) {
- if ((Z_ARRVAL_P(entry)->u.v.nApplyCount > 1)) {
- php_error_docref(NULL, E_WARNING, "recursion detected");
- return;
- }
-
- if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(entry))) {
- Z_ARRVAL_P(entry)->u.v.nApplyCount++;
+ if (Z_REFCOUNTED_P(entry)) {
+ if (Z_IS_RECURSIVE_P(entry)) {
+ php_error_docref(NULL, E_WARNING, "recursion detected");
+ return;
+ }
+ Z_PROTECT_RECURSION_P(entry);
}
ZEND_HASH_FOREACH_VAL_IND(Z_ARRVAL_P(entry), value_ptr) {
php_compact_var(eg_active_symbol_table, return_value, value_ptr);
} ZEND_HASH_FOREACH_END();
- if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(entry))) {
- Z_ARRVAL_P(entry)->u.v.nApplyCount--;
+ if (Z_REFCOUNTED_P(entry)) {
+ Z_UNPROTECT_RECURSION_P(entry);
}
}
}
@@ -2899,7 +2895,7 @@ long_str:
goto err;
}
- lstep = step;
+ lstep = (zend_ulong)step;
Z_TYPE_INFO(tmp) = IS_LONG;
if (low > high) { /* Negative steps */
@@ -3636,7 +3632,7 @@ PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src) /* {{{ */
ZVAL_DEREF(src_zval);
ZVAL_DEREF(dest_zval);
thash = Z_TYPE_P(dest_zval) == IS_ARRAY ? Z_ARRVAL_P(dest_zval) : NULL;
- if ((thash && thash->u.v.nApplyCount > 1) || (src_entry == dest_entry && Z_ISREF_P(dest_entry) && (Z_REFCOUNT_P(dest_entry) % 2))) {
+ if ((thash && GC_IS_RECURSIVE(thash)) || (src_entry == dest_entry && Z_ISREF_P(dest_entry) && (Z_REFCOUNT_P(dest_entry) % 2))) {
php_error_docref(NULL, E_WARNING, "recursion detected");
return 0;
}
@@ -3662,12 +3658,12 @@ PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src) /* {{{ */
src_zval = &tmp;
}
if (Z_TYPE_P(src_zval) == IS_ARRAY) {
- if (thash && ZEND_HASH_APPLY_PROTECTION(thash)) {
- thash->u.v.nApplyCount++;
+ if (thash && !(GC_FLAGS(thash) & GC_IMMUTABLE)) {
+ GC_PROTECT_RECURSION(thash);
}
ret = php_array_merge_recursive(Z_ARRVAL_P(dest_zval), Z_ARRVAL_P(src_zval));
- if (thash && ZEND_HASH_APPLY_PROTECTION(thash)) {
- thash->u.v.nApplyCount--;
+ if (thash && !(GC_FLAGS(thash) & GC_IMMUTABLE)) {
+ GC_UNPROTECT_RECURSION(thash);
}
if (!ret) {
return 0;
@@ -3761,8 +3757,8 @@ PHPAPI int php_array_replace_recursive(HashTable *dest, HashTable *src) /* {{{ *
dest_zval = dest_entry;
ZVAL_DEREF(dest_zval);
- if (Z_ARRVAL_P(dest_zval)->u.v.nApplyCount > 1 ||
- Z_ARRVAL_P(src_zval)->u.v.nApplyCount > 1 ||
+ if (Z_IS_RECURSIVE_P(dest_zval) ||
+ Z_IS_RECURSIVE_P(src_zval) ||
(Z_ISREF_P(src_entry) && Z_ISREF_P(dest_entry) && Z_REF_P(src_entry) == Z_REF_P(dest_entry) && (Z_REFCOUNT_P(dest_entry) % 2))) {
php_error_docref(NULL, E_WARNING, "recursion detected");
return 0;
@@ -3772,20 +3768,20 @@ PHPAPI int php_array_replace_recursive(HashTable *dest, HashTable *src) /* {{{ *
SEPARATE_ZVAL(dest_entry);
dest_zval = dest_entry;
- if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(dest_zval))) {
- Z_ARRVAL_P(dest_zval)->u.v.nApplyCount++;
+ if (Z_REFCOUNTED_P(dest_zval)) {
+ Z_PROTECT_RECURSION_P(dest_zval);
}
- if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(src_zval))) {
- Z_ARRVAL_P(src_zval)->u.v.nApplyCount++;
+ if (Z_REFCOUNTED_P(src_zval)) {
+ Z_PROTECT_RECURSION_P(src_zval);
}
ret = php_array_replace_recursive(Z_ARRVAL_P(dest_zval), Z_ARRVAL_P(src_zval));
- if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(dest_zval))) {
- Z_ARRVAL_P(dest_zval)->u.v.nApplyCount--;
+ if (Z_REFCOUNTED_P(dest_zval)) {
+ Z_UNPROTECT_RECURSION_P(dest_zval);
}
- if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(src_zval))) {
- Z_ARRVAL_P(src_zval)->u.v.nApplyCount--;
+ if (Z_REFCOUNTED_P(src_zval)) {
+ Z_UNPROTECT_RECURSION_P(src_zval);
}
if (!ret) {
@@ -3992,7 +3988,7 @@ PHP_FUNCTION(array_keys)
if (HT_IS_PACKED(arrval) && HT_IS_WITHOUT_HOLES(arrval)) {
/* Optimistic case: range(0..n-1) for vector-like packed array */
ZVAL_LONG(&new_val, 0);
- for (; Z_LVAL(new_val) < elem_count; ++Z_LVAL(new_val)) {
+ for (; (zend_ulong)Z_LVAL(new_val) < elem_count; ++Z_LVAL(new_val)) {
ZEND_HASH_FILL_ADD(&new_val);
}
} else {
@@ -4408,7 +4404,7 @@ PHP_FUNCTION(array_flip)
/* }}} */
/* {{{ proto array array_change_key_case(array input [, int case=CASE_LOWER])
- Retuns an array with all string keys lowercased [or uppercased] */
+ Returns an array with all string keys lowercased [or uppercased] */
PHP_FUNCTION(array_change_key_case)
{
zval *array, *entry;
@@ -4525,7 +4521,7 @@ PHP_FUNCTION(array_unique)
RETVAL_ARR(zend_array_dup(Z_ARRVAL_P(array)));
/* create and sort array with pointers to the target_hash buckets */
- arTmp = (struct bucketindex *) pemalloc((Z_ARRVAL_P(array)->nNumOfElements + 1) * sizeof(struct bucketindex), Z_ARRVAL_P(array)->u.flags & HASH_FLAG_PERSISTENT);
+ arTmp = (struct bucketindex *) pemalloc((Z_ARRVAL_P(array)->nNumOfElements + 1) * sizeof(struct bucketindex), GC_FLAGS(Z_ARRVAL_P(array)) & IS_ARRAY_PERSISTENT);
for (i = 0, idx = 0; idx < Z_ARRVAL_P(array)->nNumUsed; idx++) {
p = Z_ARRVAL_P(array)->arData + idx;
if (Z_TYPE(p->val) == IS_UNDEF) continue;
@@ -4560,7 +4556,7 @@ PHP_FUNCTION(array_unique)
}
}
}
- pefree(arTmp, Z_ARRVAL_P(array)->u.flags & HASH_FLAG_PERSISTENT);
+ pefree(arTmp, GC_FLAGS(Z_ARRVAL_P(array)) & IS_ARRAY_PERSISTENT);
}
/* }}} */
@@ -4815,7 +4811,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
goto out;
}
hash = Z_ARRVAL(args[i]);
- list = (Bucket *) pemalloc((hash->nNumOfElements + 1) * sizeof(Bucket), hash->u.flags & HASH_FLAG_PERSISTENT);
+ list = (Bucket *) pemalloc((hash->nNumOfElements + 1) * sizeof(Bucket), GC_FLAGS(hash) & IS_ARRAY_PERSISTENT);
lists[i] = list;
ptrs[i] = list;
for (idx = 0; idx < hash->nNumUsed; idx++) {
@@ -4940,7 +4936,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
out:
for (i = 0; i < arr_argc; i++) {
hash = Z_ARRVAL(args[i]);
- pefree(lists[i], hash->u.flags & HASH_FLAG_PERSISTENT);
+ pefree(lists[i], GC_FLAGS(hash) & IS_ARRAY_PERSISTENT);
}
PHP_ARRAY_CMP_FUNC_RESTORE();
@@ -5230,7 +5226,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
goto out;
}
hash = Z_ARRVAL(args[i]);
- list = (Bucket *) pemalloc((hash->nNumOfElements + 1) * sizeof(Bucket), hash->u.flags & HASH_FLAG_PERSISTENT);
+ list = (Bucket *) pemalloc((hash->nNumOfElements + 1) * sizeof(Bucket), GC_FLAGS(hash) & IS_ARRAY_PERSISTENT);
lists[i] = list;
ptrs[i] = list;
for (idx = 0; idx < hash->nNumUsed; idx++) {
@@ -5353,7 +5349,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_
out:
for (i = 0; i < arr_argc; i++) {
hash = Z_ARRVAL(args[i]);
- pefree(lists[i], hash->u.flags & HASH_FLAG_PERSISTENT);
+ pefree(lists[i], GC_FLAGS(hash) & IS_ARRAY_PERSISTENT);
}
PHP_ARRAY_CMP_FUNC_RESTORE();
@@ -5738,7 +5734,7 @@ PHP_FUNCTION(array_rand)
if (num_req == 1) {
HashTable *ht = Z_ARRVAL_P(input);
- if (num_avail < ht->nNumUsed - (ht->nNumUsed>>1)) {
+ if ((uint32_t)num_avail < ht->nNumUsed - (ht->nNumUsed>>1)) {
/* If less than 1/2 of elements are used, don't sample. Instead search for a
* specific offset using linear scan. */
zend_long i = 0, randval = php_mt_rand_range(0, num_avail - 1);
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 383e988090..93d469168b 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -962,7 +962,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_gethostname, 0)
ZEND_END_ARG_INFO()
#endif
-#if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !defined(__BEOS__))
+#if defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC
ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_check_record, 0, 0, 1)
ZEND_ARG_INFO(0, host)
ZEND_ARG_INFO(0, type)
@@ -984,7 +984,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_get_mx, 0, 0, 2)
ZEND_END_ARG_INFO()
# endif
-#endif /* defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !defined(__BEOS__)) */
+#endif /* defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC */
/* }}} */
/* {{{ exec.c */
@@ -1204,7 +1204,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_fgetcsv, 0, 0, 1)
ZEND_ARG_INFO(0, escape)
ZEND_END_ARG_INFO()
-#if (!defined(__BEOS__) && HAVE_REALPATH) || defined(ZTS)
+#if HAVE_REALPATH || defined(ZTS)
ZEND_BEGIN_ARG_INFO(arginfo_realpath, 0)
ZEND_ARG_INFO(0, path)
ZEND_END_ARG_INFO()
@@ -3060,7 +3060,7 @@ const zend_function_entry basic_functions[] = { /* {{{ */
PHP_FE(gethostname, arginfo_gethostname)
#endif
-#if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !defined(__BEOS__))
+#if defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC
PHP_FE(dns_check_record, arginfo_dns_check_record)
PHP_FALIAS(checkdnsrr, dns_check_record, arginfo_dns_check_record)
@@ -3189,7 +3189,7 @@ const zend_function_entry basic_functions[] = { /* {{{ */
PHP_FALIAS(socket_get_status, stream_get_meta_data, arginfo_stream_get_meta_data)
-#if (!defined(__BEOS__) && HAVE_REALPATH) || defined(ZTS)
+#if HAVE_REALPATH || defined(ZTS)
PHP_FE(realpath, arginfo_realpath)
#endif
@@ -3700,7 +3700,7 @@ PHP_MINIT_FUNCTION(basic) /* {{{ */
php_register_url_stream_wrapper("http", &php_stream_http_wrapper);
php_register_url_stream_wrapper("ftp", &php_stream_ftp_wrapper);
-#if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !defined(__BEOS__))
+#if defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC
# if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS
BASIC_MINIT_SUBMODULE(dns)
# endif
@@ -3880,7 +3880,7 @@ PHP_FUNCTION(constant)
c = zend_get_constant_ex(const_name, scope, ZEND_FETCH_CLASS_SILENT);
if (c) {
ZVAL_DUP(return_value, c);
- if (Z_CONSTANT_P(return_value)) {
+ if (Z_TYPE_P(return_value) == IS_CONSTANT_AST) {
if (UNEXPECTED(zval_update_constant_ex(return_value, scope) != SUCCESS)) {
return;
}
@@ -4149,7 +4149,7 @@ PHP_FUNCTION(putenv)
pe.key_len = (int)strlen(pe.key);
#ifdef PHP_WIN32
if (equals) {
- if (pe.key_len < setting_len - 1) {
+ if ((size_t)pe.key_len < setting_len - 1) {
value = p + 1;
} else {
/* empty string*/
@@ -5411,9 +5411,9 @@ PHP_FUNCTION(ini_get_all)
}
/* }}} */
-static int php_ini_check_path(char *option_name, int option_len, char *new_option_name, int new_option_len) /* {{{ */
+static int php_ini_check_path(char *option_name, size_t option_len, char *new_option_name, size_t new_option_len) /* {{{ */
{
- if (option_len != (new_option_len - 1)) {
+ if (option_len + 1 != new_option_len) {
return 0;
}
@@ -5434,7 +5434,7 @@ PHP_FUNCTION(ini_set)
Z_PARAM_STR(new_value)
ZEND_PARSE_PARAMETERS_END();
- old_value = zend_ini_string(ZSTR_VAL(varname), (int)ZSTR_LEN(varname), 0);
+ old_value = zend_ini_string(ZSTR_VAL(varname), ZSTR_LEN(varname), 0);
/* copy to return here, because alter might free it! */
if (old_value) {
@@ -5451,7 +5451,7 @@ PHP_FUNCTION(ini_set)
RETVAL_FALSE;
}
-#define _CHECK_PATH(var, var_len, ini) php_ini_check_path(var, (int)var_len, ini, sizeof(ini))
+#define _CHECK_PATH(var, var_len, ini) php_ini_check_path(var, var_len, ini, sizeof(ini))
/* open basedir check */
if (PG(open_basedir)) {
if (_CHECK_PATH(ZSTR_VAL(varname), ZSTR_LEN(varname), "error_log") ||
@@ -5466,6 +5466,7 @@ PHP_FUNCTION(ini_set)
}
}
}
+#undef _CHECK_PATH
if (zend_alter_ini_entry_ex(varname, new_value, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0) == FAILURE) {
zval_dtor(return_value);
@@ -5917,7 +5918,7 @@ static void php_simple_ini_parser_cb(zval *arg1, zval *arg2, zval *arg3, int cal
}
if (!(Z_STRLEN_P(arg1) > 1 && Z_STRVAL_P(arg1)[0] == '0') && is_numeric_string(Z_STRVAL_P(arg1), Z_STRLEN_P(arg1), NULL, NULL, 0) == IS_LONG) {
- zend_ulong key = (zend_ulong) zend_atol(Z_STRVAL_P(arg1), (int)Z_STRLEN_P(arg1));
+ zend_ulong key = (zend_ulong) zend_atol(Z_STRVAL_P(arg1), Z_STRLEN_P(arg1));
if ((find_hash = zend_hash_index_find(Z_ARRVAL_P(arr), key)) == NULL) {
array_init(&hash);
find_hash = zend_hash_index_update(Z_ARRVAL_P(arr), key, &hash);
diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c
index 9967031f09..c54f395ab9 100644
--- a/ext/standard/browscap.c
+++ b/ext/standard/browscap.c
@@ -101,7 +101,7 @@ static uint8_t browscap_compute_prefix_len(zend_string *pattern) {
break;
}
}
- return MIN(i, UINT8_MAX);
+ return (uint8_t)MIN(i, UINT8_MAX);
}
static size_t browscap_compute_contains(
@@ -119,7 +119,7 @@ static size_t browscap_compute_contains(
}
}
}
- *contains_start = i;
+ *contains_start = (uint16_t)i;
/* Find first placeholder character after that */
for (; i < ZSTR_LEN(pattern); i++) {
@@ -127,7 +127,7 @@ static size_t browscap_compute_contains(
break;
}
}
- *contains_len = MIN(i - *contains_start, UINT8_MAX);
+ *contains_len = (uint8_t)MIN(i - *contains_start, UINT8_MAX);
return i;
}
@@ -276,9 +276,7 @@ static HashTable *browscap_entry_to_array(browser_data *bdata, browscap_entry *e
zval tmp;
uint32_t i;
- HashTable *ht;
- ALLOC_HASHTABLE(ht);
- zend_hash_init(ht, 8, NULL, ZVAL_PTR_DTOR, 0);
+ HashTable *ht = zend_new_array(8);
ZVAL_STR(&tmp, browscap_convert_pattern(entry->pattern, 0));
zend_hash_str_add(ht, "browser_name_regex", sizeof("browser_name_regex")-1, &tmp);
@@ -303,7 +301,7 @@ static void php_browscap_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callb
{
browscap_parser_ctx *ctx = arg;
browser_data *bdata = ctx->bdata;
- int persistent = bdata->htab->u.flags & HASH_FLAG_PERSISTENT;
+ int persistent = GC_FLAGS(bdata->htab) & IS_ARRAY_PERSISTENT;
if (!arg1) {
return;
diff --git a/ext/standard/credits.c b/ext/standard/credits.c
index 59b3def4f7..80bf9832e7 100644
--- a/ext/standard/credits.c
+++ b/ext/standard/credits.c
@@ -106,7 +106,7 @@ PHPAPI void php_print_credits(int flag) /* {{{ */
if (flag & PHP_CREDITS_QA) {
php_info_print_table_start();
php_info_print_table_header(1, "PHP Quality Assurance Team");
- php_info_print_table_row(1, "Ilia Alshanetsky, Joerg Behrens, Antony Dovgal, Stefan Esser, Moriyoshi Koizumi, Magnus Maatta, Sebastian Nohn, Derick Rethans, Melvyn Sopacua, Jani Taskinen, Pierre-Alain Joye, Dmitry Stogov, Felipe Pena, David Soria Parra, Stanislav Malyshev, Julien Pauli, Stephen Zarkos, Anatol Belski, Remi Collet, Ferenc Kovacs");
+ php_info_print_table_row(1, "Ilia Alshanetsky, Joerg Behrens, Antony Dovgal, Stefan Esser, Moriyoshi Koizumi, Magnus Maatta, Sebastian Nohn, Derick Rethans, Melvyn Sopacua, Pierre-Alain Joye, Dmitry Stogov, Felipe Pena, David Soria Parra, Stanislav Malyshev, Julien Pauli, Stephen Zarkos, Anatol Belski, Remi Collet, Ferenc Kovacs");
php_info_print_table_end();
}
diff --git a/ext/standard/dir.c b/ext/standard/dir.c
index 3cbc7cca2c..cc5c6d44ae 100644
--- a/ext/standard/dir.c
+++ b/ext/standard/dir.c
@@ -511,7 +511,7 @@ no_results:
}
array_init(return_value);
- for (n = 0; n < globbuf.gl_pathc; n++) {
+ for (n = 0; n < (size_t)globbuf.gl_pathc; n++) {
if (PG(open_basedir) && *PG(open_basedir)) {
if (php_check_open_basedir_ex(globbuf.gl_pathv[n], 0)) {
basedir_limit = 1;
diff --git a/ext/standard/dns.c b/ext/standard/dns.c
index ee03a31e25..68ac495353 100644
--- a/ext/standard/dns.c
+++ b/ext/standard/dns.c
@@ -304,7 +304,7 @@ static zend_string *php_gethostbyname(char *name)
#endif /* HAVE_FULL_DNS_FUNCS || defined(PHP_WIN32) */
/* Note: These functions are defined in ext/standard/dns_win32.c for Windows! */
-#if !defined(PHP_WIN32) && (HAVE_DNS_SEARCH_FUNC && !defined(__BEOS__))
+#if !defined(PHP_WIN32) && HAVE_DNS_SEARCH_FUNC
#ifndef HFIXEDSZ
#define HFIXEDSZ 12 /* fixed data in header <arpa/nameser.h> */
@@ -1114,7 +1114,7 @@ PHP_FUNCTION(dns_get_mx)
}
/* }}} */
#endif /* HAVE_FULL_DNS_FUNCS */
-#endif /* !defined(PHP_WIN32) && (HAVE_DNS_SEARCH_FUNC && !defined(__BEOS__)) */
+#endif /* !defined(PHP_WIN32) && HAVE_DNS_SEARCH_FUNC */
#if HAVE_FULL_DNS_FUNCS || defined(PHP_WIN32)
PHP_MINIT_FUNCTION(dns) {
diff --git a/ext/standard/file.c b/ext/standard/file.c
index d82c2c513e..6e76f235e2 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -2340,7 +2340,7 @@ out:
}
/* }}} */
-#if (!defined(__BEOS__) && HAVE_REALPATH) || defined(ZTS)
+#if HAVE_REALPATH || defined(ZTS)
/* {{{ proto string realpath(string path)
Return the resolved path */
PHP_FUNCTION(realpath)
diff --git a/ext/standard/file.h b/ext/standard/file.h
index 4a014c7617..94eafc6daf 100644
--- a/ext/standard/file.h
+++ b/ext/standard/file.h
@@ -62,7 +62,7 @@ PHP_FUNCTION(get_meta_tags);
PHP_FUNCTION(flock);
PHP_FUNCTION(fd_set);
PHP_FUNCTION(fd_isset);
-#if (!defined(__BEOS__) && HAVE_REALPATH) || defined(ZTS)
+#if HAVE_REALPATH || defined(ZTS)
PHP_FUNCTION(realpath);
#endif
#ifdef HAVE_FNMATCH
diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c
index b0d6a9813f..c762d30e0d 100644
--- a/ext/standard/filestat.c
+++ b/ext/standard/filestat.c
@@ -894,7 +894,7 @@ PHPAPI void php_stat(const char *filename, size_t filename_length, int type, zva
case S_IFDIR: RETURN_STRING("dir");
case S_IFBLK: RETURN_STRING("block");
case S_IFREG: RETURN_STRING("file");
-#if defined(S_IFSOCK) && !defined(ZEND_WIN32)&&!defined(__BEOS__)
+#if defined(S_IFSOCK) && !defined(PHP_WIN32)
case S_IFSOCK: RETURN_STRING("socket");
#endif
}
diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c
index d54f2f6ced..b548dddc5f 100644
--- a/ext/standard/ftp_fopen_wrapper.c
+++ b/ext/standard/ftp_fopen_wrapper.c
@@ -135,7 +135,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char
{
php_stream *stream = NULL, *reuseid = NULL;
php_url *resource = NULL;
- int result, use_ssl, use_ssl_on_data = 0, tmp_len;
+ int result, use_ssl, use_ssl_on_data = 0;
char tmp_line[512];
char *transport;
int transport_len;
@@ -148,13 +148,13 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char
return NULL;
}
- use_ssl = resource->scheme && (strlen(resource->scheme) > 3) && resource->scheme[3] == 's';
+ use_ssl = resource->scheme && (ZSTR_LEN(resource->scheme) > 3) && ZSTR_VAL(resource->scheme)[3] == 's';
/* use port 21 if one wasn't specified */
if (resource->port == 0)
resource->port = 21;
- transport_len = (int)spprintf(&transport, 0, "tcp://%s:%d", resource->host, resource->port);
+ transport_len = (int)spprintf(&transport, 0, "tcp://%s:%d", ZSTR_VAL(resource->host), resource->port);
stream = php_stream_xport_create(transport, transport_len, REPORT_ERRORS, STREAM_XPORT_CLIENT | STREAM_XPORT_CONNECT, NULL, NULL, context, NULL, NULL);
efree(transport);
if (stream == NULL) {
@@ -245,11 +245,11 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char
/* send the user name */
if (resource->user != NULL) {
- tmp_len = (int)php_raw_url_decode(resource->user, (int)strlen(resource->user));
+ ZSTR_LEN(resource->user) = php_raw_url_decode(ZSTR_VAL(resource->user), ZSTR_LEN(resource->user));
- PHP_FTP_CNTRL_CHK(resource->user, tmp_len, "Invalid login %s")
+ PHP_FTP_CNTRL_CHK(ZSTR_VAL(resource->user), ZSTR_LEN(resource->user), "Invalid login %s")
- php_stream_printf(stream, "USER %s\r\n", resource->user);
+ php_stream_printf(stream, "USER %s\r\n", ZSTR_VAL(resource->user));
} else {
php_stream_write_string(stream, "USER anonymous\r\n");
}
@@ -262,11 +262,11 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char
php_stream_notify_info(context, PHP_STREAM_NOTIFY_AUTH_REQUIRED, tmp_line, 0);
if (resource->pass != NULL) {
- tmp_len = (int)php_raw_url_decode(resource->pass, (int)strlen(resource->pass));
+ ZSTR_LEN(resource->pass) = php_raw_url_decode(ZSTR_VAL(resource->pass), ZSTR_LEN(resource->pass));
- PHP_FTP_CNTRL_CHK(resource->pass, tmp_len, "Invalid password %s")
+ PHP_FTP_CNTRL_CHK(resource->pass, ZSTR_LEN(resource->pass), "Invalid password %s")
- php_stream_printf(stream, "PASS %s\r\n", resource->pass);
+ php_stream_printf(stream, "PASS %s\r\n", ZSTR_VAL(resource->pass));
} else {
/* if the user has configured who they are,
send that as the password */
@@ -548,11 +548,11 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa
/* Append */
memcpy(tmp_line, "APPE", sizeof("APPE"));
}
- php_stream_printf(stream, "%s %s\r\n", tmp_line, (resource->path != NULL ? resource->path : "/"));
+ php_stream_printf(stream, "%s %s\r\n", tmp_line, (resource->path != NULL ? ZSTR_VAL(resource->path) : "/"));
/* open the data channel */
if (hoststart == NULL) {
- hoststart = resource->host;
+ hoststart = ZSTR_VAL(resource->host);
}
transport_len = (int)spprintf(&transport, 0, "tcp://%s:%d", hoststart, portno);
datastream = php_stream_xport_create(transport, transport_len, REPORT_ERRORS, STREAM_XPORT_CLIENT | STREAM_XPORT_CONNECT, NULL, NULL, context, NULL, NULL);
@@ -719,7 +719,7 @@ php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, const char *pat
/* open the data channel */
if (hoststart == NULL) {
- hoststart = resource->host;
+ hoststart = ZSTR_VAL(resource->host);
}
datastream = php_stream_sock_open_host(hoststart, portno, SOCK_STREAM, 0, 0);
@@ -727,7 +727,7 @@ php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, const char *pat
goto opendir_errexit;
}
- php_stream_printf(stream, "NLST %s\r\n", (resource->path != NULL ? resource->path : "/"));
+ php_stream_printf(stream, "NLST %s\r\n", (resource->path != NULL ? ZSTR_VAL(resource->path) : "/"));
result = GET_FTP_RESULT(stream);
if (result != 150 && result != 125) {
@@ -792,7 +792,7 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, const char *url,
}
ssb->sb.st_mode = 0644; /* FTP won't give us a valid mode, so approximate one based on being readable */
- php_stream_printf(stream, "CWD %s\r\n", (resource->path != NULL ? resource->path : "/")); /* If we can CWD to it, it's a directory (maybe a link, but we can't tell) */
+ php_stream_printf(stream, "CWD %s\r\n", (resource->path != NULL ? ZSTR_VAL(resource->path) : "/")); /* If we can CWD to it, it's a directory (maybe a link, but we can't tell) */
result = GET_FTP_RESULT(stream);
if (result < 200 || result > 299) {
ssb->sb.st_mode |= S_IFREG;
@@ -808,7 +808,7 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, const char *url,
goto stat_errexit;
}
- php_stream_printf(stream, "SIZE %s\r\n", (resource->path != NULL ? resource->path : "/"));
+ php_stream_printf(stream, "SIZE %s\r\n", (resource->path != NULL ? ZSTR_VAL(resource->path) : "/"));
result = GET_FTP_RESULT(stream);
if (result < 200 || result > 299) {
/* Failure either means it doesn't exist
@@ -823,7 +823,7 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, const char *url,
ssb->sb.st_size = atoi(tmp_line + 4);
}
- php_stream_printf(stream, "MDTM %s\r\n", (resource->path != NULL ? resource->path : "/"));
+ php_stream_printf(stream, "MDTM %s\r\n", (resource->path != NULL ? ZSTR_VAL(resource->path) : "/"));
result = GET_FTP_RESULT(stream);
if (result == 213) {
char *p = tmp_line + 4;
@@ -922,7 +922,7 @@ static int php_stream_ftp_unlink(php_stream_wrapper *wrapper, const char *url, i
}
/* Attempt to delete the file */
- php_stream_printf(stream, "DELE %s\r\n", (resource->path != NULL ? resource->path : "/"));
+ php_stream_printf(stream, "DELE %s\r\n", (resource->path != NULL ? ZSTR_VAL(resource->path) : "/"));
result = GET_FTP_RESULT(stream);
if (result < 200 || result > 299) {
@@ -965,10 +965,10 @@ static int php_stream_ftp_rename(php_stream_wrapper *wrapper, const char *url_fr
!resource_to ||
!resource_from->scheme ||
!resource_to->scheme ||
- strcmp(resource_from->scheme, resource_to->scheme) ||
+ !zend_string_equals(resource_from->scheme, resource_to->scheme) ||
!resource_from->host ||
!resource_to->host ||
- strcmp(resource_from->host, resource_to->host) ||
+ !zend_string_equals(resource_from->host, resource_to->host) ||
(resource_from->port != resource_to->port &&
resource_from->port * resource_to->port != 0 &&
resource_from->port + resource_to->port != 21) ||
@@ -980,13 +980,13 @@ static int php_stream_ftp_rename(php_stream_wrapper *wrapper, const char *url_fr
stream = php_ftp_fopen_connect(wrapper, url_from, "r", 0, NULL, context, NULL, NULL, NULL, NULL);
if (!stream) {
if (options & REPORT_ERRORS) {
- php_error_docref(NULL, E_WARNING, "Unable to connect to %s", resource_from->host);
+ php_error_docref(NULL, E_WARNING, "Unable to connect to %s", ZSTR_VAL(resource_from->host));
}
goto rename_errexit;
}
/* Rename FROM */
- php_stream_printf(stream, "RNFR %s\r\n", (resource_from->path != NULL ? resource_from->path : "/"));
+ php_stream_printf(stream, "RNFR %s\r\n", (resource_from->path != NULL ? ZSTR_VAL(resource_from->path) : "/"));
result = GET_FTP_RESULT(stream);
if (result < 300 || result > 399) {
@@ -997,7 +997,7 @@ static int php_stream_ftp_rename(php_stream_wrapper *wrapper, const char *url_fr
}
/* Rename TO */
- php_stream_printf(stream, "RNTO %s\r\n", (resource_to->path != NULL ? resource_to->path : "/"));
+ php_stream_printf(stream, "RNTO %s\r\n", (resource_to->path != NULL ? ZSTR_VAL(resource_to->path) : "/"));
result = GET_FTP_RESULT(stream);
if (result < 200 || result > 299) {
@@ -1051,14 +1051,14 @@ static int php_stream_ftp_mkdir(php_stream_wrapper *wrapper, const char *url, in
}
if (!recursive) {
- php_stream_printf(stream, "MKD %s\r\n", resource->path);
+ php_stream_printf(stream, "MKD %s\r\n", ZSTR_VAL(resource->path));
result = GET_FTP_RESULT(stream);
} else {
/* we look for directory separator from the end of string, thus hopefuly reducing our work load */
char *p, *e, *buf;
- buf = estrdup(resource->path);
- e = buf + strlen(buf);
+ buf = estrndup(ZSTR_VAL(resource->path), ZSTR_LEN(resource->path));
+ e = buf + ZSTR_LEN(resource->path);
/* find a top level directory we need to create */
while ((p = strrchr(buf, '/'))) {
@@ -1071,7 +1071,7 @@ static int php_stream_ftp_mkdir(php_stream_wrapper *wrapper, const char *url, in
}
}
if (p == buf) {
- php_stream_printf(stream, "MKD %s\r\n", resource->path);
+ php_stream_printf(stream, "MKD %s\r\n", ZSTR_VAL(resource->path));
result = GET_FTP_RESULT(stream);
} else {
php_stream_printf(stream, "MKD %s\r\n", buf);
diff --git a/ext/standard/http.c b/ext/standard/http.c
index e270342c7b..afbb77d1fa 100644
--- a/ext/standard/http.c
+++ b/ext/standard/http.c
@@ -42,7 +42,7 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr,
return FAILURE;
}
- if (ht->u.v.nApplyCount > 0) {
+ if (GC_IS_RECURSIVE(ht)) {
/* Prevent recursion */
return SUCCESS;
}
@@ -136,12 +136,12 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr,
*(p++) = 'B';
*p = '\0';
}
- if (ZEND_HASH_APPLY_PROTECTION(ht)) {
- ht->u.v.nApplyCount++;
+ if (!(GC_FLAGS(ht) & GC_IMMUTABLE)) {
+ GC_PROTECT_RECURSION(ht);
}
php_url_encode_hash_ex(HASH_OF(zdata), formstr, NULL, 0, newprefix, newprefix_len, "%5D", 3, (Z_TYPE_P(zdata) == IS_OBJECT ? zdata : NULL), arg_sep, enc_type);
- if (ZEND_HASH_APPLY_PROTECTION(ht)) {
- ht->u.v.nApplyCount--;
+ if (!(GC_FLAGS(ht) & GC_IMMUTABLE)) {
+ GC_UNPROTECT_RECURSION(ht);
}
efree(newprefix);
} else if (Z_TYPE_P(zdata) == IS_NULL || Z_TYPE_P(zdata) == IS_RESOURCE) {
diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c
index d803593a63..78131fbcc5 100644
--- a/ext/standard/http_fopen_wrapper.c
+++ b/ext/standard/http_fopen_wrapper.c
@@ -152,7 +152,8 @@ static php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper,
return NULL;
}
- if (strncasecmp(resource->scheme, "http", sizeof("http")) && strncasecmp(resource->scheme, "https", sizeof("https"))) {
+ if (!zend_string_equals_literal_ci(resource->scheme, "http") &&
+ !zend_string_equals_literal_ci(resource->scheme, "https")) {
if (!context ||
(tmpzval = php_stream_context_get_option(context, wrapper->wops->label, "proxy")) == NULL ||
Z_TYPE_P(tmpzval) != IS_STRING ||
@@ -176,7 +177,7 @@ static php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper,
return NULL;
}
- use_ssl = resource->scheme && (strlen(resource->scheme) > 4) && resource->scheme[4] == 's';
+ use_ssl = resource->scheme && (ZSTR_LEN(resource->scheme) > 4) && ZSTR_VAL(resource->scheme)[4] == 's';
/* choose default ports */
if (use_ssl && resource->port == 0)
resource->port = 443;
@@ -191,7 +192,7 @@ static php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper,
transport_len = Z_STRLEN_P(tmpzval);
transport_string = estrndup(Z_STRVAL_P(tmpzval), Z_STRLEN_P(tmpzval));
} else {
- transport_len = spprintf(&transport_string, 0, "%s://%s:%d", use_ssl ? "ssl" : "tcp", resource->host, resource->port);
+ transport_len = spprintf(&transport_string, 0, "%s://%s:%d", use_ssl ? "ssl" : "tcp", ZSTR_VAL(resource->host), resource->port);
}
}
@@ -234,13 +235,13 @@ static php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper,
/* Set peer_name or name verification will try to use the proxy server name */
if (!context || (tmpzval = php_stream_context_get_option(context, "ssl", "peer_name")) == NULL) {
- ZVAL_STRING(&ssl_proxy_peer_name, resource->host);
+ ZVAL_STR_COPY(&ssl_proxy_peer_name, resource->host);
php_stream_context_set_option(PHP_STREAM_CONTEXT(stream), "ssl", "peer_name", &ssl_proxy_peer_name);
zval_ptr_dtor(&ssl_proxy_peer_name);
}
smart_str_appendl(&header, "CONNECT ", sizeof("CONNECT ")-1);
- smart_str_appends(&header, resource->host);
+ smart_str_appends(&header, ZSTR_VAL(resource->host));
smart_str_appendc(&header, ':');
smart_str_append_unsigned(&header, resource->port);
smart_str_appendl(&header, " HTTP/1.0\r\n", sizeof(" HTTP/1.0\r\n")-1);
@@ -388,8 +389,8 @@ finish:
/* Send the traditional /path/to/file?query_string */
/* file */
- if (resource->path && *resource->path) {
- smart_str_appends(&req_buf, resource->path);
+ if (resource->path && ZSTR_LEN(resource->path)) {
+ smart_str_appends(&req_buf, ZSTR_VAL(resource->path));
} else {
smart_str_appendc(&req_buf, '/');
}
@@ -397,7 +398,7 @@ finish:
/* query string */
if (resource->query) {
smart_str_appendc(&req_buf, '?');
- smart_str_appends(&req_buf, resource->query);
+ smart_str_appends(&req_buf, ZSTR_VAL(resource->query));
}
}
@@ -531,15 +532,15 @@ finish:
zend_string *stmp;
/* decode the strings first */
- php_url_decode(resource->user, strlen(resource->user));
+ php_url_decode(ZSTR_VAL(resource->user), ZSTR_LEN(resource->user));
- strcpy(scratch, resource->user);
+ strcpy(scratch, ZSTR_VAL(resource->user));
strcat(scratch, ":");
/* Note: password is optional! */
if (resource->pass) {
- php_url_decode(resource->pass, strlen(resource->pass));
- strcat(scratch, resource->pass);
+ php_url_decode(ZSTR_VAL(resource->pass), ZSTR_LEN(resource->pass));
+ strcat(scratch, ZSTR_VAL(resource->pass));
}
stmp = php_base64_encode((unsigned char*)scratch, strlen(scratch));
@@ -564,7 +565,7 @@ finish:
/* Send Host: header so name-based virtual hosts work */
if ((have_header & HTTP_HEADER_HOST) == 0) {
smart_str_appends(&req_buf, "Host: ");
- smart_str_appends(&req_buf, resource->host);
+ smart_str_appends(&req_buf, ZSTR_VAL(resource->host));
if ((use_ssl && resource->port != 443 && resource->port != 0) ||
(!use_ssl && resource->port != 80 && resource->port != 0)) {
smart_str_appendc(&req_buf, ':');
@@ -855,21 +856,24 @@ finish:
{
if (*location != '/') {
if (*(location+1) != '\0' && resource->path) {
- char *s = strrchr(resource->path, '/');
+ char *s = strrchr(ZSTR_VAL(resource->path), '/');
if (!s) {
- s = resource->path;
- if (!s[0]) {
- efree(s);
- s = resource->path = estrdup("/");
+ s = ZSTR_VAL(resource->path);
+ if (!ZSTR_LEN(resource->path)) {
+ zend_string_release(resource->path);
+ resource->path = zend_string_init("/", 1, 0);
+ s = ZSTR_VAL(resource->path);
} else {
*s = '/';
}
}
s[1] = '\0';
- if (resource->path && *(resource->path) == '/' && *(resource->path + 1) == '\0') {
- snprintf(loc_path, sizeof(loc_path) - 1, "%s%s", resource->path, location);
+ if (resource->path &&
+ ZSTR_VAL(resource->path)[0] == '/' &&
+ ZSTR_VAL(resource->path)[1] == '\0') {
+ snprintf(loc_path, sizeof(loc_path) - 1, "%s%s", ZSTR_VAL(resource->path), location);
} else {
- snprintf(loc_path, sizeof(loc_path) - 1, "%s/%s", resource->path, location);
+ snprintf(loc_path, sizeof(loc_path) - 1, "%s/%s", ZSTR_VAL(resource->path), location);
}
} else {
snprintf(loc_path, sizeof(loc_path) - 1, "/%s", location);
@@ -878,9 +882,9 @@ finish:
strlcpy(loc_path, location, sizeof(loc_path));
}
if ((use_ssl && resource->port != 443) || (!use_ssl && resource->port != 80)) {
- snprintf(new_path, sizeof(new_path) - 1, "%s://%s:%d%s", resource->scheme, resource->host, resource->port, loc_path);
+ snprintf(new_path, sizeof(new_path) - 1, "%s://%s:%d%s", ZSTR_VAL(resource->scheme), ZSTR_VAL(resource->host), resource->port, loc_path);
} else {
- snprintf(new_path, sizeof(new_path) - 1, "%s://%s%s", resource->scheme, resource->host, loc_path);
+ snprintf(new_path, sizeof(new_path) - 1, "%s://%s%s", ZSTR_VAL(resource->scheme), ZSTR_VAL(resource->host), loc_path);
}
} else {
strlcpy(new_path, location, sizeof(new_path));
@@ -896,9 +900,8 @@ finish:
#define CHECK_FOR_CNTRL_CHARS(val) { \
if (val) { \
unsigned char *s, *e; \
- size_t l; \
- l = php_url_decode(val, strlen(val)); \
- s = (unsigned char*)val; e = s + l; \
+ ZSTR_LEN(val) = php_url_decode(ZSTR_VAL(val), ZSTR_LEN(val)); \
+ s = (unsigned char*)ZSTR_VAL(val); e = s + ZSTR_LEN(val); \
while (s < e) { \
if (iscntrl(*s)) { \
php_stream_wrapper_log_error(wrapper, options, "Invalid redirect URL! %s", new_path); \
@@ -910,9 +913,9 @@ finish:
}
/* check for control characters in login, password & path */
if (strncasecmp(new_path, "http://", sizeof("http://") - 1) || strncasecmp(new_path, "https://", sizeof("https://") - 1)) {
- CHECK_FOR_CNTRL_CHARS(resource->user)
- CHECK_FOR_CNTRL_CHARS(resource->pass)
- CHECK_FOR_CNTRL_CHARS(resource->path)
+ CHECK_FOR_CNTRL_CHARS(resource->user);
+ CHECK_FOR_CNTRL_CHARS(resource->pass);
+ CHECK_FOR_CNTRL_CHARS(resource->path);
}
stream = php_stream_url_wrap_http_ex(
wrapper, new_path, mode, options, opened_path, context,
diff --git a/ext/standard/image.c b/ext/standard/image.c
index 9deb5a8a74..5cd95ad400 100644
--- a/ext/standard/image.c
+++ b/ext/standard/image.c
@@ -1186,7 +1186,7 @@ PHPAPI char * php_image_type_to_mime_type(int image_type)
case IMAGE_FILETYPE_PSD:
return "image/psd";
case IMAGE_FILETYPE_BMP:
- return "image/x-ms-bmp";
+ return "image/bmp";
case IMAGE_FILETYPE_TIFF_II:
case IMAGE_FILETYPE_TIFF_MM:
return "image/tiff";
diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c
index e92e721b88..797e2a2eca 100644
--- a/ext/standard/iptc.c
+++ b/ext/standard/iptc.c
@@ -275,7 +275,7 @@ PHP_FUNCTION(iptcembed)
iptcdata_len++; /* make the length even */
}
- psheader[ 2 ] = (iptcdata_len+28)>>8;
+ psheader[ 2 ] = (char) (iptcdata_len+28)>>8;
psheader[ 3 ] = (iptcdata_len+28)&0xff;
for (inx = 0; inx < 28; inx++) {
diff --git a/ext/standard/lcg.c b/ext/standard/lcg.c
index af826c547b..f8b7e8d340 100644
--- a/ext/standard/lcg.c
+++ b/ext/standard/lcg.c
@@ -118,6 +118,9 @@ PHP_MINIT_FUNCTION(lcg) /* {{{ */
Returns a value from the combined linear congruential generator */
PHP_FUNCTION(lcg_value)
{
+ if (zend_parse_parameters_none() == FAILURE) {
+ return;
+ }
RETURN_DOUBLE(php_combined_lcg());
}
/* }}} */
diff --git a/ext/standard/link.c b/ext/standard/link.c
index c55e6f4b0a..7e0a6d3876 100644
--- a/ext/standard/link.c
+++ b/ext/standard/link.c
@@ -57,7 +57,7 @@ PHP_FUNCTION(readlink)
char *link;
size_t link_len;
char buff[MAXPATHLEN];
- int ret;
+ ssize_t ret;
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_PATH(link, link_len)
diff --git a/ext/standard/link_win32.c b/ext/standard/link_win32.c
index 53ce7fbb4d..406526128f 100644
--- a/ext/standard/link_win32.c
+++ b/ext/standard/link_win32.c
@@ -63,7 +63,7 @@ TODO:
PHP_FUNCTION(readlink)
{
char *link;
- size_t link_len;
+ ssize_t link_len;
char target[MAXPATHLEN];
if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &link, &link_len) == FAILURE) {
@@ -74,7 +74,8 @@ PHP_FUNCTION(readlink)
RETURN_FALSE;
}
- if (php_sys_readlink(link, target, MAXPATHLEN) == -1) {
+ link_len = php_sys_readlink(link, target, MAXPATHLEN);
+ if (link_len == -1) {
php_error_docref(NULL, E_WARNING, "readlink failed to read the symbolic link (%s), error %d)", link, GetLastError());
RETURN_FALSE;
}
diff --git a/ext/standard/math.c b/ext/standard/math.c
index 6f7bede332..8285edeeda 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -1193,7 +1193,7 @@ PHPAPI zend_string *_php_math_number_format_ex(double d, int dec, char *dec_poin
* we requested due to internal buffer limitations */
if (dec) {
size_t declen = (dp ? s - dp : 0);
- size_t topad = dec > declen ? dec - declen : 0;
+ size_t topad = (size_t)dec > declen ? dec - declen : 0;
/* pad with '0's */
while (topad--) {
diff --git a/ext/standard/microtime.c b/ext/standard/microtime.c
index 0373a32a5d..aa63a6e42e 100644
--- a/ext/standard/microtime.c
+++ b/ext/standard/microtime.c
@@ -136,7 +136,7 @@ PHP_FUNCTION(getrusage)
#ifdef PHP_WIN32 /* Windows only implements a limited amount of fields from the rusage struct */
PHP_RUSAGE_PARA(ru_majflt);
PHP_RUSAGE_PARA(ru_maxrss);
-#elif !defined( _OSD_POSIX) && !defined(__BEOS__) /* BS2000 has only a few fields in the rusage struct*/
+#elif !defined(_OSD_POSIX)
PHP_RUSAGE_PARA(ru_oublock);
PHP_RUSAGE_PARA(ru_inblock);
PHP_RUSAGE_PARA(ru_msgsnd);
diff --git a/ext/standard/password.c b/ext/standard/password.c
index 7f99f21e29..f49624e655 100644
--- a/ext/standard/password.c
+++ b/ext/standard/password.c
@@ -415,9 +415,6 @@ PHP_FUNCTION(password_hash)
zend_long algo = PHP_PASSWORD_DEFAULT;
HashTable *options = NULL;
-#if HAVE_ARGON2LIB
-#endif
-
ZEND_PARSE_PARAMETERS_START(2, 3)
Z_PARAM_STR(password)
Z_PARAM_LONG(algo)
diff --git a/ext/standard/php_array.h b/ext/standard/php_array.h
index 2b58db71e3..d9c5eedc18 100644
--- a/ext/standard/php_array.h
+++ b/ext/standard/php_array.h
@@ -107,7 +107,7 @@ PHPAPI int php_array_merge(HashTable *dest, HashTable *src);
PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src);
PHPAPI int php_array_replace_recursive(HashTable *dest, HashTable *src);
PHPAPI int php_multisort_compare(const void *a, const void *b);
-PHPAPI zend_long php_count_recursive(zval *array, zend_long mode);
+PHPAPI zend_long php_count_recursive(HashTable *ht);
#define PHP_SORT_REGULAR 0
#define PHP_SORT_NUMERIC 1
diff --git a/ext/standard/php_dns.h b/ext/standard/php_dns.h
index a95e2c0d7e..8905ff97d4 100644
--- a/ext/standard/php_dns.h
+++ b/ext/standard/php_dns.h
@@ -65,7 +65,7 @@ PHP_FUNCTION(gethostbynamel);
PHP_FUNCTION(gethostname);
#endif
-#if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !defined(__BEOS__))
+#if defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC
PHP_FUNCTION(dns_check_record);
# if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS
@@ -74,7 +74,7 @@ PHP_FUNCTION(dns_get_record);
PHP_MINIT_FUNCTION(dns);
# endif
-#endif /* defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !defined(__BEOS__)) */
+#endif /* defined(PHP_WIN32) || HAVE_DNS_SEARCH_FUNC */
#ifndef INT16SZ
#define INT16SZ 2
diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c
index 0031440704..8e7b95e739 100644
--- a/ext/standard/php_fopen_wrapper.c
+++ b/ext/standard/php_fopen_wrapper.c
@@ -28,6 +28,7 @@
#include "php.h"
#include "php_globals.h"
#include "php_standard.h"
+#include "php_memory_streams.h"
#include "php_fopen_wrappers.h"
#include "SAPI.h"
@@ -203,20 +204,12 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa
return NULL;
}
}
- if (strpbrk(mode, "wa+")) {
- mode_rw = TEMP_STREAM_DEFAULT;
- } else {
- mode_rw = TEMP_STREAM_READONLY;
- }
+ mode_rw = php_stream_mode_from_str(mode);
return php_stream_temp_create(mode_rw, max_memory);
}
if (!strcasecmp(path, "memory")) {
- if (strpbrk(mode, "wa+")) {
- mode_rw = TEMP_STREAM_DEFAULT;
- } else {
- mode_rw = TEMP_STREAM_READONLY;
- }
+ mode_rw = php_stream_mode_from_str(mode);
return php_stream_memory_create(mode_rw);
}
@@ -395,7 +388,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa
return NULL;
}
-#if defined(S_IFSOCK) && !defined(WIN32) && !defined(__BEOS__)
+#if defined(S_IFSOCK) && !defined(PHP_WIN32)
do {
zend_stat_t st;
memset(&st, 0, sizeof(st));
diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c
index 1c0c07b79b..b8d189d47d 100644
--- a/ext/standard/streamsfuncs.c
+++ b/ext/standard/streamsfuncs.c
@@ -665,8 +665,7 @@ static int stream_array_from_fd_set(zval *stream_array, fd_set *fds)
if (Z_TYPE_P(stream_array) != IS_ARRAY) {
return 0;
}
- ZVAL_NEW_ARR(&new_array);
- zend_hash_init(Z_ARRVAL(new_array), zend_hash_num_elements(Z_ARRVAL_P(stream_array)), NULL, ZVAL_PTR_DTOR, 0);
+ array_init_size(&new_array, zend_hash_num_elements(Z_ARRVAL_P(stream_array)));
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(stream_array), num_ind, key, elem) {
php_socket_t this_fd;
@@ -714,8 +713,7 @@ static int stream_array_emulate_read_fd_set(zval *stream_array)
if (Z_TYPE_P(stream_array) != IS_ARRAY) {
return 0;
}
- ZVAL_NEW_ARR(&new_array);
- zend_hash_init(Z_ARRVAL(new_array), zend_hash_num_elements(Z_ARRVAL_P(stream_array)), NULL, ZVAL_PTR_DTOR, 0);
+ array_init_size(&new_array, zend_hash_num_elements(Z_ARRVAL_P(stream_array)));
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(stream_array), elem) {
ZVAL_DEREF(elem);
@@ -1559,7 +1557,7 @@ PHP_FUNCTION(stream_resolve_include_path)
Z_PARAM_PATH(filename, filename_len)
ZEND_PARSE_PARAMETERS_END();
- resolved_path = zend_resolve_path(filename, (int)filename_len);
+ resolved_path = zend_resolve_path(filename, filename_len);
if (resolved_path) {
RETURN_STR(resolved_path);
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 6ffc2ae2bb..55bcca14db 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -2789,11 +2789,16 @@ PHP_FUNCTION(chr)
/* {{{ php_ucfirst
Uppercase the first character of the word in a native string */
-static void php_ucfirst(char *str)
+static zend_string* php_ucfirst(zend_string *str)
{
- register char *r;
- r = str;
- *r = toupper((unsigned char) *r);
+ unsigned char r = toupper(ZSTR_VAL(str)[0]);
+ if (r == ZSTR_VAL(str)[0]) {
+ return zend_string_copy(str);
+ } else {
+ zend_string *s = zend_string_init(ZSTR_VAL(str), ZSTR_LEN(str), 0);
+ ZSTR_VAL(s)[0] = r;
+ return s;
+ }
}
/* }}} */
@@ -2811,18 +2816,22 @@ PHP_FUNCTION(ucfirst)
RETURN_EMPTY_STRING();
}
- ZVAL_STRINGL(return_value, ZSTR_VAL(str), ZSTR_LEN(str));
- php_ucfirst(Z_STRVAL_P(return_value));
+ RETURN_STR(php_ucfirst(str));
}
/* }}} */
/* {{{
Lowercase the first character of the word in a native string */
-static void php_lcfirst(char *str)
+static zend_string* php_lcfirst(zend_string *str)
{
- register char *r;
- r = str;
- *r = tolower((unsigned char) *r);
+ unsigned char r = tolower(ZSTR_VAL(str)[0]);
+ if (r == ZSTR_VAL(str)[0]) {
+ return zend_string_copy(str);
+ } else {
+ zend_string *s = zend_string_init(ZSTR_VAL(str), ZSTR_LEN(str), 0);
+ ZSTR_VAL(s)[0] = r;
+ return s;
+ }
}
/* }}} */
@@ -2840,8 +2849,7 @@ PHP_FUNCTION(lcfirst)
RETURN_EMPTY_STRING();
}
- ZVAL_STRINGL(return_value, ZSTR_VAL(str), ZSTR_LEN(str));
- php_lcfirst(Z_STRVAL_P(return_value));
+ RETURN_STR(php_lcfirst(str));
}
/* }}} */
diff --git a/ext/standard/tests/array/array_change_key_case_variation1.phpt b/ext/standard/tests/array/array_change_key_case_variation1.phpt
index 86653930f1..cf73693965 100644
--- a/ext/standard/tests/array/array_change_key_case_variation1.phpt
+++ b/ext/standard/tests/array/array_change_key_case_variation1.phpt
@@ -3,7 +3,7 @@ Test array_change_key_case() function : usage variations - Pass different data t
--FILE--
<?php
/* Prototype : array array_change_key_case(array $input [, int $case])
- * Description: Retuns an array with all string keys lowercased [or uppercased]
+ * Description: Returns an array with all string keys lowercased [or uppercased]
* Source code: ext/standard/array.c
*/
diff --git a/ext/standard/tests/array/array_change_key_case_variation2.phpt b/ext/standard/tests/array/array_change_key_case_variation2.phpt
index f2a9385234..6b2f4ef1ab 100644
--- a/ext/standard/tests/array/array_change_key_case_variation2.phpt
+++ b/ext/standard/tests/array/array_change_key_case_variation2.phpt
@@ -5,7 +5,7 @@ Test array_change_key_case() function : usage variations - Pass different data t
--FILE--
<?php
/* Prototype : array array_change_key_case(array $input [, int $case])
- * Description: Retuns an array with all string keys lowercased [or uppercased]
+ * Description: Returns an array with all string keys lowercased [or uppercased]
* Source code: ext/standard/array.c
*/
diff --git a/ext/standard/tests/array/array_change_key_case_variation3.phpt b/ext/standard/tests/array/array_change_key_case_variation3.phpt
index 596703385c..f395f8ed6b 100644
--- a/ext/standard/tests/array/array_change_key_case_variation3.phpt
+++ b/ext/standard/tests/array/array_change_key_case_variation3.phpt
@@ -3,7 +3,7 @@ Test array_change_key_case() function : usage variations - different data types
--FILE--
<?php
/* Prototype : array array_change_key_case(array $input [, int $case])
- * Description: Retuns an array with all string keys lowercased [or uppercased]
+ * Description: Returns an array with all string keys lowercased [or uppercased]
* Source code: ext/standard/array.c
*/
diff --git a/ext/standard/tests/array/array_change_key_case_variation4.phpt b/ext/standard/tests/array/array_change_key_case_variation4.phpt
index ad9ad75a38..89b6ee0797 100644
--- a/ext/standard/tests/array/array_change_key_case_variation4.phpt
+++ b/ext/standard/tests/array/array_change_key_case_variation4.phpt
@@ -3,7 +3,7 @@ Test array_change_key_case() function : usage variations - different int values
--FILE--
<?php
/* Prototype : array array_change_key_case(array $input [, int $case])
- * Description: Retuns an array with all string keys lowercased [or uppercased]
+ * Description: Returns an array with all string keys lowercased [or uppercased]
* Source code: ext/standard/array.c
*/
diff --git a/ext/standard/tests/array/array_change_key_case_variation5.phpt b/ext/standard/tests/array/array_change_key_case_variation5.phpt
index aa3852a41f..185534f9be 100644
--- a/ext/standard/tests/array/array_change_key_case_variation5.phpt
+++ b/ext/standard/tests/array/array_change_key_case_variation5.phpt
@@ -3,7 +3,7 @@ Test array_change_key_case() function : usage variations - position of internal
--FILE--
<?php
/* Prototype : array array_change_key_case(array $input [, int $case])
- * Description: Retuns an array with all string keys lowercased [or uppercased]
+ * Description: Returns an array with all string keys lowercased [or uppercased]
* Source code: ext/standard/array.c
*/
diff --git a/ext/standard/tests/array/array_change_key_case_variation6.phpt b/ext/standard/tests/array/array_change_key_case_variation6.phpt
index d4371d3459..3cafb4d0ad 100644
--- a/ext/standard/tests/array/array_change_key_case_variation6.phpt
+++ b/ext/standard/tests/array/array_change_key_case_variation6.phpt
@@ -3,7 +3,7 @@ Test array_change_key_case() function : usage variations - multidimensional arra
--FILE--
<?php
/* Prototype : array array_change_key_case(array $input [, int $case])
- * Description: Retuns an array with all string keys lowercased [or uppercased]
+ * Description: Returns an array with all string keys lowercased [or uppercased]
* Source code: ext/standard/array.c
*/
diff --git a/ext/standard/tests/array/array_change_key_case_variation7.phpt b/ext/standard/tests/array/array_change_key_case_variation7.phpt
index 8cbc23a12f..a08a1afa8c 100644
--- a/ext/standard/tests/array/array_change_key_case_variation7.phpt
+++ b/ext/standard/tests/array/array_change_key_case_variation7.phpt
@@ -3,7 +3,7 @@ Test array_change_key_case() function : usage variations - referenced variables
--FILE--
<?php
/* Prototype : array array_change_key_case(array $input [, int $case])
- * Description: Retuns an array with all string keys lowercased [or uppercased]
+ * Description: Returns an array with all string keys lowercased [or uppercased]
* Source code: ext/standard/array.c
*/
diff --git a/ext/standard/tests/array/compact_variation1.phpt b/ext/standard/tests/array/compact_variation1.phpt
index ea48132857..d2b9fc45df 100644
--- a/ext/standard/tests/array/compact_variation1.phpt
+++ b/ext/standard/tests/array/compact_variation1.phpt
@@ -37,10 +37,6 @@ array(1) {
Warning: compact(): recursion detected in %s on line %d
Warning: compact(): recursion detected in %s on line %d
-
-Warning: compact(): recursion detected in %s on line %d
-
-Warning: compact(): recursion detected in %s on line %d
array(2) {
["a"]=>
int(1)
diff --git a/ext/standard/tests/array/count_variation3.phpt b/ext/standard/tests/array/count_variation3.phpt
index e11b4c2449..9c89bcd16b 100644
--- a/ext/standard/tests/array/count_variation3.phpt
+++ b/ext/standard/tests/array/count_variation3.phpt
@@ -35,5 +35,5 @@ int(4)
-- $mode = 1: --
Warning: count(): recursion detected in %s on line %d
-int(12)
+int(4)
Done
diff --git a/ext/standard/tests/file/file.inc b/ext/standard/tests/file/file.inc
index aff9d107d9..1a98d16dfb 100644
--- a/ext/standard/tests/file/file.inc
+++ b/ext/standard/tests/file/file.inc
@@ -528,7 +528,7 @@ function delete_links($file_path,
corresponding next 13 values of the same stat for equality
$stat = stat array
- Retuns: true when all of them match, false otherwise
+ Returns: true when all of them match, false otherwise
*/
function compare_self_stat( array $stat )
{
diff --git a/ext/standard/tests/general_functions/debug_zval_dump_o.phpt b/ext/standard/tests/general_functions/debug_zval_dump_o.phpt
index c06dff556d..e2c84dae9b 100644
--- a/ext/standard/tests/general_functions/debug_zval_dump_o.phpt
+++ b/ext/standard/tests/general_functions/debug_zval_dump_o.phpt
@@ -135,25 +135,7 @@ object(object_class)#%d (6) refcount(%d){
int(3)
}
["object_class1"]=>
- object(object_class)#%d (6) refcount(%d){
- ["value1"]=>
- int(5)
- ["value2":"object_class":private]=>
- int(10)
- ["value3":protected]=>
- int(20)
- ["value4"]=>
- int(30)
- ["array_var"]=>
- array(2) refcount(%d){
- ["key1"]=>
- int(1)
- ["key2 "]=>
- int(3)
- }
- ["object_class1"]=>
- *RECURSION*
- }
+ *RECURSION*
}
-- Iteration 2 --
object(no_member_class)#%d (0) refcount(%d){
@@ -184,25 +166,7 @@ object(contains_object_class)#%d (9) refcount(%d){
int(3)
}
["object_class1"]=>
- object(object_class)#%d (6) refcount(%d){
- ["value1"]=>
- int(5)
- ["value2":"object_class":private]=>
- int(10)
- ["value3":protected]=>
- int(20)
- ["value4"]=>
- int(30)
- ["array_var"]=>
- array(2) refcount(%d){
- ["key1"]=>
- int(1)
- ["key2 "]=>
- int(3)
- }
- ["object_class1"]=>
- *RECURSION*
- }
+ *RECURSION*
}
["class_object2"]=>
object(object_class)#%d (6) refcount(%d){
@@ -222,25 +186,7 @@ object(contains_object_class)#%d (9) refcount(%d){
int(3)
}
["object_class1"]=>
- object(object_class)#%d (6) refcount(%d){
- ["value1"]=>
- int(5)
- ["value2":"object_class":private]=>
- int(10)
- ["value3":protected]=>
- int(20)
- ["value4"]=>
- int(30)
- ["array_var"]=>
- array(2) refcount(%d){
- ["key1"]=>
- int(1)
- ["key2 "]=>
- int(3)
- }
- ["object_class1"]=>
- *RECURSION*
- }
+ *RECURSION*
}
["class_object3":"contains_object_class":private]=>
object(object_class)#%d (6) refcount(%d){
@@ -260,25 +206,7 @@ object(contains_object_class)#%d (9) refcount(%d){
int(3)
}
["object_class1"]=>
- object(object_class)#%d (6) refcount(%d){
- ["value1"]=>
- int(5)
- ["value2":"object_class":private]=>
- int(10)
- ["value3":protected]=>
- int(20)
- ["value4"]=>
- int(30)
- ["array_var"]=>
- array(2) refcount(%d){
- ["key1"]=>
- int(1)
- ["key2 "]=>
- int(3)
- }
- ["object_class1"]=>
- *RECURSION*
- }
+ *RECURSION*
}
["class_object4":protected]=>
object(object_class)#%d (6) refcount(%d){
@@ -298,195 +226,13 @@ object(contains_object_class)#%d (9) refcount(%d){
int(3)
}
["object_class1"]=>
- object(object_class)#%d (6) refcount(%d){
- ["value1"]=>
- int(5)
- ["value2":"object_class":private]=>
- int(10)
- ["value3":protected]=>
- int(20)
- ["value4"]=>
- int(30)
- ["array_var"]=>
- array(2) refcount(%d){
- ["key1"]=>
- int(1)
- ["key2 "]=>
- int(3)
- }
- ["object_class1"]=>
- *RECURSION*
- }
+ *RECURSION*
}
["no_member_class_object"]=>
object(no_member_class)#%d (0) refcount(%d){
}
["class_object5"]=>
- object(contains_object_class)#%d (9) refcount(%d){
- ["p"]=>
- int(30)
- ["p1":protected]=>
- int(40)
- ["p2":"contains_object_class":private]=>
- int(50)
- ["class_object1"]=>
- object(object_class)#%d (6) refcount(%d){
- ["value1"]=>
- int(5)
- ["value2":"object_class":private]=>
- int(10)
- ["value3":protected]=>
- int(20)
- ["value4"]=>
- int(30)
- ["array_var"]=>
- array(2) refcount(%d){
- ["key1"]=>
- int(1)
- ["key2 "]=>
- int(3)
- }
- ["object_class1"]=>
- object(object_class)#%d (6) refcount(%d){
- ["value1"]=>
- int(5)
- ["value2":"object_class":private]=>
- int(10)
- ["value3":protected]=>
- int(20)
- ["value4"]=>
- int(30)
- ["array_var"]=>
- array(2) refcount(%d){
- ["key1"]=>
- int(1)
- ["key2 "]=>
- int(3)
- }
- ["object_class1"]=>
- *RECURSION*
- }
- }
- ["class_object2"]=>
- object(object_class)#%d (6) refcount(%d){
- ["value1"]=>
- int(5)
- ["value2":"object_class":private]=>
- int(10)
- ["value3":protected]=>
- int(20)
- ["value4"]=>
- int(30)
- ["array_var"]=>
- array(2) refcount(%d){
- ["key1"]=>
- int(1)
- ["key2 "]=>
- int(3)
- }
- ["object_class1"]=>
- object(object_class)#%d (6) refcount(%d){
- ["value1"]=>
- int(5)
- ["value2":"object_class":private]=>
- int(10)
- ["value3":protected]=>
- int(20)
- ["value4"]=>
- int(30)
- ["array_var"]=>
- array(2) refcount(%d){
- ["key1"]=>
- int(1)
- ["key2 "]=>
- int(3)
- }
- ["object_class1"]=>
- *RECURSION*
- }
- }
- ["class_object3":"contains_object_class":private]=>
- object(object_class)#%d (6) refcount(%d){
- ["value1"]=>
- int(5)
- ["value2":"object_class":private]=>
- int(10)
- ["value3":protected]=>
- int(20)
- ["value4"]=>
- int(30)
- ["array_var"]=>
- array(2) refcount(%d){
- ["key1"]=>
- int(1)
- ["key2 "]=>
- int(3)
- }
- ["object_class1"]=>
- object(object_class)#%d (6) refcount(%d){
- ["value1"]=>
- int(5)
- ["value2":"object_class":private]=>
- int(10)
- ["value3":protected]=>
- int(20)
- ["value4"]=>
- int(30)
- ["array_var"]=>
- array(2) refcount(%d){
- ["key1"]=>
- int(1)
- ["key2 "]=>
- int(3)
- }
- ["object_class1"]=>
- *RECURSION*
- }
- }
- ["class_object4":protected]=>
- object(object_class)#%d (6) refcount(%d){
- ["value1"]=>
- int(5)
- ["value2":"object_class":private]=>
- int(10)
- ["value3":protected]=>
- int(20)
- ["value4"]=>
- int(30)
- ["array_var"]=>
- array(2) refcount(%d){
- ["key1"]=>
- int(1)
- ["key2 "]=>
- int(3)
- }
- ["object_class1"]=>
- object(object_class)#%d (6) refcount(%d){
- ["value1"]=>
- int(5)
- ["value2":"object_class":private]=>
- int(10)
- ["value3":protected]=>
- int(20)
- ["value4"]=>
- int(30)
- ["array_var"]=>
- array(2) refcount(%d){
- ["key1"]=>
- int(1)
- ["key2 "]=>
- int(3)
- }
- ["object_class1"]=>
- *RECURSION*
- }
- }
- ["no_member_class_object"]=>
- object(no_member_class)#%d (0) refcount(%d){
- }
- ["class_object5"]=>
- *RECURSION*
- }
+ *RECURSION*
}
-- Iteration 4 --
object(object_class)#%d (6) refcount(%d){
@@ -506,25 +252,7 @@ object(object_class)#%d (6) refcount(%d){
int(3)
}
["object_class1"]=>
- object(object_class)#%d (6) refcount(%d){
- ["value1"]=>
- int(5)
- ["value2":"object_class":private]=>
- int(10)
- ["value3":protected]=>
- int(20)
- ["value4"]=>
- int(30)
- ["array_var"]=>
- array(2) refcount(%d){
- ["key1"]=>
- int(1)
- ["key2 "]=>
- int(3)
- }
- ["object_class1"]=>
- *RECURSION*
- }
+ *RECURSION*
}
-- Iteration 5 --
object(object_class)#%d (6) refcount(%d){
@@ -544,25 +272,7 @@ object(object_class)#%d (6) refcount(%d){
int(3)
}
["object_class1"]=>
- object(object_class)#%d (6) refcount(%d){
- ["value1"]=>
- int(5)
- ["value2":"object_class":private]=>
- int(10)
- ["value3":protected]=>
- int(20)
- ["value4"]=>
- int(30)
- ["array_var"]=>
- array(2) refcount(%d){
- ["key1"]=>
- int(1)
- ["key2 "]=>
- int(3)
- }
- ["object_class1"]=>
- *RECURSION*
- }
+ *RECURSION*
}
-- Iteration 6 --
object(no_member_class)#%d (0) refcount(%d){
@@ -587,25 +297,7 @@ object(object_class)#%d (6) refcount(%d){
int(3)
}
["object_class1"]=>
- object(object_class)#%d (6) refcount(%d){
- ["value1"]=>
- int(5)
- ["value2":"object_class":private]=>
- int(10)
- ["value3":protected]=>
- int(20)
- ["value4"]=>
- int(30)
- ["array_var"]=>
- array(2) refcount(%d){
- ["key1"]=>
- int(1)
- ["key2 "]=>
- int(3)
- }
- ["object_class1"]=>
- *RECURSION*
- }
+ *RECURSION*
}
-- Iteration 9 --
object(object_class)#%d (6) refcount(%d){
@@ -625,25 +317,7 @@ object(object_class)#%d (6) refcount(%d){
int(3)
}
["object_class1"]=>
- object(object_class)#%d (6) refcount(%d){
- ["value1"]=>
- int(5)
- ["value2":"object_class":private]=>
- int(10)
- ["value3":protected]=>
- int(20)
- ["value4"]=>
- int(30)
- ["array_var"]=>
- array(2) refcount(%d){
- ["key1"]=>
- int(1)
- ["key2 "]=>
- int(3)
- }
- ["object_class1"]=>
- *RECURSION*
- }
+ *RECURSION*
}
-- Iteration 10 --
int(30)
@@ -674,67 +348,7 @@ object(object_class)#%d (7) refcount(%d){
int(3)
}
["object_class1"]=>
- object(object_class)#%d (7) refcount(%d){
- ["value1"]=>
- int(5)
- ["value2":"object_class":private]=>
- int(10)
- ["value3":protected]=>
- int(20)
- ["value4"]=>
- int(30)
- ["array_var"]=>
- array(2) refcount(%d){
- ["key1"]=>
- int(1)
- ["key2 "]=>
- int(3)
- }
- ["object_class1"]=>
- *RECURSION*
- ["obj"]=>
- &object(object_class)#%d (7) refcount(%d){
- ["value1"]=>
- int(5)
- ["value2":"object_class":private]=>
- int(10)
- ["value3":protected]=>
- int(20)
- ["value4"]=>
- int(30)
- ["array_var"]=>
- array(2) refcount(%d){
- ["key1"]=>
- int(1)
- ["key2 "]=>
- int(3)
- }
- ["object_class1"]=>
- object(object_class)#%d (7) refcount(%d){
- ["value1"]=>
- int(5)
- ["value2":"object_class":private]=>
- int(10)
- ["value3":protected]=>
- int(20)
- ["value4"]=>
- int(30)
- ["array_var"]=>
- array(2) refcount(%d){
- ["key1"]=>
- int(1)
- ["key2 "]=>
- int(3)
- }
- ["object_class1"]=>
- *RECURSION*
- ["obj"]=>
- *RECURSION*
- }
- ["obj"]=>
- *RECURSION*
- }
- }
+ *RECURSION*
["obj"]=>
&object(object_class)#%d (7) refcount(%d){
["value1"]=>
@@ -753,89 +367,9 @@ object(object_class)#%d (7) refcount(%d){
int(3)
}
["object_class1"]=>
- object(object_class)#%d (7) refcount(%d){
- ["value1"]=>
- int(5)
- ["value2":"object_class":private]=>
- int(10)
- ["value3":protected]=>
- int(20)
- ["value4"]=>
- int(30)
- ["array_var"]=>
- array(2) refcount(%d){
- ["key1"]=>
- int(1)
- ["key2 "]=>
- int(3)
- }
- ["object_class1"]=>
- *RECURSION*
- ["obj"]=>
- &object(object_class)#%d (7) refcount(%d){
- ["value1"]=>
- int(5)
- ["value2":"object_class":private]=>
- int(10)
- ["value3":protected]=>
- int(20)
- ["value4"]=>
- int(30)
- ["array_var"]=>
- array(2) refcount(%d){
- ["key1"]=>
- int(1)
- ["key2 "]=>
- int(3)
- }
- ["object_class1"]=>
- *RECURSION*
- ["obj"]=>
- *RECURSION*
- }
- }
+ *RECURSION*
["obj"]=>
- &object(object_class)#%d (7) refcount(%d){
- ["value1"]=>
- int(5)
- ["value2":"object_class":private]=>
- int(10)
- ["value3":protected]=>
- int(20)
- ["value4"]=>
- int(30)
- ["array_var"]=>
- array(2) refcount(%d){
- ["key1"]=>
- int(1)
- ["key2 "]=>
- int(3)
- }
- ["object_class1"]=>
- *RECURSION*
- ["obj"]=>
- &object(object_class)#%d (7) refcount(%d){
- ["value1"]=>
- int(5)
- ["value2":"object_class":private]=>
- int(10)
- ["value3":protected]=>
- int(20)
- ["value4"]=>
- int(30)
- ["array_var"]=>
- array(2) refcount(%d){
- ["key1"]=>
- int(1)
- ["key2 "]=>
- int(3)
- }
- ["object_class1"]=>
- *RECURSION*
- ["obj"]=>
- *RECURSION*
- }
- }
+ *RECURSION*
}
}
Done
diff --git a/ext/standard/tests/general_functions/strval.phpt b/ext/standard/tests/general_functions/strval.phpt
index 2e1e81c2ee..6d76431dbc 100644
--- a/ext/standard/tests/general_functions/strval.phpt
+++ b/ext/standard/tests/general_functions/strval.phpt
@@ -96,7 +96,7 @@ $scalars = array(
$heredoc_empty_string
);
/* loop to check that strval() recognizes different
- scalar values and retuns the string conversion of same */
+ scalar values and returns the string conversion of same */
$loop_counter = 1;
foreach ($scalars as $scalar ) {
echo "-- Iteration $loop_counter --\n"; $loop_counter++;
diff --git a/ext/standard/tests/image/getimagesize.phpt b/ext/standard/tests/image/getimagesize.phpt
index eefa331ea5..1164f10c3e 100644
--- a/ext/standard/tests/image/getimagesize.phpt
+++ b/ext/standard/tests/image/getimagesize.phpt
@@ -37,7 +37,7 @@ array(16) {
["bits"]=>
int(24)
["mime"]=>
- string(14) "image/x-ms-bmp"
+ string(9) "image/bmp"
}
["test12pix.webp"]=>
array(6) {
@@ -67,7 +67,7 @@ array(16) {
["bits"]=>
int(32)
["mime"]=>
- string(14) "image/x-ms-bmp"
+ string(9) "image/bmp"
}
["test1pix.bmp"]=>
array(6) {
@@ -82,7 +82,7 @@ array(16) {
["bits"]=>
int(24)
["mime"]=>
- string(14) "image/x-ms-bmp"
+ string(9) "image/bmp"
}
["test1pix.jp2"]=>
array(7) {
diff --git a/ext/standard/tests/image/getimagesize_basic.phpt b/ext/standard/tests/image/getimagesize_basic.phpt
index 4d47225818..63ae334066 100644
--- a/ext/standard/tests/image/getimagesize_basic.phpt
+++ b/ext/standard/tests/image/getimagesize_basic.phpt
@@ -138,7 +138,7 @@ array(6) {
["bits"]=>
int(24)
["mime"]=>
- string(14) "image/x-ms-bmp"
+ string(9) "image/bmp"
}
array(0) {
}
diff --git a/ext/standard/tests/image/image_type_to_mime_type.phpt b/ext/standard/tests/image/image_type_to_mime_type.phpt
index 4ae5680238..38a90c1bb3 100644
--- a/ext/standard/tests/image/image_type_to_mime_type.phpt
+++ b/ext/standard/tests/image/image_type_to_mime_type.phpt
@@ -27,13 +27,13 @@ image_type_to_mime_type()
--EXPECT--
array(16) {
["test-1pix.bmp"]=>
- string(14) "image/x-ms-bmp"
+ string(9) "image/bmp"
["test12pix.webp"]=>
string(10) "image/webp"
["test1bpix.bmp"]=>
- string(14) "image/x-ms-bmp"
+ string(9) "image/bmp"
["test1pix.bmp"]=>
- string(14) "image/x-ms-bmp"
+ string(9) "image/bmp"
["test1pix.jp2"]=>
string(9) "image/jp2"
["test1pix.jpc"]=>
diff --git a/ext/standard/tests/image/image_type_to_mime_type_basic.phpt b/ext/standard/tests/image/image_type_to_mime_type_basic.phpt
index 5506570494..9ee91961c2 100644
--- a/ext/standard/tests/image/image_type_to_mime_type_basic.phpt
+++ b/ext/standard/tests/image/image_type_to_mime_type_basic.phpt
@@ -49,7 +49,7 @@ string(10) "image/jpeg"
string(9) "image/png"
string(29) "application/x-shockwave-flash"
string(9) "image/psd"
-string(14) "image/x-ms-bmp"
+string(9) "image/bmp"
string(10) "image/tiff"
string(10) "image/tiff"
string(24) "application/octet-stream"
diff --git a/ext/standard/tests/image/image_type_to_mime_type_variation3.phpt b/ext/standard/tests/image/image_type_to_mime_type_variation3.phpt
index 7b06c0a145..1b4f418cdb 100644
--- a/ext/standard/tests/image/image_type_to_mime_type_variation3.phpt
+++ b/ext/standard/tests/image/image_type_to_mime_type_variation3.phpt
@@ -39,7 +39,7 @@ string\(29\) "application\/x-shockwave-flash"
string\(9\) "image\/psd"
-- Iteration 6 --
-string\(14\) "image\/x-ms-bmp"
+string\(9\) "image\/bmp"
-- Iteration 7 --
string\(10\) "image\/tiff"
diff --git a/ext/standard/tests/math/lcg_value_basic.phpt b/ext/standard/tests/math/lcg_value_basic.phpt
index 6d624d84ab..8fc95190c6 100644
--- a/ext/standard/tests/math/lcg_value_basic.phpt
+++ b/ext/standard/tests/math/lcg_value_basic.phpt
@@ -21,36 +21,38 @@ if ($i != 100) {
echo "PASSED\n";
}
-echo "\n lcg_value error cases..spurious args get ignored\n";
+echo "\n lcg_value error cases..\n";
$res = lcg_value(23);
-if (!is_float($res) || $res < 0 || $res > 1) {
- echo "FAILED\n";
-} else {
+if (is_null($res)) {
echo "PASSED\n";
+} else {
+ echo "FAILED\n";
}
$res = lcg_value(10,false);
-if (!is_float($res) || $res < 0 || $res > 1) {
- echo "FAILED\n";
-} else {
+if (is_null($res)) {
echo "PASSED\n";
+} else {
+ echo "FAILED\n";
}
echo "MATHS test script completed\n";
?>
---EXPECT--
+--EXPECTF--
MATHS test script started
lcg_value tests...
PASSED
- lcg_value error cases..spurious args get ignored
+ lcg_value error cases..
+
+Warning: lcg_value() expects exactly 0 parameters, 1 given in %slcg_value_basic.php on line %d
PASSED
+
+Warning: lcg_value() expects exactly 0 parameters, 2 given in %slcg_value_basic.php on line %d
PASSED
MATHS test script completed
-
-
diff --git a/ext/standard/tests/math/rand_inverted_order.phpt b/ext/standard/tests/math/rand_inverted_order.phpt
new file mode 100644
index 0000000000..ac904b21ed
--- /dev/null
+++ b/ext/standard/tests/math/rand_inverted_order.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Test rand funtion when min and max are in proper or inverted order
+--CREDIT--
+PHP TestFEst 2017 - PHPDublin, PHPSP - Joao P V Martins <jp.joao@gmail.com>
+--FILE--
+<?php
+$min_value = 10;
+$max_value = 20;
+$correct_order = rand($min_value, $max_value);
+$incorrect_order = rand($max_value, $min_value);
+var_dump($correct_order >= $min_value);
+var_dump($correct_order <= $max_value);
+var_dump($incorrect_order >= $min_value);
+var_dump($incorrect_order <= $max_value);
+?>
+--EXPECT--
+bool(true)
+bool(true)
+bool(true)
+bool(true)
diff --git a/ext/standard/tests/serialize/bug70172.phpt b/ext/standard/tests/serialize/bug70172.phpt
index 471d1a4b4e..a2359d6434 100644
--- a/ext/standard/tests/serialize/bug70172.phpt
+++ b/ext/standard/tests/serialize/bug70172.phpt
@@ -19,7 +19,7 @@ $fakezval .= "\x01";
$fakezval .= "\x00";
$fakezval .= "\x00\x00";
-$inner = 'r:2;';
+$inner = 'R:2;';
$exploit = 'a:2:{i:0;i:1;i:1;C:3:"obj":'.strlen($inner).':{'.$inner.'}}';
$data = unserialize($exploit);
diff --git a/ext/standard/tests/serialize/bug70963.phpt b/ext/standard/tests/serialize/bug70963.phpt
index 0bdfb2c4c9..c4e2267b04 100644
--- a/ext/standard/tests/serialize/bug70963.phpt
+++ b/ext/standard/tests/serialize/bug70963.phpt
@@ -25,22 +25,6 @@ array(2) {
[1]=>
string(4) "test"
}
-array(2) {
- [0]=>
- object(Exception)#%d (6) {
- ["message":protected]=>
- string(0) ""
- ["string":"Exception":private]=>
- string(0) ""
- ["code":protected]=>
- int(0)
- ["file":protected]=>
- string(%d) "%s"
- ["line":protected]=>
- int(3)
- ["previous":"Exception":private]=>
- NULL
- }
- [1]=>
- string(4) "test"
-}
+
+Notice: unserialize(): Error at offset %d of %d bytes in %sbug70963.php on line 3
+bool(false)
diff --git a/ext/standard/tests/serialize/unserialize_mem_leak.phpt b/ext/standard/tests/serialize/unserialize_mem_leak.phpt
index 97c59f9ad1..2a295d83b9 100644
--- a/ext/standard/tests/serialize/unserialize_mem_leak.phpt
+++ b/ext/standard/tests/serialize/unserialize_mem_leak.phpt
@@ -8,9 +8,12 @@ function foo() {
gc_collect_cycles();
}
+$str = 'a:1:{i:0;R:1;}';
+foo(unserialize($str));
$str = 'a:1:{i:0;r:1;}';
foo(unserialize($str));
echo "okey";
?>
---EXPECT--
+--EXPECTF--
+Notice: unserialize(): Error at offset %d of %d bytes in %sunserialize_mem_leak.php on line 9
okey
diff --git a/ext/standard/tests/setrawcookie_basic_001.phpt b/ext/standard/tests/setrawcookie_basic_001.phpt
new file mode 100644
index 0000000000..4a6fcc8d9b
--- /dev/null
+++ b/ext/standard/tests/setrawcookie_basic_001.phpt
@@ -0,0 +1,10 @@
+--TEST--
+Test setrawcookie basic functionality
+--CREDIT--
+PHP TestFEst 2017 - PHPDublin, PHPSP - Joao P V Martins <jp.joao@gmail.com>
+--FILE--
+<?php
+var_dump(setrawcookie('cookie_name', rawurlencode('cookie_content')));
+?>
+--EXPECT--
+bool(true)
diff --git a/ext/standard/tests/setrawcookie_basic_002.phpt b/ext/standard/tests/setrawcookie_basic_002.phpt
new file mode 100644
index 0000000000..fc98c8dcf4
--- /dev/null
+++ b/ext/standard/tests/setrawcookie_basic_002.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Test setrawcookie to fail when output exists before
+--CREDIT--
+PHP TestFEst 2017 - PHPDublin, PHPSP - Joao P V Martins <jp.joao@gmail.com>
+--FILE--
+<?php
+echo 'output' . PHP_EOL;
+var_dump(@setrawcookie('cookie_name', rawurlencode('cookie_content')));
+?>
+--EXPECT--
+output
+bool(false)
diff --git a/ext/standard/tests/streams/bug75031.phpt b/ext/standard/tests/streams/bug75031.phpt
new file mode 100644
index 0000000000..f0d67a3524
--- /dev/null
+++ b/ext/standard/tests/streams/bug75031.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Bug #75031: Append mode in php://temp and php://memory
+--FILE--
+<?php
+
+function test_75031($type, $mode) {
+ $fp = fopen($type, $mode);
+ fwrite($fp, "hello");
+ fseek($fp, 0, SEEK_SET);
+ fwrite($fp, "world");
+ var_dump(stream_get_contents($fp, -1, 0));
+ fclose($fp);
+}
+
+test_75031("php://temp", "w+");
+test_75031("php://memory", "w+");
+test_75031("php://temp", "a+");
+test_75031("php://memory", "a+");
+
+?>
+--EXPECT--
+string(5) "world"
+string(5) "world"
+string(10) "helloworld"
+string(10) "helloworld"
diff --git a/ext/standard/tests/strings/bug72433.phpt b/ext/standard/tests/strings/bug72433.phpt
index d5a6612f2b..534b1e6ac6 100644
--- a/ext/standard/tests/strings/bug72433.phpt
+++ b/ext/standard/tests/strings/bug72433.phpt
@@ -19,41 +19,5 @@ $fill_freed_space_2 = "filler_zval_2";
var_dump($free_me);
?>
--EXPECTF--
-array(3) {
- [0]=>
- array(3) {
- [0]=>
- *RECURSION*
- [1]=>
- *RECURSION*
- [2]=>
- object(ArrayObject)#%d (1) {
- ["storage":"ArrayObject":private]=>
- *RECURSION*
- }
- }
- [1]=>
- array(3) {
- [0]=>
- *RECURSION*
- [1]=>
- *RECURSION*
- [2]=>
- object(ArrayObject)#%d (1) {
- ["storage":"ArrayObject":private]=>
- *RECURSION*
- }
- }
- [2]=>
- object(ArrayObject)#%d (1) {
- ["storage":"ArrayObject":private]=>
- array(3) {
- [0]=>
- *RECURSION*
- [1]=>
- *RECURSION*
- [2]=>
- *RECURSION*
- }
- }
-}
+Notice: unserialize(): Error at offset %d of %d bytes in %sbug72433.php on line 8
+bool(false)
diff --git a/ext/standard/url.c b/ext/standard/url.c
index a3a19a2b22..e909eee347 100644
--- a/ext/standard/url.c
+++ b/ext/standard/url.c
@@ -42,19 +42,19 @@
PHPAPI void php_url_free(php_url *theurl)
{
if (theurl->scheme)
- efree(theurl->scheme);
+ zend_string_release(theurl->scheme);
if (theurl->user)
- efree(theurl->user);
+ zend_string_release(theurl->user);
if (theurl->pass)
- efree(theurl->pass);
+ zend_string_release(theurl->pass);
if (theurl->host)
- efree(theurl->host);
+ zend_string_release(theurl->host);
if (theurl->path)
- efree(theurl->path);
+ zend_string_release(theurl->path);
if (theurl->query)
- efree(theurl->query);
+ zend_string_release(theurl->query);
if (theurl->fragment)
- efree(theurl->fragment);
+ zend_string_release(theurl->fragment);
efree(theurl);
}
/* }}} */
@@ -124,8 +124,8 @@ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length)
}
if (e + 1 == ue) { /* only scheme is available */
- ret->scheme = estrndup(s, (e - s));
- php_replace_controlchars_ex(ret->scheme, (e - s));
+ ret->scheme = zend_string_init(s, (e - s), 0);
+ php_replace_controlchars_ex(ZSTR_VAL(ret->scheme), ZSTR_LEN(ret->scheme));
return ret;
}
@@ -146,18 +146,18 @@ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length)
goto parse_port;
}
- ret->scheme = estrndup(s, (e-s));
- php_replace_controlchars_ex(ret->scheme, (e - s));
+ ret->scheme = zend_string_init(s, (e-s), 0);
+ php_replace_controlchars_ex(ZSTR_VAL(ret->scheme), ZSTR_LEN(ret->scheme));
s = e + 1;
goto just_path;
} else {
- ret->scheme = estrndup(s, (e-s));
- php_replace_controlchars_ex(ret->scheme, (e - s));
+ ret->scheme = zend_string_init(s, (e-s), 0);
+ php_replace_controlchars_ex(ZSTR_VAL(ret->scheme), ZSTR_LEN(ret->scheme));
if (e + 2 < ue && *(e + 2) == '/') {
s = e + 3;
- if (!strncasecmp("file", ret->scheme, sizeof("file"))) {
+ if (zend_string_equals_literal_ci(ret->scheme, "file")) {
if (e + 3 < ue && *(e + 3) == '/') {
/* support windows drive letters as in:
file:///c:/somedir/file.txt
@@ -193,13 +193,11 @@ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length)
s += 2;
}
} else {
- if (ret->scheme) efree(ret->scheme);
- efree(ret);
+ php_url_free(ret);
return NULL;
}
} else if (p == pp && pp == ue) {
- if (ret->scheme) efree(ret->scheme);
- efree(ret);
+ php_url_free(ret);
return NULL;
} else if (s + 1 < ue && *s == '/' && *(s + 1) == '/') { /* relative-scheme URL */
s += 2;
@@ -228,15 +226,15 @@ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length)
/* check for login and password */
if ((p = zend_memrchr(s, '@', (e-s)))) {
if ((pp = memchr(s, ':', (p-s)))) {
- ret->user = estrndup(s, (pp-s));
- php_replace_controlchars_ex(ret->user, (pp - s));
+ ret->user = zend_string_init(s, (pp-s), 0);
+ php_replace_controlchars_ex(ZSTR_VAL(ret->user), ZSTR_LEN(ret->user));
pp++;
- ret->pass = estrndup(pp, (p-pp));
- php_replace_controlchars_ex(ret->pass, (p-pp));
+ ret->pass = zend_string_init(pp, (p-pp), 0);
+ php_replace_controlchars_ex(ZSTR_VAL(ret->pass), ZSTR_LEN(ret->pass));
} else {
- ret->user = estrndup(s, (p-s));
- php_replace_controlchars_ex(ret->user, (p-s));
+ ret->user = zend_string_init(s, (p-s), 0);
+ php_replace_controlchars_ex(ZSTR_VAL(ret->user), ZSTR_LEN(ret->user));
}
s = p + 1;
@@ -256,10 +254,7 @@ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length)
if (!ret->port) {
p++;
if (e-p > 5) { /* port cannot be longer then 5 characters */
- if (ret->scheme) efree(ret->scheme);
- if (ret->user) efree(ret->user);
- if (ret->pass) efree(ret->pass);
- efree(ret);
+ php_url_free(ret);
return NULL;
} else if (e - p > 0) {
zend_long port;
@@ -269,10 +264,7 @@ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length)
if (port > 0 && port <= 65535) {
ret->port = (unsigned short)port;
} else {
- if (ret->scheme) efree(ret->scheme);
- if (ret->user) efree(ret->user);
- if (ret->pass) efree(ret->pass);
- efree(ret);
+ php_url_free(ret);
return NULL;
}
}
@@ -284,15 +276,12 @@ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length)
/* check if we have a valid host, if we don't reject the string as url */
if ((p-s) < 1) {
- if (ret->scheme) efree(ret->scheme);
- if (ret->user) efree(ret->user);
- if (ret->pass) efree(ret->pass);
- efree(ret);
+ php_url_free(ret);
return NULL;
}
- ret->host = estrndup(s, (p-s));
- php_replace_controlchars_ex(ret->host, (p - s));
+ ret->host = zend_string_init(s, (p-s), 0);
+ php_replace_controlchars_ex(ZSTR_VAL(ret->host), ZSTR_LEN(ret->host));
if (e == ue) {
return ret;
@@ -307,8 +296,8 @@ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length)
if (p) {
p++;
if (p < e) {
- ret->fragment = estrndup(p, (e - p));
- php_replace_controlchars_ex(ret->fragment, (e - p));
+ ret->fragment = zend_string_init(p, (e - p), 0);
+ php_replace_controlchars_ex(ZSTR_VAL(ret->fragment), ZSTR_LEN(ret->fragment));
}
e = p-1;
}
@@ -317,15 +306,15 @@ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length)
if (p) {
p++;
if (p < e) {
- ret->query = estrndup(p, (e - p));
- php_replace_controlchars_ex(ret->query, (e - p));
+ ret->query = zend_string_init(p, (e - p), 0);
+ php_replace_controlchars_ex(ZSTR_VAL(ret->query), ZSTR_LEN(ret->query));
}
e = p-1;
}
if (s < e || s == ue) {
- ret->path = estrndup(s, (e - s));
- php_replace_controlchars_ex(ret->path, (e - s));
+ ret->path = zend_string_init(s, (e - s), 0);
+ php_replace_controlchars_ex(ZSTR_VAL(ret->path), ZSTR_LEN(ret->path));
}
return ret;
@@ -357,28 +346,28 @@ PHP_FUNCTION(parse_url)
if (key > -1) {
switch (key) {
case PHP_URL_SCHEME:
- if (resource->scheme != NULL) RETVAL_STRING(resource->scheme);
+ if (resource->scheme != NULL) RETVAL_STR_COPY(resource->scheme);
break;
case PHP_URL_HOST:
- if (resource->host != NULL) RETVAL_STRING(resource->host);
+ if (resource->host != NULL) RETVAL_STR_COPY(resource->host);
break;
case PHP_URL_PORT:
if (resource->port != 0) RETVAL_LONG(resource->port);
break;
case PHP_URL_USER:
- if (resource->user != NULL) RETVAL_STRING(resource->user);
+ if (resource->user != NULL) RETVAL_STR_COPY(resource->user);
break;
case PHP_URL_PASS:
- if (resource->pass != NULL) RETVAL_STRING(resource->pass);
+ if (resource->pass != NULL) RETVAL_STR_COPY(resource->pass);
break;
case PHP_URL_PATH:
- if (resource->path != NULL) RETVAL_STRING(resource->path);
+ if (resource->path != NULL) RETVAL_STR_COPY(resource->path);
break;
case PHP_URL_QUERY:
- if (resource->query != NULL) RETVAL_STRING(resource->query);
+ if (resource->query != NULL) RETVAL_STR_COPY(resource->query);
break;
case PHP_URL_FRAGMENT:
- if (resource->fragment != NULL) RETVAL_STRING(resource->fragment);
+ if (resource->fragment != NULL) RETVAL_STR_COPY(resource->fragment);
break;
default:
php_error_docref(NULL, E_WARNING, "Invalid URL component identifier " ZEND_LONG_FMT, key);
@@ -392,11 +381,11 @@ PHP_FUNCTION(parse_url)
/* add the various elements to the array */
if (resource->scheme != NULL) {
- ZVAL_STRING(&tmp, resource->scheme);
+ ZVAL_STR_COPY(&tmp, resource->scheme);
zend_hash_add_new(Z_ARRVAL_P(return_value), ZSTR_KNOWN(ZEND_STR_SCHEME), &tmp);
}
if (resource->host != NULL) {
- ZVAL_STRING(&tmp, resource->host);
+ ZVAL_STR_COPY(&tmp, resource->host);
zend_hash_add_new(Z_ARRVAL_P(return_value), ZSTR_KNOWN(ZEND_STR_HOST), &tmp);
}
if (resource->port != 0) {
@@ -404,23 +393,23 @@ PHP_FUNCTION(parse_url)
zend_hash_add_new(Z_ARRVAL_P(return_value), ZSTR_KNOWN(ZEND_STR_PORT), &tmp);
}
if (resource->user != NULL) {
- ZVAL_STRING(&tmp, resource->user);
+ ZVAL_STR_COPY(&tmp, resource->user);
zend_hash_add_new(Z_ARRVAL_P(return_value), ZSTR_KNOWN(ZEND_STR_USER), &tmp);
}
if (resource->pass != NULL) {
- ZVAL_STRING(&tmp, resource->pass);
+ ZVAL_STR_COPY(&tmp, resource->pass);
zend_hash_add_new(Z_ARRVAL_P(return_value), ZSTR_KNOWN(ZEND_STR_PASS), &tmp);
}
if (resource->path != NULL) {
- ZVAL_STRING(&tmp, resource->path);
+ ZVAL_STR_COPY(&tmp, resource->path);
zend_hash_add_new(Z_ARRVAL_P(return_value), ZSTR_KNOWN(ZEND_STR_PATH), &tmp);
}
if (resource->query != NULL) {
- ZVAL_STRING(&tmp, resource->query);
+ ZVAL_STR_COPY(&tmp, resource->query);
zend_hash_add_new(Z_ARRVAL_P(return_value), ZSTR_KNOWN(ZEND_STR_QUERY), &tmp);
}
if (resource->fragment != NULL) {
- ZVAL_STRING(&tmp, resource->fragment);
+ ZVAL_STR_COPY(&tmp, resource->fragment);
zend_hash_add_new(Z_ARRVAL_P(return_value), ZSTR_KNOWN(ZEND_STR_FRAGMENT), &tmp);
}
done:
diff --git a/ext/standard/url.h b/ext/standard/url.h
index 7a2f20ed2b..8c4e63e60e 100644
--- a/ext/standard/url.h
+++ b/ext/standard/url.h
@@ -21,14 +21,14 @@
#define URL_H
typedef struct php_url {
- char *scheme;
- char *user;
- char *pass;
- char *host;
+ zend_string *scheme;
+ zend_string *user;
+ zend_string *pass;
+ zend_string *host;
unsigned short port;
- char *path;
- char *query;
- char *fragment;
+ zend_string *path;
+ zend_string *query;
+ zend_string *fragment;
} php_url;
PHPAPI void php_url_free(php_url *theurl);
diff --git a/ext/standard/url_scanner_ex.c b/ext/standard/url_scanner_ex.c
index 484d5d9c13..2698b96f05 100644
--- a/ext/standard/url_scanner_ex.c
+++ b/ext/standard/url_scanner_ex.c
@@ -182,8 +182,6 @@ PHP_INI_END()
static inline void append_modified_url(smart_str *url, smart_str *dest, smart_str *url_app, const char *separator)
{
php_url *url_parts;
- char *tmp;
- size_t tmp_len;
smart_str_0(url); /* FIXME: Bug #70480 php_url_parse_ex() crashes by processing chars exceed len */
url_parts = php_url_parse_ex(ZSTR_VAL(url->s), ZSTR_LEN(url->s));
@@ -196,21 +194,23 @@ static inline void append_modified_url(smart_str *url, smart_str *dest, smart_st
/* Check protocol. Only http/https is allowed. */
if (url_parts->scheme
- && strcasecmp("http", url_parts->scheme)
- && strcasecmp("https", url_parts->scheme)) {
+ && !zend_string_equals_literal_ci(url_parts->scheme, "http")
+ && !zend_string_equals_literal_ci(url_parts->scheme, "https")) {
smart_str_append_smart_str(dest, url);
php_url_free(url_parts);
return;
}
/* Check host whitelist. If it's not listed, do nothing. */
- if (url_parts->host
- && (tmp_len = strlen(url_parts->host))
- && (tmp = php_strtolower(url_parts->host, tmp_len))
- && !zend_hash_str_find(&BG(url_adapt_session_hosts_ht), tmp, tmp_len)) {
- smart_str_append_smart_str(dest, url);
- php_url_free(url_parts);
- return;
+ if (url_parts->host) {
+ zend_string *tmp = zend_string_tolower(url_parts->host);
+ if (!zend_hash_exists(&BG(url_adapt_session_hosts_ht), tmp)) {
+ zend_string_release(tmp);
+ smart_str_append_smart_str(dest, url);
+ php_url_free(url_parts);
+ return;
+ }
+ zend_string_release(tmp);
}
/*
@@ -229,32 +229,32 @@ static inline void append_modified_url(smart_str *url, smart_str *dest, smart_st
}
if (url_parts->scheme) {
- smart_str_appends(dest, url_parts->scheme);
+ smart_str_appends(dest, ZSTR_VAL(url_parts->scheme));
smart_str_appends(dest, "://");
} else if (*(ZSTR_VAL(url->s)) == '/' && *(ZSTR_VAL(url->s)+1) == '/') {
smart_str_appends(dest, "//");
}
if (url_parts->user) {
- smart_str_appends(dest, url_parts->user);
+ smart_str_appends(dest, ZSTR_VAL(url_parts->user));
if (url_parts->pass) {
- smart_str_appends(dest, url_parts->pass);
+ smart_str_appends(dest, ZSTR_VAL(url_parts->pass));
smart_str_appendc(dest, ':');
}
smart_str_appendc(dest, '@');
}
if (url_parts->host) {
- smart_str_appends(dest, url_parts->host);
+ smart_str_appends(dest, ZSTR_VAL(url_parts->host));
}
if (url_parts->port) {
smart_str_appendc(dest, ':');
smart_str_append_unsigned(dest, (long)url_parts->port);
}
if (url_parts->path) {
- smart_str_appends(dest, url_parts->path);
+ smart_str_appends(dest, ZSTR_VAL(url_parts->path));
}
smart_str_appendc(dest, '?');
if (url_parts->query) {
- smart_str_appends(dest, url_parts->query);
+ smart_str_appends(dest, ZSTR_VAL(url_parts->query));
smart_str_appends(dest, separator);
smart_str_append_smart_str(dest, url_app);
} else {
@@ -262,7 +262,7 @@ static inline void append_modified_url(smart_str *url, smart_str *dest, smart_st
}
if (url_parts->fragment) {
smart_str_appendc(dest, '#');
- smart_str_appends(dest, url_parts->fragment);
+ smart_str_appends(dest, ZSTR_VAL(url_parts->fragment));
}
php_url_free(url_parts);
}
@@ -383,8 +383,8 @@ static int check_host_whitelist(url_adapt_state_ex_t *ctx)
if (url_parts->scheme) {
/* Only http/https should be handled.
A bit hacky check this here, but saves a URL parse. */
- if (strcasecmp(url_parts->scheme, "http") &&
- strcasecmp(url_parts->scheme, "https")) {
+ if (!zend_string_equals_literal_ci(url_parts->scheme, "http") &&
+ !zend_string_equals_literal_ci(url_parts->scheme, "https")) {
php_url_free(url_parts);
return FAILURE;
}
@@ -394,13 +394,11 @@ static int check_host_whitelist(url_adapt_state_ex_t *ctx)
return SUCCESS;
}
if (!zend_hash_num_elements(allowed_hosts) &&
- check_http_host(url_parts->host) == SUCCESS) {
+ check_http_host(ZSTR_VAL(url_parts->host)) == SUCCESS) {
php_url_free(url_parts);
return SUCCESS;
}
- if (!zend_hash_str_find(allowed_hosts,
- url_parts->host,
- strlen(url_parts->host))) {
+ if (!zend_hash_find(allowed_hosts, url_parts->host)) {
php_url_free(url_parts);
return FAILURE;
}
@@ -513,7 +511,7 @@ state_plain_begin:
state_plain:
start = YYCURSOR;
-#line 517 "ext/standard/url_scanner_ex.c"
+#line 515 "ext/standard/url_scanner_ex.c"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
@@ -563,22 +561,22 @@ yy2:
if (yybm[0+yych] & 128) {
goto yy2;
}
-#line 520 "ext/standard/url_scanner_ex.re"
+#line 518 "ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); goto state_plain; }
-#line 569 "ext/standard/url_scanner_ex.c"
+#line 567 "ext/standard/url_scanner_ex.c"
yy5:
++YYCURSOR;
-#line 519 "ext/standard/url_scanner_ex.re"
+#line 517 "ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); STATE = STATE_TAG; goto state_tag; }
-#line 574 "ext/standard/url_scanner_ex.c"
+#line 572 "ext/standard/url_scanner_ex.c"
}
-#line 521 "ext/standard/url_scanner_ex.re"
+#line 519 "ext/standard/url_scanner_ex.re"
state_tag:
start = YYCURSOR;
-#line 582 "ext/standard/url_scanner_ex.c"
+#line 580 "ext/standard/url_scanner_ex.c"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
@@ -621,9 +619,9 @@ state_tag:
goto yy11;
}
++YYCURSOR;
-#line 527 "ext/standard/url_scanner_ex.re"
+#line 525 "ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); goto state_plain_begin; }
-#line 627 "ext/standard/url_scanner_ex.c"
+#line 625 "ext/standard/url_scanner_ex.c"
yy11:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
@@ -631,11 +629,11 @@ yy11:
if (yybm[0+yych] & 128) {
goto yy11;
}
-#line 526 "ext/standard/url_scanner_ex.re"
+#line 524 "ext/standard/url_scanner_ex.re"
{ handle_tag(STD_ARGS); /* Sets STATE */; passthru(STD_ARGS); if (STATE == STATE_PLAIN) goto state_plain; else goto state_next_arg; }
-#line 637 "ext/standard/url_scanner_ex.c"
+#line 635 "ext/standard/url_scanner_ex.c"
}
-#line 528 "ext/standard/url_scanner_ex.re"
+#line 526 "ext/standard/url_scanner_ex.re"
state_next_arg_begin:
@@ -644,7 +642,7 @@ state_next_arg_begin:
state_next_arg:
start = YYCURSOR;
-#line 648 "ext/standard/url_scanner_ex.c"
+#line 646 "ext/standard/url_scanner_ex.c"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
@@ -700,9 +698,9 @@ state_next_arg:
yy16:
++YYCURSOR;
yy17:
-#line 539 "ext/standard/url_scanner_ex.re"
+#line 537 "ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); goto state_plain_begin; }
-#line 706 "ext/standard/url_scanner_ex.c"
+#line 704 "ext/standard/url_scanner_ex.c"
yy18:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
@@ -710,30 +708,30 @@ yy18:
if (yybm[0+yych] & 128) {
goto yy18;
}
-#line 537 "ext/standard/url_scanner_ex.re"
+#line 535 "ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); goto state_next_arg; }
-#line 716 "ext/standard/url_scanner_ex.c"
+#line 714 "ext/standard/url_scanner_ex.c"
yy21:
yych = *++YYCURSOR;
if (yych != '>') goto yy17;
yy22:
++YYCURSOR;
-#line 536 "ext/standard/url_scanner_ex.re"
+#line 534 "ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); handle_form(STD_ARGS); goto state_plain_begin; }
-#line 724 "ext/standard/url_scanner_ex.c"
+#line 722 "ext/standard/url_scanner_ex.c"
yy24:
++YYCURSOR;
-#line 538 "ext/standard/url_scanner_ex.re"
+#line 536 "ext/standard/url_scanner_ex.re"
{ --YYCURSOR; STATE = STATE_ARG; goto state_arg; }
-#line 729 "ext/standard/url_scanner_ex.c"
+#line 727 "ext/standard/url_scanner_ex.c"
}
-#line 540 "ext/standard/url_scanner_ex.re"
+#line 538 "ext/standard/url_scanner_ex.re"
state_arg:
start = YYCURSOR;
-#line 737 "ext/standard/url_scanner_ex.c"
+#line 735 "ext/standard/url_scanner_ex.c"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
@@ -778,9 +776,9 @@ state_arg:
if (yych <= 'z') goto yy30;
yy28:
++YYCURSOR;
-#line 546 "ext/standard/url_scanner_ex.re"
+#line 544 "ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); STATE = STATE_NEXT_ARG; goto state_next_arg; }
-#line 784 "ext/standard/url_scanner_ex.c"
+#line 782 "ext/standard/url_scanner_ex.c"
yy30:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
@@ -788,17 +786,17 @@ yy30:
if (yybm[0+yych] & 128) {
goto yy30;
}
-#line 545 "ext/standard/url_scanner_ex.re"
+#line 543 "ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); handle_arg(STD_ARGS); STATE = STATE_BEFORE_VAL; goto state_before_val; }
-#line 794 "ext/standard/url_scanner_ex.c"
+#line 792 "ext/standard/url_scanner_ex.c"
}
-#line 547 "ext/standard/url_scanner_ex.re"
+#line 545 "ext/standard/url_scanner_ex.re"
state_before_val:
start = YYCURSOR;
-#line 802 "ext/standard/url_scanner_ex.c"
+#line 800 "ext/standard/url_scanner_ex.c"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
@@ -841,9 +839,9 @@ state_before_val:
if (yych == '=') goto yy38;
++YYCURSOR;
yy36:
-#line 553 "ext/standard/url_scanner_ex.re"
+#line 551 "ext/standard/url_scanner_ex.re"
{ --YYCURSOR; goto state_next_arg_begin; }
-#line 847 "ext/standard/url_scanner_ex.c"
+#line 845 "ext/standard/url_scanner_ex.c"
yy37:
yych = *(YYMARKER = ++YYCURSOR);
if (yych == ' ') goto yy41;
@@ -855,9 +853,9 @@ yy38:
if (yybm[0+yych] & 128) {
goto yy38;
}
-#line 552 "ext/standard/url_scanner_ex.re"
+#line 550 "ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); STATE = STATE_VAL; goto state_val; }
-#line 861 "ext/standard/url_scanner_ex.c"
+#line 859 "ext/standard/url_scanner_ex.c"
yy41:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
@@ -867,14 +865,14 @@ yy41:
YYCURSOR = YYMARKER;
goto yy36;
}
-#line 554 "ext/standard/url_scanner_ex.re"
+#line 552 "ext/standard/url_scanner_ex.re"
state_val:
start = YYCURSOR;
-#line 878 "ext/standard/url_scanner_ex.c"
+#line 876 "ext/standard/url_scanner_ex.c"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
@@ -927,15 +925,15 @@ yy46:
if (yybm[0+yych] & 32) {
goto yy46;
}
-#line 562 "ext/standard/url_scanner_ex.re"
+#line 560 "ext/standard/url_scanner_ex.re"
{ handle_val(STD_ARGS, 0, ' '); goto state_next_arg_begin; }
-#line 933 "ext/standard/url_scanner_ex.c"
+#line 931 "ext/standard/url_scanner_ex.c"
yy49:
++YYCURSOR;
yy50:
-#line 563 "ext/standard/url_scanner_ex.re"
+#line 561 "ext/standard/url_scanner_ex.re"
{ passthru(STD_ARGS); goto state_next_arg_begin; }
-#line 939 "ext/standard/url_scanner_ex.c"
+#line 937 "ext/standard/url_scanner_ex.c"
yy51:
yych = *(YYMARKER = ++YYCURSOR);
if (yych == '>') goto yy50;
@@ -958,9 +956,9 @@ yy55:
goto yy50;
yy56:
++YYCURSOR;
-#line 560 "ext/standard/url_scanner_ex.re"
+#line 558 "ext/standard/url_scanner_ex.re"
{ handle_val(STD_ARGS, 1, '"'); goto state_next_arg_begin; }
-#line 964 "ext/standard/url_scanner_ex.c"
+#line 962 "ext/standard/url_scanner_ex.c"
yy58:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
@@ -971,11 +969,11 @@ yy59:
}
if (yych >= '(') goto yy55;
++YYCURSOR;
-#line 561 "ext/standard/url_scanner_ex.re"
+#line 559 "ext/standard/url_scanner_ex.re"
{ handle_val(STD_ARGS, 1, '\''); goto state_next_arg_begin; }
-#line 977 "ext/standard/url_scanner_ex.c"
+#line 975 "ext/standard/url_scanner_ex.c"
}
-#line 564 "ext/standard/url_scanner_ex.re"
+#line 562 "ext/standard/url_scanner_ex.re"
stop:
@@ -1103,7 +1101,7 @@ static inline void php_url_scanner_session_handler_impl(char *output, size_t out
if (ZSTR_LEN(url_state->url_app.s) != 0) {
*handled_output = url_adapt_ext(output, output_len, &len, (zend_bool) (mode & (PHP_OUTPUT_HANDLER_END | PHP_OUTPUT_HANDLER_CONT | PHP_OUTPUT_HANDLER_FLUSH | PHP_OUTPUT_HANDLER_FINAL) ? 1 : 0), url_state);
- if (sizeof(uint32_t) < sizeof(size_t)) {
+ if (sizeof(uint) < sizeof(size_t)) {
if (len > UINT_MAX)
len = UINT_MAX;
}
@@ -1319,7 +1317,7 @@ static inline int php_url_scanner_reset_var_impl(zend_string *name, int encode,
}
/* Check preceeding separator */
if (!sep_removed
- && start - PG(arg_separator).output >= separator_len
+ && (size_t)(start - PG(arg_separator).output) >= separator_len
&& !memcmp(start - separator_len, PG(arg_separator).output, separator_len)) {
start -= separator_len;
}
diff --git a/ext/standard/url_scanner_ex.re b/ext/standard/url_scanner_ex.re
index 51a29b5f73..a06e8f24b4 100644
--- a/ext/standard/url_scanner_ex.re
+++ b/ext/standard/url_scanner_ex.re
@@ -185,8 +185,6 @@ alphadash = ([a-zA-Z] | "-");
static inline void append_modified_url(smart_str *url, smart_str *dest, smart_str *url_app, const char *separator)
{
php_url *url_parts;
- char *tmp;
- size_t tmp_len;
smart_str_0(url); /* FIXME: Bug #70480 php_url_parse_ex() crashes by processing chars exceed len */
url_parts = php_url_parse_ex(ZSTR_VAL(url->s), ZSTR_LEN(url->s));
@@ -199,21 +197,23 @@ static inline void append_modified_url(smart_str *url, smart_str *dest, smart_st
/* Check protocol. Only http/https is allowed. */
if (url_parts->scheme
- && strcasecmp("http", url_parts->scheme)
- && strcasecmp("https", url_parts->scheme)) {
+ && !zend_string_equals_literal_ci(url_parts->scheme, "http")
+ && !zend_string_equals_literal_ci(url_parts->scheme, "https")) {
smart_str_append_smart_str(dest, url);
php_url_free(url_parts);
return;
}
/* Check host whitelist. If it's not listed, do nothing. */
- if (url_parts->host
- && (tmp_len = strlen(url_parts->host))
- && (tmp = php_strtolower(url_parts->host, tmp_len))
- && !zend_hash_str_find(&BG(url_adapt_session_hosts_ht), tmp, tmp_len)) {
- smart_str_append_smart_str(dest, url);
- php_url_free(url_parts);
- return;
+ if (url_parts->host) {
+ zend_string *tmp = zend_string_tolower(url_parts->host);
+ if (!zend_hash_exists(&BG(url_adapt_session_hosts_ht), tmp)) {
+ zend_string_release(tmp);
+ smart_str_append_smart_str(dest, url);
+ php_url_free(url_parts);
+ return;
+ }
+ zend_string_release(tmp);
}
/*
@@ -232,32 +232,32 @@ static inline void append_modified_url(smart_str *url, smart_str *dest, smart_st
}
if (url_parts->scheme) {
- smart_str_appends(dest, url_parts->scheme);
+ smart_str_appends(dest, ZSTR_VAL(url_parts->scheme));
smart_str_appends(dest, "://");
} else if (*(ZSTR_VAL(url->s)) == '/' && *(ZSTR_VAL(url->s)+1) == '/') {
smart_str_appends(dest, "//");
}
if (url_parts->user) {
- smart_str_appends(dest, url_parts->user);
+ smart_str_appends(dest, ZSTR_VAL(url_parts->user));
if (url_parts->pass) {
- smart_str_appends(dest, url_parts->pass);
+ smart_str_appends(dest, ZSTR_VAL(url_parts->pass));
smart_str_appendc(dest, ':');
}
smart_str_appendc(dest, '@');
}
if (url_parts->host) {
- smart_str_appends(dest, url_parts->host);
+ smart_str_appends(dest, ZSTR_VAL(url_parts->host));
}
if (url_parts->port) {
smart_str_appendc(dest, ':');
smart_str_append_unsigned(dest, (long)url_parts->port);
}
if (url_parts->path) {
- smart_str_appends(dest, url_parts->path);
+ smart_str_appends(dest, ZSTR_VAL(url_parts->path));
}
smart_str_appendc(dest, '?');
if (url_parts->query) {
- smart_str_appends(dest, url_parts->query);
+ smart_str_appends(dest, ZSTR_VAL(url_parts->query));
smart_str_appends(dest, separator);
smart_str_append_smart_str(dest, url_app);
} else {
@@ -265,7 +265,7 @@ static inline void append_modified_url(smart_str *url, smart_str *dest, smart_st
}
if (url_parts->fragment) {
smart_str_appendc(dest, '#');
- smart_str_appends(dest, url_parts->fragment);
+ smart_str_appends(dest, ZSTR_VAL(url_parts->fragment));
}
php_url_free(url_parts);
}
@@ -386,8 +386,8 @@ static int check_host_whitelist(url_adapt_state_ex_t *ctx)
if (url_parts->scheme) {
/* Only http/https should be handled.
A bit hacky check this here, but saves a URL parse. */
- if (strcasecmp(url_parts->scheme, "http") &&
- strcasecmp(url_parts->scheme, "https")) {
+ if (!zend_string_equals_literal_ci(url_parts->scheme, "http") &&
+ !zend_string_equals_literal_ci(url_parts->scheme, "https")) {
php_url_free(url_parts);
return FAILURE;
}
@@ -397,13 +397,11 @@ static int check_host_whitelist(url_adapt_state_ex_t *ctx)
return SUCCESS;
}
if (!zend_hash_num_elements(allowed_hosts) &&
- check_http_host(url_parts->host) == SUCCESS) {
+ check_http_host(ZSTR_VAL(url_parts->host)) == SUCCESS) {
php_url_free(url_parts);
return SUCCESS;
}
- if (!zend_hash_str_find(allowed_hosts,
- url_parts->host,
- strlen(url_parts->host))) {
+ if (!zend_hash_find(allowed_hosts, url_parts->host)) {
php_url_free(url_parts);
return FAILURE;
}
@@ -904,7 +902,7 @@ static inline int php_url_scanner_reset_var_impl(zend_string *name, int encode,
}
/* Check preceeding separator */
if (!sep_removed
- && start - PG(arg_separator).output >= separator_len
+ && (size_t)(start - PG(arg_separator).output) >= separator_len
&& !memcmp(start - separator_len, PG(arg_separator).output, separator_len)) {
start -= separator_len;
}
diff --git a/ext/standard/var.c b/ext/standard/var.c
index 0ae7991412..e28afe9177 100644
--- a/ext/standard/var.c
+++ b/ext/standard/var.c
@@ -119,10 +119,12 @@ again:
break;
case IS_ARRAY:
myht = Z_ARRVAL_P(struc);
- if (level > 1 && ZEND_HASH_APPLY_PROTECTION(myht) && ++myht->u.v.nApplyCount > 1) {
- PUTS("*RECURSION*\n");
- --myht->u.v.nApplyCount;
- return;
+ if (level > 1 && !(GC_FLAGS(myht) & GC_IMMUTABLE)) {
+ if (GC_IS_RECURSIVE(myht)) {
+ PUTS("*RECURSION*\n");
+ return;
+ }
+ GC_PROTECT_RECURSION(myht);
}
count = zend_array_count(myht);
php_printf("%sarray(%d) {\n", COMMON, count);
@@ -131,8 +133,8 @@ again:
ZEND_HASH_FOREACH_KEY_VAL_IND(myht, num, key, val) {
php_array_element_dump(val, num, key, level);
} ZEND_HASH_FOREACH_END();
- if (level > 1 && ZEND_HASH_APPLY_PROTECTION(myht)) {
- --myht->u.v.nApplyCount;
+ if (level > 1 && !(GC_FLAGS(myht) & GC_IMMUTABLE)) {
+ GC_UNPROTECT_RECURSION(myht);
}
if (is_temp) {
zend_hash_destroy(myht);
@@ -144,11 +146,11 @@ again:
PUTS("}\n");
break;
case IS_OBJECT:
- if (Z_OBJ_APPLY_COUNT_P(struc) > 0) {
+ if (Z_IS_RECURSIVE_P(struc)) {
PUTS("*RECURSION*\n");
return;
}
- Z_OBJ_INC_APPLY_COUNT_P(struc);
+ Z_PROTECT_RECURSION_P(struc);
myht = Z_OBJDEBUG_P(struc, is_temp);
class_name = Z_OBJ_HANDLER_P(struc, get_class_name)(Z_OBJ_P(struc));
@@ -172,7 +174,7 @@ again:
php_printf("%*c", level-1, ' ');
}
PUTS("}\n");
- Z_OBJ_DEC_APPLY_COUNT_P(struc);
+ Z_UNPROTECT_RECURSION_P(struc);
break;
case IS_RESOURCE: {
const char *type_name = zend_rsrc_list_get_rsrc_type(Z_RES_P(struc));
@@ -289,18 +291,20 @@ again:
break;
case IS_ARRAY:
myht = Z_ARRVAL_P(struc);
- if (level > 1 && ZEND_HASH_APPLY_PROTECTION(myht) && myht->u.v.nApplyCount++ > 1) {
- myht->u.v.nApplyCount--;
- PUTS("*RECURSION*\n");
- return;
+ if (level > 1 && !(GC_FLAGS(myht) & GC_IMMUTABLE)) {
+ if (GC_IS_RECURSIVE(myht)) {
+ PUTS("*RECURSION*\n");
+ return;
+ }
+ GC_PROTECT_RECURSION(myht);
}
count = zend_array_count(myht);
php_printf("%sarray(%d) refcount(%u){\n", COMMON, count, Z_REFCOUNTED_P(struc) ? Z_REFCOUNT_P(struc) : 1);
ZEND_HASH_FOREACH_KEY_VAL_IND(myht, index, key, val) {
zval_array_element_dump(val, index, key, level);
} ZEND_HASH_FOREACH_END();
- if (level > 1 && ZEND_HASH_APPLY_PROTECTION(myht)) {
- myht->u.v.nApplyCount--;
+ if (level > 1 && !(GC_FLAGS(myht) & GC_IMMUTABLE)) {
+ GC_UNPROTECT_RECURSION(myht);
}
if (is_temp) {
zend_hash_destroy(myht);
@@ -314,12 +318,11 @@ again:
case IS_OBJECT:
myht = Z_OBJDEBUG_P(struc, is_temp);
if (myht) {
- if (myht->u.v.nApplyCount > 1) {
+ if (GC_IS_RECURSIVE(myht)) {
PUTS("*RECURSION*\n");
return;
- } else {
- myht->u.v.nApplyCount++;
}
+ GC_PROTECT_RECURSION(myht);
}
class_name = Z_OBJ_HANDLER_P(struc, get_class_name)(Z_OBJ_P(struc));
php_printf("%sobject(%s)#%d (%d) refcount(%u){\n", COMMON, ZSTR_VAL(class_name), Z_OBJ_HANDLE_P(struc), myht ? zend_array_count(myht) : 0, Z_REFCOUNT_P(struc));
@@ -328,7 +331,7 @@ again:
ZEND_HASH_FOREACH_KEY_VAL_IND(myht, index, key, val) {
zval_object_property_dump(val, index, key, level);
} ZEND_HASH_FOREACH_END();
- myht->u.v.nApplyCount--;
+ GC_UNPROTECT_RECURSION(myht);
if (is_temp) {
zend_hash_destroy(myht);
efree(myht);
@@ -487,11 +490,13 @@ again:
break;
case IS_ARRAY:
myht = Z_ARRVAL_P(struc);
- if (ZEND_HASH_APPLY_PROTECTION(myht) && myht->u.v.nApplyCount++ > 0) {
- myht->u.v.nApplyCount--;
- smart_str_appendl(buf, "NULL", 4);
- zend_error(E_WARNING, "var_export does not handle circular references");
- return;
+ if (!(GC_FLAGS(myht) & GC_IMMUTABLE)) {
+ if (GC_IS_RECURSIVE(myht)) {
+ smart_str_appendl(buf, "NULL", 4);
+ zend_error(E_WARNING, "var_export does not handle circular references");
+ return;
+ }
+ GC_PROTECT_RECURSION(myht);
}
if (level > 1) {
smart_str_appendc(buf, '\n');
@@ -501,8 +506,8 @@ again:
ZEND_HASH_FOREACH_KEY_VAL_IND(myht, index, key, val) {
php_array_element_export(val, index, key, level, buf);
} ZEND_HASH_FOREACH_END();
- if (ZEND_HASH_APPLY_PROTECTION(myht)) {
- myht->u.v.nApplyCount--;
+ if (!(GC_FLAGS(myht) & GC_IMMUTABLE)) {
+ GC_UNPROTECT_RECURSION(myht);
}
if (level > 1) {
buffer_append_spaces(buf, level - 1);
@@ -514,12 +519,12 @@ again:
case IS_OBJECT:
myht = Z_OBJPROP_P(struc);
if (myht) {
- if (myht->u.v.nApplyCount > 0) {
+ if (GC_IS_RECURSIVE(myht)) {
smart_str_appendl(buf, "NULL", 4);
zend_error(E_WARNING, "var_export does not handle circular references");
return;
} else {
- myht->u.v.nApplyCount++;
+ GC_PROTECT_RECURSION(myht);
}
}
if (level > 1) {
@@ -534,7 +539,7 @@ again:
ZEND_HASH_FOREACH_KEY_VAL_IND(myht, index, key, val) {
php_object_element_export(val, index, key, level, buf);
} ZEND_HASH_FOREACH_END();
- myht->u.v.nApplyCount--;
+ GC_UNPROTECT_RECURSION(myht);
}
if (level > 1) {
buffer_append_spaces(buf, level - 1);
@@ -951,18 +956,22 @@ again:
/* we should still add element even if it's not OK,
* since we already wrote the length of the array before */
- if ((Z_TYPE_P(data) == IS_ARRAY && Z_TYPE_P(struc) == IS_ARRAY && Z_ARR_P(data) == Z_ARR_P(struc))
- || (Z_TYPE_P(data) == IS_ARRAY && Z_ARRVAL_P(data)->u.v.nApplyCount > 1)
- ) {
- smart_str_appendl(buf, "N;", 2);
- } else {
- if (Z_TYPE_P(data) == IS_ARRAY && ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(data))) {
- Z_ARRVAL_P(data)->u.v.nApplyCount++;
+ if (Z_TYPE_P(data) == IS_ARRAY) {
+ if (Z_TYPE_P(data) == IS_ARRAY
+ && (UNEXPECTED(Z_IS_RECURSIVE_P(data))
+ || UNEXPECTED(Z_TYPE_P(struc) == IS_ARRAY && Z_ARR_P(data) == Z_ARR_P(struc)))) {
+ smart_str_appendl(buf, "N;", 2);
+ } else {
+ if (Z_REFCOUNTED_P(data)) {
+ Z_PROTECT_RECURSION_P(data);
+ }
+ php_var_serialize_intern(buf, data, var_hash);
+ if (Z_REFCOUNTED_P(data)) {
+ Z_UNPROTECT_RECURSION_P(data);
+ }
}
+ } else {
php_var_serialize_intern(buf, data, var_hash);
- if (Z_TYPE_P(data) == IS_ARRAY && ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(data))) {
- Z_ARRVAL_P(data)->u.v.nApplyCount--;
- }
}
} ZEND_HASH_FOREACH_END();
}
diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c
index 7e429a40bd..b32379a064 100644
--- a/ext/standard/var_unserializer.c
+++ b/ext/standard/var_unserializer.c
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.16 */
+/* Generated by re2c 0.14.3 */
#line 1 "ext/standard/var_unserializer.re"
/*
+----------------------------------------------------------------------+
@@ -571,7 +571,7 @@ static inline int object_common2(UNSERIALIZE_PARAMETER, zend_long elements)
&& zend_hash_str_exists(&Z_OBJCE_P(rval)->function_table, "__wakeup", sizeof("__wakeup")-1);
ht = Z_OBJPROP_P(rval);
- if (elements >= HT_MAX_SIZE - zend_hash_num_elements(ht)) {
+ if (elements >= (zend_long)(HT_MAX_SIZE - zend_hash_num_elements(ht))) {
return 0;
}
@@ -681,456 +681,105 @@ static int php_var_unserialize_internal(UNSERIALIZE_PARAMETER)
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
+
if ((YYLIMIT - YYCURSOR) < 7) YYFILL(7);
yych = *YYCURSOR;
switch (yych) {
case 'C':
- case 'O': goto yy4;
+ case 'O': goto yy13;
case 'N': goto yy5;
- case 'R': goto yy6;
- case 'S': goto yy7;
- case 'a': goto yy8;
- case 'b': goto yy9;
- case 'd': goto yy10;
- case 'i': goto yy11;
+ case 'R': goto yy2;
+ case 'S': goto yy10;
+ case 'a': goto yy11;
+ case 'b': goto yy6;
+ case 'd': goto yy8;
+ case 'i': goto yy7;
case 'o': goto yy12;
- case 'r': goto yy13;
- case 's': goto yy14;
- case '}': goto yy15;
- default: goto yy2;
+ case 'r': goto yy4;
+ case 's': goto yy9;
+ case '}': goto yy14;
+ default: goto yy16;
}
yy2:
- ++YYCURSOR;
+ yych = *(YYMARKER = ++YYCURSOR);
+ if (yych == ':') goto yy88;
yy3:
-#line 1035 "ext/standard/var_unserializer.re"
+#line 1036 "ext/standard/var_unserializer.re"
{ return 0; }
-#line 708 "ext/standard/var_unserializer.c"
+#line 710 "ext/standard/var_unserializer.c"
yy4:
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == ':') goto yy17;
+ if (yych == ':') goto yy83;
goto yy3;
yy5:
yych = *++YYCURSOR;
- if (yych == ';') goto yy19;
+ if (yych == ';') goto yy81;
goto yy3;
yy6:
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == ':') goto yy21;
+ if (yych == ':') goto yy77;
goto yy3;
yy7:
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == ':') goto yy22;
+ if (yych == ':') goto yy71;
goto yy3;
yy8:
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == ':') goto yy23;
+ if (yych == ':') goto yy48;
goto yy3;
yy9:
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == ':') goto yy24;
+ if (yych == ':') goto yy42;
goto yy3;
yy10:
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == ':') goto yy25;
+ if (yych == ':') goto yy36;
goto yy3;
yy11:
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == ':') goto yy26;
+ if (yych == ':') goto yy30;
goto yy3;
yy12:
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == ':') goto yy27;
+ if (yych == ':') goto yy24;
goto yy3;
yy13:
yych = *(YYMARKER = ++YYCURSOR);
- if (yych == ':') goto yy28;
+ if (yych == ':') goto yy17;
goto yy3;
yy14:
- yych = *(YYMARKER = ++YYCURSOR);
- if (yych == ':') goto yy29;
- goto yy3;
-yy15:
++YYCURSOR;
-#line 1029 "ext/standard/var_unserializer.re"
+#line 1030 "ext/standard/var_unserializer.re"
{
/* this is the case where we have less data than planned */
php_error_docref(NULL, E_NOTICE, "Unexpected end of serialized data");
return 0; /* not sure if it should be 0 or 1 here? */
}
-#line 761 "ext/standard/var_unserializer.c"
+#line 759 "ext/standard/var_unserializer.c"
+yy16:
+ yych = *++YYCURSOR;
+ goto yy3;
yy17:
yych = *++YYCURSOR;
if (yybm[0+yych] & 128) {
- goto yy30;
+ goto yy19;
}
yy18:
YYCURSOR = YYMARKER;
goto yy3;
yy19:
++YYCURSOR;
-#line 701 "ext/standard/var_unserializer.re"
- {
- *p = YYCURSOR;
- ZVAL_NULL(rval);
- return 1;
-}
-#line 778 "ext/standard/var_unserializer.c"
-yy21:
- yych = *++YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy32;
- goto yy18;
-yy22:
- yych = *++YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy34;
- goto yy18;
-yy23:
- yych = *++YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy36;
- goto yy18;
-yy24:
- yych = *++YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych <= '1') goto yy38;
- goto yy18;
-yy25:
- yych = *++YYCURSOR;
- if (yych <= '/') {
- if (yych <= ',') {
- if (yych == '+') goto yy39;
- goto yy18;
- } else {
- if (yych <= '-') goto yy40;
- if (yych <= '.') goto yy41;
- goto yy18;
- }
- } else {
- if (yych <= 'I') {
- if (yych <= '9') goto yy42;
- if (yych <= 'H') goto yy18;
- goto yy44;
- } else {
- if (yych == 'N') goto yy45;
- goto yy18;
- }
- }
-yy26:
- yych = *++YYCURSOR;
- if (yych <= ',') {
- if (yych == '+') goto yy46;
- goto yy18;
- } else {
- if (yych <= '-') goto yy46;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy47;
- goto yy18;
- }
-yy27:
- yych = *++YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy49;
- goto yy18;
-yy28:
- yych = *++YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy51;
- goto yy18;
-yy29:
- yych = *++YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy53;
- goto yy18;
-yy30:
- ++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = *YYCURSOR;
if (yybm[0+yych] & 128) {
- goto yy30;
- }
- if (yych <= '/') goto yy18;
- if (yych <= ':') goto yy55;
- goto yy18;
-yy32:
- ++YYCURSOR;
- if (YYLIMIT <= YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy32;
- if (yych == ';') goto yy56;
- goto yy18;
-yy34:
- ++YYCURSOR;
- if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
- yych = *YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy34;
- if (yych <= ':') goto yy58;
- goto yy18;
-yy36:
- ++YYCURSOR;
- if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
- yych = *YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy36;
- if (yych <= ':') goto yy59;
- goto yy18;
-yy38:
- yych = *++YYCURSOR;
- if (yych == ';') goto yy60;
- goto yy18;
-yy39:
- yych = *++YYCURSOR;
- if (yych == '.') goto yy41;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy42;
- goto yy18;
-yy40:
- yych = *++YYCURSOR;
- if (yych <= '/') {
- if (yych != '.') goto yy18;
- } else {
- if (yych <= '9') goto yy42;
- if (yych == 'I') goto yy44;
- goto yy18;
+ goto yy19;
}
-yy41:
- yych = *++YYCURSOR;
if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy62;
- goto yy18;
-yy42:
- ++YYCURSOR;
- if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
- yych = *YYCURSOR;
- if (yych <= ':') {
- if (yych <= '.') {
- if (yych <= '-') goto yy18;
- goto yy62;
- } else {
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy42;
- goto yy18;
- }
- } else {
- if (yych <= 'E') {
- if (yych <= ';') goto yy64;
- if (yych <= 'D') goto yy18;
- goto yy66;
- } else {
- if (yych == 'e') goto yy66;
- goto yy18;
- }
- }
-yy44:
- yych = *++YYCURSOR;
- if (yych == 'N') goto yy67;
- goto yy18;
-yy45:
- yych = *++YYCURSOR;
- if (yych == 'A') goto yy68;
- goto yy18;
-yy46:
- yych = *++YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych >= ':') goto yy18;
-yy47:
- ++YYCURSOR;
- if (YYLIMIT <= YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy47;
- if (yych == ';') goto yy69;
- goto yy18;
-yy49:
- ++YYCURSOR;
- if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
- yych = *YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy49;
- if (yych <= ':') goto yy71;
- goto yy18;
-yy51:
- ++YYCURSOR;
- if (YYLIMIT <= YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy51;
- if (yych == ';') goto yy72;
- goto yy18;
-yy53:
- ++YYCURSOR;
- if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
- yych = *YYCURSOR;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy53;
- if (yych <= ':') goto yy74;
- goto yy18;
-yy55:
- yych = *++YYCURSOR;
- if (yych == '"') goto yy75;
- goto yy18;
-yy56:
- ++YYCURSOR;
-#line 652 "ext/standard/var_unserializer.re"
- {
- zend_long id;
-
- *p = YYCURSOR;
- if (!var_hash) return 0;
-
- id = parse_uiv(start + 2) - 1;
- if (id == -1 || (rval_ref = var_access(var_hash, id)) == NULL) {
- return 0;
- }
-
- if (Z_ISUNDEF_P(rval_ref) || (Z_ISREF_P(rval_ref) && Z_ISUNDEF_P(Z_REFVAL_P(rval_ref)))) {
- return 0;
- }
-
- if (Z_ISREF_P(rval_ref)) {
- ZVAL_COPY(rval, rval_ref);
- } else {
- ZVAL_NEW_REF(rval_ref, rval_ref);
- ZVAL_COPY(rval, rval_ref);
- }
-
- return 1;
-}
-#line 1002 "ext/standard/var_unserializer.c"
-yy58:
- yych = *++YYCURSOR;
- if (yych == '"') goto yy77;
- goto yy18;
-yy59:
- yych = *++YYCURSOR;
- if (yych == '{') goto yy79;
- goto yy18;
-yy60:
- ++YYCURSOR;
-#line 707 "ext/standard/var_unserializer.re"
- {
- *p = YYCURSOR;
- ZVAL_BOOL(rval, parse_iv(start + 2));
- return 1;
-}
-#line 1019 "ext/standard/var_unserializer.c"
-yy62:
- ++YYCURSOR;
- if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
- yych = *YYCURSOR;
- if (yych <= ';') {
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy62;
- if (yych <= ':') goto yy18;
- } else {
- if (yych <= 'E') {
- if (yych <= 'D') goto yy18;
- goto yy66;
- } else {
- if (yych == 'e') goto yy66;
- goto yy18;
- }
- }
-yy64:
- ++YYCURSOR;
-#line 755 "ext/standard/var_unserializer.re"
- {
-#if SIZEOF_ZEND_LONG == 4
-use_double:
-#endif
- *p = YYCURSOR;
- ZVAL_DOUBLE(rval, zend_strtod((const char *)start + 2, NULL));
- return 1;
-}
-#line 1048 "ext/standard/var_unserializer.c"
-yy66:
- yych = *++YYCURSOR;
- if (yych <= ',') {
- if (yych == '+') goto yy81;
- goto yy18;
- } else {
- if (yych <= '-') goto yy81;
- if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy82;
- goto yy18;
- }
-yy67:
- yych = *++YYCURSOR;
- if (yych == 'F') goto yy84;
- goto yy18;
-yy68:
- yych = *++YYCURSOR;
- if (yych == 'N') goto yy84;
- goto yy18;
-yy69:
- ++YYCURSOR;
-#line 713 "ext/standard/var_unserializer.re"
- {
-#if SIZEOF_ZEND_LONG == 4
- int digits = YYCURSOR - start - 3;
-
- if (start[2] == '-' || start[2] == '+') {
- digits--;
- }
-
- /* Use double for large zend_long values that were serialized on a 64-bit system */
- if (digits >= MAX_LENGTH_OF_LONG - 1) {
- if (digits == MAX_LENGTH_OF_LONG - 1) {
- int cmp = strncmp((char*)YYCURSOR - MAX_LENGTH_OF_LONG, long_min_digits, MAX_LENGTH_OF_LONG - 1);
-
- if (!(cmp < 0 || (cmp == 0 && start[2] == '-'))) {
- goto use_double;
- }
- } else {
- goto use_double;
- }
- }
-#endif
- *p = YYCURSOR;
- ZVAL_LONG(rval, parse_iv(start + 2));
- return 1;
-}
-#line 1096 "ext/standard/var_unserializer.c"
-yy71:
+ if (yych >= ';') goto yy18;
yych = *++YYCURSOR;
- if (yych == '"') goto yy85;
- goto yy18;
-yy72:
+ if (yych != '"') goto yy18;
++YYCURSOR;
-#line 677 "ext/standard/var_unserializer.re"
- {
- zend_long id;
-
- *p = YYCURSOR;
- if (!var_hash) return 0;
-
- id = parse_uiv(start + 2) - 1;
- if (id == -1 || (rval_ref = var_access(var_hash, id)) == NULL) {
- return 0;
- }
-
- if (rval_ref == rval) {
- return 0;
- }
-
- if (Z_ISUNDEF_P(rval_ref) || (Z_ISREF_P(rval_ref) && Z_ISUNDEF_P(Z_REFVAL_P(rval_ref)))) {
- return 0;
- }
-
- ZVAL_COPY(rval, rval_ref);
-
- return 1;
-}
-#line 1127 "ext/standard/var_unserializer.c"
-yy74:
- yych = *++YYCURSOR;
- if (yych == '"') goto yy87;
- goto yy18;
-yy75:
- ++YYCURSOR;
-#line 877 "ext/standard/var_unserializer.re"
+#line 878 "ext/standard/var_unserializer.re"
{
size_t len, len2, len3, maxlen;
zend_long elements;
@@ -1282,47 +931,48 @@ yy75:
return object_common2(UNSERIALIZE_PASSTHRU, elements);
}
-#line 1286 "ext/standard/var_unserializer.c"
-yy77:
+#line 935 "ext/standard/var_unserializer.c"
+yy24:
+ yych = *++YYCURSOR;
+ if (yych <= '/') goto yy18;
+ if (yych >= ':') goto yy18;
+yy25:
++YYCURSOR;
-#line 802 "ext/standard/var_unserializer.re"
+ if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+ if (yych <= '/') goto yy18;
+ if (yych <= '9') goto yy25;
+ if (yych >= ';') goto yy18;
+ yych = *++YYCURSOR;
+ if (yych != '"') goto yy18;
+ ++YYCURSOR;
+#line 867 "ext/standard/var_unserializer.re"
{
- size_t len, maxlen;
- zend_string *str;
-
- len = parse_uiv(start + 2);
- maxlen = max - YYCURSOR;
- if (maxlen < len) {
- *p = start + 2;
- return 0;
- }
-
- if ((str = unserialize_str(&YYCURSOR, len, maxlen)) == NULL) {
- return 0;
- }
-
- if (*(YYCURSOR) != '"') {
- zend_string_free(str);
- *p = YYCURSOR;
- return 0;
- }
+ zend_long elements;
+ if (!var_hash) return 0;
- if (*(YYCURSOR + 1) != ';') {
- efree(str);
- *p = YYCURSOR + 1;
+ elements = object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR);
+ if (elements < 0 || elements >= HT_MAX_SIZE) {
return 0;
}
-
- YYCURSOR += 2;
- *p = YYCURSOR;
-
- ZVAL_STR(rval, str);
- return 1;
+ return object_common2(UNSERIALIZE_PASSTHRU, elements);
}
-#line 1323 "ext/standard/var_unserializer.c"
-yy79:
+#line 961 "ext/standard/var_unserializer.c"
+yy30:
+ yych = *++YYCURSOR;
+ if (yych <= '/') goto yy18;
+ if (yych >= ':') goto yy18;
+yy31:
++YYCURSOR;
-#line 836 "ext/standard/var_unserializer.re"
+ if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+ if (yych <= '/') goto yy18;
+ if (yych <= '9') goto yy31;
+ if (yych >= ';') goto yy18;
+ yych = *++YYCURSOR;
+ if (yych != '{') goto yy18;
+ ++YYCURSOR;
+#line 837 "ext/standard/var_unserializer.re"
{
zend_long elements = parse_iv(start + 2);
/* use iv() not uiv() in order to check data range */
@@ -1352,40 +1002,71 @@ yy79:
return finish_nested_data(UNSERIALIZE_PASSTHRU);
}
-#line 1356 "ext/standard/var_unserializer.c"
-yy81:
+#line 1006 "ext/standard/var_unserializer.c"
+yy36:
yych = *++YYCURSOR;
if (yych <= '/') goto yy18;
if (yych >= ':') goto yy18;
-yy82:
+yy37:
++YYCURSOR;
- if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = *YYCURSOR;
if (yych <= '/') goto yy18;
- if (yych <= '9') goto yy82;
- if (yych == ';') goto yy64;
- goto yy18;
-yy84:
+ if (yych <= '9') goto yy37;
+ if (yych >= ';') goto yy18;
yych = *++YYCURSOR;
- if (yych == ';') goto yy89;
- goto yy18;
-yy85:
+ if (yych != '"') goto yy18;
++YYCURSOR;
-#line 866 "ext/standard/var_unserializer.re"
+#line 803 "ext/standard/var_unserializer.re"
{
- zend_long elements;
- if (!var_hash) return 0;
+ size_t len, maxlen;
+ zend_string *str;
- elements = object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR);
- if (elements < 0 || elements >= HT_MAX_SIZE) {
+ len = parse_uiv(start + 2);
+ maxlen = max - YYCURSOR;
+ if (maxlen < len) {
+ *p = start + 2;
return 0;
}
- return object_common2(UNSERIALIZE_PASSTHRU, elements);
+
+ if ((str = unserialize_str(&YYCURSOR, len, maxlen)) == NULL) {
+ return 0;
+ }
+
+ if (*(YYCURSOR) != '"') {
+ zend_string_free(str);
+ *p = YYCURSOR;
+ return 0;
+ }
+
+ if (*(YYCURSOR + 1) != ';') {
+ efree(str);
+ *p = YYCURSOR + 1;
+ return 0;
+ }
+
+ YYCURSOR += 2;
+ *p = YYCURSOR;
+
+ ZVAL_STR(rval, str);
+ return 1;
}
-#line 1386 "ext/standard/var_unserializer.c"
-yy87:
+#line 1055 "ext/standard/var_unserializer.c"
+yy42:
+ yych = *++YYCURSOR;
+ if (yych <= '/') goto yy18;
+ if (yych >= ':') goto yy18;
+yy43:
++YYCURSOR;
-#line 764 "ext/standard/var_unserializer.re"
+ if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+ if (yych <= '/') goto yy18;
+ if (yych <= '9') goto yy43;
+ if (yych >= ';') goto yy18;
+ yych = *++YYCURSOR;
+ if (yych != '"') goto yy18;
+ ++YYCURSOR;
+#line 765 "ext/standard/var_unserializer.re"
{
size_t len, maxlen;
char *str;
@@ -1423,10 +1104,152 @@ yy87:
}
return 1;
}
-#line 1427 "ext/standard/var_unserializer.c"
-yy89:
+#line 1108 "ext/standard/var_unserializer.c"
+yy48:
+ yych = *++YYCURSOR;
+ if (yych <= '/') {
+ if (yych <= ',') {
+ if (yych == '+') goto yy52;
+ goto yy18;
+ } else {
+ if (yych <= '-') goto yy50;
+ if (yych <= '.') goto yy55;
+ goto yy18;
+ }
+ } else {
+ if (yych <= 'I') {
+ if (yych <= '9') goto yy53;
+ if (yych <= 'H') goto yy18;
+ goto yy51;
+ } else {
+ if (yych != 'N') goto yy18;
+ }
+ }
+ yych = *++YYCURSOR;
+ if (yych == 'A') goto yy70;
+ goto yy18;
+yy50:
+ yych = *++YYCURSOR;
+ if (yych <= '/') {
+ if (yych == '.') goto yy55;
+ goto yy18;
+ } else {
+ if (yych <= '9') goto yy53;
+ if (yych != 'I') goto yy18;
+ }
+yy51:
+ yych = *++YYCURSOR;
+ if (yych == 'N') goto yy66;
+ goto yy18;
+yy52:
+ yych = *++YYCURSOR;
+ if (yych == '.') goto yy55;
+ if (yych <= '/') goto yy18;
+ if (yych >= ':') goto yy18;
+yy53:
++YYCURSOR;
-#line 739 "ext/standard/var_unserializer.re"
+ if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
+ yych = *YYCURSOR;
+ if (yych <= ':') {
+ if (yych <= '.') {
+ if (yych <= '-') goto yy18;
+ goto yy64;
+ } else {
+ if (yych <= '/') goto yy18;
+ if (yych <= '9') goto yy53;
+ goto yy18;
+ }
+ } else {
+ if (yych <= 'E') {
+ if (yych <= ';') goto yy58;
+ if (yych <= 'D') goto yy18;
+ goto yy60;
+ } else {
+ if (yych == 'e') goto yy60;
+ goto yy18;
+ }
+ }
+yy55:
+ yych = *++YYCURSOR;
+ if (yych <= '/') goto yy18;
+ if (yych >= ':') goto yy18;
+yy56:
+ ++YYCURSOR;
+ if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
+ yych = *YYCURSOR;
+ if (yych <= ';') {
+ if (yych <= '/') goto yy18;
+ if (yych <= '9') goto yy56;
+ if (yych <= ':') goto yy18;
+ } else {
+ if (yych <= 'E') {
+ if (yych <= 'D') goto yy18;
+ goto yy60;
+ } else {
+ if (yych == 'e') goto yy60;
+ goto yy18;
+ }
+ }
+yy58:
+ ++YYCURSOR;
+#line 756 "ext/standard/var_unserializer.re"
+ {
+#if SIZEOF_ZEND_LONG == 4
+use_double:
+#endif
+ *p = YYCURSOR;
+ ZVAL_DOUBLE(rval, zend_strtod((const char *)start + 2, NULL));
+ return 1;
+}
+#line 1205 "ext/standard/var_unserializer.c"
+yy60:
+ yych = *++YYCURSOR;
+ if (yych <= ',') {
+ if (yych != '+') goto yy18;
+ } else {
+ if (yych <= '-') goto yy61;
+ if (yych <= '/') goto yy18;
+ if (yych <= '9') goto yy62;
+ goto yy18;
+ }
+yy61:
+ yych = *++YYCURSOR;
+ if (yych <= '/') goto yy18;
+ if (yych >= ':') goto yy18;
+yy62:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if (yych <= '/') goto yy18;
+ if (yych <= '9') goto yy62;
+ if (yych == ';') goto yy58;
+ goto yy18;
+yy64:
+ ++YYCURSOR;
+ if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
+ yych = *YYCURSOR;
+ if (yych <= ';') {
+ if (yych <= '/') goto yy18;
+ if (yych <= '9') goto yy64;
+ if (yych <= ':') goto yy18;
+ goto yy58;
+ } else {
+ if (yych <= 'E') {
+ if (yych <= 'D') goto yy18;
+ goto yy60;
+ } else {
+ if (yych == 'e') goto yy60;
+ goto yy18;
+ }
+ }
+yy66:
+ yych = *++YYCURSOR;
+ if (yych != 'F') goto yy18;
+yy67:
+ yych = *++YYCURSOR;
+ if (yych != ';') goto yy18;
+ ++YYCURSOR;
+#line 740 "ext/standard/var_unserializer.re"
{
*p = YYCURSOR;
@@ -1442,9 +1265,161 @@ yy89:
return 1;
}
-#line 1446 "ext/standard/var_unserializer.c"
+#line 1269 "ext/standard/var_unserializer.c"
+yy70:
+ yych = *++YYCURSOR;
+ if (yych == 'N') goto yy67;
+ goto yy18;
+yy71:
+ yych = *++YYCURSOR;
+ if (yych <= ',') {
+ if (yych != '+') goto yy18;
+ } else {
+ if (yych <= '-') goto yy72;
+ if (yych <= '/') goto yy18;
+ if (yych <= '9') goto yy73;
+ goto yy18;
+ }
+yy72:
+ yych = *++YYCURSOR;
+ if (yych <= '/') goto yy18;
+ if (yych >= ':') goto yy18;
+yy73:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if (yych <= '/') goto yy18;
+ if (yych <= '9') goto yy73;
+ if (yych != ';') goto yy18;
+ ++YYCURSOR;
+#line 714 "ext/standard/var_unserializer.re"
+ {
+#if SIZEOF_ZEND_LONG == 4
+ int digits = YYCURSOR - start - 3;
+
+ if (start[2] == '-' || start[2] == '+') {
+ digits--;
+ }
+
+ /* Use double for large zend_long values that were serialized on a 64-bit system */
+ if (digits >= MAX_LENGTH_OF_LONG - 1) {
+ if (digits == MAX_LENGTH_OF_LONG - 1) {
+ int cmp = strncmp((char*)YYCURSOR - MAX_LENGTH_OF_LONG, long_min_digits, MAX_LENGTH_OF_LONG - 1);
+
+ if (!(cmp < 0 || (cmp == 0 && start[2] == '-'))) {
+ goto use_double;
+ }
+ } else {
+ goto use_double;
+ }
+ }
+#endif
+ *p = YYCURSOR;
+ ZVAL_LONG(rval, parse_iv(start + 2));
+ return 1;
+}
+#line 1322 "ext/standard/var_unserializer.c"
+yy77:
+ yych = *++YYCURSOR;
+ if (yych <= '/') goto yy18;
+ if (yych >= '2') goto yy18;
+ yych = *++YYCURSOR;
+ if (yych != ';') goto yy18;
+ ++YYCURSOR;
+#line 708 "ext/standard/var_unserializer.re"
+ {
+ *p = YYCURSOR;
+ ZVAL_BOOL(rval, parse_iv(start + 2));
+ return 1;
+}
+#line 1336 "ext/standard/var_unserializer.c"
+yy81:
+ ++YYCURSOR;
+#line 702 "ext/standard/var_unserializer.re"
+ {
+ *p = YYCURSOR;
+ ZVAL_NULL(rval);
+ return 1;
+}
+#line 1345 "ext/standard/var_unserializer.c"
+yy83:
+ yych = *++YYCURSOR;
+ if (yych <= '/') goto yy18;
+ if (yych >= ':') goto yy18;
+yy84:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if (yych <= '/') goto yy18;
+ if (yych <= '9') goto yy84;
+ if (yych != ';') goto yy18;
+ ++YYCURSOR;
+#line 677 "ext/standard/var_unserializer.re"
+ {
+ zend_long id;
+
+ *p = YYCURSOR;
+ if (!var_hash) return 0;
+
+ id = parse_uiv(start + 2) - 1;
+ if (id == -1 || (rval_ref = var_access(var_hash, id)) == NULL) {
+ return 0;
+ }
+
+ if (rval_ref == rval) {
+ return 0;
+ }
+
+ ZVAL_DEREF(rval_ref);
+ if (Z_TYPE_P(rval_ref) != IS_OBJECT) {
+ return 0;
+ }
+
+ ZVAL_COPY(rval, rval_ref);
+
+ return 1;
+}
+#line 1383 "ext/standard/var_unserializer.c"
+yy88:
+ yych = *++YYCURSOR;
+ if (yych <= '/') goto yy18;
+ if (yych >= ':') goto yy18;
+yy89:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if (yych <= '/') goto yy18;
+ if (yych <= '9') goto yy89;
+ if (yych != ';') goto yy18;
+ ++YYCURSOR;
+#line 652 "ext/standard/var_unserializer.re"
+ {
+ zend_long id;
+
+ *p = YYCURSOR;
+ if (!var_hash) return 0;
+
+ id = parse_uiv(start + 2) - 1;
+ if (id == -1 || (rval_ref = var_access(var_hash, id)) == NULL) {
+ return 0;
+ }
+
+ if (Z_ISUNDEF_P(rval_ref) || (Z_ISREF_P(rval_ref) && Z_ISUNDEF_P(Z_REFVAL_P(rval_ref)))) {
+ return 0;
+ }
+
+ if (Z_ISREF_P(rval_ref)) {
+ ZVAL_COPY(rval, rval_ref);
+ } else {
+ ZVAL_NEW_REF(rval_ref, rval_ref);
+ ZVAL_COPY(rval, rval_ref);
+ }
+
+ return 1;
+}
+#line 1421 "ext/standard/var_unserializer.c"
}
-#line 1037 "ext/standard/var_unserializer.re"
+#line 1038 "ext/standard/var_unserializer.re"
return 0;
diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re
index 8db79bed5f..912d7be4c8 100644
--- a/ext/standard/var_unserializer.re
+++ b/ext/standard/var_unserializer.re
@@ -575,7 +575,7 @@ static inline int object_common2(UNSERIALIZE_PARAMETER, zend_long elements)
&& zend_hash_str_exists(&Z_OBJCE_P(rval)->function_table, "__wakeup", sizeof("__wakeup")-1);
ht = Z_OBJPROP_P(rval);
- if (elements >= HT_MAX_SIZE - zend_hash_num_elements(ht)) {
+ if (elements >= (zend_long)(HT_MAX_SIZE - zend_hash_num_elements(ht))) {
return 0;
}
@@ -689,7 +689,8 @@ static int php_var_unserialize_internal(UNSERIALIZE_PARAMETER)
return 0;
}
- if (Z_ISUNDEF_P(rval_ref) || (Z_ISREF_P(rval_ref) && Z_ISUNDEF_P(Z_REFVAL_P(rval_ref)))) {
+ ZVAL_DEREF(rval_ref);
+ if (Z_TYPE_P(rval_ref) != IS_OBJECT) {
return 0;
}
diff --git a/ext/sysvmsg/package.xml b/ext/sysvmsg/package.xml
deleted file mode 100644
index 403e949d35..0000000000
--- a/ext/sysvmsg/package.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>sysvmsg</name>
- <summary>Unix System V IPC Message Queues</summary>
- <maintainers>
- <maintainer>
- <user>wez</user>
- <name>Wez Furlong</name>
- <email>wez@php.net</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <description>
-Unix System V IPC Message Queues
- </description>
- <license>PHP</license>
- <release>
- <state>stable</state>
- <version>5.0.0rc1</version>
- <date>2004-03-19</date>
- <notes>
-package.xml added to support installation using pear installer
- </notes>
- <filelist>
- <file role="doc" name="CREDITS"/>
- <file role="src" name="config.m4"/>
- <file role="src" name="sysvmsg.c"/>
- <file role="src" name="php_sysvmsg.h"/>
- <file role="test" name="tests/001.phpt"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5" />
- <!-- doesn't work yet <dep type="os" rel="has" name="unix"/> -->
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/sysvsem/package.xml b/ext/sysvsem/package.xml
deleted file mode 100644
index 6c40af0e3b..0000000000
--- a/ext/sysvsem/package.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>sysvsem</name>
- <summary>Unix System V IPC Semaphores</summary>
- <maintainers>
- <maintainer>
- <user>???</user>
- <name>Tom May</name>
- <email>tom@go2net.com</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <description>
-Unix System V IPC Semaphores
- </description>
- <license>PHP</license>
- <release>
- <state>beta</state>
- <version>5.0.0rc1</version>
- <date>2004-03-19</date>
- <notes>
-package.xml added to support installation using pear installer
- </notes>
- <filelist>
- <file role="doc" name="CREDITS"/>
- <file role="src" name="config.m4"/>
- <file role="src" name="sysvsem.c"/>
- <file role="src" name="php_sysvsem.h"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5" />
- <!-- doesn't work yet <dep type="os" rel="has" name="unix"/> -->
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/sysvshm/package.xml b/ext/sysvshm/package.xml
deleted file mode 100644
index d26986bfa1..0000000000
--- a/ext/sysvshm/package.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>sysvsem</name>
- <summary>Unix System V IPC Shared Memory</summary>
- <maintainers>
- <maintainer>
- <user>???</user>
- <name>Cristian Cartus</name>
- <email>cartus@atrior.de</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <description>
-Unix System V IPC Shared Memory
- </description>
- <license>PHP</license>
- <release>
- <state>beta</state>
- <version>5.0.0rc1</version>
- <date>2004-03-19</date>
- <notes>
-package.xml added to support installation using pear installer
- </notes>
- <filelist>
- <file role="doc" name="CREDITS"/>
- <file role="src" name="config.m4"/>
- <file role="src" name="sysvsem.c"/>
- <file role="src" name="php_sysvshm.h"/>
- <file role="test" name="tests/sysvshm.phpt"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5" />
- <!-- doesn't work yet <dep type="os" rel="has" name="unix"/> -->
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/tidy/README b/ext/tidy/README
deleted file mode 100644
index 0fb6c0f035..0000000000
--- a/ext/tidy/README
+++ /dev/null
@@ -1,7 +0,0 @@
-
-README FOR ext/tidy by John Coggeshall <john@php.net>
-
-
-Tidy is an extension based on Libtidy (http://tidy.sf.net/) and allows a PHP developer
-to clean, repair, and traverse HTML, XHTML, and XML documents -- including ones with
-embedded scripting languages such as PHP or ASP within them using OO constructs.
diff --git a/ext/tidy/package.xml b/ext/tidy/package.xml
deleted file mode 100644
index a5b461ce45..0000000000
--- a/ext/tidy/package.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>tidy</name>
- <summary>Tidy HTML Repairing and Parsing</summary>
- <maintainers>
- <maintainer>
- <user>john</user>
- <name>John Coggeshall</name>
- <email>john@php.net</email>
- <role>lead</role>
- </maintainer>
- <maintainer>
- <user>iliaa</user>
- <name>Ilia Alshanetsky</name>
- <email>ilia@php.net</email>
- <role>developer</role>
- </maintainer>
- </maintainers>
- <description>
-Tidy is a binding for the Tidy HTML clean and repair utility which
-allows you to not only clean and otherwise manipluate HTML documents,
-but also traverse the document tree using the Zend Engine 2 OO semantics.
- </description>
- <license>PHP</license>
- <release>
- <state>beta</state>
- <version>2.0dev</version>
- <date>2003-11-13</date>
- <notes>
- Major API changes for PHP 5.0, including the re-introduction of resources, output buffering support,
- dual-nature syntax (tidy_clean_repair($tidy_res) or $tidy->clean_repair()) and more.
- </notes>
- <configureoptions>
- <configureoption name="with-tidy" default="autodetect" prompt="Tidy library installation dir?"/>
- </configureoptions>
- <filelist>
- <file role="src" name="config.m4"/>
- <file role="src" name="tidy.c"/>
- <file role="src" name="php_tidy.h"/>
-
- <file role="doc" name="CREDITS"/>
- <file role="doc" name="TODO"/>
- <file role="doc" name="examples/cleanhtml.php"/>
- <file role="doc" name="examples/dumpit.php"/>
- <file role="doc" name="examples/urlgrab.php"/>
- <file role="doc" name="libtidy.txt"/>
-
- <file role="test" name="tests/001.phpt"/>
- <file role="test" name="tests/002.phpt"/>
- <file role="test" name="tests/003.phpt"/>
- <file role="test" name="tests/004.phpt"/>
- <file role="test" name="tests/005.phpt"/>
- <file role="test" name="tests/005.html"/>
- <file role="test" name="tests/006.phpt"/>
- <file role="test" name="tests/007.phpt"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5" />
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/tokenizer/package.xml b/ext/tokenizer/package.xml
deleted file mode 100644
index c6ad4ff2a7..0000000000
--- a/ext/tokenizer/package.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>tokenizer</name>
- <summary>PHP Source code tokenizer</summary>
- <maintainers>
- <maintainer>
- <user>andrei</user>
- <name>Andrei Zmievski</name>
- <email>andrei@php.net</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <description>
-The tokenizer functions provide an interface to the PHP tokenizer
-embedded in the Zend Engine. Using these functions you may write
-your own PHP source analyzing or modification tools without having
-to deal with the language specification at the lexical level.
- </description>
- <license>PHP</license>
- <release>
- <state>beta</state>
- <version>5.0.0rc1</version>
- <date>2004-03-19</date>
- <notes>
-package.xml added to support installation using pear installer
- </notes>
- <filelist>
- <file role="doc" name="CREDITS"/>
- <file role="src" name="config.m4"/>
- <file role="src" name="Makefile.frag"/>
- <file role="src" name="config.w32"/>
- <file role="src" name="tokenizer.c"/>
- <file role="src" name="php_tokenizer.h"/>
- <file role="doc" name="tokenizer.php"/>
- <file role="test" name="tests/bug26463.phpt"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5" />
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/wddx/package.xml b/ext/wddx/package.xml
deleted file mode 100644
index 9656ed1d16..0000000000
--- a/ext/wddx/package.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>wddx</name>
- <summary>WDDX serialization functions</summary>
- <maintainers>
- <maintainer>
- <user>andrei</user>
- <name>Andrei Zmievski</name>
- <email>andrei@php.net</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <description>
-These functions are intended for work with WDDX (http://www.openwddx.org/)
- </description>
- <license>PHP</license>
- <release>
- <state>beta</state>
- <version>5.0.0rc1</version>
- <date>2004-03-19</date>
- <notes>
-package.xml added to support installation using pear installer
- </notes>
- <filelist>
- <file role="doc" name="CREDITS"/>
- <file role="src" name="config.m4"/>
- <file role="src" name="config.w32"/>
- <file role="src" name="wddx.c"/>
- <file role="src" name="php_wddx.h"/>
- <file role="src" name="php_wddx_api.h"/>
- <file role="test" name="tests/001.phpt"/>
- <file role="test" name="tests/wddx.xml"/>
- <file role="test" name="tests/bug27287.phpt"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5" />
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c
index b6af00edd7..556af05112 100644
--- a/ext/wddx/wddx.c
+++ b/ext/wddx/wddx.c
@@ -640,28 +640,28 @@ void php_wddx_serialize_var(wddx_packet *packet, zval *var, zend_string *name)
case IS_ARRAY:
ht = Z_ARRVAL_P(var);
- if (ht->u.v.nApplyCount > 1) {
- zend_throw_error(NULL, "WDDX doesn't support circular references");
- return;
- }
- if (ZEND_HASH_APPLY_PROTECTION(ht)) {
- ht->u.v.nApplyCount++;
+ if (Z_REFCOUNTED_P(var)) {
+ if (GC_IS_RECURSIVE(ht)) {
+ zend_throw_error(NULL, "WDDX doesn't support circular references");
+ return;
+ }
+ GC_PROTECT_RECURSION(ht);
}
php_wddx_serialize_array(packet, var);
- if (ZEND_HASH_APPLY_PROTECTION(ht)) {
- ht->u.v.nApplyCount--;
+ if (Z_REFCOUNTED_P(var)) {
+ GC_UNPROTECT_RECURSION(ht);
}
break;
case IS_OBJECT:
ht = Z_OBJPROP_P(var);
- if (ht->u.v.nApplyCount > 1) {
+ if (GC_IS_RECURSIVE(ht)) {
zend_throw_error(NULL, "WDDX doesn't support circular references");
return;
}
- ht->u.v.nApplyCount++;
+ GC_PROTECT_RECURSION(ht);
php_wddx_serialize_object(packet, var);
- ht->u.v.nApplyCount--;
+ GC_UNPROTECT_RECURSION(ht);
break;
}
@@ -691,28 +691,26 @@ static void php_wddx_add_var(wddx_packet *packet, zval *name_var)
target_hash = HASH_OF(name_var);
- if (is_array && target_hash->u.v.nApplyCount > 1) {
- php_error_docref(NULL, E_WARNING, "recursion detected");
- return;
- }
-
if (!Z_REFCOUNTED_P(name_var)) {
ZEND_HASH_FOREACH_VAL(target_hash, val) {
php_wddx_add_var(packet, val);
} ZEND_HASH_FOREACH_END();
} else {
- ZEND_HASH_FOREACH_VAL(target_hash, val) {
- if (is_array) {
- target_hash->u.v.nApplyCount++;
+ if (is_array) {
+ if (GC_IS_RECURSIVE(target_hash)) {
+ php_error_docref(NULL, E_WARNING, "recursion detected");
+ return;
}
-
+ GC_PROTECT_RECURSION(target_hash);
+ }
+ ZEND_HASH_FOREACH_VAL(target_hash, val) {
ZVAL_DEREF(val);
php_wddx_add_var(packet, val);
- if (is_array) {
- target_hash->u.v.nApplyCount--;
- }
} ZEND_HASH_FOREACH_END();
+ if (is_array) {
+ GC_UNPROTECT_RECURSION(target_hash);
+ }
}
}
}
diff --git a/ext/xml/package.xml b/ext/xml/package.xml
deleted file mode 100644
index ae5e6450d8..0000000000
--- a/ext/xml/package.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>xml</name>
- <summary>XML Parsing functions</summary>
- <maintainers>
- <maintainer>
- <user>ssb</user>
- <name>Stig Bakken</name>
- <email>ssb@php.net</email>
- <role>lead</role>
- </maintainer>
- <maintainer>
- <user>thies</user>
- <name>Thies Arntzen</name>
- <email>thies@php.net</email>
- <role>lead</role>
- </maintainer>
- <maintainer>
- <user>sterling</user>
- <name>Sterling Hughes</name>
- <email>sterling@php.net</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <description>
-This extension lets you create XML parsers and then define
-handlers for different XML events. Each XML parser also has
-a few parameters you can adjust.
- </description>
- <license>PHP</license>
- <release>
- <state>beta</state>
- <version>5.0rc1</version>
- <date>2004-03-19</date>
- <notes>
-package.xml added to support installation using pear installer
- </notes>
- <configureoptions>
- <configureoption name="with-curl" default="autodetect" prompt="path to curl installation?"/>
- </configureoptions>
- <filelist>
- <file role="doc" name="CREDITS"/>
- <file role="src" name="config.m4"/>
- <file role="src" name="config.mw32"/>
- <file role="src" name="xml.mak"/>
- <file role="src" name="compat.c"/>
- <file role="src" name="expat_compat.h"/>
- <file role="src" name="php_xml.h"/>
- <file role="src" name="xml.c"/>
- <file role="test" name="tests/.cvsignore"/>
- <file role="test" name="tests/inc.ent"/>
- <file role="test" name="tests/skipif.inc"/>
- <file role="test" name="tests/xml001.phpt"/>
- <file role="test" name="tests/xml002.phpt"/>
- <file role="test" name="tests/xml003.phpt"/>
- <file role="test" name="tests/xml004.phpt"/>
- <file role="test" name="tests/xml006.phpt"/>
- <file role="test" name="tests/xml007.phpt"/>
- <file role="test" name="tests/xmltest.xml"/>
- <file role="test" name="tests/bug25666.phpt"/>
- <file role="test" name="tests/bug26528.phpt"/>
- <file role="test" name="tests/bug26614.phpt"/>
- <file role="test" name="tests/xml009.phpt"/>
- <file role="test" name="tests/xml010.phpt"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5" />
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/xml/xml.c b/ext/xml/xml.c
index 48614ad421..4761844f44 100644
--- a/ext/xml/xml.c
+++ b/ext/xml/xml.c
@@ -70,7 +70,7 @@ ZEND_GET_MODULE(xml)
/* }}} */
-#define SKIP_TAGSTART(str) ((str) + (parser->toffset > strlen(str) ? strlen(str) : parser->toffset))
+#define SKIP_TAGSTART(str) ((str) + (parser->toffset > (int)strlen(str) ? strlen(str) : parser->toffset))
/* {{{ function prototypes */
diff --git a/ext/xml/xml.mak b/ext/xml/xml.mak
deleted file mode 100644
index b712dea1d6..0000000000
--- a/ext/xml/xml.mak
+++ /dev/null
@@ -1,172 +0,0 @@
-# Temporarily here -- later may go into some batch file
-# which will set this as an environment variable
-PROJECT_ROOT = ..\..
-
-# Module details
-MODULE_NAME = php_xml
-MODULE_DESC = "PHP 7 - XML Extension"
-VMAJ = 3
-VMIN = 0
-VREV = 0
-
-#include the common settings
-include $(PROJECT_ROOT)/netware/common.mif
-
-# Extensions of all input and output files
-.SUFFIXES:
-.SUFFIXES: .nlm .lib .obj .cpp .c .msg .mlc .mdb .xdc .d
-
-# Source files
-C_SRC = xml.c \
- start.c
-
-CPP_SRC_NODIR = $(notdir $(CPP_SRC))
-C_SRC_NODIR = $(notdir $(C_SRC))
-SRC_DIR = $(dir $(CPP_SRC) $(C_SRC))
-
-# Library files
-LIBRARY =
-
-# Destination directories and files
-OBJ_DIR = $(BUILD)
-FINAL_DIR = $(BUILD)
-MAP_FILE = $(FINAL_DIR)\$(MODULE_NAME).map
-OBJECTS = $(addprefix $(OBJ_DIR)/,$(CPP_SRC_NODIR:.c=.obj) $(C_SRC_NODIR:.c=.obj))
-DEPDS = $(addprefix $(OBJ_DIR)/,$(CPP_SRC_NODIR:.c=.d) $(C_SRC_NODIR:.c=.d))
-
-# Binary file
-ifndef BINARY
- BINARY=$(FINAL_DIR)\$(MODULE_NAME).nlm
-endif
-
-# Compile flags
-C_FLAGS += -c -maxerrors 25 -msgstyle gcc
-C_FLAGS += -wchar_t on -bool on
-C_FLAGS += -processor Pentium
-C_FLAGS += -nostdinc -nosyspath
-C_FLAGS += -relax_pointers # To remove type-casting errors
-C_FLAGS += -DNETWARE -DZTS
-C_FLAGS += -DNEW_LIBC
-C_FLAGS += -DCOMPILE_DL_XML -DHAVE_LIBEXPAT=1
-C_FLAGS += -I. -I- -I$(PROJECT_ROOT) -I$(PROJECT_ROOT)/main
-C_FLAGS += -I$(PROJECT_ROOT)/ext/standard -I$(PROJECT_ROOT)/netware
-C_FLAGS += -I$(PROJECT_ROOT)/zend -I$(PROJECT_ROOT)/tsrm
-C_FLAGS += -I$(SDK_DIR)/include -I$(MWCIncludes)
-C_FLAGS += -I$(EXPAT_DIR)/include
-
-ifndef STACK_SIZE
-STACK_SIZE=8192
-endif
-
-# Extra stuff based on debug / release builds
-ifeq '$(BUILD)' 'debug'
- SYM_FILE = $(FINAL_DIR)\$(MODULE_NAME).sym
- C_FLAGS += -inline smart -sym on -sym codeview4 -opt off -opt intrinsics -sym internal -DDEBUGGING -DDKFBPON
- C_FLAGS += -exc cw -DZEND_DEBUG=1
- LD_FLAGS += -sym on -sym codeview4 -osym $(SYM_FILE)
- export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtld.lib
-else
- C_FLAGS += -opt speed -inline on -inline smart -inline auto -sym off
- C_FLAGS += -opt intrinsics
- C_FLAGS += -opt level=4 -DZEND_DEBUG=0
- LD_FLAGS += -sym off
- export MWLibraryFiles=$(SDK_DIR)/imports/libcpre.o;mwcrtl.lib
-endif
-
-# Dependencies
-MODULE = LibC \
- expatlbc \
- phplib
-IMPORT = @$(SDK_DIR)/imports/libc.imp \
- @$(SDK_DIR)/imports/ws2nlm.imp \
- @$(MPK_DIR)/import/mpkOrg.imp \
- @$(EXPAT_DIR)/imports/expatlbc.imp \
- @$(PROJECT_ROOT)/netware/phplib.imp
-EXPORT = ($(MODULE_NAME)) get_module
-API = OutputToScreen
-
-
-# Virtual paths
-vpath %.cpp .
-vpath %.c . ..\..\netware
-vpath %.obj $(OBJ_DIR)
-
-
-all: prebuild project
-
-.PHONY: all
-
-prebuild:
- @if not exist $(OBJ_DIR) md $(OBJ_DIR)
-
-project: $(BINARY)
- @echo Build complete.
-
-$(OBJ_DIR)/%.d: %.cpp
- @echo Building Dependencies for $(<F)
- @$(CC) -M $< $(C_FLAGS) -o $@
-
-$(OBJ_DIR)/%.d: %.c
- @echo Building Dependencies for $(<F)
- @$(CC) -M $< $(C_FLAGS) -o $@
-
-$(OBJ_DIR)/%.obj: %.cpp
- @echo Compiling $?...
- @$(CC) $< $(C_FLAGS) -o $@
-
-$(OBJ_DIR)/%.obj: %.c
- @echo Compiling $?...
- @$(CC) $< $(C_FLAGS) -o $@
-
-
-$(BINARY): $(OBJECTS)
- @echo Import $(IMPORT) > $(basename $@).def
-ifdef API
- @echo Import $(API) >> $(basename $@).def
-endif
- @echo Module $(MODULE) >> $(basename $@).def
-ifdef EXPORT
- @echo Export $(EXPORT) >> $(basename $@).def
-endif
- @echo AutoUnload >> $(basename $@).def
-ifeq '$(BUILD)' 'debug'
- @echo Debug >> $(basename $@).def
-endif
- @echo Flag_On 0x00000008 >> $(basename $@).def
- @echo Start _LibCPrelude >> $(basename $@).def
- @echo Exit _LibCPostlude >> $(basename $@).def
-
- $(MPKTOOL) $(XDCFLAGS) $(basename $@).xdc
- @echo xdcdata $(basename $@).xdc >> $(basename $@).def
-
- @echo Linking $@...
- @echo $(LD_FLAGS) -commandfile $(basename $@).def > $(basename $@).link
- @echo $(LIBRARY) $(OBJECTS) >> $(basename $@).link
-
- @$(LINK) @$(basename $@).link
-
-
-.PHONY: clean
-clean: cleanobj cleanbin
-
-.PHONY: cleand
-cleand:
- @echo Deleting all dependency files...
- -@del "$(OBJ_DIR)\*.d"
-
-.PHONY: cleanobj
-cleanobj:
- @echo Deleting all object files...
- -@del "$(OBJ_DIR)\*.obj"
-
-.PHONY: cleanbin
-cleanbin:
- @echo Deleting binary files...
- -@del "$(FINAL_DIR)\$(MODULE_NAME).nlm"
- @echo Deleting MAP, DEF files, etc....
- -@del "$(FINAL_DIR)\$(MODULE_NAME).map"
- -@del "$(FINAL_DIR)\$(MODULE_NAME).def"
- -@del "$(FINAL_DIR)\$(MODULE_NAME).link"
-ifeq '$(BUILD)' 'debug'
- -@del $(FINAL_DIR)\$(MODULE_NAME).sym
-endif
diff --git a/ext/xmlreader/package.xml b/ext/xmlreader/package.xml
deleted file mode 100644
index 6536b78c1f..0000000000
--- a/ext/xmlreader/package.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../package.dtd">
-<package>
- <name>xmlreader</name>
- <summary>Provides fast, non-cached, forward-only access to XML data under PHP 5.</summary>
- <description>
- This extension wraps the libxml xmlReader API. The reader acts as a cursor
- going forward on the document stream and stopping at each node in the way.
- xmlReader is similar to SAX though uses a much simpler API.
- </description>
- <license>PHP License</license>
- <maintainers>
- <maintainer>
- <user>rrichards</user>
- <name>Rob Richards</name>
- <email>rrichards@php.net</email>
- <role>lead</role>
- </maintainer>
- <maintainer>
- <user>chregu</user>
- <role>lead</role>
- <name>Christian Stocker</name>
- <email>chregu@php.net</email>
- </maintainer>
- </maintainers>
-
- <release>
- <version>1.0.1</version>
- <date>2005-04-30</date>
- <state>stable</state>
- <notes>
- Add workaround for next() bug when using libxml 2.6.17 and lower.
- </notes>
- </release>
-
- <changelog>
- <release>
- <version>1.0</version>
- <date>2004-07-27</date>
- <state>stable</state>
- <notes>
- Add name parameter to next() to skip to next named sibling node.
- </notes>
- </release>
- </changelog>
-
- <configureoptions>
- <configureoption name="with-xmlreader" default="autodetect" prompt="Include XMLReader support?"/>
- </configureoptions>
- <filelist>
- <file role="src" name="config.m4"/>
- <file role="src" name="config.w32"/>
- <file role="src" name="php_xmlreader.c"/>
- <file role="src" name="php_xmlreader.h"/>
-
- <file role="doc" name="CREDITS"/>
- <file role="doc" name="TODO"/>
- <file role="doc" name="README"/>
- <file role="doc" name="examples/xmlreader_file.php"/>
- <file role="doc" name="examples/xmlreader_string.php"/>
- <file role="doc" name="examples/xmlreader.xml"/>
- <file role="doc" name="examples/xmlreader_validatedtd.php"/>
- <file role="doc" name="examples/dtdexample.xml"/>
- <file role="doc" name="examples/dtdexample.dtd"/>
- <file role="doc" name="examples/xmlreader_relaxNG.php"/>
- <file role="doc" name="examples/relaxNG.xml"/>
- <file role="doc" name="examples/relaxNG.rng"/>
- <file role="doc" name="examples/relaxNG2.rng"/>
- <file role="doc" name="examples/relaxNG3.rng"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5" />
- <dep type="ext" rel="has">libxml</dep>
- </deps>
-</package>
diff --git a/ext/xmlrpc/xmlrpc-epi-php.c b/ext/xmlrpc/xmlrpc-epi-php.c
index 2b1a642c05..88f52519d0 100644
--- a/ext/xmlrpc/xmlrpc-epi-php.c
+++ b/ext/xmlrpc/xmlrpc-epi-php.c
@@ -556,9 +556,12 @@ static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int dep
XMLRPC_VECTOR_TYPE vtype;
ht = HASH_OF(&val);
- if (ht && ht->u.v.nApplyCount > 1) {
- zend_throw_error(NULL, "XML-RPC doesn't support circular references");
- return NULL;
+ if (ht && !(GC_FLAGS(ht) & GC_IMMUTABLE)) {
+ if (GC_IS_RECURSIVE(ht)) {
+ zend_throw_error(NULL, "XML-RPC doesn't support circular references");
+ return NULL;
+ }
+ GC_PROTECT_RECURSION(ht);
}
ZVAL_COPY(&val_arr, &val);
@@ -569,10 +572,6 @@ static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int dep
ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL(val_arr), num_index, my_key, pIter) {
ZVAL_DEREF(pIter);
- ht = HASH_OF(pIter);
- if (ht) {
- ht->u.v.nApplyCount++;
- }
if (my_key == NULL) {
char *num_str = NULL;
@@ -587,10 +586,10 @@ static XMLRPC_VALUE PHP_to_XMLRPC_worker (const char* key, zval* in_val, int dep
} else {
XMLRPC_AddValueToVector(xReturn, PHP_to_XMLRPC_worker(ZSTR_VAL(my_key), pIter, depth++));
}
- if (ht) {
- ht->u.v.nApplyCount--;
- }
} ZEND_HASH_FOREACH_END();
+ if (ht && !(GC_FLAGS(ht) & GC_IMMUTABLE)) {
+ GC_UNPROTECT_RECURSION(ht);
+ }
zval_ptr_dtor(&val_arr);
}
break;
@@ -1340,9 +1339,6 @@ XMLRPC_VALUE_TYPE get_zval_xmlrpc_type(zval* value, zval* newvalue) /* {{{ */
case IS_DOUBLE:
type = xmlrpc_double;
break;
- case IS_CONSTANT:
- type = xmlrpc_string;
- break;
case IS_STRING:
type = xmlrpc_string;
break;
diff --git a/ext/xmlwriter/package.xml b/ext/xmlwriter/package.xml
deleted file mode 100644
index 01f7ad4424..0000000000
--- a/ext/xmlwriter/package.xml
+++ /dev/null
@@ -1,107 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../package.dtd">
-<package>
- <name>xmlwriter</name>
- <summary>Provides fast, non-cached, forward-only means to write XML data.</summary>
- <description>This extension wraps the libxml xmlWriter API. Represents a writer that provides a non-cached, forward-only means of generating streams or files containing XML data.
-</description>
- <license>PHP</license>
- <maintainers>
- <maintainer>
- <user>rrichards</user>
- <name>Rob Richards</name>
- <email>rrichards@php.net</email>
- <role>lead</role>
- </maintainer>
- </maintainers>
- <maintainer>
- <user>pajoye</user>
- <name>Pierre-Alain Joye</name>
- <email>pajoye@php.net</email>
- <role>developer</role>
- </maintainer>
- <release>
- <version>2.0.2</version>
- <date>2005-12-01</date>
- <state>stable</state>
- <notes>- fix build under 5.0
-- fix crash when XMLWriter is instantiated but not used
-- Switch from BSD-like license to PHP License 3.01
-</notes>
- </release>
- <changelog>
- <release>
- <version>2.0.0</version>
- <date>2005-08-07</date>
- <state>stable</state>
- <notes>
- fix tests using UTF-8
- move to stable state
- </notes>
- </release>
-
- <release>
- <version>1.1.0</version>
- <date>2005-05-24</date>
- <state>beta</state>
- <notes>
- Add OO interface (php5 only)
- Add test cases
- </notes>
- </release>
- <release>
- <release>
- <version>2.0.1</version>
- <date>2005-11-15</date>
- <state>stable</state>
- <notes>- Switch from PHP License to BSD-like license
-- Allow recursive calls to __get/__set for different properties (ilia)
- </notes>
- </release>
- <version>1.0</version>
- <date>2005-05-02</date>
- <state>stable</state>
- <notes>
- Many Bug Fixes
- Use PHP streams under PHP 4
- Add xmlwriter_flush function to flush buffer
- Add support for xmlTextWriterStart/EndComment
- </notes>
- </release>
- <release>
- <version>0.1</version>
- <date>2004-07-20</date>
- <state>alpha</state>
- <notes>Initial Release </notes>
- </release>
- <release>
- <version>0.2</version>
- <date>2004-10-08</date>
- <state>alpha</state>
- <notes>Fix bug 2482 and other function parameters</notes>
- </release>
- </changelog>
-
- <configureoptions>
- <configureoption name="with-xmlwriter" default="autodetect" prompt="Include XMLWriter support?"/>
- </configureoptions>
- <filelist>
- <file role="src" name="config.m4"/>
- <file role="src" name="config.w32"/>
- <file role="src" name="php_xmlwriter.c"/>
- <file role="src" name="php_xmlwriter.h"/>
- <dir name="tests" role="test">
- <file name="001.phpt"/>
- <file name="002.phpt"/>
- <file name="003.phpt"/>
- <file name="004.phpt"/>
- <file name="OO_001.phpt"/>
- <file name="OO_002.phpt"/>
- <file name="OO_003.phpt"/>
- <file name="OO_004.phpt"/>
- </dir>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="4.3.0" />
- </deps>
-</package>
diff --git a/ext/xmlwriter/package2.xml b/ext/xmlwriter/package2.xml
deleted file mode 100644
index ec6ef313b1..0000000000
--- a/ext/xmlwriter/package2.xml
+++ /dev/null
@@ -1,94 +0,0 @@
-<?xml version="1.0"?>
-<package packagerversion="1.4.0a2" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <name>xmlwriter</name>
- <channel>pecl.php.net</channel>
- <summary>Provides fast, non-cached, forward-only means to write XML data.</summary>
- <description>This extension wraps the libxml xmlWriter API. Represents a writer that provides a non-cached, forward-only means of generating streams or files containing XML data.
-</description>
- <lead>
- <name>Rob Richards</name>
- <user>rrichards</user>
- <email>rrichards@php.net</email>
- <active>yes</active>
- </lead>
- <developer>
- <name>Pierre-Alain Joye</name>
- <user>pajoye</user>
- <email>pajoye@php.net</email>
- <active>yes</active>
- </developer>
- <date>2005-12-01</date>
- <version>
- <release>2.0.2</release>
- <api>2.0.0</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <license uri="http://www.php.net/license/3_01.txt">PHP</license>
- <notes>- fix build under 5.0
-- fix crash when XMLWriter is instantiated but not used
-- Switch from BSD-like license to PHP License 3.01
-</notes>
- <contents>
- <dir name="/">
- <file role="src" name="config.m4"/>
- <file role="src" name="config.w32"/>
- <file role="src" name="php_xmlwriter.c"/>
- <file role="src" name="php_xmlwriter.h"/>
- <dir name="tests" role="test">
- <file role="test" name="001.phpt"/>
- <file role="test" name="002.phpt"/>
- <file role="test" name="003.phpt"/>
- <file role="test" name="004.phpt"/>
- <file role="test" name="OO_001.phpt"/>
- <file role="test" name="OO_002.phpt"/>
- <file role="test" name="OO_003.phpt"/>
- <file role="test" name="OO_004.phpt"/>
- </dir>
- </dir>
- </contents>
- <dependencies>
- <required>
- <php>
- <min>4.3.0</min>
- </php>
- <pearinstaller>
- <min>1.4.0a2</min>
- </pearinstaller>
- </required>
- </dependencies>
- <providesextension>xmlwriter</providesextension>
- <extsrcrelease />
- <changelog>
- <release>
- <version>
- <release>2.0.1</release>
- <api>2.0.0</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
- <notes>- Switch from PHP License to BSD-like license
-- Allow recursive calls to __get/__set for different properties (ilia)
- </notes>
- </release>
- <release>
- <date>2005-08-07</date>
- <time>01:20:00</time>
- <version>
- <release>2.0.0</release>
- <api>2.0.0</api>
- </version>
- <stability>
- <release>stable</release>
- <api>stable</api>
- </stability>
- <license uri="http://www.php.net/license">PHP License</license>
- <notes>Promote to stable</notes>
- </release>
- </changelog>
-</package>
diff --git a/ext/xsl/php_xsl.c b/ext/xsl/php_xsl.c
index b7160232ef..61afc36099 100644
--- a/ext/xsl/php_xsl.c
+++ b/ext/xsl/php_xsl.c
@@ -113,10 +113,8 @@ zend_object *xsl_objects_new(zend_class_entry *class_type)
zend_object_std_init(&intern->std, class_type);
object_properties_init(&intern->std, class_type);
- ALLOC_HASHTABLE(intern->parameter);
- zend_hash_init(intern->parameter, 0, NULL, ZVAL_PTR_DTOR, 0);
- ALLOC_HASHTABLE(intern->registered_phpfunctions);
- zend_hash_init(intern->registered_phpfunctions, 0, NULL, ZVAL_PTR_DTOR, 0);
+ intern->parameter = zend_new_array(0);
+ intern->registered_phpfunctions = zend_new_array(0);
intern->std.handlers = &xsl_object_handlers;
return &intern->std;
diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c
index 3970e267ba..02c436e340 100644
--- a/ext/xsl/xsltprocessor.c
+++ b/ext/xsl/xsltprocessor.c
@@ -343,8 +343,7 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t
xmlNode *nodep;
dom_object *obj;
if (intern->node_list == NULL) {
- ALLOC_HASHTABLE(intern->node_list);
- zend_hash_init(intern->node_list, 0, NULL, ZVAL_PTR_DTOR, 0);
+ intern->node_list = zend_new_array(0);
}
Z_ADDREF(retval);
zend_hash_next_index_insert(intern->node_list, &retval);
diff --git a/ext/zend_test/test.c b/ext/zend_test/test.c
index 9549d28705..773225a64d 100644
--- a/ext/zend_test/test.c
+++ b/ext/zend_test/test.c
@@ -240,7 +240,7 @@ const zend_function_entry zend_test_functions[] = {
zend_module_entry zend_test_module_entry = {
STANDARD_MODULE_HEADER,
- "test",
+ "zend-test",
zend_test_functions,
PHP_MINIT(zend_test),
PHP_MSHUTDOWN(zend_test),
diff --git a/ext/zip/config.m4 b/ext/zip/config.m4
index 7ae43250c0..f928700c80 100644
--- a/ext/zip/config.m4
+++ b/ext/zip/config.m4
@@ -14,7 +14,7 @@ PHP_ARG_WITH(pcre-dir, pcre install prefix,
[ --with-pcre-dir ZIP: pcre install prefix], no, no)
PHP_ARG_WITH(libzip, libzip,
-[ --with-libzip[=DIR] ZIP: use libzip], no, no)
+[ --with-libzip[=DIR] ZIP: use libzip], yes, no)
if test "$PHP_ZIP" != "no"; then
diff --git a/ext/zip/config.w32 b/ext/zip/config.w32
index cdc42bdb1d..010237267c 100644
--- a/ext/zip/config.w32
+++ b/ext/zip/config.w32
@@ -17,39 +17,6 @@ if (PHP_ZIP != "no") {
AC_DEFINE('HAVE_ZIP', 1);
AC_DEFINE('HAVE_LIBZIP', 1);
ADD_FLAG("CFLAGS_ZIP", "/D _WIN32 /D HAVE_ENCRYPTION");
- } else if (CHECK_HEADER_ADD_INCLUDE("zlib.h", "CFLAGS_ZIP", "..\\zlib;" + PHP_ZIP) &&
- CHECK_HEADER_ADD_INCLUDE("zipconf.h", "CFLAGS_ZIP", configure_module_dirname + "\\lib;" + PHP_ZIP) &&
- (((PHP_ZLIB=="no") && (CHECK_LIB("zlib_a.lib", "zip", PHP_ZIP) || CHECK_LIB("zlib.lib", "zip", PHP_ZIP))) ||
- (PHP_ZLIB_SHARED && CHECK_LIB("zlib.lib", "zip", PHP_ZIP)) || (PHP_ZLIB == "yes" && (!PHP_ZLIB_SHARED)))
- ) {
- EXTENSION('zip', 'php_zip.c zip_stream.c');
- ADD_SOURCES(configure_module_dirname + "/lib", "zip_add.c zip_add_dir.c zip_add_entry.c\
- zip_close.c zip_delete.c zip_dir_add.c zip_dirent.c zip_discard.c zip_entry.c\
- zip_err_str.c zip_error.c zip_error_clear.c zip_error_get.c zip_error_get_sys_type.c\
- zip_error_strerror.c zip_error_to_str.c zip_extra_field.c zip_extra_field_api.c\
- zip_fclose.c zip_fdopen.c zip_file_add.c zip_file_error_clear.c zip_file_error_get.c\
- zip_file_get_comment.c zip_file_get_offset.c zip_file_rename.c zip_file_replace.c\
- zip_file_set_comment.c zip_file_strerror.c zip_filerange_crc.c zip_fopen.c\
- zip_fopen_encrypted.c zip_fopen_index.c zip_fopen_index_encrypted.c zip_fread.c\
- zip_get_archive_comment.c zip_get_archive_flag.c zip_get_compression_implementation.c\
- zip_get_encryption_implementation.c zip_get_file_comment.c zip_get_name.c zip_get_num_entries.c \
- zip_get_num_files.c zip_memdup.c zip_name_locate.c zip_new.c zip_open.c zip_rename.c zip_replace.c\
- zip_hash.c \
- zip_set_archive_comment.c zip_set_archive_flag.c zip_set_default_password.c zip_set_file_comment.c\
- zip_set_file_compression.c zip_set_name.c zip_source_buffer.c zip_source_close.c zip_source_crc.c\
- zip_source_deflate.c zip_source_error.c zip_source_filep.c zip_source_free.c\
- zip_source_function.c zip_source_layered.c zip_source_open.c zip_source_pkware.c \
- zip_source_read.c zip_source_stat.c zip_source_window.c zip_source_zip.c zip_source_zip_new.c\
- zip_stat.c zip_stat_index.c zip_stat_init.c zip_strerror.c zip_string.c zip_unchange.c zip_unchange_all.c\
- zip_unchange_archive.c zip_unchange_data.c zip_utf-8.c mkstemp.c \
- zip_file_set_external_attributes.c zip_file_get_external_attributes.c zip_source_write.c \
- zip_source_call.c zip_source_supports.c zip_buffer.c zip_source_seek.c zip_source_tell.c \
- zip_io_util.c zip_source_remove.c zip_source_rollback_write.c zip_source_commit_write.c \
- zip_source_tell_write.c zip_source_begin_write.c zip_source_seek_write.c \
- zip_source_win32a.c zip_source_win32utf8.c zip_source_win32handle.c zip_source_win32w.c", "zip");
-
- AC_DEFINE('HAVE_ZIP', 1);
- ADD_FLAG("CFLAGS_ZIP", "/D _WIN32");
} else {
WARNING("zip not enabled; libraries and headers not found");
}
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index 2353519be4..d50c735845 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -137,18 +137,18 @@ static char * php_zip_make_relative_path(char *path, size_t path_len) /* {{{ */
# define CWD_STATE_FREE(s) efree(s)
/* {{{ php_zip_extract_file */
-static int php_zip_extract_file(struct zip * za, char *dest, char *file, int file_len)
+static int php_zip_extract_file(struct zip * za, char *dest, char *file, size_t file_len)
{
php_stream_statbuf ssb;
struct zip_file *zf;
struct zip_stat sb;
char b[8192];
- int n, len, ret;
+ int n, ret;
php_stream *stream;
char *fullpath;
char *file_dirname_fullpath;
char file_dirname[MAXPATHLEN];
- size_t dir_len;
+ size_t dir_len, len;
int is_dir_only = 0;
char *path_cleaned;
size_t path_cleaned_len;
@@ -181,7 +181,7 @@ static int php_zip_extract_file(struct zip * za, char *dest, char *file, int fil
memcpy(file_dirname, path_cleaned, path_cleaned_len);
dir_len = php_dirname(file_dirname, path_cleaned_len);
- if (dir_len <= 0 || (dir_len == 1 && file_dirname[0] == '.')) {
+ if (!dir_len || (dir_len == 1 && file_dirname[0] == '.')) {
len = spprintf(&file_dirname_fullpath, 0, "%s", dest);
} else {
len = spprintf(&file_dirname_fullpath, 0, "%s/%s", dest, file_dirname);
diff --git a/ext/zlib/package.xml b/ext/zlib/package.xml
deleted file mode 100644
index 7eb9fa0936..0000000000
--- a/ext/zlib/package.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE package SYSTEM "../pear/package.dtd">
-<package>
- <name>zlib</name>
- <summary>zlib compression management</summary>
- <maintainers>
- <maintainer>
- <user>sr</user>
- <name>Stefan Roehrich</name>
- <email>sr@linux.de</email>
- <role>lead</role>
- </maintainer>
- <maintainer>
- <user>rasmus</user>
- <name>Rasmus Lerdorf</name>
- <email>rasmus@php.net</email>
- <role>developer</role>
- </maintainer>
- <maintainer>
- <user>zeev</user>
- <name>Zeev Suraski</name>
- <email>zeev@php.net</email>
- <role>developer</role>
- </maintainer>
- <maintainer>
- <user>???</user>
- <name>Jade Nicoletti</name>
- <email>???@php.net</email>
- <role>developer</role>
- </maintainer>
- </maintainers>
- <description>
-This module enables you to transparently read and write
-gzip (.gz) compressed files, through versions of most of
-the filesystem functions which work with gzip-compressed
-files (and uncompressed files, too, but not with sockets).
- </description>
- <license>PHP</license>
- <release>
- <state>beta</state>
- <version>5.0.0rc1</version>
- <date>2004-03-19</date>
- <notes>
-package.xml added to support installation using pear installer
- </notes>
- <filelist>
- <file role="doc" name="CREDITS"/>
- <file role="doc" name="zlib_win32_howto.txt"/>
- <file role="src" name="config0.m4"/>
- <file role="src" name="config.w32"/>
- <file role="src" name="php_zlib.h"/>
- <file role="src" name="zlib.c"/>
- <file role="src" name="zlib_fopen_wrapper.c"/>
- <file role="src" name="php_zlib.def"/>
- <file role="test" name="tests/001.phpt"/>
- <file role="test" name="tests/002.phpt"/>
- <file role="test" name="tests/003.phpt"/>
- <file role="test" name="tests/gzreadgzwrite.phpt"/>
- <file role="test" name="tests/gzreadgzwriteplain.phpt"/>
- <file role="test" name="tests/gzfilegzreadfile.phpt"/>
- </filelist>
- <deps>
- <dep type="php" rel="ge" version="5" />
- </deps>
- </release>
-</package>
-<!--
-vim:et:ts=1:sw=1
--->
diff --git a/ext/zlib/tests/zlib_get_coding_type_basic.phpt b/ext/zlib/tests/zlib_get_coding_type_basic.phpt
new file mode 100644
index 0000000000..e60a97f2d9
--- /dev/null
+++ b/ext/zlib/tests/zlib_get_coding_type_basic.phpt
@@ -0,0 +1,19 @@
+--TEST--
+zlib_get_coding_type() basic call without env
+--CREDIT--
+PHP TestFest 2017 - Bergfreunde, Florian Engelhardt <florian.engelhardt@bergfreunde.de>
+--SKIPIF--
+<?php if (!extension_loaded("zlib")) print "skip"; ?>
+--FILE--
+<?php
+ini_set('zlib.output_compression', 'Off');
+$encOff = zlib_get_coding_type();
+ini_set('zlib.output_compression', 'On');
+$encOn = zlib_get_coding_type();
+ini_set('zlib.output_compression', 'Off');
+var_dump($encOff);
+var_dump($encOn);
+?>
+--EXPECT--
+bool(false)
+bool(false)
diff --git a/ext/zlib/tests/zlib_get_coding_type_br.phpt b/ext/zlib/tests/zlib_get_coding_type_br.phpt
new file mode 100644
index 0000000000..dca6ad7571
--- /dev/null
+++ b/ext/zlib/tests/zlib_get_coding_type_br.phpt
@@ -0,0 +1,21 @@
+--TEST--
+zlib_get_coding_type() with unsupported encoding
+--CREDIT--
+PHP TestFest 2017 - Bergfreunde, Florian Engelhardt <florian.engelhardt@bergfreunde.de>
+--SKIPIF--
+<?php if (!extension_loaded("zlib")) print "skip"; ?>
+--ENV--
+HTTP_ACCEPT_ENCODING=br
+--FILE--
+<?php
+ini_set('zlib.output_compression', 'Off');
+$encOff = zlib_get_coding_type();
+ini_set('zlib.output_compression', 'On');
+$encOn = zlib_get_coding_type();
+ini_set('zlib.output_compression', 'Off');
+var_dump($encOff);
+var_dump($encOn);
+?>
+--EXPECT--
+bool(false)
+bool(false)
diff --git a/ext/zlib/tests/zlib_get_coding_type_deflate.phpt b/ext/zlib/tests/zlib_get_coding_type_deflate.phpt
new file mode 100644
index 0000000000..bca85e9cb9
--- /dev/null
+++ b/ext/zlib/tests/zlib_get_coding_type_deflate.phpt
@@ -0,0 +1,21 @@
+--TEST--
+zlib_get_coding_type() with deflate encoding
+--CREDIT--
+PHP TestFest 2017 - Bergfreunde, Florian Engelhardt <florian.engelhardt@bergfreunde.de>
+--SKIPIF--
+<?php if (!extension_loaded("zlib")) print "skip"; ?>
+--ENV--
+HTTP_ACCEPT_ENCODING=deflate
+--FILE--
+<?php
+ini_set('zlib.output_compression', 'Off');
+$encOff = zlib_get_coding_type();
+ini_set('zlib.output_compression', 'On');
+$encOn = zlib_get_coding_type();
+ini_set('zlib.output_compression', 'Off');
+var_dump($encOff);
+var_dump($encOn);
+?>
+--EXPECT--
+bool(false)
+string(7) "deflate"
diff --git a/ext/zlib/tests/zlib_get_coding_type_gzip.phpt b/ext/zlib/tests/zlib_get_coding_type_gzip.phpt
new file mode 100644
index 0000000000..e3d26e5e71
--- /dev/null
+++ b/ext/zlib/tests/zlib_get_coding_type_gzip.phpt
@@ -0,0 +1,21 @@
+--TEST--
+zlib_get_coding_type() with gzip encoding
+--CREDIT--
+PHP TestFest 2017 - Bergfreunde, Florian Engelhardt <florian.engelhardt@bergfreunde.de>
+--SKIPIF--
+<?php if (!extension_loaded("zlib")) print "skip"; ?>
+--ENV--
+HTTP_ACCEPT_ENCODING=gzip
+--FILE--
+<?php
+ini_set('zlib.output_compression', 'Off');
+$encOff = zlib_get_coding_type();
+ini_set('zlib.output_compression', 'On');
+$encOn = zlib_get_coding_type();
+ini_set('zlib.output_compression', 'Off');
+var_dump($encOff);
+var_dump($encOn);
+?>
+--EXPECT--
+bool(false)
+string(4) "gzip"
diff --git a/main/build-defs.h.in b/main/build-defs.h.in
index fb9bc7f881..c577ea8423 100644
--- a/main/build-defs.h.in
+++ b/main/build-defs.h.in
@@ -73,8 +73,6 @@
#define PHP_LDAP_LFLAGS ""
#define PHP_LDAP_INCLUDE ""
#define PHP_LDAP_LIBS ""
-#define PHP_BIRDSTEP_INCLUDE ""
-#define PHP_BIRDSTEP_LIBS ""
#define PEAR_INSTALLDIR "@EXPANDED_PEAR_INSTALLDIR@"
#define PHP_INCLUDE_PATH "@INCLUDE_PATH@"
#define PHP_EXTENSION_DIR "@EXPANDED_EXTENSION_DIR@"
diff --git a/main/fastcgi.c b/main/fastcgi.c
index 1e8a8064d7..41770ed2db 100644
--- a/main/fastcgi.c
+++ b/main/fastcgi.c
@@ -739,9 +739,9 @@ int fcgi_listen(const char *path, int backlog)
return listen_socket;
#else
- int path_len = strlen(path);
+ size_t path_len = strlen(path);
- if (path_len >= (int)sizeof(sa.sa_unix.sun_path)) {
+ if (path_len >= sizeof(sa.sa_unix.sun_path)) {
fcgi_log(FCGI_ERROR, "Listening socket's path name is too long.\n");
return -1;
}
diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c
index 12de33be83..06b0eb35fa 100644
--- a/main/fopen_wrappers.c
+++ b/main/fopen_wrappers.c
@@ -168,11 +168,11 @@ PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path
while (VCWD_REALPATH(path_tmp, resolved_name) == NULL) {
#if defined(PHP_WIN32) || defined(HAVE_SYMLINK)
if (nesting_level == 0) {
- int ret;
+ ssize_t ret;
char buf[MAXPATHLEN];
ret = php_sys_readlink(path_tmp, buf, MAXPATHLEN - 1);
- if (ret < 0) {
+ if (ret == -1) {
/* not a broken symlink, move along.. */
} else {
/* put the real path into the path buffer */
@@ -355,7 +355,7 @@ PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle)
char *path_info;
char *filename = NULL;
zend_string *resolved_path = NULL;
- int length;
+ size_t length;
zend_bool orig_display_errors;
path_info = SG(request_info).request_uri;
@@ -378,7 +378,7 @@ PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle)
pwbuf = emalloc(pwbuflen);
#endif
length = s - (path_info + 2);
- if (length > (int)sizeof(user) - 1) {
+ if (length > sizeof(user) - 1) {
length = sizeof(user) - 1;
}
memcpy(user, path_info + 2, length);
@@ -402,9 +402,9 @@ PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle)
}
} else
#endif
- if (PG(doc_root) && path_info && (length = (int)strlen(PG(doc_root))) &&
+ if (PG(doc_root) && path_info && (length = strlen(PG(doc_root))) &&
IS_ABSOLUTE_PATH(PG(doc_root), length)) {
- int path_len = (int)strlen(path_info);
+ size_t path_len = strlen(path_info);
filename = emalloc(length + path_len + 2);
memcpy(filename, PG(doc_root), length);
if (!IS_SLASH(filename[length - 1])) { /* length is never 0 */
@@ -420,7 +420,7 @@ PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle)
if (filename) {
- resolved_path = zend_resolve_path(filename, (int)strlen(filename));
+ resolved_path = zend_resolve_path(filename, strlen(filename));
}
if (!resolved_path) {
@@ -472,7 +472,7 @@ PHPAPI int php_fopen_primary_script(zend_file_handle *file_handle)
/* {{{ php_resolve_path
* Returns the realpath for given filename according to include path
*/
-PHPAPI zend_string *php_resolve_path(const char *filename, int filename_length, const char *path)
+PHPAPI zend_string *php_resolve_path(const char *filename, size_t filename_length, const char *path)
{
char resolved_path[MAXPATHLEN];
char trypath[MAXPATHLEN];
@@ -532,7 +532,7 @@ PHPAPI zend_string *php_resolve_path(const char *filename, int filename_length,
}
end = strchr(p, DEFAULT_DIR_SEPARATOR);
if (end) {
- if (filename_length > (MAXPATHLEN - 2) || (end-ptr) > MAXPATHLEN || (end-ptr) + 1 + (size_t)filename_length + 1 >= MAXPATHLEN) {
+ if (filename_length > (MAXPATHLEN - 2) || (end-ptr) > MAXPATHLEN || (end-ptr) + 1 + filename_length + 1 >= MAXPATHLEN) {
ptr = end + 1;
continue;
}
@@ -543,7 +543,7 @@ PHPAPI zend_string *php_resolve_path(const char *filename, int filename_length,
} else {
size_t len = strlen(ptr);
- if (filename_length > (MAXPATHLEN - 2) || len > MAXPATHLEN || len + 1 + (size_t)filename_length + 1 >= MAXPATHLEN) {
+ if (filename_length > (MAXPATHLEN - 2) || len > MAXPATHLEN || len + 1 + filename_length + 1 >= MAXPATHLEN) {
break;
}
memcpy(trypath, ptr, len);
@@ -624,7 +624,7 @@ PHPAPI FILE *php_fopen_with_path(const char *filename, const char *mode, const c
char *pathbuf, *ptr, *end;
char trypath[MAXPATHLEN];
FILE *fp;
- int filename_length;
+ size_t filename_length;
zend_string *exec_filename;
if (opened_path) {
@@ -635,7 +635,7 @@ PHPAPI FILE *php_fopen_with_path(const char *filename, const char *mode, const c
return NULL;
}
- filename_length = (int)strlen(filename);
+ filename_length = strlen(filename);
#ifndef PHP_WIN32
(void) filename_length;
#endif
@@ -761,14 +761,14 @@ 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;
+ size_t copy_len;
+ size_t path_len;
if (!filepath[0]) {
return NULL;
}
- path_len = (int)strlen(filepath);
+ path_len = strlen(filepath);
if (IS_ABSOLUTE_PATH(filepath, path_len)) {
cwd[0] = '\0';
@@ -811,7 +811,7 @@ PHPAPI char *expand_filepath_with_mode(const char *filepath, char *real_path, co
}
new_state.cwd = estrdup(cwd);
- new_state.cwd_length = (int)strlen(cwd);
+ new_state.cwd_length = strlen(cwd);
if (virtual_file_ex(&new_state, filepath, NULL, realpath_mode)) {
efree(new_state.cwd);
diff --git a/main/fopen_wrappers.h b/main/fopen_wrappers.h
index 5e1544c513..cdded57938 100644
--- a/main/fopen_wrappers.h
+++ b/main/fopen_wrappers.h
@@ -39,7 +39,7 @@ PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path
PHPAPI int php_check_safe_mode_include_dir(const char *path);
-PHPAPI zend_string *php_resolve_path(const char *filename, int filename_len, const char *path);
+PHPAPI zend_string *php_resolve_path(const char *filename, size_t filename_len, const char *path);
PHPAPI FILE *php_fopen_with_path(const char *filename, const char *mode, const char *path, zend_string **opened_path);
diff --git a/main/main.c b/main/main.c
index a84f7cdb6f..dfa3378913 100644
--- a/main/main.c
+++ b/main/main.c
@@ -184,7 +184,7 @@ static PHP_INI_MH(OnSetSerializePrecision)
static PHP_INI_MH(OnChangeMemoryLimit)
{
if (new_value) {
- PG(memory_limit) = zend_atol(ZSTR_VAL(new_value), (int)ZSTR_LEN(new_value));
+ PG(memory_limit) = zend_atol(ZSTR_VAL(new_value), ZSTR_LEN(new_value));
} else {
PG(memory_limit) = 1<<30; /* effectively, no limit */
}
@@ -337,7 +337,7 @@ static PHP_INI_MH(OnUpdateTimeout)
/* {{{ php_get_display_errors_mode() helper function
*/
-static int php_get_display_errors_mode(char *value, int value_length)
+static int php_get_display_errors_mode(char *value, size_t value_length)
{
int mode;
@@ -370,7 +370,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(ZSTR_VAL(new_value), (int)ZSTR_LEN(new_value));
+ PG(display_errors) = (zend_bool) php_get_display_errors_mode(ZSTR_VAL(new_value), ZSTR_LEN(new_value));
return SUCCESS;
}
@@ -380,15 +380,16 @@ static PHP_INI_MH(OnUpdateDisplayErrors)
*/
static PHP_INI_DISP(display_errors_mode)
{
- int mode, tmp_value_length, cgi_or_cli;
+ int mode, cgi_or_cli;
+ size_t tmp_value_length;
char *tmp_value;
if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
tmp_value = (ini_entry->orig_value ? ZSTR_VAL(ini_entry->orig_value) : NULL );
- tmp_value_length = (int)(ini_entry->orig_value? ZSTR_LEN(ini_entry->orig_value) : 0);
+ tmp_value_length = (ini_entry->orig_value? ZSTR_LEN(ini_entry->orig_value) : 0);
} else if (ini_entry->value) {
tmp_value = ZSTR_VAL(ini_entry->value);
- tmp_value_length = (int)ZSTR_LEN(ini_entry->value);
+ tmp_value_length = ZSTR_LEN(ini_entry->value);
} else {
tmp_value = NULL;
tmp_value_length = 0;
@@ -1008,10 +1009,10 @@ PHPAPI ZEND_COLD void php_win32_docref2_from_error(DWORD error, const char *para
php_error_docref2(NULL, param1, param2, E_WARNING, "%s", strerror(errno));
} else {
char buf[PHP_WIN32_ERROR_MSG_BUFFER_SIZE + 1];
- int buf_len;
+ size_t buf_len;
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, error, 0, buf, PHP_WIN32_ERROR_MSG_BUFFER_SIZE, NULL);
- buf_len = (int)strlen(buf);
+ buf_len = strlen(buf);
if (buf_len >= 2) {
buf[buf_len - 1] = '\0';
buf[buf_len - 2] = '\0';
@@ -1452,7 +1453,7 @@ PHPAPI int php_stream_open_for_zend_ex(const char *filename, zend_file_handle *h
}
/* }}} */
-static zend_string *php_resolve_path_for_zend(const char *filename, int filename_len) /* {{{ */
+static zend_string *php_resolve_path_for_zend(const char *filename, size_t filename_len) /* {{{ */
{
return php_resolve_path(filename, filename_len, PG(include_path));
}
@@ -1589,39 +1590,8 @@ static void sigchld_handler(int apar)
/* }}} */
#endif
-/* {{{ php_start_sapi()
- */
-static int php_start_sapi(void)
-{
- int retval = SUCCESS;
-
- if(!SG(sapi_started)) {
- zend_try {
- PG(during_request_startup) = 1;
-
- /* initialize global variables */
- PG(modules_activated) = 0;
- PG(header_is_being_sent) = 0;
- PG(connection_status) = PHP_CONNECTION_NORMAL;
-
- zend_activate();
- zend_set_timeout(EG(timeout_seconds), 1);
- zend_activate_modules();
- PG(modules_activated)=1;
- } zend_catch {
- retval = FAILURE;
- } zend_end_try();
-
- SG(sapi_started) = 1;
- }
- return retval;
-}
-
-/* }}} */
-
/* {{{ php_request_startup
*/
-#ifndef APACHE_HOOKS
int php_request_startup(void)
{
int retval = SUCCESS;
@@ -1701,61 +1671,6 @@ int php_request_startup(void)
return retval;
}
-# else
-int php_request_startup(void)
-{
- int retval = SUCCESS;
-
- zend_interned_strings_activate();
-
-#if PHP_SIGCHILD
- signal(SIGCHLD, sigchld_handler);
-#endif
-
- if (php_start_sapi() == FAILURE) {
- return FAILURE;
- }
-
- php_output_activate();
- sapi_activate();
- php_hash_environment();
-
- zend_try {
- PG(during_request_startup) = 1;
- if (PG(expose_php)) {
- sapi_add_header(SAPI_PHP_VERSION_HEADER, sizeof(SAPI_PHP_VERSION_HEADER)-1, 1);
- }
- } zend_catch {
- retval = FAILURE;
- } zend_end_try();
-
- return retval;
-}
-# endif
-/* }}} */
-
-/* {{{ php_request_startup_for_hook
- */
-int php_request_startup_for_hook(void)
-{
- int retval = SUCCESS;
-
- zend_interned_strings_activate();
-
-#if PHP_SIGCHLD
- signal(SIGCHLD, sigchld_handler);
-#endif
-
- if (php_start_sapi() == FAILURE) {
- return FAILURE;
- }
-
- php_output_activate();
- sapi_activate_headers_only();
- php_hash_environment();
-
- return retval;
-}
/* }}} */
/* {{{ php_request_shutdown_for_exec
@@ -1770,60 +1685,6 @@ void php_request_shutdown_for_exec(void *dummy)
}
/* }}} */
-/* {{{ php_request_shutdown_for_hook
- */
-void php_request_shutdown_for_hook(void *dummy)
-{
-
- if (PG(modules_activated)) zend_try {
- php_call_shutdown_functions();
- } zend_end_try();
-
- if (PG(modules_activated)) {
- zend_deactivate_modules();
- }
-
- if (PG(modules_activated)) {
- php_free_shutdown_functions();
- }
-
- zend_try {
- zend_unset_timeout();
- } zend_end_try();
-
- zend_try {
- int i;
-
- for (i = 0; i < NUM_TRACK_VARS; i++) {
- zval_ptr_dtor(&PG(http_globals)[i]);
- }
- } zend_end_try();
-
- zend_deactivate();
-
- zend_try {
- sapi_deactivate();
- } zend_end_try();
-
- zend_try {
- php_shutdown_stream_hashes();
- } zend_end_try();
-
- zend_interned_strings_deactivate();
-
- zend_try {
- shutdown_memory_manager(CG(unclean_shutdown), 0);
- } zend_end_try();
-
-#ifdef ZEND_SIGNALS
- zend_try {
- zend_signal_deactivate();
- } zend_end_try();
-#endif
-}
-
-/* }}} */
-
/* {{{ php_request_shutdown
*/
void php_request_shutdown(void *dummy)
diff --git a/main/network.c b/main/network.c
index 763a84be94..ab328e7b4f 100644
--- a/main/network.c
+++ b/main/network.c
@@ -271,22 +271,19 @@ PHPAPI int php_network_getaddresses(const char *host, int socktype, struct socka
#define O_NONBLOCK O_NDELAY
#endif
-#if !defined(__BEOS__)
-# define HAVE_NON_BLOCKING_CONNECT 1
-# ifdef PHP_WIN32
+#ifdef PHP_WIN32
typedef u_long php_non_blocking_flags_t;
# define SET_SOCKET_BLOCKING_MODE(sock, save) \
save = TRUE; ioctlsocket(sock, FIONBIO, &save)
# define RESTORE_SOCKET_BLOCKING_MODE(sock, save) \
ioctlsocket(sock, FIONBIO, &save)
-# else
+#else
typedef int php_non_blocking_flags_t;
# define SET_SOCKET_BLOCKING_MODE(sock, save) \
save = fcntl(sock, F_GETFL, 0); \
fcntl(sock, F_SETFL, save | O_NONBLOCK)
# define RESTORE_SOCKET_BLOCKING_MODE(sock, save) \
fcntl(sock, F_SETFL, save)
-# endif
#endif
/* Connect to a socket using an interruptible connect with optional timeout.
@@ -302,7 +299,6 @@ PHPAPI int php_network_connect_socket(php_socket_t sockfd,
zend_string **error_string,
int *error_code)
{
-#if HAVE_NON_BLOCKING_CONNECT
php_non_blocking_flags_t orig_flags;
int n;
int error = 0;
@@ -380,12 +376,6 @@ ok:
}
}
return ret;
-#else
- if (asynchronous) {
- php_error_docref(NULL, E_WARNING, "Asynchronous connect() not supported on this platform");
- }
- return (connect(sockfd, addr, addrlen) == 0) ? 0 : -1;
-#endif
}
/* }}} */
diff --git a/main/php.h b/main/php.h
index 388317ddd9..6dc05caea7 100644
--- a/main/php.h
+++ b/main/php.h
@@ -101,9 +101,7 @@ typedef int gid_t;
typedef char * caddr_t;
typedef unsigned int uint;
typedef unsigned long ulong;
-# if !NSAPI
typedef int pid_t;
-# endif
# ifndef PHP_DEBUG
# ifdef inline
diff --git a/main/php_main.h b/main/php_main.h
index ff342a1f38..539f9e7456 100644
--- a/main/php_main.h
+++ b/main/php_main.h
@@ -34,8 +34,6 @@ PHPAPI int php_module_startup(sapi_module_struct *sf, zend_module_entry *additio
PHPAPI void php_module_shutdown(void);
PHPAPI void php_module_shutdown_for_exec(void);
PHPAPI int php_module_shutdown_wrapper(sapi_module_struct *sapi_globals);
-PHPAPI int php_request_startup_for_hook(void);
-PHPAPI void php_request_shutdown_for_hook(void *dummy);
PHPAPI int php_register_extensions(zend_module_entry **ptr, int count);
diff --git a/main/php_memory_streams.h b/main/php_memory_streams.h
index f8989d261b..271a9276e0 100644
--- a/main/php_memory_streams.h
+++ b/main/php_memory_streams.h
@@ -25,9 +25,10 @@
#define PHP_STREAM_MAX_MEM 2 * 1024 * 1024
-#define TEMP_STREAM_DEFAULT 0
-#define TEMP_STREAM_READONLY 1
-#define TEMP_STREAM_TAKE_BUFFER 2
+#define TEMP_STREAM_DEFAULT 0x0
+#define TEMP_STREAM_READONLY 0x1
+#define TEMP_STREAM_TAKE_BUFFER 0x2
+#define TEMP_STREAM_APPEND 0x4
#define php_stream_memory_create(mode) _php_stream_memory_create((mode) STREAMS_CC)
#define php_stream_memory_create_rel(mode) _php_stream_memory_create((mode) STREAMS_REL_CC)
@@ -41,6 +42,7 @@
#define php_stream_temp_open(mode, max_memory_usage, buf, length) _php_stream_temp_open((mode), (max_memory_usage), (buf), (length) STREAMS_CC)
BEGIN_EXTERN_C()
+
PHPAPI php_stream *_php_stream_memory_create(int mode STREAMS_DC);
PHPAPI php_stream *_php_stream_memory_open(int mode, char *buf, size_t length STREAMS_DC);
PHPAPI char *_php_stream_memory_get_buffer(php_stream *stream, size_t *length STREAMS_DC);
@@ -48,6 +50,10 @@ PHPAPI char *_php_stream_memory_get_buffer(php_stream *stream, size_t *length ST
PHPAPI php_stream *_php_stream_temp_create(int mode, size_t max_memory_usage STREAMS_DC);
PHPAPI php_stream *_php_stream_temp_create_ex(int mode, size_t max_memory_usage, const char *tmpdir STREAMS_DC);
PHPAPI php_stream *_php_stream_temp_open(int mode, size_t max_memory_usage, char *buf, size_t length STREAMS_DC);
+
+PHPAPI int php_stream_mode_from_str(const char *mode);
+PHPAPI const char *_php_stream_mode_to_str(int mode);
+
END_EXTERN_C()
extern PHPAPI php_stream_ops php_stream_memory_ops;
diff --git a/main/php_open_temporary_file.c b/main/php_open_temporary_file.c
index f2303882f4..71354654b5 100644
--- a/main/php_open_temporary_file.c
+++ b/main/php_open_temporary_file.c
@@ -125,7 +125,7 @@ static int php_do_open_temporary_file(const char *path, const char *pfx, zend_st
}
new_state.cwd = estrdup(cwd);
- new_state.cwd_length = (int)strlen(cwd);
+ new_state.cwd_length = strlen(cwd);
if (virtual_file_ex(&new_state, path, NULL, CWD_REALPATH)) {
efree(new_state.cwd);
@@ -216,7 +216,7 @@ PHPAPI const char* php_get_temporary_directory(void)
{
char *sys_temp_dir = PG(sys_temp_dir);
if (sys_temp_dir) {
- int len = (int)strlen(sys_temp_dir);
+ size_t len = strlen(sys_temp_dir);
if (len >= 2 && sys_temp_dir[len - 1] == DEFAULT_SLASH) {
PG(php_sys_temp_dir) = estrndup(sys_temp_dir, len - 1);
return PG(php_sys_temp_dir);
@@ -237,7 +237,10 @@ PHPAPI const char* php_get_temporary_directory(void)
wchar_t sTemp[MAXPATHLEN];
char *tmp;
size_t len = GetTempPathW(MAXPATHLEN, sTemp);
- assert(0 < len); /* should *never* fail! */
+
+ if (!len) {
+ return NULL;
+ }
if (NULL == (tmp = php_win32_ioutil_conv_w_to_any(sTemp, len, &len))) {
return NULL;
@@ -253,7 +256,7 @@ PHPAPI const char* php_get_temporary_directory(void)
{
char* s = getenv("TMPDIR");
if (s && *s) {
- int len = strlen(s);
+ size_t len = strlen(s);
if (s[len - 1] == DEFAULT_SLASH) {
PG(php_sys_temp_dir) = estrndup(s, len - 1);
diff --git a/main/php_reentrancy.h b/main/php_reentrancy.h
index f66f3c5e3a..6689662c94 100644
--- a/main/php_reentrancy.h
+++ b/main/php_reentrancy.h
@@ -91,7 +91,7 @@ char *asctime_r(const struct tm *tm, char *buf);
#endif
-#if !defined(HAVE_GMTIME_R) && defined(HAVE_GMTIME) || defined(__BEOS__)
+#if !defined(HAVE_GMTIME_R) && defined(HAVE_GMTIME)
#define PHP_NEED_REENTRANCY 1
PHPAPI struct tm *php_gmtime_r(const time_t *const timep, struct tm *p_tm);
#else
diff --git a/main/php_syslog.c b/main/php_syslog.c
new file mode 100644
index 0000000000..63b23c2363
--- /dev/null
+++ b/main/php_syslog.c
@@ -0,0 +1,92 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 7 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 2017 The PHP Group |
+ +----------------------------------------------------------------------+
+ | This source file is subject to version 3.01 of the PHP license, |
+ | that is bundled with this package in the file LICENSE, and is |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Philip Prindeville <philipp@redfish-solutions.com> |
+ +----------------------------------------------------------------------+
+*/
+
+/* $Id$ */
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include <stdlib.h>
+#include "php.h"
+#include "php_syslog.h"
+
+#include "zend.h"
+#include "zend_smart_string.h"
+
+/*
+ * The SCO OpenServer 5 Development System (not the UDK)
+ * defines syslog to std_syslog.
+ */
+
+#ifdef HAVE_STD_SYSLOG
+#define syslog std_syslog
+#endif
+
+#ifdef PHP_WIN32
+PHPAPI void php_syslog(int priority, const char *format, ...) /* {{{ */
+{
+ va_list args;
+
+ va_start(args, format);
+ vsyslog(priority, format, args);
+ va_end(args);
+}
+/* }}} */
+#else
+PHPAPI void php_syslog(int priority, const char *format, ...) /* {{{ */
+{
+ const char *ptr;
+ unsigned char c;
+ smart_string fbuf = {0};
+ smart_string sbuf = {0};
+ va_list args;
+
+ va_start(args, format);
+ zend_printf_to_smart_string(&fbuf, format, args);
+ smart_string_0(&fbuf);
+ va_end(args);
+
+ for (ptr = fbuf.c; ; ++ptr) {
+ c = *ptr;
+ if (c == '\0') {
+ syslog(priority, "%.*s", (int)sbuf.len, sbuf.c);
+ break;
+ }
+
+ if (c != '\n')
+ smart_string_appendc(&sbuf, c);
+ else {
+ syslog(priority, "%.*s", (int)sbuf.len, sbuf.c);
+ smart_string_reset(&sbuf);
+ }
+ }
+
+ smart_string_free(&fbuf);
+ smart_string_free(&sbuf);
+}
+/* }}} */
+#endif
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: sw=4 ts=4 fdm=marker
+ * vim<600: sw=4 ts=4
+ */
diff --git a/main/php_syslog.h b/main/php_syslog.h
index be68cc499a..4c4ca4eeb1 100644
--- a/main/php_syslog.h
+++ b/main/php_syslog.h
@@ -21,6 +21,8 @@
#ifndef PHP_SYSLOG_H
#define PHP_SYSLOG_H
+#include "php.h"
+
#ifdef PHP_WIN32
#include "win32/syslog.h"
#else
@@ -30,26 +32,12 @@
#endif
#endif
-/*
- * The SCO OpenServer 5 Development System (not the UDK)
- * defines syslog to std_syslog.
- */
-
-#ifdef syslog
-
-#ifdef HAVE_STD_SYSLOG
-#define php_syslog std_syslog
-#endif
-
-#undef syslog
+BEGIN_EXTERN_C()
+PHPAPI void php_syslog(int, const char *format, ...);
+END_EXTERN_C()
#endif
-#ifndef php_syslog
-#define php_syslog syslog
-#endif
-
-#endif
/*
* Local variables:
* tab-width: 4
diff --git a/main/php_version.h b/main/php_version.h
index 62cdcfceda..e81c515249 100644
--- a/main/php_version.h
+++ b/main/php_version.h
@@ -1,8 +1,8 @@
/* automatically generated by configure */
/* edit configure.ac to change version number */
#define PHP_MAJOR_VERSION 7
-#define PHP_MINOR_VERSION 2
+#define PHP_MINOR_VERSION 3
#define PHP_RELEASE_VERSION 0
#define PHP_EXTRA_VERSION "-dev"
-#define PHP_VERSION "7.2.0-dev"
-#define PHP_VERSION_ID 70200
+#define PHP_VERSION "7.3.0-dev"
+#define PHP_VERSION_ID 70300
diff --git a/main/reentrancy.c b/main/reentrancy.c
index b95deca262..2d2f130782 100644
--- a/main/reentrancy.c
+++ b/main/reentrancy.c
@@ -111,18 +111,6 @@ PHPAPI struct tm *php_gmtime_r(const time_t *const timep, struct tm *p_tm)
#endif
-#if defined(__BEOS__)
-
-PHPAPI struct tm *php_gmtime_r(const time_t *const timep, struct tm *p_tm)
-{
- /* Modified according to LibC definition */
- if (((struct tm*)gmtime_r(timep, p_tm)) == p_tm)
- return (p_tm);
- return (NULL);
-}
-
-#endif /* BEOS */
-
#if !defined(HAVE_POSIX_READDIR_R)
PHPAPI int php_readdir_r(DIR *dirp, struct dirent *entry,
diff --git a/main/streams/memory.c b/main/streams/memory.c
index 7af87c7efb..c212778151 100644
--- a/main/streams/memory.c
+++ b/main/streams/memory.c
@@ -53,10 +53,11 @@ static size_t php_stream_memory_write(php_stream *stream, const char *buf, size_
if (ms->mode & TEMP_STREAM_READONLY) {
return 0;
+ } else if (ms->mode & TEMP_STREAM_APPEND) {
+ ms->fpos = ms->fsize;
}
if (ms->fpos + count > ms->fsize) {
char *tmp;
-
if (!ms->data) {
tmp = emalloc(ms->fpos + count);
} else {
@@ -222,9 +223,6 @@ static int php_stream_memory_stat(php_stream *stream, php_stream_statbuf *ssb) /
#ifndef PHP_WIN32
ssb->sb.st_blksize = -1;
-#endif
-
-#if !defined(PHP_WIN32) && !defined(__BEOS__)
ssb->sb.st_blocks = -1;
#endif
@@ -276,6 +274,29 @@ PHPAPI php_stream_ops php_stream_memory_ops = {
php_stream_memory_set_option
};
+/* {{{ */
+PHPAPI int php_stream_mode_from_str(const char *mode)
+{
+ if (strpbrk(mode, "a")) {
+ return TEMP_STREAM_APPEND;
+ } else if (strpbrk(mode, "w+")) {
+ return TEMP_STREAM_DEFAULT;
+ }
+ return TEMP_STREAM_READONLY;
+}
+/* }}} */
+
+/* {{{ */
+PHPAPI const char *_php_stream_mode_to_str(int mode)
+{
+ if (mode == TEMP_STREAM_READONLY) {
+ return "rb";
+ } else if (mode == TEMP_STREAM_APPEND) {
+ return "a+b";
+ }
+ return "w+b";
+}
+/* }}} */
/* {{{ */
PHPAPI php_stream *_php_stream_memory_create(int mode STREAMS_DC)
@@ -290,7 +311,7 @@ PHPAPI php_stream *_php_stream_memory_create(int mode STREAMS_DC)
self->smax = ~0u;
self->mode = mode;
- stream = php_stream_alloc_rel(&php_stream_memory_ops, self, 0, mode & TEMP_STREAM_READONLY ? "rb" : "w+b");
+ stream = php_stream_alloc_rel(&php_stream_memory_ops, self, 0, _php_stream_mode_to_str(mode));
stream->flags |= PHP_STREAM_FLAG_NO_BUFFER;
return stream;
}
@@ -564,7 +585,7 @@ PHPAPI php_stream *_php_stream_temp_create_ex(int mode, size_t max_memory_usage,
if (tmpdir) {
self->tmpdir = estrdup(tmpdir);
}
- stream = php_stream_alloc_rel(&php_stream_temp_ops, self, 0, mode & TEMP_STREAM_READONLY ? "rb" : "w+b");
+ stream = php_stream_alloc_rel(&php_stream_temp_ops, self, 0, _php_stream_mode_to_str(mode));
stream->flags |= PHP_STREAM_FLAG_NO_BUFFER;
self->innerstream = php_stream_memory_create_rel(mode);
php_stream_encloses(stream, self->innerstream);
diff --git a/main/streams/streams.c b/main/streams/streams.c
index dab8505d41..e768d0f533 100644
--- a/main/streams/streams.c
+++ b/main/streams/streams.c
@@ -1996,7 +1996,7 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mod
}
if (options & USE_PATH) {
- resolved_path = zend_resolve_path(path, (int)strlen(path));
+ resolved_path = zend_resolve_path(path, strlen(path));
if (resolved_path) {
path = ZSTR_VAL(resolved_path);
/* we've found this file, don't re-check include_path or run realpath */
diff --git a/php.ini-development b/php.ini-development
index 8ba304b8c0..4dddd9ff80 100644
--- a/php.ini-development
+++ b/php.ini-development
@@ -1091,8 +1091,6 @@ odbc.defaultlrl = 4096
; http://php.net/odbc.defaultbinmode
odbc.defaultbinmode = 1
-;birdstep.max_links = -1
-
[Interbase]
; Allow or prevent persistent links.
ibase.allow_persistent = 1
diff --git a/php.ini-production b/php.ini-production
index fb08287fa6..2b546ddb08 100644
--- a/php.ini-production
+++ b/php.ini-production
@@ -1098,8 +1098,6 @@ odbc.defaultlrl = 4096
; http://php.net/odbc.defaultbinmode
odbc.defaultbinmode = 1
-;birdstep.max_links = -1
-
[Interbase]
; Allow or prevent persistent links.
ibase.allow_persistent = 1
diff --git a/run-tests.php b/run-tests.php
index a32db44bf8..c95ef4e54d 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -26,6 +26,15 @@
/* $Id$ */
+define('INIT_DIR', getcwd());
+
+// change into the PHP source directory.
+if (getenv('TEST_PHP_SRCDIR')) {
+ @chdir(getenv('TEST_PHP_SRCDIR'));
+}
+define('TEST_PHP_SRCDIR', getcwd());
+
+
/* Sanity check to ensure that pcre extension needed by this script is available.
* In the event it is not, print a nice error message indicating that this script will
* not run without it.
@@ -64,29 +73,16 @@ if (ini_get('date.timezone') == '') {
date_default_timezone_set('UTC');
}
-// store current directory
-$CUR_DIR = getcwd();
-
-// change into the PHP source directory.
-
-if (getenv('TEST_PHP_SRCDIR')) {
- @chdir(getenv('TEST_PHP_SRCDIR'));
-}
-
// Delete some security related environment variables
putenv('SSH_CLIENT=deleted');
putenv('SSH_AUTH_SOCK=deleted');
putenv('SSH_TTY=deleted');
putenv('SSH_CONNECTION=deleted');
-$cwd = getcwd();
set_time_limit(0);
ini_set('pcre.backtrack_limit', PHP_INT_MAX);
-$valgrind_version = 0;
-$valgrind_header = '';
-
// delete as much output buffers as possible
while(@ob_end_clean());
if (ob_get_level()) echo "Not all buffers were deleted.\n";
@@ -132,11 +128,11 @@ if (getenv('TEST_PHP_EXECUTABLE')) {
$php = getenv('TEST_PHP_EXECUTABLE');
if ($php=='auto') {
- $php = $cwd . '/sapi/cli/php';
+ $php = TEST_PHP_SRCDIR . '/sapi/cli/php';
putenv("TEST_PHP_EXECUTABLE=$php");
if (!getenv('TEST_PHP_CGI_EXECUTABLE')) {
- $php_cgi = $cwd . '/sapi/cgi/php-cgi';
+ $php_cgi = TEST_PHP_SRCDIR . '/sapi/cgi/php-cgi';
if (file_exists($php_cgi)) {
putenv("TEST_PHP_CGI_EXECUTABLE=$php_cgi");
@@ -152,7 +148,7 @@ if (getenv('TEST_PHP_CGI_EXECUTABLE')) {
$php_cgi = getenv('TEST_PHP_CGI_EXECUTABLE');
if ($php_cgi=='auto') {
- $php_cgi = $cwd . '/sapi/cgi/php-cgi';
+ $php_cgi = TEST_PHP_SRCDIR . '/sapi/cgi/php-cgi';
putenv("TEST_PHP_CGI_EXECUTABLE=$php_cgi");
}
@@ -180,7 +176,7 @@ if (getenv('TEST_PHPDBG_EXECUTABLE')) {
$phpdbg = getenv('TEST_PHPDBG_EXECUTABLE');
if ($phpdbg=='auto') {
- $phpdbg = $cwd . '/sapi/phpdbg/phpdbg';
+ $phpdbg = TEST_PHP_SRCDIR . '/sapi/phpdbg/phpdbg';
putenv("TEST_PHPDBG_EXECUTABLE=$phpdbg");
}
@@ -261,7 +257,7 @@ $no_file_cache = '-d opcache.file_cache= -d opcache.file_cache_only=0';
function write_information()
{
- global $cwd, $php, $php_cgi, $phpdbg, $php_info, $user_tests, $ini_overwrites, $pass_options, $exts_to_test, $leak_check, $valgrind_header, $no_file_cache;
+ global $php, $php_cgi, $phpdbg, $php_info, $user_tests, $ini_overwrites, $pass_options, $exts_to_test, $valgrind, $no_file_cache;
// Get info from php
$info_file = __DIR__ . '/run-test-info.php';
@@ -328,13 +324,13 @@ More .INIs : " , (function_exists(\'php_ini_scanned_files\') ? str_replace("\n"
echo "
=====================================================================
PHP : $php $php_info $php_cgi_info $phpdbg_info
-CWD : $cwd
+CWD : ".TEST_PHP_SRCDIR."
Extra dirs : ";
foreach ($user_tests as $test_dir) {
echo "{$test_dir}\n ";
}
echo "
-VALGRIND : " . ($leak_check ? $valgrind_header : 'Not used') . "
+VALGRIND : " . ($valgrind ? $valgrind->getHeader() : 'Not used') . "
=====================================================================
";
}
@@ -347,7 +343,7 @@ define('TRAVIS_CI' , (bool) getenv('TRAVIS'));
function save_or_mail_results()
{
global $sum_results, $just_save_results, $failed_test_summary,
- $PHP_FAILED_TESTS, $CUR_DIR, $php, $output_file;
+ $PHP_FAILED_TESTS, $php, $output_file;
/* We got failed Tests, offer the user to send an e-mail to QA team, unless NO_INTERACTION is set */
if (!getenv('NO_INTERACTION') && !TRAVIS_CI) {
@@ -419,7 +415,7 @@ function save_or_mail_results()
}
/* Always use the generated libtool - Mac OSX uses 'glibtool' */
- $libtool = shell_exec($CUR_DIR . '/libtool --version');
+ $libtool = shell_exec(INIT_DIR . '/libtool --version');
/* Use shtool to find out if there is glibtool present (MacOSX) */
$sys_libtool_path = shell_exec(__DIR__ . '/build/shtool path glibtool libtool');
@@ -487,10 +483,10 @@ $failed_tests_file= false;
$pass_option_n = false;
$pass_options = '';
-$output_file = $CUR_DIR . '/php_test_results_' . date('Ymd_Hi') . '.txt';
+$output_file = INIT_DIR . '/php_test_results_' . date('Ymd_Hi') . '.txt';
$just_save_results = false;
-$leak_check = false;
+$valgrind = null;
$html_output = false;
$html_file = null;
$temp_source = null;
@@ -603,19 +599,7 @@ if (isset($argc) && $argc > 1) {
break;
//case 'l'
case 'm':
- $leak_check = true;
- $valgrind_cmd = "valgrind --version";
- $valgrind_header = system_with_timeout($valgrind_cmd, $environment);
- $replace_count = 0;
- if (!$valgrind_header) {
- error("Valgrind returned no version info, cannot proceed.\nPlease check if Valgrind is installed.");
- } else {
- $valgrind_version = preg_replace("/valgrind-(\d+)\.(\d+)\.(\d+)([.\w_-]+)?(\s+)/", '$1.$2.$3', $valgrind_header, 1, $replace_count);
- if ($replace_count != 1) {
- error("Valgrind returned invalid version info (\"$valgrind_header\"), cannot proceed.");
- }
- $valgrind_header = trim($valgrind_header);
- }
+ $valgrind = new RuntestsValgrind($environment);
break;
case 'n':
if (!$pass_option_n) {
@@ -908,7 +892,7 @@ foreach ($exts_to_test as $key => $val) {
}
foreach ($test_dirs as $dir) {
- find_files("{$cwd}/{$dir}", ($dir == 'ext'));
+ find_files(TEST_PHP_SRCDIR."/{$dir}", ($dir == 'ext'));
}
foreach ($user_tests as $dir) {
@@ -962,13 +946,11 @@ function test_name($name)
function test_sort($a, $b)
{
- global $cwd;
-
$a = test_name($a);
$b = test_name($b);
- $ta = strpos($a, "{$cwd}/tests") === 0 ? 1 + (strpos($a, "{$cwd}/tests/run-test") === 0 ? 1 : 0) : 0;
- $tb = strpos($b, "{$cwd}/tests") === 0 ? 1 + (strpos($b, "{$cwd}/tests/run-test") === 0 ? 1 : 0) : 0;
+ $ta = strpos($a, TEST_PHP_SRCDIR."/tests") === 0 ? 1 + (strpos($a, TEST_PHP_SRCDIR."/tests/run-test") === 0 ? 1 : 0) : 0;
+ $tb = strpos($b, TEST_PHP_SRCDIR."/tests") === 0 ? 1 + (strpos($b, TEST_PHP_SRCDIR."/tests/run-test") === 0 ? 1 : 0) : 0;
if ($ta == $tb) {
return strcmp($a, $b);
@@ -1116,7 +1098,7 @@ function error_report($testname, $logname, $tested)
function system_with_timeout($commandline, $env = null, $stdin = null, $captureStdIn = true, $captureStdOut = true, $captureStdErr = true)
{
- global $leak_check, $cwd;
+ global $valgrind;
$data = '';
@@ -1135,7 +1117,7 @@ function system_with_timeout($commandline, $env = null, $stdin = null, $captureS
if ($captureStdErr) {
$descriptorspec[2] = array('pipe', 'w');
}
- $proc = proc_open($commandline, $descriptorspec, $pipes, $cwd, $bin_env, array('suppress_errors' => true, 'binary_pipes' => true));
+ $proc = proc_open($commandline, $descriptorspec, $pipes, TEST_PHP_SRCDIR, $bin_env, array('suppress_errors' => true, 'binary_pipes' => true));
if (!$proc) {
return false;
@@ -1149,7 +1131,7 @@ function system_with_timeout($commandline, $env = null, $stdin = null, $captureS
unset($pipes[0]);
}
- $timeout = $leak_check ? 300 : (isset($env['TEST_TIMEOUT']) ? $env['TEST_TIMEOUT'] : 60);
+ $timeout = $valgrind ? 300 : (isset($env['TEST_TIMEOUT']) ? $env['TEST_TIMEOUT'] : 60);
while (true) {
/* hide errors from interrupted syscalls */
@@ -1251,11 +1233,10 @@ function show_file_block($file, $block, $section = null)
//
function run_test($php, $file, $env)
{
- global $log_format, $ini_overwrites, $cwd, $PHP_FAILED_TESTS;
+ global $log_format, $ini_overwrites, $PHP_FAILED_TESTS;
global $pass_options, $DETAILED, $IN_REDIRECT, $test_cnt, $test_idx;
- global $leak_check, $temp_source, $temp_target, $cfg, $environment;
+ global $valgrind, $temp_source, $temp_target, $cfg, $environment;
global $no_clean;
- global $valgrind_version;
global $SHOW_ONLY_GROUPS;
global $no_file_cache;
global $slow_min_ms;
@@ -1390,7 +1371,7 @@ TEST $file
}
fclose($fp);
- $shortname = str_replace($cwd . '/', '', $file);
+ $shortname = str_replace(TEST_PHP_SRCDIR . '/', '', $file);
$tested_file = $shortname;
if ($borked) {
@@ -1620,7 +1601,7 @@ TEST $file
$extra = substr(PHP_OS, 0, 3) !== "WIN" ?
"unset REQUEST_METHOD; unset QUERY_STRING; unset PATH_TRANSLATED; unset SCRIPT_FILENAME; unset REQUEST_METHOD;": "";
- if ($leak_check) {
+ if ($valgrind) {
$env['USE_ZEND_ALLOC'] = '0';
$env['ZEND_DONT_UNLOAD_MODULES'] = 1;
} else {
@@ -1915,25 +1896,11 @@ TEST $file
$cmd = "$php $pass_options $ini_settings -f \"$test_file\" $args$cmdRedirect";
}
- if ($leak_check) {
+ if ($valgrind) {
$env['USE_ZEND_ALLOC'] = '0';
$env['ZEND_DONT_UNLOAD_MODULES'] = 1;
- $valgrind_cmd = "valgrind -q --tool=memcheck --trace-children=yes";
- if (strpos($test_file, "pcre") !== false) {
- $valgrind_cmd .= " --smc-check=all";
- }
-
- /* --vex-iropt-register-updates=allregs-at-mem-access is necessary for phpdbg watchpoint tests */
- if (version_compare($valgrind_version, '3.8.0', '>=')) {
- /* valgrind 3.3.0+ doesn't have --log-file-exactly option */
- $cmd = "$valgrind_cmd --vex-iropt-register-updates=allregs-at-mem-access --log-file=$memcheck_filename $cmd";
- } elseif (version_compare($valgrind_version, '3.3.0', '>=')) {
- $cmd = "$valgrind_cmd --vex-iropt-precise-memory-exns=yes --log-file=$memcheck_filename $cmd";
- } else {
- $cmd = "$valgrind_cmd --vex-iropt-precise-memory-exns=yes --log-file-exactly=$memcheck_filename $cmd";
- }
-
+ $cmd = $valgrind->wrapCommand($cmd, $memcheck_filename, strpos($test_file, "pcre") !== false);
} else {
$env['USE_ZEND_ALLOC'] = '1';
$env['ZEND_DONT_UNLOAD_MODULES'] = 0;
@@ -1994,7 +1961,7 @@ COMMAND $cmd
$leaked = false;
$passed = false;
- if ($leak_check) { // leak check
+ if ($valgrind) { // leak check
$leaked = filesize($memcheck_filename) > 0;
if (!$leaked) {
@@ -2269,7 +2236,7 @@ $output
$diff = empty($diff) ? '' : preg_replace('/\e/', '<esc>', $diff);
- junit_mark_test_as($restype, str_replace($cwd . '/', '', $tested_file), $tested, null, $info, $diff);
+ junit_mark_test_as($restype, str_replace(TEST_PHP_SRCDIR . '/', '', $tested_file), $tested, null, $info, $diff);
return $restype[0] . 'ED';
}
@@ -2490,7 +2457,7 @@ function compute_summary()
function get_summary($show_ext_summary, $show_html)
{
- global $exts_skipped, $exts_tested, $n_total, $sum_results, $percent_results, $end_time, $start_time, $failed_test_summary, $PHP_FAILED_TESTS, $leak_check;
+ global $exts_skipped, $exts_tested, $n_total, $sum_results, $percent_results, $end_time, $start_time, $failed_test_summary, $PHP_FAILED_TESTS, $valgrind;
$x_total = $n_total - $sum_results['SKIPPED'] - $sum_results['BORKED'];
@@ -2535,7 +2502,7 @@ Tests warned : ' . sprintf('%4d (%5.1f%%)', $sum_results['WARNED'], $percent_
Tests failed : ' . sprintf('%4d (%5.1f%%)', $sum_results['FAILED'], $percent_results['FAILED']) . ' ' . sprintf('(%5.1f%%)', $x_failed) . '
Expected fail : ' . sprintf('%4d (%5.1f%%)', $sum_results['XFAILED'], $percent_results['XFAILED']) . ' ' . sprintf('(%5.1f%%)', $x_xfailed);
- if ($leak_check) {
+ if ($valgrind) {
$summary .= '
Tests leaked : ' . sprintf('%4d (%5.1f%%)', $sum_results['LEAKED'], $percent_results['LEAKED']) . ' ' . sprintf('(%5.1f%%)', $x_leaked);
}
@@ -2978,6 +2945,54 @@ function junit_finish_timer($file_name) {
unset($JUNIT['files'][$file_name]['start']);
}
+class RuntestsValgrind {
+ protected $version = '';
+ protected $header = '';
+ protected $version_3_3_0 = false;
+ protected $verison_3_8_0 = false;
+
+ public function getVersion() {
+ return $this->version;
+ }
+
+ public function getHeader() {
+ return $this->header;
+ }
+
+ public function __construct(array $environment) {
+ $header = system_with_timeout('valgrind --version', $environment);
+ if (!$header) {
+ error("Valgrind returned no version info, cannot proceed.\nPlease check if Valgrind is installed.");
+ }
+ $count = 0;
+ $version = preg_replace("/valgrind-(\d+)\.(\d+)\.(\d+)([.\w_-]+)?(\s+)/", '$1.$2.$3', $header, 1, $count);
+ if ($count != 1) {
+ error("Valgrind returned invalid version info (\"{$header}\"), cannot proceed.");
+ }
+ $this->version = $version;
+ $this->header = trim($header);
+ $this->version_3_3_0 = version_compare($version, '3.3.0', '>=');
+ $this->version_3_8_0 = version_compare($version, '3.8.0', '>=');
+ }
+
+ public function wrapCommand($cmd, $memcheck_filename, $check_all) {
+ $vcmd = 'valgrind -q --tool=memcheck --trace-children=yes';
+ if ($check_all) {
+ $vcmd .= ' --smc-check=all';
+ }
+
+ /* --vex-iropt-register-updates=allregs-at-mem-access is necessary for phpdbg watchpoint tests */
+ if ($this->version_3_8_0) {
+ /* valgrind 3.3.0+ doesn't have --log-file-exactly option */
+ return "$vcmd --vex-iropt-register-updates=allregs-at-mem-access --log-file=$memcheck_filename $cmd";
+ } elseif ($this->version_3_3_0) {
+ return "$vcmd --vex-iropt-precise-memory-exns=yes --log-file=$memcheck_filename $cmd";
+ } else {
+ return "$vcmd --vex-iropt-precise-memory-exns=yes --log-file-exactly=$memcheck_filename $cmd";
+ }
+ }
+}
+
/*
* Local variables:
* tab-width: 4
diff --git a/sapi/apache2handler/config.m4 b/sapi/apache2handler/config.m4
index 2e64b215e5..3176700287 100644
--- a/sapi/apache2handler/config.m4
+++ b/sapi/apache2handler/config.m4
@@ -103,13 +103,6 @@ if test "$PHP_APXS2" != "no"; then
SAPI_SHARED=libs/libphp7.so
INSTALL_IT="$INSTALL_IT $SAPI_SHARED"
;;
- *beos*)
- if test -f _APP_; then `rm _APP_`; fi
- `ln -s $APXS_BINDIR/httpd _APP_`
- EXTRA_LIBS="$EXTRA_LIBS _APP_"
- PHP_SELECT_SAPI(apache2handler, shared, mod_php7.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS)
- INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL"
- ;;
*)
PHP_SELECT_SAPI(apache2handler, shared, mod_php7.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS)
INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL"
diff --git a/sapi/cli/TODO b/sapi/cli/TODO
deleted file mode 100644
index 22e6689001..0000000000
--- a/sapi/cli/TODO
+++ /dev/null
@@ -1,2 +0,0 @@
-TODO:
-
diff --git a/sapi/cli/tests/012-2.phpt b/sapi/cli/tests/012-2.phpt
new file mode 100644
index 0000000000..34be936708
--- /dev/null
+++ b/sapi/cli/tests/012-2.phpt
@@ -0,0 +1,52 @@
+--TEST--
+more invalid arguments and error messages
+--SKIPIF--
+<?php include "skipif.inc"; ?>
+--FILE--
+<?php
+
+$php = getenv('TEST_PHP_EXECUTABLE');
+
+// -r : behavior = CLI_DIRECT
+// -F / -R / -B / -E : behavior = PROCESS_STDIN
+// -l : behavior = LINT
+// -s : behavior = HIGHLIGHT
+// -w : behavior = STRIP
+
+var_dump(`"$php" -n -r "echo 1;" -F some.php`);
+var_dump(`"$php" -n -r "echo 2;" -f some.php`);
+var_dump(`"$php" -n -r "echo 3;" -l`); // ignores linting
+var_dump(`"$php" -n -r "echo 4;" -R some.php`);
+var_dump(`"$php" -n -r "echo 5;" -B ""`);
+var_dump(`"$php" -n -a -B ""`);
+var_dump(`"$php" -n -r "echo 6;" -E ""`);
+var_dump(`"$php" -n -a -E ""`);
+var_dump(`"$php" -n -r "echo 7;" -s`);
+var_dump(`"$php" -n -r "echo 8;" -w`);
+var_dump(`"$php" -n -l -r "echo 9;"`);
+
+echo "Done\n";
+?>
+--EXPECTF--
+string(57) "Either execute direct code, process stdin or use a file.
+"
+string(57) "Either execute direct code, process stdin or use a file.
+"
+string(1) "3"
+string(57) "Either execute direct code, process stdin or use a file.
+"
+string(57) "Either execute direct code, process stdin or use a file.
+"
+string(57) "Either execute direct code, process stdin or use a file.
+"
+string(57) "Either execute direct code, process stdin or use a file.
+"
+string(57) "Either execute direct code, process stdin or use a file.
+"
+string(42) "Source highlighting only works for files.
+"
+string(39) "Source stripping only works for files.
+"
+string(57) "Either execute direct code, process stdin or use a file.
+"
+Done
diff --git a/sapi/cli/tests/cli_get_process_title_basic.phpt b/sapi/cli/tests/cli_get_process_title_basic.phpt
new file mode 100644
index 0000000000..66d1d4f3a7
--- /dev/null
+++ b/sapi/cli/tests/cli_get_process_title_basic.phpt
@@ -0,0 +1,18 @@
+--TEST--
+cli_get_process_title() function : basic functionality
+--CREDITS--
+Patrick Allaert patrickallaert@php.net
+@nephp #nephp17
+--SKIPIF--
+<?php
+if (PHP_SAPI !== "cli")
+ die("skip");
+?>
+--FILE--
+<?php
+if (cli_set_process_title("title") && cli_get_process_title() === "title")
+ echo "Title correctly retrieved!\n";
+
+?>
+--EXPECT--
+Title correctly retrieved!
diff --git a/sapi/cli/tests/cli_get_process_title_error.phpt b/sapi/cli/tests/cli_get_process_title_error.phpt
new file mode 100644
index 0000000000..67274db26c
--- /dev/null
+++ b/sapi/cli/tests/cli_get_process_title_error.phpt
@@ -0,0 +1,16 @@
+--TEST--
+cli_get_process_title() function : error conditions
+--CREDITS--
+Patrick Allaert patrickallaert@php.net
+@nephp #nephp17
+--SKIPIF--
+<?php
+if (PHP_SAPI !== "cli")
+ die("skip");
+?>
+--FILE--
+<?php
+cli_get_process_title("foo");
+?>
+--EXPECTF--
+Warning: cli_get_process_title() expects exactly 0 parameters, 1 given in %scli_get_process_title_error.php on line 2
diff --git a/sapi/cli/tests/cli_set_process_title_basic.phpt b/sapi/cli/tests/cli_set_process_title_basic.phpt
new file mode 100644
index 0000000000..9899f3456b
--- /dev/null
+++ b/sapi/cli/tests/cli_set_process_title_basic.phpt
@@ -0,0 +1,19 @@
+--TEST--
+cli_set_process_title() function : basic functionality
+--CREDITS--
+Patrick Allaert patrickallaert@php.net
+@nephp #nephp17
+--SKIPIF--
+<?php
+if (PHP_SAPI !== "cli")
+ die("skip");
+?>
+--FILE--
+<?php
+if (cli_set_process_title("title") === true &&
+ cli_get_process_title() === "title")
+ echo "Successfully set title\n";
+
+?>
+--EXPECT--
+Successfully set title
diff --git a/sapi/cli/tests/cli_set_process_title_error.phpt b/sapi/cli/tests/cli_set_process_title_error.phpt
new file mode 100644
index 0000000000..025c73015b
--- /dev/null
+++ b/sapi/cli/tests/cli_set_process_title_error.phpt
@@ -0,0 +1,19 @@
+--TEST--
+cli_set_process_title() function : error conditions
+--CREDITS--
+Patrick Allaert patrickallaert@php.net
+@nephp #nephp17
+--SKIPIF--
+<?php
+if (PHP_SAPI !== "cli")
+ die("skip");
+?>
+--FILE--
+<?php
+cli_set_process_title();
+cli_set_process_title("foo", "bar");
+?>
+--EXPECTF--
+Warning: cli_set_process_title() expects exactly 1 parameter, 0 given in %scli_set_process_title_error.php on line 2
+
+Warning: cli_set_process_title() expects exactly 1 parameter, 2 given in %scli_set_process_title_error.php on line 3
diff --git a/sapi/fpm/.gitignore b/sapi/fpm/.gitignore
deleted file mode 100644
index 3f8c0913a4..0000000000
--- a/sapi/fpm/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-php-fpm.8
-php-fpm.service
-status.html
-www.conf
diff --git a/sapi/fpm/fpm/fpm_sockets.c b/sapi/fpm/fpm/fpm_sockets.c
index d58a8f82b6..f16bdfb938 100644
--- a/sapi/fpm/fpm/fpm_sockets.c
+++ b/sapi/fpm/fpm/fpm_sockets.c
@@ -179,7 +179,7 @@ static int fpm_sockets_new_listening_socket(struct fpm_worker_pool_s *wp, struct
if (wp->listen_address_domain == FPM_AF_UNIX) {
if (fpm_socket_unix_test_connect((struct sockaddr_un *)sa, socklen) == 0) {
- zlog(ZLOG_ERROR, "An another FPM instance seems to already listen on %s", ((struct sockaddr_un *) sa)->sun_path);
+ zlog(ZLOG_ERROR, "Another FPM instance seems to already listen on %s", ((struct sockaddr_un *) sa)->sun_path);
close(sock);
return -1;
}
diff --git a/sapi/phpdbg/.gitignore b/sapi/phpdbg/.gitignore
deleted file mode 100644
index 51165dab2f..0000000000
--- a/sapi/phpdbg/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
-.libs/
-phpdbg
-*.lo
-*.o
-*.output
-build
diff --git a/sapi/phpdbg/.travis.yml b/sapi/phpdbg/.travis.yml
deleted file mode 100644
index 2e777fbe13..0000000000
--- a/sapi/phpdbg/.travis.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-language: c
-
-env:
-- PHP="PHP-5.4"
-- PHP="PHP-5.5"
-- PHP="PHP-5.6"
-
-before_script: ./travis/ci.sh
-
-script:
-- ./php-src/sapi/cli/php php-src/sapi/phpdbg/tests/run-tests.php -diff2stdout --phpdbg php-src/sapi/phpdbg/phpdbg
diff --git a/sapi/phpdbg/README.md b/sapi/phpdbg/README.md
index a2a84deb7b..9d1163bc47 100644
--- a/sapi/phpdbg/README.md
+++ b/sapi/phpdbg/README.md
@@ -5,8 +5,6 @@ Implemented as a SAPI module, phpdbg can exert complete control over the environ
phpdbg aims to be a lightweight, powerful, easy to use debugging platform for PHP 5.4+
-[![phpdbg on travis-ci](https://travis-ci.org/krakjoe/phpdbg.png?branch=master)](https://travis-ci.org/krakjoe/phpdbg)
-
Features
========
diff --git a/sapi/phpdbg/phpdbg_opcode.c b/sapi/phpdbg/phpdbg_opcode.c
index 62f5e8c71c..551d1f8a86 100644
--- a/sapi/phpdbg/phpdbg_opcode.c
+++ b/sapi/phpdbg/phpdbg_opcode.c
@@ -37,7 +37,7 @@ static inline const char *phpdbg_decode_opcode(zend_uchar opcode) /* {{{ */
} /* }}} */
static inline char *phpdbg_decode_op(
- zend_op_array *ops, const znode_op *op, uint32_t type) /* {{{ */
+ zend_op_array *ops, const zend_op *opline, const znode_op *op, uint32_t type) /* {{{ */
{
char *decode = NULL;
@@ -56,7 +56,7 @@ static inline char *phpdbg_decode_op(
spprintf(&decode, 0, "~%u", EX_VAR_TO_NUM(op->var) - ops->last_var);
break;
case IS_CONST: {
- zval *literal = RT_CONSTANT(ops, *op);
+ zval *literal = RT_CONSTANT(opline, *op);
decode = phpdbg_short_zval_print(literal, 20);
} break;
}
@@ -68,7 +68,7 @@ char *phpdbg_decode_input_op(
uint32_t flags) {
char *result = NULL;
if (op_type != IS_UNUSED) {
- result = phpdbg_decode_op(ops, &op, op_type);
+ result = phpdbg_decode_op(ops, opline, &op, op_type);
} else if (ZEND_VM_OP_JMP_ADDR == (flags & ZEND_VM_OP_MASK)) {
spprintf(&result, 0, "J%td", OP_JMP_ADDR(opline, op) - ops->opcodes);
} else if (ZEND_VM_OP_NUM == (flags & ZEND_VM_OP_MASK)) {
@@ -118,7 +118,7 @@ char *phpdbg_decode_opline(zend_op_array *ops, zend_op *opline) /*{{{ */
spprintf(&decode[3], 0, "%" PRIu32, opline->result.num);
break;
default:
- decode[3] = phpdbg_decode_op(ops, &opline->result, opline->result_type);
+ decode[3] = phpdbg_decode_op(ops, opline, &opline->result, opline->result_type);
break;
}
diff --git a/sapi/phpdbg/phpdbg_utils.c b/sapi/phpdbg/phpdbg_utils.c
index 1fd059d685..fa27fa96a8 100644
--- a/sapi/phpdbg/phpdbg_utils.c
+++ b/sapi/phpdbg/phpdbg_utils.c
@@ -687,10 +687,12 @@ PHPDBG_API void phpdbg_xml_var_dump(zval *zv) {
break;
case IS_ARRAY:
myht = Z_ARRVAL_P(zv);
- if (ZEND_HASH_APPLY_PROTECTION(myht) && ++myht->u.v.nApplyCount > 1) {
- phpdbg_xml("<recursion />");
- --myht->u.v.nApplyCount;
- break;
+ if (!(GC_FLAGS(myht) & GC_IMMUTABLE)) {
+ if (GC_IS_RECURSIVE(myht)) {
+ phpdbg_xml("<recursion />");
+ break;
+ }
+ GC_PROTECT_RECURSION(myht);
}
phpdbg_xml("<array refstatus=\"%s\" num=\"%d\">", COMMON, zend_hash_num_elements(myht));
element_dump_func = phpdbg_xml_array_element_dump;
@@ -698,9 +700,8 @@ PHPDBG_API void phpdbg_xml_var_dump(zval *zv) {
goto head_done;
case IS_OBJECT:
myht = Z_OBJDEBUG_P(zv, is_temp);
- if (myht && ++myht->u.v.nApplyCount > 1) {
+ if (myht && GC_IS_RECURSIVE(myht)) {
phpdbg_xml("<recursion />");
- --myht->u.v.nApplyCount;
break;
}
@@ -715,7 +716,7 @@ head_done:
element_dump_func(val, key, num);
} ZEND_HASH_FOREACH_END();
zend_hash_apply_with_arguments(myht, (apply_func_args_t) element_dump_func, 0);
- --myht->u.v.nApplyCount;
+ GC_UNPROTECT_RECURSION(myht);
if (is_temp) {
zend_hash_destroy(myht);
efree(myht);
@@ -763,9 +764,9 @@ PHPDBG_API zend_bool phpdbg_check_caught_ex(zend_execute_data *execute_data, zen
zend_class_entry *ce;
cur = &op_array->opcodes[catch];
- if (!(ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(cur->op1))))) {
- ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(cur->op1)), EX_CONSTANT(cur->op1) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD);
- CACHE_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(cur->op1)), ce);
+ if (!(ce = CACHED_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(cur, cur->op1))))) {
+ ce = zend_fetch_class_by_name(Z_STR_P(RT_CONSTANT(cur, cur->op1)), RT_CONSTANT(cur, cur->op1) + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD);
+ CACHE_PTR(Z_CACHE_SLOT_P(RT_CONSTANT(cur, cur->op1)), ce);
}
if (ce == exception->ce || (ce && instanceof_function(exception->ce, ce))) {
@@ -843,12 +844,17 @@ char *phpdbg_short_zval_print(zval *zv, int maxlen) /* {{{ */
ZSTR_VAL(str), ZSTR_LEN(str) <= maxlen ? 0 : '+');
break;
}
- case IS_CONSTANT:
- decode = estrdup("<constant>");
- break;
- case IS_CONSTANT_AST:
- decode = estrdup("<ast>");
+ case IS_CONSTANT_AST: {
+ zend_ast *ast = Z_ASTVAL_P(zv);
+
+ if (ast->kind == ZEND_AST_CONSTANT
+ || ast->kind == ZEND_AST_CONSTANT_CLASS) {
+ decode = estrdup("<constant>");
+ } else {
+ decode = estrdup("<ast>");
+ }
break;
+ }
default:
spprintf(&decode, 0, "unknown type: %d", Z_TYPE_P(zv));
break;
diff --git a/sapi/phpdbg/travis/ci.sh b/sapi/phpdbg/travis/ci.sh
deleted file mode 100755
index 206b158b9b..0000000000
--- a/sapi/phpdbg/travis/ci.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/usr/bin/env sh
-git clone https://github.com/php/php-src
-cd php-src
-git checkout $PHP
-cd sapi
-rm -rf phpdbg
-git clone https://github.com/krakjoe/phpdbg.git
-cd ../
-./buildconf --force
-./configure --disable-all --enable-phpdbg --enable-maintainer-zts
-make
diff --git a/tests/lang/operators/operator_identical_recusion-01.phpt b/tests/lang/operators/operator_identical_recusion-01.phpt
new file mode 100644
index 0000000000..3680e30e4d
--- /dev/null
+++ b/tests/lang/operators/operator_identical_recusion-01.phpt
@@ -0,0 +1,10 @@
+--TEST--
+Test === operator : False recursion detection
+--FILE--
+<?php
+$n = 0;
+$a = [[$n]];
+$b = [&$a];
+var_dump($a === $b);
+--EXPECT--
+bool(false) \ No newline at end of file
diff --git a/travis/compile.sh b/travis/compile.sh
index b2d29b99df..0017026c1b 100755
--- a/travis/compile.sh
+++ b/travis/compile.sh
@@ -45,6 +45,7 @@ $TS \
--with-png-dir=/usr \
--enable-exif \
--enable-zip \
+--without-libzip \
--with-zlib \
--with-zlib-dir=/usr \
--enable-soap \
diff --git a/win32/build/config.w32 b/win32/build/config.w32
index 43b03626a4..71cf49156f 100644
--- a/win32/build/config.w32
+++ b/win32/build/config.w32
@@ -60,29 +60,32 @@ DEFINE("BASE_INCLUDES", "/I . /I main /I Zend /I TSRM /I ext ");
toolset_setup_common_cflags();
-ARG_WITH('mp', 'Tell Visual Studio use up to [n,auto,disable] processes for compilation', 'auto');
-var PHP_MP_DISABLED = true;
-if (VS_TOOLSET && PHP_MP != 'disable') {
- if(PHP_DEBUG == 'yes') {
- STDOUT.WriteLine('WARNING: Debug builds cannot be built using multi processing');
- } else {
- // no from disable-all
- if(PHP_MP == 'auto' || PHP_MP == 'no') {
- ADD_FLAG('CFLAGS', ' /MP ');
- PHP_MP_DISABLED = false;
+if (VS_TOOLSET) {
+ ARG_WITH('mp', 'Tell Visual Studio use up to [n,auto,disable] processes for compilation', 'auto');
+ var PHP_MP_DISABLED = true;
+
+ if (PHP_MP != 'disable') {
+ if(PHP_DEBUG == 'yes') {
+ STDOUT.WriteLine('WARNING: Debug builds cannot be built using multi processing');
} else {
- if(parseInt(PHP_MP) != 0) {
- ADD_FLAG('CFLAGS', ' /MP'+ PHP_MP +' ');
+ // no from disable-all
+ if(PHP_MP == 'auto' || PHP_MP == 'no') {
+ ADD_FLAG('CFLAGS', ' /MP ');
PHP_MP_DISABLED = false;
} else {
- STDOUT.WriteLine('WARNING: Invalid argument for MP: ' + PHP_MP);
+ if(parseInt(PHP_MP) != 0) {
+ ADD_FLAG('CFLAGS', ' /MP'+ PHP_MP +' ');
+ PHP_MP_DISABLED = false;
+ } else {
+ STDOUT.WriteLine('WARNING: Invalid argument for MP: ' + PHP_MP);
+ }
}
}
}
-}
-if (!PHP_MP_DISABLED) {
- STDOUT.WriteLine('Enabling multi process build');
+ if (!PHP_MP_DISABLED) {
+ STDOUT.WriteLine('Enabling multi process build');
+ }
}
// General link flags
@@ -241,7 +244,8 @@ ADD_FLAG("CFLAGS_BD_ZEND", "/D ZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
ADD_SOURCES("main", "main.c snprintf.c spprintf.c getopt.c fopen_wrappers.c \
php_scandir.c php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.c \
strlcat.c mergesort.c reentrancy.c php_variables.c php_ticks.c network.c \
- php_open_temporary_file.c output.c internal_functions.c php_sprintf.c");
+ php_open_temporary_file.c output.c internal_functions.c php_sprintf.c \
+ php_syslog.c");
ADD_FLAG("CFLAGS_BD_MAIN", "/D ZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE('HAVE_STRNLEN', 1);
diff --git a/win32/build/confutils.js b/win32/build/confutils.js
index bdcc406cf7..ab27bbbc48 100644
--- a/win32/build/confutils.js
+++ b/win32/build/confutils.js
@@ -62,6 +62,9 @@ var sapi_enabled = new Array();
/* Store the headers to install */
var headers_install = new Array();
+/* Store unknown configure options */
+var INVALID_CONFIG_ARGS = new Array();
+
/* Mapping CL version > human readable name */
var VC_VERSIONS = new Array();
VC_VERSIONS[1700] = 'MSVC11 (Visual C++ 2012)';
@@ -101,10 +104,10 @@ if (typeof(CWD) == "undefined") {
/* defaults; we pick up the precise versions from configure.ac */
var PHP_VERSION = 7;
-var PHP_MINOR_VERSION = 2;
+var PHP_MINOR_VERSION = 3;
var PHP_RELEASE_VERSION = 0;
var PHP_EXTRA_VERSION = "";
-var PHP_VERSION_STRING = "7.2.0";
+var PHP_VERSION_STRING = "7.3.0";
/* Get version numbers and DEFINE as a string */
function get_version_numbers()
@@ -402,11 +405,15 @@ function conf_process_args()
}
}
if (!found) {
- STDERR.WriteLine("Unknown option " + argname + "; please try configure.js --help for a list of valid options");
- WScript.Quit(2);
+ INVALID_CONFIG_ARGS[INVALID_CONFIG_ARGS.length] = argname;
}
}
+ if (PHP_SNAPSHOT_BUILD != 'no' && INVALID_CONFIG_ARGS.length) {
+ STDERR.WriteLine('Unknown option ' + INVALID_CONFIG_ARGS[0] + '; please try configure.js --help for a list of valid options');
+ WScript.Quit(2);
+ }
+
if (configure_help_mode) {
STDOUT.WriteLine(word_wrap_and_indent(0,
"Options that enable extensions and SAPI will accept \
@@ -2006,6 +2013,17 @@ function generate_files()
STDOUT.WriteBlankLines(1);
write_summary();
+ if (INVALID_CONFIG_ARGS.length) {
+ STDOUT.WriteLine('WARNING');
+ STDOUT.WriteLine('The following arguments is invalid, and therefore ignored:');
+
+ for (var i = 0; i < INVALID_CONFIG_ARGS.length; ++i) {
+ STDOUT.WriteLine(' ' + INVALID_CONFIG_ARGS[i]);
+ }
+
+ STDOUT.WriteBlankLines(2);
+ }
+
if (PHP_SNAPSHOT_BUILD != "no") {
STDOUT.WriteLine("Type 'nmake snap' to build a PHP snapshot");
} else {
diff --git a/win32/build/mkdist.php b/win32/build/mkdist.php
index 804fcf7585..bf91b8b360 100644
--- a/win32/build/mkdist.php
+++ b/win32/build/mkdist.php
@@ -46,12 +46,6 @@ function get_depends($module)
/* apache 2 */
'libhttpd.dll', 'libapr.dll', 'libaprutil.dll','libapr-1.dll', 'libaprutil-1.dll',
- /* pi3web */
- 'piapi.dll', 'pi3api.dll',
-
- /* nsapi */
- 'ns-httpd30.dll', 'ns-httpd35.dll', 'ns-httpd36.dll', 'ns-httpd40.dll',
-
/* oracle */
'oci.dll', 'ociw32.dll',
@@ -253,10 +247,10 @@ if(sizeof($pecl_targets)) {
$text_files = array(
"LICENSE" => "license.txt",
"NEWS" => "news.txt",
+ "INSTALL" => "install.txt",
"README.REDIST.BINS" => "readme-redist-bins.txt",
"php.ini-development" => "php.ini-development",
- "php.ini-production" => "php.ini-production",
- "win32/install.txt" => "install.txt",
+ "php.ini-production" => "php.ini-production"
);
foreach ($text_files as $src => $dest) {
diff --git a/win32/install.txt b/win32/install.txt
deleted file mode 100644
index 0b989e8fe9..0000000000
--- a/win32/install.txt
+++ /dev/null
@@ -1,1797 +0,0 @@
-Installing PHP
- __________________________________________________________________
-
- Table of Contents
- Preface
- 1. General Installation Considerations
- 2. Installation on Windows systems
-
- Manual Installation Steps
- ActiveScript
- Microsoft IIS
- Apache 1.3.x on Microsoft Windows
- Apache 2.0.x on Microsoft Windows
- Sun, iPlanet and Netscape servers on Microsoft Windows
- OmniHTTPd Server
- Sambar Server on Microsoft Windows
- Xitami on Microsoft Windows
- Installation of extensions on Windows
-
- 3. Installation of PECL extensions
-
- Introduction to PECL Installations
- Downloading PECL extensions
- PECL for Windows users
- Compiling shared PECL extensions with the pecl command
- Compiling shared PECL extensions with phpize
- Compiling PECL extensions statically into PHP
-
- 4. Problems?
-
- Read the FAQ
- Other problems
- Bug reports
-
- 5. Runtime Configuration
-
- The configuration file
- How to change configuration settings
-
- 6. Installation FAQ
- __________________________________________________________________
-
-Preface
-
- These installation instructions were generated from the HTML version of
- the PHP Manual so formatting and linking have been altered. See the
- online and updated version at: http://php.net/install.windows
- __________________________________________________________________
-
-Chapter 1. General Installation Considerations
-
- Before starting the installation, first you need to know what do you
- want to use PHP for. There are three main fields you can use PHP, as
- described in the What can PHP do? section:
-
- * Websites and web applications (server-side scripting)
- * Command line scripting
- * Desktop (GUI) applications
-
- For the first and most common form, you need three things: PHP itself,
- a web server and a web browser. You probably already have a web
- browser, and depending on your operating system setup, you may also
- have a web server (e.g. Apache on Linux and MacOS X; IIS on Windows).
- You may also rent webspace at a company. This way, you don't need to
- set up anything on your own, only write your PHP scripts, upload it to
- the server you rent, and see the results in your browser.
-
- In case of setting up the server and PHP on your own, you have two
- choices for the method of connecting PHP to the server. For many
- servers PHP has a direct module interface (also called SAPI). These
- servers include Apache, Microsoft Internet Information Server, Netscape
- and iPlanet servers. Many other servers have support for ISAPI, the
- Microsoft module interface (OmniHTTPd for example). If PHP has no
- module support for your web server, you can always use it as a CGI or
- FastCGI processor. This means you set up your server to use the CGI
- executable of PHP to process all PHP file requests on the server.
-
- If you are also interested to use PHP for command line scripting (e.g.
- write scripts autogenerating some images for you offline, or processing
- text files depending on some arguments you pass to them), you always
- need the command line executable. For more information, read the
- section about writing command line PHP applications. In this case, you
- need no server and no browser.
-
- With PHP you can also write desktop GUI applications using the PHP-GTK
- extension. This is a completely different approach than writing web
- pages, as you do not output any HTML, but manage Windows and objects
- within them. For more information about PHP-GTK, please visit the site
- dedicated to this extension. PHP-GTK is not included in the official
- PHP distribution.
-
- From now on, this section deals with setting up PHP for web servers on
- Unix and Windows with server module interfaces and CGI executables. You
- will also find information on the command line executable in the
- following sections.
-
- PHP source code and binary distributions for Windows can be found at
- http://www.php.net/downloads.php. We recommend you to choose a mirror
- nearest to you for downloading the distributions.
- __________________________________________________________________
-
-Chapter 2. Installation on Windows systems
-
- This section applies to Windows 98/Me and Windows NT/2000/XP/2003. PHP
- will not work on 16 bit platforms such as Windows 3.1 and sometimes we
- refer to the supported Windows platforms as Win32. Windows 95 is no
- longer supported as of PHP 4.3.0.
-
- If you have Microsoft Visual Studio, you can also build PHP from the
- original source code.
-
- Once you have PHP installed on your Windows system, you may also want
- to load various extensions for added functionality.
-
- Warning
-
- There are several all-in-one installers over the Internet, but none of
- those are endorsed by PHP.net, as we believe that the manual
- installation is the best choice to have your system secure and
- optimised.
- __________________________________________________________________
-
-Manual Installation Steps
-
- This install guide will help you manually install and configure PHP
- with a web server on Microsoft Windows. To get started you'll need to
- download the zip binary distribution from the downloads page at
- http://www.php.net/downloads.php.
-
- Although there are many all-in-one installation kits, we recommend you
- take the time to setup PHP yourself as this will provide you with a
- better understanding of the system, and enables you to install PHP
- extensions easily when needed.
-
- Upgrading from a previous PHP version: Previous editions of the
- manual suggest moving various ini and DLL files into your SYSTEM
- (i.e. C:\WINDOWS) folder and while this simplifies the installation
- procedure it makes upgrading difficult. We advise you remove all of
- these files (like php.ini and PHP related DLLs from the Windows
- SYSTEM folder) before moving on with a new PHP installation. Be sure
- to backup these files as you might break the entire system. The old
- php.ini might be useful in setting up the new PHP as well. And as
- you'll soon learn, the preferred method for installing PHP is to
- keep all PHP related files in one directory and have this directory
- available to your systems PATH.
-
- MDAC requirements: If you use Microsoft Windows 98/NT4 download the
- latest version of the Microsoft Data Access Components (MDAC) for
- your platform. MDAC is available at http://msdn.microsoft.com/data/.
- This requirement exists because ODBC is built into the distributed
- Windows binaries.
-
- The following steps should be completed on all installations before any
- server specific instructions are performed:
-
- Extract the distribution file into a directory of your choice. If you
- are installing PHP 4, extract to C:\, as the zip file expands to a
- foldername like php-4.3.7-Win32. If you are installing PHP 7, extract
- to C:\php as the zip file doesn't expand as in PHP 4. You may choose a
- different location but do not have spaces in the path (like C:\Program
- Files\PHP) as some web servers will crash if you do.
-
- The directory structure extracted from the zip is different for PHP
- versions 4 and 5 and look like as follows:
-
- Example 2-2. PHP 7 package structure
-c:\php
- |
- +--dev
- | |
- | |-php7ts.lib
- |
- +--ext -- extension DLLs for PHP
- | |
- | |-php_bz2.dll
- | |
- | |-php_cpdf.dll
- | |
- | |-..
- |
- +--extras
- | |
- | +--mibs -- support files for SNMP
- | |
- | +--openssl -- support files for Openssl
- | |
- | +--pdf-related -- support files for PDF
- | |
- | |-mime.magic
- |
- +--pear -- initial copy of PEAR
- |
- |
- |-go-pear.bat -- PEAR setup script
- |
- |-fdftk.dll
- |
- |-..
- |
- |-php-cgi.exe -- CGI executable
- |
- |-php-win.exe -- executes scripts without an opened command prompt
- |
- |-php.exe -- CLI executable - ONLY for command line scripting
- |
- |-..
- |
- |-php.ini-development -- development php.ini settings
- |
- |-php.ini-production -- recommended php.ini settings for production
- |
- |-php5activescript.dll
- |
- |-php7apache2_4.dll
- |
- |-..
- |
- |-php5ts.dll -- core PHP DLL
- |
- |-...
-
- Notice the differences and similarities. Both PHP 4 and PHP 5 have a
- CGI executable, a CLI executable, and server modules, but they are
- located in different folders and/or have different names. While PHP 4
- packages have the server modules in the sapi folder, PHP 5
- distributions have no such directory and instead they're in the PHP
- folder root. The supporting DLLs for the PHP 5 extensions are also not
- in a separate directory.
-
- Note: In PHP 4, you should move all files located in the dll and
- sapi folders to the main folder (e.g. C:\php).
-
- Here is a list of server modules shipped with PHP 5:
-
- * php7apache2_4.dll - Apache 2.4.x module.
-
- Server modules provide significantly better performance and additional
- functionality compared to the CGI binary. The FastCGI is significantly
- more stable and can be faster than the ISAPI module with IIS.
- The CLI version is designed to let you use PHP for command line
- scripting. More information about CLI is available in the chapter
- about using PHP from the command line.
-
- Warning
-
- The SAPI modules have been significantly improved as of the 4.1
- release, however, in older systems you may encounter server errors or
- other server modules failing, such as ASP.
-
- The CGI and CLI binaries, and the web server modules all require the
- php7ts.dll file to be available to them. You have to make
- sure that this file can be found by your PHP installation. The search
- order for this DLL is as follows:
-
- * The same directory from where php.exe is called, or in case you use
- a SAPI module, the web server's directory (e.g. C:\Program
- Files\Apache Group\Apache2\bin).
- * Any directory in your Windows PATH environment variable.
-
- To make php7ts.dll available you have three options: copy
- the file to the Windows system directory, copy the file to the web
- server's directory, or add your PHP directory, C:\php to the PATH. For
- better maintenance, we advise you to follow the last option, add C:\php
- to the PATH, because it will be simpler to upgrade PHP in the future.
- Read more about how to add your PHP directory to PATH in the
- corresponding FAQ entry (and then don't forget to restart the computer
- - logoff isn't enough).
-
- The next step is to set up a valid configuration file for PHP, php.ini.
- There are two ini files distributed in the zip file, php.ini-development
- and php.ini-production. We advise you to use php.ini-production,
- because we optimized the default settings in this file for performance,
- and security. Read this well documented file carefully because it has
- changes from php.ini-production that will drastically affect your setup.
- Some examples are display_errors being off and magic_quotes_gpc being off.
- In addition to reading these, study the ini settings and set every
- element manually yourself. If you would like to achieve the best
- security, then this is the way for you, although PHP works fine with
- these default ini files. Copy your chosen ini-file to a directory that
- PHP is able to find and rename it to php.ini. PHP searches for php.ini
- in the locations described in the Section called The configuration file
- in Chapter 5 section.
-
- If you are running Apache 2, the simpler option is to use the PHPIniDir
- directive (read the installation on Apache 2 page), otherwise your best
- option is to set the PHPRC environment variable. This process is
- explained in the following FAQ entry.
-
- Note: If you're using NTFS on Windows NT, 2000, XP or 2003, make
- sure that the user running the web server has read permissions to
- your php.ini (e.g. make it readable by Everyone).
-
- The following steps are optional:
-
- * Edit your new php.ini file. If you plan to use OmniHTTPd, do not
- follow the next step. Set the doc_root to point to your web servers
- document_root. For example:
-
-doc_root = c:\inetpub\wwwroot // for IIS
-
-doc_root = c:\apache\htdocs // for Apache
-
- * Choose the extensions you would like to load when PHP starts. See
- the section about Windows extensions, about how to set up one, and
- what is already built in. Note that on a new installation it is
- advisable to first get PHP working and tested without any
- extensions before enabling them in php.ini.
-
- PHP is now setup on your system. The next step is to choose a web
- server, and enable it to run PHP. Choose a web server from the table of
- contents.
- __________________________________________________________________
-
-ActiveScript
-
- This section contains notes specific to the ActiveScript installation.
-
- ActiveScript is a Windows only SAPI that enables you to use PHP script
- in any ActiveScript compliant host, like Windows Script Host,
- ASP/ASP.NET, Windows Script Components or Microsoft Scriptlet control.
-
- As of PHP 5.0.1, ActiveScript has been moved to the PECL repository.
- The DLL for this PECL extension may be downloaded from either the PHP
- Downloads page or from http://pecl4win.php.net/
-
- Note: You should read the manual installation steps first!
-
- After installing PHP, you should download the ActiveScript DLL
- (php7activescript.dll) and place it in the main PHP folder (e.g.
- C:\php).
-
- After having all the files needed, you must register the DLL on your
- system. To achieve this, open a Command Prompt window (located in the
- Start Menu). Then go to your PHP directory by typing something like cd
- C:\php. To register the DLL just type regsvr32 php7activescript.dll.
-
- To test if ActiveScript is working, create a new file, named test.wsf
- (the extension is very important) and type:
-<job id="test">
-
- <script language="PHPScript">
- $WScript->Echo("Hello World!");
- </script>
-
-</job>
-
- Save and double-click on the file. If you receive a little window
- saying "Hello World!" you're done.
-
- Note: In PHP 4, the engine was named 'ActivePHP', so if you are
- using PHP 4, you should replace 'PHPScript' with 'ActivePHP' in the
- above example.
-
- Note: ActiveScript doesn't use the default php.ini file. Instead, it
- will look only in the same directory as the .exe that caused it to
- load. You should create php-activescript.ini and place it in that
- folder, if you wish to load extensions, etc.
- __________________________________________________________________
-
-Microsoft IIS
-
- This section contains notes and hints specific to IIS (Microsoft
- Internet Information Server).
-
- Warning
-
- By using the CGI setup, your server is open to several possible
- attacks. Please read our CGI security section to learn how to defend
- yourself from those attacks.
- __________________________________________________________________
-
-General considerations for all installations of PHP with IIS
-
- * First, read the Manual Installation Instructions. Do not skip this
- step as it provides crucial information for installing PHP on
- Windows.
- * CGI users must set the cgi.force_redirect PHP directive to 0 inside
- php.ini. Read the faq on cgi.force_redirect for important details.
- Also, CGI users may want to set the cgi.redirect_status_env
- directive. When using directives, be sure these directives aren't
- commented out inside php.ini.
- * The PHP 4 CGI is named php.exe while in PHP 7 it's php-cgi.exe. In
- PHP 7, php.exe is the CLI, and not the CGI.
- * Modify the Windows PATH environment variable to include the PHP
- directory. This way the PHP DLL files and PHP executables can all
- remain in the PHP directory without cluttering up the Windows
- system directory. For more details, see the FAQ on Setting the
- PATH.
- * The IIS user (usually IUSR_MACHINENAME) needs permission to read
- various files and directories, such as php.ini, docroot, and the
- session tmp directory.
- * Be sure the extension_dir and doc_root PHP directives are
- appropriately set in php.ini. These directives depend on the system
- that PHP is being installed on. In PHP 4, the extension_dir is
- extensions while with PHP 7 it's ext. So, an example PHP 7
- extensions_dir value is "c:\php\ext" and an example IIS doc_root
- value is "c:\Inetpub\wwwroot".
- * PHP extension DLL files, such as php_mysql.dll and php_curl.dll,
- are found in the zip package of the PHP download. In PHP 7, many
- extensions are part of PECL and can be downloaded in the
- "Collection of PECL modules" package. Files such as php_zip.dll and
- php_ssh2.dll. Download PHP files here.
- * When defining the executable, the 'check that file exists' box may
- also be checked. For a small performance penalty, the IIS
- will check that the script file exists and sort out authentication
- before firing up PHP. This means that the web server will provide
- sensible 404 style error messages instead of CGI errors complaining
- that PHP did not output any data.
- __________________________________________________________________
-
-Windows NT/200x/XP and IIS 4 or newer
-
- PHP may be installed as a CGI binary, or with the ISAPI module. In
- either case, you need to start the Microsoft Management Console (may
- appear as 'Internet Services Manager', either in your Windows NT 4.0
- Option Pack branch or the Control Panel=>Administrative Tools under
- Windows 2000/XP). Then right click on your Web server node (this will
- most probably appear as 'Default Web Server'), and select 'Properties'.
-
- If you want to use the CGI binary, do the following:
-
- * Under 'Home Directory', 'Virtual Directory', or 'Directory', do the
- following:
- * Change the Execute Permissions to 'Scripts only'
- * Click on the 'Configuration' button, and choose the Application
- Mappings tab. Click Add and set the Executable path to the
- appropriate CGI file. An example PHP 7 value is: C:\php\php-cgi.exe
- Supply .php as the extension. Leave 'Method exclusions' blank, and
- check the 'Script engine' checkbox. Now, click OK a few times.
- * Set up the appropriate security. (This is done in Internet Service
- Manager), and if your NT Server uses NTFS file system, add execute
- rights for I_USR_ to the directory that contains php.exe /
- php-cgi.exe.
-
- To use the ISAPI module, do the following:
-
- * If you don't want to perform HTTP Authentication using PHP, you can
- (and should) skip this step. Under ISAPI Filters, add a new ISAPI
- filter. Use PHP as the filter name, and supply a path to the
- php7isapi.dll.
- * Under 'Home Directory', 'Virtual Directory', or 'Directory', do the
- following:
- * Change the Execute Permissions to 'Scripts only'
- * Click on the 'Configuration' button, and choose the Application
- Mappings tab. Click Add and set the Executable path to the
- appropriate ISAPI DLL. An example PHP 7 value is:
- C:\php\php7isapi.dll Supply .php as the extension. Leave 'Method
- exclusions' blank, and check the 'Script engine' checkbox. Now,
- click OK a few times.
- * Stop IIS completely (NET STOP iisadmin)
- * Start IIS again (NET START w3svc)
-
- With IIS 6 (2003 Server), open up the IIS Manager, go to Web Service
- Extensions, choose "Add a new Web service extension", enter in a name
- such as PHP, choose the Add button and for the value browse to either
- the ISAPI file (php7isapi.dll) or CGI (php.exe or
- php-cgi.exe) then check "Set extension status to Allowed" and click OK.
-
- In order to use index.php as a default content page, do the following:
- From within the Documents tab, choose Add. Type in index.php and click
- OK. Adjust the order by choosing Move Up or Move Down. This is similar
- to setting DirectoryIndex with Apache.
-
- The steps above must be repeated for each extension that is to be
- associated with PHP scripts. .php is the most common although .php3 may
- be required for legacy applications.
-
- If you experience 100% CPU usage after some time, turn off the IIS
- setting Cache ISAPI Application.
- __________________________________________________________________
-
-Windows and IIS
-
-See http://www.php.net/install.windows
- __________________________________________________________________
-
-Apache 1.3.x on Microsoft Windows
-
- This section contains notes and hints specific to Apache 1.3.x installs
- of PHP on Microsoft Windows systems. There are also instructions and
- notes for Apache 2 on a separate page.
-
- Note: Please read the manual installation steps first!
-
- There are two ways to set up PHP to work with Apache 1.3.x on Windows.
- One is to use the CGI binary (php.exe for PHP 4 and php-cgi.exe for PHP
- 5), the other is to use the Apache Module DLL. In either case you need
- to edit your httpd.conf to configure Apache to work with PHP, and then
- restart the server.
-
- It is worth noting here that now the SAPI module has been made more
- stable under Windows, we recommend it's use above the CGI binary, since
- it is more transparent and secure.
-
- Although there can be a few variations of configuring PHP under Apache,
- these are simple enough to be used by the newcomer. Please consult the
- Apache Documentation for further configuration directives.
-
- After changing the configuration file, remember to restart the server,
- for example, NET STOP APACHE followed by NET START APACHE, if you run
- Apache as a Windows Service, or use your regular shortcuts.
-
- Note: Remember that when adding path values in the Apache
- configuration files on Windows, all backslashes such as
- c:\directory\file.ext must be converted to forward slashes, as
- c:/directory/file.ext. A trailing slash may also be necessary for
- directories.
- __________________________________________________________________
-
-Installing as an Apache module
-
- You should add the following lines to your Apache httpd.conf file:
-
- Example 2-3. PHP as an Apache 1.3.x module
-
- This assumes PHP is installed to c:\php. Adjust the path if this is not
- the case.
-
- For PHP 7:
-# Add to the end of the LoadModule section
-LoadModule php7_module "C:/php/php7apache.dll"
-
-# Add to the end of the AddModule section
-AddModule mod_php7.c
-
- For both:
-# Add this line inside the <IfModule mod_mime.c> conditional brace
-AddType application/x-httpd-php .php
-
-# For syntax highlighted .phps files, also add
-AddType application/x-httpd-php-source .phps
- __________________________________________________________________
-
-Installing as a CGI binary
-
- If you unzipped the PHP package to C:\php\ as described in the Manual
- Installation Steps section, you need to insert these lines to your
- Apache configuration file to set up the CGI binary:
-
- Example 2-4. PHP and Apache 1.3.x as CGI
-ScriptAlias /php/ "c:/php/"
-AddType application/x-httpd-php .php
-
-# For PHP 4
-Action application/x-httpd-php "/php/php.exe"
-
-# For PHP 7
-Action application/x-httpd-php "/php/php-cgi.exe"
-
-# specify the directory where php.ini is
-SetEnv PHPRC C:/php
-
- Note that the second line in the list above can be found in the actual
- versions of httpd.conf, but it is commented out. Remember also to
- substitute the c:/php/ for your actual path to PHP.
-
- Warning
-
- By using the CGI setup, your server is open to several possible
- attacks. Please read our CGI security section to learn how to defend
- yourself from those attacks.
-
- If you would like to present PHP source files syntax highlighted, there
- is no such convenient option as with the module version of PHP. If you
- chose to configure Apache to use PHP as a CGI binary, you will need to
- use the highlight_file() function. To do this simply create a PHP
- script file and add this code: <?php
- highlight_file('some_php_script.php'); ?>.
- __________________________________________________________________
-
-Apache 2.0.x on Microsoft Windows
-
- This section contains notes and hints specific to Apache 2.0.x installs
- of PHP on Microsoft Windows systems. We also have instructions and
- notes for Apache 1.3.x users on a separate page.
-
- Note: You should read the manual installation steps first!
-
- Apache 2.2.x Support: Users of Apache 2.2.x may use the
- documentation below except the appropriate DLL file is named
- php7apache2_2.dll and it only exists as of PHP 7.2.0. See also
- http://snaps.php.net/
-
- Warning
-
- We do not recommend using a threaded MPM in production with Apache2.
- Use the prefork MPM instead, or use Apache1. For information on why,
- read the related FAQ entry on using Apache2 with a threaded MPM
-
- You are highly encouraged to take a look at the Apache Documentation to
- get a basic understanding of the Apache 2.0.x Server. Also consider to
- read the Windows specific notes for Apache 2.0.x before reading on
- here.
-
- PHP and Apache 2.0.x compatibility notes: The following versions of
- PHP are known to work with the most recent version of Apache 2.0.x:
-
- * PHP 4.3.0 or later available at http://www.php.net/downloads.php.
- * the latest stable development version. Get the source code
- http://snaps.php.net/php7-latest.tar.gz or download binaries for
- Windows http://snaps.php.net/win32/php7-win32-latest.zip.
- * a prerelease version downloadable from http://qa.php.net/.
- * you have always the option to obtain PHP through SVN.
-
- These versions of PHP are compatible to Apache 2.0.40 and later.
-
- Apache 2.0 SAPI-support started with PHP 4.2.0. PHP 4.2.3 works with
- Apache 2.0.39, don't use any other version of Apache with PHP 4.2.3.
- However, the recommended setup is to use PHP 4.3.0 or later with the
- most recent version of Apache2.
-
- All mentioned versions of PHP will work still with Apache 1.3.x.
-
- Warning
-
- Apache 2.0.x is designed to run on Windows NT 4.0, Windows 2000 or
- Windows XP. At this time, support for Windows 9x is incomplete. Apache
- 2.0.x is not expected to work on those platforms at this time.
-
- Download the most recent version of Apache 2.0.x and a fitting PHP
- version. Follow the Manual Installation Steps and come back to go on
- with the integration of PHP and Apache.
-
- There are two ways to set up PHP to work with Apache 2.0.x on Windows.
- One is to use the CGI binary the other is to use the Apache module DLL.
- In either case you need to edit your httpd.conf to configure Apache to
- work with PHP and then restart the server.
-
- Note: Remember that when adding path values in the Apache
- configuration files on Windows, all backslashes such as
- c:\directory\file.ext must be converted to forward slashes, as
- c:/directory/file.ext. A trailing slash may also be necessary for
- directories.
- __________________________________________________________________
-
-Installing as a CGI binary
-
- You need to insert these three lines to your Apache httpd.conf
- configuration file to set up the CGI binary:
-
- Example 2-5. PHP and Apache 2.0 as CGI
-ScriptAlias /php/ "c:/php/"
-AddType application/x-httpd-php .php
-
-# For PHP 4
-Action application/x-httpd-php "/php/php.exe"
-
-# For PHP 7
-Action application/x-httpd-php "/php/php-cgi.exe"
-
- Warning
-
- By using the CGI setup, your server is open to several possible
- attacks. Please read our CGI security section to learn how to defend
- yourself from those attacks.
- __________________________________________________________________
-
-Installing as an Apache module
-
- You need to insert these two lines to your Apache httpd.conf
- configuration file to set up the PHP module for Apache 2.0:
-
- Example 2-6. PHP and Apache 2.0 as Module
-
-# For PHP 7 do something like this:
-LoadModule php7_module "c:/php/php7apache2.dll"
-AddType application/x-httpd-php .php
-
-# configure the path to php.ini
-PHPIniDir "C:/php"
-
- Note: Remember to substitute your actual path to PHP for the c:/php/
- in the above examples. Take care to use either
- php5apache2.dll in your LoadModule directive and not php5apache.dll
- as the latter ones are designed to run with Apache 1.3.x.
-
- Note: If you want to use content negotiation, read related FAQ.
-
- Warning
-
- Don't mix up your installation with DLL files from different PHP
- versions. You have the only choice to use the DLL's and extensions that
- ship with your downloaded PHP version.
- __________________________________________________________________
-
-Sun, iPlanet and Netscape servers on Microsoft Windows
-
- This section contains notes and hints specific to Sun Java System Web
- Server, Sun ONE Web Server, iPlanet and Netscape server installs of PHP
- on Windows.
-
- From PHP 4.3.3 on you can use PHP scripts with the NSAPI module to
- generate custom directory listings and error pages. Additional
- functions for Apache compatibility are also available. For support in
- current web servers read the note about subrequests.
- __________________________________________________________________
-
-CGI setup on Sun, iPlanet and Netscape servers
-
- To install PHP as a CGI handler, do the following:
-
- * Copy php7ts.dll to your systemroot (the directory where you
- installed Windows)
- * Make a file association from the command line. Type the following
- two lines:
-
-assoc .php=PHPScript
-ftype PHPScript=c:\php\php.exe %1 %*
-
- * In the Netscape Enterprise Administration Server create a dummy
- shellcgi directory and remove it just after (this step creates 5
- important lines in obj.conf and allow the web server to handle
- shellcgi scripts).
- * In the Netscape Enterprise Administration Server create a new mime
- type (Category: type, Content-Type: magnus-internal/shellcgi, File
- Suffix:php).
- * Do it for each web server instance you want PHP to run
-
- More details about setting up PHP as a CGI executable can be found
- here: http://benoit.noss.free.fr/php/install-php.html
- __________________________________________________________________
-
-NSAPI setup on Sun, iPlanet and Netscape servers
-
- To install PHP with NSAPI, do the following:
-
- * Copy php7ts.dll to your systemroot (the directory where you
- installed Windows)
- * Make a file association from the command line. Type the following
- two lines:
-
-assoc .php=PHPScript
-ftype PHPScript=c:\php\php.exe %1 %*
-
- * In the Netscape Enterprise Administration Server create a new mime
- type (Category: type, Content-Type: magnus-internal/x-httpd-php,
- File Suffix: php).
- * Edit magnus.conf (for servers >= 6) or obj.conf (for servers < 6)
- and add the following: You should place the lines after mime types
- init.
-
-Init fn="load-modules" funcs="php7_init,php7_execute,php7_auth_trans" shlib="c:/
-php/sapi/php7nsapi.dll"
-Init fn="php7_init" LateInit="yes" errorString="Failed to initialise PHP!" [php_
-ini="c:/path/to/php.ini"]
-
- The php_ini parameter is optional but with it you
- can place your php.ini in your web server configuration directory.
- * Configure the default object in obj.conf (for virtual server
- classes [Sun Web Server 6.0+] in their vserver.obj.conf): In the
- <Object name="default"> section, place this line necessarily after
- all 'ObjectType' and before all 'AddLog' lines:
-
-Service fn="php7_execute" type="magnus-internal/x-httpd-php" [inikey=value inike
-y=value ...]
-
- As additional parameters you can add some special
- php.ini-values, for example you can set a
- docroot="/path/to/docroot" specific to the context php7_execute is
- called. For boolean ini-keys please use 0/1 as value, not
- "On","Off",... (this will not work correctly), e.g.
- zlib.output_compression=1 instead of zlib.output_compression="On"
- * This is only needed if you want to configure a directory that only
- consists of PHP scripts (same like a cgi-bin directory):
-
-<Object name="x-httpd-php">
-ObjectType fn="force-type" type="magnus-internal/x-httpd-php"
-Service fn=php7_execute [inikey=value inikey=value ...]
-</Object>
-
- After that you can configure a directory in the Administration
- server and assign it the style x-httpd-php. All files in it will
- get executed as PHP. This is nice to hide PHP usage by renaming
- files to .html.
- * Restart your web service and apply changes
- * Do it for each web server instance you want PHP to run
-
- Note: More details about setting up PHP as an NSAPI filter can be
- found here: http://benoit.noss.free.fr/php/install-php4.html
-
- Note: The stacksize that PHP uses depends on the configuration of
- the web server. If you get crashes with very large PHP scripts, it
- is recommended to raise it with the Admin Server (in the section
- "MAGNUS EDITOR").
- __________________________________________________________________
-
-CGI environment and recommended modifications in php.ini
-
- Important when writing PHP scripts is the fact that Sun JSWS/Sun ONE
- WS/iPlanet/Netscape is a multithreaded web server. Because of that all
- requests are running in the same process space (the space of the web
- server itself) and this space has only one environment. If you want to
- get CGI variables like PATH_INFO, HTTP_HOST etc. it is not the correct
- way to try this in the old PHP 3.x way with getenv() or a similar way
- (register globals to environment, $_ENV). You would only get the
- environment of the running web server without any valid CGI variables!
-
- Note: Why are there (invalid) CGI variables in the environment?
-
- Answer: This is because you started the web server process from the
- admin server which runs the startup script of the web server, you
- wanted to start, as a CGI script (a CGI script inside of the admin
- server!). This is why the environment of the started web server has
- some CGI environment variables in it. You can test this by starting
- the web server not from the administration server. Use the command
- line as root user and start it manually - you will see there are no
- CGI-like environment variables.
- __________________________________________________________________
-
-Special use for error pages or self-made directory listings (PHP >= 4.3.3)
-
- You can use PHP to generate the error pages for "404 Not Found" or
- similar. Add the following line to the object in obj.conf for every
- error page you want to overwrite:
-Error fn="php7_execute" code=XXX script="/path/to/script.php" [inikey=value inik
-ey=value...]
-
- where XXX is the HTTP error code. Please delete any other Error
- directives which could interfere with yours. If you want to place a
- page for all errors that could exist, leave the code parameter out.
- Your script can get the HTTP status code with $_SERVER['ERROR_TYPE'].
-
- Another possibility is to generate self-made directory listings. Just
- create a PHP script which displays a directory listing and replace the
- corresponding default Service line for type="magnus-internal/directory"
- in obj.conf with the following:
-Service fn="php7_execute" type="magnus-internal/directory" script="/path/to/scri
-pt.php" [inikey=value inikey=value...]
-
- For both error and directory listing pages the original URI and
- translated URI are in the variables $_SERVER['PATH_INFO'] and
- $_SERVER['PATH_TRANSLATED'].
- __________________________________________________________________
-
-Note about nsapi_virtual() and subrequests (PHP >= 4.3.3)
-
- The NSAPI module now supports the nsapi_virtual() function (alias:
- virtual()) to make subrequests on the web server and insert the result
- in the web page. The problem is, that this function uses some
- undocumented features from the NSAPI library.
-
- Under Unix this is not a problem, because the module automatically
- looks for the needed functions and uses them if available. If not,
- nsapi_virtual() is disabled.
-
- Under Windows limitations in the DLL handling need the use of a
- automatic detection of the most recent ns-httpdXX.dll file. This is
- tested for servers till version 6.1. If a newer version of the Sun
- server is used, the detection fails and nsapi_virtual() is disabled.
-
- If this is the case, try the following: Add the following parameter to
- php7_init in magnus.conf/obj.conf:
- Init fn=php7_init ... server_lib="ns-httpdXX.dll"
-
- where XX is the correct DLL version number. To get it, look in the
- server-root for the correct DLL name. The DLL with the biggest filesize
- is the right one.
-
- You can check the status by using the phpinfo() function.
-
- Note: But be warned: Support for nsapi_virtual() is EXPERIMENTAL!!!
- __________________________________________________________________
-
-OmniHTTPd Server
-
- This section contains notes and hints specific to OmniHTTPd on Windows.
-
- Note: You should read the manual installation steps first!
-
- Warning
-
- By using the CGI setup, your server is open to several possible
- attacks. Please read our CGI security section to learn how to defend
- yourself from those attacks.
-
- You need to complete the following steps to make PHP work with
- OmniHTTPd. This is a CGI executable setup. SAPI is supported by
- OmniHTTPd, but some tests have shown that it is not so stable to use
- PHP as an ISAPI module.
-
- Important for CGI users: Read the faq on cgi.force_redirect for
- important details. This directive needs to be set to 0.
-
- 1. Install OmniHTTPd server.
- 2. Right click on the blue OmniHTTPd icon in the system tray and
- select Properties
- 3. Click on Web Server Global Settings
- 4. On the 'External' tab, enter: virtual = .php | actual =
- c:\php\php.exe (use php-cgi.exe if installing PHP 7), and use the
- Add button.
- 5. On the Mime tab, enter: virtual = wwwserver/stdcgi | actual = .php,
- and use the Add button.
- 6. Click OK
-
- Repeat steps 2 - 6 for each extension you want to associate with PHP.
-
- __________________________________________________________________
-
-Xitami on Microsoft Windows
-
- This section contains notes and hints specific to Xitami on Windows.
-
- Note: You should read the manual installation steps first!
-
- This list describes how to set up the PHP CGI binary to work with
- Xitami on Windows.
-
- Important for CGI users: Read the faq on cgi.force_redirect for
- important details. This directive needs to be set to 0. If you want
- to use $_SERVER['PHP_SELF'] you have to enable the cgi.fix_pathinfo
- directive.
-
- Warning
-
- By using the CGI setup, your server is open to several possible
- attacks. Please read our CGI security section to learn how to defend
- yourself from those attacks.
-
- * Make sure the web server is running, and point your browser to
- xitamis admin console (usually http://127.0.0.1/admin), and click
- on Configuration.
- * Navigate to the Filters, and put the extension which PHP should
- parse (i.e. .php) into the field File extensions (.xxx).
- * In Filter command or script put the path and name of your PHP CGI
- executable i.e. C:\php\php-cgi.exe.
- * Press the 'Save' icon.
- * Restart the server to reflect changes.
- __________________________________________________________________
-
-Installation of extensions on Windows
-
- After installing PHP and a web server on Windows, you will probably
- want to install some extensions for added functionality. You can choose
- which extensions you would like to load when PHP starts by modifying
- your php.ini. You can also load a module dynamically in your script
- using dl().
-
- The DLLs for PHP extensions are prefixed with php_.
-
- Many extensions are built into the Windows version of PHP. This means
- additional DLL files, and the extension directive, are not used to load
- these extensions. The Windows PHP Extensions table lists extensions
- that require, or used to require, additional PHP DLL files. Here's a
- list of built in extensions:
-
- In PHP 7 (updated PHP 5.0.4), the following changes exist. Built in:
- DOM, LibXML, Iconv, SimpleXML, SPL and SQLite. And the following are no
- longer built in: MySQL and Overload.
-
- The default location PHP searches for extensions is C:\php7 in PHP 7.
- To change this setting to reflect your setup of PHP edit your php.ini
- file:
-
- * You will need to change the extension_dir setting to point to the
- directory where your extensions lives, or where you have placed
- your php_*.dll files. For example:
-
-extension_dir = C:\php\extensions
-
- * Enable the extension(s) in php.ini you want to use by uncommenting
- the extension=php_*.dll lines in php.ini. This is done by deleting
- the leading ; from the extension you want to load.
-
- Example 2-8. Enable Bzip2 extension for PHP-Windows
-// change the following line from ...
-;extension=php_bz2.dll
-
-// ... to
-extension=php_bz2.dll
-
- * Some of the extensions need extra DLLs to work. Couple of them can
- be found in the distribution package, in in the main folder in PHP 5,
- but some, for example Oracle (php_oci8.dll) require DLLs which are
- not bundled with the distribution package.
- * Some of these DLLs are not bundled with the PHP distribution. See
- each extensions documentation page for details. Also, read the
- manual section titled Installation of PECL extensions for details
- on PECL. An increasingly large number of PHP extensions are found
- in PECL, and these extensions require a separate download.
-
- Note: If you are running a server module version of PHP remember to
- restart your web server to reflect your changes to php.ini.
-
- The following table describes some of the extensions available and
- required additional dlls.
-
- Table 2-1. PHP Extensions
- Extension Description Notes
- php_bz2.dll bzip2 compression functions None
- php_calendar.dll Calendar conversion functions
- php_cpdf.dll ClibPDF functions None
- php_crack.dll Crack functions None
- php_ctype.dll ctype family functions
- php_curl.dll CURL, Client URL library functions Requires: libeay32.dll,
- ssleay32.dll (bundled)
- php_db.dll DBM functions Deprecated. Use DBA instead (php_dba.dll)
- php_dba.dll DBA: DataBase (dbm-style) Abstraction layer functions None
- php_dbase.dll dBase functions None
- php_dbx.dll dbx functions
- php_exif.dll EXIF functions php_mbstring.dll. And, php_exif.dll must be
- loaded after php_mbstring.dll in php.ini.
- php_fdf.dll FDF: Forms Data Format functions. Requires: fdftk.dll
- (bundled)
- php_filepro.dll filePro functions Read-only access
- php_ftp.dll FTP functions
- php_gd2.dll GD library image functions GD2
- php_gettext.dll Gettext functions, requires libintl-1.dll,
- iconv.dll (bundled).
- php_iconv.dll ICONV characterset conversion Requires: iconv.dll
- php_imap.dll IMAP POP3 and NNTP functions None
- php_interbase.dll InterBase functions Requires: gds32.dll (bundled)
- php_ldap.dll LDAP functions requires libeay32.dll, ssleay32.dll (bundled)
- php_mbstring.dll Multi-Byte String functions None
- php_mime_magic.dll Mimetype functions Requires: magic.mime (bundled)
- php_ming.dll Ming functions for Flash None
- php_msql.dll mSQL functions Requires: msql.dll (bundled)
- php_mssql.dll MSSQL functions Requires: ntwdblib.dll (bundled)
- php_mysql.dll MySQL functions PHP >= 5.0.0, requires libmysql.dll
- (bundled)
- php_mysqli.dll MySQLi functions PHP >= 5.0.0, requires libmysql.dll
- (libmysqli.dll in PHP <= 5.0.2) (bundled)
- php_oci8.dll Oracle 8 functions Requires: Oracle 8.1+ client libraries
- php_openssl.dll OpenSSL functions Requires: libeay32.dll (bundled)
- php_oracle.dll Oracle functions Requires: Oracle 7 client libraries
- php_pgsql.dll PostgreSQL functions None
- php_printer.dll Printer functions None
- php_shmop.dll Shared Memory functions None
- php_snmp.dll SNMP get and walk functions NT only!
- php_soap.dll SOAP functions PHP >= 5.0.0
- php_sockets.dll Socket functions None
- php_sodium.dll Sodium cryptography library PHP >= 7.2.0
- php_sybase_ct.dll Sybase functions Requires: Sybase client libraries
- php_tidy.dll Tidy functions PHP >= 5.0.0
- php_tokenizer.dll Tokenizer functions Built in since PHP 4.3.0
- php_xmlrpc.dll XML-RPC functions PHP >= 4.2.1 requires: iconv.dll
- (bundled)
- php_xslt.dll XSLT requires libxslt.dll, iconv.dll (bundled).
- php_zip.dll Zip File functions
- php_zlib.dll ZLib compression functions
- __________________________________________________________________
-
-Chapter 3. Installation of PECL extensions
-
-Introduction to PECL Installations
-
- PECL is a repository of PHP extensions that are made available to you
- via the PEAR packaging system. This section of the manual is intended
- to demonstrate how to obtain and install PECL extensions.
-
- These instructions assume /your/phpsrcdir/ is the path to the PHP
- source distribution, and that extname is the name of the PECL
- extension. Adjust accordingly. These instructions also assume a
- familiarity with the pear command. The information in the PEAR manual
- for the pear command also applies to the pecl command.
-
- To be useful, a shared extension must be built, installed, and loaded.
- The methods described below provide you with various instructions on
- how to build and install the extensions, but they do not automatically
- load them. Extensions can be loaded by adding an extension directive.
- To this php.ini file, or through the use of the dl() function.
-
- When building PHP modules, it's important to have known-good versions
- of the required tools (autoconf, automake, libtool, etc.) See the
- SVN Instructions for details on the required tools, and required
- versions.
- __________________________________________________________________
-
-Downloading PECL extensions
-
- There are several options for downloading PECL extensions, such as:
-
- * http://pecl.php.net
- The PECL web site contains information about the different
- extensions that are offered by the PHP Development Team. The
- information available here includes: ChangeLog, release notes,
- requirements and other similar details.
- * pecl download extname
- PECL extensions that have releases listed on the PECL web site are
- available for download and installation using the pecl command.
- Specific revisions may also be specified.
- * SVN
- Most PECL extensions also reside in SVN. A web-based view may be
- seen at http://svn.php.net/pecl/. To download straight from SVN,
- the following sequence of commands may be used.
-
-$ svn co http://svn.php.net/repository/pecl/<extname>/trunk
-
- * Windows downloads
- Windows users may find compiled PECL binaries by downloading the
- Collection of PECL modules from the PHP Downloads page, or by
- retrieving a PECL Snapshot or an extension DLL on PECL4WIN. To
- compile PHP under Windows, read the appropriate chapter.
- __________________________________________________________________
-
-PECL for Windows users
-
- As with any other PHP extension DLL, installation is as simple as
- copying the PECL extension DLLs into the extension_dir folder and
- loading them from php.ini. For example, add the following line to your
- php.ini:
-
- extension=php_extname.dll
-
- After doing this, restart the web server.
- __________________________________________________________________
-
-Compiling shared PECL extensions with the pecl command
-
- PECL makes it easy to create shared PHP extensions. Using the pecl
- command, do the following:
-
- $ pecl install extname
-
- This will download the source for extname, compile, and install
- extname.so into your extension_dir. extname.so may then be loaded via
- php.ini
-
- By default, the pecl command will not install packages that are marked
- with the alpha or beta state. If no stable packages are available, you
- may install a beta package using the following command:
-
- $ pecl install extname-beta
-
- You may also install a specific version using this variant:
-
- $ pecl install extname-0.1
- __________________________________________________________________
-
-Compiling shared PECL extensions with phpize
-
- Sometimes, using the pecl installer is not an option. This could be
- because you're behind a firewall, or it could be because the extension
- you want to install is not available as a PECL compatible package, such
- as unreleased extensions from SVN. If you need to build such an
- extension, you can use the lower-level build tools to perform the build
- manually.
-
- The phpize command is used to prepare the build environment for a PHP
- extension. In the following sample, the sources for an extension are in
- a directory named extname:
-
-$ cd extname
-$ phpize
-$ ./configure
-$ make
-# make install
-
- A successful install will have created extname.so and put it into the
- PHP extensions directory. You'll need to and adjust php.ini and add an
- extension=extname.so line before you can use the extension.
-
- If the system is missing the phpize command, and precompiled packages
- (like RPM's) are used, be sure to also install the appropriate devel
- version of the PHP package as they often include the phpize command
- along with the appropriate header files to build PHP and its
- extensions.
-
- Execute phpize --help to display additional usage information.
- __________________________________________________________________
-
-Compiling PECL extensions statically into PHP
-
- You might find that you need to build a PECL extension statically into
- your PHP binary. To do this, you'll need to place the extension source
- under the php-src/ext/ directory and tell the PHP build system to
- regenerate its configure script.
-
-$ cd /your/phpsrcdir/ext
-$ pecl download extname
-$ gzip -d < extname.tgz | tar -xvf -
-$ mv extname-x.x.x extname
-
- This will result in the following directory:
-
- /your/phpsrcdir/ext/extname
-
- From here, force PHP to rebuild the configure script, and then build
- PHP as normal:
-
-$ cd /your/phpsrcdir
-$ rm configure
-$ ./buildconf --force
-$ ./configure --help
-$ ./configure --with-extname --enable-someotherext --with-foobar
-$ make
-$ make install
-
- Note: To run the 'buildconf' script you need autoconf 2.13 and
- automake 1.4+ (newer versions of autoconf may work, but are not
- supported).
-
- Whether --enable-extname or --with-extname is used depends on the
- extension. Typically an extension that does not require external
- libraries uses --enable. To be sure, run the following after buildconf:
-
- $ ./configure --help | grep extname
- __________________________________________________________________
-
-Chapter 4. Problems?
-
-Read the FAQ
-
- Some problems are more common than others. The most common ones are
- listed in the PHP FAQ, part of this manual.
- __________________________________________________________________
-
-Other problems
-
- If you are still stuck, someone on the PHP installation mailing list
- may be able to help you. You should check out the archive first, in
- case someone already answered someone else who had the same problem as
- you. The archives are available from the support page on
- http://www.php.net/support.php. To subscribe to the PHP installation
- mailing list, send an empty mail to
- php-install-subscribe@lists.php.net. The mailing list address is
- php-install@lists.php.net.
-
- If you want to get help on the mailing list, please try to be precise
- and give the necessary details about your environment (which operating
- system, what PHP version, what web server, if you are running PHP as
- CGI or a server module, safe mode, etc...), and preferably enough code
- to make others able to reproduce and test your problem.
- __________________________________________________________________
-
-Bug reports
-
- If you think you have found a bug in PHP, please report it. The PHP
- developers probably don't know about it, and unless you report it,
- chances are it won't be fixed. You can report bugs using the
- bug-tracking system at http://bugs.php.net/. Please do not send bug
- reports in mailing list or personal letters. The bug system is also
- suitable to submit feature requests.
-
- Read the How to report a bug document before submitting any bug
- reports!
- __________________________________________________________________
-
-Chapter 5. Runtime Configuration
-
-The configuration file
-
- The configuration file (called php3.ini in PHP 3, and simply php.ini as
- of PHP 4) is read when PHP starts up. For the server module versions of
- PHP, this happens only once when the web server is started. For the CGI
- and CLI version, it happens on every invocation.
-
- php.ini is searched in these locations (in order):
-
- * SAPI module specific location (PHPIniDir directive in Apache 2, -c
- command line option in CGI and CLI, php_ini parameter in NSAPI,
- PHP_INI_PATH environment variable in THTTPD)
- * The PHPRC environment variable. Before PHP 5.2.0 this was checked
- after the registry key mentioned below.
- * As of PHP 5.2.0, the following registry locations are searched in
- order: HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x.y.z\IniFilePath,
- HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x.y\IniFilePath and
- HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x\IniFilePath, where x, y and z
- mean the PHP major, minor and release versions.
- * HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath (Windows Registry
- location)
- * Current working directory (except CLI)
- * The web server's directory (for SAPI modules), or directory of PHP
- (otherwise in Windows)
- * Windows directory (C:\windows or C:\winnt) (for Windows), or
- --with-config-file-path compile time option
-
- If php-SAPI.ini exists (where SAPI is used SAPI, so the filename is
- e.g. php-cli.ini or php-apache.ini), it's used instead of php.ini. SAPI
- name can be determined by php_sapi_name().
-
- Note: The Apache web server changes the directory to root at startup
- causing PHP to attempt to read php.ini from the root filesystem if
- it exists.
-
- The php.ini directives handled by extensions are documented
- respectively on the pages of the extensions themselves. The list of the
- core directives is available in the appendix. Probably not all PHP
- directives are documented in the manual though. For a complete list of
- directives available in your PHP version, please read your well
- commented php.ini file. Alternatively, you may find the latest
- php.ini from SVN helpful too.
-
- Example 5-1. php.ini example
-; any text on a line after an unquoted semicolon (;) is ignored
-[php] ; section markers (text within square brackets) are also ignored
-; Boolean values can be set to either:
-; true, on, yes
-; or false, off, no, none
-html_errors = off
-track_errors = yes
-
-; you can enclose strings in double-quotes
-include_path = ".:/usr/local/lib/php"
-
-; backslashes are treated the same as any other character
-include_path = ".;c:\php\lib"
-
- Since PHP 5.1.0, it is possible to refer to existing .ini variables
- from within .ini files. Example: open_basedir = ${open_basedir}
- ":/new/dir".
- __________________________________________________________________
-
-How to change configuration settings
-
-Running PHP as an Apache module
-
- When using PHP as an Apache module, you can also change the
- configuration settings using directives in Apache configuration files
- (e.g. httpd.conf) and .htaccess files. You will need "AllowOverride
- Options" or "AllowOverride All" privileges to do so.
-
- With PHP 4 and PHP 7, there are several Apache directives that allow
- you to change the PHP configuration from within the Apache
- configuration files. For a listing of which directives are PHP_INI_ALL,
- PHP_INI_PERDIR, or PHP_INI_SYSTEM, have a look at the List of php.ini
- directives appendix.
-
- Note: With PHP 3, there are Apache directives that correspond to
- each configuration setting in the php3.ini name, except the name is
- prefixed by "php3_".
-
- php_value name value
- Sets the value of the specified directive. Can be used only with
- PHP_INI_ALL and PHP_INI_PERDIR type directives. To clear a
- previously set value use none as the value.
-
- Note: Don't use php_value to set boolean values. php_flag (see
- below) should be used instead.
-
- php_flag name on|off
- Used to set a boolean configuration directive. Can be used only
- with PHP_INI_ALL and PHP_INI_PERDIR type directives.
-
- php_admin_value name value
- Sets the value of the specified directive. This can not be used
- in .htaccess files. Any directive type set with php_admin_value
- can not be overridden by .htaccess or virtualhost directives. To
- clear a previously set value use none as the value.
-
- php_admin_flag name on|off
- Used to set a boolean configuration directive. This can not be
- used in .htaccess files. Any directive type set with
- php_admin_flag can not be overridden by .htaccess or virtualhost
- directives.
-
- Example 5-2. Apache configuration example
-<IfModule mod_php7.c>
- php_value include_path ".:/usr/local/lib/php"
- php_admin_flag engine on
-</IfModule>
-
- Caution
-
- PHP constants do not exist outside of PHP. For example, in httpd.conf
- you can not use PHP constants such as E_ALL or E_NOTICE to set the
- error_reporting directive as they will have no meaning and will
- evaluate to 0. Use the associated bitmask values instead. These
- constants can be used in php.ini
- __________________________________________________________________
-
-Changing PHP configuration via the Windows registry
-
- When running PHP on Windows, the configuration values can be modified
- on a per-directory basis using the Windows registry. The configuration
- values are stored in the registry key HKLM\SOFTWARE\PHP\Per Directory
- Values, in the sub-keys corresponding to the path names. For example,
- configuration values for the directory c:\inetpub\wwwroot would be
- stored in the key HKLM\SOFTWARE\PHP\Per Directory
- Values\c\inetpub\wwwroot. The settings for the directory would be
- active for any script running from this directory or any subdirectory
- of it. The values under the key should have the name of the PHP
- configuration directive and the string value. PHP constants in the
- values are not parsed. However, only configuration values changeable in
- PHP_INI_USER can be set this way, PHP_INI_PERDIR values can not.
- __________________________________________________________________
-
-Other interfaces to PHP
-
- Regardless of how you run PHP, you can change certain values at runtime
- of your scripts through ini_set(). See the documentation on the
- ini_set() page for more information.
-
- If you are interested in a complete list of configuration settings on
- your system with their current values, you can execute the phpinfo()
- function, and review the resulting page. You can also access the values
- of individual configuration directives at runtime using ini_get() or
- get_cfg_var().
- __________________________________________________________________
-
-Chapter 6. Installation FAQ
-
- This section holds common questions about the way to install PHP. PHP
- is available for almost any OS (except maybe for MacOS before OSX), and
- almost any web server.
-
- To install PHP, follow the instructions in Installing PHP.
-
- 1. Why shouldn't I use Apache2 with a threaded MPM in a production
- environment?
-
- 2. Unix/Windows: Where should my php.ini file be located?
- 3. Unix: I installed PHP, but every time I load a document, I get the
- message 'Document Contains No Data'! What's going on here?
-
- 4. Unix: I installed PHP using RPMS, but Apache isn't processing the
- PHP pages! What's going on here?
-
- 5. Unix: I installed PHP 3 using RPMS, but it doesn't compile with the
- database support I need! What's going on here?
-
- 6. Unix: I patched Apache with the FrontPage extensions patch, and
- suddenly PHP stopped working. Is PHP incompatible with the
- Apache FrontPage extensions?
-
- 7. Unix/Windows: I have installed PHP, but when I try to access a PHP
- script file via my browser, I get a blank screen.
-
- 8. Unix/Windows: I have installed PHP, but when try to access a PHP
- script file via my browser, I get a server 500 error.
-
- 9. Some operating systems: I have installed PHP without errors, but
- when I try to start apache I get undefined symbol errors:
-
-[mybox:user /src/php7] root# apachectl configtest
- apachectl: /usr/local/apache/bin/httpd Undefined symbols:
- _compress
- _uncompress
-
- 10. Windows: I have installed PHP, but when I to access a PHP script
- file via my browser, I get the error:
-
-cgi error:
- The specified CGI application misbehaved by not
- returning a complete set of HTTP headers.
- The headers it did return are:
-
- 11. Windows: I've followed all the instructions, but still can't get
- PHP and IIS to work together!
-
- 12. When running PHP as CGI with IIS, OmniHTTPD or Xitami, I get
- the following error: Security Alert! PHP CGI cannot be accessed
- directly..
-
- 13. How do I know if my php.ini is being found and read? It seems like
- it isn't as my changes aren't being implemented.
-
- 14. How do I add my PHP directory to the PATH on Windows?
- 15. How do I make the php.ini file available to PHP on windows?
- 16. Is it possible to use Apache content negotiation (MultiViews
- option) with PHP?
-
- 17. Is PHP limited to process GET and POST request methods only?
-
- 1. Why shouldn't I use Apache2 with a threaded MPM in a production
- environment?
-
- PHP is glue. It is the glue used to build cool web applications by
- sticking dozens of 3rd-party libraries together and making it all
- appear as one coherent entity through an intuitive and easy to learn
- language interface. The flexibility and power of PHP relies on the
- stability and robustness of the underlying platform. It needs a working
- OS, a working web server and working 3rd-party libraries to glue
- together. When any of these stop working PHP needs ways to identify the
- problems and fix them quickly. When you make the underlying framework
- more complex by not having completely separate execution threads,
- completely separate memory segments and a strong sandbox for each
- request to play in, feet of clay are introduced into PHP's system.
-
- If you feel you have to use a threaded MPM, look at a FastCGI
- configuration where PHP is running in its own memory space.
-
- And finally, this warning against using a threaded MPM is not as strong
- for Windows systems because most libraries on that platform tend to be
- threadsafe.
-
- 2. Unix/Windows: Where should my php.ini file be located?
-
- By default on Unix it should be in /usr/local/lib which is
- <install-path>/lib. Most people will want to change this at
- compile-time with the --with-config-file-path flag. You would, for
- example, set it with something like:
- --with-config-file-path=/etc
-
- And then you would copy php.ini-production from the distribution to
- /etc/php.ini and edit it to make any local changes you want.
- --with-config-file-scan-dir=PATH
-
- On Windows the default path for the php.ini file is the Windows
- directory. If you're using the Apache webserver, php.ini is first
- searched in the Apaches install directory, e.g. c:\program files\apache
- group\apache. This way you can have different php.ini files for
- different versions of Apache on the same machine.
-
- See also the chapter about the configuration file.
-
- 3. Unix: I installed PHP, but every time I load a document, I get the
- message 'Document Contains No Data'! What's going on here?
-
- This probably means that PHP is having some sort of problem and is
- core-dumping. Look in your server error log to see if this is the case,
- and then try to reproduce the problem with a small test case. If you
- know how to use 'gdb', it is very helpful when you can provide a
- backtrace with your bug report to help the developers pinpoint the
- problem. If you are using PHP as an Apache module try something like:
-
- * Stop your httpd processes
- * gdb httpd
- * Stop your httpd processes
- * > run -X -f /path/to/httpd.conf
- * Then fetch the URL causing the problem with your browser
- * > run -X -f /path/to/httpd.conf
- * If you are getting a core dump, gdb should inform you of this now
- * type: bt
- * You should include your backtrace in your bug report. This should
- be submitted to http://bugs.php.net/
-
- If your script uses the regular expression functions (ereg() and
- friends), you should make sure that you compiled PHP and Apache with
- the same regular expression package. This should happen automatically
- with PHP and Apache 1.3.x
-
- 4. Unix: I installed PHP using RPMS, but Apache isn't processing the
- PHP pages! What's going on here?
-
- Assuming you installed both Apache and PHP from RPM packages, you need
- to uncomment or add some or all of the following lines in your
- httpd.conf file:
-# Extra Modules
-AddModule mod_php.c
-AddModule mod_php3.c
-AddModule mod_perl.c
-
-# Extra Modules
-LoadModule php_module modules/mod_php.so
-LoadModule perl_module modules/libperl.so
-
- And add:
-AddType application/x-httpd-php3 .php3 # for PHP 3
-AddType application/x-httpd-php .php # for PHP 4
-
- ... to the global properties, or to the properties of the VirtualDomain
- you want to have PHP support added to.
-
- 5. Unix: I installed PHP 3 using RPMS, but it doesn't compile with the
- database support I need! What's going on here?
-
- Due to the way PHP 3 built, it is not easy to build a complete flexible
- PHP RPM. This issue is addressed in PHP 4. For PHP 3, we currently
- suggest you use the mechanism described in the INSTALL.REDHAT file in
- the PHP distribution. If you insist on using an RPM version of PHP 3,
- read on...
-
- The RPM packagers are setting up the RPMS to install without database
- support to simplify installations and because RPMS use /usr/ instead of
- the standard /usr/local/ directory for files. You need to tell the RPM
- spec file which databases to support and the location of the top-level
- of your database server.
-
- This example will explain the process of adding support for the popular
- MySQL database server, using the mod installation for Apache.
-
- Of course all of this information can be adjusted for any database
- server that PHP supports. We will assume you installed MySQL and Apache
- completely with RPMS for this example as well.
-
- * First remove mod_php3 :
-
-rpm -e mod_php3
-
- * Then get the source rpm and INSTALL it, NOT --rebuild
-
-rpm -Uvh mod_php3-3.0.5-2.src.rpm
-
- * Then edit the /usr/src/redhat/SPECS/mod_php3.spec file
- In the %build section add the database support you want, and the
- path.
- For MySQL you would add --with-mysql=/usr The %build section will
- look something like this:
-
-./configure --prefix=/usr \
---with-apxs=/usr/sbin/apxs \
---with-config-file-path=/usr/lib \
---enable-debug=no \
---enable-safe-mode \
---with-exec-dir=/usr/bin \
---with-mysql=/usr \
---with-system-regex
-
- * Once this modification is made then build the binary rpm as
- follows:
-
-rpm -bb /usr/src/redhat/SPECS/mod_php3.spec
-
- * Then install the rpm
-
-rpm -ivh /usr/src/redhat/RPMS/i386/mod_php3-3.0.5-2.i386.rpm
-
- Make sure you restart Apache, and you now have PHP 3 with MySQL support
- using RPM's. Note that it is probably much easier to just build from
- the distribution tarball of PHP 3 and follow the instructions in
- INSTALL.REDHAT found in that distribution.
-
- 6. Unix: I patched Apache with the FrontPage extensions patch, and
- suddenly PHP stopped working. Is PHP incompatible with the Apache
- FrontPage extensions?
-
- No, PHP works fine with the FrontPage extensions. The problem is that
- the FrontPage patch modifies several Apache structures, that PHP relies
- on. Recompiling PHP (using 'make clean ; make') after the FP patch is
- applied would solve the problem.
-
- 7. Unix/Windows: I have installed PHP, but when I try to access a PHP
- script file via my browser, I get a blank screen.
-
- Do a 'view source' in the web browser and you will probably find that
- you can see the source code of your PHP script. This means that the web
- server did not send the script to PHP for interpretation. Something is
- wrong with the server configuration - double check the server
- configuration against the PHP installation instructions.
-
- 8. Unix/Windows: I have installed PHP, but when try to access a PHP
- script file via my browser, I get a server 500 error.
-
- Something went wrong when the server tried to run PHP. To get to see a
- sensible error message, from the command line, change to the directory
- containing the PHP executable (php.exe on Windows) and run php -i. If
- PHP has any problems running, then a suitable error message will be
- displayed which will give you a clue as to what needs to be done next.
- If you get a screen full of HTML codes (the output of the phpinfo()
- function) then PHP is working, and your problem may be related to your
- server configuration which you should double check.
-
- 9. Some operating systems: I have installed PHP without errors, but
- when I try to start apache I get undefined symbol errors:
-[mybox:user /src/php7] root# apachectl configtest
- apachectl: /usr/local/apache/bin/httpd Undefined symbols:
- _compress
- _uncompress
-
- This has actually nothing to do with PHP, but with the MySQL client
- libraries. Some need --with-zlib, others do not. This is also covered
- in the MySQL FAQ.
-
- 10. Windows: I have installed PHP, but when I to access a PHP script
- file via my browser, I get the error:
-cgi error:
- The specified CGI application misbehaved by not
- returning a complete set of HTTP headers.
- The headers it did return are:
-
- This error message means that PHP failed to output anything at all. To
- get to see a sensible error message, from the command line, change to
- the directory containing the PHP executable (php.exe on Windows) and
- run php -i. If PHP has any problems running, then a suitable error
- message will be displayed which will give you a clue as to what needs
- to be done next. If you get a screen full of HTML codes (the output of
- the phpinfo() function) then PHP is working.
-
- Once PHP is working at the command line, try accessing the script via
- the browser again. If it still fails then it could be one of the
- following:
-
- * File permissions on your PHP script, php.exe, php7ts.dll, php.ini
- or any PHP extensions you are trying to load are such that the
- anonymous internet user ISUR_<machinename> cannot access them.
- * The script file does not exist (or possibly isn't where you think
- it is relative to your web root directory). Note that for IIS you
- can trap this error by ticking the 'check file exists' box when
- setting up the script mappings in the Internet Services Manager. If
- a script file does not exist then the server will return a 404
- error instead. There is also the additional benefit that IIS will
- do any authentication required for you based on the NTLanMan
- permissions on your script file.
-
- 11. Windows: I've followed all the instructions, but still can't get
- PHP and IIS to work together!
-
- Make sure any user who needs to run a PHP script has the rights to run
- php.exe! IIS uses an anonymous user which is added at the time IIS is
- installed. This user needs rights to php.exe. Also, any authenticated
- user will also need rights to execute php.exe. And for IIS4 you need to
- tell it that PHP is a script engine. Also, you will want to read this
- faq.
-
- 12. When running PHP as CGI with IIS, OmniHTTPD or Xitami, I get
- the following error: Security Alert! PHP CGI cannot be accessed
- directly..
-
- You must set the cgi.force_redirect directive to 0. It defaults to 1 so
- be sure the directive isn't commented out (with a ;). Like all
- directives, this is set in php.ini
-
- Because the default is 1, it's critical that you're 100% sure that the
- correct php.ini file is being read. Read this faq for details.
-
- 13. How do I know if my php.ini is being found and read? It seems like
- it isn't as my changes aren't being implemented.
-
- To be sure your php.ini is being read by PHP, make a call to phpinfo()
- and near the top will be a listing called Configuration File (php.ini).
- This will tell you where PHP is looking for php.ini and whether or not
- it's being read. If just a directory PATH exists than it's not being
- read and you should put your php.ini in that directory. If php.ini is
- included within the PATH than it is being read.
-
- If php.ini is being read and you're running PHP as a module, then be
- sure to restart your web server after making changes to php.ini
-
- 14. How do I add my PHP directory to the PATH on Windows?
-
- On Windows NT, 2000, XP and 2003:
-
- * Go to Control Panel and open the System icon (Start -> Settings ->
- Control Panel -> System, or just Start -> Control Panel -> System
- for Windows XP/2003)
- * Go to the Advanced tab
- * Click on the 'Environment Variables' button
- * Look into the 'System Variables' pane
- * Find the Path entry (you may need to scroll to find it)
- * Double click on the Path entry
- * Enter your PHP directory at the end, including ';' before (e.g.
- ;C:\php)
- * Press OK and restart your computer
-
- On Windows 98/Me you need to edit the autoexec.bat file:
-
- * Open the Notepad (Start -> Run and enter notepad)
- * Open the C:\autoexec.bat file
- * Locate the line with PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;..... and
- add: ;C:\php to the end of the line
- * Save the file and restart your computer
-
- Note: Be sure to reboot after following the steps above to ensure
- that the PATH changes are applied.
-
- The PHP manual used to promote the copying of files into the Windows
- system directory, this is because this directory (C:\Windows, C:\WINNT,
- etc.) is by default in the systems PATH. Copying files into the Windows
- system directory has long since been deprecated and may cause problems.
-
- 15. How do I make the php.ini file available to PHP on windows?
-
- There are several ways of doing this. If you are using Apache, read
- their installation specific instructions (Apache 1, Apache 2),
- otherwise you must set the PHPRC environment variable:
-
- On Windows NT, 2000, XP and 2003:
-
- * Go to Control Panel and open the System icon (Start -> Settings ->
- Control Panel -> System, or just Start -> Control Panel -> System
- for Windows XP/2003)
- * Go to the Advanced tab
- * Click on the 'Environment Variables' button
- * Look into the 'System variables' pane
- * Click on 'New' and enter 'PHPRC' as the variable name and the
- directory where php.ini is located as the variable value (e.g.
- C:\php)
- * Press OK and restart your computer
-
- On Windows 98/Me you need to edit the autoexec.bat file:
-
- * Open the Notepad (Start -> Run and enter notepad)
- * Open the C:\autoexec.bat file
- * Add a new line to the end of the file: set PHPRC=C:\php (replace
- C:\php with the directory where php.ini is located). Please note
- that the path cannot contain spaces. For instance, if you have
- installed PHP in C:\Program Files\PHP, you would enter
- C:\PROGRA~1\PHP instead.
- * Save the file and restart your computer
-
- 16. Is it possible to use Apache content negotiation (MultiViews
- option) with PHP?
-
- If links to PHP files include extension, everything works perfect. This
- FAQ is only for the case when links to PHP files don't include
- extension and you want to use content negotiation to choose PHP files
- from URL with no extension. In this case, replace the line AddType
- application/x-httpd-php .php with:
-# PHP 4
-AddHandler php-script php
-AddType text/html php
-
-# PHP 7
-AddHandler php7-script php
-AddType text/html php
-
- This solution doesn't work for Apache 1 as PHP module doesn't catch
- php-script.
-
- 17. Is PHP limited to process GET and POST request methods only?
-
- No, it is possible to handle any request method, e.g. CONNECT. Proper
- response status can be sent with header(). If only GET and POST methods
- should be handled, it can be achieved with this Apache configuration:
-<LimitExcept GET POST>
-Deny from all
-</LimitExcept>
diff --git a/win32/ioutil.c b/win32/ioutil.c
index 7eeddfbb70..f541b0df36 100644
--- a/win32/ioutil.c
+++ b/win32/ioutil.c
@@ -587,6 +587,8 @@ BOOL php_win32_ioutil_init(void)
if (!canonicalize_path_w) {
canonicalize_path_w = (MyPathCchCanonicalizeEx)MyPathCchCanonicalizeExFallback;
}
+
+ FreeLibrary(hMod);
} else {
canonicalize_path_w = (MyPathCchCanonicalizeEx)MyPathCchCanonicalizeExFallback;
}
diff --git a/win32/select.c b/win32/select.c
index bdc53e8181..33e5fb2aa2 100644
--- a/win32/select.c
+++ b/win32/select.c
@@ -66,7 +66,7 @@ PHPAPI int php_select(php_socket_t max_fd, fd_set *rfds, fd_set *wfds, fd_set *e
FD_ZERO(&sock_except);
/* build an array of handles for non-sockets */
- for (i = 0; i < max_fd; i++) {
+ for (i = 0; (uint32_t)i < max_fd; i++) {
if (SAFE_FD_ISSET(i, rfds) || SAFE_FD_ISSET(i, wfds) || SAFE_FD_ISSET(i, efds)) {
handles[n_handles] = (HANDLE)(zend_uintptr_t)_get_osfhandle(i);
if (handles[n_handles] == INVALID_HANDLE_VALUE) {
diff --git a/win32/syslog.h b/win32/syslog.h
index 104c4b75ff..3220ed66b6 100644
--- a/win32/syslog.h
+++ b/win32/syslog.h
@@ -73,6 +73,7 @@
extern void closelog(void);
extern void openlog(const char *, int, int);
extern void syslog(int, const char *, ...);
+extern void vsyslog(int, const char *, va_list ap);
#endif /* SYSLOG_H */
diff --git a/win32/wsyslog.c b/win32/wsyslog.c
index 6b0f03e8ea..e13ef05d87 100644
--- a/win32/wsyslog.c
+++ b/win32/wsyslog.c
@@ -58,6 +58,7 @@
#include "php_win32_globals.h"
#include "wsyslog.h"
+#include "codepage.h"
void closelog(void)
{
@@ -80,10 +81,19 @@ void closelog(void)
void syslog(int priority, const char *message, ...)
{
va_list args;
+
+ va_start(args, message); /* initialize vararg mechanism */
+ vsyslog(priority, message, args);
+ va_end(args);
+}
+
+void vsyslog(int priority, const char *message, va_list args)
+{
LPTSTR strs[2];
unsigned short etype;
char *tmp = NULL;
DWORD evid;
+ wchar_t *strsw[2];
/* default event source */
if (INVALID_HANDLE_VALUE == PW32G(log_source))
@@ -102,13 +112,28 @@ void syslog(int priority, const char *message, ...)
etype = EVENTLOG_WARNING_TYPE;
evid = PHP_SYSLOG_WARNING_TYPE;
}
- va_start(args, message); /* initialize vararg mechanism */
+
vspprintf(&tmp, 0, message, args); /* build message */
+
+ strsw[0] = php_win32_cp_any_to_w(PW32G(log_header));
+ strsw[1] = php_win32_cp_any_to_w(tmp);
+
+ /* report the event */
+ if (strsw[0] && strsw[1]) {
+ ReportEventW(PW32G(log_source), etype, (unsigned short) priority, evid, NULL, 2, 0, strsw, NULL);
+ free(strsw[0]);
+ free(strsw[1]);
+ efree(tmp);
+ return;
+ }
+
+ free(strsw[0]);
+ free(strsw[1]);
+
strs[0] = PW32G(log_header); /* write header */
strs[1] = tmp; /* then the message */
- /* report the event */
- ReportEvent(PW32G(log_source), etype, (unsigned short) priority, evid, NULL, 2, 0, strs, NULL);
- va_end(args);
+
+ ReportEventA(PW32G(log_source), etype, (unsigned short) priority, evid, NULL, 2, 0, strs, NULL);
efree(tmp);
}
@@ -127,7 +152,6 @@ void openlog(const char *ident, int logopt, int facility)
PW32G(log_source) = RegisterEventSource(NULL, "PHP-" PHP_VERSION);
spprintf(&PW32G(log_header), 0, (logopt & LOG_PID) ? "%s[%d]" : "%s", ident, getpid());
}
-
/*
* Local variables:
* tab-width: 4