summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Lytochkin <lytboris@php.net>2013-06-16 00:03:30 +0400
committerBoris Lytochkin <lytboris@php.net>2013-06-16 00:03:30 +0400
commit8acfa0b3f8e10780c1f1a3f07c2b8466c289b9bb (patch)
treeb012173b91ab6313cab0a3be5fafc95812f7e2d3
parent8c3b8f39aa00fb4a24191d9f846cd2f4006cf23d (diff)
parent02f552cecadf7fa0a77f179e02f4dcb33b267105 (diff)
downloadphp-git-8acfa0b3f8e10780c1f1a3f07c2b8466c289b9bb.tar.gz
Merge branch 'PHP-5.4' of https://git.php.net/push/php-src into PHP-5.4
* 'PHP-5.4' of https://git.php.net/push/php-src: (76 commits) Fixed bug #63186 (compile failure on netbsd) fix test for bug #60322 ensure the error_reporting level to get expected notice fixed tests missing tests for bug #53437 fix double entry Merge branch 'pull-request/341' typo fixes (argument) typo fixes (accommodate, parameter) missing colon Backported the fix for bug #53437 Backported the fix for bug #53437 Fixed bug #64988 (Class loading order affects E_STRICT warning) Fixed test script PHPTests for the DOMDocument::loadHTMLfile method. They cover - The basic behaviour - When the method receives as argument a file which doesn't exist - When the argument is an empty string - When an empty file is loaded - When a not-well formed html file is loaded Fix spelling and correct typo. Callback has to be restored in MSHUTDOWN Update NEWs Fixed bug #64997 (Segfault while using RecursiveIteratorIterator on 64-bits systems) Fixed merge wrongly ...
-rw-r--r--NEWS71
-rw-r--r--README.PARAMETER_PARSING_API2
-rw-r--r--README.TESTING2
-rw-r--r--Zend/ZEND_CHANGES2
-rw-r--r--Zend/tests/019.phpt2
-rw-r--r--Zend/tests/bug32428.phpt2
-rw-r--r--Zend/tests/bug64660.phpt11
-rw-r--r--Zend/tests/bug64720.phpt48
-rw-r--r--Zend/tests/bug64821.1.phpt22
-rw-r--r--Zend/tests/bug64821.2.phpt19
-rw-r--r--Zend/tests/bug64821.3.phpt20
-rw-r--r--Zend/tests/bug64960.phpt40
-rw-r--r--Zend/tests/bug64966.phpt30
-rw-r--r--Zend/tests/bug64988.phpt30
-rw-r--r--Zend/tests/gc_007.phpt2
-rw-r--r--Zend/tests/gc_008.phpt2
-rw-r--r--Zend/tests/gc_009.phpt2
-rw-r--r--Zend/zend_API.c2
-rw-r--r--Zend/zend_API.h6
-rw-r--r--Zend/zend_compile.c10
-rw-r--r--Zend/zend_exceptions.c10
-rw-r--r--Zend/zend_execute_API.c6
-rw-r--r--Zend/zend_gc.h4
-rw-r--r--Zend/zend_language_scanner.c6
-rw-r--r--Zend/zend_language_scanner.l4
-rw-r--r--Zend/zend_object_handlers.c8
-rw-r--r--Zend/zend_opcode.c3
-rw-r--r--Zend/zend_operators.c2
-rw-r--r--Zend/zend_vm_def.h2
-rw-r--r--Zend/zend_vm_execute.h2
-rw-r--r--acinclude.m42
-rwxr-xr-xbuild/shtool4
-rw-r--r--configure.in2
-rw-r--r--ext/bz2/bz2.c2
-rw-r--r--ext/calendar/jewish.c3
-rw-r--r--ext/calendar/tests/jdtojewish64.phpt19
-rw-r--r--ext/com_dotnet/com_variant.c2
-rw-r--r--ext/date/php_date.c317
-rw-r--r--ext/date/php_date.h2
-rw-r--r--ext/date/tests/bug45682.phpt18
-rw-r--r--ext/date/tests/bug48678.phpt18
-rw-r--r--ext/date/tests/bug49081.phpt7
-rw-r--r--ext/date/tests/bug49778.phpt16
-rw-r--r--ext/date/tests/bug52113.phpt161
-rw-r--r--ext/date/tests/bug52738.phpt7
-rw-r--r--ext/date/tests/bug52808.phpt48
-rw-r--r--ext/date/tests/bug53437.phpt134
-rw-r--r--ext/date/tests/bug53437_var1.phpt13
-rw-r--r--ext/date/tests/bug53437_var2.phpt80
-rw-r--r--ext/date/tests/bug53437_var3.phpt47
-rw-r--r--ext/date/tests/bug53437_var4.phpt64
-rw-r--r--ext/date/tests/bug53437_var5.phpt47
-rw-r--r--ext/date/tests/date_diff1.phpt16
-rw-r--r--ext/date/tests/date_sunrise_and_sunset_basic.phpt2
-rw-r--r--ext/dba/tests/dba_cdb_read.phpt2
-rw-r--r--ext/dom/element.c2
-rw-r--r--ext/dom/tests/DOMDocument_loadHTMLfile.phpt17
-rw-r--r--ext/dom/tests/DOMDocument_loadHTMLfile_error1.phpt18
-rw-r--r--ext/dom/tests/DOMDocument_loadHTMLfile_error2.phpt18
-rw-r--r--ext/dom/tests/DOMDocument_loadHTMLfile_variation1.phpt18
-rw-r--r--ext/dom/tests/DOMDocument_loadHTMLfile_variation2.phpt17
-rw-r--r--ext/dom/tests/DOMNode_removeChild_basic.phpt4
-rw-r--r--ext/dom/tests/empty.html0
-rw-r--r--ext/dom/tests/not_well.html8
-rw-r--r--ext/enchant/enchant.c2
-rw-r--r--ext/exif/tests/exif_tagname_variation1.phpt2
-rw-r--r--ext/fileinfo/libmagic.patch10
-rw-r--r--ext/fileinfo/libmagic/softmagic.c2
-rw-r--r--ext/fileinfo/tests/finfo_file_002.phpt4
-rw-r--r--ext/fileinfo/tests/finfo_phpinfo_basic.phpt2
-rw-r--r--ext/fileinfo/tests/magic6
-rw-r--r--ext/fileinfo/tests/resources/test.mp3bin0 -> 25801 bytes
-rw-r--r--ext/filter/tests/bug49510.phpt4
-rw-r--r--ext/gd/tests/imagecopyresampled_basic.phpt6
-rw-r--r--ext/hash/tests/mhash_002.phpt2
-rw-r--r--ext/imap/tests/imap_include.inc2
-rw-r--r--ext/interbase/tests/005.phpt4
-rw-r--r--ext/intl/doc/Tutorial.txt2
-rw-r--r--ext/intl/doc/grapheme_api.php4
-rw-r--r--ext/intl/doc/msgfmt_api.php4
-rw-r--r--ext/intl/tests/badargs.phpt2
-rw-r--r--ext/libxml/tests/bug61367-read.phpt2
-rw-r--r--ext/mbstring/README_PHP3-i18n-ja2
-rw-r--r--ext/mbstring/libmbfl/filters/unicode_table_jis2004.h2
-rw-r--r--ext/mbstring/oniguruma/HISTORY2
-rw-r--r--ext/mbstring/php_mbregex.c2
-rw-r--r--ext/mbstring/tests/mb_str_functions_opt-parameter.phpt2
-rw-r--r--ext/mysql/php_mysql.c2
-rw-r--r--ext/mysqli/tests/bug34810.phpt2
-rw-r--r--ext/mysqlnd/mysqlnd.c2
-rw-r--r--ext/mysqlnd/mysqlnd_result.c4
-rw-r--r--ext/oci8/package.xml2
-rw-r--r--ext/oci8/tests/conn_attr.inc2
-rw-r--r--ext/oci8/tests/conn_attr_4.phpt6
-rw-r--r--ext/odbc/php_odbc_includes.h2
-rw-r--r--ext/openssl/tests/openssl.cnf2
-rw-r--r--ext/openssl/xp_ssl.c2
-rw-r--r--ext/pcre/pcrelib/ChangeLog2
-rw-r--r--ext/pcre/pcrelib/NEWS2
-rw-r--r--ext/pcre/pcrelib/pcre_compile.c2
-rw-r--r--ext/pcre/tests/preg_replace_basic.phpt2
-rw-r--r--ext/pcre/tests/preg_replace_edit_basic.phpt2
-rw-r--r--ext/pcre/tests/preg_split_basic.phpt2
-rw-r--r--ext/pdo/pdo_sql_parser.c4
-rw-r--r--ext/pdo/pdo_sql_parser.re4
-rw-r--r--ext/pdo/php_pdo_driver.h2
-rw-r--r--ext/pdo/tests/bug61292.phpt9
-rw-r--r--ext/pdo_dblib/dblib_driver.c103
-rw-r--r--ext/pdo_dblib/dblib_stmt.c99
-rw-r--r--ext/pdo_dblib/pdo_dblib.c8
-rw-r--r--ext/pdo_dblib/php_pdo_dblib_int.h8
-rw-r--r--ext/pdo_firebird/firebird_statement.c11
-rw-r--r--ext/pdo_firebird/tests/bug_62024.phpt51
-rw-r--r--ext/pdo_firebird/tests/bug_64037.phpt45
-rw-r--r--ext/pdo_pgsql/pgsql_driver.c2
-rw-r--r--ext/pdo_pgsql/tests/copy_from.phpt8
-rw-r--r--ext/pdo_pgsql/tests/is_in_transaction.phpt8
-rw-r--r--ext/pgsql/README2
-rw-r--r--ext/pgsql/pgsql.c41
-rw-r--r--ext/pgsql/tests/10pg_convert_85.phpt1
-rw-r--r--ext/pgsql/tests/12pg_insert_85.phpt2
-rw-r--r--ext/pgsql/tests/14pg_update_85.phpt2
-rw-r--r--ext/pgsql/tests/18pg_escape_bytea.phpt3
-rw-r--r--ext/pgsql/tests/bug64609.phpt30
-rw-r--r--ext/phar/func_interceptors.c2
-rw-r--r--ext/phar/phar_object.c12
-rw-r--r--ext/phar/tar.c25
-rw-r--r--ext/phar/tests/files/openssl.cnf2
-rw-r--r--ext/phar/util.c8
-rw-r--r--ext/phar/zip.c31
-rw-r--r--ext/posix/config.m42
-rw-r--r--ext/session/session.c3
-rw-r--r--ext/shmop/README6
-rw-r--r--ext/snmp/snmp.c6
-rw-r--r--ext/soap/TODO2
-rw-r--r--ext/soap/TODO.old4
-rw-r--r--ext/soap/interop/client_round2_params.php2
-rw-r--r--ext/soap/php_http.c2
-rw-r--r--ext/soap/php_sdl.c4
-rw-r--r--ext/soap/soap.c10
-rw-r--r--ext/soap/tests/bugs/bug27742.wsdl4
-rw-r--r--ext/sockets/sockets.c6
-rw-r--r--ext/spl/internal/cachingiterator.inc2
-rw-r--r--ext/spl/spl_iterators.c19
-rw-r--r--ext/spl/tests/iterator_031.phpt2
-rw-r--r--ext/spl/tests/spl_004.phpt6
-rw-r--r--ext/sqlite3/libsqlite/sqlite3.c76
-rw-r--r--ext/sqlite3/sqlite3.c2
-rw-r--r--ext/standard/browscap.c21
-rw-r--r--ext/standard/filestat.c2
-rw-r--r--ext/standard/ftp_fopen_wrapper.c4
-rw-r--r--ext/standard/image.c2
-rw-r--r--ext/standard/quot_print.c4
-rw-r--r--ext/standard/streamsfuncs.c23
-rw-r--r--ext/standard/tests/array/009.phpt2
-rw-r--r--ext/standard/tests/array/array_combine_variation3.phpt2
-rw-r--r--ext/standard/tests/array/array_fill_basic.phpt2
-rw-r--r--ext/standard/tests/array/array_fill_keys_error.phpt4
-rw-r--r--ext/standard/tests/array/array_fill_variation4.phpt2
-rw-r--r--ext/standard/tests/array/array_intersect_assoc_variation3.phpt2
-rw-r--r--ext/standard/tests/array/array_intersect_assoc_variation4.phpt2
-rw-r--r--ext/standard/tests/array/array_intersect_variation3.phpt2
-rw-r--r--ext/standard/tests/array/array_intersect_variation4.phpt2
-rw-r--r--ext/standard/tests/array/array_key_exists.phpt2
-rw-r--r--ext/standard/tests/array/array_merge.phpt2
-rw-r--r--ext/standard/tests/array/array_merge_recursive_variation3.phpt2
-rw-r--r--ext/standard/tests/array/array_pad_variation6.phpt2
-rw-r--r--ext/standard/tests/array/array_unique_variation2.phpt2
-rw-r--r--ext/standard/tests/array/array_unshift_variation9.phpt2
-rw-r--r--ext/standard/tests/array/array_walk_basic2.phpt2
-rw-r--r--ext/standard/tests/array/array_walk_error2.phpt2
-rw-r--r--ext/standard/tests/array/array_walk_recursive_basic2.phpt2
-rw-r--r--ext/standard/tests/array/array_walk_recursive_error2.phpt2
-rw-r--r--ext/standard/tests/array/arsort_variation1.phpt2
-rw-r--r--ext/standard/tests/array/arsort_variation2.phpt2
-rw-r--r--ext/standard/tests/array/asort_variation1.phpt2
-rw-r--r--ext/standard/tests/array/asort_variation2.phpt2
-rw-r--r--ext/standard/tests/array/bug31158.phpt2
-rw-r--r--ext/standard/tests/array/bug40709.phpt10
-rw-r--r--ext/standard/tests/array/krsort_variation1.phpt2
-rw-r--r--ext/standard/tests/array/krsort_variation2.phpt2
-rw-r--r--ext/standard/tests/array/ksort_variation1.phpt2
-rw-r--r--ext/standard/tests/array/ksort_variation2.phpt2
-rw-r--r--ext/standard/tests/array/sizeof_basic2.phpt2
-rw-r--r--ext/standard/tests/array/sizeof_variation4.phpt2
-rw-r--r--ext/standard/tests/array/sort_variation1.phpt2
-rw-r--r--ext/standard/tests/array/sort_variation2.phpt2
-rw-r--r--ext/standard/tests/array/uasort_error.phpt2
-rw-r--r--ext/standard/tests/array/usort_error2.phpt2
-rw-r--r--ext/standard/tests/class_object/class_exists_variation_001.phpt2
-rw-r--r--ext/standard/tests/class_object/class_exists_variation_002.phpt2
-rw-r--r--ext/standard/tests/class_object/trait_exists_variation_001.phpt2
-rw-r--r--ext/standard/tests/class_object/trait_exists_variation_002.phpt2
-rw-r--r--ext/standard/tests/file/005_error.phpt2
-rw-r--r--ext/standard/tests/file/007_variation10.phpt2
-rw-r--r--ext/standard/tests/file/007_variation11-win32.phpt6
-rw-r--r--ext/standard/tests/file/007_variation11.phpt6
-rw-r--r--ext/standard/tests/file/007_variation12-win32.phpt4
-rw-r--r--ext/standard/tests/file/007_variation12.phpt4
-rw-r--r--ext/standard/tests/file/007_variation13-win32.phpt2
-rw-r--r--ext/standard/tests/file/007_variation13.phpt2
-rw-r--r--ext/standard/tests/file/007_variation14.phpt2
-rw-r--r--ext/standard/tests/file/007_variation15.phpt4
-rw-r--r--ext/standard/tests/file/007_variation16.phpt2
-rw-r--r--ext/standard/tests/file/007_variation18.phpt2
-rw-r--r--ext/standard/tests/file/007_variation19.phpt6
-rw-r--r--ext/standard/tests/file/007_variation2.phpt2
-rw-r--r--ext/standard/tests/file/007_variation20.phpt4
-rw-r--r--ext/standard/tests/file/007_variation21.phpt2
-rw-r--r--ext/standard/tests/file/007_variation22.phpt2
-rw-r--r--ext/standard/tests/file/007_variation23.phpt4
-rw-r--r--ext/standard/tests/file/007_variation24.phpt2
-rw-r--r--ext/standard/tests/file/007_variation3.phpt6
-rw-r--r--ext/standard/tests/file/007_variation4.phpt4
-rw-r--r--ext/standard/tests/file/007_variation5.phpt2
-rw-r--r--ext/standard/tests/file/007_variation6.phpt2
-rw-r--r--ext/standard/tests/file/007_variation7.phpt4
-rw-r--r--ext/standard/tests/file/007_variation8.phpt2
-rw-r--r--ext/standard/tests/file/bug52820.phpt2
-rw-r--r--ext/standard/tests/file/fgetc_variation3.phpt2
-rw-r--r--ext/standard/tests/file/fgetc_variation4.phpt2
-rw-r--r--ext/standard/tests/file/fgetcsv_variation1.phpt2
-rw-r--r--ext/standard/tests/file/fgetcsv_variation10.phpt2
-rw-r--r--ext/standard/tests/file/fgetcsv_variation11.phpt2
-rw-r--r--ext/standard/tests/file/fgetcsv_variation12.phpt2
-rw-r--r--ext/standard/tests/file/fgetcsv_variation13.phpt2
-rw-r--r--ext/standard/tests/file/fgetcsv_variation14.phpt2
-rw-r--r--ext/standard/tests/file/fgetcsv_variation15.phpt2
-rw-r--r--ext/standard/tests/file/fgetcsv_variation16.phpt2
-rw-r--r--ext/standard/tests/file/fgetcsv_variation17.phpt2
-rw-r--r--ext/standard/tests/file/fgetcsv_variation18.phpt2
-rw-r--r--ext/standard/tests/file/fgetcsv_variation19.phpt2
-rw-r--r--ext/standard/tests/file/fgetcsv_variation2.phpt2
-rw-r--r--ext/standard/tests/file/fgetcsv_variation20.phpt2
-rw-r--r--ext/standard/tests/file/fgetcsv_variation21.phpt2
-rw-r--r--ext/standard/tests/file/fgetcsv_variation24.phpt2
-rw-r--r--ext/standard/tests/file/fgetcsv_variation25.phpt2
-rw-r--r--ext/standard/tests/file/fgetcsv_variation27.phpt2
-rw-r--r--ext/standard/tests/file/fgetcsv_variation28.phpt2
-rw-r--r--ext/standard/tests/file/fgetcsv_variation29.phpt2
-rw-r--r--ext/standard/tests/file/fgetcsv_variation3.phpt2
-rw-r--r--ext/standard/tests/file/fgetcsv_variation31.phpt2
-rw-r--r--ext/standard/tests/file/fgetcsv_variation4.phpt2
-rw-r--r--ext/standard/tests/file/fgetcsv_variation5.phpt2
-rw-r--r--ext/standard/tests/file/fgetcsv_variation6.phpt2
-rw-r--r--ext/standard/tests/file/fgetcsv_variation7.phpt2
-rw-r--r--ext/standard/tests/file/fgetcsv_variation8.phpt2
-rw-r--r--ext/standard/tests/file/fgetcsv_variation9.phpt2
-rw-r--r--ext/standard/tests/file/fgets_variation1.phpt2
-rw-r--r--ext/standard/tests/file/fgets_variation3.phpt4
-rw-r--r--ext/standard/tests/file/fgetss_basic2-win32.phpt2
-rw-r--r--ext/standard/tests/file/fgetss_basic2.phpt2
-rw-r--r--ext/standard/tests/file/fgetss_variation1-win32.phpt2
-rw-r--r--ext/standard/tests/file/fgetss_variation1.phpt2
-rw-r--r--ext/standard/tests/file/fgetss_variation2.phpt2
-rw-r--r--ext/standard/tests/file/fgetss_variation3-win32.phpt2
-rw-r--r--ext/standard/tests/file/fgetss_variation3.phpt2
-rw-r--r--ext/standard/tests/file/fgetss_variation4.phpt2
-rw-r--r--ext/standard/tests/file/fgetss_variation5-win32.phpt2
-rw-r--r--ext/standard/tests/file/fgetss_variation5.phpt2
-rw-r--r--ext/standard/tests/file/fileinode_error.phpt4
-rw-r--r--ext/standard/tests/file/fseek_ftell_rewind_basic2-win32.phpt2
-rw-r--r--ext/standard/tests/file/fseek_ftell_rewind_basic2.phpt2
-rw-r--r--ext/standard/tests/file/fstat_variation1.phpt2
-rw-r--r--ext/standard/tests/file/fstat_variation2.phpt2
-rw-r--r--ext/standard/tests/file/fstat_variation3.phpt2
-rw-r--r--ext/standard/tests/file/fstat_variation4.phpt2
-rw-r--r--ext/standard/tests/file/fstat_variation5.phpt2
-rw-r--r--ext/standard/tests/file/fstat_variation6.phpt2
-rw-r--r--ext/standard/tests/file/fstat_variation7.phpt2
-rw-r--r--ext/standard/tests/mail/mail_include.inc2
-rw-r--r--ext/standard/tests/streams/bug64770.phpt3
-rw-r--r--ext/standard/tests/strings/addslashes_variation1.phpt2
-rw-r--r--ext/standard/tests/strings/bug36306.phpt4
-rw-r--r--ext/standard/tests/strings/bug50847.phpt2
-rw-r--r--ext/standard/tests/strings/bug64879.phpt12
-rw-r--r--ext/standard/tests/strings/chop_variation1.phpt2
-rw-r--r--ext/standard/tests/strings/chop_variation2.phpt2
-rw-r--r--ext/standard/tests/strings/chunk_split_error.phpt2
-rw-r--r--ext/standard/tests/strings/get_html_translation_table_variation1.phpt2
-rw-r--r--ext/standard/tests/strings/get_html_translation_table_variation2.phpt2
-rw-r--r--ext/standard/tests/strings/htmlspecialchars_decode_variation3.phpt2
-rw-r--r--ext/standard/tests/strings/join_variation1.phpt2
-rw-r--r--ext/standard/tests/strings/join_variation2.phpt2
-rw-r--r--ext/standard/tests/strings/setlocale_basic1.phpt2
-rw-r--r--ext/standard/tests/strings/setlocale_basic2.phpt2
-rw-r--r--ext/standard/tests/strings/setlocale_basic3.phpt2
-rw-r--r--ext/standard/tests/strings/setlocale_error.phpt2
-rw-r--r--ext/standard/tests/strings/setlocale_variation1.phpt2
-rw-r--r--ext/standard/tests/strings/setlocale_variation2.phpt2
-rw-r--r--ext/standard/tests/strings/setlocale_variation3.phpt2
-rw-r--r--ext/standard/tests/strings/setlocale_variation4.phpt2
-rw-r--r--ext/standard/tests/strings/setlocale_variation5.phpt2
-rw-r--r--ext/standard/tests/strings/strcspn_variation2.phpt4
-rw-r--r--ext/standard/tests/strings/strip_tags_variation5.phpt2
-rw-r--r--ext/standard/tests/strings/stripcslashes_variation1.phpt2
-rw-r--r--ext/standard/tests/strings/stripslashes_variation1.phpt2
-rw-r--r--ext/standard/tests/strings/strrchr_basic.phpt2
-rw-r--r--ext/standard/tests/strings/strspn_variation2.phpt4
-rw-r--r--ext/standard/tests/strings/strtok_variation1.phpt2
-rw-r--r--ext/standard/tests/strings/strtok_variation2.phpt2
-rw-r--r--ext/standard/tests/strings/trim1.phptbin2046 -> 2046 bytes
-rw-r--r--ext/standard/tests/strings/trim_error.phpt2
-rw-r--r--ext/standard/tests/strings/trim_variation1.phpt2
-rw-r--r--ext/standard/tests/strings/trim_variation2.phpt2
-rw-r--r--ext/standard/tests/strings/ucwords_variation1.phpt2
-rw-r--r--ext/standard/tests/strings/ucwords_variation2.phpt2
-rw-r--r--ext/standard/tests/strings/wordwrap_variation1.phpt2
-rw-r--r--ext/standard/tests/strings/wordwrap_variation2.phpt2
-rw-r--r--ext/standard/tests/strings/wordwrap_variation3.phpt2
-rw-r--r--ext/standard/tests/strings/wordwrap_variation4.phpt2
-rw-r--r--ext/standard/user_filters.c2
-rw-r--r--ext/standard/uuencode.c2
-rw-r--r--ext/sysvmsg/sysvmsg.c2
-rw-r--r--ext/sysvsem/tests/sysv.phpt6
-rw-r--r--ext/xmlreader/php_xmlreader.c8
-rw-r--r--ext/xmlrpc/libxmlrpc/simplestring.c2
-rw-r--r--ext/xmlrpc/libxmlrpc/xmlrpc.c4
-rw-r--r--ext/zip/lib/zip_open.c2
-rw-r--r--ext/zip/tests/bug64342_0.phpt2
-rw-r--r--ext/zip/tests/bug64342_1.phpt2
-rw-r--r--ext/zlib/tests/gzfile_variation1.phpt2
-rw-r--r--ext/zlib/tests/gzfile_variation10.phpt2
-rw-r--r--ext/zlib/tests/gzfile_variation11.phpt2
-rw-r--r--ext/zlib/tests/gzfile_variation12.phpt2
-rw-r--r--ext/zlib/tests/gzfile_variation13.phpt2
-rw-r--r--ext/zlib/tests/gzfile_variation14.phpt2
-rw-r--r--ext/zlib/tests/gzfile_variation2.phpt2
-rw-r--r--ext/zlib/tests/gzfile_variation3.phpt2
-rw-r--r--ext/zlib/tests/gzfile_variation4.phpt2
-rw-r--r--ext/zlib/tests/gzfile_variation5.phpt2
-rw-r--r--ext/zlib/tests/gzfile_variation6.phpt2
-rw-r--r--ext/zlib/tests/gzfile_variation7.phpt2
-rw-r--r--ext/zlib/tests/gzfile_variation8.phpt2
-rw-r--r--ext/zlib/tests/gzfile_variation9.phpt2
-rw-r--r--ext/zlib/tests/readgzfile_variation1.phpt2
-rw-r--r--ext/zlib/tests/readgzfile_variation10.phpt2
-rw-r--r--ext/zlib/tests/readgzfile_variation11.phpt2
-rw-r--r--ext/zlib/tests/readgzfile_variation12.phpt2
-rw-r--r--ext/zlib/tests/readgzfile_variation13.phpt2
-rw-r--r--ext/zlib/tests/readgzfile_variation14.phpt2
-rw-r--r--ext/zlib/tests/readgzfile_variation2.phpt2
-rw-r--r--ext/zlib/tests/readgzfile_variation3.phpt2
-rw-r--r--ext/zlib/tests/readgzfile_variation4.phpt2
-rw-r--r--ext/zlib/tests/readgzfile_variation5.phpt2
-rw-r--r--ext/zlib/tests/readgzfile_variation6.phpt2
-rw-r--r--ext/zlib/tests/readgzfile_variation7.phpt2
-rw-r--r--ext/zlib/tests/readgzfile_variation8.phpt2
-rw-r--r--ext/zlib/tests/readgzfile_variation9.phpt2
-rw-r--r--main/main.c2
-rw-r--r--main/php_version.h6
-rw-r--r--main/rfc1867.c2
-rw-r--r--main/streams/cast.c14
-rw-r--r--main/streams/xp_socket.c2
-rwxr-xr-xrun-tests.php2
-rw-r--r--sapi/apache/mod_php5.c2
-rw-r--r--sapi/apache2filter/README2
-rw-r--r--sapi/apache2handler/README2
-rw-r--r--sapi/apache2handler/sapi_apache2.c2
-rw-r--r--sapi/apache_hooks/mod_php5.c2
-rw-r--r--sapi/fpm/config.m422
-rw-r--r--sapi/fpm/fpm/fpm_conf.c22
-rw-r--r--sapi/fpm/fpm/fpm_conf.h4
-rw-r--r--sapi/fpm/fpm/fpm_events.c8
-rw-r--r--sapi/fpm/fpm/fpm_stdio.c4
-rw-r--r--sapi/fpm/fpm/fpm_systemd.c113
-rw-r--r--sapi/fpm/fpm/fpm_systemd.h13
-rw-r--r--sapi/fpm/php-fpm.conf.in12
-rw-r--r--sapi/fpm/php-fpm.service.in1
-rw-r--r--sapi/isapi/stresstest/stresstest.cpp2
-rw-r--r--sapi/thttpd/thttpd.c2
-rw-r--r--scripts/dev/generate-phpt.pharbin52353 -> 52354 bytes
-rw-r--r--scripts/dev/generate-phpt/src/gtFunction.php2
-rwxr-xr-xserver-tests-config.php2
-rwxr-xr-xserver-tests.php2
-rw-r--r--tests/output/bug60322.phpt5
-rw-r--r--win32/glob.c2
-rw-r--r--win32/install.txt2
-rw-r--r--win32/sendmail.c12
-rw-r--r--win32/signal.h2
380 files changed, 2503 insertions, 580 deletions
diff --git a/NEWS b/NEWS
index 7040afc44a..d9634ffddd 100644
--- a/NEWS
+++ b/NEWS
@@ -1,22 +1,84 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-?? ??? 2013, PHP 5.4.16
+?? ??? 2013, PHP 5.4.17
- Core:
+ . Fixed bug #64988 (Class loading order affects E_STRICT warning). (Laruence)
+ . Fixed bug #64966 (segfault in zend_do_fcall_common_helper_SPEC). (Laruence)
+ . Fixed bug #64960 (Segfault in gc_zval_possible_root). (Laruence)
+ . Fixed bug #64934 (Apache2 TS crash with get_browser()). (Anatol)
+
+- DateTime:
+ . Fixed bug #53437 (Crash when using unserialized DatePeriod instance).
+ (Gustavo, Derick, Anatol)
+
+- FPM:
+ . Fixed Bug #64915 (error_log ignored when daemonize=0). (Remi)
+
+- PDO_DBlib:
+ . Fixed bug #63638 (Cannot connect to SQL Server 2008 with PDO dblib).
+ (Stanley Sufficool)
+ . Fixed bug #64338 (pdo_dblib can't connect to Azure SQL). (Stanley
+ Sufficool)
+ . Fixed bug #64808 (FreeTDS PDO getColumnMeta on a prepared but not executed
+ statement crashes). (Stanley Sufficool)
+
+- PDO_pgsql:
+ . Fixed Bug #64949 (Buffer overflow in _pdo_pgsql_error). (Remi)
+
+- SPL:
+ . Fixed bug #64997 (Segfault while using RecursiveIteratorIterator on
+ 64-bits systems). (Laruence)
+
+06 Jun 2013, PHP 5.4.16
+
+- Core:
+ . Fixed bug #64879 (Heap based buffer overflow in quoted_printable_encode,
+ CVE 2013-2110). (Stas)
+ . Fixed bug #64853 (Use of no longer available ini directives causes crash on
+ TS build). (Anatol)
. Fixed bug #64729 (compilation failure on x32). (Gustavo)
+ . Fixed bug #64720 (SegFault on zend_deactivate). (Dmitry)
+ . Fixed bug #64660 (Segfault on memory exhaustion within function definition).
+ (Stas, reported by Juha Kylmänen)
+
+- Calendar:
+ . Fixed bug #64895 (Integer overflow in SndToJewish). (Remi)
+
+- Fileinfo:
+ . Fixed bug #64830 (mimetype detection segfaults on mp3 file). (Anatol)
- FPM:
. Ignore QUERY_STRING when sent in SCRIPT_FILENAME. (Remi)
. Fixed some possible memory or resource leaks and possible null dereference
detected by code coverity scan. (Remi)
. Log a warning when a syscall fails. (Remi)
+ . Add --with-fpm-systemd option to report health to systemd, and
+ systemd_interval option to configure this. The service can now use
+ Type=notify in the systemd unit file. (Remi)
+
+- MySQLi
+ . Fixed bug #64726 (Segfault when calling fetch_object on a use_result and DB
+ pointer has closed). (Laruence)
+
+- Phar
+ . Fixed bug #64214 (PHAR PHPTs intermittently crash when run on DFS, SMB or
+ with non std tmp dir). (Pierre)
- SNMP:
. Fixed bug #64765 (Some IPv6 addresses get interpreted wrong).
- (Boris Lytochkin)
+ (Boris Lytochkin)
. Fixed bug #64159 (Truncated snmpget). (Boris Lytochkin)
-?? ??? 2013, PHP 5.4.15
+- Streams:
+ . Fixed bug #64770 (stream_select() fails with pipes returned by proc_open()
+ on Windows x64). (Anatol)
+
+- Zend Engine:
+ . Fixed bug #64821 (Custom Exceptions crash when internal properties
+ overridden). (Anatol)
+
+09 May 2013, PHP 5.4.15
- Core:
. Fixed bug #64578 (debug_backtrace in set_error_handler corrupts zend heap:
segfault). (Laruence)
@@ -113,9 +175,6 @@ PHP NEWS
. Disabled external entities loading (CVE-2013-1643, CVE-2013-1824).
(Dmitry)
-- Phar:
- . Fixed timestamp update on Phar contents modification. (Dmitry)
-
- SPL:
. Fixed bug #64264 (SPLFixedArray toArray problem). (Laruence)
. Fixed bug #64228 (RecursiveDirectoryIterator always assumes SKIP_DOTS).
diff --git a/README.PARAMETER_PARSING_API b/README.PARAMETER_PARSING_API
index 927e48188c..4579340e5e 100644
--- a/README.PARAMETER_PARSING_API
+++ b/README.PARAMETER_PARSING_API
@@ -32,7 +32,7 @@ resources cannot be auto-converted.
Type specifiers
---------------
The following list shows the type specifier, its meaning and the parameter
- types that need to be passed by address. All passed paramaters are set
+ types that need to be passed by address. All passed parameters are set
if the PHP parameter is non optional and untouched if optional and the
parameter is not present. The only exception is O where the zend_class_entry*
has to be provided on input and is used to verify the PHP parameter is an
diff --git a/README.TESTING b/README.TESTING
index 75141d50e5..5e0ee11be0 100644
--- a/README.TESTING
+++ b/README.TESTING
@@ -1,6 +1,6 @@
[IMPORTANT NOTICE]
------------------
- Failed tests usualy indicate a problem with your local system setup
+ Failed tests usually indicate a problem with your local system setup
and not within PHP itself (at least for official PHP release versions).
You may decide to automaticaly submit a test summary to our QA workflow
at the end of a test run.
diff --git a/Zend/ZEND_CHANGES b/Zend/ZEND_CHANGES
index 5208ce1623..4a6dc6cdcf 100644
--- a/Zend/ZEND_CHANGES
+++ b/Zend/ZEND_CHANGES
@@ -435,7 +435,7 @@ Changes in the Zend Engine 2.0
that of other object-oriented languages, such as Java: When the
last reference to an object is destroyed the object's
destructor, which is a class method name __destruct() that
- recieves no parameters, is called before the object is freed
+ receives no parameters, is called before the object is freed
from memory.
Example:
diff --git a/Zend/tests/019.phpt b/Zend/tests/019.phpt
index 70093cd28b..654f86bb11 100644
--- a/Zend/tests/019.phpt
+++ b/Zend/tests/019.phpt
@@ -357,7 +357,7 @@ var_dump($global_var);
test_unset3();
var_dump($global_var);
-//Note: No error conditions relating to passing arugments can be tested
+//Note: No error conditions relating to passing arguments can be tested
// because these are not functions but statements, it will result in syntax error.
?>
===DONE===
diff --git a/Zend/tests/bug32428.phpt b/Zend/tests/bug32428.phpt
index 0b5ca6aebc..e75148fec1 100644
--- a/Zend/tests/bug32428.phpt
+++ b/Zend/tests/bug32428.phpt
@@ -1,5 +1,5 @@
--TEST--
-Bug #32428 (The @ warning error supression operator is broken)
+Bug #32428 (The @ warning error suppression operator is broken)
--FILE--
<?php
$data = @$not_exists;
diff --git a/Zend/tests/bug64660.phpt b/Zend/tests/bug64660.phpt
new file mode 100644
index 0000000000..e2b89da1cd
--- /dev/null
+++ b/Zend/tests/bug64660.phpt
@@ -0,0 +1,11 @@
+--TEST--
+Bug #64660 (Segfault on memory exhaustion within function definition)
+--FILE--
+<?php
+function a() {
+ [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[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]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
+}
+echo "Done\n";
+--EXPECTF--
+
+Parse error: memory exhausted in %s on line %d
diff --git a/Zend/tests/bug64720.phpt b/Zend/tests/bug64720.phpt
new file mode 100644
index 0000000000..6c33165bb5
--- /dev/null
+++ b/Zend/tests/bug64720.phpt
@@ -0,0 +1,48 @@
+--TEST--
+Bug #64720 (SegFault on zend_deactivate)
+--FILE--
+<?php
+class Stat {
+ private static $requests;
+ public static function getInstance() {
+ if (!isset(self::$requests[1])) {
+ self::$requests[1] = new self();
+ }
+ return self::$requests[1];
+ }
+
+ public function __destruct() {
+ unset(self::$requests[1]);
+ }
+}
+
+class Foo {
+ public function __construct() {
+ Stat::getInstance();
+ }
+}
+
+class Error {
+ private $trace;
+ public function __construct() {
+ $this->trace = debug_backtrace(1);
+ }
+}
+
+class Bar {
+ public function __destruct() {
+ Stat::getInstance();
+ new Error();
+ }
+
+ public function test() {
+ new Error();
+ }
+}
+
+$foo = new Foo();
+$bar = new Bar();
+$bar->test();
+?>
+--EXPECTF--
+Fatal error: Access to undeclared static property: Stat::$requests in %sbug64720.php on line 12
diff --git a/Zend/tests/bug64821.1.phpt b/Zend/tests/bug64821.1.phpt
new file mode 100644
index 0000000000..5e2093c472
--- /dev/null
+++ b/Zend/tests/bug64821.1.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Bug #64821 Custom Exceptions crash when internal properties overridden (variation 1)
+--FILE--
+<?php
+
+class a extends exception {
+ public function __construct() {
+ $this->message = NULL;
+ $this->string = NULL;
+ $this->code = array();
+ $this->line = "hello";
+ }
+}
+
+throw new a;
+
+?>
+--EXPECTF--
+Fatal error: Uncaught exception 'a' in %s:0
+Stack trace:
+#0 {main}
+ thrown in %s on line %d
diff --git a/Zend/tests/bug64821.2.phpt b/Zend/tests/bug64821.2.phpt
new file mode 100644
index 0000000000..91a43f500b
--- /dev/null
+++ b/Zend/tests/bug64821.2.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Bug #64821 Custom Exceptions crash when internal properties overridden (variation 2)
+--FILE--
+<?php
+
+class a extends exception {
+ public function __construct() {
+ $this->line = array();
+ }
+}
+
+throw new a;
+
+?>
+--EXPECTF--
+Fatal error: Uncaught exception 'a' in %s:0
+Stack trace:
+#0 {main}
+ thrown in %s on line %d
diff --git a/Zend/tests/bug64821.3.phpt b/Zend/tests/bug64821.3.phpt
new file mode 100644
index 0000000000..9e96075d49
--- /dev/null
+++ b/Zend/tests/bug64821.3.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #64821 Custom Exceptions crash when internal properties overridden (variation 3)
+--FILE--
+<?php
+
+class a extends exception {
+ public function __construct() {
+ $this->line = array();
+ $this->file = NULL;
+ }
+}
+
+throw new a;
+
+?>
+--EXPECTF--
+Fatal error: Uncaught exception 'a' in :0
+Stack trace:
+#0 {main}
+ thrown in Unknown on line %d
diff --git a/Zend/tests/bug64960.phpt b/Zend/tests/bug64960.phpt
new file mode 100644
index 0000000000..b31cca3dc6
--- /dev/null
+++ b/Zend/tests/bug64960.phpt
@@ -0,0 +1,40 @@
+--TEST--
+Bug #64960 (Segfault in gc_zval_possible_root)
+--FILE--
+<?php
+// this makes ob_end_clean raise an error
+ob_end_flush();
+
+class ExceptionHandler {
+ public function __invoke (Exception $e)
+ {
+ // this triggers the custom error handler
+ ob_end_clean();
+ }
+}
+
+// this must be a class, closure does not trigger segfault
+set_exception_handler(new ExceptionHandler());
+
+// exception must be throwed from error handler.
+set_error_handler(function()
+{
+ $e = new Exception;
+ $e->_trace = debug_backtrace();
+
+ throw $e;
+});
+
+// trigger error handler
+$a['waa'];
+?>
+--EXPECTF--
+Notice: ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush in %sbug64960.php on line 3
+
+Fatal error: Uncaught exception 'Exception' in %sbug64960.php:19
+Stack trace:
+#0 [internal function]: {closure}(8, 'ob_end_clean():...', '%s', 9, Array)
+#1 %sbug64960.php(9): ob_end_clean()
+#2 [internal function]: ExceptionHandler->__invoke(Object(Exception))
+#3 {main}
+ thrown in %sbug64960.php on line 19
diff --git a/Zend/tests/bug64966.phpt b/Zend/tests/bug64966.phpt
new file mode 100644
index 0000000000..c1cdbbf812
--- /dev/null
+++ b/Zend/tests/bug64966.phpt
@@ -0,0 +1,30 @@
+--TEST--
+Bug #64966 (segfault in zend_do_fcall_common_helper_SPEC)
+--FILE--
+<?php
+error_reporting(E_ALL);
+set_error_handler(function($error) { throw new Exception(); }, E_RECOVERABLE_ERROR);
+
+function test($func) {
+ $a = $func("");
+ return true;
+}
+class A {
+ public function b() {
+ test("strlen");
+ test("iterator_apply");
+ }
+}
+
+$a = new A();
+$a->b();
+?>
+--EXPECTF--
+Fatal error: Uncaught exception 'Exception' in %sbug64966.php:3
+Stack trace:
+#0 [internal function]: {closure}(4096, 'Argument 1 pass...', '%s', 6, Array)
+#1 %sbug64966.php(6): iterator_apply('')
+#2 %sbug64966.php(12): test('iterator_apply')
+#3 %sbug64966.php(17): A->b()
+#4 {main}
+ thrown in %sbug64966.php on line 3
diff --git a/Zend/tests/bug64988.phpt b/Zend/tests/bug64988.phpt
new file mode 100644
index 0000000000..34fd482f38
--- /dev/null
+++ b/Zend/tests/bug64988.phpt
@@ -0,0 +1,30 @@
+--TEST--
+Bug #64988 (Class loading order affects E_STRICT warning)
+--FILE--
+<?php
+abstract class Base1 {
+ public function insert(array $data){
+ return array_reverse($data);
+ }
+}
+
+class Noisy1 extends Base1 {
+ public function insert(array $data, $option1 = Null) {
+ if (!empty($option1)) {
+ $data['option1'] = $option1;
+ }
+ return parent::insert($data);
+ }
+}
+class Smooth1 extends Noisy1 {
+ public function insert(array $data) {
+ return parent::insert($data, count($data));
+ }
+}
+
+$o = new Smooth1();
+echo "okey";
+?>
+--EXPECTF--
+Strict Standards: Declaration of Smooth1::insert() should be compatible with Noisy1::insert(array $data, $option1 = NULL) in %sbug64988.php on line 20
+okey
diff --git a/Zend/tests/gc_007.phpt b/Zend/tests/gc_007.phpt
index 8601ea43b1..a018e4846d 100644
--- a/Zend/tests/gc_007.phpt
+++ b/Zend/tests/gc_007.phpt
@@ -1,5 +1,5 @@
--TEST--
-GC 007: Unreferensed array cycle
+GC 007: Unreferenced array cycle
--INI--
zend.enable_gc=1
--FILE--
diff --git a/Zend/tests/gc_008.phpt b/Zend/tests/gc_008.phpt
index 289d581d60..4e27e5b70a 100644
--- a/Zend/tests/gc_008.phpt
+++ b/Zend/tests/gc_008.phpt
@@ -1,5 +1,5 @@
--TEST--
-GC 008: Unreferensed object cycle
+GC 008: Unreferenced object cycle
--INI--
zend.enable_gc=1
--FILE--
diff --git a/Zend/tests/gc_009.phpt b/Zend/tests/gc_009.phpt
index 263d31f45b..3f4657d2e3 100644
--- a/Zend/tests/gc_009.phpt
+++ b/Zend/tests/gc_009.phpt
@@ -1,5 +1,5 @@
--TEST--
-GC 009: Unreferensed array-object cycle
+GC 009: Unreferenced array-object cycle
--INI--
zend.enable_gc=1
--FILE--
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 529092ab92..e1f80c7171 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -1143,7 +1143,7 @@ ZEND_API void object_properties_init(zend_object *object, zend_class_entry *clas
/* This function requires 'properties' to contain all props declared in the
* class and all props being public. If only a subset is given or the class
- * has protected members then you need to merge the properties seperately by
+ * has protected members then you need to merge the properties separately by
* calling zend_merge_properties(). */
ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *class_type, HashTable *properties ZEND_FILE_LINE_DC TSRMLS_DC) /* {{{ */
{
diff --git a/Zend/zend_API.h b/Zend/zend_API.h
index 62bf391ca5..7b8b68d3b2 100644
--- a/Zend/zend_API.h
+++ b/Zend/zend_API.h
@@ -90,7 +90,7 @@ typedef struct _zend_fcall_info_cache {
#define ZEND_NS_RAW_FENTRY(ns, zend_name, name, arg_info, flags) ZEND_RAW_FENTRY(ZEND_NS_NAME(ns, zend_name), name, arg_info, flags)
#define ZEND_NS_RAW_NAMED_FE(ns, zend_name, name, arg_info) ZEND_NS_RAW_FENTRY(ns, #zend_name, name, arg_info, 0)
-#define ZEND_NS_NAMED_FE(ns, zend_name, name, arg_info) ZEND_NS_FENTRY(ns, #zend_name, name, arg_info, 0)
+#define ZEND_NS_NAMED_FE(ns, zend_name, name, arg_info) ZEND_NS_FENTRY(ns, zend_name, name, arg_info, 0)
#define ZEND_NS_FE(ns, name, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(name), arg_info, 0)
#define ZEND_NS_DEP_FE(ns, name, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(name), arg_info, ZEND_ACC_DEPRECATED)
#define ZEND_NS_FALIAS(ns, name, alias, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(alias), arg_info, 0)
@@ -461,7 +461,7 @@ ZEND_API extern const zend_fcall_info_cache empty_fcall_info_cache;
*/
ZEND_API int zend_fcall_info_init(zval *callable, uint check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, char **callable_name, char **error TSRMLS_DC);
-/** Clear argumens connected with zend_fcall_info *fci
+/** Clear arguments connected with zend_fcall_info *fci
* If free_mem is not zero then the params array gets free'd as well
*/
ZEND_API void zend_fcall_info_args_clear(zend_fcall_info *fci, int free_mem);
@@ -499,7 +499,7 @@ ZEND_API int zend_fcall_info_argv(zend_fcall_info *fci TSRMLS_DC, int argc, va_l
ZEND_API int zend_fcall_info_argn(zend_fcall_info *fci TSRMLS_DC, int argc, ...);
/** Call a function using information created by zend_fcall_info_init()/args().
- * If args is given then those replace the arguement info in fci is temporarily.
+ * If args is given then those replace the argument info in fci is temporarily.
*/
ZEND_API int zend_fcall_info_call(zend_fcall_info *fci, zend_fcall_info_cache *fcc, zval **retval, zval *args TSRMLS_DC);
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 82275ce624..433a1902eb 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -3267,11 +3267,11 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function *
if (child->common.prototype && (child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT)) {
if (!zend_do_perform_implementation_check(child, child->common.prototype TSRMLS_CC)) {
- zend_error(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_get_function_declaration(child->common.prototype? child->common.prototype : parent TSRMLS_CC));
+ zend_error(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_get_function_declaration(child->common.prototype TSRMLS_CC));
}
} else if (EG(error_reporting) & E_STRICT || EG(user_error_handler)) { /* Check E_STRICT (or custom error handler) before the check so that we save some time */
if (!zend_do_perform_implementation_check(child, parent TSRMLS_CC)) {
- char *method_prototype = zend_get_function_declaration(child->common.prototype? child->common.prototype : parent TSRMLS_CC);
+ char *method_prototype = zend_get_function_declaration(parent TSRMLS_CC);
zend_error(E_STRICT, "Declaration of %s::%s() should be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, method_prototype);
efree(method_prototype);
}
@@ -3744,7 +3744,7 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, const
#endif
} else {
/* inherited members are overridden by members inserted by traits */
- /* check whether the trait method fullfills the inheritance requirements */
+ /* check whether the trait method fulfills the inheritance requirements */
do_inheritance_check_on_method(fn, existing_fn TSRMLS_CC);
}
}
@@ -5479,7 +5479,7 @@ void zend_do_shell_exec(znode *result, const znode *cmd TSRMLS_DC) /* {{{ */
break;
}
SET_NODE(opline->op1, cmd);
- opline->op2.opline_num = 0;
+ opline->op2.opline_num = 1;
opline->extended_value = ZEND_DO_FCALL;
SET_UNUSED(opline->op2);
@@ -6943,7 +6943,7 @@ ZEND_API size_t zend_dirname(char *path, size_t len)
}
#elif defined(NETWARE)
/*
- * Find the first occurence of : from the left
+ * Find the first occurrence of : from the left
* move the path pointer to the position just after :
* increment the len_adjust to the length of path till colon character(inclusive)
* If there is no character beyond : simple return len
diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c
index f457b2846f..f07c1135f0 100644
--- a/Zend/zend_exceptions.c
+++ b/Zend/zend_exceptions.c
@@ -817,6 +817,10 @@ ZEND_API void zend_exception_error(zval *exception, int severity TSRMLS_DC) /* {
if (instanceof_function(ce_exception, default_exception_ce TSRMLS_CC)) {
file = zend_read_property(default_exception_ce, EG(exception), "file", sizeof("file")-1, 1 TSRMLS_CC);
line = zend_read_property(default_exception_ce, EG(exception), "line", sizeof("line")-1, 1 TSRMLS_CC);
+
+ convert_to_string(file);
+ file = (Z_STRLEN_P(file) > 0) ? file : NULL;
+ line = (Z_TYPE_P(line) == IS_LONG) ? line : NULL;
} else {
file = NULL;
line = NULL;
@@ -828,7 +832,11 @@ ZEND_API void zend_exception_error(zval *exception, int severity TSRMLS_DC) /* {
file = zend_read_property(default_exception_ce, exception, "file", sizeof("file")-1, 1 TSRMLS_CC);
line = zend_read_property(default_exception_ce, exception, "line", sizeof("line")-1, 1 TSRMLS_CC);
- zend_error_va(severity, Z_STRVAL_P(file), Z_LVAL_P(line), "Uncaught %s\n thrown", Z_STRVAL_P(str));
+ convert_to_string(str);
+ convert_to_string(file);
+ convert_to_long(line);
+
+ zend_error_va(severity, (Z_STRLEN_P(file) > 0) ? Z_STRVAL_P(file) : NULL, Z_LVAL_P(line), "Uncaught %s\n thrown", Z_STRVAL_P(str));
} else {
zend_error(severity, "Uncaught exception '%s'", ce_exception->name);
}
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 09e703ca59..9bffe9eff8 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -254,15 +254,13 @@ void shutdown_executor(TSRMLS_D) /* {{{ */
if (EG(user_error_handler)) {
zeh = EG(user_error_handler);
EG(user_error_handler) = NULL;
- zval_dtor(zeh);
- FREE_ZVAL(zeh);
+ zval_ptr_dtor(&zeh);
}
if (EG(user_exception_handler)) {
zeh = EG(user_exception_handler);
EG(user_exception_handler) = NULL;
- zval_dtor(zeh);
- FREE_ZVAL(zeh);
+ zval_ptr_dtor(&zeh);
}
zend_stack_destroy(&EG(user_error_handlers_error_reporting));
diff --git a/Zend/zend_gc.h b/Zend/zend_gc.h
index a443032686..3483e9dbf0 100644
--- a/Zend/zend_gc.h
+++ b/Zend/zend_gc.h
@@ -106,7 +106,7 @@ typedef struct _zend_gc_globals {
gc_root_buffer *first_unused; /* pointer to first unused buffer */
gc_root_buffer *last_unused; /* pointer to last unused buffer */
- zval_gc_info *zval_to_free; /* temporaryt list of zvals to free */
+ zval_gc_info *zval_to_free; /* temporary list of zvals to free */
zval_gc_info *free_list;
zval_gc_info *next_to_free;
@@ -199,7 +199,7 @@ static zend_always_inline void gc_remove_from_buffer(gc_root_buffer *root TSRMLS
GC_ZVAL_INIT(z); \
} while (0)
-/* The following macroses override macroses from zend_alloc.h */
+/* The following macros override macros from zend_alloc.h */
#undef ALLOC_ZVAL
#define ALLOC_ZVAL(z) \
do { \
diff --git a/Zend/zend_language_scanner.c b/Zend/zend_language_scanner.c
index 03cf334dba..fa90342616 100644
--- a/Zend/zend_language_scanner.c
+++ b/Zend/zend_language_scanner.c
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Wed Mar 27 23:52:29 2013 */
+/* Generated by re2c 0.13.5 on Mon May 20 00:45:38 2013 */
#line 1 "Zend/zend_language_scanner.l"
/*
+----------------------------------------------------------------------+
@@ -585,7 +585,7 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR
compiler_result = zendparse(TSRMLS_C);
zend_do_return(&retval_znode, 0 TSRMLS_CC);
CG(in_compilation) = original_in_compilation;
- if (compiler_result==1) { /* parser error */
+ if (compiler_result != 0) { /* parser error */
zend_bailout();
}
compilation_successful=1;
@@ -760,7 +760,7 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
SCNG(script_filtered) = NULL;
}
- if (compiler_result==1) {
+ if (compiler_result != 0) {
CG(active_op_array) = original_active_op_array;
CG(unclean_shutdown)=1;
destroy_op_array(op_array TSRMLS_CC);
diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l
index 97c938ebf6..7415d33720 100644
--- a/Zend/zend_language_scanner.l
+++ b/Zend/zend_language_scanner.l
@@ -583,7 +583,7 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR
compiler_result = zendparse(TSRMLS_C);
zend_do_return(&retval_znode, 0 TSRMLS_CC);
CG(in_compilation) = original_in_compilation;
- if (compiler_result==1) { /* parser error */
+ if (compiler_result != 0) { /* parser error */
zend_bailout();
}
compilation_successful=1;
@@ -758,7 +758,7 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
SCNG(script_filtered) = NULL;
}
- if (compiler_result==1) {
+ if (compiler_result != 0) {
CG(active_op_array) = original_active_op_array;
CG(unclean_shutdown)=1;
destroy_op_array(op_array TSRMLS_CC);
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index cc45d35ecd..c2bb056a9a 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -1278,6 +1278,14 @@ ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, const char *p
}
}
+ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL) ||
+ UNEXPECTED(CE_STATIC_MEMBERS(ce)[property_info->offset] == NULL)) {
+ if (!silent) {
+ zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name, property_name);
+ }
+ return NULL;
+ }
+
return &CE_STATIC_MEMBERS(ce)[property_info->offset];
}
/* }}} */
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c
index e673f0197c..695b651a87 100644
--- a/Zend/zend_opcode.c
+++ b/Zend/zend_opcode.c
@@ -162,8 +162,9 @@ static inline void cleanup_user_class_data(zend_class_entry *ce TSRMLS_DC)
for (i = 0; i < ce->default_static_members_count; i++) {
if (ce->static_members_table[i]) {
- zval_ptr_dtor(&ce->static_members_table[i]);
+ zval *p = ce->static_members_table[i];
ce->static_members_table[i] = NULL;
+ zval_ptr_dtor(&p);
}
}
ce->static_members_table = NULL;
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
index 594f1f1057..474f978a32 100644
--- a/Zend/zend_operators.c
+++ b/Zend/zend_operators.c
@@ -1475,7 +1475,7 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {
/* If both are objects sharing the same comparision handler then use is */
if (Z_OBJ_HANDLER_P(op1,compare_objects) == Z_OBJ_HANDLER_P(op2,compare_objects)) {
if (Z_OBJ_HANDLE_P(op1) == Z_OBJ_HANDLE_P(op2)) {
- /* object handles are identical, apprently this is the same object */
+ /* object handles are identical, apparently this is the same object */
ZVAL_LONG(result, 0);
return SUCCESS;
}
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index eed65e3e27..15cef7132f 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -2684,6 +2684,8 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
if (!RETURN_VALUE_USED(opline)) {
zval_ptr_dtor(&ret->var.ptr);
}
+ } else if (RETURN_VALUE_USED(opline)) {
+ EX_T(opline->result.var).var.ptr = NULL;
}
} else if (fbc->type == ZEND_USER_FUNCTION) {
EX(original_return_value) = EG(return_value_ptr_ptr);
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 18b3f4772c..4982cc2133 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -648,6 +648,8 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
if (!RETURN_VALUE_USED(opline)) {
zval_ptr_dtor(&ret->var.ptr);
}
+ } else if (RETURN_VALUE_USED(opline)) {
+ EX_T(opline->result.var).var.ptr = NULL;
}
} else if (fbc->type == ZEND_USER_FUNCTION) {
EX(original_return_value) = EG(return_value_ptr_ptr);
diff --git a/acinclude.m4 b/acinclude.m4
index ed7d1ea4e5..350e4989bb 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -1832,7 +1832,7 @@ AC_TRY_COMPILE([
])
dnl -------------------------------------------------------------------------
-dnl Library/function existance and build sanity checks
+dnl Library/function existence and build sanity checks
dnl -------------------------------------------------------------------------
dnl
diff --git a/build/shtool b/build/shtool
index d50aa1dbb8..684a01f5df 100755
--- a/build/shtool
+++ b/build/shtool
@@ -376,11 +376,11 @@ while [ $# -gt 0 ]; do
eval "opt_${opt_OPT}=yes"
;;
':' )
- # option with argument (multiple occurances override)
+ # option with argument (multiple occurrences override)
eval "opt_${opt_OPT}=\"\$opt_ARG\""
;;
'+' )
- # option with argument (multiple occurances append)
+ # option with argument (multiple occurrences append)
eval "opt_${opt_OPT}=\"\$opt_${opt_OPT}\${ASC_NL}\$opt_ARG\""
;;
* )
diff --git a/configure.in b/configure.in
index 1e66182129..c1db370a0f 100644
--- a/configure.in
+++ b/configure.in
@@ -119,7 +119,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=5
PHP_MINOR_VERSION=4
-PHP_RELEASE_VERSION=16
+PHP_RELEASE_VERSION=17
PHP_EXTRA_VERSION="-dev"
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c
index 65b06d79f5..abe84fc316 100644
--- a/ext/bz2/bz2.c
+++ b/ext/bz2/bz2.c
@@ -518,7 +518,7 @@ static PHP_FUNCTION(bzcompress)
efree(dest);
RETURN_LONG(error);
} else {
- /* Copy the buffer, we have perhaps allocate alot more than we need,
+ /* Copy the buffer, we have perhaps allocate a lot more than we need,
so we erealloc() the buffer to the proper size */
dest = erealloc(dest, dest_len + 1);
dest[dest_len] = 0;
diff --git a/ext/calendar/jewish.c b/ext/calendar/jewish.c
index f4dc7c35ae..fcc0e5c0b8 100644
--- a/ext/calendar/jewish.c
+++ b/ext/calendar/jewish.c
@@ -272,6 +272,7 @@
#define HALAKIM_PER_METONIC_CYCLE (HALAKIM_PER_LUNAR_CYCLE * (12 * 19 + 7))
#define JEWISH_SDN_OFFSET 347997
+#define JEWISH_SDN_MAX 324542846L /* 12/13/887605, greater value raises interger overflow */
#define NEW_MOON_OF_CREATION 31524
#define SUNDAY 0
@@ -519,7 +520,7 @@ void SdnToJewish(
int tishri1After;
int yearLength;
- if (sdn <= JEWISH_SDN_OFFSET) {
+ if (sdn <= JEWISH_SDN_OFFSET || sdn > JEWISH_SDN_MAX) {
*pYear = 0;
*pMonth = 0;
*pDay = 0;
diff --git a/ext/calendar/tests/jdtojewish64.phpt b/ext/calendar/tests/jdtojewish64.phpt
new file mode 100644
index 0000000000..9f01109a71
--- /dev/null
+++ b/ext/calendar/tests/jdtojewish64.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Bug #64895: Integer overflow in SndToJewish
+--SKIPIF--
+<?php
+include 'skipif.inc';
+if (PHP_INT_SIZE == 4) {
+ die("skip this test is for 64bit platform only");
+}
+?>
+--FILE--
+<?php
+$a = array(38245310, 324542846, 324542847, 9223372036854743639);
+
+foreach ($a as $x) var_dump(jdtojewish($x));
+--EXPECTF--
+string(11) "2/22/103759"
+string(12) "12/13/887605"
+string(5) "0/0/0"
+string(5) "0/0/0"
diff --git a/ext/com_dotnet/com_variant.c b/ext/com_dotnet/com_variant.c
index 853b7df4ca..8289322d6d 100644
--- a/ext/com_dotnet/com_variant.c
+++ b/ext/com_dotnet/com_variant.c
@@ -429,7 +429,7 @@ PHP_FUNCTION(com_variant_create_instance)
/* If already an array and VT_ARRAY is passed then:
- if only VT_ARRAY passed then do not perform a conversion
- if VT_ARRAY plus other type passed then perform conversion
- but will probably fail (origional behavior)
+ but will probably fail (original behavior)
*/
if ((vt & VT_ARRAY) && (V_VT(&obj->v) & VT_ARRAY)) {
long orig_vt = vt;
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 04f28aac6f..d1f9a7f8e3 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -39,6 +39,20 @@ static __inline __int64_t php_date_llabs( __int64_t i ) { return i >= 0 ? i : -i
static inline long long php_date_llabs( long long i ) { return i >= 0 ? i : -i; }
#endif
+#ifdef PHP_WIN32
+#define DATE_I64_BUF_LEN 65
+# define DATE_I64A(i, s, len) _i64toa_s(i, s, len, 10)
+# define DATE_A64I(i, s) i = _atoi64(s)
+#else
+#define DATE_I64_BUF_LEN 65
+# define DATE_I64A(i, s, len) \
+ do { \
+ int st = snprintf(s, len, "%lld", i); \
+ s[st] = '\0'; \
+ } while (0);
+# define DATE_A64I(i, s) i = atoll(s)
+#endif
+
/* {{{ arginfo */
ZEND_BEGIN_ARG_INFO_EX(arginfo_date, 0, 0, 1)
ZEND_ARG_INFO(0, format)
@@ -472,6 +486,8 @@ const zend_function_entry date_funcs_interval[] = {
const zend_function_entry date_funcs_period[] = {
PHP_ME(DatePeriod, __construct, arginfo_date_period_construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC)
+ PHP_ME(DatePeriod, __wakeup, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(DatePeriod, __set_state, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
PHP_FE_END
};
@@ -569,9 +585,13 @@ static HashTable *date_object_get_gc(zval *object, zval ***table, int *n TSRMLS_
static HashTable *date_object_get_properties(zval *object TSRMLS_DC);
static HashTable *date_object_get_gc_interval(zval *object, zval ***table, int *n TSRMLS_DC);
static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC);
+static HashTable *date_object_get_gc_period(zval *object, zval ***table, int *n TSRMLS_DC);
+static HashTable *date_object_get_properties_period(zval *object TSRMLS_DC);
zval *date_interval_read_property(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC);
void date_interval_write_property(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC);
+static zval *date_period_read_property(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC);
+static void date_period_write_property(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC);
/* {{{ Module struct */
zend_module_entry date_module_entry = {
@@ -1982,6 +2002,11 @@ static void date_register_classes(TSRMLS_D)
zend_class_implements(date_ce_period TSRMLS_CC, 1, zend_ce_traversable);
memcpy(&date_object_handlers_period, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
date_object_handlers_period.clone_obj = date_object_clone_period;
+ date_object_handlers_period.get_properties = date_object_get_properties_period;
+ date_object_handlers_period.get_property_ptr_ptr = NULL;
+ date_object_handlers_period.get_gc = date_object_get_gc_period;
+ date_object_handlers_period.read_property = date_period_read_property;
+ date_object_handlers_period.write_property = date_period_write_property;
#define REGISTER_PERIOD_CLASS_CONST_STRING(const_name, value) \
zend_declare_class_constant_long(date_ce_period, const_name, sizeof(const_name)-1, value TSRMLS_CC);
@@ -2081,7 +2106,7 @@ static HashTable *date_object_get_properties(zval *object TSRMLS_DC)
props = zend_std_get_properties(object TSRMLS_CC);
- if (!dateobj->time) {
+ if (!dateobj->time || GC_G(gc_active)) {
return props;
}
@@ -2229,7 +2254,6 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC)
zval *zv;
php_interval_obj *intervalobj;
-
intervalobj = (php_interval_obj *) zend_object_store_get_object(object TSRMLS_CC);
props = zend_std_get_properties(object TSRMLS_CC);
@@ -2240,7 +2264,7 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC)
#define PHP_DATE_INTERVAL_ADD_PROPERTY(n,f) \
MAKE_STD_ZVAL(zv); \
- ZVAL_LONG(zv, intervalobj->diff->f); \
+ ZVAL_LONG(zv, (long)intervalobj->diff->f); \
zend_hash_update(props, n, strlen(n) + 1, &zv, sizeof(zval), NULL);
PHP_DATE_INTERVAL_ADD_PROPERTY("y", y);
@@ -2249,6 +2273,9 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC)
PHP_DATE_INTERVAL_ADD_PROPERTY("h", h);
PHP_DATE_INTERVAL_ADD_PROPERTY("i", i);
PHP_DATE_INTERVAL_ADD_PROPERTY("s", s);
+ PHP_DATE_INTERVAL_ADD_PROPERTY("weekday", weekday);
+ PHP_DATE_INTERVAL_ADD_PROPERTY("weekday_behavior", weekday_behavior);
+ PHP_DATE_INTERVAL_ADD_PROPERTY("first_last_day_of", first_last_day_of);
PHP_DATE_INTERVAL_ADD_PROPERTY("invert", invert);
if (intervalobj->diff->days != -99999) {
PHP_DATE_INTERVAL_ADD_PROPERTY("days", days);
@@ -2257,6 +2284,10 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC)
ZVAL_FALSE(zv);
zend_hash_update(props, "days", 5, &zv, sizeof(zval), NULL);
}
+ PHP_DATE_INTERVAL_ADD_PROPERTY("special_type", special.type);
+ PHP_DATE_INTERVAL_ADD_PROPERTY("special_amount", special.amount);
+ PHP_DATE_INTERVAL_ADD_PROPERTY("have_weekday_relative", have_weekday_relative);
+ PHP_DATE_INTERVAL_ADD_PROPERTY("have_special_relative", have_special_relative);
return props;
}
@@ -2358,6 +2389,7 @@ PHPAPI zval *php_date_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC)
object_init_ex(object, pce);
Z_SET_REFCOUNT_P(object, 1);
Z_UNSET_ISREF_P(object);
+
return object;
}
@@ -3629,30 +3661,48 @@ PHP_METHOD(DateInterval, __construct)
}
/* }}} */
-static long php_date_long_from_hash_element(HashTable *myht, char *element, size_t size)
-{
- zval **z_arg = NULL;
-
- if (zend_hash_find(myht, element, size + 1, (void**) &z_arg) == SUCCESS) {
- convert_to_long(*z_arg);
- return Z_LVAL_PP(z_arg);
- } else {
- return -1;
- }
-}
static int php_date_interval_initialize_from_hash(zval **return_value, php_interval_obj **intobj, HashTable *myht TSRMLS_DC)
{
(*intobj)->diff = timelib_rel_time_ctor();
- (*intobj)->diff->y = php_date_long_from_hash_element(myht, "y", 1);
- (*intobj)->diff->m = php_date_long_from_hash_element(myht, "m", 1);
- (*intobj)->diff->d = php_date_long_from_hash_element(myht, "d", 1);
- (*intobj)->diff->h = php_date_long_from_hash_element(myht, "h", 1);
- (*intobj)->diff->i = php_date_long_from_hash_element(myht, "i", 1);
- (*intobj)->diff->s = php_date_long_from_hash_element(myht, "s", 1);
- (*intobj)->diff->invert = php_date_long_from_hash_element(myht, "invert", 6);
- (*intobj)->diff->days = php_date_long_from_hash_element(myht, "days", 4);
+#define PHP_DATE_INTERVAL_READ_PROPERTY(element, member, itype, def) \
+ do { \
+ zval **z_arg = NULL; \
+ if (zend_hash_find(myht, element, strlen(element) + 1, (void**) &z_arg) == SUCCESS) { \
+ convert_to_long(*z_arg); \
+ (*intobj)->diff->member = (itype)Z_LVAL_PP(z_arg); \
+ } else { \
+ (*intobj)->diff->member = (itype)def; \
+ } \
+ } while (0);
+
+#define PHP_DATE_INTERVAL_READ_PROPERTY_I64(element, member) \
+ do { \
+ zval **z_arg = NULL; \
+ if (zend_hash_find(myht, element, strlen(element) + 1, (void**) &z_arg) == SUCCESS) { \
+ convert_to_string(*z_arg); \
+ DATE_A64I((*intobj)->diff->member, Z_STRVAL_PP(z_arg)); \
+ } else { \
+ (*intobj)->diff->member = -1LL; \
+ } \
+ } while (0);
+
+ PHP_DATE_INTERVAL_READ_PROPERTY("y", y, timelib_sll, -1)
+ PHP_DATE_INTERVAL_READ_PROPERTY("m", m, timelib_sll, -1)
+ PHP_DATE_INTERVAL_READ_PROPERTY("d", d, timelib_sll, -1)
+ PHP_DATE_INTERVAL_READ_PROPERTY("h", h, timelib_sll, -1)
+ PHP_DATE_INTERVAL_READ_PROPERTY("i", i, timelib_sll, -1)
+ PHP_DATE_INTERVAL_READ_PROPERTY("s", s, timelib_sll, -1)
+ PHP_DATE_INTERVAL_READ_PROPERTY("weekday", weekday, int, -1)
+ PHP_DATE_INTERVAL_READ_PROPERTY("weekday_behavior", weekday_behavior, int, -1)
+ PHP_DATE_INTERVAL_READ_PROPERTY("first_last_day_of", first_last_day_of, int, -1)
+ PHP_DATE_INTERVAL_READ_PROPERTY("invert", invert, int, 0);
+ PHP_DATE_INTERVAL_READ_PROPERTY_I64("days", days);
+ PHP_DATE_INTERVAL_READ_PROPERTY("special_type", special.type, unsigned int, 0);
+ PHP_DATE_INTERVAL_READ_PROPERTY_I64("special_amount", special.amount);
+ PHP_DATE_INTERVAL_READ_PROPERTY("have_weekday_relative", have_weekday_relative, unsigned int, 0);
+ PHP_DATE_INTERVAL_READ_PROPERTY("have_special_relative", have_special_relative, unsigned int, 0);
(*intobj)->initialized = 1;
return 0;
@@ -4256,6 +4306,229 @@ PHP_FUNCTION(date_sun_info)
timelib_time_dtor(t2);
}
/* }}} */
+
+static HashTable *date_object_get_gc_period(zval *object, zval ***table, int *n TSRMLS_DC)
+{
+ *table = NULL;
+ *n = 0;
+ return zend_std_get_properties(object TSRMLS_CC);
+}
+
+static HashTable *date_object_get_properties_period(zval *object TSRMLS_DC)
+{
+ HashTable *props;
+ zval *zv;
+ php_period_obj *period_obj;
+
+ period_obj = zend_object_store_get_object(object TSRMLS_CC);
+
+ props = zend_std_get_properties(object TSRMLS_CC);
+
+ if (!period_obj->start || GC_G(gc_active)) {
+ return props;
+ }
+
+ MAKE_STD_ZVAL(zv);
+ if (period_obj->start) {
+ php_date_obj *date_obj;
+ object_init_ex(zv, date_ce_date);
+ date_obj = zend_object_store_get_object(zv TSRMLS_CC);
+ date_obj->time = timelib_time_clone(period_obj->start);
+ } else {
+ ZVAL_NULL(zv);
+ }
+ zend_hash_update(props, "start", sizeof("start"), &zv, sizeof(zv), NULL);
+
+ MAKE_STD_ZVAL(zv);
+ if (period_obj->current) {
+ php_date_obj *date_obj;
+ object_init_ex(zv, date_ce_date);
+ date_obj = zend_object_store_get_object(zv TSRMLS_CC);
+ date_obj->time = timelib_time_clone(period_obj->current);
+ } else {
+ ZVAL_NULL(zv);
+ }
+ zend_hash_update(props, "current", sizeof("current"), &zv, sizeof(zv), NULL);
+
+ MAKE_STD_ZVAL(zv);
+ if (period_obj->end) {
+ php_date_obj *date_obj;
+ object_init_ex(zv, date_ce_date);
+ date_obj = zend_object_store_get_object(zv TSRMLS_CC);
+ date_obj->time = timelib_time_clone(period_obj->end);
+ } else {
+ ZVAL_NULL(zv);
+ }
+ zend_hash_update(props, "end", sizeof("end"), &zv, sizeof(zv), NULL);
+
+ MAKE_STD_ZVAL(zv);
+ if (period_obj->interval) {
+ php_interval_obj *interval_obj;
+ object_init_ex(zv, date_ce_interval);
+ interval_obj = zend_object_store_get_object(zv TSRMLS_CC);
+ interval_obj->diff = timelib_rel_time_clone(period_obj->interval);
+ interval_obj->initialized = 1;
+ } else {
+ ZVAL_NULL(zv);
+ }
+ zend_hash_update(props, "interval", sizeof("interval"), &zv, sizeof(zv), NULL);
+
+ /* converted to larger type (int->long); must check when unserializing */
+ MAKE_STD_ZVAL(zv);
+ ZVAL_LONG(zv, (long) period_obj->recurrences);
+ zend_hash_update(props, "recurrences", sizeof("recurrences"), &zv, sizeof(zv), NULL);
+
+ MAKE_STD_ZVAL(zv);
+ ZVAL_BOOL(zv, period_obj->include_start_date);
+ zend_hash_update(props, "include_start_date", sizeof("include_start_date"), &zv, sizeof(zv), NULL);
+
+ return props;
+}
+
+static int php_date_period_initialize_from_hash(php_period_obj *period_obj, HashTable *myht TSRMLS_DC)
+{
+ zval **ht_entry;
+
+ /* this function does no rollback on error */
+
+ if (zend_hash_find(myht, "start", sizeof("start"), (void**) &ht_entry) == SUCCESS) {
+ if (Z_TYPE_PP(ht_entry) == IS_OBJECT && Z_OBJCE_PP(ht_entry) == date_ce_date) {
+ php_date_obj *date_obj;
+ date_obj = zend_object_store_get_object(*ht_entry TSRMLS_CC);
+ period_obj->start = timelib_time_clone(date_obj->time);
+ } else if (Z_TYPE_PP(ht_entry) != IS_NULL) {
+ return 0;
+ }
+ } else {
+ return 0;
+ }
+
+ if (zend_hash_find(myht, "end", sizeof("end"), (void**) &ht_entry) == SUCCESS) {
+ if (Z_TYPE_PP(ht_entry) == IS_OBJECT && Z_OBJCE_PP(ht_entry) == date_ce_date) {
+ php_date_obj *date_obj;
+ date_obj = zend_object_store_get_object(*ht_entry TSRMLS_CC);
+ period_obj->end = timelib_time_clone(date_obj->time);
+ } else if (Z_TYPE_PP(ht_entry) != IS_NULL) {
+ return 0;
+ }
+ } else {
+ return 0;
+ }
+
+ if (zend_hash_find(myht, "current", sizeof("current"), (void**) &ht_entry) == SUCCESS) {
+ if (Z_TYPE_PP(ht_entry) == IS_OBJECT && Z_OBJCE_PP(ht_entry) == date_ce_date) {
+ php_date_obj *date_obj;
+ date_obj = zend_object_store_get_object(*ht_entry TSRMLS_CC);
+ period_obj->current = timelib_time_clone(date_obj->time);
+ } else if (Z_TYPE_PP(ht_entry) != IS_NULL) {
+ return 0;
+ }
+ } else {
+ return 0;
+ }
+
+ if (zend_hash_find(myht, "interval", sizeof("interval"), (void**) &ht_entry) == SUCCESS) {
+ if (Z_TYPE_PP(ht_entry) == IS_OBJECT && Z_OBJCE_PP(ht_entry) == date_ce_interval) {
+ php_interval_obj *interval_obj;
+ interval_obj = zend_object_store_get_object(*ht_entry TSRMLS_CC);
+ period_obj->interval = timelib_rel_time_clone(interval_obj->diff);
+ } else { /* interval is required */
+ return 0;
+ }
+ } else {
+ return 0;
+ }
+
+ if (zend_hash_find(myht, "recurrences", sizeof("recurrences"), (void**) &ht_entry) == SUCCESS &&
+ Z_TYPE_PP(ht_entry) == IS_LONG && Z_LVAL_PP(ht_entry) >= 0 && Z_LVAL_PP(ht_entry) <= INT_MAX) {
+ period_obj->recurrences = Z_LVAL_PP(ht_entry);
+ } else {
+ return 0;
+ }
+
+ if (zend_hash_find(myht, "include_start_date", sizeof("include_start_date"), (void**) &ht_entry) == SUCCESS &&
+ Z_TYPE_PP(ht_entry) == IS_BOOL) {
+ period_obj->include_start_date = Z_BVAL_PP(ht_entry);
+ } else {
+ return 0;
+ }
+
+ period_obj->initialized = 1;
+
+ return 1;
+}
+
+/* {{{ proto DatePeriod::__set_state()
+*/
+PHP_METHOD(DatePeriod, __set_state)
+{
+ php_period_obj *period_obj;
+ zval *array;
+ HashTable *myht;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ myht = Z_ARRVAL_P(array);
+
+ object_init_ex(return_value, date_ce_period);
+ period_obj = zend_object_store_get_object(return_value TSRMLS_CC);
+ if (!php_date_period_initialize_from_hash(period_obj, myht TSRMLS_CC)) {
+ php_error(E_ERROR, "Invalid serialization data for DatePeriod object");
+ }
+}
+/* }}} */
+
+/* {{{ proto DatePeriod::__wakeup()
+*/
+PHP_METHOD(DatePeriod, __wakeup)
+{
+ zval *object = getThis();
+ php_period_obj *period_obj;
+ HashTable *myht;
+
+ period_obj = zend_object_store_get_object(object TSRMLS_CC);
+
+ myht = Z_OBJPROP_P(object);
+
+ if (!php_date_period_initialize_from_hash(period_obj, myht TSRMLS_CC)) {
+ php_error(E_ERROR, "Invalid serialization data for DatePeriod object");
+ }
+}
+/* }}} */
+
+/* {{{ date_period_read_property */
+static zval *date_period_read_property(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC)
+{
+ zval *zv;
+ if (type != BP_VAR_IS && type != BP_VAR_R) {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Retrieval of DatePeriod properties for modification is unsupported");
+ }
+
+ Z_OBJPROP_P(object); /* build properties hash table */
+
+ zv = std_object_handlers.read_property(object, member, type, key TSRMLS_CC);
+ if (Z_TYPE_P(zv) == IS_OBJECT && Z_OBJ_HANDLER_P(zv, clone_obj)) {
+ /* defensive copy */
+ zend_object_value zov = Z_OBJ_HANDLER_P(zv, clone_obj)(zv TSRMLS_CC);
+ MAKE_STD_ZVAL(zv);
+ Z_TYPE_P(zv) = IS_OBJECT;
+ Z_OBJVAL_P(zv) = zov;
+ }
+
+ return zv;
+}
+/* }}} */
+
+/* {{{ date_period_write_property */
+static void date_period_write_property(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC)
+{
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Writing to DatePeriod properties is unsupported");
+}
+/* }}} */
+
+
/*
* Local variables:
* tab-width: 4
diff --git a/ext/date/php_date.h b/ext/date/php_date.h
index f0b662b5d9..806c27ac5b 100644
--- a/ext/date/php_date.h
+++ b/ext/date/php_date.h
@@ -88,6 +88,8 @@ PHP_FUNCTION(date_interval_format);
PHP_FUNCTION(date_interval_create_from_date_string);
PHP_METHOD(DatePeriod, __construct);
+PHP_METHOD(DatePeriod, __wakeup);
+PHP_METHOD(DatePeriod, __set_state);
/* Options and Configuration */
PHP_FUNCTION(date_default_timezone_set);
diff --git a/ext/date/tests/bug45682.phpt b/ext/date/tests/bug45682.phpt
index d8bbfc5a04..ea8fa94706 100644
--- a/ext/date/tests/bug45682.phpt
+++ b/ext/date/tests/bug45682.phpt
@@ -11,8 +11,8 @@ $other = new DateTime("31-July-2008");
$diff = date_diff($date, $other);
var_dump($diff);
---EXPECT--
-object(DateInterval)#3 (8) {
+--EXPECTF--
+object(DateInterval)#%d (15) {
["y"]=>
int(0)
["m"]=>
@@ -25,8 +25,22 @@ object(DateInterval)#3 (8) {
int(0)
["s"]=>
int(0)
+ ["weekday"]=>
+ int(0)
+ ["weekday_behavior"]=>
+ int(0)
+ ["first_last_day_of"]=>
+ int(0)
["invert"]=>
int(0)
["days"]=>
int(3)
+ ["special_type"]=>
+ int(0)
+ ["special_amount"]=>
+ int(0)
+ ["have_weekday_relative"]=>
+ int(0)
+ ["have_special_relative"]=>
+ int(0)
}
diff --git a/ext/date/tests/bug48678.phpt b/ext/date/tests/bug48678.phpt
index e2cb724f76..253cb84ce6 100644
--- a/ext/date/tests/bug48678.phpt
+++ b/ext/date/tests/bug48678.phpt
@@ -15,8 +15,15 @@ DateInterval Object
[h] => 12
[i] => 30
[s] => 5
+ [weekday] => 0
+ [weekday_behavior] => 0
+ [first_last_day_of] => 0
[invert] => 0
- [days] =>%s
+ [days] =>
+ [special_type] => 0
+ [special_amount] => 0
+ [have_weekday_relative] => 0
+ [have_special_relative] => 0
)
DateInterval Object
(
@@ -26,6 +33,13 @@ DateInterval Object
[h] => 12
[i] => 30
[s] => 5
+ [weekday] => 0
+ [weekday_behavior] => 0
+ [first_last_day_of] => 0
[invert] => 0
- [days] =>%s
+ [days] => 0
+ [special_type] => 0
+ [special_amount] => 0
+ [have_weekday_relative] => 0
+ [have_special_relative] => 0
)
diff --git a/ext/date/tests/bug49081.phpt b/ext/date/tests/bug49081.phpt
index f4f02903d1..31f7351481 100644
--- a/ext/date/tests/bug49081.phpt
+++ b/ext/date/tests/bug49081.phpt
@@ -17,6 +17,13 @@ DateInterval Object
[h] => 4
[i] => 0
[s] => 0
+ [weekday] => 0
+ [weekday_behavior] => 0
+ [first_last_day_of] => 0
[invert] => 0
[days] => 30
+ [special_type] => 0
+ [special_amount] => 0
+ [have_weekday_relative] => 0
+ [have_special_relative] => 0
)
diff --git a/ext/date/tests/bug49778.phpt b/ext/date/tests/bug49778.phpt
index 67c8e27f91..2062d69168 100644
--- a/ext/date/tests/bug49778.phpt
+++ b/ext/date/tests/bug49778.phpt
@@ -8,7 +8,7 @@ echo $i->format("%d"), "\n";
echo $i->format("%a"), "\n";
?>
--EXPECT--
-object(DateInterval)#1 (8) {
+object(DateInterval)#1 (15) {
["y"]=>
int(0)
["m"]=>
@@ -21,10 +21,24 @@ object(DateInterval)#1 (8) {
int(0)
["s"]=>
int(0)
+ ["weekday"]=>
+ int(0)
+ ["weekday_behavior"]=>
+ int(0)
+ ["first_last_day_of"]=>
+ int(0)
["invert"]=>
int(0)
["days"]=>
bool(false)
+ ["special_type"]=>
+ int(0)
+ ["special_amount"]=>
+ int(0)
+ ["have_weekday_relative"]=>
+ int(0)
+ ["have_special_relative"]=>
+ int(0)
}
7
(unknown)
diff --git a/ext/date/tests/bug52113.phpt b/ext/date/tests/bug52113.phpt
index a7d9339d13..f4730c6a44 100644
--- a/ext/date/tests/bug52113.phpt
+++ b/ext/date/tests/bug52113.phpt
@@ -32,7 +32,7 @@ var_dump($unser, $p);
?>
--EXPECT--
-object(DateInterval)#3 (8) {
+object(DateInterval)#3 (15) {
["y"]=>
int(0)
["m"]=>
@@ -45,12 +45,26 @@ object(DateInterval)#3 (8) {
int(0)
["s"]=>
int(0)
+ ["weekday"]=>
+ int(0)
+ ["weekday_behavior"]=>
+ int(0)
+ ["first_last_day_of"]=>
+ int(0)
["invert"]=>
int(0)
["days"]=>
int(0)
+ ["special_type"]=>
+ int(0)
+ ["special_amount"]=>
+ int(0)
+ ["have_weekday_relative"]=>
+ int(0)
+ ["have_special_relative"]=>
+ int(0)
}
-string(128) "O:12:"DateInterval":8:{s:1:"y";i:0;s:1:"m";i:0;s:1:"d";i:0;s:1:"h";i:4;s:1:"i";i:0;s:1:"s";i:0;s:6:"invert";i:0;s:4:"days";i:0;}"
+string(320) "O:12:"DateInterval":15:{s:1:"y";i:0;s:1:"m";i:0;s:1:"d";i:0;s:1:"h";i:4;s:1:"i";i:0;s:1:"s";i:0;s:7:"weekday";i:0;s:16:"weekday_behavior";i:0;s:17:"first_last_day_of";i:0;s:6:"invert";i:0;s:4:"days";i:0;s:12:"special_type";i:0;s:14:"special_amount";i:0;s:21:"have_weekday_relative";i:0;s:21:"have_special_relative";i:0;}"
DateInterval::__set_state(array(
'y' => 0,
'm' => 0,
@@ -58,9 +72,16 @@ DateInterval::__set_state(array(
'h' => 4,
'i' => 0,
's' => 0,
+ 'weekday' => 0,
+ 'weekday_behavior' => 0,
+ 'first_last_day_of' => 0,
'invert' => 0,
'days' => 0,
-))object(DateInterval)#5 (8) {
+ 'special_type' => 0,
+ 'special_amount' => 0,
+ 'have_weekday_relative' => 0,
+ 'have_special_relative' => 0,
+))object(DateInterval)#5 (15) {
["y"]=>
int(0)
["m"]=>
@@ -73,14 +94,78 @@ DateInterval::__set_state(array(
int(0)
["s"]=>
int(0)
+ ["weekday"]=>
+ int(0)
+ ["weekday_behavior"]=>
+ int(0)
+ ["first_last_day_of"]=>
+ int(0)
["invert"]=>
int(0)
["days"]=>
int(0)
+ ["special_type"]=>
+ int(0)
+ ["special_amount"]=>
+ int(0)
+ ["have_weekday_relative"]=>
+ int(0)
+ ["have_special_relative"]=>
+ int(0)
}
-object(DatePeriod)#6 (0) {
+object(DatePeriod)#6 (6) {
+ ["start"]=>
+ object(DateTime)#4 (3) {
+ ["date"]=>
+ string(19) "2003-01-02 08:00:00"
+ ["timezone_type"]=>
+ int(3)
+ ["timezone"]=>
+ string(3) "UTC"
+ }
+ ["current"]=>
+ NULL
+ ["end"]=>
+ NULL
+ ["interval"]=>
+ object(DateInterval)#7 (15) {
+ ["y"]=>
+ int(0)
+ ["m"]=>
+ int(0)
+ ["d"]=>
+ int(0)
+ ["h"]=>
+ int(4)
+ ["i"]=>
+ int(0)
+ ["s"]=>
+ int(0)
+ ["weekday"]=>
+ int(0)
+ ["weekday_behavior"]=>
+ int(0)
+ ["first_last_day_of"]=>
+ int(0)
+ ["invert"]=>
+ int(0)
+ ["days"]=>
+ int(0)
+ ["special_type"]=>
+ int(0)
+ ["special_amount"]=>
+ int(0)
+ ["have_weekday_relative"]=>
+ int(0)
+ ["have_special_relative"]=>
+ int(0)
+ }
+ ["recurrences"]=>
+ int(3)
+ ["include_start_date"]=>
+ bool(true)
}
-object(DateInterval)#4 (8) {
+object(DateInterval)#8 (15) {
["y"]=>
int(7)
["m"]=>
@@ -93,10 +178,74 @@ object(DateInterval)#4 (8) {
int(3)
["s"]=>
int(2)
+ ["weekday"]=>
+ int(-1)
+ ["weekday_behavior"]=>
+ int(-1)
+ ["first_last_day_of"]=>
+ int(-1)
["invert"]=>
int(1)
["days"]=>
int(2400)
+ ["special_type"]=>
+ int(0)
+ ["special_amount"]=>
+ int(-1)
+ ["have_weekday_relative"]=>
+ int(0)
+ ["have_special_relative"]=>
+ int(0)
}
-object(DatePeriod)#7 (0) {
+object(DatePeriod)#9 (6) {
+ ["start"]=>
+ object(DateTime)#6 (3) {
+ ["date"]=>
+ string(19) "2003-01-02 08:00:00"
+ ["timezone_type"]=>
+ int(3)
+ ["timezone"]=>
+ string(3) "UTC"
+ }
+ ["current"]=>
+ NULL
+ ["end"]=>
+ NULL
+ ["interval"]=>
+ object(DateInterval)#7 (15) {
+ ["y"]=>
+ int(0)
+ ["m"]=>
+ int(0)
+ ["d"]=>
+ int(0)
+ ["h"]=>
+ int(4)
+ ["i"]=>
+ int(0)
+ ["s"]=>
+ int(0)
+ ["weekday"]=>
+ int(0)
+ ["weekday_behavior"]=>
+ int(0)
+ ["first_last_day_of"]=>
+ int(0)
+ ["invert"]=>
+ int(0)
+ ["days"]=>
+ int(0)
+ ["special_type"]=>
+ int(0)
+ ["special_amount"]=>
+ int(0)
+ ["have_weekday_relative"]=>
+ int(0)
+ ["have_special_relative"]=>
+ int(0)
+ }
+ ["recurrences"]=>
+ int(3)
+ ["include_start_date"]=>
+ bool(true)
}
diff --git a/ext/date/tests/bug52738.phpt b/ext/date/tests/bug52738.phpt
index fc1b6029e9..ea219f7c7c 100644
--- a/ext/date/tests/bug52738.phpt
+++ b/ext/date/tests/bug52738.phpt
@@ -27,6 +27,13 @@ di Object
[h] => 0
[i] => 0
[s] => 0
+ [weekday] => 0
+ [weekday_behavior] => 0
+ [first_last_day_of] => 0
[invert] => 0
[days] =>
+ [special_type] => 0
+ [special_amount] => 0
+ [have_weekday_relative] => 0
+ [have_special_relative] => 0
)
diff --git a/ext/date/tests/bug52808.phpt b/ext/date/tests/bug52808.phpt
index e031ac6ee3..1f0fc84cd7 100644
--- a/ext/date/tests/bug52808.phpt
+++ b/ext/date/tests/bug52808.phpt
@@ -25,7 +25,7 @@ foreach($intervals as $iv) {
echo "==DONE==\n";
?>
--EXPECTF--
-object(DateInterval)#%d (8) {
+object(DateInterval)#%d (15) {
["y"]=>
int(1)
["m"]=>
@@ -38,12 +38,26 @@ object(DateInterval)#%d (8) {
int(30)
["s"]=>
int(0)
+ ["weekday"]=>
+ int(0)
+ ["weekday_behavior"]=>
+ int(0)
+ ["first_last_day_of"]=>
+ int(0)
["invert"]=>
int(1)
["days"]=>
int(437)
+ ["special_type"]=>
+ int(0)
+ ["special_amount"]=>
+ int(0)
+ ["have_weekday_relative"]=>
+ int(0)
+ ["have_special_relative"]=>
+ int(0)
}
-object(DateInterval)#%d (8) {
+object(DateInterval)#%d (15) {
["y"]=>
int(0)
["m"]=>
@@ -56,12 +70,26 @@ object(DateInterval)#%d (8) {
int(30)
["s"]=>
int(0)
+ ["weekday"]=>
+ int(0)
+ ["weekday_behavior"]=>
+ int(0)
+ ["first_last_day_of"]=>
+ int(0)
["invert"]=>
int(0)
["days"]=>
int(294)
+ ["special_type"]=>
+ int(0)
+ ["special_amount"]=>
+ int(0)
+ ["have_weekday_relative"]=>
+ int(0)
+ ["have_special_relative"]=>
+ int(0)
}
-object(DateInterval)#%d (8) {
+object(DateInterval)#%d (15) {
["y"]=>
int(0)
["m"]=>
@@ -74,10 +102,24 @@ object(DateInterval)#%d (8) {
int(30)
["s"]=>
int(0)
+ ["weekday"]=>
+ int(0)
+ ["weekday_behavior"]=>
+ int(0)
+ ["first_last_day_of"]=>
+ int(0)
["invert"]=>
int(0)
["days"]=>
int(294)
+ ["special_type"]=>
+ int(0)
+ ["special_amount"]=>
+ int(0)
+ ["have_weekday_relative"]=>
+ int(0)
+ ["have_special_relative"]=>
+ int(0)
}
DateInterval::__construct(): Failed to parse interval (2007-05-11T15:30:00Z/)
DateInterval::__construct(): Failed to parse interval (2007-05-11T15:30:00Z)
diff --git a/ext/date/tests/bug53437.phpt b/ext/date/tests/bug53437.phpt
index f089866538..2ea091453f 100644
--- a/ext/date/tests/bug53437.phpt
+++ b/ext/date/tests/bug53437.phpt
@@ -1,7 +1,5 @@
--TEST--
-Bug #53437 (Crash when using unserialized DatePeriod instance)
---XFAIL--
-Bug #53437 Not fixed yet
+Bug #53437 (Crash when using unserialized DatePeriod instance), variation 1
--FILE--
<?php
$dp = new DatePeriod(new DateTime('2010-01-01 UTC'), new DateInterval('P1D'), 2);
@@ -20,9 +18,137 @@ $dpu = unserialize($ser); // $dpu has invalid values???
var_dump($dpu);
echo "Unserialized:\r\n";
-// ???which leads to CRASH:
foreach($dpu as $dt) {
echo $dt->format('Y-m-d H:i:s')."\r\n";
}
?>
+==DONE==
--EXPECT--
+Original:
+2010-01-01 00:00:00
+2010-01-02 00:00:00
+2010-01-03 00:00:00
+
+object(DatePeriod)#1 (6) {
+ ["start"]=>
+ object(DateTime)#2 (3) {
+ ["date"]=>
+ string(19) "2010-01-01 00:00:00"
+ ["timezone_type"]=>
+ int(3)
+ ["timezone"]=>
+ string(3) "UTC"
+ }
+ ["current"]=>
+ object(DateTime)#4 (3) {
+ ["date"]=>
+ string(19) "2010-01-04 00:00:00"
+ ["timezone_type"]=>
+ int(3)
+ ["timezone"]=>
+ string(3) "UTC"
+ }
+ ["end"]=>
+ NULL
+ ["interval"]=>
+ object(DateInterval)#5 (15) {
+ ["y"]=>
+ int(0)
+ ["m"]=>
+ int(0)
+ ["d"]=>
+ int(1)
+ ["h"]=>
+ int(0)
+ ["i"]=>
+ int(0)
+ ["s"]=>
+ int(0)
+ ["weekday"]=>
+ int(0)
+ ["weekday_behavior"]=>
+ int(0)
+ ["first_last_day_of"]=>
+ int(0)
+ ["invert"]=>
+ int(0)
+ ["days"]=>
+ bool(false)
+ ["special_type"]=>
+ int(0)
+ ["special_amount"]=>
+ int(0)
+ ["have_weekday_relative"]=>
+ int(0)
+ ["have_special_relative"]=>
+ int(0)
+ }
+ ["recurrences"]=>
+ int(3)
+ ["include_start_date"]=>
+ bool(true)
+}
+object(DatePeriod)#5 (6) {
+ ["start"]=>
+ object(DateTime)#10 (3) {
+ ["date"]=>
+ string(19) "2010-01-01 00:00:00"
+ ["timezone_type"]=>
+ int(3)
+ ["timezone"]=>
+ string(3) "UTC"
+ }
+ ["current"]=>
+ object(DateTime)#7 (3) {
+ ["date"]=>
+ string(19) "2010-01-04 00:00:00"
+ ["timezone_type"]=>
+ int(3)
+ ["timezone"]=>
+ string(3) "UTC"
+ }
+ ["end"]=>
+ NULL
+ ["interval"]=>
+ object(DateInterval)#8 (15) {
+ ["y"]=>
+ int(0)
+ ["m"]=>
+ int(0)
+ ["d"]=>
+ int(1)
+ ["h"]=>
+ int(0)
+ ["i"]=>
+ int(0)
+ ["s"]=>
+ int(0)
+ ["weekday"]=>
+ int(0)
+ ["weekday_behavior"]=>
+ int(0)
+ ["first_last_day_of"]=>
+ int(0)
+ ["invert"]=>
+ int(0)
+ ["days"]=>
+ int(0)
+ ["special_type"]=>
+ int(0)
+ ["special_amount"]=>
+ int(0)
+ ["have_weekday_relative"]=>
+ int(0)
+ ["have_special_relative"]=>
+ int(0)
+ }
+ ["recurrences"]=>
+ int(3)
+ ["include_start_date"]=>
+ bool(true)
+}
+Unserialized:
+2010-01-01 00:00:00
+2010-01-02 00:00:00
+2010-01-03 00:00:00
+==DONE==
diff --git a/ext/date/tests/bug53437_var1.phpt b/ext/date/tests/bug53437_var1.phpt
new file mode 100644
index 0000000000..f1f9843d5e
--- /dev/null
+++ b/ext/date/tests/bug53437_var1.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Bug #53437 (Crash when using unserialized DatePeriod instance), variation 2
+--FILE--
+<?php
+$s = 'O:10:"DatePeriod":0:{}';
+
+$dp = unserialize($s);
+
+var_dump($dp);
+?>
+==DONE==
+--EXPECTF--
+Fatal error: Invalid serialization data for DatePeriod object in %sbug53437_var1.php on line %d
diff --git a/ext/date/tests/bug53437_var2.phpt b/ext/date/tests/bug53437_var2.phpt
new file mode 100644
index 0000000000..50aebda57c
--- /dev/null
+++ b/ext/date/tests/bug53437_var2.phpt
@@ -0,0 +1,80 @@
+--TEST--
+Bug #53437 DateInterval basic serialization
+--FILE--
+<?php
+$di0 = new DateInterval('P2Y4DT6H8M');
+
+$s = serialize($di0);
+
+$di1 = unserialize($s);
+
+var_dump($di0, $di1);
+
+?>
+==DONE==
+--EXPECT--
+object(DateInterval)#1 (15) {
+ ["y"]=>
+ int(2)
+ ["m"]=>
+ int(0)
+ ["d"]=>
+ int(4)
+ ["h"]=>
+ int(6)
+ ["i"]=>
+ int(8)
+ ["s"]=>
+ int(0)
+ ["weekday"]=>
+ int(0)
+ ["weekday_behavior"]=>
+ int(0)
+ ["first_last_day_of"]=>
+ int(0)
+ ["invert"]=>
+ int(0)
+ ["days"]=>
+ bool(false)
+ ["special_type"]=>
+ int(0)
+ ["special_amount"]=>
+ int(0)
+ ["have_weekday_relative"]=>
+ int(0)
+ ["have_special_relative"]=>
+ int(0)
+}
+object(DateInterval)#2 (15) {
+ ["y"]=>
+ int(2)
+ ["m"]=>
+ int(0)
+ ["d"]=>
+ int(4)
+ ["h"]=>
+ int(6)
+ ["i"]=>
+ int(8)
+ ["s"]=>
+ int(0)
+ ["weekday"]=>
+ int(0)
+ ["weekday_behavior"]=>
+ int(0)
+ ["first_last_day_of"]=>
+ int(0)
+ ["invert"]=>
+ int(0)
+ ["days"]=>
+ int(0)
+ ["special_type"]=>
+ int(0)
+ ["special_amount"]=>
+ int(0)
+ ["have_weekday_relative"]=>
+ int(0)
+ ["have_special_relative"]=>
+ int(0)
+}
+==DONE==
diff --git a/ext/date/tests/bug53437_var3.phpt b/ext/date/tests/bug53437_var3.phpt
new file mode 100644
index 0000000000..82b90f559b
--- /dev/null
+++ b/ext/date/tests/bug53437_var3.phpt
@@ -0,0 +1,47 @@
+--TEST--
+Bug #53437 DateInterval unserialize bad data, 32 bit
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 4) { die('skip 32 bit only'); } ?>
+--FILE--
+<?php
+$s = 'O:12:"DateInterval":15:{s:1:"y";s:1:"2";s:1:"m";s:1:"0";s:1:"d";s:3:"bla";s:1:"h";s:1:"6";s:1:"i";s:1:"8";s:1:"s";s:1:"0";s:7:"weekday";i:10;s:16:"weekday_behavior";i:10;s:17:"first_last_day_of";i:0;s:6:"invert";i:0;s:4:"days";s:4:"aoeu";s:12:"special_type";i:0;s:14:"special_amount";s:21:"234523452345234532455";s:21:"have_weekday_relative";i:21474836489;s:21:"have_special_relative";s:3:"bla";}';
+
+$di = unserialize($s);
+var_dump($di);
+
+?>
+==DONE==
+--EXPECTF--
+object(DateInterval)#%d (15) {
+ ["y"]=>
+ int(2)
+ ["m"]=>
+ int(0)
+ ["d"]=>
+ int(0)
+ ["h"]=>
+ int(6)
+ ["i"]=>
+ int(8)
+ ["s"]=>
+ int(0)
+ ["weekday"]=>
+ int(10)
+ ["weekday_behavior"]=>
+ int(10)
+ ["first_last_day_of"]=>
+ int(0)
+ ["invert"]=>
+ int(0)
+ ["days"]=>
+ int(0)
+ ["special_type"]=>
+ int(0)
+ ["special_amount"]=>
+ int(-1)
+ ["have_weekday_relative"]=>
+ int(9)
+ ["have_special_relative"]=>
+ int(0)
+}
+==DONE==
diff --git a/ext/date/tests/bug53437_var4.phpt b/ext/date/tests/bug53437_var4.phpt
new file mode 100644
index 0000000000..88fd81c9db
--- /dev/null
+++ b/ext/date/tests/bug53437_var4.phpt
@@ -0,0 +1,64 @@
+--TEST--
+Bug #53437 (Check that var_dump out is the same using the whole object or it's single properties), variation 4
+--INI--
+date.timezone = Europe/Berlin
+--FILE--
+<?php
+$dt = new DateTime('2009-10-11');
+
+$df = $dt->diff(new DateTime('2009-10-13'));
+
+var_dump($df,
+ $df->y,
+ $df->m,
+ $df->d,
+ $df->h,
+ $df->i,
+ $df->s,
+ $df->invert,
+ $df->days);
+
+?>
+==DONE==
+--EXPECTF--
+object(DateInterval)#%d (15) {
+ ["y"]=>
+ int(0)
+ ["m"]=>
+ int(0)
+ ["d"]=>
+ int(2)
+ ["h"]=>
+ int(0)
+ ["i"]=>
+ int(0)
+ ["s"]=>
+ int(0)
+ ["weekday"]=>
+ int(0)
+ ["weekday_behavior"]=>
+ int(0)
+ ["first_last_day_of"]=>
+ int(0)
+ ["invert"]=>
+ int(0)
+ ["days"]=>
+ int(2)
+ ["special_type"]=>
+ int(0)
+ ["special_amount"]=>
+ int(0)
+ ["have_weekday_relative"]=>
+ int(0)
+ ["have_special_relative"]=>
+ int(0)
+}
+int(0)
+int(0)
+int(2)
+int(0)
+int(0)
+int(0)
+int(0)
+int(2)
+==DONE==
diff --git a/ext/date/tests/bug53437_var5.phpt b/ext/date/tests/bug53437_var5.phpt
new file mode 100644
index 0000000000..e95fcdae96
--- /dev/null
+++ b/ext/date/tests/bug53437_var5.phpt
@@ -0,0 +1,47 @@
+--TEST--
+Bug #53437 DateInterval unserialize bad data, 64 bit
+--SKIPIF--
+<?php if (PHP_INT_SIZE != 8) { die('skip true 64 bit only'); } ?>
+--FILE--
+<?php
+$s = 'O:12:"DateInterval":15:{s:1:"y";s:1:"2";s:1:"m";s:1:"0";s:1:"d";s:3:"bla";s:1:"h";s:1:"6";s:1:"i";s:1:"8";s:1:"s";s:1:"0";s:7:"weekday";i:10;s:16:"weekday_behavior";i:10;s:17:"first_last_day_of";i:0;s:6:"invert";i:0;s:4:"days";s:4:"aoeu";s:12:"special_type";i:0;s:14:"special_amount";s:21:"234523452345234532455";s:21:"have_weekday_relative";i:21474836489;s:21:"have_special_relative";s:3:"bla";}';
+
+$di = unserialize($s);
+var_dump($di);
+
+?>
+==DONE==
+--EXPECTF--
+object(DateInterval)#%d (15) {
+ ["y"]=>
+ int(2)
+ ["m"]=>
+ int(0)
+ ["d"]=>
+ int(0)
+ ["h"]=>
+ int(6)
+ ["i"]=>
+ int(8)
+ ["s"]=>
+ int(0)
+ ["weekday"]=>
+ int(10)
+ ["weekday_behavior"]=>
+ int(10)
+ ["first_last_day_of"]=>
+ int(0)
+ ["invert"]=>
+ int(0)
+ ["days"]=>
+ int(0)
+ ["special_type"]=>
+ int(0)
+ ["special_amount"]=>
+ int(9223372036854775807)
+ ["have_weekday_relative"]=>
+ int(9)
+ ["have_special_relative"]=>
+ int(0)
+}
+==DONE==
diff --git a/ext/date/tests/date_diff1.phpt b/ext/date/tests/date_diff1.phpt
index cf32fcbf3b..a908cdba75 100644
--- a/ext/date/tests/date_diff1.phpt
+++ b/ext/date/tests/date_diff1.phpt
@@ -28,7 +28,7 @@ object(DateTime)#2 (3) {
["timezone"]=>
string(3) "EDT"
}
-object(DateInterval)#3 (8) {
+object(DateInterval)#3 (15) {
["y"]=>
int(0)
["m"]=>
@@ -41,8 +41,22 @@ object(DateInterval)#3 (8) {
int(19)
["s"]=>
int(40)
+ ["weekday"]=>
+ int(0)
+ ["weekday_behavior"]=>
+ int(0)
+ ["first_last_day_of"]=>
+ int(0)
["invert"]=>
int(0)
["days"]=>
int(33)
+ ["special_type"]=>
+ int(0)
+ ["special_amount"]=>
+ int(0)
+ ["have_weekday_relative"]=>
+ int(0)
+ ["have_special_relative"]=>
+ int(0)
}
diff --git a/ext/date/tests/date_sunrise_and_sunset_basic.phpt b/ext/date/tests/date_sunrise_and_sunset_basic.phpt
index a96fa83034..f89b63fd93 100644
--- a/ext/date/tests/date_sunrise_and_sunset_basic.phpt
+++ b/ext/date/tests/date_sunrise_and_sunset_basic.phpt
@@ -14,7 +14,7 @@ offset: +1 GMT
echo "Basic test for date_sunrise() and date_sunset()\n";
-// supress date() function strict msgs
+// suppress date() function strict msgs
error_reporting(E_ALL & ~E_STRICT);
echo date("D M d Y") . ', sunrise time : ' . date_sunrise(time(), SUNFUNCS_RET_STRING, 38.4, -9, 90, 1) . "\n";
diff --git a/ext/dba/tests/dba_cdb_read.phpt b/ext/dba/tests/dba_cdb_read.phpt
index 71575f5d85..a782a572e9 100644
--- a/ext/dba/tests/dba_cdb_read.phpt
+++ b/ext/dba/tests/dba_cdb_read.phpt
@@ -20,7 +20,7 @@ DBA CDB handler test (read only)
$keys .= $a;
$count++;
}
- // display number of entries and key existance
+ // display number of entries and key existence
echo $count;
for ($i=1; $i<8; $i++) {
echo dba_exists($i, $db_file) ? "Y" : "N";
diff --git a/ext/dom/element.c b/ext/dom/element.c
index f217ca2450..606a23f9cb 100644
--- a/ext/dom/element.c
+++ b/ext/dom/element.c
@@ -177,7 +177,7 @@ PHP_METHOD(domelement, __construct)
RETURN_FALSE;
}
- /* Namespace logic is seperate and only when uri passed in to insure no BC breakage */
+ /* Namespace logic is separate and only when uri passed in to insure no BC breakage */
if (uri_len > 0) {
errorcode = dom_check_qname(name, &localname, &prefix, uri_len, name_len);
if (errorcode == 0) {
diff --git a/ext/dom/tests/DOMDocument_loadHTMLfile.phpt b/ext/dom/tests/DOMDocument_loadHTMLfile.phpt
new file mode 100644
index 0000000000..93a614903f
--- /dev/null
+++ b/ext/dom/tests/DOMDocument_loadHTMLfile.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Test DOMDocument::loadHTMLFile
+--DESCRIPTION--
+Verifies the basic behaviour of the method
+--CREDITS--
+Antonio Diaz Ruiz <dejalatele@gmail.com>
+--INI--
+assert.bail=true
+--SKIPIF--
+<?php include('skipif.inc'); ?>
+--FILE--
+<?php
+$doc = new DOMDocument();
+$result = $doc->loadHTMLFile(dirname(__FILE__) . "/test.html");
+assert('$result === true');
+?>
+--EXPECT--
diff --git a/ext/dom/tests/DOMDocument_loadHTMLfile_error1.phpt b/ext/dom/tests/DOMDocument_loadHTMLfile_error1.phpt
new file mode 100644
index 0000000000..aee51966a3
--- /dev/null
+++ b/ext/dom/tests/DOMDocument_loadHTMLfile_error1.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Test DOMDocument::loadHTMLFile when the file doesn't exist
+--DESCRIPTION--
+Verifies that an error message is showed if the file doesn't exist
+--CREDITS--
+Antonio Diaz Ruiz <dejalatele@gmail.com>
+--INI--
+assert.bail=true
+--SKIPIF--
+<?php include('skipif.inc'); ?>
+--FILE--
+<?php
+$doc = new DOMDocument();
+$result = $doc->loadHTMLFile(dirname(__FILE__) . "/ffff/test.html");
+assert('$result === false');
+?>
+--EXPECTF--
+%r(PHP ){0,1}%rWarning: DOMDocument::loadHTMLFile(): I/O warning : failed to load external entity %s
diff --git a/ext/dom/tests/DOMDocument_loadHTMLfile_error2.phpt b/ext/dom/tests/DOMDocument_loadHTMLfile_error2.phpt
new file mode 100644
index 0000000000..e59ff56c5a
--- /dev/null
+++ b/ext/dom/tests/DOMDocument_loadHTMLfile_error2.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Test DOMDocument::loadHTMLFile when an empty string is passed
+--DESCRIPTION--
+Verifies that an error message is showed if an empty string is passed as argument
+--CREDITS--
+Antonio Diaz Ruiz <dejalatele@gmail.com>
+--INI--
+assert.bail=true
+--SKIPIF--
+<?php include('skipif.inc'); ?>
+--FILE--
+<?php
+$doc = new DOMDocument();
+$result = $doc->loadHTMLFile("");
+assert('$result === false');
+?>
+--EXPECTF--
+%r(PHP ){0,1}%rWarning: DOMDocument::loadHTMLFile(): Empty string supplied as input %s
diff --git a/ext/dom/tests/DOMDocument_loadHTMLfile_variation1.phpt b/ext/dom/tests/DOMDocument_loadHTMLfile_variation1.phpt
new file mode 100644
index 0000000000..2535772c78
--- /dev/null
+++ b/ext/dom/tests/DOMDocument_loadHTMLfile_variation1.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Test DOMDocument::loadHTMLFile when an empty document is loaded
+--DESCRIPTION--
+Verifies that an warning message is showed if an empty document is loaded
+--CREDITS--
+Antonio Diaz Ruiz <dejalatele@gmail.com>
+--INI--
+assert.bail=true
+--SKIPIF--
+<?php include('skipif.inc'); ?>
+--FILE--
+<?php
+$doc = new DOMDocument();
+$result = $doc->loadHTMLFile(dirname(__FILE__) . "/empty.html");
+assert('$result === true');
+?>
+--EXPECTF--
+%r(PHP ){0,1}%rWarning: DOMDocument::loadHTMLFile(): Document is empty %s
diff --git a/ext/dom/tests/DOMDocument_loadHTMLfile_variation2.phpt b/ext/dom/tests/DOMDocument_loadHTMLfile_variation2.phpt
new file mode 100644
index 0000000000..829686dd65
--- /dev/null
+++ b/ext/dom/tests/DOMDocument_loadHTMLfile_variation2.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Test DOMDocument::loadHTMLFile when a not-well formed document is loaded
+--DESCRIPTION--
+Verifies the behavior if a not-well formed document is loaded
+--CREDITS--
+Antonio Diaz Ruiz <dejalatele@gmail.com>
+--INI--
+assert.bail=true
+--SKIPIF--
+<?php include('skipif.inc'); ?>
+--FILE--
+<?php
+$doc = new DOMDocument();
+$result = $doc->loadHTMLFile(dirname(__FILE__) . "/not_well.html");
+assert('$result === true');
+?>
+--EXPECT--
diff --git a/ext/dom/tests/DOMNode_removeChild_basic.phpt b/ext/dom/tests/DOMNode_removeChild_basic.phpt
index 384eb47b5e..fb0977488e 100644
--- a/ext/dom/tests/DOMNode_removeChild_basic.phpt
+++ b/ext/dom/tests/DOMNode_removeChild_basic.phpt
@@ -39,7 +39,7 @@ $root = $dom->documentElement;
$children = $root->childNodes;
$len = $children->length;
-echo "orignal has $len nodes\n";
+echo "original has $len nodes\n";
for ($index = $children->length - 1; $index >=0; $index--) {
echo "node $index\n";
$current = $children->item($index);
@@ -58,7 +58,7 @@ for ($index = 0; $index < $children->length; $index++) {
}
--EXPECTF--
-orignal has 5 nodes
+original has 5 nodes
node 4
Course: no title:DOMText
~string(1) "
diff --git a/ext/dom/tests/empty.html b/ext/dom/tests/empty.html
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ext/dom/tests/empty.html
diff --git a/ext/dom/tests/not_well.html b/ext/dom/tests/not_well.html
new file mode 100644
index 0000000000..151f46295f
--- /dev/null
+++ b/ext/dom/tests/not_well.html
@@ -0,0 +1,8 @@
+<head>
+<title>Hello world</title>
+</head>
+<body>
+This is a not well-formed<br>
+html files with undeclared entities&nbsp;
+</body>
+</html>
diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c
index e4b4263766..141192c67f 100644
--- a/ext/enchant/enchant.c
+++ b/ext/enchant/enchant.c
@@ -651,7 +651,7 @@ PHP_FUNCTION(enchant_broker_free_dict)
/* }}} */
/* {{{ proto bool enchant_broker_dict_exists(resource broker, string tag)
- Wether a dictionary exists or not. Using non-empty tag */
+ Whether a dictionary exists or not. Using non-empty tag */
PHP_FUNCTION(enchant_broker_dict_exists)
{
zval *broker;
diff --git a/ext/exif/tests/exif_tagname_variation1.phpt b/ext/exif/tests/exif_tagname_variation1.phpt
index da899194c7..0f9c135420 100644
--- a/ext/exif/tests/exif_tagname_variation1.phpt
+++ b/ext/exif/tests/exif_tagname_variation1.phpt
@@ -78,7 +78,7 @@ $values = array (
// loop through each element of the array and check the working of exif_tagname()
-// when $index arugment is supplied with different values
+// when $index argument is supplied with different values
echo "\n--- Testing exif_tagname() by supplying different values for 'index' argument ---\n";
$counter = 1;
diff --git a/ext/fileinfo/libmagic.patch b/ext/fileinfo/libmagic.patch
index ced3b2bb51..97e771e920 100644
--- a/ext/fileinfo/libmagic.patch
+++ b/ext/fileinfo/libmagic.patch
@@ -2978,7 +2978,7 @@ diff -u libmagic.orig/readelf.h libmagic/readelf.h
typedef uint8_t Elf64_Char;
diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
--- libmagic.orig/softmagic.c 2013-03-21 18:45:14.000000000 +0100
-+++ libmagic/softmagic.c 2013-04-08 15:42:57.328298809 +0200
++++ libmagic/softmagic.c 2013-05-14 11:00:07.044745939 +0200
@@ -41,6 +41,11 @@
#include <stdlib.h>
#include <time.h>
@@ -3123,7 +3123,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
}
}
-@@ -1717,9 +1694,9 @@
+@@ -1717,12 +1694,12 @@
ms->o.buf = sbuf;
ms->offset = soffset;
if (rv == 1) {
@@ -3134,7 +3134,11 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
+ return -1;
if (file_printf(ms, "%s", rbuf) == -1)
return -1;
- free(rbuf);
+- free(rbuf);
++ efree(rbuf);
+ }
+ return rv;
+
@@ -1837,6 +1814,42 @@
return file_strncmp(a, b, len, flags);
}
diff --git a/ext/fileinfo/libmagic/softmagic.c b/ext/fileinfo/libmagic/softmagic.c
index c69fdb5a3e..1e7dbf7449 100644
--- a/ext/fileinfo/libmagic/softmagic.c
+++ b/ext/fileinfo/libmagic/softmagic.c
@@ -1699,7 +1699,7 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
return -1;
if (file_printf(ms, "%s", rbuf) == -1)
return -1;
- free(rbuf);
+ efree(rbuf);
}
return rv;
diff --git a/ext/fileinfo/tests/finfo_file_002.phpt b/ext/fileinfo/tests/finfo_file_002.phpt
index 3593233c39..feb4010f74 100644
--- a/ext/fileinfo/tests/finfo_file_002.phpt
+++ b/ext/fileinfo/tests/finfo_file_002.phpt
@@ -18,7 +18,7 @@ ksort($results);
var_dump($results);
?>
--EXPECTF--
-array(7) {
+array(8) {
["%s/resources/dir.zip"]=>
string(15) "application/zip"
["%s/resources/test.awk"]=>
@@ -29,6 +29,8 @@ array(7) {
string(9) "image/gif"
["%s/resources/test.jpg"]=>
string(10) "image/jpeg"
+ ["%s/resources/test.mp3"]=>
+ string(10) "audio/mpeg"
["%s/resources/test.pdf"]=>
string(15) "application/pdf"
["%s/resources/test.png"]=>
diff --git a/ext/fileinfo/tests/finfo_phpinfo_basic.phpt b/ext/fileinfo/tests/finfo_phpinfo_basic.phpt
index c43ba4e298..7d1b008d5a 100644
--- a/ext/fileinfo/tests/finfo_phpinfo_basic.phpt
+++ b/ext/fileinfo/tests/finfo_phpinfo_basic.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test finfo extention : loading into phpinfo()
+Test finfo extension : loading into phpinfo()
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
--FILE--
diff --git a/ext/fileinfo/tests/magic b/ext/fileinfo/tests/magic
index 5266dd0dc5..27bde927e6 100644
--- a/ext/fileinfo/tests/magic
+++ b/ext/fileinfo/tests/magic
@@ -4957,7 +4957,7 @@
>>>>0 ubelong =0 \b, next free block index %lu
>>>>0 ubelong !0 \b, next free block index %lu
>>>512 default x dBase IV DBT
-# DBF file name without extention
+# DBF file name without extension
>>>>8 string >\0 \b of %-.8s.DBF
# size of blocks ; not reliable 0x2020204C
#>>>>4 ulelong =0 \b, blocks size %lu
@@ -13205,7 +13205,7 @@
# they have their real name at offset 22
>>>>>22 string >\0 \b%-.5s
>4 uleshort&0x8000 0x0000
-# 32 bit sector adressing ( > 32 MB) for block devices
+# 32 bit sector addressing ( > 32 MB) for block devices
>>4 uleshort&0x0002 0x0002 \b,32-bit sector-
# support by driver functions 13h, 17h, 18h
>4 uleshort&0x0040 0x0040 \b,IOCTL-
@@ -17951,7 +17951,7 @@
# 00030 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 ................
# 00040 00 00 00 00 ff ff ff ff ff ff ff ff 02 00 00 00 ................
#
-# GRR this test is still too general as it catches example adressen.dbt
+# GRR this test is still too general as it catches example addressen.dbt
0 belong 0x03000000
>8 ubelong 0xec020000 VMS Alpha executable
>>75264 string PK\003\004 \b, Info-ZIP SFX archive v5.12 w/decryption
diff --git a/ext/fileinfo/tests/resources/test.mp3 b/ext/fileinfo/tests/resources/test.mp3
new file mode 100644
index 0000000000..ff6dc3ad75
--- /dev/null
+++ b/ext/fileinfo/tests/resources/test.mp3
Binary files differ
diff --git a/ext/filter/tests/bug49510.phpt b/ext/filter/tests/bug49510.phpt
index 3f365cc431..340c1ccd6b 100644
--- a/ext/filter/tests/bug49510.phpt
+++ b/ext/filter/tests/bug49510.phpt
@@ -1,5 +1,7 @@
--TEST--
-#49510 boolean validation fails with FILTER_NULL_ON_FAILURE
+Bug #49510 boolean validation fails with FILTER_NULL_ON_FAILURE
+--SKIPIF--
+<?php if (!extension_loaded("filter")) die("skip"); ?>
--FILE--
<?php
var_dump(filter_var(false, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
diff --git a/ext/gd/tests/imagecopyresampled_basic.phpt b/ext/gd/tests/imagecopyresampled_basic.phpt
index a0454faf86..fd96ab6928 100644
--- a/ext/gd/tests/imagecopyresampled_basic.phpt
+++ b/ext/gd/tests/imagecopyresampled_basic.phpt
@@ -35,9 +35,9 @@ imagefilledellipse($image_lge, 200, 150, 300, 200, $col_ellipse);
imagepng($image_lge, $dest_lge);
// Get new dimensions
-$percent = 0.5; // new image 50% of orginal
+$percent = 0.5; // new image 50% of original
list($width, $height) = getimagesize($dest_lge);
-echo "Size of orginal: width=". $width . " height=" . $height . "\n";
+echo "Size of original: width=". $width . " height=" . $height . "\n";
$new_width = $width * $percent;
$new_height = $height * $percent;
@@ -66,6 +66,6 @@ echo "Done\n";
?>
--EXPECT--
Simple test of imagecopyresampled() function
-Size of orginal: width=400 height=300
+Size of original: width=400 height=300
Size of copy: width=200 height=150
Done
diff --git a/ext/hash/tests/mhash_002.phpt b/ext/hash/tests/mhash_002.phpt
index 7bcafd3896..45cf09fb77 100644
--- a/ext/hash/tests/mhash_002.phpt
+++ b/ext/hash/tests/mhash_002.phpt
@@ -24,7 +24,7 @@ $supported_hash_al = array(
"CRC32" => 4,
"CRC32B" => 4,
"ADLER32" => 4,
-"NA_XYZ" => 0 /* verify that the algorythm works */
+"NA_XYZ" => 0 /* verify that the algorithm works */
);
$hc = mhash_count() + 1;
diff --git a/ext/imap/tests/imap_include.inc b/ext/imap/tests/imap_include.inc
index ed36239572..b33a10e5e8 100644
--- a/ext/imap/tests/imap_include.inc
+++ b/ext/imap/tests/imap_include.inc
@@ -61,7 +61,7 @@ function displayOverviewFields($resp, $fields=null) {
* @param string mailbox_suffix Suffix used to uniquely identify mailboxes
* @param int message_count number of test msgs to be written to new mailbox
*
- * @return IMAP stream to new mailbox on sucesss; FALSE on failure
+ * @return IMAP stream to new mailbox on success; FALSE on failure
*/
function setup_test_mailbox($mailbox_suffix, $message_count, &$new_mailbox = null, $msg_type = "simple"){
global $server, $default_mailbox, $username, $password;
diff --git a/ext/interbase/tests/005.phpt b/ext/interbase/tests/005.phpt
index 5b16ac2917..c5167c132e 100644
--- a/ext/interbase/tests/005.phpt
+++ b/ext/interbase/tests/005.phpt
@@ -18,7 +18,7 @@ InterBase: transactions
/*
Difference between default and other transactions:
-default commited when you call ibase_close().
+default committed when you call ibase_close().
Other transaction doing rollback.
If you not open default transaction with
@@ -158,7 +158,7 @@ three transaction on default link
ibase_free_result($res);
- /* tr_4 IBASE_COMMITED + IBASE_REC_NO_VERSION + IBASE_NOWAIT */
+ /* tr_4 IBASE_COMMITTED + IBASE_REC_NO_VERSION + IBASE_NOWAIT */
$res = ibase_query($tr_4, "select * from test5");
echo "three rows in fourth transaction with deadlock\n";
diff --git a/ext/intl/doc/Tutorial.txt b/ext/intl/doc/Tutorial.txt
index 4a66dc1844..3bb31b00ec 100644
--- a/ext/intl/doc/Tutorial.txt
+++ b/ext/intl/doc/Tutorial.txt
@@ -7,7 +7,7 @@ Examle of locales format: 'en_US', 'ru_UA', 'ua_UA' (see http://demo.icu-project
2. Collator::getDisplayName( $obj_locale, $disp_locale ).
-Get name of the object for the desired Locale, in the desired langauge. Both arguments
+Get name of the object for the desired Locale, in the desired language. Both arguments
must be from getAvailableLocales method.
@param string $obj_locale Locale to get display name for.
diff --git a/ext/intl/doc/grapheme_api.php b/ext/intl/doc/grapheme_api.php
index 465453fd32..e22d165cbb 100644
--- a/ext/intl/doc/grapheme_api.php
+++ b/ext/intl/doc/grapheme_api.php
@@ -98,7 +98,7 @@
* @param string $haystack The input string.
* @param string $needle The string to look for.
* @param [boolean] $before_needle If TRUE (the default is FALSE), grapheme_strstr() returns the part of the
- haystack before the first occurence of the needle.
+ haystack before the first occurrence of the needle.
* @return string Returns the portion of string, or FALSE if needle is not found.
*/
function grapheme_strstr($haystack, $needle, $before_needle = FALSE) {}
@@ -109,7 +109,7 @@
* @param string $haystack The input string.
* @param string $needle The string to look for.
* @param [boolean] $before_needle If TRUE (the default is FALSE), grapheme_strstr() returns the part of the
- haystack before the first occurence of the needle.
+ haystack before the first occurrence of the needle.
* @return string Returns the portion of string, or FALSE if needle is not found.
*/
function grapheme_stristr($haystack, $needle, $before_needle = FALSE) {}
diff --git a/ext/intl/doc/msgfmt_api.php b/ext/intl/doc/msgfmt_api.php
index e4d047b979..3df6f0de11 100644
--- a/ext/intl/doc/msgfmt_api.php
+++ b/ext/intl/doc/msgfmt_api.php
@@ -31,7 +31,7 @@ class MessageFormatter {
/**
* Format the message
* @param array $args arguments to insert into the pattern string
- * @return string the formatted string, or false if an error ocurred
+ * @return string the formatted string, or false if an error occurred
*/
public function format($args) {}
@@ -124,7 +124,7 @@ class MessageFormatter {
* Format the message
* @param MessageFormatter $fmt The message formatter
* @param array $args arguments to insert into the pattern string
- * @return string the formatted string, or false if an error ocurred
+ * @return string the formatted string, or false if an error occurred
*/
function msgfmt_format($fmt, $args) {}
diff --git a/ext/intl/tests/badargs.phpt b/ext/intl/tests/badargs.phpt
index 9232bbf0c1..264af73acc 100644
--- a/ext/intl/tests/badargs.phpt
+++ b/ext/intl/tests/badargs.phpt
@@ -1,5 +1,5 @@
--TEST--
-Check that bad argumens return the same
+Check that bad arguments return the same
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
--FILE--
diff --git a/ext/libxml/tests/bug61367-read.phpt b/ext/libxml/tests/bug61367-read.phpt
index 94da3d8481..75d0006a3f 100644
--- a/ext/libxml/tests/bug61367-read.phpt
+++ b/ext/libxml/tests/bug61367-read.phpt
@@ -8,7 +8,7 @@ error_reporting=E_ALL & ~E_NOTICE
--FILE--
<?php
/*
- * Note: Using error_reporting=E_ALL & ~E_NOTICE to supress "Trying to get property of non-object" notices.
+ * Note: Using error_reporting=E_ALL & ~E_NOTICE to suppress "Trying to get property of non-object" notices.
*/
class StreamExploiter {
public function stream_close ( ) {
diff --git a/ext/mbstring/README_PHP3-i18n-ja b/ext/mbstring/README_PHP3-i18n-ja
index cac00b82a1..869fe3e495 100644
--- a/ext/mbstring/README_PHP3-i18n-ja
+++ b/ext/mbstring/README_PHP3-i18n-ja
@@ -408,7 +408,7 @@ o i18n.script_encoding - script encoding
entering the script parser.
Be aware that auto detection may fail under some conditions.
- For best auto detection, add multibyte charactor at begining of
+ For best auto detection, add multibyte charactor at beginning of
script.
diff --git a/ext/mbstring/libmbfl/filters/unicode_table_jis2004.h b/ext/mbstring/libmbfl/filters/unicode_table_jis2004.h
index 5ae282e91b..cb6c445e75 100644
--- a/ext/mbstring/libmbfl/filters/unicode_table_jis2004.h
+++ b/ext/mbstring/libmbfl/filters/unicode_table_jis2004.h
@@ -4643,7 +4643,7 @@ static const int ucs_r2_jisx0213_min = 0xFA0F;
static const int ucs_r2_jisx0213_max = 0xFA6A;
/*
- CJK Compatibility Ideographs: U+F900 - U+FAFF (seperate mapping for U+F9XX)
+ CJK Compatibility Ideographs: U+F900 - U+FAFF (separate mapping for U+F9XX)
*/
static const unsigned short ucs_r2b_jisx0213_cmap_key[] = {
0xf91d,0xf928,0xf929,0xf936,0xf970,0xf9d0,0xf9dc};
diff --git a/ext/mbstring/oniguruma/HISTORY b/ext/mbstring/oniguruma/HISTORY
index a1debefa49..55c5572fa0 100644
--- a/ext/mbstring/oniguruma/HISTORY
+++ b/ext/mbstring/oniguruma/HISTORY
@@ -1607,7 +1607,7 @@ History
2003/01/31: [impl] rename TTRANS() to TOLOWER().
2003/01/30: [bug] .c.o --> .c.obj in win32\Makefile.
2003/01/30: [impl] add -DNOT_RUBY to Makefile.in.
- NOT_RUBY is refered in regint.h for escape double
+ NOT_RUBY is referred in regint.h for escape double
including config.h.
2003/01/30: [impl] when string hasn't case ambiguity, don't compile
to ignore case opcode.
diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c
index 145ee0c13f..607921ebb6 100644
--- a/ext/mbstring/php_mbregex.c
+++ b/ext/mbstring/php_mbregex.c
@@ -648,7 +648,7 @@ _php_mb_regex_init_options(const char *parg, int narg, OnigOptionType *option, O
/* }}} */
/*
- * php funcions
+ * php functions
*/
/* {{{ proto string mb_regex_encoding([string encoding])
diff --git a/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt b/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt
index 5fb642f9b2..6219e585eb 100644
--- a/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt
+++ b/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt
@@ -1,5 +1,7 @@
--TEST--
Optional long parameter might be null
+--SKIPIF--
+<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
--FILE--
<?php
echo mb_strpos('abb', 'b', null, 'UTF-8') . "\n";
diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c
index 5ad7bc903d..db0e5a1fc5 100644
--- a/ext/mysql/php_mysql.c
+++ b/ext/mysql/php_mysql.c
@@ -720,7 +720,7 @@ PHP_MINFO_FUNCTION(mysql)
static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
{
char *user=NULL, *passwd=NULL, *host_and_port=NULL, *socket=NULL, *tmp=NULL, *host=NULL;
- int user_len, passwd_len, host_len;
+ int user_len = 0, passwd_len = 0, host_len = 0;
char *hashed_details=NULL;
int hashed_details_length, port = MYSQL_PORT;
long client_flags = 0;
diff --git a/ext/mysqli/tests/bug34810.phpt b/ext/mysqli/tests/bug34810.phpt
index 1ea89d9bee..4fe87f4c00 100644
--- a/ext/mysqli/tests/bug34810.phpt
+++ b/ext/mysqli/tests/bug34810.phpt
@@ -16,7 +16,7 @@ class DbConnection {
var_dump($link);
$link = mysqli_init();
- /* @ is to supress 'Property access is not allowed yet' */
+ /* @ is to suppress 'Property access is not allowed yet' */
@var_dump($link);
$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c
index 90c2b73eae..d70582b7fb 100644
--- a/ext/mysqlnd/mysqlnd.c
+++ b/ext/mysqlnd/mysqlnd.c
@@ -1337,7 +1337,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, list_fields)(MYSQLND_CONN_DATA * conn, const c
}
if (FAIL == result->m.read_result_metadata(result, conn TSRMLS_CC)) {
- DBG_ERR("Error ocurred while reading metadata");
+ DBG_ERR("Error occurred while reading metadata");
result->m.free_result(result, TRUE TSRMLS_CC);
result = NULL;
break;
diff --git a/ext/mysqlnd/mysqlnd_result.c b/ext/mysqlnd/mysqlnd_result.c
index a857a05d71..fd2023cd10 100644
--- a/ext/mysqlnd/mysqlnd_result.c
+++ b/ext/mysqlnd/mysqlnd_result.c
@@ -497,7 +497,7 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s
mnd_efree(conn->current_result);
conn->current_result = NULL;
}
- DBG_ERR("Error ocurred while reading metadata");
+ DBG_ERR("Error occurred while reading metadata");
break;
}
@@ -509,7 +509,7 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s
break;
}
if (FAIL == (ret = PACKET_READ(fields_eof, conn))) {
- DBG_ERR("Error ocurred while reading the EOF packet");
+ DBG_ERR("Error occurred while reading the EOF packet");
result->m.free_result_contents(result TSRMLS_CC);
mnd_efree(result);
if (!stmt) {
diff --git a/ext/oci8/package.xml b/ext/oci8/package.xml
index 00566b1b60..c51d216f32 100644
--- a/ext/oci8/package.xml
+++ b/ext/oci8/package.xml
@@ -831,7 +831,7 @@ Fixed bug #36820 (Privileged connection with an Oracle password file fails)
<date>2006-03-16</date>
<license uri="http://www.php.net/license">PHP</license>
<notes>Changed OCI8 code to use OCIServerVersion() instead of OCIPing(), which may crash Oracle server of version &lt; 10.2
-Fixed bug #36235 (ocicolumnname returns false before a succesfull fetch)
+Fixed bug #36235 (ocicolumnname returns false before a successfull fetch)
Fixed bug #36096 (oci_result() returns garbage after oci_fetch() failed)
Fixed bug #36055 (possible OCI8 crash in multithreaded environment)
Fixed bug #36010 (Segfault when re-creating and re-executing statements with bound parameters)
diff --git a/ext/oci8/tests/conn_attr.inc b/ext/oci8/tests/conn_attr.inc
index 2c086b1892..220e688210 100644
--- a/ext/oci8/tests/conn_attr.inc
+++ b/ext/oci8/tests/conn_attr.inc
@@ -98,7 +98,7 @@ function set_attr($conn,$attr,$sufix)
else if (!strcmp($attr,'CLIENT_IDENTIFIER'))
$r = oci_set_client_identifier($conn,'ID00'.$sufix);
else
- echo "Pass one of the above four attibutes!!!\n";
+ echo "Pass one of the above four attributes!!!\n";
if ($r) {
echo "Value of $attr has been set successfully\n";
}
diff --git a/ext/oci8/tests/conn_attr_4.phpt b/ext/oci8/tests/conn_attr_4.phpt
index d15b7a38de..4885f80b71 100644
--- a/ext/oci8/tests/conn_attr_4.phpt
+++ b/ext/oci8/tests/conn_attr_4.phpt
@@ -62,7 +62,7 @@ foreach($values_array as $val ) {
oci_set_client_info($c1,$val);
$r = oci_set_action($c1,$val);
if ($r) {
- echo "Values set succesfully to $val\n";
+ echo "Values set successfully to $val\n";
foreach($attr_array as $attr) {
get_attr($c1,$attr);
}
@@ -98,12 +98,12 @@ bool(true)
The value of ACTION is ACTION1
Setting to different values
-Values set succesfully to 1000
+Values set successfully to 1000
The value of MODULE is 1000
The value of ACTION is 1000
The value of CLIENT_INFO is 1000
The value of CLIENT_IDENTIFIER is 1000
-Values set succesfully to
+Values set successfully to
The value of MODULE is
The value of ACTION is
The value of CLIENT_INFO is
diff --git a/ext/odbc/php_odbc_includes.h b/ext/odbc/php_odbc_includes.h
index 8251528e19..ca237c0537 100644
--- a/ext/odbc/php_odbc_includes.h
+++ b/ext/odbc/php_odbc_includes.h
@@ -161,7 +161,7 @@ PHP_FUNCTION(solid_fetch_prev);
#define UNIX
/*
* Extended Fetch in the Birdstep ODBC API is incapable of returning long varchar (memo) fields.
- * So the following line has been commented-out to accomadate. - KNS
+ * So the following line has been commented-out to accommodate. - KNS
*
* #define HAVE_SQL_EXTENDED_FETCH 1
*/
diff --git a/ext/openssl/tests/openssl.cnf b/ext/openssl/tests/openssl.cnf
index 10e69076cf..4ed40fdc8a 100644
--- a/ext/openssl/tests/openssl.cnf
+++ b/ext/openssl/tests/openssl.cnf
@@ -3,7 +3,7 @@ default_bits = 1024
default_keyfile = privkey.pem
distinguished_name = req_distinguished_name
attributes = req_attributes
-x509_extensions = v3_ca # The extentions to add to the self signed cert
+x509_extensions = v3_ca # The extensions to add to the self signed cert
string_mask = MASK:4294967295
diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c
index 0e1523853a..e19e8f098d 100644
--- a/ext/openssl/xp_ssl.c
+++ b/ext/openssl/xp_ssl.c
@@ -274,7 +274,7 @@ static int php_openssl_sockop_close(php_stream *stream, int close_handle TSRMLS_
* Essentially, we are waiting for the socket to become writeable, which means
* that all pending data has been sent.
* We use a small timeout which should encourage the OS to send the data,
- * but at the same time avoid hanging indefintely.
+ * but at the same time avoid hanging indefinitely.
* */
do {
n = php_pollfd_for_ms(sslsock->s.socket, POLLOUT, 500);
diff --git a/ext/pcre/pcrelib/ChangeLog b/ext/pcre/pcrelib/ChangeLog
index 1b016ecee5..ed164fed0f 100644
--- a/ext/pcre/pcrelib/ChangeLog
+++ b/ext/pcre/pcrelib/ChangeLog
@@ -1751,7 +1751,7 @@ Version 7.7 07-May-08
containing () gave an internal compiling error instead of "reference to
non-existent subpattern". Fortunately, when the pattern did exist, the
compiled code was correct. (When scanning forwards to check for the
- existencd of the subpattern, it was treating the data ']' as terminating
+ existence of the subpattern, it was treating the data ']' as terminating
the class, so got the count wrong. When actually compiling, the reference
was subsequently set up correctly.)
diff --git a/ext/pcre/pcrelib/NEWS b/ext/pcre/pcrelib/NEWS
index ebd9c5ec9d..082139f222 100644
--- a/ext/pcre/pcrelib/NEWS
+++ b/ext/pcre/pcrelib/NEWS
@@ -591,7 +591,7 @@ some of the new functionality in Perl 5.005.
Another (I hope this is the last!) change has been made to the API for the
pcre_compile() function. An additional argument has been added to make it
possible to pass over a pointer to character tables built in the current
-locale by pcre_maketables(). To use the default tables, this new arguement
+locale by pcre_maketables(). To use the default tables, this new argument
should be passed as NULL.
IMPORTANT FOR THOSE UPGRADING FROM VERSION 2.05
diff --git a/ext/pcre/pcrelib/pcre_compile.c b/ext/pcre/pcrelib/pcre_compile.c
index 5f0c8ed087..4997b3b1ec 100644
--- a/ext/pcre/pcrelib/pcre_compile.c
+++ b/ext/pcre/pcrelib/pcre_compile.c
@@ -8139,7 +8139,7 @@ if (code - codestart > length) errorcode = ERR23;
#ifdef SUPPORT_VALGRIND
/* If the estimated length exceeds the really used length, mark the extra
-allocated memory as unadressable, so that any out-of-bound reads can be
+allocated memory as unaddressable, so that any out-of-bound reads can be
detected. */
VALGRIND_MAKE_MEM_NOACCESS(code, (length - (code - codestart)) * sizeof(pcre_uchar));
#endif
diff --git a/ext/pcre/tests/preg_replace_basic.phpt b/ext/pcre/tests/preg_replace_basic.phpt
index 33fb2d4a8a..6962bce255 100644
--- a/ext/pcre/tests/preg_replace_basic.phpt
+++ b/ext/pcre/tests/preg_replace_basic.phpt
@@ -11,7 +11,7 @@ var_dump($string);
var_dump(preg_replace('<- This is a string$>', 'This shouldn\'t work', $string)); //tries to find '- This is a string' at the end of a string but can't so replaces nothing and prints the unchanged $string.
var_dump(preg_replace('<[0-35-9]>', '4', $string)); //finds any number that's not 4 and replaces it with a 4 ('444444444')
var_dump(preg_replace('<\b[hH]\w{2,4}>', 'Bonjour', $string)); //finds h or H at the beginning of a word followed by 2-4 characters and replaces it with Bonjour (i.e. Hello -> Bonjour) (was finding the 'his' in This and replacing it)
-var_dump(preg_replace('<(\w)\s*-\s*(\w)>', '\\1. \\2', $string)); //finds dashes with an indefinate amount of whitespace around them and replaces them with a full stop precedeby no spaces and followed by one space
+var_dump(preg_replace('<(\w)\s*-\s*(\w)>', '\\1. \\2', $string)); //finds dashes with an indefinite amount of whitespace around them and replaces them with a full stop precedeby no spaces and followed by one space
var_dump(preg_replace('<(^[a-z]\w+)@(\w+)\.(\w+)\.([a-z]{2,}$)>', '\\1 at \\2 dot \\3 dot \\4', 'josmessa@uk.ibm.com')); //finds the e-mail address and replaces the @ and . with "at" and "dot" (uses backreferences) ('josmessa at uk dot ibm dot com')
?>
diff --git a/ext/pcre/tests/preg_replace_edit_basic.phpt b/ext/pcre/tests/preg_replace_edit_basic.phpt
index 97350e756e..556b48b8c1 100644
--- a/ext/pcre/tests/preg_replace_edit_basic.phpt
+++ b/ext/pcre/tests/preg_replace_edit_basic.phpt
@@ -24,7 +24,7 @@ var_dump(preg_replace('<\b[hH]\w{2,4}>',
'Bonjour', $string)); //finds h or H at the beginning of a word followed by 2-4 characters and replaces it with Bonjour (i.e. Hello -> Bonjour) (was finding the 'his' in This and replacing it)
var_dump(preg_replace('<(\w)\s*-\s*(\w)>',
- '\\1. \\2', $string)); //finds dashes with an indefinate amount of whitespace around them and replaces them with a full stop precedeby no spaces and followed by one space
+ '\\1. \\2', $string)); //finds dashes with an indefinite amount of whitespace around them and replaces them with a full stop precedeby no spaces and followed by one space
var_dump(preg_replace('<(^[a-z]\w+)@(\w+)\.(\w+)\.([a-z]{2,}$)>',
'\\1 at \\2 dot \\3 dot \\4', 'josmessa@uk.ibm.com')); //finds the e-mail address and replaces the @ and . with "at" and "dot" (uses backreferences) ('josmessa at uk dot ibm dot com')
diff --git a/ext/pcre/tests/preg_split_basic.phpt b/ext/pcre/tests/preg_split_basic.phpt
index e94a94f62e..5d23ce6df1 100644
--- a/ext/pcre/tests/preg_split_basic.phpt
+++ b/ext/pcre/tests/preg_split_basic.phpt
@@ -7,7 +7,7 @@ Test preg_split() function : basic functionality
* Function is implemented in ext/pcre/php_pcre.c
*/
$string = 'this is a_list: value1, Test__, string; Hello, world!_(parentheses)';
-var_dump(preg_split('/[:,;\(\)]/', $string, -1, PREG_SPLIT_NO_EMPTY)); //parts of $string seperated by : , ; ( or ) are put into an array.
+var_dump(preg_split('/[:,;\(\)]/', $string, -1, PREG_SPLIT_NO_EMPTY)); //parts of $string separated by : , ; ( or ) are put into an array.
var_dump(preg_split('/:\s*(\w*,*\s*)+;/', $string)); //all text between : and ; is removed
var_dump(preg_split('/(\(|\))/', $string, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY)); //all text before (parentheses) is put into first element, ( into second, "parentheses" into third and ) into fourth.
var_dump(preg_split('/NAME/i', $string)); //tries to find NAME regardless of case in $string (can't split it so just returns how string as first element)
diff --git a/ext/pdo/pdo_sql_parser.c b/ext/pdo/pdo_sql_parser.c
index 4219762a4b..4c523506c4 100644
--- a/ext/pdo/pdo_sql_parser.c
+++ b/ext/pdo/pdo_sql_parser.c
@@ -761,9 +761,9 @@ int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char
while (SUCCESS == zend_hash_get_current_data(params, (void**)&param)) {
if(param->parameter) {
convert_to_string(param->parameter);
- /* accomodate a string that needs to be fully quoted
+ /* accommodate a string that needs to be fully quoted
bind placeholders are at least 2 characters, so
- the accomodate their own "'s
+ the accommodate their own "'s
*/
newbuffer_len += padding * Z_STRLEN_P(param->parameter);
}
diff --git a/ext/pdo/pdo_sql_parser.re b/ext/pdo/pdo_sql_parser.re
index d4272d679b..80e3b4f95f 100644
--- a/ext/pdo/pdo_sql_parser.re
+++ b/ext/pdo/pdo_sql_parser.re
@@ -408,9 +408,9 @@ int old_pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len, char
while (SUCCESS == zend_hash_get_current_data(params, (void**)&param)) {
if(param->parameter) {
convert_to_string(param->parameter);
- /* accomodate a string that needs to be fully quoted
+ /* accommodate a string that needs to be fully quoted
bind placeholders are at least 2 characters, so
- the accomodate their own "'s
+ the accommodate their own "'s
*/
newbuffer_len += padding * Z_STRLEN_P(param->parameter);
}
diff --git a/ext/pdo/php_pdo_driver.h b/ext/pdo/php_pdo_driver.h
index f38e7b5ec9..c757dbf1e5 100644
--- a/ext/pdo/php_pdo_driver.h
+++ b/ext/pdo/php_pdo_driver.h
@@ -469,7 +469,7 @@ struct _pdo_dbh_t {
/* when set, convert int/floats to strings */
unsigned stringify:1;
- /* the sum of the number of bits here and the bit fields preceeding should
+ /* the sum of the number of bits here and the bit fields preceding should
* equal 32 */
unsigned _reserved_flags:21;
diff --git a/ext/pdo/tests/bug61292.phpt b/ext/pdo/tests/bug61292.phpt
index 2381fd1a23..05b2e9c011 100644
--- a/ext/pdo/tests/bug61292.phpt
+++ b/ext/pdo/tests/bug61292.phpt
@@ -17,8 +17,15 @@ class Database_SQL extends PDO
{
function __construct()
{
+ $dsn = getenv('PDOTEST_DSN');
+ $user = getenv('PDOTEST_USER');
+ $pass = getenv('PDOTEST_PASS');
+
+ if ($user === false) $user = NULL;
+ if ($pass === false) $pass = NULL;
$options = array(PDO::ATTR_PERSISTENT => TRUE);
- parent::__construct(getenv("PDOTEST_DSN"), getenv("PDOTEST_USER"), getenv("PDOTEST_PASS"), $options);
+
+ parent::__construct($dsn, $user, $pass, $options);
}
var $bar = array();
diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c
index ffc910177f..9ed5087369 100644
--- a/ext/pdo_dblib/dblib_driver.c
+++ b/ext/pdo_dblib/dblib_driver.c
@@ -32,6 +32,9 @@
#include "php_pdo_dblib_int.h"
#include "zend_exceptions.h"
+/* Cache of the server supported datatypes, initialized in handle_factory */
+zval* pdo_dblib_datatypes;
+
static int dblib_fetch_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS_DC)
{
pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data;
@@ -262,17 +265,37 @@ static struct pdo_dbh_methods dblib_methods = {
static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC)
{
pdo_dblib_db_handle *H;
- int i, ret = 0;
+ int i, nvars, nvers, ret = 0;
+ int *val;
+
+ const pdo_dblib_keyval tdsver[] = {
+ {"4.2",DBVERSION_42}
+ ,{"4.6",DBVERSION_46}
+ ,{"5.0",DBVERSION_70} /* FIXME: This does not work with Sybase, but environ will */
+ ,{"6.0",DBVERSION_70}
+ ,{"7.0",DBVERSION_70}
+ ,{"7.1",DBVERSION_71}
+ ,{"7.2",DBVERSION_72}
+ ,{"8.0",DBVERSION_72}
+ ,{"10.0",DBVERSION_100}
+ ,{"auto",0} /* Only works with FreeTDS. Other drivers will bork */
+
+ };
+
+ nvers = sizeof(tdsver)/sizeof(tdsver[0]);
+
struct pdo_data_src_parser vars[] = {
- { "charset", NULL, 0 },
- { "appname", "PHP " PDO_DBLIB_FLAVOUR, 0 },
- { "host", "127.0.0.1", 0 },
- { "dbname", NULL, 0 },
- { "secure", NULL, 0 }, /* DBSETLSECURE */
- /* TODO: DBSETLVERSION ? */
+ { "charset", NULL, 0 }
+ ,{ "appname", "PHP " PDO_DBLIB_FLAVOUR, 0 }
+ ,{ "host", "127.0.0.1", 0 }
+ ,{ "dbname", NULL, 0 }
+ ,{ "secure", NULL, 0 } /* DBSETLSECURE */
+ ,{ "version", NULL, 0 } /* DBSETLVERSION */
};
-
- php_pdo_parse_data_source(dbh->data_source, dbh->data_source_len, vars, 5);
+
+ nvars = sizeof(vars)/sizeof(vars[0]);
+
+ php_pdo_parse_data_source(dbh->data_source, dbh->data_source_len, vars, nvars);
H = pecalloc(1, sizeof(*H), dbh->is_persistent);
H->login = dblogin();
@@ -282,11 +305,37 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
goto cleanup;
}
+ DBERRHANDLE(H->login, (EHANDLEFUNC) error_handler);
+ DBMSGHANDLE(H->login, (MHANDLEFUNC) msg_handler);
+
+ if(vars[5].optval) {
+ for(i=0;i<nvers;i++) {
+ if(strcmp(vars[5].optval,tdsver[i].key) == 0) {
+ if(FAIL==dbsetlversion(H->login, tdsver[i].value)) {
+ pdo_raise_impl_error(dbh, NULL, "HY000", "PDO_DBLIB: Failed to set version specified in connection string." TSRMLS_CC);
+ goto cleanup;
+ }
+ break;
+ }
+ }
+
+ if (i==nvers) {
+ printf("Invalid version '%s'\n", vars[5].optval);
+ pdo_raise_impl_error(dbh, NULL, "HY000", "PDO_DBLIB: Invalid version specified in connection string." TSRMLS_CC);
+ goto cleanup; /* unknown version specified */
+ }
+ }
+
if (dbh->username) {
- DBSETLUSER(H->login, dbh->username);
+ if(FAIL == DBSETLUSER(H->login, dbh->username)) {
+ goto cleanup;
+ }
}
+
if (dbh->password) {
- DBSETLPWD(H->login, dbh->password);
+ if(FAIL == DBSETLPWD(H->login, dbh->password)) {
+ goto cleanup;
+ }
}
#if !PHP_DBLIB_IS_MSSQL
@@ -297,14 +346,9 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
DBSETLAPP(H->login, vars[1].optval);
-#if PHP_DBLIB_IS_MSSQL
- dbprocerrhandle(H->login, (EHANDLEFUNC) error_handler);
- dbprocmsghandle(H->login, (MHANDLEFUNC) msg_handler);
-#endif
-
H->link = dbopen(H->login, vars[2].optval);
- if (H->link == NULL) {
+ if (!H->link) {
goto cleanup;
}
@@ -315,18 +359,35 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
DBSETOPT(H->link, DBTEXTSIZE, "2147483647");
/* allow double quoted indentifiers */
- DBSETOPT(H->link, DBQUOTEDIDENT, NULL);
+ DBSETOPT(H->link, DBQUOTEDIDENT, "1");
- if (vars[3].optval && FAIL == dbuse(H->link, vars[3].optval)) {
- goto cleanup;
+ if (vars[3].optval) {
+ DBSETLDBNAME(H->login, vars[3].optval);
}
ret = 1;
dbh->max_escaped_char_length = 2;
dbh->alloc_own_columns = 1;
+#if 0
+ /* Cache the supported data types from the servers systypes table */
+ if(dbcmd(H->link, "select usertype, name from systypes order by usertype") != FAIL) {
+ if(dbsqlexec(H->link) != FAIL) {
+ dbresults(H->link);
+ while (dbnextrow(H->link) == SUCCESS) {
+ val = dbdata(H->link, 1);
+ add_index_string(pdo_dblib_datatypes, *val, dbdata(H->link, 2), 1);
+ }
+ }
+ /* Throw out any remaining resultsets */
+ dbcancel(H-link);
+ }
+#endif
+
+
+
cleanup:
- for (i = 0; i < sizeof(vars)/sizeof(vars[0]); i++) {
+ for (i = 0; i < nvars; i++) {
if (vars[i].freeme) {
efree(vars[i].optval);
}
diff --git a/ext/pdo_dblib/dblib_stmt.c b/ext/pdo_dblib/dblib_stmt.c
index 1a2fefd47a..51cebc48b0 100644
--- a/ext/pdo_dblib/dblib_stmt.c
+++ b/ext/pdo_dblib/dblib_stmt.c
@@ -36,35 +36,51 @@
/* {{{ pdo_dblib_get_field_name
*
- * Updated for MSSQL 2008 SR2 extended types
+ * Return the data type name for a given TDS number
*
*/
static char *pdo_dblib_get_field_name(int type)
{
+ /*
+ * I don't return dbprtype(type) because it does not fully describe the type
+ * (example: varchar is reported as char by dbprtype)
+ *
+ * FIX ME: Cache datatypes from server systypes table in pdo_dblib_handle_factory()
+ * to make this future proof.
+ */
+
switch (type) {
+ case 31: return "nvarchar";
case 34: return "image";
case 35: return "text";
case 36: return "uniqueidentifier";
+ case 37: return "varbinary"; /* & timestamp - Sybase AS12 */
+ case 38: return "bigint"; /* & bigintn - Sybase AS12 */
+ case 39: return "varchar"; /* & sysname & nvarchar - Sybase AS12 */
case 40: return "date";
case 41: return "time";
case 42: return "datetime2";
case 43: return "datetimeoffset";
+ case 45: return "binary"; /* Sybase AS12 */
+ case 47: return "char"; /* & nchar & uniqueidentifierstr Sybase AS12 */
case 48: return "tinyint";
+ case 50: return "bit"; /* Sybase AS12 */
case 52: return "smallint";
+ case 55: return "decimal"; /* Sybase AS12 */
case 56: return "int";
case 58: return "smalldatetime";
case 59: return "real";
case 60: return "money";
case 61: return "datetime";
case 62: return "float";
+ case 63: return "numeric"; /* or uint, ubigint, usmallint Sybase AS12 */
case 98: return "sql_variant";
case 99: return "ntext";
case 104: return "bit";
- case 106: return "decimal";
- case 108: return "numeric";
+ case 106: return "decimal"; /* decimal n on sybase */
+ case 108: return "numeric"; /* numeric n on sybase */
case 122: return "smallmoney";
case 127: return "bigint";
- case 240: return "geometry";
case 165: return "varbinary";
case 167: return "varchar";
case 173: return "binary";
@@ -72,23 +88,22 @@ static char *pdo_dblib_get_field_name(int type)
case 189: return "timestamp";
case 231: return "nvarchar";
case 239: return "nchar";
+ case 240: return "geometry";
case 241: return "xml";
- default:
- return "unknown";
- break;
+ default: return "unknown";
}
}
/* }}} */
-static int dblib_dblib_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC)
+static int pdo_dblib_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC)
{
pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data;
pdo_dblib_db_handle *H = S->H;
/* Cancel any pending results */
dbcancel(H->link);
-
- efree(stmt->columns);
+
+ efree(stmt->columns);
stmt->columns = NULL;
return 1;
@@ -98,7 +113,8 @@ static int pdo_dblib_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC)
{
pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data;
- dblib_dblib_stmt_cursor_closer(stmt TSRMLS_CC);
+ efree(stmt->columns);
+ stmt->columns = NULL;
efree(S);
@@ -113,7 +129,12 @@ static int pdo_dblib_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC)
ret = dbresults(H->link);
- if (ret == FAIL || ret == NO_MORE_RESULTS) {
+ if (FAIL == ret) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO_DBLIB: dbresults() returned FAIL" TSRMLS_CC);
+ return 0;
+ }
+
+ if(NO_MORE_RESULTS == ret) {
return 0;
}
@@ -131,6 +152,8 @@ static int pdo_dblib_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
dbsetuserdata(H->link, (BYTE*) &S->err);
+ pdo_dblib_stmt_cursor_closer(stmt TSRMLS_CC);
+
if (FAIL == dbcmd(H->link, stmt->active_query_string)) {
return 0;
}
@@ -141,10 +164,6 @@ static int pdo_dblib_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
ret = pdo_dblib_stmt_next_rowset(stmt TSRMLS_CC);
- if (ret == 0) {
- return 0;
- }
-
stmt->row_count = DBCOUNT(H->link);
stmt->column_count = dbnumcols(H->link);
@@ -162,7 +181,12 @@ static int pdo_dblib_stmt_fetch(pdo_stmt_t *stmt,
ret = dbnextrow(H->link);
- if (ret == FAIL || ret == NO_MORE_ROWS) {
+ if (FAIL == ret) {
+ pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO_DBLIB: dbnextrow() returned FAIL" TSRMLS_CC);
+ return 0;
+ }
+
+ if(NO_MORE_ROWS == ret) {
return 0;
}
@@ -174,6 +198,10 @@ static int pdo_dblib_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data;
pdo_dblib_db_handle *H = S->H;
+ if(colno >= stmt->column_count || colno < 0) {
+ return FAILURE;
+ }
+
struct pdo_column_data *col = &stmt->columns[colno];
col->name = (char*)dbcolname(H->link, colno+1);
@@ -205,11 +233,12 @@ static int pdo_dblib_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr,
}
switch (coltype) {
- case SQLCHAR:
- case SQLTEXT:
case SQLVARBINARY:
case SQLBINARY:
case SQLIMAGE:
+ case SQLTEXT:
+ /* FIXME: Above types should be returned as a stream as they can be VERY large */
+ case SQLCHAR:
case SQLVARCHAR:
tmp_ptr = emalloc(*len + 1);
memcpy(tmp_ptr, *ptr, *len);
@@ -225,34 +254,26 @@ static int pdo_dblib_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr,
*ptr = tmp_ptr;
break;
}
-#ifdef SQLUNIQUE
case SQLUNIQUE: {
-#else
- case 36: { /* FreeTDS hack, also used by ext/mssql */
-#endif
*len = 36+1;
tmp_ptr = emalloc(*len + 1);
/* uniqueidentifier is a 16-byte binary number, convert to 32 char hex string */
-#ifdef SQLUNIQUE
*len = dbconvert(NULL, SQLUNIQUE, *ptr, *len, SQLCHAR, tmp_ptr, *len);
-#else
- *len = dbconvert(NULL, 36, *ptr, *len, SQLCHAR, tmp_ptr, *len);
-#endif
php_strtoupper(tmp_ptr, *len);
*ptr = tmp_ptr;
break;
}
default:
if (dbwillconvert(coltype, SQLCHAR)) {
- tmp_len = 32 + (2 * (*len));
+ tmp_len = 32 + (2 * (*len)); /* FIXME: We allocate more than we need here */
tmp_ptr = emalloc(tmp_len);
*len = dbconvert(NULL, coltype, *ptr, *len, SQLCHAR, tmp_ptr, -1);
*ptr = tmp_ptr;
- } else {
- *len = 0;
- *ptr = NULL;
- }
+ } else {
+ *len = 0; /* FIXME: Silently fails and returns null on conversion errors */
+ *ptr = NULL;
+ }
}
*caller_frees = 1;
@@ -270,17 +291,25 @@ static int pdo_dblib_stmt_get_column_meta(pdo_stmt_t *stmt, long colno, zval *re
{
pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data;
pdo_dblib_db_handle *H = S->H;
-
+ DBTYPEINFO* dbtypeinfo;
+
+ if(colno >= stmt->column_count || colno < 0) {
+ return FAILURE;
+ }
+
array_init(return_value);
- DBTYPEINFO* dbtypeinfo;
dbtypeinfo = dbcoltypeinfo(H->link, colno+1);
+
+ if(!dbtypeinfo) return FAILURE;
add_assoc_long(return_value, "max_length", dbcollen(H->link, colno+1) );
add_assoc_long(return_value, "precision", (int) dbtypeinfo->precision );
add_assoc_long(return_value, "scale", (int) dbtypeinfo->scale );
add_assoc_string(return_value, "column_source", dbcolsource(H->link, colno+1), 1);
add_assoc_string(return_value, "native_type", pdo_dblib_get_field_name(dbcoltype(H->link, colno+1)), 1);
+ add_assoc_long(return_value, "native_type_id", dbcoltype(H->link, colno+1));
+ add_assoc_long(return_value, "native_usertype_id", dbcolutype(H->link, colno+1));
return 1;
}
@@ -297,6 +326,6 @@ struct pdo_stmt_methods dblib_stmt_methods = {
NULL, /* get attr */
pdo_dblib_stmt_get_column_meta, /* meta */
pdo_dblib_stmt_next_rowset, /* nextrow */
- dblib_dblib_stmt_cursor_closer
+ pdo_dblib_stmt_cursor_closer
};
diff --git a/ext/pdo_dblib/pdo_dblib.c b/ext/pdo_dblib/pdo_dblib.c
index ed79aea20d..bc5d364ed3 100644
--- a/ext/pdo_dblib/pdo_dblib.c
+++ b/ext/pdo_dblib/pdo_dblib.c
@@ -93,8 +93,12 @@ int error_handler(DBPROCESS *dbproc, int severity, int dberr,
char *state = "HY000";
TSRMLS_FETCH();
- einfo = (pdo_dblib_err*)dbgetuserdata(dbproc);
- if (!einfo) einfo = &DBLIB_G(err);
+ if(dbproc) {
+ einfo = (pdo_dblib_err*)dbgetuserdata(dbproc);
+ if (!einfo) einfo = &DBLIB_G(err);
+ } else {
+ einfo = &DBLIB_G(err);
+ }
einfo->severity = severity;
einfo->oserr = oserr;
diff --git a/ext/pdo_dblib/php_pdo_dblib_int.h b/ext/pdo_dblib/php_pdo_dblib_int.h
index dd06a1d94f..2bdb83c326 100644
--- a/ext/pdo_dblib/php_pdo_dblib_int.h
+++ b/ext/pdo_dblib/php_pdo_dblib_int.h
@@ -71,6 +71,8 @@
# define SQLVARBINARY SYBVARBINARY
# ifdef SYBUNIQUE
# define SQLUNIQUE SYBUNIQUE
+#else
+# define SQLUNIQUE 36 /* FreeTDS Hack */
# endif
# define DBERRHANDLE(a, b) dberrhandle(b)
@@ -118,6 +120,12 @@ typedef struct {
pdo_dblib_err err;
} pdo_dblib_stmt;
+typedef struct {
+ const char* key;
+ int value;
+} pdo_dblib_keyval;
+
+
ZEND_BEGIN_MODULE_GLOBALS(dblib)
pdo_dblib_err err;
char sqlstate[6];
diff --git a/ext/pdo_firebird/firebird_statement.c b/ext/pdo_firebird/firebird_statement.c
index 5c3e435f7b..2b57cd8ba6 100644
--- a/ext/pdo_firebird/firebird_statement.c
+++ b/ext/pdo_firebird/firebird_statement.c
@@ -344,7 +344,7 @@ static int firebird_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, /* {{
if (n >= 0) {
*len = slprintf(*ptr, CHAR_BUF_LEN, "%" LL_MASK "d.%0*" LL_MASK "d",
n / f, -var->sqlscale, n % f);
- } else if (n < -f) {
+ } else if (n <= -f) {
*len = slprintf(*ptr, CHAR_BUF_LEN, "%" LL_MASK "d.%0*" LL_MASK "d",
n / f, -var->sqlscale, -n % f);
} else {
@@ -535,12 +535,14 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_dat
int force_null;
case IS_LONG:
- var->sqltype = sizeof(long) == 8 ? SQL_INT64 : SQL_LONG;
+ /* keep the allow-NULL flag */
+ var->sqltype = (sizeof(long) == 8 ? SQL_INT64 : SQL_LONG) | (var->sqltype & 1);
var->sqldata = (void*)&Z_LVAL_P(param->parameter);
var->sqllen = sizeof(long);
break;
case IS_DOUBLE:
- var->sqltype = SQL_DOUBLE;
+ /* keep the allow-NULL flag */
+ var->sqltype = SQL_DOUBLE | (var->sqltype & 1);
var->sqldata = (void*)&Z_DVAL_P(param->parameter);
var->sqllen = sizeof(double);
break;
@@ -560,7 +562,8 @@ static int firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_dat
force_null = (Z_STRLEN_P(param->parameter) == 0);
}
if (!force_null) {
- var->sqltype = SQL_TEXT;
+ /* keep the allow-NULL flag */
+ var->sqltype = SQL_TEXT | (var->sqltype & 1);
var->sqldata = Z_STRVAL_P(param->parameter);
var->sqllen = Z_STRLEN_P(param->parameter);
break;
diff --git a/ext/pdo_firebird/tests/bug_62024.phpt b/ext/pdo_firebird/tests/bug_62024.phpt
new file mode 100644
index 0000000000..e046879c22
--- /dev/null
+++ b/ext/pdo_firebird/tests/bug_62024.phpt
@@ -0,0 +1,51 @@
+--TEST--
+Bug #62024 Cannot insert second row with null using parametrized query (Firebird PDO)
+--SKIPIF--
+<?php extension_loaded("pdo_firebird") or die("skip"); ?>
+<?php function_exists("ibase_query") or die("skip"); ?>
+--FILE--
+<?php
+
+require("testdb.inc");
+
+$dbh = new PDO("firebird:dbname=$test_base",$user,$password) or die;
+$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
+$value = '2';
+@$dbh->exec('DROP TABLE test_insert');
+$dbh->exec("CREATE TABLE test_insert (ID INTEGER NOT NULL, TEXT VARCHAR(10))");
+
+$dbh->commit();
+
+//start actual test
+
+$sql = "insert into test_insert (id, text) values (?, ?)";
+$sttmt = $dbh->prepare($sql);
+
+$args_ok = array(1, "test1");
+$args_err = array(2, null);
+
+$res = $sttmt->execute($args_ok);
+var_dump($res);
+
+$res = $sttmt->execute($args_err);
+var_dump($res);
+
+$dbh->commit();
+
+
+//teardown test data
+$sttmt = $dbh->prepare('DELETE FROM test_insert');
+$sttmt->execute();
+
+$dbh->commit();
+
+$dbh->exec('DROP TABLE test_insert');
+
+unset($sttmt);
+unset($dbh);
+
+?>
+--EXPECT--
+bool(true)
+bool(true)
+
diff --git a/ext/pdo_firebird/tests/bug_64037.phpt b/ext/pdo_firebird/tests/bug_64037.phpt
new file mode 100644
index 0000000000..f7b53e57a3
--- /dev/null
+++ b/ext/pdo_firebird/tests/bug_64037.phpt
@@ -0,0 +1,45 @@
+--TEST--
+Bug #64037 Firebird return wrong value for numeric field
+--SKIPIF--
+<?php extension_loaded("pdo_firebird") or die("skip"); ?>
+<?php function_exists("ibase_query") or die("skip"); ?>
+--FILE--
+<?php
+
+require("testdb.inc");
+
+$dbh = new PDO("firebird:dbname=$test_base",$user,$password) or die;
+$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
+$value = '2';
+@$dbh->exec('DROP TABLE price');
+$dbh->exec("CREATE TABLE PRICE (ID INTEGER NOT NULL, TEXT VARCHAR(10), COST NUMERIC(15, 2))");
+$dbh->exec("INSERT INTO PRICE (ID, TEXT, COST) VALUES (1, 'test', -1.0)");
+$dbh->exec("INSERT INTO PRICE (ID, TEXT, COST) VALUES (2, 'test', -0.99)");
+$dbh->exec("INSERT INTO PRICE (ID, TEXT, COST) VALUES (3, 'test', -1.01)");
+
+$dbh->commit();
+
+$query = "SELECT * from price order by ID";
+$stmt = $dbh->prepare($query);
+$stmt->execute();
+$rows = $stmt->fetchAll();
+var_dump($rows[0]['COST']);
+var_dump($rows[1]['COST']);
+var_dump($rows[2]['COST']);
+
+
+$stmt = $dbh->prepare('DELETE FROM price');
+$stmt->execute();
+
+$dbh->commit();
+
+$dbh->exec('DROP TABLE price');
+
+unset($stmt);
+unset($dbh);
+
+?>
+--EXPECT--
+string(5) "-1.00"
+string(5) "-0.99"
+string(5) "-1.01" \ No newline at end of file
diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c
index a54fccd0e6..252bfff25b 100644
--- a/ext/pdo_pgsql/pgsql_driver.c
+++ b/ext/pdo_pgsql/pgsql_driver.c
@@ -76,7 +76,7 @@ int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char *
einfo->errmsg = NULL;
}
- if (sqlstate == NULL) {
+ if (sqlstate == NULL || strlen(sqlstate) >= sizeof(pdo_error_type)) {
strcpy(*pdo_err, "HY000");
}
else {
diff --git a/ext/pdo_pgsql/tests/copy_from.phpt b/ext/pdo_pgsql/tests/copy_from.phpt
index 2858905d0c..10967b0fe9 100644
--- a/ext/pdo_pgsql/tests/copy_from.phpt
+++ b/ext/pdo_pgsql/tests/copy_from.phpt
@@ -110,8 +110,10 @@ $db->rollback();
echo "Exception! at line ", $e->getLine(), "\n";
var_dump($e->getMessage());
}
-if(isset($filename)) {
- @unlink($filename);
+
+// Clean up
+foreach (array($filename, $filenameWithDifferentNullValues, $filenameWithDifferentNullValuesAndSelectedFields) as $f) {
+ @unlink($f);
}
?>
--EXPECT--
@@ -383,4 +385,4 @@ array(6) {
NULL
}
Testing pgsqlCopyFromFile() with error
-bool(false) \ No newline at end of file
+bool(false)
diff --git a/ext/pdo_pgsql/tests/is_in_transaction.phpt b/ext/pdo_pgsql/tests/is_in_transaction.phpt
index 99ff56162d..72da4f4e07 100644
--- a/ext/pdo_pgsql/tests/is_in_transaction.phpt
+++ b/ext/pdo_pgsql/tests/is_in_transaction.phpt
@@ -57,10 +57,10 @@ var_dump($db->inTransaction());
?>
--EXPECT--
Test PDO::PGSQL_TRANSACTION_INTRANS
-int(2)
+bool(true)
Test PDO::PGSQL_TRANSACTION_IDLE
-int(0)
+bool(false)
Test PDO::PGSQL_TRANSACTION_INERROR
-int(3)
+bool(true)
Test PDO::PGSQL_TRANSACTION_IDLE
-int(0)
+bool(false)
diff --git a/ext/pgsql/README b/ext/pgsql/README
index 2b4c412338..785b4f034b 100644
--- a/ext/pgsql/README
+++ b/ext/pgsql/README
@@ -35,7 +35,7 @@ names.
Older names will become aliases of new functions for backward
compatibility.
-Manual will be updated when this change is commited to CVS source.
+Manual will be updated when this change is committed to CVS source.
==== Configure Option Notes ====
You cannot specify PostgreSQL source directly to build PostgreSQL
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index d01dda6037..f90ba78780 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -4998,7 +4998,7 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z
}
smart_str_appends(&querystr,
- "SELECT a.attname, a.attnum, t.typname, a.attlen, a.attnotNULL, a.atthasdef, a.attndims "
+ "SELECT a.attname, a.attnum, t.typname, a.attlen, a.attnotnull, a.atthasdef, a.attndims, t.typtype = 'e' "
"FROM pg_class as c, pg_attribute a, pg_type t, pg_namespace n "
"WHERE a.attnum > 0 AND a.attrelid = c.oid AND c.relname = '");
tmp_name2 = php_addslashes(tmp_name2, strlen(tmp_name2), &new_len, 0 TSRMLS_CC);
@@ -5044,6 +5044,12 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z
add_assoc_bool(elem, "has default", 0);
}
add_assoc_long(elem, "array dims", atoi(PQgetvalue(pg_result,i,6)));
+ if (!strcmp(PQgetvalue(pg_result,i,7), "t")) {
+ add_assoc_bool(elem, "is enum", 1);
+ }
+ else {
+ add_assoc_bool(elem, "is enum", 0);
+ }
name = PQgetvalue(pg_result,i,0);
add_assoc_zval(meta, name, elem);
}
@@ -5077,7 +5083,18 @@ PHP_FUNCTION(pg_meta_data)
zval_dtor(return_value); /* destroy array */
RETURN_FALSE;
}
-}
+ else {
+ HashPosition pos;
+ zval **val;
+
+ for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(return_value), &pos);
+ zend_hash_get_current_data_ex(Z_ARRVAL_P(return_value), (void **)&val, &pos) == SUCCESS;
+ zend_hash_move_forward_ex(Z_ARRVAL_P(return_value), &pos)) {
+ /* delete newly added entry, in order to keep BC */
+ zend_hash_del_key_or_index(Z_ARRVAL_PP(val), "is enum", sizeof("is enum"), 0, HASH_DEL_KEY);
+ }
+ }
+}
/* }}} */
/* {{{ php_pgsql_get_data_type
@@ -5259,8 +5276,9 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
char *field = NULL;
uint field_len = -1;
ulong num_idx = -1;
- zval *meta, **def, **type, **not_null, **has_default, **val, *new_val;
+ zval *meta, **def, **type, **not_null, **has_default, **is_enum, **val, *new_val;
int new_len, key_type, err = 0, skip_field;
+ php_pgsql_data_type data_type;
assert(pg_link != NULL);
assert(Z_TYPE_P(values) == IS_ARRAY);
@@ -5311,17 +5329,30 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected broken meta data. Missing 'has default'");
err = 1;
}
+ if (!err && zend_hash_find(Z_ARRVAL_PP(def), "is enum", sizeof("is enum"), (void **)&is_enum) == FAILURE) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected broken meta data. Missing 'is enum'");
+ err = 1;
+ }
if (!err && (Z_TYPE_PP(val) == IS_ARRAY ||
Z_TYPE_PP(val) == IS_OBJECT ||
Z_TYPE_PP(val) == IS_CONSTANT_ARRAY)) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects scaler values as field values");
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects scalar values as field values");
err = 1;
}
if (err) {
break; /* break out for() */
}
ALLOC_INIT_ZVAL(new_val);
- switch(php_pgsql_get_data_type(Z_STRVAL_PP(type), Z_STRLEN_PP(type)))
+
+ if (Z_BVAL_PP(is_enum)) {
+ /* enums need to be treated like strings */
+ data_type = PG_TEXT;
+ }
+ else {
+ data_type = php_pgsql_get_data_type(Z_STRVAL_PP(type), Z_STRLEN_PP(type));
+ }
+
+ switch(data_type)
{
case PG_BOOL:
switch (Z_TYPE_PP(val)) {
diff --git a/ext/pgsql/tests/10pg_convert_85.phpt b/ext/pgsql/tests/10pg_convert_85.phpt
index 4f1c92bf1a..8b1cc8f538 100644
--- a/ext/pgsql/tests/10pg_convert_85.phpt
+++ b/ext/pgsql/tests/10pg_convert_85.phpt
@@ -12,6 +12,7 @@ error_reporting(E_ALL);
include 'config.inc';
$db = pg_connect($conn_str);
+pg_query($db, "SET standard_conforming_strings = 0");
$fields = array('num'=>'1234', 'str'=>'AAA', 'bin'=>'BBB');
$converted = pg_convert($db, $table_name, $fields);
diff --git a/ext/pgsql/tests/12pg_insert_85.phpt b/ext/pgsql/tests/12pg_insert_85.phpt
index a85dea0363..5fbbe4b7af 100644
--- a/ext/pgsql/tests/12pg_insert_85.phpt
+++ b/ext/pgsql/tests/12pg_insert_85.phpt
@@ -12,6 +12,8 @@ error_reporting(E_ALL);
include 'config.inc';
$db = pg_connect($conn_str);
+pg_query($db, "SET standard_conforming_strings = 0");
+
$fields = array('num'=>'1234', 'str'=>'AAA', 'bin'=>'BBB');
pg_insert($db, $table_name, $fields) or print "Error in test 1\n";
diff --git a/ext/pgsql/tests/14pg_update_85.phpt b/ext/pgsql/tests/14pg_update_85.phpt
index f1c77eac1d..06ca8c3de9 100644
--- a/ext/pgsql/tests/14pg_update_85.phpt
+++ b/ext/pgsql/tests/14pg_update_85.phpt
@@ -12,6 +12,8 @@ error_reporting(E_ALL);
include 'config.inc';
$db = pg_connect($conn_str);
+pg_query($db, "SET standard_conforming_strings = 0");
+
$fields = array('num'=>'1234', 'str'=>'ABC', 'bin'=>'XYZ');
$ids = array('num'=>'1234');
diff --git a/ext/pgsql/tests/18pg_escape_bytea.phpt b/ext/pgsql/tests/18pg_escape_bytea.phpt
index 43f98c4467..5f52a17d97 100644
--- a/ext/pgsql/tests/18pg_escape_bytea.phpt
+++ b/ext/pgsql/tests/18pg_escape_bytea.phpt
@@ -8,10 +8,11 @@ PostgreSQL pg_escape_bytea() functions
include('config.inc');
+$db = pg_connect($conn_str);
+
$image = file_get_contents(dirname(__FILE__) . '/php.gif');
$esc_image = pg_escape_bytea($image);
-$db = pg_connect($conn_str);
pg_query($db, 'INSERT INTO '.$table_name.' (num, bin) VALUES (9876, \''.$esc_image.'\');');
$result = pg_query($db, 'SELECT * FROM '.$table_name.' WHERE num = 9876');
$rows = pg_fetch_all($result);
diff --git a/ext/pgsql/tests/bug64609.phpt b/ext/pgsql/tests/bug64609.phpt
new file mode 100644
index 0000000000..0df63012da
--- /dev/null
+++ b/ext/pgsql/tests/bug64609.phpt
@@ -0,0 +1,30 @@
+--TEST--
+Bug #64609 (pg_convert enum type support)
+--SKIPIF--
+<?php
+include("skipif.inc");
+skip_server_version('8.3', '<');
+?>
+--FILE--
+<?php
+error_reporting(E_ALL);
+
+include 'config.inc';
+
+$db = pg_connect($conn_str);
+pg_query("BEGIN");
+pg_query("CREATE TYPE t_enum AS ENUM ('ok', 'ko')");
+pg_query("CREATE TABLE test_enum (a t_enum)");
+
+$fields = array('a' => 'ok');
+$converted = pg_convert($db, 'test_enum', $fields);
+
+pg_query("ROLLBACK");
+
+var_dump($converted);
+?>
+--EXPECT--
+array(1) {
+ ["a"]=>
+ string(4) "'ok'"
+}
diff --git a/ext/phar/func_interceptors.c b/ext/phar/func_interceptors.c
index 65193726de..00cb92ff13 100644
--- a/ext/phar/func_interceptors.c
+++ b/ext/phar/func_interceptors.c
@@ -733,7 +733,7 @@ notfound:
PHAR_G(cwd_len) = save_len;
efree(entry);
efree(arch);
- /* Error Occured */
+ /* Error Occurred */
if (!IS_EXISTS_CHECK(type)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%sstat failed for %s", IS_LINK_OPERATION(type) ? "L" : "", filename);
}
diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c
index a6dd2c8146..aeb11851c5 100644
--- a/ext/phar/phar_object.c
+++ b/ext/phar/phar_object.c
@@ -1899,6 +1899,10 @@ PHP_METHOD(Phar, buildFromDirectory)
pass.count = 0;
pass.ret = return_value;
pass.fp = php_stream_fopen_tmpfile();
+ if (pass.fp == NULL) {
+ zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\" unable to create temporary file", phar_obj->arc.archive->fname);
+ return;
+ }
if (phar_obj->arc.archive->is_persistent && FAILURE == phar_copy_on_write(&(phar_obj->arc.archive) TSRMLS_CC)) {
zval_ptr_dtor(&iteriter);
@@ -1979,6 +1983,10 @@ PHP_METHOD(Phar, buildFromIterator)
pass.ret = return_value;
pass.count = 0;
pass.fp = php_stream_fopen_tmpfile();
+ if (pass.fp == NULL) {
+ zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "phar \"%s\": unable to create temporary file", phar_obj->arc.archive->fname);
+ return;
+ }
if (SUCCESS == spl_iterator_apply(obj, (spl_iterator_apply_func_t) phar_build, (void *) &pass TSRMLS_CC)) {
phar_obj->arc.archive->ufp = pass.fp;
@@ -2311,6 +2319,10 @@ static zval *phar_convert_to_other(phar_archive_data *source, int convert, char
zend_get_hash_value, NULL, 0);
phar->fp = php_stream_fopen_tmpfile();
+ if (phar->fp == NULL) {
+ zend_throw_exception_ex(phar_ce_PharException, 0 TSRMLS_CC, "unable to create temporary file");
+ return NULL;
+ }
phar->fname = source->fname;
phar->fname_len = source->fname_len;
phar->is_temporary_alias = source->is_temporary_alias;
diff --git a/ext/phar/tar.c b/ext/phar/tar.c
index f170335437..0e60e3db13 100644
--- a/ext/phar/tar.c
+++ b/ext/phar/tar.c
@@ -847,7 +847,10 @@ int phar_tar_setmetadata(zval *metadata, phar_entry_info *entry, char **error TS
entry->is_modified = 1;
entry->fp = php_stream_fopen_tmpfile();
entry->offset = entry->offset_abs = 0;
-
+ if (entry->fp == NULL) {
+ spprintf(error, 0, "phar error: unable to create temporary file");
+ return -1;
+ }
if (entry->metadata_str.len != php_stream_write(entry->fp, entry->metadata_str.c, entry->metadata_str.len)) {
spprintf(error, 0, "phar tar error: unable to write metadata to magic metadata file \"%s\"", entry->filename);
zend_hash_del(&(entry->phar->manifest), entry->filename, entry->filename_len);
@@ -949,7 +952,10 @@ int phar_tar_flush(phar_archive_data *phar, char *user_stub, long len, int defau
entry.filename = estrndup(".phar/alias.txt", sizeof(".phar/alias.txt")-1);
entry.filename_len = sizeof(".phar/alias.txt")-1;
entry.fp = php_stream_fopen_tmpfile();
-
+ if (entry.fp == NULL) {
+ spprintf(error, 0, "phar error: unable to create temporary file");
+ return -1;
+ }
if (phar->alias_len != (int)php_stream_write(entry.fp, phar->alias, phar->alias_len)) {
if (error) {
spprintf(error, 0, "unable to set alias in tar-based phar \"%s\"", phar->fname);
@@ -1014,6 +1020,10 @@ int phar_tar_flush(phar_archive_data *phar, char *user_stub, long len, int defau
len = pos - user_stub + 18;
entry.fp = php_stream_fopen_tmpfile();
+ if (entry.fp == NULL) {
+ spprintf(error, 0, "phar error: unable to create temporary file");
+ return EOF;
+ }
entry.uncompressed_filesize = len + 5;
if ((size_t)len != php_stream_write(entry.fp, user_stub, len)
@@ -1038,7 +1048,10 @@ int phar_tar_flush(phar_archive_data *phar, char *user_stub, long len, int defau
} else {
/* Either this is a brand new phar (add the stub), or the default stub is required (overwrite the stub) */
entry.fp = php_stream_fopen_tmpfile();
-
+ if (entry.fp == NULL) {
+ spprintf(error, 0, "phar error: unable to create temporary file");
+ return EOF;
+ }
if (sizeof(newstub)-1 != php_stream_write(entry.fp, newstub, sizeof(newstub)-1)) {
php_stream_close(entry.fp);
if (error) {
@@ -1087,7 +1100,6 @@ nostub:
}
newfile = php_stream_fopen_tmpfile();
-
if (!newfile) {
if (error) {
spprintf(error, 0, "unable to create temporary file");
@@ -1174,7 +1186,10 @@ nostub:
entry.filename = ".phar/signature.bin";
entry.filename_len = sizeof(".phar/signature.bin")-1;
entry.fp = php_stream_fopen_tmpfile();
-
+ if (entry.fp == NULL) {
+ spprintf(error, 0, "phar error: unable to create temporary file");
+ return EOF;
+ }
#ifdef WORDS_BIGENDIAN
# define PHAR_SET_32(var, buffer) \
*(php_uint32 *)(var) = (((((unsigned char*)&(buffer))[3]) << 24) \
diff --git a/ext/phar/tests/files/openssl.cnf b/ext/phar/tests/files/openssl.cnf
index 10e69076cf..4ed40fdc8a 100644
--- a/ext/phar/tests/files/openssl.cnf
+++ b/ext/phar/tests/files/openssl.cnf
@@ -3,7 +3,7 @@ default_bits = 1024
default_keyfile = privkey.pem
distinguished_name = req_distinguished_name
attributes = req_attributes
-x509_extensions = v3_ca # The extentions to add to the self signed cert
+x509_extensions = v3_ca # The extensions to add to the self signed cert
string_mask = MASK:4294967295
diff --git a/ext/phar/util.c b/ext/phar/util.c
index 05c90cd458..898d8bd4b2 100644
--- a/ext/phar/util.c
+++ b/ext/phar/util.c
@@ -889,6 +889,10 @@ int phar_copy_entry_fp(phar_entry_info *source, phar_entry_info *dest, char **er
dest->offset = 0;
dest->is_modified = 1;
dest->fp = php_stream_fopen_tmpfile();
+ if (dest->fp == NULL) {
+ spprintf(error, 0, "phar error: unable to create temporary file");
+ return EOF;
+ }
phar_seek_efp(source, 0, SEEK_SET, 0, 1 TSRMLS_CC);
link = phar_get_link_source(source TSRMLS_CC);
@@ -1129,6 +1133,10 @@ int phar_separate_entry_fp(phar_entry_info *entry, char **error TSRMLS_DC) /* {{
}
fp = php_stream_fopen_tmpfile();
+ if (fp == NULL) {
+ spprintf(error, 0, "phar error: unable to create temporary file");
+ return FAILURE;
+ }
phar_seek_efp(entry, 0, SEEK_SET, 0, 1 TSRMLS_CC);
link = phar_get_link_source(entry TSRMLS_CC);
diff --git a/ext/phar/zip.c b/ext/phar/zip.c
index 33732fbd63..6ba745e9cb 100644
--- a/ext/phar/zip.c
+++ b/ext/phar/zip.c
@@ -937,10 +937,11 @@ is_compressed:
PHAR_SET_32(local.uncompsize, entry->uncompressed_filesize);
PHAR_SET_32(central.compsize, entry->compressed_filesize);
PHAR_SET_32(local.compsize, entry->compressed_filesize);
-
- if (-1 == php_stream_seek(p->old, entry->offset_abs, SEEK_SET)) {
- spprintf(p->error, 0, "unable to seek to start of file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fname);
- return ZEND_HASH_APPLY_STOP;
+ if (p->old) {
+ if (-1 == php_stream_seek(p->old, entry->offset_abs, SEEK_SET)) {
+ spprintf(p->error, 0, "unable to seek to start of file \"%s\" while creating zip-based phar \"%s\"", entry->filename, entry->phar->fname);
+ return ZEND_HASH_APPLY_STOP;
+ }
}
}
not_compressed:
@@ -1095,6 +1096,10 @@ static int phar_zip_applysignature(phar_archive_data *phar, struct _phar_zip_pas
off_t tell, st;
newfile = php_stream_fopen_tmpfile();
+ if (newfile == NULL) {
+ spprintf(pass->error, 0, "phar error: unable to create temporary file for the signature file");
+ return FAILURE;
+ }
st = tell = php_stream_tell(pass->filefp);
/* copy the local files, central directory, and the zip comment to generate the hash */
php_stream_seek(pass->filefp, 0, SEEK_SET);
@@ -1122,6 +1127,10 @@ static int phar_zip_applysignature(phar_archive_data *phar, struct _phar_zip_pas
entry.fp = php_stream_fopen_tmpfile();
entry.fp_type = PHAR_MOD;
entry.is_modified = 1;
+ if (entry.fp == NULL) {
+ spprintf(pass->error, 0, "phar error: unable to create temporary file for signature");
+ return FAILURE;
+ }
PHAR_SET_32(sigbuf, phar->sig_flags);
PHAR_SET_32(sigbuf + 4, signature_length);
@@ -1192,7 +1201,10 @@ int phar_zip_flush(phar_archive_data *phar, char *user_stub, long len, int defau
/* set alias */
if (!phar->is_temporary_alias && phar->alias_len) {
entry.fp = php_stream_fopen_tmpfile();
-
+ if (entry.fp == NULL) {
+ spprintf(error, 0, "phar error: unable to create temporary file");
+ return EOF;
+ }
if (phar->alias_len != (int)php_stream_write(entry.fp, phar->alias, phar->alias_len)) {
if (error) {
spprintf(error, 0, "unable to set alias in zip-based phar \"%s\"", phar->fname);
@@ -1267,6 +1279,10 @@ int phar_zip_flush(phar_archive_data *phar, char *user_stub, long len, int defau
len = pos - user_stub + 18;
entry.fp = php_stream_fopen_tmpfile();
+ if (entry.fp == NULL) {
+ spprintf(error, 0, "phar error: unable to create temporary file");
+ return EOF;
+ }
entry.uncompressed_filesize = len + 5;
if ((size_t)len != php_stream_write(entry.fp, user_stub, len)
@@ -1300,7 +1316,10 @@ int phar_zip_flush(phar_archive_data *phar, char *user_stub, long len, int defau
} else {
/* Either this is a brand new phar (add the stub), or the default stub is required (overwrite the stub) */
entry.fp = php_stream_fopen_tmpfile();
-
+ if (entry.fp == NULL) {
+ spprintf(error, 0, "phar error: unable to create temporary file");
+ return EOF;
+ }
if (sizeof(newstub)-1 != php_stream_write(entry.fp, newstub, sizeof(newstub)-1)) {
php_stream_close(entry.fp);
if (error) {
diff --git a/ext/posix/config.m4 b/ext/posix/config.m4
index 83ead2e46a..82b80ce972 100644
--- a/ext/posix/config.m4
+++ b/ext/posix/config.m4
@@ -45,6 +45,6 @@ int main(int argc, char *argv[])
])
])
if test "$ac_cv_have_utsname_domainname" = yes; then
- AC_DEFINE(HAVE_UTSNAME_DOMAINNAME, 1, [Wether struct utsname has domainname])
+ AC_DEFINE(HAVE_UTSNAME_DOMAINNAME, 1, [Whether struct utsname has domainname])
fi
fi
diff --git a/ext/session/session.c b/ext/session/session.c
index a3be9a78c2..d9989ba753 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -2221,6 +2221,9 @@ static PHP_MSHUTDOWN_FUNCTION(session) /* {{{ */
PHP_MSHUTDOWN(ps_mm) (SHUTDOWN_FUNC_ARGS_PASSTHRU);
#endif
+ /* restore the orig callback */
+ php_rfc1867_callback = php_session_rfc1867_orig_callback;
+
ps_serializers[PREDEFINED_SERIALIZERS].name = NULL;
memset(&ps_modules[PREDEFINED_MODULES], 0, (MAX_MODULES-PREDEFINED_MODULES)*sizeof(ps_module *));
diff --git a/ext/shmop/README b/ext/shmop/README
index 5ec15861b8..a8ea03af91 100644
--- a/ext/shmop/README
+++ b/ext/shmop/README
@@ -4,12 +4,12 @@ Shared Memory Operations Extension to PHP
While developing a search deamon we needed a php based front end
to communicate the deamon via SHM. PHP already had a shared memory
- extention (sysvshm) written by Christian Cartus <cartus@atrior.de>,
- unfortunatly this extention was designed with PHP only in mind and
+ extension (sysvshm) written by Christian Cartus <cartus@atrior.de>,
+ unfortunately this extension was designed with PHP only in mind and
offers high level features which are extremly bothersome for basic SHM
we had in mind. After spending a day trying to reverse engineer and figure
out the format of sysvshm we decided that it would be much easier to
- add our own extention to php for simple SHM operations, we were right :)).
+ add our own extension to php for simple SHM operations, we were right :)).
the functions are:
diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c
index c97692822b..727328b407 100644
--- a/ext/snmp/snmp.c
+++ b/ext/snmp/snmp.c
@@ -719,7 +719,7 @@ static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st,
zval *snmpval = NULL;
int snmp_errno;
- /* we start with retval=FALSE. If any actual data is aquired, retval will be set to appropriate type */
+ /* we start with retval=FALSE. If any actual data is acquired, retval will be set to appropriate type */
RETVAL_FALSE;
/* reset errno and errstr */
@@ -1871,7 +1871,7 @@ PHP_METHOD(snmp, close)
/* }}} */
/* {{{ proto mixed SNMP::get(mixed object_id [, bool preserve_keys])
- Fetch a SNMP object returing scalar for single OID and array of oid->value pairs for multi OID request */
+ Fetch a SNMP object returning scalar for single OID and array of oid->value pairs for multi OID request */
PHP_METHOD(snmp, get)
{
php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_GET, (-1));
@@ -1879,7 +1879,7 @@ PHP_METHOD(snmp, get)
/* }}} */
/* {{{ proto mixed SNMP::getnext(mixed object_id)
- Fetch a SNMP object returing scalar for single OID and array of oid->value pairs for multi OID request */
+ Fetch a SNMP object returning scalar for single OID and array of oid->value pairs for multi OID request */
PHP_METHOD(snmp, getnext)
{
php_snmp(INTERNAL_FUNCTION_PARAM_PASSTHRU, SNMP_CMD_GETNEXT, (-1));
diff --git a/ext/soap/TODO b/ext/soap/TODO
index ad0b11c948..9e6784f6f4 100644
--- a/ext/soap/TODO
+++ b/ext/soap/TODO
@@ -41,7 +41,7 @@ Encoding
? support for "nillable" and "nil"
? default values of <element>
? provide schema 1999/2001 support???
-? make internal refrences for soap encoding (use seralization logic)???
+? make internal references for soap encoding (use serialization logic)???
? provide user space overriding of serialization certin objects and types???
WSDL
diff --git a/ext/soap/TODO.old b/ext/soap/TODO.old
index 59deb4b9dc..b219c61f8a 100644
--- a/ext/soap/TODO.old
+++ b/ext/soap/TODO.old
@@ -2,13 +2,13 @@ TODO:
make sure soap 1.1 and 1.2 is supported fully
Better WSDL support Client and server (how much validation is needed here?)
UDDI??
-make internal refrences for soap encoding (use seralization logic)
+make internal references for soap encoding (use serialization logic)
add ini option for always soap_error_handler
provide user space overriding of serialization certin objects and types
serialization in general needs to be polished/finished... all xsd types
look to see if php-soap will work with out always_populate_raw_post_data on
see if client will work with ssl.. should be eaiser with php_streams
-work on soap seralizer (php serialization)
+work on soap serializer (php serialization)
-work on a soap-service 'regiestry' and 'proxy' (apache soap style)
-convert all string mainpulation to use smart_str
make the 'soap' packet abstract.. maybe incorperate xml-rpc
diff --git a/ext/soap/interop/client_round2_params.php b/ext/soap/interop/client_round2_params.php
index f0987a1702..e0b2c0e82d 100644
--- a/ext/soap/interop/client_round2_params.php
+++ b/ext/soap/interop/client_round2_params.php
@@ -486,7 +486,7 @@ $test->headers_expect = array();
$soap_tests['GroupC'][] = $test;
// echoMeStringRequest with endpoint header destination, must understand,
-// invalid namespace, should recieve a fault
+// invalid namespace, should receive a fault
$test = new SOAP_Test('echoVoid(echoMeStringRequest invalid namespace)', NULL);
$test->headers[] = new SoapHeader('http://unknown.org/echoheader/','echoMeStringRequest', 'hello world', 1, SOAP_ACTOR_NEXT);
$test->headers_expect = array();
diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c
index d83b85e639..7fc755d51b 100644
--- a/ext/soap/php_http.c
+++ b/ext/soap/php_http.c
@@ -1160,7 +1160,7 @@ try_again:
zval *err;
MAKE_STD_ZVAL(err);
ZVAL_STRINGL(err, http_body, http_body_size, 1);
- add_soap_fault(this_ptr, "HTTP", "Didn't recieve an xml document", NULL, err TSRMLS_CC);
+ add_soap_fault(this_ptr, "HTTP", "Didn't receive an xml document", NULL, err TSRMLS_CC);
efree(content_type);
efree(http_headers);
efree(http_body);
diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c
index 33e137cbbb..0ac4c2ed7a 100644
--- a/ext/soap/php_sdl.c
+++ b/ext/soap/php_sdl.c
@@ -40,8 +40,8 @@ static void delete_binding(void *binding);
static void delete_binding_persistent(void *binding);
static void delete_function(void *function);
static void delete_function_persistent(void *function);
-static void delete_parameter(void *paramater);
-static void delete_parameter_persistent(void *paramater);
+static void delete_parameter(void *parameter);
+static void delete_parameter_persistent(void *parameter);
static void delete_header(void *header);
static void delete_header_persistent(void *header);
static void delete_document(void *doc_ptr);
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index 7df84e5b2a..2a7299eced 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -1669,7 +1669,7 @@ PHP_METHOD(SoapServer, handle)
}
}
#endif
- /* If new session or something wierd happned */
+ /* If new session or something weird happned */
if (soap_obj == NULL) {
zval *tmp_soap;
@@ -3909,7 +3909,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
if (version == SOAP_1_1) {
if (zend_hash_find(prop, "faultcode", sizeof("faultcode"), (void**)&tmp) == SUCCESS) {
- int new_len;
+ size_t new_len;
xmlNodePtr node = xmlNewNode(NULL, BAD_CAST("faultcode"));
char *str = php_escape_html_entities((unsigned char*)Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), &new_len, 0, 0, NULL TSRMLS_CC);
xmlAddChild(param, node);
@@ -3919,7 +3919,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
xmlNodeSetContent(node, code);
xmlFree(code);
} else {
- xmlNodeSetContentLen(node, BAD_CAST(str), new_len);
+ xmlNodeSetContentLen(node, BAD_CAST(str), (int)new_len);
}
efree(str);
}
@@ -3934,7 +3934,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
detail_name = "detail";
} else {
if (zend_hash_find(prop, "faultcode", sizeof("faultcode"), (void**)&tmp) == SUCCESS) {
- int new_len;
+ size_t new_len;
xmlNodePtr node = xmlNewChild(param, ns, BAD_CAST("Code"), NULL);
char *str = php_escape_html_entities((unsigned char*)Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), &new_len, 0, 0, NULL TSRMLS_CC);
node = xmlNewChild(node, ns, BAD_CAST("Value"), NULL);
@@ -3944,7 +3944,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, char *function
xmlNodeSetContent(node, code);
xmlFree(code);
} else {
- xmlNodeSetContentLen(node, BAD_CAST(str), new_len);
+ xmlNodeSetContentLen(node, BAD_CAST(str), (int)new_len);
}
efree(str);
}
diff --git a/ext/soap/tests/bugs/bug27742.wsdl b/ext/soap/tests/bugs/bug27742.wsdl
index f38d911852..7f1514acbf 100644
--- a/ext/soap/tests/bugs/bug27742.wsdl
+++ b/ext/soap/tests/bugs/bug27742.wsdl
@@ -5,7 +5,7 @@
<xsd:schema targetNamespace="urn:TMSWebServices" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tms="urn:TMSWebServices" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<simpleType name="duration">
<annotation>
- <documentation xml:lang="en">ISO 8601 pattern used to denote program durations. Year, month and day are not relevent in our context and are omitted.</documentation>
+ <documentation xml:lang="en">ISO 8601 pattern used to denote program durations. Year, month and day are not relevant in our context and are omitted.</documentation>
</annotation>
<restriction base="xsd:duration">
<pattern value="PT[0-9][0-9]H[0-5][0-9]M"/>
@@ -484,7 +484,7 @@
</attribute>
<attribute name="to" type="tms:date" use="optional">
<annotation>
- <documentation xml:lang="en">Date untill which the mapping is valid, within the validity period of the whole XTVD document. @IMPORTANT : The change will occur at midnight.</documentation>
+ <documentation xml:lang="en">Date until which the mapping is valid, within the validity period of the whole XTVD document. @IMPORTANT : The change will occur at midnight.</documentation>
</annotation>
</attribute>
</complexType>
diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c
index 06bd0ec6b4..b3bcbf2600 100644
--- a/ext/sockets/sockets.c
+++ b/ext/sockets/sockets.c
@@ -1822,8 +1822,8 @@ PHP_FUNCTION(socket_recvfrom)
retval = recvfrom(php_sock->bsd_socket, recv_buf, arg3, arg4, (struct sockaddr *)&s_un, (socklen_t *)&slen);
if (retval < 0) {
- efree(recv_buf);
PHP_SOCKET_ERROR(php_sock, "unable to recvfrom", errno);
+ efree(recv_buf);
RETURN_FALSE;
}
@@ -1847,8 +1847,8 @@ PHP_FUNCTION(socket_recvfrom)
retval = recvfrom(php_sock->bsd_socket, recv_buf, arg3, arg4, (struct sockaddr *)&sin, (socklen_t *)&slen);
if (retval < 0) {
- efree(recv_buf);
PHP_SOCKET_ERROR(php_sock, "unable to recvfrom", errno);
+ efree(recv_buf);
RETURN_FALSE;
}
@@ -1876,8 +1876,8 @@ PHP_FUNCTION(socket_recvfrom)
retval = recvfrom(php_sock->bsd_socket, recv_buf, arg3, arg4, (struct sockaddr *)&sin6, (socklen_t *)&slen);
if (retval < 0) {
- efree(recv_buf);
PHP_SOCKET_ERROR(php_sock, "unable to recvfrom", errno);
+ efree(recv_buf);
RETURN_FALSE;
}
diff --git a/ext/spl/internal/cachingiterator.inc b/ext/spl/internal/cachingiterator.inc
index 33258ab954..4d4bf8dbff 100644
--- a/ext/spl/internal/cachingiterator.inc
+++ b/ext/spl/internal/cachingiterator.inc
@@ -23,7 +23,7 @@
* flag CALL_TOSTRING to do the conversion when the actual element
* is being fetched. Otherwise the conversion would happen with the
* already changed iterator. If you do not need this then it you should
- * omit this flag because it costs unneccessary work and time.
+ * omit this flag because it costs unnecessary work and time.
*/
class CachingIterator implements OuterIterator
{
diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c
index e6cd155a8a..eb8247654e 100644
--- a/ext/spl/spl_iterators.c
+++ b/ext/spl/spl_iterators.c
@@ -1027,12 +1027,12 @@ static void spl_recursive_tree_iterator_get_entry(spl_recursive_it_object * obje
zend_replace_error_handling(EH_THROW, spl_ce_UnexpectedValueException, &error_handling TSRMLS_CC);
if (data && *data) {
RETVAL_ZVAL(*data, 1, 0);
- }
- if (Z_TYPE_P(return_value) == IS_ARRAY) {
- zval_dtor(return_value);
- ZVAL_STRINGL(return_value, "Array", sizeof("Array")-1, 1);
- } else {
- convert_to_string(return_value);
+ if (Z_TYPE_P(return_value) == IS_ARRAY) {
+ zval_dtor(return_value);
+ ZVAL_STRINGL(return_value, "Array", sizeof("Array")-1, 1);
+ } else {
+ convert_to_string(return_value);
+ }
}
zend_restore_error_handling(&error_handling TSRMLS_CC);
}
@@ -1133,8 +1133,15 @@ SPL_METHOD(RecursiveTreeIterator, current)
}
}
+ INIT_ZVAL(prefix);
+ INIT_ZVAL(entry);
spl_recursive_tree_iterator_get_prefix(object, &prefix TSRMLS_CC);
spl_recursive_tree_iterator_get_entry(object, &entry TSRMLS_CC);
+ if (Z_TYPE(entry) != IS_STRING) {
+ zval_dtor(&prefix);
+ zval_dtor(&entry);
+ RETURN_NULL();
+ }
spl_recursive_tree_iterator_get_postfix(object, &postfix TSRMLS_CC);
str_len = Z_STRLEN(prefix) + Z_STRLEN(entry) + Z_STRLEN(postfix);
diff --git a/ext/spl/tests/iterator_031.phpt b/ext/spl/tests/iterator_031.phpt
index 40342f4bb4..8bd3ca7c54 100644
--- a/ext/spl/tests/iterator_031.phpt
+++ b/ext/spl/tests/iterator_031.phpt
@@ -1,5 +1,5 @@
--TEST--
-SPL: AppendIterator::append() rewinds when neccessary
+SPL: AppendIterator::append() rewinds when necessary
--FILE--
<?php
diff --git a/ext/spl/tests/spl_004.phpt b/ext/spl/tests/spl_004.phpt
index 97896f8154..d56f48f896 100644
--- a/ext/spl/tests/spl_004.phpt
+++ b/ext/spl/tests/spl_004.phpt
@@ -43,8 +43,8 @@ var_dump(iterator_apply($it, 'test'));
echo "===ERRORS===\n";
var_dump(iterator_apply($it, 'test', 1));
-var_dump(iterator_apply($it, 'non_existing_functon'));
-var_dump(iterator_apply($it, 'non_existing_functon', NULL, 2));
+var_dump(iterator_apply($it, 'non_existing_function'));
+var_dump(iterator_apply($it, 'non_existing_function', NULL, 2));
?>
===DONE===
@@ -77,7 +77,7 @@ int(4)
Error: Argument 3 passed to iterator_apply() must be of the type array, integer given
Error: iterator_apply() expects parameter 3 to be array, integer given
NULL
-Error: iterator_apply() expects parameter 2 to be a valid callback, function 'non_existing_functon' not found or invalid function name
+Error: iterator_apply() expects parameter 2 to be a valid callback, function 'non_existing_function' not found or invalid function name
NULL
Error: iterator_apply() expects at most 3 parameters, 4 given
NULL
diff --git a/ext/sqlite3/libsqlite/sqlite3.c b/ext/sqlite3/libsqlite/sqlite3.c
index d96367e212..655b4cf4dc 100644
--- a/ext/sqlite3/libsqlite/sqlite3.c
+++ b/ext/sqlite3/libsqlite/sqlite3.c
@@ -361,7 +361,7 @@
** The SQLITE_THREADSAFE macro must be defined as 0, 1, or 2.
** 0 means mutexes are permanently disable and the library is never
** threadsafe. 1 means the library is serialized which is the highest
-** level of threadsafety. 2 means the libary is multithreaded - multiple
+** level of threadsafety. 2 means the library is multithreaded - multiple
** threads can use SQLite as long as no two threads try to use the same
** database connection at the same time.
**
@@ -19267,7 +19267,7 @@ SQLITE_PRIVATE void sqlite3VXPrintf(
}
if( xtype==etGENERIC && precision>0 ) precision--;
#if 0
- /* Rounding works like BSD when the constant 0.4999 is used. Wierd! */
+ /* Rounding works like BSD when the constant 0.4999 is used. Weird! */
for(idx=precision, rounder=0.4999; idx>0; idx--, rounder*=0.1);
#else
/* It makes more sense to use 0.5 */
@@ -23962,7 +23962,7 @@ static int os2Delete(
}
/*
-** Check the existance and status of a file.
+** Check the existence and status of a file.
*/
static int os2Access(
sqlite3_vfs *pVfs, /* Not used on os2 */
@@ -26315,7 +26315,7 @@ static int nolockClose(sqlite3_file *id) {
/******************************************************************************
************************* Begin dot-file Locking ******************************
**
-** The dotfile locking implementation uses the existance of separate lock
+** The dotfile locking implementation uses the existence of separate lock
** files in order to control access to the database. This works on just
** about every filesystem imaginable. But there are serious downsides:
**
@@ -26330,7 +26330,7 @@ static int nolockClose(sqlite3_file *id) {
**
** Dotfile locking works by creating a file in the same directory as the
** database and with the same name but with a ".lock" extension added.
-** The existance of a lock file implies an EXCLUSIVE lock. All other lock
+** The existence of a lock file implies an EXCLUSIVE lock. All other lock
** types (SHARED, RESERVED, PENDING) are mapped into EXCLUSIVE.
*/
@@ -29637,7 +29637,7 @@ static int unixDelete(
}
/*
-** Test the existance of or access permissions of file zPath. The
+** Test the existence of or access permissions of file zPath. The
** test performed depends on the value of flags:
**
** SQLITE_ACCESS_EXISTS: Return 1 if the file exists
@@ -33788,7 +33788,7 @@ static int winDelete(
}
/*
-** Check the existance and status of a file.
+** Check the existence and status of a file.
*/
static int winAccess(
sqlite3_vfs *pVfs, /* Not used on win32 */
@@ -34345,7 +34345,7 @@ SQLITE_API int sqlite3_os_end(void){
/*
** A bitmap is an instance of the following structure.
**
-** This bitmap records the existance of zero or more bits
+** This bitmap records the existence of zero or more bits
** with values between 1 and iSize, inclusive.
**
** There are three possible representations of the bitmap.
@@ -35828,7 +35828,7 @@ static sqlite3_pcache *pcache1Create(int szPage, int bPurgeable){
int sz; /* Bytes of memory required to allocate the new cache */
/*
- ** The seperateCache variable is true if each PCache has its own private
+ ** The separateCache variable is true if each PCache has its own private
** PGroup. In other words, separateCache is true for mode (1) where no
** mutexing is required.
**
@@ -41734,7 +41734,7 @@ static void pagerUnlockIfUnused(Pager *pPager){
** page is initialized to all zeros.
**
** If noContent is true, it means that we do not care about the contents
-** of the page. This occurs in two seperate scenarios:
+** of the page. This occurs in two separate scenarios:
**
** a) When reading a free-list leaf page from the database, and
**
@@ -48700,7 +48700,7 @@ static int allocateSpace(MemPage *pPage, int nByte, int *pIdx){
}else if( gap+2<=top ){
/* Search the freelist looking for a free slot big enough to satisfy
** the request. The allocation is made from the first free slot in
- ** the list that is large enough to accomadate it.
+ ** the list that is large enough to accommodate it.
*/
int pc, addr;
for(addr=hdr+1; (pc = get2byte(&data[addr]))>0; addr=pc){
@@ -50520,7 +50520,7 @@ SQLITE_PRIVATE int sqlite3BtreeIncrVacuum(Btree *p){
/*
** This routine is called prior to sqlite3PagerCommit when a transaction
-** is commited for an auto-vacuum database.
+** is committed for an auto-vacuum database.
**
** If SQLITE_OK is returned, then *pnTrunc is set to the number of pages
** the database file should be truncated to during the commit process.
@@ -52264,7 +52264,7 @@ SQLITE_PRIVATE int sqlite3BtreePrevious(BtCursor *pCur, int *pRes){
** which in turn can make database access faster.
**
** If the "exact" parameter is not 0, and the page-number nearby exists
-** anywhere on the free-list, then it is guarenteed to be returned. This
+** anywhere on the free-list, then it is guaranteed to be returned. This
** is only used by auto-vacuum databases when allocating a new table.
*/
static int allocateBtreePage(
@@ -58372,7 +58372,7 @@ SQLITE_PRIVATE void sqlite3VdbeNoopComment(Vdbe *p, const char *zFormat, ...){
** by running with Valgrind.
**
** About the #ifdef SQLITE_OMIT_TRACE: Normally, this routine is never called
-** unless p->nOp>0. This is because in the absense of SQLITE_OMIT_TRACE,
+** unless p->nOp>0. This is because in the absence of SQLITE_OMIT_TRACE,
** an OP_Trace instruction is always inserted by sqlite3VdbeGet() as soon as
** a new VDBE is created. So we are free to set addr to p->nOp-1 without
** having to double-check to make sure that the result is non-negative. But
@@ -59551,7 +59551,7 @@ static void invalidateCursorsOnModifiedBtrees(sqlite3 *db){
** close it now. Argument eOp must be either SAVEPOINT_ROLLBACK or
** SAVEPOINT_RELEASE. If it is SAVEPOINT_ROLLBACK, then the statement
** transaction is rolled back. If eOp is SAVEPOINT_RELEASE, then the
-** statement transaction is commtted.
+** statement transaction is committed.
**
** If an IO error occurs, an SQLITE_IOERR_XXX error code is returned.
** Otherwise SQLITE_OK.
@@ -60076,7 +60076,7 @@ SQLITE_PRIVATE int sqlite3VdbeCursorMoveto(VdbeCursor *p){
** the blob of data that it corresponds to. In a table record, all serial
** types are stored at the start of the record, and the blobs of data at
** the end. Hence these functions allow the caller to handle the
-** serial-type and data blob seperately.
+** serial-type and data blob separately.
**
** The following table describes the various storage classes for data:
**
@@ -65590,7 +65590,7 @@ case OP_AutoCommit: {
** other process can start another write transaction while this transaction is
** underway. Starting a write transaction also creates a rollback journal. A
** write transaction must be started before any changes can be made to the
-** database. If P2 is 2 or greater then an EXCLUSIVE lock is also obtained
+** database. If P2 is 2 or greater than an EXCLUSIVE lock is also obtained
** on the file.
**
** If a write-transaction is started and the Vdbe.usesStmtJournal flag is
@@ -72784,7 +72784,7 @@ SQLITE_PRIVATE int sqlite3FindInIndex(Parse *pParse, Expr *pX, int *prNotFound){
**
** If rMayHaveNull is zero, that means that the subquery is being used
** for membership testing only. There is no need to initialize any
-** registers to indicate the presense or absence of NULLs on the RHS.
+** registers to indicate the presence or absence of NULLs on the RHS.
**
** For a SELECT or EXISTS operator, return the register that holds the
** result. For IN operators or if an error occurs, the return value is 0.
@@ -74392,7 +74392,7 @@ SQLITE_PRIVATE void sqlite3ExprIfTrue(Parse *pParse, Expr *pExpr, int dest, int
int r1, r2;
assert( jumpIfNull==SQLITE_JUMPIFNULL || jumpIfNull==0 );
- if( NEVER(v==0) ) return; /* Existance of VDBE checked by caller */
+ if( NEVER(v==0) ) return; /* Existence of VDBE checked by caller */
if( NEVER(pExpr==0) ) return; /* No way this can happen */
op = pExpr->op;
switch( op ){
@@ -74512,7 +74512,7 @@ SQLITE_PRIVATE void sqlite3ExprIfFalse(Parse *pParse, Expr *pExpr, int dest, int
int r1, r2;
assert( jumpIfNull==SQLITE_JUMPIFNULL || jumpIfNull==0 );
- if( NEVER(v==0) ) return; /* Existance of VDBE checked by caller */
+ if( NEVER(v==0) ) return; /* Existence of VDBE checked by caller */
if( pExpr==0 ) return;
/* The value of pExpr->op and op are related as follows:
@@ -79452,7 +79452,7 @@ SQLITE_PRIVATE void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView,
/* Drop all SQLITE_MASTER table and index entries that refer to the
** table. The program name loops through the master table and deletes
** every row that refers to a table of the same name as the one being
- ** dropped. Triggers are handled seperately because a trigger can be
+ ** dropped. Triggers are handled separately because a trigger can be
** created in the temp database that refers to a table in another
** database.
*/
@@ -82374,7 +82374,7 @@ static void absFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
**
** If p1 is negative, then we begin abs(p1) from the end of x[].
**
-** If p2 is negative, return the p2 characters preceeding p1.
+** If p2 is negative, return the p2 characters preceding p1.
*/
static void substrFunc(
sqlite3_context *context,
@@ -83172,7 +83172,7 @@ static void zeroblobFunc(
/*
** The replace() function. Three arguments are all strings: call
** them A, B, and C. The result is also a string which is derived
-** from A by replacing every occurance of B with C. The match
+** from A by replacing every occurrence of B with C. The match
** must be exact. Collating sequences are not used.
*/
static void replaceFunc(
@@ -90574,7 +90574,7 @@ SQLITE_PRIVATE void sqlite3SelectDelete(sqlite3 *db, Select *p){
}
/*
-** Given 1 to 3 identifiers preceeding the JOIN keyword, determine the
+** Given 1 to 3 identifiers preceding the JOIN keyword, determine the
** type of join. Return an integer constant that expresses that type
** in terms of the following bit values:
**
@@ -91892,7 +91892,7 @@ static void computeLimitRegisters(Parse *pParse, Select *p, int iBreak){
/*
** "LIMIT -1" always shows all rows. There is some
- ** contraversy about what the correct behavior should be.
+ ** controversy about what the correct behavior should be.
** The current implementation interprets "LIMIT 0" to mean
** no rows.
*/
@@ -93544,7 +93544,7 @@ static u8 minMaxQuery(Select *p){
/*
** The select statement passed as the first argument is an aggregate query.
-** The second argment is the associated aggregate-info object. This
+** The second argument is the associated aggregate-info object. This
** function tests if the SELECT is of the form:
**
** SELECT count(*) FROM <tbl>
@@ -93617,7 +93617,7 @@ SQLITE_PRIVATE int sqlite3IndexedByLookup(Parse *pParse, struct SrcList_item *pF
** without worrying about messing up the presistent representation
** of the view.
**
-** (3) Add terms to the WHERE clause to accomodate the NATURAL keyword
+** (3) Add terms to the WHERE clause to accommodate the NATURAL keyword
** on joins and the ON and USING clause of joins.
**
** (4) Scan the list of columns in the result set (pEList) looking
@@ -94252,7 +94252,7 @@ SQLITE_PRIVATE int sqlite3Select(
if( pSub==0 || pItem->isPopulated ) continue;
/* Increment Parse.nHeight by the height of the largest expression
- ** tree refered to by this, the parent select. The child select
+ ** tree referred to by this, the parent select. The child select
** may contain expression trees of at most
** (SQLITE_MAX_EXPR_DEPTH-Parse.nHeight) height. This is a bit
** more conservative than necessary, but much easier than enforcing
@@ -96115,7 +96115,7 @@ SQLITE_PRIVATE void sqlite3CodeRowTriggerDirect(
/*
** This is called to code the required FOR EACH ROW triggers for an operation
** on table pTab. The operation to code triggers for (INSERT, UPDATE or DELETE)
-** is given by the op paramater. The tr_tm parameter determines whether the
+** is given by the op parameter. The tr_tm parameter determines whether the
** BEFORE or AFTER triggers are coded. If the operation is an UPDATE, then
** parameter pChanges is passed the list of columns being modified.
**
@@ -99313,7 +99313,7 @@ static void exprAnalyzeOrTerm(
}
if( (chngToIN & getMask(pMaskSet, pOrTerm->leftCursor))==0 ){
/* This term must be of the form t1.a==t2.b where t2 is in the
- ** chngToIN set but t1 is not. This term will be either preceeded
+ ** chngToIN set but t1 is not. This term will be either preceded
** or follwed by an inverted copy (t2.b==t1.a). Skip this term
** and use its inversion. */
testcase( pOrTerm->wtFlags & TERM_COPIED );
@@ -102953,7 +102953,7 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(
** (1) The table must not depend on other tables that have not
** yet run.
**
- ** (2) A full-table-scan plan cannot supercede indexed plan unless
+ ** (2) A full-table-scan plan cannot supersede indexed plan unless
** the full-table-scan is an "optimal" plan as defined above.
**
** (3) All tables have an INDEXED BY clause or this table lacks an
@@ -107619,7 +107619,7 @@ SQLITE_PRIVATE const char sqlite3IsEbcdicIdChar[];
** a statement.
**
** (4) CREATE The keyword CREATE has been seen at the beginning of a
-** statement, possibly preceeded by EXPLAIN and/or followed by
+** statement, possibly preceded by EXPLAIN and/or followed by
** TEMP or TEMPORARY
**
** (5) TRIGGER We are in the middle of a trigger definition that must be
@@ -108525,7 +108525,7 @@ static int binCollFunc(
/*
** Another built-in collating sequence: NOCASE.
**
-** This collating sequence is intended to be used for "case independant
+** This collating sequence is intended to be used for "case independent
** comparison". SQLite's knowledge of upper and lower case equivalents
** extends only to the 26 characters used in the English language.
**
@@ -116368,7 +116368,7 @@ SQLITE_PRIVATE int sqlite3Fts3EvalPhraseStats(
** of the current row.
**
** More specifically, the returned buffer contains 1 varint for each
-** occurence of the phrase in the column, stored using the normal (delta+2)
+** occurrence of the phrase in the column, stored using the normal (delta+2)
** compression and is terminated by either an 0x01 or 0x00 byte. For example,
** if the requested column contains "a b X c d X X" and the position-list
** for 'X' is requested, the buffer returned may contain:
@@ -118508,7 +118508,7 @@ static int star_oh(const char *z){
/*
** If the word ends with zFrom and xCond() is true for the stem
-** of the word that preceeds the zFrom ending, then change the
+** of the word that preceds the zFrom ending, then change the
** ending to zTo.
**
** The input word *pz and zFrom are both in reverse order. zTo
@@ -123270,9 +123270,9 @@ static int fts3SnippetFindPositions(Fts3Expr *pExpr, int iPhrase, void *ctx){
** is the snippet with the highest score, where scores are calculated
** by adding:
**
-** (a) +1 point for each occurence of a matchable phrase in the snippet.
+** (a) +1 point for each occurrence of a matchable phrase in the snippet.
**
-** (b) +1000 points for the first occurence of each matchable phrase in
+** (b) +1000 points for the first occurrence of each matchable phrase in
** the snippet for which the corresponding mCovered bit is not set.
**
** The selected snippet parameters are stored in structure *pFragment before
@@ -123373,7 +123373,7 @@ static int fts3StringAppend(
}
/* If there is insufficient space allocated at StrBuffer.z, use realloc()
- ** to grow the buffer until so that it is big enough to accomadate the
+ ** to grow the buffer until so that it is big enough to accommodate the
** appended data.
*/
if( pStr->n+nAppend+1>=pStr->nAlloc ){
diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c
index df449d7380..2aef0414aa 100644
--- a/ext/sqlite3/sqlite3.c
+++ b/ext/sqlite3/sqlite3.c
@@ -1409,7 +1409,7 @@ static int register_bound_parameter_to_sqlite(struct php_sqlite3_bound_param *pa
/* }}} */
/* {{{ proto bool SQLite3Stmt::bindParam(int parameter_number, mixed parameter [, int type])
- Bind Paramater to a stmt variable. */
+ Bind Parameter to a stmt variable. */
PHP_METHOD(sqlite3stmt, bindParam)
{
php_sqlite3_stmt *stmt_obj;
diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c
index 1e1252f60a..ed773b851c 100644
--- a/ext/standard/browscap.c
+++ b/ext/standard/browscap.c
@@ -451,6 +451,19 @@ static int browser_reg_compare(zval **browser TSRMLS_DC, int num_args, va_list a
}
/* }}} */
+static void browscap_zval_copy_ctor(zval **p) /* {{{ */
+{
+ zval *new;
+
+ ALLOC_ZVAL(new);
+ *new = **p;
+
+ zval_copy_ctor(new);
+
+ INIT_PZVAL(new);
+ *p = new;
+} /* }}} */
+
/* {{{ proto mixed get_browser([string browser_name [, bool return_array]])
Get information about the capabilities of a browser. If browser_name is omitted or null, HTTP_USER_AGENT is used. Returns an object by default; if return_array is true, returns an array. */
PHP_FUNCTION(get_browser)
@@ -511,11 +524,11 @@ PHP_FUNCTION(get_browser)
if (return_array) {
array_init(return_value);
- zend_hash_copy(Z_ARRVAL_P(return_value), Z_ARRVAL_PP(agent), (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *));
+ zend_hash_copy(Z_ARRVAL_P(return_value), Z_ARRVAL_PP(agent), (copy_ctor_func_t) browscap_zval_copy_ctor, (void *) &tmp_copy, sizeof(zval *));
}
else {
object_init(return_value);
- zend_hash_copy(Z_OBJPROP_P(return_value), Z_ARRVAL_PP(agent), (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *));
+ zend_hash_copy(Z_OBJPROP_P(return_value), Z_ARRVAL_PP(agent), (copy_ctor_func_t) browscap_zval_copy_ctor, (void *) &tmp_copy, sizeof(zval *));
}
while (zend_hash_find(Z_ARRVAL_PP(agent), "parent", sizeof("parent"), (void **) &z_agent_name) == SUCCESS) {
@@ -524,10 +537,10 @@ PHP_FUNCTION(get_browser)
}
if (return_array) {
- zend_hash_merge(Z_ARRVAL_P(return_value), Z_ARRVAL_PP(agent), (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *), 0);
+ zend_hash_merge(Z_ARRVAL_P(return_value), Z_ARRVAL_PP(agent), (copy_ctor_func_t) browscap_zval_copy_ctor, (void *) &tmp_copy, sizeof(zval *), 0);
}
else {
- zend_hash_merge(Z_OBJPROP_P(return_value), Z_ARRVAL_PP(agent), (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *), 0);
+ zend_hash_merge(Z_OBJPROP_P(return_value), Z_ARRVAL_PP(agent), (copy_ctor_func_t) browscap_zval_copy_ctor, (void *) &tmp_copy, sizeof(zval *), 0);
}
}
diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c
index ce2987bfc9..73be21d9a9 100644
--- a/ext/standard/filestat.c
+++ b/ext/standard/filestat.c
@@ -904,7 +904,7 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ
}
if (php_stream_stat_path_ex((char *)filename, flags, &ssb, NULL)) {
- /* Error Occured */
+ /* Error Occurred */
if (!IS_EXISTS_CHECK(type)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%sstat failed for %s", IS_LINK_OPERATION(type) ? "L" : "", filename);
}
diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c
index 3732939358..86975d7f5b 100644
--- a/ext/standard/ftp_fopen_wrapper.c
+++ b/ext/standard/ftp_fopen_wrapper.c
@@ -440,7 +440,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, char *path, ch
if (strchr(mode, 'a')) {
read_write = 3; /* Open for Appending */
} else {
- read_write = 2; /* Open for writting */
+ read_write = 2; /* Open for writing */
}
}
if (!read_write) {
@@ -500,7 +500,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, char *path, ch
}
if (result <= 299 && result >= 200) {
if (allow_overwrite) {
- /* Context permits overwritting file,
+ /* Context permits overwriting file,
so we just delete whatever's there in preparation */
php_stream_printf(stream TSRMLS_CC, "DELE %s\r\n", resource->path);
result = GET_FTP_RESULT(stream);
diff --git a/ext/standard/image.c b/ext/standard/image.c
index 4984e4064a..b3dade4a75 100644
--- a/ext/standard/image.c
+++ b/ext/standard/image.c
@@ -606,7 +606,7 @@ static struct gfxinfo *php_handle_jpc(php_stream * stream TSRMLS_DC)
/* JPEG 2000 components can be vastly different from one another.
Each component can be sampled at a different resolution, use
- a different colour space, have a seperate colour depth, and
+ a different colour space, have a separate colour depth, and
be compressed totally differently! This makes giving a single
"bit depth" answer somewhat problematic. For this implementation
we'll use the highest depth encountered. */
diff --git a/ext/standard/quot_print.c b/ext/standard/quot_print.c
index 28dcc63f13..0df127362f 100644
--- a/ext/standard/quot_print.c
+++ b/ext/standard/quot_print.c
@@ -151,7 +151,7 @@ PHPAPI unsigned char *php_quot_print_encode(const unsigned char *str, size_t len
unsigned char c, *ret, *d;
char *hex = "0123456789ABCDEF";
- ret = safe_emalloc(1, 3 * length + 3 * (((3 * length)/PHP_QPRINT_MAXL) + 1), 0);
+ ret = safe_emalloc(3, length + (((3 * length)/(PHP_QPRINT_MAXL-9)) + 1), 1);
d = ret;
while (length--) {
@@ -286,4 +286,4 @@ PHP_FUNCTION(quoted_printable_encode)
* End:
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
- */ \ No newline at end of file
+ */
diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c
index d7fc68ae33..f487763b9e 100644
--- a/ext/standard/streamsfuncs.c
+++ b/ext/standard/streamsfuncs.c
@@ -601,7 +601,6 @@ static int stream_array_to_fd_set(zval *stream_array, fd_set *fds, php_socket_t
{
zval **elem;
php_stream *stream;
- php_socket_t this_fd = 0;
int cnt = 0;
if (Z_TYPE_P(stream_array) != IS_ARRAY) {
@@ -611,6 +610,11 @@ static int stream_array_to_fd_set(zval *stream_array, fd_set *fds, php_socket_t
zend_hash_get_current_data(Z_ARRVAL_P(stream_array), (void **) &elem) == SUCCESS;
zend_hash_move_forward(Z_ARRVAL_P(stream_array))) {
+ /* Temporary int fd is needed for the STREAM data type on windows, passing this_fd directly to php_stream_cast()
+ would eventually bring a wrong result on x64. php_stream_cast() casts to int internally, and this will leave
+ the higher bits of a SOCKET variable uninitialized on systems with little endian. */
+ int tmp_fd;
+
php_stream_from_zval_no_verify(stream, elem);
if (stream == NULL) {
continue;
@@ -620,7 +624,9 @@ static int stream_array_to_fd_set(zval *stream_array, fd_set *fds, php_socket_t
* when casting. It is only used here so that the buffered data warning
* is not displayed.
* */
- if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&this_fd, 1) && this_fd != -1) {
+ if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&tmp_fd, 1) && tmp_fd != -1) {
+
+ php_socket_t this_fd = (php_socket_t)tmp_fd;
PHP_SAFE_FD_SET(this_fd, fds);
@@ -638,7 +644,6 @@ static int stream_array_from_fd_set(zval *stream_array, fd_set *fds TSRMLS_DC)
zval **elem, **dest_elem;
php_stream *stream;
HashTable *new_hash;
- php_socket_t this_fd = 0;
int ret = 0;
if (Z_TYPE_P(stream_array) != IS_ARRAY) {
@@ -655,6 +660,11 @@ static int stream_array_from_fd_set(zval *stream_array, fd_set *fds TSRMLS_DC)
char *key;
uint key_len;
ulong num_ind;
+ /* Temporary int fd is needed for the STREAM data type on windows, passing this_fd directly to php_stream_cast()
+ would eventually bring a wrong result on x64. php_stream_cast() casts to int internally, and this will leave
+ the higher bits of a SOCKET variable uninitialized on systems with little endian. */
+ int tmp_fd;
+
type = zend_hash_get_current_key_ex(Z_ARRVAL_P(stream_array),
&key, &key_len, &num_ind, 0, NULL);
@@ -672,7 +682,10 @@ static int stream_array_from_fd_set(zval *stream_array, fd_set *fds TSRMLS_DC)
* when casting. It is only used here so that the buffered data warning
* is not displayed.
*/
- if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&this_fd, 1) && this_fd != -1) {
+ if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)&tmp_fd, 1) && tmp_fd != -1) {
+
+ php_socket_t this_fd = (php_socket_t)tmp_fd;
+
if (PHP_SAFE_FD_ISSET(this_fd, fds)) {
if (type == HASH_KEY_IS_LONG) {
zend_hash_index_update(new_hash, num_ind, (void *)elem, sizeof(zval *), (void **)&dest_elem);
@@ -1578,7 +1591,7 @@ PHP_FUNCTION(stream_is_local)
/* }}} */
/* {{{ proto bool stream_supports_lock(resource stream)
- Tells wether the stream supports locking through flock(). */
+ Tells whether the stream supports locking through flock(). */
PHP_FUNCTION(stream_supports_lock)
{
php_stream *stream;
diff --git a/ext/standard/tests/array/009.phpt b/ext/standard/tests/array/009.phpt
index f88f8763fa..7b3bba2261 100644
--- a/ext/standard/tests/array/009.phpt
+++ b/ext/standard/tests/array/009.phpt
@@ -94,7 +94,7 @@ var_dump( current($temp_array, $temp_array) );
var_dump( reset($temp_array, $temp_array) );
var_dump( next($temp_array, $temp_array) );
-// invalid args type, valid arguement: array
+// invalid args type, valid argument: array
$int_var = 1;
$float_var = 1.5;
$string = "string";
diff --git a/ext/standard/tests/array/array_combine_variation3.phpt b/ext/standard/tests/array/array_combine_variation3.phpt
index 03de632905..1381fe0f4c 100644
--- a/ext/standard/tests/array/array_combine_variation3.phpt
+++ b/ext/standard/tests/array/array_combine_variation3.phpt
@@ -29,7 +29,7 @@ the lazy dog
This is a double quoted string
EOT;
-// heredoc with diferent whitespaces
+// heredoc with different whitespaces
$diff_whitespaces = <<<EOT
hello\r world\t
1111\t\t != 2222\v\v
diff --git a/ext/standard/tests/array/array_fill_basic.phpt b/ext/standard/tests/array/array_fill_basic.phpt
index 8623f8e6c2..309c9ca073 100644
--- a/ext/standard/tests/array/array_fill_basic.phpt
+++ b/ext/standard/tests/array/array_fill_basic.phpt
@@ -16,7 +16,7 @@ $heredoc = <<<HERE_DOC
Hello
HERE_DOC;
-// array of possible valid values for 'val' arugment
+// array of possible valid values for 'val' argument
$values = array (
/* 1 */ NULL,
diff --git a/ext/standard/tests/array/array_fill_keys_error.phpt b/ext/standard/tests/array/array_fill_keys_error.phpt
index 31a03e7f5f..012a729d62 100644
--- a/ext/standard/tests/array/array_fill_keys_error.phpt
+++ b/ext/standard/tests/array/array_fill_keys_error.phpt
@@ -20,7 +20,7 @@ var_dump( array_fill_keys($keys, $val, $extra_arg) );
echo "\n-- Testing array_fill_keys() function with less than expected no. of arguments --\n";
var_dump( array_fill_keys($keys) );
-echo "\n-- Testing array_fill_keys() function with no argumets --\n";
+echo "\n-- Testing array_fill_keys() function with no arguments --\n";
var_dump( array_fill_keys() );
echo "Done";
@@ -38,7 +38,7 @@ NULL
Warning: array_fill_keys() expects exactly 2 parameters, 1 given in %sarray_fill_keys_error.php on line %d
NULL
--- Testing array_fill_keys() function with no argumets --
+-- Testing array_fill_keys() function with no arguments --
Warning: array_fill_keys() expects exactly 2 parameters, 0 given in %sarray_fill_keys_error.php on line %d
NULL
diff --git a/ext/standard/tests/array/array_fill_variation4.phpt b/ext/standard/tests/array/array_fill_variation4.phpt
index 9e1f50c683..13b566a7db 100644
--- a/ext/standard/tests/array/array_fill_variation4.phpt
+++ b/ext/standard/tests/array/array_fill_variation4.phpt
@@ -17,7 +17,7 @@ $heredoc = <<<HERE_DOC
Hello
HERE_DOC;
-// array of possible valid values for 'val' arugment
+// array of possible valid values for 'val' argument
$values = array (
/* 1 */ NULL,
diff --git a/ext/standard/tests/array/array_intersect_assoc_variation3.phpt b/ext/standard/tests/array/array_intersect_assoc_variation3.phpt
index 50be080590..e3f0ae08ec 100644
--- a/ext/standard/tests/array/array_intersect_assoc_variation3.phpt
+++ b/ext/standard/tests/array/array_intersect_assoc_variation3.phpt
@@ -31,7 +31,7 @@ the lazy dog
This is a double quoted string
EOT;
-// heredoc with diferent whitespaces
+// heredoc with different whitespaces
$diff_whitespaces = <<<EOT
hello\r world\t
1111\t\t != 2222\v\v
diff --git a/ext/standard/tests/array/array_intersect_assoc_variation4.phpt b/ext/standard/tests/array/array_intersect_assoc_variation4.phpt
index ed2e3d9514..9eb342f8e7 100644
--- a/ext/standard/tests/array/array_intersect_assoc_variation4.phpt
+++ b/ext/standard/tests/array/array_intersect_assoc_variation4.phpt
@@ -31,7 +31,7 @@ the lazy dog
This is a double quoted string
EOT;
-// heredoc with diferent whitespaces
+// heredoc with different whitespaces
$diff_whitespaces = <<<EOT
hello\r world\t
1111\t\t != 2222\v\v
diff --git a/ext/standard/tests/array/array_intersect_variation3.phpt b/ext/standard/tests/array/array_intersect_variation3.phpt
index b2b7d8ac01..c404e58bab 100644
--- a/ext/standard/tests/array/array_intersect_variation3.phpt
+++ b/ext/standard/tests/array/array_intersect_variation3.phpt
@@ -30,7 +30,7 @@ the lazy dog
This is a double quoted string
EOT;
-// heredoc with diferent whitespaces
+// heredoc with different whitespaces
$diff_whitespaces = <<<EOT
hello\r world\t
1111\t\t != 2222\v\v
diff --git a/ext/standard/tests/array/array_intersect_variation4.phpt b/ext/standard/tests/array/array_intersect_variation4.phpt
index 4f1d6f3dd5..66624a66cd 100644
--- a/ext/standard/tests/array/array_intersect_variation4.phpt
+++ b/ext/standard/tests/array/array_intersect_variation4.phpt
@@ -30,7 +30,7 @@ the lazy dog
This is a double quoted string
EOT;
-// heredoc with diferent whitespaces
+// heredoc with different whitespaces
$diff_whitespaces = <<<EOT
hello\r world\t
1111\t\t != 2222\v\v
diff --git a/ext/standard/tests/array/array_key_exists.phpt b/ext/standard/tests/array/array_key_exists.phpt
index f433e12562..37ac0f8ecc 100644
--- a/ext/standard/tests/array/array_key_exists.phpt
+++ b/ext/standard/tests/array/array_key_exists.phpt
@@ -114,7 +114,7 @@ var_dump(array_key_exists("print_member", $key_check_obj)); // not found, its a
var_dump(array_key_exists("arr", $key_check_obj)); //found, public member
var_dump(array_key_exists("var", $key_check_obj->arr)); //found, key is in member array
-/* error condition, first arguemnt as object */
+/* error condition, first argument as object */
var_dump( array_key_exists($key_check_obj, $key_check_obj) );
echo "Done\n";
?>
diff --git a/ext/standard/tests/array/array_merge.phpt b/ext/standard/tests/array/array_merge.phpt
index b718386da1..30830de2b3 100644
--- a/ext/standard/tests/array/array_merge.phpt
+++ b/ext/standard/tests/array/array_merge.phpt
@@ -79,7 +79,7 @@ echo "\n*** Testing array_merge() with typecasting non-array to array ***\n";
var_dump(array_merge($begin_array[4], (array)"type1", (array)10, (array)12.34));
echo "\n*** Testing error conditions ***";
-/* Invalid argumens */
+/* Invalid arguments */
var_dump(array_merge());
var_dump(array_merge(100, 200));
var_dump(array_merge($begin_array[0], $begin_array[1], 100));
diff --git a/ext/standard/tests/array/array_merge_recursive_variation3.phpt b/ext/standard/tests/array/array_merge_recursive_variation3.phpt
index 722388a015..76bf913918 100644
--- a/ext/standard/tests/array/array_merge_recursive_variation3.phpt
+++ b/ext/standard/tests/array/array_merge_recursive_variation3.phpt
@@ -30,7 +30,7 @@ the lazy dog
This is a double quoted string
EOT;
-// heredoc with diferent whitespaces
+// heredoc with different whitespaces
$diff_whitespaces = <<<EOT
hello\r world\t
1111\t\t != 2222\v\v
diff --git a/ext/standard/tests/array/array_pad_variation6.phpt b/ext/standard/tests/array/array_pad_variation6.phpt
index 2f97e3ee5f..a491573909 100644
--- a/ext/standard/tests/array/array_pad_variation6.phpt
+++ b/ext/standard/tests/array/array_pad_variation6.phpt
@@ -31,7 +31,7 @@ the lazy dog
This is a double quoted string
EOT;
-// heredoc with diferent whitespaces
+// heredoc with different whitespaces
$diff_whitespaces = <<<EOT
hello\r world\t
1111\t\t != 2222\v\v
diff --git a/ext/standard/tests/array/array_unique_variation2.phpt b/ext/standard/tests/array/array_unique_variation2.phpt
index 3cfcfba2b2..757dd6e057 100644
--- a/ext/standard/tests/array/array_unique_variation2.phpt
+++ b/ext/standard/tests/array/array_unique_variation2.phpt
@@ -29,7 +29,7 @@ the lazy dog
This is a double quoted string
EOT;
-// heredoc with diferent whitespaces
+// heredoc with different whitespaces
$diff_whitespaces = <<<EOT
hello\r world\t
1111\t\t != 2222\v\v
diff --git a/ext/standard/tests/array/array_unshift_variation9.phpt b/ext/standard/tests/array/array_unshift_variation9.phpt
index a667e6da03..b6440f899e 100644
--- a/ext/standard/tests/array/array_unshift_variation9.phpt
+++ b/ext/standard/tests/array/array_unshift_variation9.phpt
@@ -33,7 +33,7 @@ the lazy dog
This is a double quoted string
EOT;
-// heredoc with diferent whitespaces
+// heredoc with different whitespaces
$diff_whitespaces = <<<EOT
hello\r world\t
1111\t\t != 2222\v\v
diff --git a/ext/standard/tests/array/array_walk_basic2.phpt b/ext/standard/tests/array/array_walk_basic2.phpt
index e856b580ba..3ef15605e7 100644
--- a/ext/standard/tests/array/array_walk_basic2.phpt
+++ b/ext/standard/tests/array/array_walk_basic2.phpt
@@ -25,7 +25,7 @@ function test_alter(&$item, $key, $prefix)
// with proper type
var_dump($item); // value
var_dump($key); // key
- var_dump($prefix); // additional agument passed to callback function
+ var_dump($prefix); // additional argument passed to callback function
echo "\n"; // new line to separate the output between each element
}
diff --git a/ext/standard/tests/array/array_walk_error2.phpt b/ext/standard/tests/array/array_walk_error2.phpt
index 654637ab5a..63c5f51ee0 100644
--- a/ext/standard/tests/array/array_walk_error2.phpt
+++ b/ext/standard/tests/array/array_walk_error2.phpt
@@ -25,7 +25,7 @@ echo "*** Testing array_walk() : error conditions - callback parameters ***\n";
var_dump( array_walk($input, "callback1") );
var_dump( array_walk($input, "callback2", 4) );
-// expected: Warning is supressed
+// expected: Warning is suppressed
var_dump( @array_walk($input, "callback1") );
var_dump( @array_walk($input, "callback2", 4) );
diff --git a/ext/standard/tests/array/array_walk_recursive_basic2.phpt b/ext/standard/tests/array/array_walk_recursive_basic2.phpt
index c71d92b456..a049c0b812 100644
--- a/ext/standard/tests/array/array_walk_recursive_basic2.phpt
+++ b/ext/standard/tests/array/array_walk_recursive_basic2.phpt
@@ -25,7 +25,7 @@ function test_alter(&$item, $key, $prefix)
// with proper type
var_dump($item); // value
var_dump($key); // key
- var_dump($prefix); // additional agument passed to callback function
+ var_dump($prefix); // additional argument passed to callback function
echo "\n"; // new line to separate the output between each element
}
diff --git a/ext/standard/tests/array/array_walk_recursive_error2.phpt b/ext/standard/tests/array/array_walk_recursive_error2.phpt
index d628e9327a..8e0c8829e6 100644
--- a/ext/standard/tests/array/array_walk_recursive_error2.phpt
+++ b/ext/standard/tests/array/array_walk_recursive_error2.phpt
@@ -25,7 +25,7 @@ echo "*** Testing array_walk_recursive() : error conditions - callback parameter
var_dump( array_walk_recursive($input, "callback1") );
var_dump( array_walk_recursive($input, "callback2", 4) );
-// expected: Warning is supressed
+// expected: Warning is suppressed
var_dump( @array_walk_recursive($input, "callback1") );
var_dump( @array_walk_recursive($input, "callback2", 4) );
diff --git a/ext/standard/tests/array/arsort_variation1.phpt b/ext/standard/tests/array/arsort_variation1.phpt
index 1545abe34e..bff8d41303 100644
--- a/ext/standard/tests/array/arsort_variation1.phpt
+++ b/ext/standard/tests/array/arsort_variation1.phpt
@@ -74,7 +74,7 @@ $unexpected_values = array (
);
// loop though each element of the array and check the working of arsort()
-// when $array arugment is supplied with different values from $unexpected_values
+// when $array argument is supplied with different values from $unexpected_values
echo "\n-- Testing arsort() by supplying different unexpected values for 'array' argument --\n";
echo "\n-- Flag values are defualt, SORT_REGULAR, SORT_NUMERIC, SORT_STRING --\n";
diff --git a/ext/standard/tests/array/arsort_variation2.phpt b/ext/standard/tests/array/arsort_variation2.phpt
index b85653052f..ddfe319a46 100644
--- a/ext/standard/tests/array/arsort_variation2.phpt
+++ b/ext/standard/tests/array/arsort_variation2.phpt
@@ -70,7 +70,7 @@ $unexpected_values = array(
);
// loop though each element of the array and check the working of arsort()
-// when $flag arugment is supplied with different values from $unexpected_values
+// when $flag argument is supplied with different values from $unexpected_values
echo "\n-- Testing arsort() by supplying different unexpected values for 'sort_flags' argument --\n";
$counter = 1;
diff --git a/ext/standard/tests/array/asort_variation1.phpt b/ext/standard/tests/array/asort_variation1.phpt
index 5420f0524c..67eb5bf21c 100644
--- a/ext/standard/tests/array/asort_variation1.phpt
+++ b/ext/standard/tests/array/asort_variation1.phpt
@@ -74,7 +74,7 @@ $unexpected_values = array (
);
// loop though each element of the array and check the working of asort()
-// when $array arugment is supplied with different values from $unexpected_values
+// when $array argument is supplied with different values from $unexpected_values
echo "\n-- Testing asort() by supplying different unexpected values for 'array' argument --\n";
echo "\n-- Flag values are defualt, SORT_REGULAR, SORT_NUMERIC, SORT_STRING --\n";
diff --git a/ext/standard/tests/array/asort_variation2.phpt b/ext/standard/tests/array/asort_variation2.phpt
index 6cce644331..138e124537 100644
--- a/ext/standard/tests/array/asort_variation2.phpt
+++ b/ext/standard/tests/array/asort_variation2.phpt
@@ -70,7 +70,7 @@ $unexpected_values = array(
);
// loop though each element of the array and check the working of asort()
-// when $flag arugment is supplied with different values from $unexpected_values
+// when $flag argument is supplied with different values from $unexpected_values
echo "\n-- Testing asort() by supplying different unexpected values for 'sort_flags' argument --\n";
$counter = 1;
diff --git a/ext/standard/tests/array/bug31158.phpt b/ext/standard/tests/array/bug31158.phpt
index e672a10b28..da7a9ec907 100644
--- a/ext/standard/tests/array/bug31158.phpt
+++ b/ext/standard/tests/array/bug31158.phpt
@@ -1,5 +1,7 @@
--TEST--
Bug #31158 (array_splice on $GLOBALS crashes)
+--INI--
+error_reporting = E_ALL
--FILE--
<?php
function __(){
diff --git a/ext/standard/tests/array/bug40709.phpt b/ext/standard/tests/array/bug40709.phpt
index eb0c712000..7e132ba3d4 100644
--- a/ext/standard/tests/array/bug40709.phpt
+++ b/ext/standard/tests/array/bug40709.phpt
@@ -2,7 +2,7 @@
Bug #40709 (array_reduce() behaves strange with one item stored arrays)
--FILE--
<?php
-function CommaSeperatedList($a, $b) {
+function CommaSeparatedList($a, $b) {
if($a == null)
return $b;
else
@@ -12,10 +12,10 @@ function CommaSeperatedList($a, $b) {
$arr1 = array(1,2,3);
$arr2 = array(1);
-echo "result for arr1: ".array_reduce($arr1,'CommaSeperatedList')."\n";
-echo "result for arr2: ".array_reduce($arr2,'CommaSeperatedList')."\n";
-echo "result for arr1: ".array_reduce($arr1,'CommaSeperatedList')."\n";
-echo "result for arr2: ".array_reduce($arr2,'CommaSeperatedList')."\n";
+echo "result for arr1: ".array_reduce($arr1,'CommaSeparatedList')."\n";
+echo "result for arr2: ".array_reduce($arr2,'CommaSeparatedList')."\n";
+echo "result for arr1: ".array_reduce($arr1,'CommaSeparatedList')."\n";
+echo "result for arr2: ".array_reduce($arr2,'CommaSeparatedList')."\n";
echo "Done\n";
?>
diff --git a/ext/standard/tests/array/krsort_variation1.phpt b/ext/standard/tests/array/krsort_variation1.phpt
index e4cbaf8d2c..fa13242a08 100644
--- a/ext/standard/tests/array/krsort_variation1.phpt
+++ b/ext/standard/tests/array/krsort_variation1.phpt
@@ -72,7 +72,7 @@ $unexpected_values = array (
);
// loop though each element of the array and check the working of krsort()
-// when $array arugment is supplied with different values from $unexpected_values
+// when $array argument is supplied with different values from $unexpected_values
echo "\n-- Testing krsort() by supplying different unexpected values for 'array' argument --\n";
echo "\n-- Flag values are defualt, SORT_REGULAR, SORT_NUMERIC, SORT_STRING --\n";
diff --git a/ext/standard/tests/array/krsort_variation2.phpt b/ext/standard/tests/array/krsort_variation2.phpt
index 1376202470..d193589de4 100644
--- a/ext/standard/tests/array/krsort_variation2.phpt
+++ b/ext/standard/tests/array/krsort_variation2.phpt
@@ -69,7 +69,7 @@ $unexpected_values = array (
);
// loop though each element of the array and check the working of krsort()
-// when 'sort_flags' arugment is supplied with different values
+// when 'sort_flags' argument is supplied with different values
echo "\n-- Testing krsort() by supplying different unexpected values for 'sort_flags' argument --\n";
$counter = 1;
diff --git a/ext/standard/tests/array/ksort_variation1.phpt b/ext/standard/tests/array/ksort_variation1.phpt
index d8c037fa95..37a35d1c01 100644
--- a/ext/standard/tests/array/ksort_variation1.phpt
+++ b/ext/standard/tests/array/ksort_variation1.phpt
@@ -72,7 +72,7 @@ $unexpected_values = array (
);
// loop though each element of the array and check the working of ksort()
-// when $array arugment is supplied with different values from $unexpected_values
+// when $array argument is supplied with different values from $unexpected_values
echo "\n-- Testing ksort() by supplying different unexpected values for 'array' argument --\n";
echo "\n-- Flag values are defualt, SORT_REGULAR, SORT_NUMERIC, SORT_STRING --\n";
diff --git a/ext/standard/tests/array/ksort_variation2.phpt b/ext/standard/tests/array/ksort_variation2.phpt
index 4969844e75..102c1c1eb6 100644
--- a/ext/standard/tests/array/ksort_variation2.phpt
+++ b/ext/standard/tests/array/ksort_variation2.phpt
@@ -69,7 +69,7 @@ $unexpected_values = array (
);
// loop though each element of the array and check the working of ksort()
-// when 'sort_flags' arugment is supplied with different values
+// when 'sort_flags' argument is supplied with different values
echo "\n-- Testing ksort() by supplying different unexpected values for 'sort_flags' argument --\n";
$counter = 1;
diff --git a/ext/standard/tests/array/sizeof_basic2.phpt b/ext/standard/tests/array/sizeof_basic2.phpt
index a2ab2eedfd..b56682c31a 100644
--- a/ext/standard/tests/array/sizeof_basic2.phpt
+++ b/ext/standard/tests/array/sizeof_basic2.phpt
@@ -19,7 +19,7 @@ echo "*** Testing sizeof() : basic functionality ***\n";
$int_array = array(1, 2, 3, 4);
$string_array = array("Saffron", "White", "Green");
-$indexed_array = array("Agression" => "Saffron", "Peace" => "White", "Growth" => "Green");
+$indexed_array = array("Aggression" => "Saffron", "Peace" => "White", "Growth" => "Green");
$mixed_array = array(1, 2, "Aggression" => "Saffron", 10 => "Ten", "Ten" => 10);
echo "-- Testing sizeof() with integer array in default, COUNT_NORMAL, COUNT_RECURSIVE modes --\n";
diff --git a/ext/standard/tests/array/sizeof_variation4.phpt b/ext/standard/tests/array/sizeof_variation4.phpt
index a2462757d6..cb8fecc822 100644
--- a/ext/standard/tests/array/sizeof_variation4.phpt
+++ b/ext/standard/tests/array/sizeof_variation4.phpt
@@ -54,7 +54,7 @@ $values = array (
/* 20 */ $fp
);
-// loop through the each element of the $values array for 'var' arugment
+// loop through the each element of the $values array for 'var' argument
// and check the functionality of sizeof()
$counter = 1;
foreach($values as $value)
diff --git a/ext/standard/tests/array/sort_variation1.phpt b/ext/standard/tests/array/sort_variation1.phpt
index f6991bdf67..9243de08e4 100644
--- a/ext/standard/tests/array/sort_variation1.phpt
+++ b/ext/standard/tests/array/sort_variation1.phpt
@@ -73,7 +73,7 @@ $unexpected_values = array (
);
// loop though each element of the array and check the working of sort()
-// when $array arugment is supplied with different values from $unexpected_values
+// when $array argument is supplied with different values from $unexpected_values
echo "\n-- Testing sort() by supplying different unexpected values for 'array' argument --\n";
echo "\n-- Flag values are defualt, SORT_REGULAR, SORT_NUMERIC, SORT_STRING --\n";
diff --git a/ext/standard/tests/array/sort_variation2.phpt b/ext/standard/tests/array/sort_variation2.phpt
index 7cb8ed642a..af3deba4b9 100644
--- a/ext/standard/tests/array/sort_variation2.phpt
+++ b/ext/standard/tests/array/sort_variation2.phpt
@@ -69,7 +69,7 @@ $unexpected_values = array(
);
// loop though each element of the array and check the working of sort()
-// when $flag arugment is supplied with different values
+// when $flag argument is supplied with different values
echo "\n-- Testing sort() by supplying different unexpected values for 'flag' argument --\n";
$counter = 1;
diff --git a/ext/standard/tests/array/uasort_error.phpt b/ext/standard/tests/array/uasort_error.phpt
index 820ab58478..cc2dd3a217 100644
--- a/ext/standard/tests/array/uasort_error.phpt
+++ b/ext/standard/tests/array/uasort_error.phpt
@@ -50,7 +50,7 @@ var_dump( uasort($array_arg) );
echo "-- Testing uasort() function with non-existent compare function --\n";
var_dump( uasort($array_arg, 'non_existent') );
-// With non existent comparison function and extra arguemnt
+// With non existent comparison function and extra argument
echo "-- Testing uasort() function with non-existent compare function and extra argument --\n";
var_dump( uasort($array_arg, 'non_existent', $extra_arg) );
diff --git a/ext/standard/tests/array/usort_error2.phpt b/ext/standard/tests/array/usort_error2.phpt
index 308199fc1f..7bf0f659e0 100644
--- a/ext/standard/tests/array/usort_error2.phpt
+++ b/ext/standard/tests/array/usort_error2.phpt
@@ -36,7 +36,7 @@ $extra_arg = 10;
echo "\n-- Testing usort() function with non-existent compare function --\n";
var_dump( usort($array_arg, 'non_existent') );
-// With non existent comparison function and extra arguemnt
+// With non existent comparison function and extra argument
echo "\n-- Testing usort() function with non-existent compare function and extra argument --\n";
var_dump( usort($array_arg, 'non_existent', $extra_arg) );
?>
diff --git a/ext/standard/tests/class_object/class_exists_variation_001.phpt b/ext/standard/tests/class_object/class_exists_variation_001.phpt
index c9146ba9f7..52a3584763 100644
--- a/ext/standard/tests/class_object/class_exists_variation_001.phpt
+++ b/ext/standard/tests/class_object/class_exists_variation_001.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test class_exists() function : usage variations - unexpected types for agument 1
+Test class_exists() function : usage variations - unexpected types for argument 1
--FILE--
<?php
/* Prototype : proto bool class_exists(string classname [, bool autoload])
diff --git a/ext/standard/tests/class_object/class_exists_variation_002.phpt b/ext/standard/tests/class_object/class_exists_variation_002.phpt
index ae9de157f6..954e4d8cbc 100644
--- a/ext/standard/tests/class_object/class_exists_variation_002.phpt
+++ b/ext/standard/tests/class_object/class_exists_variation_002.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test class_exists() function : usage variations - unexpected types for agument 2
+Test class_exists() function : usage variations - unexpected types for argument 2
--FILE--
<?php
/* Prototype : proto bool class_exists(string classname [, bool autoload])
diff --git a/ext/standard/tests/class_object/trait_exists_variation_001.phpt b/ext/standard/tests/class_object/trait_exists_variation_001.phpt
index 65ef1993cf..e7fa4afd1e 100644
--- a/ext/standard/tests/class_object/trait_exists_variation_001.phpt
+++ b/ext/standard/tests/class_object/trait_exists_variation_001.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test trait_exists() function : usage variations - unexpected types for agument 1
+Test trait_exists() function : usage variations - unexpected types for argument 1
--FILE--
<?php
/* Prototype : proto bool trait_exists(string traitname [, bool autoload])
diff --git a/ext/standard/tests/class_object/trait_exists_variation_002.phpt b/ext/standard/tests/class_object/trait_exists_variation_002.phpt
index a2fcbbf018..365efffe41 100644
--- a/ext/standard/tests/class_object/trait_exists_variation_002.phpt
+++ b/ext/standard/tests/class_object/trait_exists_variation_002.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test trait_exists() function : usage variations - unexpected types for agument 2
+Test trait_exists() function : usage variations - unexpected types for argument 2
--FILE--
<?php
/* Prototype : proto bool trait_exists(string traitname [, bool autoload])
diff --git a/ext/standard/tests/file/005_error.phpt b/ext/standard/tests/file/005_error.phpt
index fc4852e4ad..20ba3a7fc0 100644
--- a/ext/standard/tests/file/005_error.phpt
+++ b/ext/standard/tests/file/005_error.phpt
@@ -23,7 +23,7 @@ Test fileatime(), filemtime(), filectime() & touch() functions : error condition
echo "*** Testing error conditions ***\n";
echo "\n-- Testing with Non-existing files --";
-/* Both invalid argumetns */
+/* Both invalid arguments */
var_dump( fileatime("/no/such/file/or/dir") );
var_dump( filemtime("/no/such/file/or/dir") );
var_dump( filectime("/no/such/file/or/dir") );
diff --git a/ext/standard/tests/file/007_variation10.phpt b/ext/standard/tests/file/007_variation10.phpt
index c9f3e01cff..2981ef7d4c 100644
--- a/ext/standard/tests/file/007_variation10.phpt
+++ b/ext/standard/tests/file/007_variation10.phpt
@@ -30,7 +30,7 @@ echo "*** Test fopen() & fclose() functions: with 'r+t' mode ***\n";
$file_handle = fopen($file, "r+t"); //opening the file in "r+t" mode
var_dump($file_handle); //Check for the content of handle
var_dump( get_resource_type($file_handle) ); //Check for the type of resource
-var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file
+var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file
var_dump( fread($file_handle, 100) ); //Check for read operation
var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the end of the file
var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string
diff --git a/ext/standard/tests/file/007_variation11-win32.phpt b/ext/standard/tests/file/007_variation11-win32.phpt
index d9c6e83d48..a567b72b03 100644
--- a/ext/standard/tests/file/007_variation11-win32.phpt
+++ b/ext/standard/tests/file/007_variation11-win32.phpt
@@ -36,12 +36,12 @@ echo "*** Test fopen() & fclose() functions: with 'wt' mode ***\n";
$file_handle = fopen($file, "wt"); //opening the file "wt" mode
var_dump($file_handle); //Check for the content of handle
var_dump( get_resource_type($file_handle) ); //Check for the type of resource
-var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file
+var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file
var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string
var_dump( ftell($file_handle) ); //File pointer position after write operation, expected at the end of the file
rewind($file_handle);
var_dump( fread($file_handle, 100) ); //Check for read operation; fails; expected: empty string
-var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the begining of the file
+var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the beginning of the file
var_dump( fclose($file_handle) ); //Check for close operation on the file handle
var_dump( get_resource_type($file_handle) ); //Check whether resource is lost after close operation
@@ -53,7 +53,7 @@ clearstatcache();
unlink($file); //Deleting the file
fclose( fopen($file, "wt") ); //Opening the non-existing file in "wt" mode, which will be created
-var_dump( file_exists($file) ); //Check for the existance of file
+var_dump( file_exists($file) ); //Check for the existence of file
echo "*** Done ***\n";
--CLEAN--
<?php
diff --git a/ext/standard/tests/file/007_variation11.phpt b/ext/standard/tests/file/007_variation11.phpt
index 0656c64609..c884f47f42 100644
--- a/ext/standard/tests/file/007_variation11.phpt
+++ b/ext/standard/tests/file/007_variation11.phpt
@@ -36,12 +36,12 @@ echo "*** Test fopen() & fclose() functions: with 'wt' mode ***\n";
$file_handle = fopen($file, "wt"); //opening the file "wt" mode
var_dump($file_handle); //Check for the content of handle
var_dump( get_resource_type($file_handle) ); //Check for the type of resource
-var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file
+var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file
var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string
var_dump( ftell($file_handle) ); //File pointer position after write operation, expected at the end of the file
rewind($file_handle);
var_dump( fread($file_handle, 100) ); //Check for read operation; fails; expected: empty string
-var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the begining of the file
+var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the beginning of the file
var_dump( fclose($file_handle) ); //Check for close operation on the file handle
var_dump( get_resource_type($file_handle) ); //Check whether resource is lost after close operation
@@ -53,7 +53,7 @@ clearstatcache();
unlink($file); //Deleting the file
fclose( fopen($file, "wt") ); //Opening the non-existing file in "wt" mode, which will be created
-var_dump( file_exists($file) ); //Check for the existance of file
+var_dump( file_exists($file) ); //Check for the existence of file
echo "*** Done ***\n";
--CLEAN--
<?php
diff --git a/ext/standard/tests/file/007_variation12-win32.phpt b/ext/standard/tests/file/007_variation12-win32.phpt
index 0fb9ad8dfa..d3d26e2996 100644
--- a/ext/standard/tests/file/007_variation12-win32.phpt
+++ b/ext/standard/tests/file/007_variation12-win32.phpt
@@ -36,7 +36,7 @@ echo "*** Test fopen() & fclose() functions: with 'w+t' mode ***\n";
$file_handle = fopen($file, "w+t"); //opening the file "w+t" mode
var_dump($file_handle); //Check for the content of handle
var_dump( get_resource_type($file_handle) ); //Check for the type of resource
-var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file
+var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file
var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string
var_dump( ftell($file_handle) ); //File pointer position after write operation, expected at the end of the file
rewind($file_handle);
@@ -53,7 +53,7 @@ clearstatcache();
unlink($file); //Deleting the file
fclose( fopen($file, "w+t") ); //Opening the non-existing file in "w+t" mode, which will be created
-var_dump( file_exists($file) ); //Check for the existance of file
+var_dump( file_exists($file) ); //Check for the existence of file
echo "*** Done ***\n";
--CLEAN--
<?php
diff --git a/ext/standard/tests/file/007_variation12.phpt b/ext/standard/tests/file/007_variation12.phpt
index 44488fa21d..c56605ac62 100644
--- a/ext/standard/tests/file/007_variation12.phpt
+++ b/ext/standard/tests/file/007_variation12.phpt
@@ -36,7 +36,7 @@ echo "*** Test fopen() & fclose() functions: with 'w+t' mode ***\n";
$file_handle = fopen($file, "w+t"); //opening the file "w+t" mode
var_dump($file_handle); //Check for the content of handle
var_dump( get_resource_type($file_handle) ); //Check for the type of resource
-var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file
+var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file
var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string
var_dump( ftell($file_handle) ); //File pointer position after write operation, expected at the end of the file
rewind($file_handle);
@@ -53,7 +53,7 @@ clearstatcache();
unlink($file); //Deleting the file
fclose( fopen($file, "w+t") ); //Opening the non-existing file in "w+t" mode, which will be created
-var_dump( file_exists($file) ); //Check for the existance of file
+var_dump( file_exists($file) ); //Check for the existence of file
echo "*** Done ***\n";
--CLEAN--
<?php
diff --git a/ext/standard/tests/file/007_variation13-win32.phpt b/ext/standard/tests/file/007_variation13-win32.phpt
index 736b101042..fabcde90cc 100644
--- a/ext/standard/tests/file/007_variation13-win32.phpt
+++ b/ext/standard/tests/file/007_variation13-win32.phpt
@@ -45,7 +45,7 @@ var_dump( filesize($file) ); //Check that data hasn't over written; Expected: Si
unlink($file); //Deleting the file
fclose( fopen($file, "at") ); //Opening the non-existing file in "at" mode, which will be created
-var_dump( file_exists($file) ); //Check for the existance of file
+var_dump( file_exists($file) ); //Check for the existence of file
echo "*** Done ***\n";
--CLEAN--
<?php
diff --git a/ext/standard/tests/file/007_variation13.phpt b/ext/standard/tests/file/007_variation13.phpt
index 0cb48d3661..9d3e6265b5 100644
--- a/ext/standard/tests/file/007_variation13.phpt
+++ b/ext/standard/tests/file/007_variation13.phpt
@@ -45,7 +45,7 @@ var_dump( filesize($file) ); //Check that data hasn't over written; Expected: Si
unlink($file); //Deleting the file
fclose( fopen($file, "at") ); //Opening the non-existing file in "at" mode, which will be created
-var_dump( file_exists($file) ); //Check for the existance of file
+var_dump( file_exists($file) ); //Check for the existence of file
echo "*** Done ***\n";
--CLEAN--
<?php
diff --git a/ext/standard/tests/file/007_variation14.phpt b/ext/standard/tests/file/007_variation14.phpt
index ed76ab4834..ebcad6d830 100644
--- a/ext/standard/tests/file/007_variation14.phpt
+++ b/ext/standard/tests/file/007_variation14.phpt
@@ -39,7 +39,7 @@ var_dump( get_resource_type($file_handle) ); //Check whether resource is lost a
unlink($file); //Deleting the file
fclose( fopen($file, "a+t") ); //Opening the non-existing file in "a+t" mode, which will be created
-var_dump( file_exists($file) ); //Check for the existance of file
+var_dump( file_exists($file) ); //Check for the existence of file
echo "*** Done ***\n";
--CLEAN--
<?php
diff --git a/ext/standard/tests/file/007_variation15.phpt b/ext/standard/tests/file/007_variation15.phpt
index 11eed0d5a4..1a2d530b65 100644
--- a/ext/standard/tests/file/007_variation15.phpt
+++ b/ext/standard/tests/file/007_variation15.phpt
@@ -28,12 +28,12 @@ echo "*** Test fopen() & fclose() functions: with 'xt' mode ***\n";
$file_handle = fopen($file, "xt"); //opening the non-existing file in "xt" mode, file will be created
var_dump($file_handle); //Check for the content of handle
var_dump( get_resource_type($file_handle) ); //Check for the type of resource
-var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file
+var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file
var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string
var_dump( ftell($file_handle) ); //File pointer position after write operation, expected at the end of the file
rewind($file_handle);
var_dump( fread($file_handle, 100) ); //Check for read operation; fails; expected: empty string
-var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the begining of the file
+var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the beginning of the file
var_dump( fclose($file_handle) ); //Check for close operation on the file handle
var_dump( get_resource_type($file_handle) ); //Check whether resource is lost after close operation
$file_handle = fopen($file, "xt"); //Opening the existing data file in 'xt' mode to check for the warning message
diff --git a/ext/standard/tests/file/007_variation16.phpt b/ext/standard/tests/file/007_variation16.phpt
index c725aa183f..633299dedf 100644
--- a/ext/standard/tests/file/007_variation16.phpt
+++ b/ext/standard/tests/file/007_variation16.phpt
@@ -28,7 +28,7 @@ echo "*** Test fopen() & fclose() functions: with 'x+t' mode ***\n";
$file_handle = fopen($file, "x+t"); //opening the non-existing file in "x+t" mode, file will be created
var_dump($file_handle); //Check for the content of handle
var_dump( get_resource_type($file_handle) ); //Check for the type of resource
-var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file
+var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file
var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string
var_dump( ftell($file_handle) ); //File pointer position after write operation, expected at the end of the file
rewind($file_handle);
diff --git a/ext/standard/tests/file/007_variation18.phpt b/ext/standard/tests/file/007_variation18.phpt
index 991051d5e4..88350b8426 100644
--- a/ext/standard/tests/file/007_variation18.phpt
+++ b/ext/standard/tests/file/007_variation18.phpt
@@ -30,7 +30,7 @@ echo "*** Test fopen() & fclose() functions: with 'r+b' mode ***\n";
$file_handle = fopen($file, "r+b"); //opening the file in "r+b" mode
var_dump($file_handle); //Check for the content of handle
var_dump( get_resource_type($file_handle) ); //Check for the type of resource
-var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file
+var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file
var_dump( fread($file_handle, 100) ); //Check for read operation
var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the end of the file
var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string
diff --git a/ext/standard/tests/file/007_variation19.phpt b/ext/standard/tests/file/007_variation19.phpt
index 3830e4fc24..0731d454bb 100644
--- a/ext/standard/tests/file/007_variation19.phpt
+++ b/ext/standard/tests/file/007_variation19.phpt
@@ -31,12 +31,12 @@ echo "*** Test fopen() & fclose() functions: with 'wb' mode ***\n";
$file_handle = fopen($file, "wb"); //opening the file "wb" mode
var_dump($file_handle); //Check for the content of handle
var_dump( get_resource_type($file_handle) ); //Check for the type of resource
-var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file
+var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file
var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string
var_dump( ftell($file_handle) ); //File pointer position after write operation, expected at the end of the file
rewind($file_handle);
var_dump( fread($file_handle, 100) ); //Check for read operation; fails; expected: empty string
-var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the begining of the file
+var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the beginning of the file
var_dump( fclose($file_handle) ); //Check for close operation on the file handle
var_dump( get_resource_type($file_handle) ); //Check whether resource is lost after close operation
@@ -48,7 +48,7 @@ clearstatcache();
unlink($file); //Deleting the file
fclose( fopen($file, "wb") ); //Opening the non-existing file in "wb" mode, which will be created
-var_dump( file_exists($file) ); //Check for the existance of file
+var_dump( file_exists($file) ); //Check for the existence of file
echo "*** Done ***\n";
--CLEAN--
<?php
diff --git a/ext/standard/tests/file/007_variation2.phpt b/ext/standard/tests/file/007_variation2.phpt
index 4c883ea32c..deb51266ee 100644
--- a/ext/standard/tests/file/007_variation2.phpt
+++ b/ext/standard/tests/file/007_variation2.phpt
@@ -30,7 +30,7 @@ echo "*** Test fopen() & fclose() functions: with 'r+' mode ***\n";
$file_handle = fopen($file, "r+"); //opening the file in "r+" mode
var_dump($file_handle); //Check for the content of handle
var_dump( get_resource_type($file_handle) ); //Check for the type of resource
-var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file
+var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file
var_dump( fread($file_handle, 100) ); //Check for read operation
var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the end of the file
var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string
diff --git a/ext/standard/tests/file/007_variation20.phpt b/ext/standard/tests/file/007_variation20.phpt
index 4d66dc7eec..3eddec4258 100644
--- a/ext/standard/tests/file/007_variation20.phpt
+++ b/ext/standard/tests/file/007_variation20.phpt
@@ -31,7 +31,7 @@ echo "*** Test fopen() & fclose() functions: with 'w+b' mode ***\n";
$file_handle = fopen($file, "w+b"); //opening the file "w+b" mode
var_dump($file_handle); //Check for the content of handle
var_dump( get_resource_type($file_handle) ); //Check for the type of resource
-var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file
+var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file
var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string
var_dump( ftell($file_handle) ); //File pointer position after write operation, expected at the end of the file
rewind($file_handle);
@@ -48,7 +48,7 @@ clearstatcache();
unlink($file); //Deleting the file
fclose( fopen($file, "w+b") ); //Opening the non-existing file in "w+b" mode, which will be created
-var_dump( file_exists($file) ); //Check for the existance of file
+var_dump( file_exists($file) ); //Check for the existence of file
echo "*** Done ***\n";
--CLEAN--
<?php
diff --git a/ext/standard/tests/file/007_variation21.phpt b/ext/standard/tests/file/007_variation21.phpt
index 6c968f229c..c70aaad784 100644
--- a/ext/standard/tests/file/007_variation21.phpt
+++ b/ext/standard/tests/file/007_variation21.phpt
@@ -40,7 +40,7 @@ var_dump( filesize($file) ); //Check that data hasn't over written; Expected: Si
unlink($file); //Deleting the file
fclose( fopen($file, "ab") ); //Opening the non-existing file in "ab" mode, which will be created
-var_dump( file_exists($file) ); //Check for the existance of file
+var_dump( file_exists($file) ); //Check for the existence of file
echo "*** Done ***\n";
--CLEAN--
<?php
diff --git a/ext/standard/tests/file/007_variation22.phpt b/ext/standard/tests/file/007_variation22.phpt
index d1456fe261..63deee4f84 100644
--- a/ext/standard/tests/file/007_variation22.phpt
+++ b/ext/standard/tests/file/007_variation22.phpt
@@ -39,7 +39,7 @@ var_dump( get_resource_type($file_handle) ); //Check whether resource is lost a
unlink($file); //Deleting the file
fclose( fopen($file, "a+b") ); //Opening the non-existing file in "a+b" mode, which will be created
-var_dump( file_exists($file) ); //Check for the existance of file
+var_dump( file_exists($file) ); //Check for the existence of file
echo "*** Done ***\n";
--CLEAN--
<?php
diff --git a/ext/standard/tests/file/007_variation23.phpt b/ext/standard/tests/file/007_variation23.phpt
index 528f05a86f..1826296a06 100644
--- a/ext/standard/tests/file/007_variation23.phpt
+++ b/ext/standard/tests/file/007_variation23.phpt
@@ -28,12 +28,12 @@ echo "*** Test fopen() & fclose() functions: with 'xb' mode ***\n";
$file_handle = fopen($file, "xb"); //opening the non-existing file in "xb" mode, file will be created
var_dump($file_handle); //Check for the content of handle
var_dump( get_resource_type($file_handle) ); //Check for the type of resource
-var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file
+var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file
var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string
var_dump( ftell($file_handle) ); //File pointer position after write operation, expected at the end of the file
rewind($file_handle);
var_dump( fread($file_handle, 100) ); //Check for read operation; fails; expected: empty string
-var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the begining of the file
+var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the beginning of the file
var_dump( fclose($file_handle) ); //Check for close operation on the file handle
var_dump( get_resource_type($file_handle) ); //Check whether resource is lost after close operation
$file_handle = fopen($file, "xb"); //Opening the existing data file in 'xb' mode to check for the warning message
diff --git a/ext/standard/tests/file/007_variation24.phpt b/ext/standard/tests/file/007_variation24.phpt
index 41fc24cbe2..d898ba7b52 100644
--- a/ext/standard/tests/file/007_variation24.phpt
+++ b/ext/standard/tests/file/007_variation24.phpt
@@ -28,7 +28,7 @@ echo "*** Test fopen() & fclose() functions: with 'x+b' mode ***\n";
$file_handle = fopen($file, "x+b"); //opening the non-existing file in "x+b" mode, file will be created
var_dump($file_handle); //Check for the content of handle
var_dump( get_resource_type($file_handle) ); //Check for the type of resource
-var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file
+var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file
var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string
var_dump( ftell($file_handle) ); //File pointer position after write operation, expected at the end of the file
rewind($file_handle);
diff --git a/ext/standard/tests/file/007_variation3.phpt b/ext/standard/tests/file/007_variation3.phpt
index cd31eba1e1..f4ae03658f 100644
--- a/ext/standard/tests/file/007_variation3.phpt
+++ b/ext/standard/tests/file/007_variation3.phpt
@@ -31,12 +31,12 @@ echo "*** Test fopen() & fclose() functions: with 'w' mode ***\n";
$file_handle = fopen($file, "w"); //opening the file "w" mode
var_dump($file_handle); //Check for the content of handle
var_dump( get_resource_type($file_handle) ); //Check for the type of resource
-var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file
+var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file
var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string
var_dump( ftell($file_handle) ); //File pointer position after write operation, expected at the end of the file
rewind($file_handle);
var_dump( fread($file_handle, 100) ); //Check for read operation; fails; expected: empty string
-var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the begining of the file
+var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the beginning of the file
var_dump( fclose($file_handle) ); //Check for close operation on the file handle
var_dump( get_resource_type($file_handle) ); //Check whether resource is lost after close operation
@@ -48,7 +48,7 @@ clearstatcache();
unlink($file); //Deleting the file
fclose( fopen($file, "w") ); //Opening the non-existing file in "w" mode, which will be created
-var_dump( file_exists($file) ); //Check for the existance of file
+var_dump( file_exists($file) ); //Check for the existence of file
echo "*** Done ***\n";
--CLEAN--
<?php
diff --git a/ext/standard/tests/file/007_variation4.phpt b/ext/standard/tests/file/007_variation4.phpt
index e88324e831..0dabc5b9ad 100644
--- a/ext/standard/tests/file/007_variation4.phpt
+++ b/ext/standard/tests/file/007_variation4.phpt
@@ -31,7 +31,7 @@ echo "*** Test fopen() & fclose() functions: with 'w+' mode ***\n";
$file_handle = fopen($file, "w+"); //opening the file "w+" mode
var_dump($file_handle); //Check for the content of handle
var_dump( get_resource_type($file_handle) ); //Check for the type of resource
-var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file
+var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file
var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string
var_dump( ftell($file_handle) ); //File pointer position after write operation, expected at the end of the file
rewind($file_handle);
@@ -48,7 +48,7 @@ clearstatcache();
unlink($file); //Deleting the file
fclose( fopen($file, "w+") ); //Opening the non-existing file in "w+" mode, which will be created
-var_dump( file_exists($file) ); //Check for the existance of file
+var_dump( file_exists($file) ); //Check for the existence of file
echo "*** Done ***\n";
--CLEAN--
<?php
diff --git a/ext/standard/tests/file/007_variation5.phpt b/ext/standard/tests/file/007_variation5.phpt
index 9311534574..51e366d291 100644
--- a/ext/standard/tests/file/007_variation5.phpt
+++ b/ext/standard/tests/file/007_variation5.phpt
@@ -40,7 +40,7 @@ var_dump( filesize($file) ); //Check that data hasn't over written; Expected: Si
unlink($file); //Deleting the file
fclose( fopen($file, "a") ); //Opening the non-existing file in "a" mode, which will be created
-var_dump( file_exists($file) ); //Check for the existance of file
+var_dump( file_exists($file) ); //Check for the existence of file
echo "*** Done ***\n";
--CLEAN--
<?php
diff --git a/ext/standard/tests/file/007_variation6.phpt b/ext/standard/tests/file/007_variation6.phpt
index b274b05925..92c0171751 100644
--- a/ext/standard/tests/file/007_variation6.phpt
+++ b/ext/standard/tests/file/007_variation6.phpt
@@ -39,7 +39,7 @@ var_dump( get_resource_type($file_handle) ); //Check whether resource is lost a
unlink($file); //Deleting the file
fclose( fopen($file, "a+") ); //Opening the non-existing file in "a+" mode, which will be created
-var_dump( file_exists($file) ); //Check for the existance of file
+var_dump( file_exists($file) ); //Check for the existence of file
echo "*** Done ***\n";
--CLEAN--
<?php
diff --git a/ext/standard/tests/file/007_variation7.phpt b/ext/standard/tests/file/007_variation7.phpt
index 131daff55b..06bf9117f3 100644
--- a/ext/standard/tests/file/007_variation7.phpt
+++ b/ext/standard/tests/file/007_variation7.phpt
@@ -28,12 +28,12 @@ echo "*** Test fopen() & fclose() functions: with 'x' mode ***\n";
$file_handle = fopen($file, "x"); //opening the non-existing file in "x" mode, file will be created
var_dump($file_handle); //Check for the content of handle
var_dump( get_resource_type($file_handle) ); //Check for the type of resource
-var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file
+var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file
var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string
var_dump( ftell($file_handle) ); //File pointer position after write operation, expected at the end of the file
rewind($file_handle);
var_dump( fread($file_handle, 100) ); //Check for read operation; fails; expected: empty string
-var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the begining of the file
+var_dump( ftell($file_handle) ); //File pointer position after read operation, expected at the beginning of the file
var_dump( fclose($file_handle) ); //Check for close operation on the file handle
var_dump( get_resource_type($file_handle) ); //Check whether resource is lost after close operation
$file_handle = fopen($file, "x"); //Opening the existing data file in 'x' mode to check for the warning message
diff --git a/ext/standard/tests/file/007_variation8.phpt b/ext/standard/tests/file/007_variation8.phpt
index aa847115c0..fae6932048 100644
--- a/ext/standard/tests/file/007_variation8.phpt
+++ b/ext/standard/tests/file/007_variation8.phpt
@@ -28,7 +28,7 @@ echo "*** Test fopen() & fclose() functions: with 'x+' mode ***\n";
$file_handle = fopen($file, "x+"); //opening the non-existing file in "x+" mode, file will be created
var_dump($file_handle); //Check for the content of handle
var_dump( get_resource_type($file_handle) ); //Check for the type of resource
-var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the begining of the file
+var_dump( ftell($file_handle) ); //Initial file pointer position, expected at the beginning of the file
var_dump( fwrite($file_handle, $string) ); //Check for write operation; passes; expected:size of the $string
var_dump( ftell($file_handle) ); //File pointer position after write operation, expected at the end of the file
rewind($file_handle);
diff --git a/ext/standard/tests/file/bug52820.phpt b/ext/standard/tests/file/bug52820.phpt
index 91976b04db..3a9f9c31a4 100644
--- a/ext/standard/tests/file/bug52820.phpt
+++ b/ext/standard/tests/file/bug52820.phpt
@@ -1,5 +1,5 @@
--TEST--
-Bug #52820 (writes to fopencookie FILE* not commited when seeking the stream)
+Bug #52820 (writes to fopencookie FILE* not committed when seeking the stream)
--SKIPIF--
<?php
if (!function_exists('leak_variable'))
diff --git a/ext/standard/tests/file/fgetc_variation3.phpt b/ext/standard/tests/file/fgetc_variation3.phpt
index f8349989a4..64efaa6cfd 100644
--- a/ext/standard/tests/file/fgetc_variation3.phpt
+++ b/ext/standard/tests/file/fgetc_variation3.phpt
@@ -30,7 +30,7 @@ foreach ($file_modes as $file_mode ) {
$data = "fgetc_variation test";
fwrite($file_handle, $data);
- // rewind the file pointer to begining of the file
+ // rewind the file pointer to beginning of the file
var_dump( rewind($file_handle) );
var_dump( ftell($file_handle) );
var_dump( feof($file_handle) );
diff --git a/ext/standard/tests/file/fgetc_variation4.phpt b/ext/standard/tests/file/fgetc_variation4.phpt
index a2bc9e5245..cb6f0cdce5 100644
--- a/ext/standard/tests/file/fgetc_variation4.phpt
+++ b/ext/standard/tests/file/fgetc_variation4.phpt
@@ -29,7 +29,7 @@ foreach ($file_modes as $file_mode ) {
$data = "fgetc\n test";
fwrite($file_handle, $data);
- // rewind the file pointer to begining of the file
+ // rewind the file pointer to beginning of the file
var_dump( rewind($file_handle) );
var_dump( ftell($file_handle) );
var_dump( feof($file_handle) );
diff --git a/ext/standard/tests/file/fgetcsv_variation1.phpt b/ext/standard/tests/file/fgetcsv_variation1.phpt
index 8a698e40a0..969c9c0348 100644
--- a/ext/standard/tests/file/fgetcsv_variation1.phpt
+++ b/ext/standard/tests/file/fgetcsv_variation1.phpt
@@ -59,7 +59,7 @@ foreach ($csv_lists as $csv_list) {
fwrite($file_handle, "\n"); // blank line
// close the file if the mode to be used is read mode and re-open using read mode
- // else rewind the file pointer to begining of the file
+ // else rewind the file pointer to beginning of the file
if ( strstr($file_modes[$mode_counter], "r" ) ) {
fclose($file_handle);
$file_handle = fopen($filename, $file_modes[$mode_counter]);
diff --git a/ext/standard/tests/file/fgetcsv_variation10.phpt b/ext/standard/tests/file/fgetcsv_variation10.phpt
index 250237c21f..60a401bb86 100644
--- a/ext/standard/tests/file/fgetcsv_variation10.phpt
+++ b/ext/standard/tests/file/fgetcsv_variation10.phpt
@@ -58,7 +58,7 @@ foreach ($csv_lists as $csv_list) {
fwrite($file_handle, "\n"); // blank line
// close the file if the mode to be used is read mode and re-open using read mode
- // else rewind the file pointer to begining of the file
+ // else rewind the file pointer to beginning of the file
if ( strstr($file_modes[$mode_counter], "r" ) ) {
fclose($file_handle);
$file_handle = fopen($filename, $file_modes[$mode_counter]);
diff --git a/ext/standard/tests/file/fgetcsv_variation11.phpt b/ext/standard/tests/file/fgetcsv_variation11.phpt
index 815ede6f01..d5741248fb 100644
--- a/ext/standard/tests/file/fgetcsv_variation11.phpt
+++ b/ext/standard/tests/file/fgetcsv_variation11.phpt
@@ -59,7 +59,7 @@ foreach ($csv_lists as $csv_list) {
fwrite($file_handle, "\n"); // blank line
// close the file if the mode to be used is read mode and re-open using read mode
- // else rewind the file pointer to begining of the file
+ // else rewind the file pointer to beginning of the file
if ( strstr($file_modes[$mode_counter], "r" ) ) {
fclose($file_handle);
$file_handle = fopen($filename, $file_modes[$mode_counter]);
diff --git a/ext/standard/tests/file/fgetcsv_variation12.phpt b/ext/standard/tests/file/fgetcsv_variation12.phpt
index e513fe6761..3168684468 100644
--- a/ext/standard/tests/file/fgetcsv_variation12.phpt
+++ b/ext/standard/tests/file/fgetcsv_variation12.phpt
@@ -57,7 +57,7 @@ foreach ($csv_lists as $csv_list) {
fwrite($file_handle, "\n"); // blank line
// close the file if the mode to be used is read mode and re-open using read mode
- // else rewind the file pointer to begining of the file
+ // else rewind the file pointer to beginning of the file
if ( strstr($file_modes[$mode_counter], "r" ) ) {
fclose($file_handle);
$file_handle = fopen($filename, $file_modes[$mode_counter]);
diff --git a/ext/standard/tests/file/fgetcsv_variation13.phpt b/ext/standard/tests/file/fgetcsv_variation13.phpt
index a00405b90b..f191a26379 100644
--- a/ext/standard/tests/file/fgetcsv_variation13.phpt
+++ b/ext/standard/tests/file/fgetcsv_variation13.phpt
@@ -37,7 +37,7 @@ $loop_counter = 1;
fwrite($file_handle, "This is line of text without csv fields\n");
// close the file if the mode to be used is read mode and re-open using read mode
- // else rewind the file pointer to begining of the file
+ // else rewind the file pointer to beginning of the file
if ( strstr($file_modes[$mode_counter], "r" ) ) {
fclose($file_handle);
$file_handle = fopen($filename, $file_modes[$mode_counter]);
diff --git a/ext/standard/tests/file/fgetcsv_variation14.phpt b/ext/standard/tests/file/fgetcsv_variation14.phpt
index 927bf8a077..14c72a24b1 100644
--- a/ext/standard/tests/file/fgetcsv_variation14.phpt
+++ b/ext/standard/tests/file/fgetcsv_variation14.phpt
@@ -36,7 +36,7 @@ $loop_counter = 1;
fwrite($file_handle, "\n"); // blank line
// close the file if the mode to be used is read mode and re-open using read mode
- // else rewind the file pointer to begining of the file
+ // else rewind the file pointer to beginning of the file
if ( strstr($file_modes[$mode_counter], "r" ) ) {
fclose($file_handle);
$file_handle = fopen($filename, $file_modes[$mode_counter]);
diff --git a/ext/standard/tests/file/fgetcsv_variation15.phpt b/ext/standard/tests/file/fgetcsv_variation15.phpt
index b36b88ed3f..c6859497ee 100644
--- a/ext/standard/tests/file/fgetcsv_variation15.phpt
+++ b/ext/standard/tests/file/fgetcsv_variation15.phpt
@@ -53,7 +53,7 @@ foreach ($csv_lists as $csv_list) {
fwrite($file_handle, "\n"); // blank line
// close the file if the mode to be used is read mode and re-open using read mode
- // else rewind the file pointer to begining of the file
+ // else rewind the file pointer to beginning of the file
if ( strstr($file_modes[$mode_counter], "r" ) ) {
fclose($file_handle);
$file_handle = fopen($filename, $file_modes[$mode_counter]);
diff --git a/ext/standard/tests/file/fgetcsv_variation16.phpt b/ext/standard/tests/file/fgetcsv_variation16.phpt
index 904c422428..9cfdd72460 100644
--- a/ext/standard/tests/file/fgetcsv_variation16.phpt
+++ b/ext/standard/tests/file/fgetcsv_variation16.phpt
@@ -55,7 +55,7 @@ foreach ($csv_lists as $csv_list) {
fwrite($file_handle, "\n"); // blank line
// close the file if the mode to be used is read mode and re-open using read mode
- // else rewind the file pointer to begining of the file
+ // else rewind the file pointer to beginning of the file
if ( strstr($file_modes[$mode_counter], "r" ) ) {
fclose($file_handle);
$file_handle = fopen($filename, $file_modes[$mode_counter]);
diff --git a/ext/standard/tests/file/fgetcsv_variation17.phpt b/ext/standard/tests/file/fgetcsv_variation17.phpt
index a54f8da61e..b8d918659f 100644
--- a/ext/standard/tests/file/fgetcsv_variation17.phpt
+++ b/ext/standard/tests/file/fgetcsv_variation17.phpt
@@ -55,7 +55,7 @@ foreach ($csv_lists as $csv_list) {
fwrite($file_handle, "\n"); // blank line
// close the file if the mode to be used is read mode and re-open using read mode
- // else rewind the file pointer to begining of the file
+ // else rewind the file pointer to beginning of the file
if ( strstr($file_modes[$mode_counter], "r" ) ) {
fclose($file_handle);
$file_handle = fopen($filename, $file_modes[$mode_counter]);
diff --git a/ext/standard/tests/file/fgetcsv_variation18.phpt b/ext/standard/tests/file/fgetcsv_variation18.phpt
index 19915e816f..f0ebcb7fae 100644
--- a/ext/standard/tests/file/fgetcsv_variation18.phpt
+++ b/ext/standard/tests/file/fgetcsv_variation18.phpt
@@ -55,7 +55,7 @@ foreach ($csv_lists as $csv_list) {
fwrite($file_handle, "\n"); // blank line
// close the file if the mode to be used is read mode and re-open using read mode
- // else rewind the file pointer to begining of the file
+ // else rewind the file pointer to beginning of the file
if ( strstr($file_modes[$mode_counter], "r" ) ) {
fclose($file_handle);
$file_handle = fopen($filename, $file_modes[$mode_counter]);
diff --git a/ext/standard/tests/file/fgetcsv_variation19.phpt b/ext/standard/tests/file/fgetcsv_variation19.phpt
index 2e282e1701..cb510099bd 100644
--- a/ext/standard/tests/file/fgetcsv_variation19.phpt
+++ b/ext/standard/tests/file/fgetcsv_variation19.phpt
@@ -56,7 +56,7 @@ foreach ($csv_lists as $csv_list) {
fwrite($file_handle, "\n"); // blank line
// close the file if the mode to be used is read mode and re-open using read mode
- // else rewind the file pointer to begining of the file
+ // else rewind the file pointer to beginning of the file
if ( strstr($file_modes[$mode_counter], "r" ) ) {
fclose($file_handle);
$file_handle = fopen($filename, $file_modes[$mode_counter]);
diff --git a/ext/standard/tests/file/fgetcsv_variation2.phpt b/ext/standard/tests/file/fgetcsv_variation2.phpt
index 7b875b821a..d1e446d1f9 100644
--- a/ext/standard/tests/file/fgetcsv_variation2.phpt
+++ b/ext/standard/tests/file/fgetcsv_variation2.phpt
@@ -59,7 +59,7 @@ foreach ($csv_lists as $csv_list) {
fwrite($file_handle, "\n"); // blank line
// close the file if the mode to be used is read mode and re-open using read mode
- // else rewind the file pointer to begining of the file
+ // else rewind the file pointer to beginning of the file
if ( strstr($file_modes[$mode_counter], "r" ) ) {
fclose($file_handle);
$file_handle = fopen($filename, $file_modes[$mode_counter]);
diff --git a/ext/standard/tests/file/fgetcsv_variation20.phpt b/ext/standard/tests/file/fgetcsv_variation20.phpt
index e96089e9ab..70bd8acbb0 100644
--- a/ext/standard/tests/file/fgetcsv_variation20.phpt
+++ b/ext/standard/tests/file/fgetcsv_variation20.phpt
@@ -38,7 +38,7 @@ $loop_counter = 1;
fwrite($file_handle, "This is line of text without csv fields\n");
// close the file if the mode to be used is read mode and re-open using read mode
- // else rewind the file pointer to begining of the file
+ // else rewind the file pointer to beginning of the file
if ( strstr($file_modes[$mode_counter], "r" ) ) {
fclose($file_handle);
$file_handle = fopen($filename, $file_modes[$mode_counter]);
diff --git a/ext/standard/tests/file/fgetcsv_variation21.phpt b/ext/standard/tests/file/fgetcsv_variation21.phpt
index e6a9ee586d..ae8c4f1ef6 100644
--- a/ext/standard/tests/file/fgetcsv_variation21.phpt
+++ b/ext/standard/tests/file/fgetcsv_variation21.phpt
@@ -38,7 +38,7 @@ $loop_counter = 1;
fwrite($file_handle, "\n"); // blank line
// close the file if the mode to be used is read mode and re-open using read mode
- // else rewind the file pointer to begining of the file
+ // else rewind the file pointer to beginning of the file
if ( strstr($file_modes[$mode_counter], "r" ) ) {
fclose($file_handle);
$file_handle = fopen($filename, $file_modes[$mode_counter]);
diff --git a/ext/standard/tests/file/fgetcsv_variation24.phpt b/ext/standard/tests/file/fgetcsv_variation24.phpt
index 89b6d03b90..cdfadceb70 100644
--- a/ext/standard/tests/file/fgetcsv_variation24.phpt
+++ b/ext/standard/tests/file/fgetcsv_variation24.phpt
@@ -59,7 +59,7 @@ foreach ($csv_lists as $csv_list) {
fwrite($file_handle, "\n"); // blank line
// close the file if the mode to be used is read mode and re-open using read mode
- // else rewind the file pointer to begining of the file
+ // else rewind the file pointer to beginning of the file
if ( strstr($file_modes[$mode_counter], "r" ) ) {
fclose($file_handle);
$file_handle = fopen($filename, $file_modes[$mode_counter]);
diff --git a/ext/standard/tests/file/fgetcsv_variation25.phpt b/ext/standard/tests/file/fgetcsv_variation25.phpt
index 1877bc0a0e..52e830cb5b 100644
--- a/ext/standard/tests/file/fgetcsv_variation25.phpt
+++ b/ext/standard/tests/file/fgetcsv_variation25.phpt
@@ -62,7 +62,7 @@ foreach ($csv_lists as $csv_list) {
fwrite($file_handle, "\n"); // blank line
// close the file if the mode to be used is read mode and re-open using read mode
- // else rewind the file pointer to begining of the file
+ // else rewind the file pointer to beginning of the file
if ( strstr($file_modes[$mode_counter], "r" ) ) {
fclose($file_handle);
$file_handle = fopen($filename, $file_modes[$mode_counter]);
diff --git a/ext/standard/tests/file/fgetcsv_variation27.phpt b/ext/standard/tests/file/fgetcsv_variation27.phpt
index aafc3ab6c9..a215e90a3f 100644
--- a/ext/standard/tests/file/fgetcsv_variation27.phpt
+++ b/ext/standard/tests/file/fgetcsv_variation27.phpt
@@ -62,7 +62,7 @@ foreach ($csv_lists as $csv_list) {
fwrite($file_handle, "\n"); // blank line
// close the file if the mode to be used is read mode and re-open using read mode
- // else rewind the file pointer to begining of the file
+ // else rewind the file pointer to beginning of the file
if ( strstr($file_modes[$mode_counter], "r" ) ) {
fclose($file_handle);
$file_handle = fopen($filename, $file_modes[$mode_counter]);
diff --git a/ext/standard/tests/file/fgetcsv_variation28.phpt b/ext/standard/tests/file/fgetcsv_variation28.phpt
index 56dd538ac1..4e6fed3171 100644
--- a/ext/standard/tests/file/fgetcsv_variation28.phpt
+++ b/ext/standard/tests/file/fgetcsv_variation28.phpt
@@ -62,7 +62,7 @@ foreach ($csv_lists as $csv_list) {
fwrite($file_handle, "\n"); // blank line
// close the file if the mode to be used is read mode and re-open using read mode
- // else rewind the file pointer to begining of the file
+ // else rewind the file pointer to beginning of the file
if ( strstr($file_modes[$mode_counter], "r" ) ) {
fclose($file_handle);
$file_handle = fopen($filename, $file_modes[$mode_counter]);
diff --git a/ext/standard/tests/file/fgetcsv_variation29.phpt b/ext/standard/tests/file/fgetcsv_variation29.phpt
index 08c7503517..0420860321 100644
--- a/ext/standard/tests/file/fgetcsv_variation29.phpt
+++ b/ext/standard/tests/file/fgetcsv_variation29.phpt
@@ -57,7 +57,7 @@ foreach ($csv_lists as $csv_list) {
fwrite($file_handle, "\n"); // blank line
// close the file if the mode to be used is read mode and re-open using read mode
- // else rewind the file pointer to begining of the file
+ // else rewind the file pointer to beginning of the file
if ( strstr($file_modes[$mode_counter], "r" ) ) {
fclose($file_handle);
$file_handle = fopen($filename, $file_modes[$mode_counter]);
diff --git a/ext/standard/tests/file/fgetcsv_variation3.phpt b/ext/standard/tests/file/fgetcsv_variation3.phpt
index 52c094faa5..8cde39da20 100644
--- a/ext/standard/tests/file/fgetcsv_variation3.phpt
+++ b/ext/standard/tests/file/fgetcsv_variation3.phpt
@@ -59,7 +59,7 @@ foreach ($csv_lists as $csv_list) {
fwrite($file_handle, "\n"); // blank line
// close the file if the mode to be used is read mode and re-open using read mode
- // else rewind the file pointer to begining of the file
+ // else rewind the file pointer to beginning of the file
if ( strstr($file_modes[$mode_counter], "r" ) ) {
fclose($file_handle);
$file_handle = fopen($filename, $file_modes[$mode_counter]);
diff --git a/ext/standard/tests/file/fgetcsv_variation31.phpt b/ext/standard/tests/file/fgetcsv_variation31.phpt
index 1d896b7919..7d1e90e1f9 100644
--- a/ext/standard/tests/file/fgetcsv_variation31.phpt
+++ b/ext/standard/tests/file/fgetcsv_variation31.phpt
@@ -57,7 +57,7 @@ foreach ($csv_lists as $csv_list) {
fwrite($file_handle, "\n"); // blank line
// close the file if the mode to be used is read mode and re-open using read mode
- // else rewind the file pointer to begining of the file
+ // else rewind the file pointer to beginning of the file
if ( strstr($file_modes[$mode_counter], "r" ) ) {
fclose($file_handle);
$file_handle = fopen($filename, $file_modes[$mode_counter]);
diff --git a/ext/standard/tests/file/fgetcsv_variation4.phpt b/ext/standard/tests/file/fgetcsv_variation4.phpt
index 0c84484721..da945daa70 100644
--- a/ext/standard/tests/file/fgetcsv_variation4.phpt
+++ b/ext/standard/tests/file/fgetcsv_variation4.phpt
@@ -58,7 +58,7 @@ foreach ($csv_lists as $csv_list) {
fwrite($file_handle, "\n"); // blank line
// close the file if the mode to be used is read mode and re-open using read mode
- // else rewind the file pointer to begining of the file
+ // else rewind the file pointer to beginning of the file
if ( strstr($file_modes[$mode_counter], "r" ) ) {
fclose($file_handle);
$file_handle = fopen($filename, $file_modes[$mode_counter]);
diff --git a/ext/standard/tests/file/fgetcsv_variation5.phpt b/ext/standard/tests/file/fgetcsv_variation5.phpt
index 283fa40bd8..d3564e4015 100644
--- a/ext/standard/tests/file/fgetcsv_variation5.phpt
+++ b/ext/standard/tests/file/fgetcsv_variation5.phpt
@@ -61,7 +61,7 @@ foreach ($csv_lists as $csv_list) {
fwrite($file_handle, "\n"); // blank line
// close the file if the mode to be used is read mode and re-open using read mode
- // else rewind the file pointer to begining of the file
+ // else rewind the file pointer to beginning of the file
if ( strstr($file_modes[$mode_counter], "r" ) ) {
fclose($file_handle);
$file_handle = fopen($filename, $file_modes[$mode_counter]);
diff --git a/ext/standard/tests/file/fgetcsv_variation6.phpt b/ext/standard/tests/file/fgetcsv_variation6.phpt
index 9878cb98d2..844dd7c519 100644
--- a/ext/standard/tests/file/fgetcsv_variation6.phpt
+++ b/ext/standard/tests/file/fgetcsv_variation6.phpt
@@ -61,7 +61,7 @@ foreach ($csv_lists as $csv_list) {
fwrite($file_handle, "\n"); // blank line
// close the file if the mode to be used is read mode and re-open using read mode
- // else rewind the file pointer to begining of the file
+ // else rewind the file pointer to beginning of the file
if ( strstr($file_modes[$mode_counter], "r" ) ) {
fclose($file_handle);
$file_handle = fopen($filename, $file_modes[$mode_counter]);
diff --git a/ext/standard/tests/file/fgetcsv_variation7.phpt b/ext/standard/tests/file/fgetcsv_variation7.phpt
index 723328e086..271a55b009 100644
--- a/ext/standard/tests/file/fgetcsv_variation7.phpt
+++ b/ext/standard/tests/file/fgetcsv_variation7.phpt
@@ -58,7 +58,7 @@ foreach ($csv_lists as $csv_list) {
fwrite($file_handle, "\n"); // blank line
// close the file if the mode to be used is read mode and re-open using read mode
- // else rewind the file pointer to begining of the file
+ // else rewind the file pointer to beginning of the file
if ( strstr($file_modes[$mode_counter], "r" ) ) {
fclose($file_handle);
$file_handle = fopen($filename, $file_modes[$mode_counter]);
diff --git a/ext/standard/tests/file/fgetcsv_variation8.phpt b/ext/standard/tests/file/fgetcsv_variation8.phpt
index 21b6c88752..bf06d29b40 100644
--- a/ext/standard/tests/file/fgetcsv_variation8.phpt
+++ b/ext/standard/tests/file/fgetcsv_variation8.phpt
@@ -62,7 +62,7 @@ foreach ($csv_lists as $csv_list) {
fwrite($file_handle, "\n"); // blank line
// close the file if the mode to be used is read mode and re-open using read mode
- // else rewind the file pointer to begining of the file
+ // else rewind the file pointer to beginning of the file
if ( strstr($file_modes[$mode_counter], "r" ) ) {
fclose($file_handle);
$file_handle = fopen($filename, $file_modes[$mode_counter]);
diff --git a/ext/standard/tests/file/fgetcsv_variation9.phpt b/ext/standard/tests/file/fgetcsv_variation9.phpt
index 6400fc84e3..294241e6cd 100644
--- a/ext/standard/tests/file/fgetcsv_variation9.phpt
+++ b/ext/standard/tests/file/fgetcsv_variation9.phpt
@@ -61,7 +61,7 @@ foreach ($csv_lists as $csv_list) {
fwrite($file_handle, "\n"); // blank line
// close the file if the mode to be used is read mode and re-open using read mode
- // else rewind the file pointer to begining of the file
+ // else rewind the file pointer to beginning of the file
if ( strstr($file_modes[$mode_counter], "r" ) ) {
fclose($file_handle);
$file_handle = fopen($filename, $file_modes[$mode_counter]);
diff --git a/ext/standard/tests/file/fgets_variation1.phpt b/ext/standard/tests/file/fgets_variation1.phpt
index 48ea231194..68a20e8992 100644
--- a/ext/standard/tests/file/fgets_variation1.phpt
+++ b/ext/standard/tests/file/fgets_variation1.phpt
@@ -29,7 +29,7 @@ foreach ($file_modes as $file_mode ) {
$data = "fgets_variation test";
fwrite($file_handle, $data);
- // rewind the file pointer to begining of the file
+ // rewind the file pointer to beginning of the file
var_dump( rewind($file_handle) );
var_dump( ftell($file_handle) );
var_dump( feof($file_handle) );
diff --git a/ext/standard/tests/file/fgets_variation3.phpt b/ext/standard/tests/file/fgets_variation3.phpt
index 4f0364132a..b39ba0c6af 100644
--- a/ext/standard/tests/file/fgets_variation3.phpt
+++ b/ext/standard/tests/file/fgets_variation3.phpt
@@ -36,7 +36,7 @@ foreach($file_modes as $file_mode) {
}
echo "-- fgets() with default length, file pointer at 0 --\n";
- // get the file pointer to begining of the file
+ // get the file pointer to beginning of the file
rewind($file_handle);
var_dump( ftell($file_handle) );
@@ -45,7 +45,7 @@ foreach($file_modes as $file_mode) {
var_dump( feof($file_handle) ); // enusre if eof set
echo "-- fgets() with length = 23, Expected: 22 chars, file pointer at 0 --\n";
- // get the file pointer to begining of the file
+ // get the file pointer to beginning of the file
rewind($file_handle);
var_dump( ftell($file_handle) );
diff --git a/ext/standard/tests/file/fgetss_basic2-win32.phpt b/ext/standard/tests/file/fgetss_basic2-win32.phpt
index 9187fe532a..ca6f40cb94 100644
--- a/ext/standard/tests/file/fgetss_basic2-win32.phpt
+++ b/ext/standard/tests/file/fgetss_basic2-win32.phpt
@@ -48,7 +48,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) {
exit();
}
- // rewind the file pointer to begining of the file
+ // rewind the file pointer to beginning of the file
var_dump( filesize($filename) );
var_dump( rewind($file_handle) );
var_dump( ftell($file_handle) );
diff --git a/ext/standard/tests/file/fgetss_basic2.phpt b/ext/standard/tests/file/fgetss_basic2.phpt
index 63fdde850d..86be24810e 100644
--- a/ext/standard/tests/file/fgetss_basic2.phpt
+++ b/ext/standard/tests/file/fgetss_basic2.phpt
@@ -46,7 +46,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) {
exit();
}
- // rewind the file pointer to begining of the file
+ // rewind the file pointer to beginning of the file
var_dump( filesize($filename) );
var_dump( rewind($file_handle) );
var_dump( ftell($file_handle) );
diff --git a/ext/standard/tests/file/fgetss_variation1-win32.phpt b/ext/standard/tests/file/fgetss_variation1-win32.phpt
index 0aca5d3760..7cd49333bf 100644
--- a/ext/standard/tests/file/fgetss_variation1-win32.phpt
+++ b/ext/standard/tests/file/fgetss_variation1-win32.phpt
@@ -56,7 +56,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) {
exit();
}
- // rewind the file pointer to begining of the file
+ // rewind the file pointer to beginning of the file
var_dump( filesize($filename) );
var_dump( rewind($file_handle) );
var_dump( ftell($file_handle) );
diff --git a/ext/standard/tests/file/fgetss_variation1.phpt b/ext/standard/tests/file/fgetss_variation1.phpt
index d85b09556d..5a0556a198 100644
--- a/ext/standard/tests/file/fgetss_variation1.phpt
+++ b/ext/standard/tests/file/fgetss_variation1.phpt
@@ -52,7 +52,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) {
exit();
}
- // rewind the file pointer to begining of the file
+ // rewind the file pointer to beginning of the file
var_dump( filesize($filename) );
var_dump( rewind($file_handle) );
var_dump( ftell($file_handle) );
diff --git a/ext/standard/tests/file/fgetss_variation2.phpt b/ext/standard/tests/file/fgetss_variation2.phpt
index d155f08683..a436e8c4b3 100644
--- a/ext/standard/tests/file/fgetss_variation2.phpt
+++ b/ext/standard/tests/file/fgetss_variation2.phpt
@@ -44,7 +44,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) {
exit();
}
- // rewind the file pointer to begining of the file
+ // rewind the file pointer to beginning of the file
var_dump( filesize($filename) );
var_dump( rewind($file_handle) );
var_dump( ftell($file_handle) );
diff --git a/ext/standard/tests/file/fgetss_variation3-win32.phpt b/ext/standard/tests/file/fgetss_variation3-win32.phpt
index 7539b36876..fc7561dff5 100644
--- a/ext/standard/tests/file/fgetss_variation3-win32.phpt
+++ b/ext/standard/tests/file/fgetss_variation3-win32.phpt
@@ -55,7 +55,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) {
exit();
}
- // rewind the file pointer to begining of the file
+ // rewind the file pointer to beginning of the file
rewind($file_handle);
var_dump( ftell($file_handle) );
var_dump( filesize($filename) );
diff --git a/ext/standard/tests/file/fgetss_variation3.phpt b/ext/standard/tests/file/fgetss_variation3.phpt
index 5b339a1bb9..e6f63c310f 100644
--- a/ext/standard/tests/file/fgetss_variation3.phpt
+++ b/ext/standard/tests/file/fgetss_variation3.phpt
@@ -51,7 +51,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) {
exit();
}
- // rewind the file pointer to begining of the file
+ // rewind the file pointer to beginning of the file
rewind($file_handle);
var_dump( ftell($file_handle) );
var_dump( filesize($filename) );
diff --git a/ext/standard/tests/file/fgetss_variation4.phpt b/ext/standard/tests/file/fgetss_variation4.phpt
index 6c201d1a9e..b93bc6afd0 100644
--- a/ext/standard/tests/file/fgetss_variation4.phpt
+++ b/ext/standard/tests/file/fgetss_variation4.phpt
@@ -47,7 +47,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) {
exit();
}
- // rewind the file pointer to begining of the file
+ // rewind the file pointer to beginning of the file
var_dump( filesize($filename) );
var_dump( rewind($file_handle) );
var_dump( ftell($file_handle) );
diff --git a/ext/standard/tests/file/fgetss_variation5-win32.phpt b/ext/standard/tests/file/fgetss_variation5-win32.phpt
index cedc7b98da..a2d4a705e8 100644
--- a/ext/standard/tests/file/fgetss_variation5-win32.phpt
+++ b/ext/standard/tests/file/fgetss_variation5-win32.phpt
@@ -52,7 +52,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) {
echo "Error: failed to open file $filename!\n";
exit();
}
- // rewind the file pointer to begining of the file
+ // rewind the file pointer to beginning of the file
var_dump( filesize($filename) );
var_dump( rewind($file_handle) );
var_dump( ftell($file_handle) );
diff --git a/ext/standard/tests/file/fgetss_variation5.phpt b/ext/standard/tests/file/fgetss_variation5.phpt
index ea53382e2d..c499d598b2 100644
--- a/ext/standard/tests/file/fgetss_variation5.phpt
+++ b/ext/standard/tests/file/fgetss_variation5.phpt
@@ -49,7 +49,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) {
echo "Error: failed to open file $filename!\n";
exit();
}
- // rewind the file pointer to begining of the file
+ // rewind the file pointer to beginning of the file
var_dump( filesize($filename) );
var_dump( rewind($file_handle) );
var_dump( ftell($file_handle) );
diff --git a/ext/standard/tests/file/fileinode_error.phpt b/ext/standard/tests/file/fileinode_error.phpt
index d716c4ae5b..eb5d79e0c3 100644
--- a/ext/standard/tests/file/fileinode_error.phpt
+++ b/ext/standard/tests/file/fileinode_error.phpt
@@ -16,10 +16,10 @@ var_dump( fileinode("/no/such/file/dir") );
var_dump( fileinode("string") );
var_dump( fileinode(100) );
-/* No.of argumetns less than expected */
+/* No.of arguments less than expected */
var_dump( fileinode() );
-/* No.of argumetns greater than expected */
+/* No.of arguments greater than expected */
var_dump( fileinode(__FILE__, "string") );
echo "\n*** Done ***";
diff --git a/ext/standard/tests/file/fseek_ftell_rewind_basic2-win32.phpt b/ext/standard/tests/file/fseek_ftell_rewind_basic2-win32.phpt
index 18ecf9a1dd..915ab0e558 100644
--- a/ext/standard/tests/file/fseek_ftell_rewind_basic2-win32.phpt
+++ b/ext/standard/tests/file/fseek_ftell_rewind_basic2-win32.phpt
@@ -52,7 +52,7 @@ foreach($file_content_types as $file_content_type){
fwrite($file_handle,(binary)$data_to_be_written);
// set file pointer to 0
- var_dump( rewind($file_handle) ); // set to begining of file
+ var_dump( rewind($file_handle) ); // set to beginning of file
var_dump( ftell($file_handle) );
foreach($whence_set as $whence){
diff --git a/ext/standard/tests/file/fseek_ftell_rewind_basic2.phpt b/ext/standard/tests/file/fseek_ftell_rewind_basic2.phpt
index 866009467a..63d0edd5a5 100644
--- a/ext/standard/tests/file/fseek_ftell_rewind_basic2.phpt
+++ b/ext/standard/tests/file/fseek_ftell_rewind_basic2.phpt
@@ -51,7 +51,7 @@ foreach($file_content_types as $file_content_type){
fwrite($file_handle,(binary)$data_to_be_written);
// set file pointer to 0
- var_dump( rewind($file_handle) ); // set to begining of file
+ var_dump( rewind($file_handle) ); // set to beginning of file
var_dump( ftell($file_handle) );
foreach($whence_set as $whence){
diff --git a/ext/standard/tests/file/fstat_variation1.phpt b/ext/standard/tests/file/fstat_variation1.phpt
index b2ad54196c..14b7b31c4b 100644
--- a/ext/standard/tests/file/fstat_variation1.phpt
+++ b/ext/standard/tests/file/fstat_variation1.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function fstat() by substituting agument 1 with array values.
+Test function fstat() by substituting argument 1 with array values.
--FILE--
<?php
$index_array = array(1, 2, 3);
diff --git a/ext/standard/tests/file/fstat_variation2.phpt b/ext/standard/tests/file/fstat_variation2.phpt
index fd62f23b60..6368c3b849 100644
--- a/ext/standard/tests/file/fstat_variation2.phpt
+++ b/ext/standard/tests/file/fstat_variation2.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function fstat() by substituting agument 1 with boolean values.
+Test function fstat() by substituting argument 1 with boolean values.
--FILE--
<?php
$variation_array = array(
diff --git a/ext/standard/tests/file/fstat_variation3.phpt b/ext/standard/tests/file/fstat_variation3.phpt
index 4cd74e3c14..59de1bbfc1 100644
--- a/ext/standard/tests/file/fstat_variation3.phpt
+++ b/ext/standard/tests/file/fstat_variation3.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function fstat() by substituting agument 1 with emptyUnsetUndefNull values.
+Test function fstat() by substituting argument 1 with emptyUnsetUndefNull values.
--FILE--
<?php
$unset_var = 10;
diff --git a/ext/standard/tests/file/fstat_variation4.phpt b/ext/standard/tests/file/fstat_variation4.phpt
index 16497760b8..dc2575f7d0 100644
--- a/ext/standard/tests/file/fstat_variation4.phpt
+++ b/ext/standard/tests/file/fstat_variation4.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function fstat() by substituting agument 1 with float values.
+Test function fstat() by substituting argument 1 with float values.
--FILE--
<?php
$variation_array = array(
diff --git a/ext/standard/tests/file/fstat_variation5.phpt b/ext/standard/tests/file/fstat_variation5.phpt
index ef4f4eaf3d..6f98da81e7 100644
--- a/ext/standard/tests/file/fstat_variation5.phpt
+++ b/ext/standard/tests/file/fstat_variation5.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function fstat() by substituting agument 1 with int values.
+Test function fstat() by substituting argument 1 with int values.
--FILE--
<?php
$variation_array = array (
diff --git a/ext/standard/tests/file/fstat_variation6.phpt b/ext/standard/tests/file/fstat_variation6.phpt
index 0789ff7a93..01f6d36199 100644
--- a/ext/standard/tests/file/fstat_variation6.phpt
+++ b/ext/standard/tests/file/fstat_variation6.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function fstat() by substituting agument 1 with object values.
+Test function fstat() by substituting argument 1 with object values.
--FILE--
<?php
diff --git a/ext/standard/tests/file/fstat_variation7.phpt b/ext/standard/tests/file/fstat_variation7.phpt
index 1f3f001b25..5a55dceb9a 100644
--- a/ext/standard/tests/file/fstat_variation7.phpt
+++ b/ext/standard/tests/file/fstat_variation7.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function fstat() by substituting agument 1 with string values.
+Test function fstat() by substituting argument 1 with string values.
--FILE--
<?php
$heredoc = <<<EOT
diff --git a/ext/standard/tests/mail/mail_include.inc b/ext/standard/tests/mail/mail_include.inc
index a0ff5e0c17..0785552e54 100644
--- a/ext/standard/tests/mail/mail_include.inc
+++ b/ext/standard/tests/mail/mail_include.inc
@@ -15,7 +15,7 @@ $mailbox_prefix = "phpttest"; // name used for test mailbox
* @para, string mailbox_suffix Suffix used to uniquely identify mailboxes
* @param int message_count number of test msgs to be written to new mailbox
*
- * @return IMAP stream to new mailbox on sucesss; FALSE on failure
+ * @return IMAP stream to new mailbox on success; FALSE on failure
*/
function setup_test_mailbox($mailbox_suffix, $message_count, &$new_mailbox = null, $msg_type = "simple"){
global $server, $default_mailbox, $username, $password;
diff --git a/ext/standard/tests/streams/bug64770.phpt b/ext/standard/tests/streams/bug64770.phpt
index ae738d83cd..785c4237a1 100644
--- a/ext/standard/tests/streams/bug64770.phpt
+++ b/ext/standard/tests/streams/bug64770.phpt
@@ -11,7 +11,8 @@ $descs = array(
$other_opts = array('suppress_errors' => false, 'binary_pipes' => true);
-$p = proc_open('dir', $descs, $pipes, '.', NULL, $other_opts);
+$cmd = (substr(PHP_OS, 0, 3) == 'WIN') ? 'dir' : 'ls';
+$p = proc_open($cmd, $descs, $pipes, '.', NULL, $other_opts);
if (is_resource($p)) {
$data = '';
diff --git a/ext/standard/tests/strings/addslashes_variation1.phpt b/ext/standard/tests/strings/addslashes_variation1.phpt
index cc245ae04b..6dfeb7e69b 100644
--- a/ext/standard/tests/strings/addslashes_variation1.phpt
+++ b/ext/standard/tests/strings/addslashes_variation1.phpt
@@ -79,7 +79,7 @@ $values = array (
// loop through each element of the array and check the working of addslashes()
-// when $str arugment is supplied with different values
+// when $str argument is supplied with different values
echo "\n--- Testing addslashes() by supplying different values for 'str' argument ---\n";
$counter = 1;
for($index = 0; $index < count($values); $index ++) {
diff --git a/ext/standard/tests/strings/bug36306.phpt b/ext/standard/tests/strings/bug36306.phpt
index 2d8449aac3..4527ea0edc 100644
--- a/ext/standard/tests/strings/bug36306.phpt
+++ b/ext/standard/tests/strings/bug36306.phpt
@@ -6,10 +6,10 @@ Bug #36306 (crc32() 64bit)
/* as an example how to write crc32 tests
PHP does not have uint values, you cannot
display crc32 like a signed integer.
- Have to find some small strings to truely reproduce
+ Have to find some small strings to truly reproduce
the problem, this example being not a problem
*/
-echo dechex(crc32("platform independant")) . "\n";
+echo dechex(crc32("platform independent")) . "\n";
?>
--EXPECT--
ccd9fe66
diff --git a/ext/standard/tests/strings/bug50847.phpt b/ext/standard/tests/strings/bug50847.phpt
index 28e83f5111..1f7081930e 100644
--- a/ext/standard/tests/strings/bug50847.phpt
+++ b/ext/standard/tests/strings/bug50847.phpt
@@ -1,5 +1,5 @@
--TEST--
-Bug #50847 (strip_tags() removes all tags greater then 1023 bytes long)
+Bug #50847 (strip_tags() removes all tags greater than 1023 bytes long)
--FILE--
<?php
$var = '<param value="' . str_repeat("a", 2048) . '" />';
diff --git a/ext/standard/tests/strings/bug64879.phpt b/ext/standard/tests/strings/bug64879.phpt
new file mode 100644
index 0000000000..1df90c6d85
--- /dev/null
+++ b/ext/standard/tests/strings/bug64879.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Bug #64879: quoted_printable_encode() wrong size calculation (CVE-2013-2110)
+--FILE--
+<?php
+
+quoted_printable_encode(str_repeat("\xf4", 1000));
+quoted_printable_encode(str_repeat("\xf4", 100000));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Done
diff --git a/ext/standard/tests/strings/chop_variation1.phpt b/ext/standard/tests/strings/chop_variation1.phpt
index de5ecd8164..bb5bca4ecf 100644
--- a/ext/standard/tests/strings/chop_variation1.phpt
+++ b/ext/standard/tests/strings/chop_variation1.phpt
@@ -82,7 +82,7 @@ $values = array (
// loop through each element of the array and check the working of chop()
-// when $str arugment is supplied with different values
+// when $str argument is supplied with different values
echo "\n--- Testing chop() by supplying different values for 'str' argument ---\n";
$counter = 1;
diff --git a/ext/standard/tests/strings/chop_variation2.phpt b/ext/standard/tests/strings/chop_variation2.phpt
index f0416e77bc..02d32306ec 100644
--- a/ext/standard/tests/strings/chop_variation2.phpt
+++ b/ext/standard/tests/strings/chop_variation2.phpt
@@ -82,7 +82,7 @@ $values = array (
// loop through each element of the array and check the working of chop()
-// when $charlist arugment is supplied with different values
+// when $charlist argument is supplied with different values
echo "\n--- Testing chop() by supplying different values for 'charlist' argument ---\n";
$counter = 1;
diff --git a/ext/standard/tests/strings/chunk_split_error.phpt b/ext/standard/tests/strings/chunk_split_error.phpt
index 9313b65b5b..341f04ffd3 100644
--- a/ext/standard/tests/strings/chunk_split_error.phpt
+++ b/ext/standard/tests/strings/chunk_split_error.phpt
@@ -10,7 +10,7 @@ Test chunk_split() function : error conditions
/*
* Testing error conditions of chunk_split() with zero arguments
-* and for more than expected number of argments
+* and for more than expected number of arguments
*/
echo "*** Testing chunk_split() : error conditions ***\n";
diff --git a/ext/standard/tests/strings/get_html_translation_table_variation1.phpt b/ext/standard/tests/strings/get_html_translation_table_variation1.phpt
index 7f7e229354..76d590c35b 100644
--- a/ext/standard/tests/strings/get_html_translation_table_variation1.phpt
+++ b/ext/standard/tests/strings/get_html_translation_table_variation1.phpt
@@ -65,7 +65,7 @@ $values = array (
// loop through each element of the array and check the working of get_html_translation_table()
-// when $table arugment is supplied with different values
+// when $table argument is supplied with different values
echo "\n--- Testing get_html_translation_table() by supplying different values for 'table' argument ---\n";
$counter = 1;
for($index = 0; $index < count($values); $index ++) {
diff --git a/ext/standard/tests/strings/get_html_translation_table_variation2.phpt b/ext/standard/tests/strings/get_html_translation_table_variation2.phpt
index b792a55545..ea42af996c 100644
--- a/ext/standard/tests/strings/get_html_translation_table_variation2.phpt
+++ b/ext/standard/tests/strings/get_html_translation_table_variation2.phpt
@@ -68,7 +68,7 @@ $values = array (
// loop through each element of the array and check the working of get_html_translation_table()
-// when $quote_style arugment is supplied with different values
+// when $quote_style argument is supplied with different values
echo "\n--- Testing get_html_translation_table() by supplying different values for 'quote_style' argument ---\n";
$counter = 1;
for($index = 0; $index < count($values); $index ++) {
diff --git a/ext/standard/tests/strings/htmlspecialchars_decode_variation3.phpt b/ext/standard/tests/strings/htmlspecialchars_decode_variation3.phpt
index b15307614a..b36556f1a2 100644
--- a/ext/standard/tests/strings/htmlspecialchars_decode_variation3.phpt
+++ b/ext/standard/tests/strings/htmlspecialchars_decode_variation3.phpt
@@ -30,7 +30,7 @@ $multiline_string = <<<EOT
&quot;This is a double quoted string&quot;
EOT;
-// heredoc with diferent whitespaces
+// heredoc with different whitespaces
$diff_whitespaces = <<<EOT
<html>Roy&#039;s height\r &gt; Sam\t&#039;s height
1111\t\t &amp; 0000\v\v = \f0000
diff --git a/ext/standard/tests/strings/join_variation1.phpt b/ext/standard/tests/strings/join_variation1.phpt
index 02bcf34406..e2635f05f8 100644
--- a/ext/standard/tests/strings/join_variation1.phpt
+++ b/ext/standard/tests/strings/join_variation1.phpt
@@ -84,7 +84,7 @@ $values = array (
// loop through each element of the array and check the working of join()
-// when $glue arugment is supplied with different values
+// when $glue argument is supplied with different values
echo "\n--- Testing join() by supplying different values for 'glue' argument ---\n";
$counter = 1;
for($index = 0; $index < count($values); $index ++) {
diff --git a/ext/standard/tests/strings/join_variation2.phpt b/ext/standard/tests/strings/join_variation2.phpt
index 50395f1764..46e91afd3b 100644
--- a/ext/standard/tests/strings/join_variation2.phpt
+++ b/ext/standard/tests/strings/join_variation2.phpt
@@ -82,7 +82,7 @@ $values = array (
// loop through each element of the array and check the working of join()
-// when $pieces arugment is supplied with different values
+// when $pieces argument is supplied with different values
echo "\n--- Testing join() by supplying different values for 'pieces' argument ---\n";
$counter = 1;
for($index = 0; $index < count($values); $index ++) {
diff --git a/ext/standard/tests/strings/setlocale_basic1.phpt b/ext/standard/tests/strings/setlocale_basic1.phpt
index 957357f6c1..c806e6fabf 100644
--- a/ext/standard/tests/strings/setlocale_basic1.phpt
+++ b/ext/standard/tests/strings/setlocale_basic1.phpt
@@ -14,7 +14,7 @@ if (setlocale(LC_ALL, "en_US.utf8", "en_AU.utf8", "ko_KR.utf8", "zh_CN.utf8", "d
/* Prototype : string setlocale (int $category , string $locale [,string $..] )
: string setlocale(int $category , array $locale);
* Description: Sets locale information.Returns the new current locale ,
- * or FALSE if locale functinality is not implemented in this platform.
+ * or FALSE if locale functionality is not implemented in this platform.
* Source code: ext/standard/string.c
*/
diff --git a/ext/standard/tests/strings/setlocale_basic2.phpt b/ext/standard/tests/strings/setlocale_basic2.phpt
index fe61b9b431..7204c45911 100644
--- a/ext/standard/tests/strings/setlocale_basic2.phpt
+++ b/ext/standard/tests/strings/setlocale_basic2.phpt
@@ -14,7 +14,7 @@ if (setlocale(LC_ALL, "en_US.utf8", "en_AU.utf8", "ko_KR.utf8", "zh_CN.utf8", "d
/* Prototype : string setlocale (int $category , string $locale [,string $..] )
: string setlocale(int $category , array $locale);
* Description: Sets locale information.Returns the new current locale , or FALSE
- if locale functinality is not implemented in this platform.
+ if locale functionality is not implemented in this platform.
* Source code: ext/standard/string.c
*/
diff --git a/ext/standard/tests/strings/setlocale_basic3.phpt b/ext/standard/tests/strings/setlocale_basic3.phpt
index 47917e34e4..997dad98e7 100644
--- a/ext/standard/tests/strings/setlocale_basic3.phpt
+++ b/ext/standard/tests/strings/setlocale_basic3.phpt
@@ -14,7 +14,7 @@ if (setlocale(LC_ALL, "en_US.utf8", "Ko_KR.utf8", "zh_CN.utf8") === false) {
/* Prototype : string setlocale (int $category , string $locale [,string $..] )
: string setlocale(int $category , array $locale);
* Description: Sets locale information.Returns the new current locale , or FALSE
- if locale functinality is not implemented in this platform.
+ if locale functionality is not implemented in this platform.
* Source code: ext/standard/string.c
*/
diff --git a/ext/standard/tests/strings/setlocale_error.phpt b/ext/standard/tests/strings/setlocale_error.phpt
index e3f3765fbf..361d00c584 100644
--- a/ext/standard/tests/strings/setlocale_error.phpt
+++ b/ext/standard/tests/strings/setlocale_error.phpt
@@ -12,7 +12,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
<?php
/* Prototype : string setlocale (int $category , string $locale [,string $..] )
: string setlocale(int $category , array $locale);
- * Description: Sets locale information.Returns the new current locale , or FALSE if locale functinality is not implemented in this platform.
+ * Description: Sets locale information.Returns the new current locale , or FALSE if locale functionality is not implemented in this platform.
* Source code: ext/standard/string.c
*/
diff --git a/ext/standard/tests/strings/setlocale_variation1.phpt b/ext/standard/tests/strings/setlocale_variation1.phpt
index 5e21d0b79f..04665b5455 100644
--- a/ext/standard/tests/strings/setlocale_variation1.phpt
+++ b/ext/standard/tests/strings/setlocale_variation1.phpt
@@ -14,7 +14,7 @@ if (setlocale(LC_ALL, "en_US.utf8", "Ko_KR.utf8", "zh_CN.utf8") === false) {
/* Prototype : string setlocale (int $category , string $locale [,string $..] )
: string setlocale(int $category , array $locale);
* Description: Sets locale information.Returns the new current locale , or FALSE
- if locale functinality is not implemented in this platform.
+ if locale functionality is not implemented in this platform.
* Source code: ext/standard/string.c
*/
diff --git a/ext/standard/tests/strings/setlocale_variation2.phpt b/ext/standard/tests/strings/setlocale_variation2.phpt
index af8739a767..038ba58c5e 100644
--- a/ext/standard/tests/strings/setlocale_variation2.phpt
+++ b/ext/standard/tests/strings/setlocale_variation2.phpt
@@ -11,7 +11,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
/* Prototype : string setlocale (int $category , string $locale [,string $..] )
: string setlocale(int $category , array $locale);
* Description: Sets locale information.Returns the new current locale , or FALSE
- if locale functinality is not implemented in this platform.
+ if locale functionality is not implemented in this platform.
* Source code: ext/standard/string.c
*/
diff --git a/ext/standard/tests/strings/setlocale_variation3.phpt b/ext/standard/tests/strings/setlocale_variation3.phpt
index 09d6c1186a..44cbe1bda7 100644
--- a/ext/standard/tests/strings/setlocale_variation3.phpt
+++ b/ext/standard/tests/strings/setlocale_variation3.phpt
@@ -14,7 +14,7 @@ if (setlocale(LC_ALL,'en_US.utf8') === false) {
/* Prototype : string setlocale (int $category , string $locale [,string $..] )
* : string setlocale(int $category , array $locale);
* Description: Sets locale information.Returns the new current locale , or FALSE
- * if locale functinality is not implemented in this platform.
+ * if locale functionality is not implemented in this platform.
* Source code: ext/standard/string.c
*/
diff --git a/ext/standard/tests/strings/setlocale_variation4.phpt b/ext/standard/tests/strings/setlocale_variation4.phpt
index 4ab1db7ad4..7b27c106d9 100644
--- a/ext/standard/tests/strings/setlocale_variation4.phpt
+++ b/ext/standard/tests/strings/setlocale_variation4.phpt
@@ -16,7 +16,7 @@ LC_ALL=en_US.utf8;
/* Prototype : string setlocale (int $category , string $locale [,string $..] )
* : string setlocale(int $category , array $locale);
* Description: Sets locale information.Returns the new current locale , or FALSE
- * if locale functinality is not implemented in this platform.
+ * if locale functionality is not implemented in this platform.
* Source code: ext/standard/string.c
*/
diff --git a/ext/standard/tests/strings/setlocale_variation5.phpt b/ext/standard/tests/strings/setlocale_variation5.phpt
index c8e947b09d..40eda3780b 100644
--- a/ext/standard/tests/strings/setlocale_variation5.phpt
+++ b/ext/standard/tests/strings/setlocale_variation5.phpt
@@ -16,7 +16,7 @@ LC_ALL=en_US.utf8;
/* Prototype : string setlocale (int $category , string $locale [,string $..] )
* : string setlocale(int $category , array $locale);
* Description: Sets locale information.Returns the new current locale , or FALSE
- * if locale functinality is not implemented in this platform.
+ * if locale functionality is not implemented in this platform.
* Source code: ext/standard/string.c
*/
diff --git a/ext/standard/tests/strings/strcspn_variation2.phpt b/ext/standard/tests/strings/strcspn_variation2.phpt
index cb7544c2a9..c21af6f256 100644
--- a/ext/standard/tests/strings/strcspn_variation2.phpt
+++ b/ext/standard/tests/strings/strcspn_variation2.phpt
@@ -15,7 +15,7 @@ error_reporting(E_ALL & ~E_NOTICE);
* Testing strcspn() : with different unexpected values for mask argument
*/
-echo "*** Testing strcspn() : with diferent unexpected values of mask argument ***\n";
+echo "*** Testing strcspn() : with different unexpected values of mask argument ***\n";
$str = 'string_val';
$start = 1;
@@ -102,7 +102,7 @@ fclose($file_handle);
echo "Done"
?>
--EXPECTF--
-*** Testing strcspn() : with diferent unexpected values of mask argument ***
+*** Testing strcspn() : with different unexpected values of mask argument ***
-- Iteration with mask value as "0" --
int(10)
diff --git a/ext/standard/tests/strings/strip_tags_variation5.phpt b/ext/standard/tests/strings/strip_tags_variation5.phpt
index 54601e9b65..20b5693905 100644
--- a/ext/standard/tests/strings/strip_tags_variation5.phpt
+++ b/ext/standard/tests/strings/strip_tags_variation5.phpt
@@ -33,7 +33,7 @@ $multiline_string = <<<EOT
<b>This is a double quoted string</b>
EOT;
-// here doc with diferent whitespaces
+// here doc with different whitespaces
$diff_whitespaces = <<<EOT
<html>hello\r world\t
1111\t\t != 2222\v\v</html>
diff --git a/ext/standard/tests/strings/stripcslashes_variation1.phpt b/ext/standard/tests/strings/stripcslashes_variation1.phpt
index 32c8963df7..a2754c6103 100644
--- a/ext/standard/tests/strings/stripcslashes_variation1.phpt
+++ b/ext/standard/tests/strings/stripcslashes_variation1.phpt
@@ -81,7 +81,7 @@ $values = array (
// loop through each element of the array and check the working of stripcslashes()
-// when $str arugment is supplied with different values
+// when $str argument is supplied with different values
echo "\n--- Testing stripcslashes() by supplying different values for 'str' argument ---\n";
$counter = 1;
for($index = 0; $index < count($values); $index ++) {
diff --git a/ext/standard/tests/strings/stripslashes_variation1.phpt b/ext/standard/tests/strings/stripslashes_variation1.phpt
index 5693a26efc..fb104199bd 100644
--- a/ext/standard/tests/strings/stripslashes_variation1.phpt
+++ b/ext/standard/tests/strings/stripslashes_variation1.phpt
@@ -80,7 +80,7 @@ $values = array (
// loop through each element of the array and check the working of stripslashes()
-// when $str arugment is supplied with different values
+// when $str argument is supplied with different values
echo "\n--- Testing stripslashes() by supplying different values for 'str' argument ---\n";
$counter = 1;
for($index = 0; $index < count($values); $index ++) {
diff --git a/ext/standard/tests/strings/strrchr_basic.phpt b/ext/standard/tests/strings/strrchr_basic.phpt
index f396834837..1d4e50efdf 100644
--- a/ext/standard/tests/strings/strrchr_basic.phpt
+++ b/ext/standard/tests/strings/strrchr_basic.phpt
@@ -30,7 +30,7 @@ var_dump( strrchr("Hello, World", "Hello, World") ); //needle as haystack
//needle string containing one existing and one non-existing char
var_dump( strrchr("Hello, World", "Hi") );
-//multiple existance of needle in haystack
+//multiple existence of needle in haystack
var_dump( strrchr("Hello, World", "o") );
var_dump( strrchr("Hello, World", "ooo") );
diff --git a/ext/standard/tests/strings/strspn_variation2.phpt b/ext/standard/tests/strings/strspn_variation2.phpt
index 7af61e559a..57929fa352 100644
--- a/ext/standard/tests/strings/strspn_variation2.phpt
+++ b/ext/standard/tests/strings/strspn_variation2.phpt
@@ -15,7 +15,7 @@ error_reporting(E_ALL & ~E_NOTICE);
* Testing strspn() : with different unexpected values for mask argument
*/
-echo "*** Testing strspn() : with diferent unexpected values of mask argument ***\n";
+echo "*** Testing strspn() : with different unexpected values of mask argument ***\n";
$str = 'string_val';
$start = 1;
@@ -102,7 +102,7 @@ fclose($file_handle);
echo "Done"
?>
--EXPECTF--
-*** Testing strspn() : with diferent unexpected values of mask argument ***
+*** Testing strspn() : with different unexpected values of mask argument ***
-- Iteration with mask value as "0" --
int(0)
diff --git a/ext/standard/tests/strings/strtok_variation1.phpt b/ext/standard/tests/strings/strtok_variation1.phpt
index b8febacfb9..cb06fc43c3 100644
--- a/ext/standard/tests/strings/strtok_variation1.phpt
+++ b/ext/standard/tests/strings/strtok_variation1.phpt
@@ -81,7 +81,7 @@ $values = array (
// loop through each element of the array and check the working of strtok()
-// when $str arugment is supplied with different values
+// when $str argument is supplied with different values
echo "\n--- Testing strtok() by supplying different values for 'str' argument ---\n";
$counter = 1;
diff --git a/ext/standard/tests/strings/strtok_variation2.phpt b/ext/standard/tests/strings/strtok_variation2.phpt
index 19a6f26fb5..13da440582 100644
--- a/ext/standard/tests/strings/strtok_variation2.phpt
+++ b/ext/standard/tests/strings/strtok_variation2.phpt
@@ -81,7 +81,7 @@ $values = array (
// loop through each element of the array and check the working of strtok()
-// when $token arugment is supplied with different values
+// when $token argument is supplied with different values
echo "\n--- Testing strtok() by supplying different values for 'token' argument ---\n";
$counter = 1;
diff --git a/ext/standard/tests/strings/trim1.phpt b/ext/standard/tests/strings/trim1.phpt
index b9323afbdf..dd52efd98e 100644
--- a/ext/standard/tests/strings/trim1.phpt
+++ b/ext/standard/tests/strings/trim1.phpt
Binary files differ
diff --git a/ext/standard/tests/strings/trim_error.phpt b/ext/standard/tests/strings/trim_error.phpt
index 092deb6dca..51dc848c9d 100644
--- a/ext/standard/tests/strings/trim_error.phpt
+++ b/ext/standard/tests/strings/trim_error.phpt
@@ -4,7 +4,7 @@ Test trim() function : error conditions
<?php
/* Prototype : string trim ( string $str [, string $charlist ] )
- * Description: Strip whitespace (or other characters) from the begining and end of a string.
+ * Description: Strip whitespace (or other characters) from the beginning and end of a string.
* Source code: ext/standard/string.c
*/
diff --git a/ext/standard/tests/strings/trim_variation1.phpt b/ext/standard/tests/strings/trim_variation1.phpt
index 625ec31824..4ef40c6801 100644
--- a/ext/standard/tests/strings/trim_variation1.phpt
+++ b/ext/standard/tests/strings/trim_variation1.phpt
@@ -4,7 +4,7 @@ Test trim() function : usage variations - test values for $str argument
<?php
/* Prototype : string trim ( string $str [, string $charlist ] )
- * Description: Strip whitespace (or other characters) from the begining and end of a string.
+ * Description: Strip whitespace (or other characters) from the beginning and end of a string.
* Source code: ext/standard/string.c
*/
diff --git a/ext/standard/tests/strings/trim_variation2.phpt b/ext/standard/tests/strings/trim_variation2.phpt
index 009d61b2df..11b2aaf1cc 100644
--- a/ext/standard/tests/strings/trim_variation2.phpt
+++ b/ext/standard/tests/strings/trim_variation2.phpt
@@ -4,7 +4,7 @@ Test trim() function : usage variations - test values for $charlist argument
<?php
/* Prototype : string trim ( string $str [, string $charlist ] )
- * Description: Strip whitespace (or other characters) from the begining and end of a string.
+ * Description: Strip whitespace (or other characters) from the beginning and end of a string.
* Source code: ext/standard/string.c
*/
diff --git a/ext/standard/tests/strings/ucwords_variation1.phpt b/ext/standard/tests/strings/ucwords_variation1.phpt
index 22c29163c4..02edf05131 100644
--- a/ext/standard/tests/strings/ucwords_variation1.phpt
+++ b/ext/standard/tests/strings/ucwords_variation1.phpt
@@ -94,7 +94,7 @@ $values = array (
);
// loop through each element of the array and check the working of ucwords()
-// when $str arugment is supplied with different values
+// when $str argument is supplied with different values
echo "\n--- Testing ucwords() by supplying different values for 'str' argument ---\n";
$counter = 1;
for($index = 0; $index < count($values); $index ++) {
diff --git a/ext/standard/tests/strings/ucwords_variation2.phpt b/ext/standard/tests/strings/ucwords_variation2.phpt
index ab6eb2f45c..4c24d97a0d 100644
--- a/ext/standard/tests/strings/ucwords_variation2.phpt
+++ b/ext/standard/tests/strings/ucwords_variation2.phpt
@@ -29,7 +29,7 @@ multiline string using
heredoc
EOT;
-// here doc with diferent whitespaces
+// here doc with different whitespaces
$diff_whitespaces = <<<EOT
testing\rucword(str)\twith
multiline string\t\tusing
diff --git a/ext/standard/tests/strings/wordwrap_variation1.phpt b/ext/standard/tests/strings/wordwrap_variation1.phpt
index d13e7dee2d..28fc128bb7 100644
--- a/ext/standard/tests/strings/wordwrap_variation1.phpt
+++ b/ext/standard/tests/strings/wordwrap_variation1.phpt
@@ -75,7 +75,7 @@ $values = array (
);
// loop though each element of the array and check the working of wordwrap()
-// when $str arugment is supplied with different values
+// when $str argument is supplied with different values
echo "\n--- Testing wordwrap() by supplying different values for 'str' argument ---\n";
$counter = 1;
for($index = 0; $index < count($values); $index ++) {
diff --git a/ext/standard/tests/strings/wordwrap_variation2.phpt b/ext/standard/tests/strings/wordwrap_variation2.phpt
index 2718791943..b914a2a815 100644
--- a/ext/standard/tests/strings/wordwrap_variation2.phpt
+++ b/ext/standard/tests/strings/wordwrap_variation2.phpt
@@ -73,7 +73,7 @@ $values = array (
// loop though each element of the array and check the working of wordwrap()
-// when $width arugment is supplied with different values
+// when $width argument is supplied with different values
echo "\n--- Testing wordwrap() by supplying different values for 'width' argument ---\n";
$counter = 1;
for($index = 0; $index < count($values); $index ++) {
diff --git a/ext/standard/tests/strings/wordwrap_variation3.phpt b/ext/standard/tests/strings/wordwrap_variation3.phpt
index 7d0c816707..ddf04c77c9 100644
--- a/ext/standard/tests/strings/wordwrap_variation3.phpt
+++ b/ext/standard/tests/strings/wordwrap_variation3.phpt
@@ -75,7 +75,7 @@ $values = array (
);
// loop though each element of the array and check the working of wordwrap()
-// when $break arugment is supplied with different values
+// when $break argument is supplied with different values
echo "\n--- Testing wordwrap() by supplying different values for 'break' argument ---\n";
$counter = 1;
for($index = 0; $index < count($values); $index ++) {
diff --git a/ext/standard/tests/strings/wordwrap_variation4.phpt b/ext/standard/tests/strings/wordwrap_variation4.phpt
index 440e93740a..7111f2d2ba 100644
--- a/ext/standard/tests/strings/wordwrap_variation4.phpt
+++ b/ext/standard/tests/strings/wordwrap_variation4.phpt
@@ -66,7 +66,7 @@ $values = array (
);
// loop though each element of the array and check the working of wordwrap()
-// when $cut arugment is supplied with different values
+// when $cut argument is supplied with different values
echo "\n--- Testing wordwrap() by supplying different values for 'cut' argument ---\n";
$counter = 1;
for($index = 0; $index < count($values); $index ++) {
diff --git a/ext/standard/user_filters.c b/ext/standard/user_filters.c
index b009e67aa1..b44be124a1 100644
--- a/ext/standard/user_filters.c
+++ b/ext/standard/user_filters.c
@@ -474,7 +474,7 @@ static void php_stream_bucket_attach(int append, INTERNAL_FUNCTION_PARAMETERS)
} else {
php_stream_bucket_prepend(brigade, bucket TSRMLS_CC);
}
- /* This is a hack necessary to accomodate situations where bucket is appended to the stream
+ /* This is a hack necessary to accommodate situations where bucket is appended to the stream
* multiple times. See bug35916.phpt for reference.
*/
if (bucket->refcount == 1) {
diff --git a/ext/standard/uuencode.c b/ext/standard/uuencode.c
index f0142ed049..76701ff24b 100644
--- a/ext/standard/uuencode.c
+++ b/ext/standard/uuencode.c
@@ -70,7 +70,7 @@ PHPAPI int php_uuencode(char *src, int src_len, char **dest) /* {{{ */
int len = 45;
char *p, *s, *e, *ee;
- /* encoded length is ~ 38% greater then the original */
+ /* encoded length is ~ 38% greater than the original */
p = *dest = safe_emalloc((size_t) ceil(src_len * 1.38), 1, 46);
s = src;
e = src + src_len;
diff --git a/ext/sysvmsg/sysvmsg.c b/ext/sysvmsg/sysvmsg.c
index e268047b69..a57e25e6c3 100644
--- a/ext/sysvmsg/sysvmsg.c
+++ b/ext/sysvmsg/sysvmsg.c
@@ -228,7 +228,7 @@ PHP_FUNCTION(msg_stat_queue)
/* {{{ proto bool msg_queue_exists(int key)
- Check wether a message queue exists */
+ Check whether a message queue exists */
PHP_FUNCTION(msg_queue_exists)
{
long key;
diff --git a/ext/sysvsem/tests/sysv.phpt b/ext/sysvsem/tests/sysv.phpt
index 3a962be31a..6f52f3bd7e 100644
--- a/ext/sysvsem/tests/sysv.phpt
+++ b/ext/sysvsem/tests/sysv.phpt
@@ -23,11 +23,11 @@ echo "Got semaphore $sem_id.\n";
// Accuire semaphore
if (! sem_acquire($sem_id)) {
- echo "Fail to aquire semaphore $sem_id.\n";
+ echo "Fail to acquire semaphore $sem_id.\n";
sem_remove($sem_id);
exit;
}
-echo "Success aquire semaphore $sem_id.\n";
+echo "Success acquire semaphore $sem_id.\n";
$shm_id = shm_attach($SHMKEY, $MEMSIZE);
if ($shm_id === FALSE) {
@@ -100,7 +100,7 @@ echo "End.\n";
--EXPECTF--
Start.
Got semaphore Resource id #%i.
-Success aquire semaphore Resource id #%i.
+Success acquire semaphore Resource id #%i.
Success to attach shared memory : %s.
Write var1 to shared memory.
Write var2 to shared memory.
diff --git a/ext/xmlreader/php_xmlreader.c b/ext/xmlreader/php_xmlreader.c
index 314be4529f..f4c2643212 100644
--- a/ext/xmlreader/php_xmlreader.c
+++ b/ext/xmlreader/php_xmlreader.c
@@ -708,7 +708,7 @@ PHP_METHOD(xmlreader, moveToAttribute)
/* }}} */
/* {{{ proto boolean XMLReader::moveToAttributeNo(int index)
-Positions reader at attribute at spcecified index.
+Positions reader at attribute at specified index.
Returns TRUE on success and FALSE on failure */
PHP_METHOD(xmlreader, moveToAttributeNo)
{
@@ -805,7 +805,7 @@ PHP_METHOD(xmlreader, read)
if (intern != NULL && intern->ptr != NULL) {
retval = xmlTextReaderRead(intern->ptr);
if (retval == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An Error Occured while reading");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "An Error Occurred while reading");
RETURN_FALSE;
} else {
RETURN_BOOL(retval);
@@ -847,7 +847,7 @@ PHP_METHOD(xmlreader, next)
retval = xmlTextReaderNext(intern->ptr);
}
if (retval == -1) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An Error Occured while reading");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "An Error Occurred while reading");
RETURN_FALSE;
} else {
RETURN_BOOL(retval);
@@ -1155,7 +1155,7 @@ PHP_METHOD(xmlreader, expand)
node = xmlTextReaderExpand(intern->ptr);
if (node == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "An Error Occured while expanding ");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "An Error Occurred while expanding ");
RETURN_FALSE;
} else {
nodec = xmlDocCopyNode(node, docp, 1);
diff --git a/ext/xmlrpc/libxmlrpc/simplestring.c b/ext/xmlrpc/libxmlrpc/simplestring.c
index 7211d2cd94..a084d0e64f 100644
--- a/ext/xmlrpc/libxmlrpc/simplestring.c
+++ b/ext/xmlrpc/libxmlrpc/simplestring.c
@@ -66,7 +66,7 @@ static const char rcsid[] = "#(@) $Id$";
*
* simplestring is, as the name implies, a simple API for dealing with C strings.
* Why would I write yet another string API? Because I couldn't find any that were
- * a) free / GPL, b) simple/lightweight, c) fast, not doing unneccesary strlens all
+ * a) free / GPL, b) simple/lightweight, c) fast, not doing unnecessary strlens all
* over the place. So. It is simple, and it seems to work, and it is pretty fast.
*
* Oh, and it is also binary safe, ie it can handle strings with embedded NULLs,
diff --git a/ext/xmlrpc/libxmlrpc/xmlrpc.c b/ext/xmlrpc/libxmlrpc/xmlrpc.c
index ec2321b347..ce70c2afd9 100644
--- a/ext/xmlrpc/libxmlrpc/xmlrpc.c
+++ b/ext/xmlrpc/libxmlrpc/xmlrpc.c
@@ -897,7 +897,7 @@ const char *XMLRPC_SetValueID_Case(XMLRPC_VALUE value, const char* id, int len,
(len > 0) ? simplestring_addn(&value->id, id, len) :
simplestring_add(&value->id, id);
- /* upper or lower case string in place if required. could be a seperate func. */
+ /* upper or lower case string in place if required. could be a separate func. */
if(id_case == xmlrpc_case_lower || id_case == xmlrpc_case_upper) {
int i;
for(i = 0; i < value->id.len; i++) {
@@ -1609,7 +1609,7 @@ XMLRPC_VALUE XMLRPC_CopyValue(XMLRPC_VALUE value) {
* XMLRPC_CopyValue ()
* NOTES
* Use this when function when you need to modify the contents of
- * the copied value seperately from the original.
+ * the copied value separately from the original.
*
* this function is recursive, thus the value and all of its children
* (if any) will be duplicated.
diff --git a/ext/zip/lib/zip_open.c b/ext/zip/lib/zip_open.c
index 2f56881b0a..5ce1c1070a 100644
--- a/ext/zip/lib/zip_open.c
+++ b/ext/zip/lib/zip_open.c
@@ -348,7 +348,7 @@ _zip_checkcons(FILE *fp, struct zip_cdir *cd, struct zip_error *error)
/* _zip_check_torrentzip:
- check wether ZA has a valid TORRENTZIP comment, i.e. is torrentzipped */
+ check whether ZA has a valid TORRENTZIP comment, i.e. is torrentzipped */
static void
_zip_check_torrentzip(struct zip *za)
diff --git a/ext/zip/tests/bug64342_0.phpt b/ext/zip/tests/bug64342_0.phpt
index 066d3e6fc2..ea7afa8e0a 100644
--- a/ext/zip/tests/bug64342_0.phpt
+++ b/ext/zip/tests/bug64342_0.phpt
@@ -1,5 +1,5 @@
--TEST--
-Bug #64342 ZipArchive::addFile() has to check file existance (variation 1)
+Bug #64342 ZipArchive::addFile() has to check file existence (variation 1)
--SKIPIF--
<?php
if(!extension_loaded('zip')) die('skip');
diff --git a/ext/zip/tests/bug64342_1.phpt b/ext/zip/tests/bug64342_1.phpt
index 2b1357d12f..06b0b92cab 100644
--- a/ext/zip/tests/bug64342_1.phpt
+++ b/ext/zip/tests/bug64342_1.phpt
@@ -1,5 +1,5 @@
--TEST--
-Bug #64342 ZipArchive::addFile() has to check file existance (variation 2)
+Bug #64342 ZipArchive::addFile() has to check file existence (variation 2)
--SKIPIF--
<?php
/* $Id$ */
diff --git a/ext/zlib/tests/gzfile_variation1.phpt b/ext/zlib/tests/gzfile_variation1.phpt
index 767abb7e30..131170b4b7 100644
--- a/ext/zlib/tests/gzfile_variation1.phpt
+++ b/ext/zlib/tests/gzfile_variation1.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function gzfile() by substituting agument 1 with array values.
+Test function gzfile() by substituting argument 1 with array values.
--SKIPIF--
<?php
if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
diff --git a/ext/zlib/tests/gzfile_variation10.phpt b/ext/zlib/tests/gzfile_variation10.phpt
index 2a6d8915d0..20de8cb535 100644
--- a/ext/zlib/tests/gzfile_variation10.phpt
+++ b/ext/zlib/tests/gzfile_variation10.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function gzfile() by substituting agument 2 with emptyUnsetUndefNull values.
+Test function gzfile() by substituting argument 2 with emptyUnsetUndefNull values.
--SKIPIF--
<?php
if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
diff --git a/ext/zlib/tests/gzfile_variation11.phpt b/ext/zlib/tests/gzfile_variation11.phpt
index 02faa4501f..a3585e5420 100644
--- a/ext/zlib/tests/gzfile_variation11.phpt
+++ b/ext/zlib/tests/gzfile_variation11.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function gzfile() by substituting agument 2 with float values.
+Test function gzfile() by substituting argument 2 with float values.
--SKIPIF--
<?php
if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
diff --git a/ext/zlib/tests/gzfile_variation12.phpt b/ext/zlib/tests/gzfile_variation12.phpt
index a8efc7616c..be28f01681 100644
--- a/ext/zlib/tests/gzfile_variation12.phpt
+++ b/ext/zlib/tests/gzfile_variation12.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function gzfile() by substituting agument 2 with int values.
+Test function gzfile() by substituting argument 2 with int values.
--SKIPIF--
<?php
if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
diff --git a/ext/zlib/tests/gzfile_variation13.phpt b/ext/zlib/tests/gzfile_variation13.phpt
index 8014d7d9d9..4198c474df 100644
--- a/ext/zlib/tests/gzfile_variation13.phpt
+++ b/ext/zlib/tests/gzfile_variation13.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function gzfile() by substituting agument 2 with object values.
+Test function gzfile() by substituting argument 2 with object values.
--SKIPIF--
<?php
if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
diff --git a/ext/zlib/tests/gzfile_variation14.phpt b/ext/zlib/tests/gzfile_variation14.phpt
index 8eb183c1c8..7462bea809 100644
--- a/ext/zlib/tests/gzfile_variation14.phpt
+++ b/ext/zlib/tests/gzfile_variation14.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function gzfile() by substituting agument 2 with string values.
+Test function gzfile() by substituting argument 2 with string values.
--SKIPIF--
<?php
if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
diff --git a/ext/zlib/tests/gzfile_variation2.phpt b/ext/zlib/tests/gzfile_variation2.phpt
index 2f75c7f81a..ba487435cd 100644
--- a/ext/zlib/tests/gzfile_variation2.phpt
+++ b/ext/zlib/tests/gzfile_variation2.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function gzfile() by substituting agument 1 with boolean values.
+Test function gzfile() by substituting argument 1 with boolean values.
--SKIPIF--
<?php
if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
diff --git a/ext/zlib/tests/gzfile_variation3.phpt b/ext/zlib/tests/gzfile_variation3.phpt
index 8a6f2cec2c..cf4520d412 100644
--- a/ext/zlib/tests/gzfile_variation3.phpt
+++ b/ext/zlib/tests/gzfile_variation3.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function gzfile() by substituting agument 1 with emptyUnsetUndefNull values.
+Test function gzfile() by substituting argument 1 with emptyUnsetUndefNull values.
--SKIPIF--
<?php
if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
diff --git a/ext/zlib/tests/gzfile_variation4.phpt b/ext/zlib/tests/gzfile_variation4.phpt
index b3c8ac483c..3310231566 100644
--- a/ext/zlib/tests/gzfile_variation4.phpt
+++ b/ext/zlib/tests/gzfile_variation4.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function gzfile() by substituting agument 1 with float values.
+Test function gzfile() by substituting argument 1 with float values.
--SKIPIF--
<?php
if (!extension_loaded(zlib)) die ('skip zlib extension not available in this build');
diff --git a/ext/zlib/tests/gzfile_variation5.phpt b/ext/zlib/tests/gzfile_variation5.phpt
index 5e210b653f..6a874a5786 100644
--- a/ext/zlib/tests/gzfile_variation5.phpt
+++ b/ext/zlib/tests/gzfile_variation5.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function gzfile() by substituting agument 1 with int values.
+Test function gzfile() by substituting argument 1 with int values.
--SKIPIF--
<?php
if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
diff --git a/ext/zlib/tests/gzfile_variation6.phpt b/ext/zlib/tests/gzfile_variation6.phpt
index 1ce1be6591..64168180fc 100644
--- a/ext/zlib/tests/gzfile_variation6.phpt
+++ b/ext/zlib/tests/gzfile_variation6.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function gzfile() by substituting agument 1 with object values.
+Test function gzfile() by substituting argument 1 with object values.
--SKIPIF--
<?php
if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
diff --git a/ext/zlib/tests/gzfile_variation7.phpt b/ext/zlib/tests/gzfile_variation7.phpt
index b441dd670e..c9dd298269 100644
--- a/ext/zlib/tests/gzfile_variation7.phpt
+++ b/ext/zlib/tests/gzfile_variation7.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function gzfile() by substituting agument 1 with string values.
+Test function gzfile() by substituting argument 1 with string values.
--SKIPIF--
<?php
if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
diff --git a/ext/zlib/tests/gzfile_variation8.phpt b/ext/zlib/tests/gzfile_variation8.phpt
index 32d969326c..50d042218c 100644
--- a/ext/zlib/tests/gzfile_variation8.phpt
+++ b/ext/zlib/tests/gzfile_variation8.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function gzfile() by substituting agument 2 with array values.
+Test function gzfile() by substituting argument 2 with array values.
--SKIPIF--
<?php
if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
diff --git a/ext/zlib/tests/gzfile_variation9.phpt b/ext/zlib/tests/gzfile_variation9.phpt
index c2c24ae26c..3675dcbef9 100644
--- a/ext/zlib/tests/gzfile_variation9.phpt
+++ b/ext/zlib/tests/gzfile_variation9.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function gzfile() by substituting agument 2 with boolean values.
+Test function gzfile() by substituting argument 2 with boolean values.
--SKIPIF--
<?php
if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
diff --git a/ext/zlib/tests/readgzfile_variation1.phpt b/ext/zlib/tests/readgzfile_variation1.phpt
index e31824ce1f..5a5ec4f6e7 100644
--- a/ext/zlib/tests/readgzfile_variation1.phpt
+++ b/ext/zlib/tests/readgzfile_variation1.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function readgzfile() by substituting agument 1 with array values.
+Test function readgzfile() by substituting argument 1 with array values.
--SKIPIF--
<?php
if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
diff --git a/ext/zlib/tests/readgzfile_variation10.phpt b/ext/zlib/tests/readgzfile_variation10.phpt
index 29249a1f2b..bc6cc5b452 100644
--- a/ext/zlib/tests/readgzfile_variation10.phpt
+++ b/ext/zlib/tests/readgzfile_variation10.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function readgzfile() by substituting agument 2 with emptyUnsetUndefNull values.
+Test function readgzfile() by substituting argument 2 with emptyUnsetUndefNull values.
--SKIPIF--
<?php
if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
diff --git a/ext/zlib/tests/readgzfile_variation11.phpt b/ext/zlib/tests/readgzfile_variation11.phpt
index 4023211ff1..01dc78721d 100644
--- a/ext/zlib/tests/readgzfile_variation11.phpt
+++ b/ext/zlib/tests/readgzfile_variation11.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function readgzfile() by substituting agument 2 with float values.
+Test function readgzfile() by substituting argument 2 with float values.
--SKIPIF--
<?php
if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
diff --git a/ext/zlib/tests/readgzfile_variation12.phpt b/ext/zlib/tests/readgzfile_variation12.phpt
index 8c291a4f46..06486acdd0 100644
--- a/ext/zlib/tests/readgzfile_variation12.phpt
+++ b/ext/zlib/tests/readgzfile_variation12.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function readgzfile() by substituting agument 2 with int values.
+Test function readgzfile() by substituting argument 2 with int values.
--SKIPIF--
<?php
if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
diff --git a/ext/zlib/tests/readgzfile_variation13.phpt b/ext/zlib/tests/readgzfile_variation13.phpt
index 117860eb40..db1bd892a5 100644
--- a/ext/zlib/tests/readgzfile_variation13.phpt
+++ b/ext/zlib/tests/readgzfile_variation13.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function readgzfile() by substituting agument 2 with object values.
+Test function readgzfile() by substituting argument 2 with object values.
--SKIPIF--
<?php
if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
diff --git a/ext/zlib/tests/readgzfile_variation14.phpt b/ext/zlib/tests/readgzfile_variation14.phpt
index ee0d6d6d4e..90081a9465 100644
--- a/ext/zlib/tests/readgzfile_variation14.phpt
+++ b/ext/zlib/tests/readgzfile_variation14.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function readgzfile() by substituting agument 2 with string values.
+Test function readgzfile() by substituting argument 2 with string values.
--SKIPIF--
<?php
if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
diff --git a/ext/zlib/tests/readgzfile_variation2.phpt b/ext/zlib/tests/readgzfile_variation2.phpt
index 367cc401b3..53a9f3e31e 100644
--- a/ext/zlib/tests/readgzfile_variation2.phpt
+++ b/ext/zlib/tests/readgzfile_variation2.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function readgzfile() by substituting agument 1 with boolean values.
+Test function readgzfile() by substituting argument 1 with boolean values.
--SKIPIF--
<?php
if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
diff --git a/ext/zlib/tests/readgzfile_variation3.phpt b/ext/zlib/tests/readgzfile_variation3.phpt
index 6645d67b7a..8afb16946e 100644
--- a/ext/zlib/tests/readgzfile_variation3.phpt
+++ b/ext/zlib/tests/readgzfile_variation3.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function readgzfile() by substituting agument 1 with emptyUnsetUndefNull values.
+Test function readgzfile() by substituting argument 1 with emptyUnsetUndefNull values.
--SKIPIF--
<?php
if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
diff --git a/ext/zlib/tests/readgzfile_variation4.phpt b/ext/zlib/tests/readgzfile_variation4.phpt
index ece84a990e..00211f7dfe 100644
--- a/ext/zlib/tests/readgzfile_variation4.phpt
+++ b/ext/zlib/tests/readgzfile_variation4.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function readgzfile() by substituting agument 1 with float values.
+Test function readgzfile() by substituting argument 1 with float values.
--SKIPIF--
<?php
if (!extension_loaded(zlib)) die ('skip zlib extension not available in this build');
diff --git a/ext/zlib/tests/readgzfile_variation5.phpt b/ext/zlib/tests/readgzfile_variation5.phpt
index 460e188930..2aa83fde3b 100644
--- a/ext/zlib/tests/readgzfile_variation5.phpt
+++ b/ext/zlib/tests/readgzfile_variation5.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function readgzfile() by substituting agument 1 with int values.
+Test function readgzfile() by substituting argument 1 with int values.
--SKIPIF--
<?php
if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
diff --git a/ext/zlib/tests/readgzfile_variation6.phpt b/ext/zlib/tests/readgzfile_variation6.phpt
index 69a4dc190a..702f91850e 100644
--- a/ext/zlib/tests/readgzfile_variation6.phpt
+++ b/ext/zlib/tests/readgzfile_variation6.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function readgzfile() by substituting agument 1 with object values.
+Test function readgzfile() by substituting argument 1 with object values.
--SKIPIF--
<?php
if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
diff --git a/ext/zlib/tests/readgzfile_variation7.phpt b/ext/zlib/tests/readgzfile_variation7.phpt
index 20162b5cb5..f4abdac9b5 100644
--- a/ext/zlib/tests/readgzfile_variation7.phpt
+++ b/ext/zlib/tests/readgzfile_variation7.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function readgzfile() by substituting agument 1 with string values.
+Test function readgzfile() by substituting argument 1 with string values.
--SKIPIF--
<?php
if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
diff --git a/ext/zlib/tests/readgzfile_variation8.phpt b/ext/zlib/tests/readgzfile_variation8.phpt
index 2e155288fa..291b69efcf 100644
--- a/ext/zlib/tests/readgzfile_variation8.phpt
+++ b/ext/zlib/tests/readgzfile_variation8.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function readgzfile() by substituting agument 2 with array values.
+Test function readgzfile() by substituting argument 2 with array values.
--SKIPIF--
<?php
if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
diff --git a/ext/zlib/tests/readgzfile_variation9.phpt b/ext/zlib/tests/readgzfile_variation9.phpt
index 5cdb5b5da5..d90058f8d2 100644
--- a/ext/zlib/tests/readgzfile_variation9.phpt
+++ b/ext/zlib/tests/readgzfile_variation9.phpt
@@ -1,5 +1,5 @@
--TEST--
-Test function readgzfile() by substituting agument 2 with boolean values.
+Test function readgzfile() by substituting argument 2 with boolean values.
--SKIPIF--
<?php
if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
diff --git a/main/main.c b/main/main.c
index 7a253f8b23..c0db64d184 100644
--- a/main/main.c
+++ b/main/main.c
@@ -2070,6 +2070,8 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
EG(exception_class) = NULL;
PG(disable_functions) = NULL;
PG(disable_classes) = NULL;
+ EG(exception) = NULL;
+ EG(objects_store).object_buckets = NULL;
#if HAVE_SETLOCALE
setlocale(LC_CTYPE, "");
diff --git a/main/php_version.h b/main/php_version.h
index cb6d7441d9..055d14d6bf 100644
--- a/main/php_version.h
+++ b/main/php_version.h
@@ -2,7 +2,7 @@
/* edit configure.in to change version number */
#define PHP_MAJOR_VERSION 5
#define PHP_MINOR_VERSION 4
-#define PHP_RELEASE_VERSION 16
+#define PHP_RELEASE_VERSION 17
#define PHP_EXTRA_VERSION "-dev"
-#define PHP_VERSION "5.4.16-dev"
-#define PHP_VERSION_ID 50416
+#define PHP_VERSION "5.4.17-dev"
+#define PHP_VERSION_ID 50417
diff --git a/main/rfc1867.c b/main/rfc1867.c
index 35a1a15956..b9007f2cb8 100644
--- a/main/rfc1867.c
+++ b/main/rfc1867.c
@@ -62,7 +62,7 @@ static void safe_php_register_variable(char *var, char *strval, int val_len, zva
#define MAX_SIZE_ANONNAME 33
/* Errors */
-#define UPLOAD_ERROR_OK 0 /* File upload succesful */
+#define UPLOAD_ERROR_OK 0 /* File upload successful */
#define UPLOAD_ERROR_A 1 /* Uploaded file exceeded upload_max_filesize */
#define UPLOAD_ERROR_B 2 /* Uploaded file exceeded MAX_FILE_SIZE */
#define UPLOAD_ERROR_C 3 /* Partially uploaded */
diff --git a/main/streams/cast.c b/main/streams/cast.c
index 878b4b52e7..da6a293e45 100644
--- a/main/streams/cast.c
+++ b/main/streams/cast.c
@@ -31,10 +31,18 @@
/* Under BSD, emulate fopencookie using funopen */
#if defined(HAVE_FUNOPEN) && !defined(HAVE_FOPENCOOKIE)
+
+/* NetBSD 6.0+ uses off_t instead of fpos_t in funopen */
+# if defined(__NetBSD__) && (__NetBSD_Version__ > 600000000)
+# define PHP_FPOS_T off_t
+# else
+# define PHP_FPOS_T fpos_t
+# endif
+
typedef struct {
int (*reader)(void *, char *, int);
int (*writer)(void *, const char *, int);
- fpos_t (*seeker)(void *, fpos_t, int);
+ PHP_FPOS_T (*seeker)(void *, PHP_FPOS_T, int);
int (*closer)(void *);
} COOKIE_IO_FUNCTIONS_T;
@@ -68,11 +76,11 @@ static int stream_cookie_writer(void *cookie, const char *buffer, int size)
return php_stream_write((php_stream *)cookie, (char *)buffer, size);
}
-static fpos_t stream_cookie_seeker(void *cookie, off_t position, int whence)
+static PHP_FPOS_T stream_cookie_seeker(void *cookie, off_t position, int whence)
{
TSRMLS_FETCH();
- return (fpos_t)php_stream_seek((php_stream *)cookie, position, whence);
+ return (PHP_FPOS_T)php_stream_seek((php_stream *)cookie, position, whence);
}
static int stream_cookie_closer(void *cookie)
diff --git a/main/streams/xp_socket.c b/main/streams/xp_socket.c
index beffc73e10..a9c050f267 100644
--- a/main/streams/xp_socket.c
+++ b/main/streams/xp_socket.c
@@ -194,7 +194,7 @@ static int php_sockop_close(php_stream *stream, int close_handle TSRMLS_DC)
* Essentially, we are waiting for the socket to become writeable, which means
* that all pending data has been sent.
* We use a small timeout which should encourage the OS to send the data,
- * but at the same time avoid hanging indefintely.
+ * but at the same time avoid hanging indefinitely.
* */
do {
n = php_pollfd_for_ms(sock->socket, POLLOUT, 500);
diff --git a/run-tests.php b/run-tests.php
index a746c36965..830dcd759b 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -679,7 +679,7 @@ Options:
-d foo=bar Pass -d option to the php binary (Define INI entry foo
with value 'bar').
- -g Comma seperated list of groups to show during test run
+ -g Comma separated list of groups to show during test run
(possible values: PASS, FAIL, XFAIL, SKIP, BORK, WARN, LEAK, REDIRECT).
-m Test for memory leaks with Valgrind.
diff --git a/sapi/apache/mod_php5.c b/sapi/apache/mod_php5.c
index 11be0ed222..8361f7f410 100644
--- a/sapi/apache/mod_php5.c
+++ b/sapi/apache/mod_php5.c
@@ -130,7 +130,7 @@ static int sapi_apache_read_post(char *buffer, uint count_bytes TSRMLS_DC)
/*
* This handles the situation where the browser sends a Expect: 100-continue header
- * and needs to recieve confirmation from the server on whether or not it can send
+ * and needs to receive confirmation from the server on whether or not it can send
* the rest of the request. RFC 2616
*
*/
diff --git a/sapi/apache2filter/README b/sapi/apache2filter/README
index 3054e208d3..bd6eb17066 100644
--- a/sapi/apache2filter/README
+++ b/sapi/apache2filter/README
@@ -54,7 +54,7 @@ HOW TO CONFIGURE
DEBUGGING APACHE AND PHP
- To debug Apache, we recommened:
+ To debug Apache, we recommend:
1. Use the Prefork MPM (Apache 1.3-like process model) by
configuring Apache with '--with-mpm=prefork'.
diff --git a/sapi/apache2handler/README b/sapi/apache2handler/README
index 5cbd1b95dd..4defa336c6 100644
--- a/sapi/apache2handler/README
+++ b/sapi/apache2handler/README
@@ -58,7 +58,7 @@ HOW TO CONFIGURE
DEBUGGING APACHE AND PHP
- To debug Apache, we recommened:
+ To debug Apache, we recommend:
1. Use the Prefork MPM (Apache 1.3-like process model) by
configuring Apache with '--with-mpm=prefork'.
diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c
index bcb2443112..b7f95e0c12 100644
--- a/sapi/apache2handler/sapi_apache2.c
+++ b/sapi/apache2handler/sapi_apache2.c
@@ -632,7 +632,7 @@ zend_first_try {
}
/*
- * check if comming due to ErrorDocument
+ * check if coming due to ErrorDocument
* We make a special exception of 413 (Invalid POST request) as the invalidity of the request occurs
* during processing of the request by PHP during POST processing. Therefor we need to re-use the exiting
* PHP instance to handle the request rather then creating a new one.
diff --git a/sapi/apache_hooks/mod_php5.c b/sapi/apache_hooks/mod_php5.c
index dda6e49891..66adb482ed 100644
--- a/sapi/apache_hooks/mod_php5.c
+++ b/sapi/apache_hooks/mod_php5.c
@@ -275,7 +275,7 @@ static int sapi_apache_read_post(char *buffer, uint count_bytes TSRMLS_DC)
/*
* This handles the situation where the browser sends a Expect: 100-continue header
- * and needs to recieve confirmation from the server on whether or not it can send
+ * and needs to receive confirmation from the server on whether or not it can send
* the rest of the request. RFC 2616
*
*/
diff --git a/sapi/fpm/config.m4 b/sapi/fpm/config.m4
index 6191c329ba..579f7c2846 100644
--- a/sapi/fpm/config.m4
+++ b/sapi/fpm/config.m4
@@ -563,6 +563,26 @@ if test "$PHP_FPM" != "no"; then
[ --with-fpm-group[=GRP] Set the group for php-fpm to run as. For a system user, this
should usually be set to match the fpm username (default: nobody)], nobody, no)
+ PHP_ARG_WITH(fpm-systemd,,
+ [ --with-fpm-systemd Activate systemd integration], no, no)
+
+ if test "$PHP_FPM_SYSTEMD" != "no" ; then
+ AC_CHECK_LIB(systemd-daemon, sd_notify, SYSTEMD_LIBS="-lsystemd-daemon")
+ AC_CHECK_HEADERS(systemd/sd-daemon.h, [HAVE_SD_DAEMON_H="yes"], [HAVE_SD_DAEMON_H="no"])
+ if test $HAVE_SD_DAEMON_H = "no" || test -z "${SYSTEMD_LIBS}"; then
+ AC_MSG_ERROR([Your system does not support systemd.])
+ else
+ AC_DEFINE(HAVE_SYSTEMD, 1, [FPM use systemd integration])
+ PHP_FPM_SD_FILES="fpm/fpm_systemd.c"
+ PHP_ADD_LIBRARY(systemd-daemon)
+ php_fpm_systemd=notify
+ fi
+ else
+ php_fpm_systemd=simple
+ fi
+ PHP_SUBST_OLD(php_fpm_systemd)
+ AC_DEFINE_UNQUOTED(PHP_FPM_SYSTEMD, "$php_fpm_systemd", [fpm systemd service type])
+
if test -z "$PHP_FPM_USER" -o "$PHP_FPM_USER" = "yes" -o "$PHP_FPM_USER" = "no"; then
php_fpm_user="nobody"
else
@@ -635,7 +655,7 @@ if test "$PHP_FPM" != "no"; then
fpm/events/port.c \
"
- PHP_SELECT_SAPI(fpm, program, $PHP_FPM_FILES $PHP_FPM_TRACE_FILES, $PHP_FPM_CFLAGS, '$(SAPI_FPM_PATH)')
+ PHP_SELECT_SAPI(fpm, program, $PHP_FPM_FILES $PHP_FPM_TRACE_FILES $PHP_FPM_SD_FILES, $PHP_FPM_CFLAGS, '$(SAPI_FPM_PATH)')
case $host_alias in
*aix*)
diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c
index 0a8a0e37e3..cd5fc34d0f 100644
--- a/sapi/fpm/fpm/fpm_conf.c
+++ b/sapi/fpm/fpm/fpm_conf.c
@@ -45,6 +45,10 @@
#include "fpm_log.h"
#include "fpm_events.h"
#include "zlog.h"
+#ifdef HAVE_SYSTEMD
+#include "fpm_systemd.h"
+#endif
+
#define STR2STR(a) (a ? a : "undefined")
#define BOOL2STR(a) (a ? "yes" : "no")
@@ -73,6 +77,10 @@ struct fpm_global_config_s fpm_global_config = {
#endif
.process_max = 0,
.process_priority = 64, /* 64 means unset */
+#ifdef HAVE_SYSTEMD
+ .systemd_watchdog = 0,
+ .systemd_interval = -1, /* -1 means not set */
+#endif
};
static struct fpm_worker_pool_s *current_wp = NULL;
static int ini_recursion = 0;
@@ -100,6 +108,9 @@ static struct ini_value_parser_s ini_fpm_global_options[] = {
{ "rlimit_files", &fpm_conf_set_integer, GO(rlimit_files) },
{ "rlimit_core", &fpm_conf_set_rlimit_core, GO(rlimit_core) },
{ "events.mechanism", &fpm_conf_set_string, GO(events_mechanism) },
+#ifdef HAVE_SYSTEMD
+ { "systemd_interval", &fpm_conf_set_time, GO(systemd_interval) },
+#endif
{ 0, 0, 0 }
};
@@ -686,7 +697,7 @@ static int fpm_evaluate_full_path(char **path, struct fpm_worker_pool_s *wp, cha
if (tmp != NULL) {
if (tmp != *path) {
- zlog(ZLOG_ERROR, "'$prefix' must be use at the begining of the value");
+ zlog(ZLOG_ERROR, "'$prefix' must be use at the beginning of the value");
return -1;
}
@@ -1152,6 +1163,12 @@ static int fpm_conf_post_process(int force_daemon TSRMLS_DC) /* {{{ */
fpm_global_config.error_log = strdup("log/php-fpm.log");
}
+#ifdef HAVE_SYSTEMD
+ if (0 > fpm_systemd_conf()) {
+ return -1;
+ }
+#endif
+
#ifdef HAVE_SYSLOG_H
if (!fpm_global_config.syslog_ident) {
fpm_global_config.syslog_ident = strdup("php-fpm");
@@ -1540,6 +1557,9 @@ static void fpm_conf_dump() /* {{{ */
zlog(ZLOG_NOTICE, "\trlimit_files = %d", fpm_global_config.rlimit_files);
zlog(ZLOG_NOTICE, "\trlimit_core = %d", fpm_global_config.rlimit_core);
zlog(ZLOG_NOTICE, "\tevents.mechanism = %s", fpm_event_machanism_name());
+#ifdef HAVE_SYSTEMD
+ zlog(ZLOG_NOTICE, "\tsystemd_interval = %ds", fpm_global_config.systemd_interval/1000);
+#endif
zlog(ZLOG_NOTICE, " ");
for (wp = fpm_worker_all_pools; wp; wp = wp->next) {
diff --git a/sapi/fpm/fpm/fpm_conf.h b/sapi/fpm/fpm/fpm_conf.h
index dc54133d43..efd65dc6d9 100644
--- a/sapi/fpm/fpm/fpm_conf.h
+++ b/sapi/fpm/fpm/fpm_conf.h
@@ -40,6 +40,10 @@ struct fpm_global_config_s {
int rlimit_files;
int rlimit_core;
char *events_mechanism;
+#ifdef HAVE_SYSTEMD
+ int systemd_watchdog;
+ int systemd_interval;
+#endif
};
extern struct fpm_global_config_s fpm_global_config;
diff --git a/sapi/fpm/fpm/fpm_events.c b/sapi/fpm/fpm/fpm_events.c
index d5835f0f7e..ce5d543f9b 100644
--- a/sapi/fpm/fpm/fpm_events.c
+++ b/sapi/fpm/fpm/fpm_events.c
@@ -29,6 +29,10 @@
#include "events/port.h"
#include "events/kqueue.h"
+#ifdef HAVE_SYSTEMD
+#include "fpm_systemd.h"
+#endif
+
#define fpm_event_set_timeout(ev, now) timeradd(&(now), &(ev)->frequency, &(ev)->timeout);
static void fpm_event_cleanup(int which, void *arg);
@@ -361,6 +365,10 @@ void fpm_event_loop(int err) /* {{{ */
zlog(ZLOG_DEBUG, "%zu bytes have been reserved in SHM", fpm_shm_get_size_allocated());
zlog(ZLOG_NOTICE, "ready to handle connections");
+
+#ifdef HAVE_SYSTEMD
+ fpm_systemd_heartbeat(NULL, 0, NULL);
+#endif
}
while (1) {
diff --git a/sapi/fpm/fpm/fpm_stdio.c b/sapi/fpm/fpm/fpm_stdio.c
index 10b867d00a..d81e10150d 100644
--- a/sapi/fpm/fpm/fpm_stdio.c
+++ b/sapi/fpm/fpm/fpm_stdio.c
@@ -291,7 +291,11 @@ int fpm_stdio_open_error_log(int reopen) /* {{{ */
fd = fpm_globals.error_log_fd; /* for FD_CLOSEXEC to work */
} else {
fpm_globals.error_log_fd = fd;
+#if HAVE_UNISTD_H
+ if (fpm_global_config.daemonize || !isatty(STDERR_FILENO)) {
+#else
if (fpm_global_config.daemonize) {
+#endif
zlog_set_fd(fpm_globals.error_log_fd);
}
}
diff --git a/sapi/fpm/fpm/fpm_systemd.c b/sapi/fpm/fpm/fpm_systemd.c
new file mode 100644
index 0000000000..c4d7ec15a4
--- /dev/null
+++ b/sapi/fpm/fpm/fpm_systemd.c
@@ -0,0 +1,113 @@
+#include "fpm_config.h"
+
+#include <sys/types.h>
+#include <systemd/sd-daemon.h>
+
+#include "fpm.h"
+#include "fpm_clock.h"
+#include "fpm_worker_pool.h"
+#include "fpm_scoreboard.h"
+#include "zlog.h"
+#include "fpm_systemd.h"
+
+
+static void fpm_systemd() /* {{{ */
+{
+ static unsigned long int last=0;
+ struct fpm_worker_pool_s *wp;
+ unsigned long int requests=0, slow_req=0;
+ int active=0, idle=0;
+
+
+ for (wp = fpm_worker_all_pools; wp; wp = wp->next) {
+ if (wp->scoreboard) {
+ active += wp->scoreboard->active;
+ idle += wp->scoreboard->idle;
+ requests += wp->scoreboard->requests;
+ slow_req += wp->scoreboard->slow_rq;
+ }
+ }
+
+/*
+ zlog(ZLOG_DEBUG, "systemd %s (Processes active:%d, idle:%d, Requests:%lu, slow:%lu, Traffic:%.3greq/sec)",
+ fpm_global_config.systemd_watchdog ? "watchdog" : "heartbeat",
+ active, idle, requests, slow_req, ((float)requests - last) * 1000.0 / fpm_global_config.systemd_interval);
+*/
+
+ if (0 > sd_notifyf(0, "READY=1\n%s"
+ "STATUS=Processes active: %d, idle: %d, Requests: %lu, slow: %lu, Traffic: %.3greq/sec",
+ fpm_global_config.systemd_watchdog ? "WATCHDOG=1\n" : "",
+ active, idle, requests, slow_req, ((float)requests - last) * 1000.0 / fpm_global_config.systemd_interval)) {
+ zlog(ZLOG_NOTICE, "failed to notify status to systemd");
+ }
+
+ last = requests;
+}
+/* }}} */
+
+void fpm_systemd_heartbeat(struct fpm_event_s *ev, short which, void *arg) /* {{{ */
+{
+ static struct fpm_event_s heartbeat;
+
+ if (fpm_globals.parent_pid != getpid()) {
+ return; /* sanity check */
+ }
+
+ if (which == FPM_EV_TIMEOUT) {
+ fpm_systemd();
+
+ return;
+ }
+
+ if (0 > sd_notifyf(0, "READY=1\n"
+ "STATUS=Ready to handle connections\n"
+ "MAINPID=%lu",
+ (unsigned long) getpid())) {
+ zlog(ZLOG_WARNING, "failed to notify start to systemd");
+ } else {
+ zlog(ZLOG_DEBUG, "have notify start to systemd");
+ }
+
+ /* first call without setting which to initialize the timer */
+ if (fpm_global_config.systemd_interval > 0) {
+ fpm_event_set_timer(&heartbeat, FPM_EV_PERSIST, &fpm_systemd_heartbeat, NULL);
+ fpm_event_add(&heartbeat, fpm_global_config.systemd_interval);
+ zlog(ZLOG_NOTICE, "systemd monitor interval set to %dms", fpm_global_config.systemd_interval);
+ } else {
+ zlog(ZLOG_NOTICE, "systemd monitor disabled");
+ }
+}
+/* }}} */
+
+int fpm_systemd_conf() /* {{{ */
+{
+ char *watchdog;
+ int interval = 0;
+
+ watchdog = getenv("WATCHDOG_USEC");
+ if (watchdog) {
+ /* usec to msec, and half the configured delay */
+ interval = (int)(atol(watchdog) / 2000L);
+ zlog(ZLOG_DEBUG, "WATCHDOG_USEC=%s, interval=%d", watchdog, interval);
+ }
+
+ if (interval > 1000) {
+ if (fpm_global_config.systemd_interval > 0) {
+ zlog(ZLOG_WARNING, "systemd_interval option ignored");
+ }
+ zlog(ZLOG_NOTICE, "systemd watchdog configured to %.3gsec", (float)interval / 1000.0);
+ fpm_global_config.systemd_watchdog = 1;
+ fpm_global_config.systemd_interval = interval;
+
+ } else if (fpm_global_config.systemd_interval < 0) {
+ /* not set => default value */
+ fpm_global_config.systemd_interval = FPM_SYSTEMD_DEFAULT_HEARTBEAT;
+
+ } else {
+ /* sec to msec */
+ fpm_global_config.systemd_interval *= 1000;
+ }
+ return 0;
+}
+/* }}} */
+
diff --git a/sapi/fpm/fpm/fpm_systemd.h b/sapi/fpm/fpm/fpm_systemd.h
new file mode 100644
index 0000000000..3ee6217717
--- /dev/null
+++ b/sapi/fpm/fpm/fpm_systemd.h
@@ -0,0 +1,13 @@
+#ifndef FPM_SYSTEMD_H
+#define FPM_SYSTEMD_H 1
+
+#include "fpm_events.h"
+
+/* 10s (in ms) heartbeat for systemd status */
+#define FPM_SYSTEMD_DEFAULT_HEARTBEAT (10000)
+
+void fpm_systemd_heartbeat(struct fpm_event_s *ev, short which, void *arg);
+int fpm_systemd_conf();
+
+#endif
+
diff --git a/sapi/fpm/php-fpm.conf.in b/sapi/fpm/php-fpm.conf.in
index a63dec7098..e0d80970af 100644
--- a/sapi/fpm/php-fpm.conf.in
+++ b/sapi/fpm/php-fpm.conf.in
@@ -10,7 +10,7 @@
; files from a glob(3) pattern. This directive can be used everywhere in the
; file.
; Relative path can also be used. They will be prefixed by:
-; - the global prefix if it's been set (-p arguement)
+; - the global prefix if it's been set (-p argument)
; - @prefix@ otherwise
;include=etc/fpm.d/*.conf
@@ -105,7 +105,15 @@
; - /dev/poll (Solaris >= 7)
; - port (Solaris >= 10)
; Default Value: not set (auto detection)
-; events.mechanism = epoll
+;events.mechanism = epoll
+
+; When FPM is build with systemd integration, specify the interval,
+; in second, between health report notification to systemd.
+; Set to 0 to disable.
+; Available Units: s(econds), m(inutes), h(ours)
+; Default Unit: seconds
+; Default value: 10
+;systemd_interval = 10
;;;;;;;;;;;;;;;;;;;;
; Pool Definitions ;
diff --git a/sapi/fpm/php-fpm.service.in b/sapi/fpm/php-fpm.service.in
index 396a88d66f..a2df30e28d 100644
--- a/sapi/fpm/php-fpm.service.in
+++ b/sapi/fpm/php-fpm.service.in
@@ -3,6 +3,7 @@ Description=The PHP FastCGI Process Manager
After=syslog.target network.target
[Service]
+Type=@php_fpm_systemd@
PIDFile=@localstatedir@/run/php-fpm.pid
ExecStart=@sbindir@/php-fpm --nodaemonize --fpm-config @sysconfdir@/php-fpm.conf
ExecReload=/bin/kill -USR2 $MAINPID
diff --git a/sapi/isapi/stresstest/stresstest.cpp b/sapi/isapi/stresstest/stresstest.cpp
index 97824e6be8..9a5964a6ba 100644
--- a/sapi/isapi/stresstest/stresstest.cpp
+++ b/sapi/isapi/stresstest/stresstest.cpp
@@ -796,7 +796,7 @@ BOOL WINAPI ServerSupportFunction(HCONN hConn, DWORD dwHSERequest,
switch(dwHSERequest) {
case (HSE_REQ_SEND_RESPONSE_HEADER) :
- lpszRespBuf = (char *)xmalloc(*lpdwSize);//+ 80);//accomodate our header
+ lpszRespBuf = (char *)xmalloc(*lpdwSize);//+ 80);//accommodate our header
if (!lpszRespBuf)
return FALSE;
wsprintf(lpszRespBuf,"%s",
diff --git a/sapi/thttpd/thttpd.c b/sapi/thttpd/thttpd.c
index 1a1baa7078..548bcda170 100644
--- a/sapi/thttpd/thttpd.c
+++ b/sapi/thttpd/thttpd.c
@@ -579,7 +579,7 @@ static void queue_request(httpd_conn *hc)
m->next = NULL;
tsrm_mutex_lock(qr_lock);
- /* Create new threads when reaching a certain threshhold */
+ /* Create new threads when reaching a certain threshold */
if (nr_threads < max_threads && nr_free_threads < 2) {
nr_threads++; /* protected by qr_lock */
diff --git a/scripts/dev/generate-phpt.phar b/scripts/dev/generate-phpt.phar
index d9e6ce4302..a12c040f9c 100644
--- a/scripts/dev/generate-phpt.phar
+++ b/scripts/dev/generate-phpt.phar
Binary files differ
diff --git a/scripts/dev/generate-phpt/src/gtFunction.php b/scripts/dev/generate-phpt/src/gtFunction.php
index 74058216ee..47f4bafcb3 100644
--- a/scripts/dev/generate-phpt/src/gtFunction.php
+++ b/scripts/dev/generate-phpt/src/gtFunction.php
@@ -19,7 +19,7 @@ class gtFunction extends gtTestSubject {
/**
- * Get the names of function argments and initialise mandatory and optional argument arrays
+ * Get the names of function arguments and initialise mandatory and optional argument arrays
*
*/
public function setArgumentNames() {
diff --git a/server-tests-config.php b/server-tests-config.php
index 47df90f5e6..0ddff28cb2 100755
--- a/server-tests-config.php
+++ b/server-tests-config.php
@@ -59,7 +59,7 @@ $conf = array(
/* if true doesn't run tests, just outputs executable info */
'TEST_CONTEXT_INFO' => false,
-/* : or ; seperated list of paths */
+/* : or ; separated list of paths */
'TEST_PATHS' => NULL
/* additional configuration items that may be set
to provide proxy support for testes:
diff --git a/server-tests.php b/server-tests.php
index 051a1cfa08..684e111c91 100755
--- a/server-tests.php
+++ b/server-tests.php
@@ -413,7 +413,7 @@ class testHarness {
public $xargs = array(
#arg env var value default description
'c' => array('' ,'file' ,NULL ,'configuration file, see server-tests-config.php for example'),
- 'd' => array('TEST_PATHS' ,'paths' ,NULL ,'colon seperate path list'),
+ 'd' => array('TEST_PATHS' ,'paths' ,NULL ,'colon separate path list'),
'e' => array('TEST_PHP_ERROR_STYLE','EMACS|MSVC' ,'EMACS' ,'editor error style'),
'h' => array('' ,'' ,NULL ,'this help'),
'i' => array('PHPRC' ,'path|file' ,NULL ,'ini file to use for tests (sets PHPRC)'),
diff --git a/tests/output/bug60322.phpt b/tests/output/bug60322.phpt
index c28ab4d617..f4d7139458 100644
--- a/tests/output/bug60322.phpt
+++ b/tests/output/bug60322.phpt
@@ -1,8 +1,11 @@
--TEST--
Bug #60322 (ob_get_clean() now raises an E_NOTICE if no buffers exist)
+--INI--
+output_buffering=128
--FILE--
<?php
-while(ob_get_clean()) ;
+ob_start();
+while(@ob_end_clean());
var_dump(ob_get_clean());
--EXPECT--
bool(false)
diff --git a/win32/glob.c b/win32/glob.c
index a197f3bbee..1aeac78fda 100644
--- a/win32/glob.c
+++ b/win32/glob.c
@@ -689,7 +689,7 @@ glob3(pathbuf, pathbuf_last, pathend, pathend_last, pattern, pattern_last,
/*
- * Extend the gl_pathv member of a glob_t structure to accomodate a new item,
+ * Extend the gl_pathv member of a glob_t structure to accommodate a new item,
* add the new item, and update gl_pathc.
*
* This assumes the BSD realloc, which only copies the block when its size
diff --git a/win32/install.txt b/win32/install.txt
index b1d4ee5148..2883dd37f5 100644
--- a/win32/install.txt
+++ b/win32/install.txt
@@ -355,7 +355,7 @@ c:\php
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 seperate directory.
+ 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).
diff --git a/win32/sendmail.c b/win32/sendmail.c
index c4969ad5e3..dac62871ae 100644
--- a/win32/sendmail.c
+++ b/win32/sendmail.c
@@ -118,8 +118,8 @@ static char *ErrorMessages[] =
{"Error while trimming mail header with PCRE, please file a bug report at http://bugs.php.net/"} /* 21 */
};
-/* This pattern converts all single occurences of \n (Unix)
- * withour a leading \r to \r\n and all occurences of \r (Mac)
+/* This pattern converts all single occurrences of \n (Unix)
+ * withour a leading \r to \r\n and all occurrences of \r (Mac)
* without a trailing \n to \r\n
* Thx to Nibbler from ircnet/#linuxger
*/
@@ -129,7 +129,7 @@ static char *ErrorMessages[] =
/* This pattern removes \r\n from the start of the string,
* \r\n from the end of the string and also makes sure every line
* is only wrapped with a single \r\n (thus reduces multiple
- * occurences of \r\n between lines to a single \r\n) */
+ * occurrences of \r\n between lines to a single \r\n) */
#define PHP_WIN32_MAIL_RMVDBL_PATTERN "/^\r\n|(\r\n)+$/m"
#define PHP_WIN32_MAIL_RMVDBL_REPLACE ""
@@ -141,11 +141,11 @@ static char *ErrorMessages[] =
#define PHP_WIN32_MAIL_DOT_REPLACE "\n.."
/* This function is meant to unify the headers passed to to mail()
- * This means, use PCRE to transform single occurences of \n or \r in \r\n
- * As a second step we also eleminate all \r\n occurences which are:
+ * This means, use PCRE to transform single occurrences of \n or \r in \r\n
+ * As a second step we also eleminate all \r\n occurrences which are:
* 1) At the start of the header
* 2) At the end of the header
- * 3) Two or more occurences in the header are removed so only one is left
+ * 3) Two or more occurrences in the header are removed so only one is left
*
* Returns NULL on error, or the new char* buffer on success.
* You have to take care and efree() the buffer on your own.
diff --git a/win32/signal.h b/win32/signal.h
index de43f98e80..df60dfb728 100644
--- a/win32/signal.h
+++ b/win32/signal.h
@@ -2,7 +2,7 @@
** Change here: if you plan to use your own version of <signal.h>
** the original "#include <signal.h>" produces an infinite reinclusion
** of this file, instead of including the standard include-file.
-** Under MS Visual Studio, there are occurences in the source where
+** Under MS Visual Studio, there are occurrences in the source where
** <signal.h> gets included throughout the PHP sources, and this should
** include THIS file, not the standard one which does not have the
** additional signals defined below.