732 commits - ext/calendar ext/com_dotnet ext/curl ext/date ext/dom ext/exif ext/fileinfo ext/filter ext/gmp ext/iconv ext/intl ext/json ext/ldap ext/libxml ext/mysqli ext/mysqlnd ext/openssl ext/pdo ext/pdo_mysql ext/pgsql ext/phar ext/posix ext/readline ext/reflection ext/session ext/soap ext/sockets ext/spl ext/sqlite3 ext/standard ext/tidy ext/wddx ext/xmlwriter ext/zip ext/zlib main/main.c main/output.c main/php_output.h main/streams NEWS php.ini-development php.ini-production README.md README.RELEASE_PROCESS README.Zeus run-tests.php sapi/cgi sapi/cli sapi/fpm tests/basic tests/output travis/compile.sh travis/ext .travis.yml UPGRADING win32/build win32/registry.c win32/time.c Zend/tests Zend/zend_alloc.c Zend/zend_alloc.h Zend/zend.c Zend/zend_compile.c Zend/zend_compile.h Zend/zend_execute.c Zend/zend.h Zend/zend_ini_scanner.c Zend/zend_ini_scanner_defs.h Zend/zend_ini_scanner.l Zend/zend_interfaces.c Zend/zend_language_parser.y Zend/zend_language_scanner.c Zend/zend_language_scanner_defs.h Zend/zend_language_scanner.l Zend/zend_multibyte.c Zend/zend_object_handlers.c Zend/zend_object_handlers.h Zend/zend_objects.c Zend/zend_opcode.c Zend/zend_operators.c Zend/zend_operators.h Zend/zend_vm_def.h Zend/zend_vm_execute.h

Jeroen van Meeuwen vanmeeuwen at kolabsys.com
Sun Jun 17 13:16:41 CEST 2012


 .travis.yml                                                           |   24 
 NEWS                                                                  |   16 
 README.RELEASE_PROCESS                                                |    4 
 README.Zeus                                                           |  112 
 README.md                                                             |   30 
 UPGRADING                                                             |   64 
 Zend/tests/bug54547.phpt                                              |   21 
 Zend/tests/bug61761.phpt                                              |   18 
 Zend/tests/bug61782.phpt                                              |   29 
 Zend/tests/bug62005.phpt                                              |   15 
 Zend/tests/bug62097.phpt                                              |   17 
 Zend/tests/const_dereference_001.phpt                                 |   21 
 Zend/tests/const_dereference_002.phpt                                 |   18 
 Zend/tests/const_dereference_003.phpt                                 |   21 
 Zend/tests/empty_with_expr.phpt                                       |   32 
 Zend/tests/gc_029.phpt                                                |    2 
 Zend/tests/gc_029_zts.phpt                                            |   37 
 Zend/tests/isset_expr_error.phpt                                      |    8 
 Zend/tests/isset_func_error.phpt                                      |    8 
 Zend/tests/traits/bug61998.phpt                                       |   68 
 Zend/zend.c                                                           |    9 
 Zend/zend.h                                                           |   13 
 Zend/zend_alloc.c                                                     |    4 
 Zend/zend_alloc.h                                                     |    6 
 Zend/zend_compile.c                                                   |   36 
 Zend/zend_compile.h                                                   |    4 
 Zend/zend_execute.c                                                   |    3 
 Zend/zend_ini_scanner.c                                               | 2566 +++++-----
 Zend/zend_ini_scanner.l                                               |   33 
 Zend/zend_ini_scanner_defs.h                                          |    2 
 Zend/zend_interfaces.c                                                |    2 
 Zend/zend_language_parser.y                                           |   23 
 Zend/zend_language_scanner.c                                          |  689 +-
 Zend/zend_language_scanner.l                                          |    7 
 Zend/zend_language_scanner_defs.h                                     |    2 
 Zend/zend_multibyte.c                                                 |    2 
 Zend/zend_object_handlers.c                                           |   28 
 Zend/zend_object_handlers.h                                           |    3 
 Zend/zend_objects.c                                                   |   26 
 Zend/zend_opcode.c                                                    |    6 
 Zend/zend_operators.c                                                 |   32 
 Zend/zend_operators.h                                                 |   24 
 Zend/zend_vm_def.h                                                    |   25 
 Zend/zend_vm_execute.h                                                |  386 +
 ext/calendar/tests/unixtojd.phpt                                      |   25 
 ext/com_dotnet/com_misc.c                                             |    6 
 ext/com_dotnet/com_olechar.c                                          |    4 
 ext/com_dotnet/com_persist.c                                          |    2 
 ext/com_dotnet/com_typeinfo.c                                         |    6 
 ext/com_dotnet/com_variant.c                                          |    6 
 ext/com_dotnet/com_wrapper.c                                          |    4 
 ext/com_dotnet/php_com_dotnet.h                                       |    8 
 ext/com_dotnet/php_com_dotnet_internal.h                              |   28 
 ext/curl/interface.c                                                  |    9 
 ext/curl/tests/bug61948-win32.phpt                                    |   25 
 ext/curl/tests/bug61948.phpt                                          |   23 
 ext/date/tests/date_default_timezone_get-1-win32.phpt                 |    4 
 ext/dom/tests/DOMAttr_value_basic_001.phpt                            |    4 
 ext/dom/tests/DOMAttr_value_basic_002.phpt                            |    4 
 ext/dom/tests/DOMCharacterData_data_error_002.phpt                    |    4 
 ext/dom/tests/DOMCharacterData_length_error_001.phpt                  |    4 
 ext/dom/tests/DOMDocument_validate_on_parse_variation.phpt            |    2 
 ext/dom/tests/dom007.phpt                                             |   26 
 ext/dom/tests/note.dtd                                                |    6 
 ext/dom/tests/note.xml                                                |    8 
 ext/exif/exif.c                                                       |    6 
 ext/fileinfo/libmagic.patch                                           |  161 
 ext/fileinfo/libmagic/file.h                                          |    1 
 ext/fileinfo/libmagic/funcs.c                                         |    2 
 ext/fileinfo/libmagic/softmagic.c                                     |   25 
 ext/fileinfo/tests/finfo_file_002.phpt                                |    4 
 ext/fileinfo/tests/finfo_file_regex-win32.phpt                        |   36 
 ext/fileinfo/tests/finfo_file_regex.phpt                              |   32 
 ext/fileinfo/tests/finfo_open_error-win32.phpt                        |   59 
 ext/fileinfo/tests/finfo_open_error.phpt                              |    5 
 ext/fileinfo/tests/resources/test.awk                                 |    1 
 ext/filter/tests/bug52209.phpt                                        |    8 
 ext/gmp/tests/022-win32.phpt                                          |   90 
 ext/gmp/tests/022.phpt                                                |    6 
 ext/gmp/tests/gmp_nextprime-win32.phpt                                |   45 
 ext/gmp/tests/gmp_nextprime.phpt                                      |    6 
 ext/iconv/iconv.c                                                     |  128 
 ext/intl/calendar/calendar_class.cpp                                  |   24 
 ext/intl/calendar/calendar_class.h                                    |    3 
 ext/intl/calendar/calendar_methods.cpp                                |  196 
 ext/intl/calendar/calendar_methods.h                                  |    4 
 ext/intl/calendar/gregoriancalendar_methods.cpp                       |    6 
 ext/intl/collator/collator_sort.c                                     |    4 
 ext/intl/common/common_enum.cpp                                       |    2 
 ext/intl/config.m4                                                    |   13 
 ext/intl/config.w32                                                   |    3 
 ext/intl/dateformat/dateformat.c                                      |  110 
 ext/intl/dateformat/dateformat_attr.c                                 |  164 
 ext/intl/dateformat/dateformat_attr.h                                 |    4 
 ext/intl/dateformat/dateformat_attrcpp.cpp                            |  261 +
 ext/intl/dateformat/dateformat_attrcpp.h                              |   35 
 ext/intl/dateformat/dateformat_class.c                                |   20 
 ext/intl/dateformat/dateformat_class.h                                |   12 
 ext/intl/dateformat/dateformat_create.cpp                             |  193 
 ext/intl/dateformat/dateformat_create.h                               |   25 
 ext/intl/dateformat/dateformat_format.c                               |    4 
 ext/intl/dateformat/dateformat_helpers.cpp                            |  106 
 ext/intl/dateformat/dateformat_helpers.h                              |   39 
 ext/intl/formatter/formatter_parse.c                                  |    5 
 ext/intl/grapheme/grapheme.h                                          |    1 
 ext/intl/grapheme/grapheme_string.c                                   |    1 
 ext/intl/intl_convertcpp.cpp                                          |   12 
 ext/intl/intl_cppshims.h                                              |   34 
 ext/intl/locale/locale_methods.c                                      |    7 
 ext/intl/msgformat/msgformat.c                                        |    6 
 ext/intl/msgformat/msgformat_attr.c                                   |    8 
 ext/intl/msgformat/msgformat_class.h                                  |   12 
 ext/intl/msgformat/msgformat_data.c                                   |   28 
 ext/intl/msgformat/msgformat_data.h                                   |    9 
 ext/intl/msgformat/msgformat_format.c                                 |   49 
 ext/intl/msgformat/msgformat_helpers.cpp                              |  702 ++
 ext/intl/msgformat/msgformat_helpers.h                                |    6 
 ext/intl/msgformat/msgformat_parse.c                                  |    2 
 ext/intl/php_intl.c                                                   |   27 
 ext/intl/php_intl.h                                                   |    7 
 ext/intl/resourcebundle/resourcebundle_class.c                        |   24 
 ext/intl/tests/badargs.phpt                                           |    5 
 ext/intl/tests/bug50590.phpt                                          |    2 
 ext/intl/tests/bug58756_MessageFormatter.phpt                         |   34 
 ext/intl/tests/bug59597_32.phpt                                       |   21 
 ext/intl/tests/bug59597_64.phpt                                       |   21 
 ext/intl/tests/bug62017.phpt                                          |   22 
 ext/intl/tests/bug62070.phpt                                          |   16 
 ext/intl/tests/bug62081.phpt                                          |   16 
 ext/intl/tests/bug62082.phpt                                          |   15 
 ext/intl/tests/bug62083.phpt                                          |   12 
 ext/intl/tests/calendar_fromDateTime_basic.phpt                       |   52 
 ext/intl/tests/calendar_fromDateTime_error.phpt                       |   59 
 ext/intl/tests/calendar_getErrorCode_getErrorMessage_basic.phpt       |    2 
 ext/intl/tests/calendar_setTimeZone_error.phpt                        |   11 
 ext/intl/tests/calendar_setTimeZone_error2.phpt                       |   29 
 ext/intl/tests/calendar_setTimeZone_variation2.phpt                   |   30 
 ext/intl/tests/calendar_toDateTime_basic.phpt                         |   23 
 ext/intl/tests/calendar_toDateTime_error.phpt                         |   41 
 ext/intl/tests/collator_get_sort_key.phpt                             |   71 
 ext/intl/tests/dateformat___construct_bad_tz_cal.phpt                 |   28 
 ext/intl/tests/dateformat_calendars.phpt                              |   45 
 ext/intl/tests/dateformat_create_cal_arg.phpt                         |   49 
 ext/intl/tests/dateformat_format.phpt                                 |    4 
 ext/intl/tests/dateformat_format_parse.phpt                           |    2 
 ext/intl/tests/dateformat_getCalendarObject_error.phpt                |   39 
 ext/intl/tests/dateformat_getTimeZone_error.phpt                      |   39 
 ext/intl/tests/dateformat_get_set_calendar.phpt                       |   93 
 ext/intl/tests/dateformat_get_set_timezone.phpt                       |   58 
 ext/intl/tests/dateformat_get_timezone_id.phpt                        |   15 
 ext/intl/tests/dateformat_setTimeZoneID_deprecation.phpt              |   18 
 ext/intl/tests/dateformat_setTimeZone_error.phpt                      |   49 
 ext/intl/tests/dateformat_set_timezone_id2.phpt                       |   22 
 ext/intl/tests/dateformat_timezone_arg_variations.phpt                |   41 
 ext/intl/tests/formatter_get_set_attribute.phpt                       |   10 
 ext/intl/tests/formatter_get_set_attribute2.phpt                      |  194 
 ext/intl/tests/msgfmt_format_datetime.phpt                            |   28 
 ext/intl/tests/msgfmt_format_error1.phpt                              |   19 
 ext/intl/tests/msgfmt_format_error2.phpt                              |   23 
 ext/intl/tests/msgfmt_format_error3.phpt                              |   23 
 ext/intl/tests/msgfmt_format_error4.phpt                              |   28 
 ext/intl/tests/msgfmt_format_error5.phpt                              |   25 
 ext/intl/tests/msgfmt_format_error6.phpt                              |   23 
 ext/intl/tests/msgfmt_format_intlcalendar.phpt                        |   30 
 ext/intl/tests/msgfmt_format_mixed_params.phpt                        |   25 
 ext/intl/tests/msgfmt_format_simple_types_numeric_strings.phpt        |   58 
 ext/intl/tests/msgfmt_format_subpatterns.phpt                         |   75 
 ext/intl/tests/msgfmt_format_subpatterns_named.phpt                   |   75 
 ext/intl/tests/msgfmt_get_error.phpt                                  |   29 
 ext/intl/tests/msgfmt_millisecond_dates.phpt                          |   29 
 ext/intl/tests/msgfmt_setPattern_cache.phpt                           |   26 
 ext/intl/tests/resourcebundle_null_mandatory_args.phpt                |   26 
 ext/intl/tests/resourcebundle_traversable.phpt                        |   23 
 ext/intl/tests/timezone_fromDateTimeZone_basic.phpt                   |   41 
 ext/intl/tests/timezone_fromDateTimeZone_error.phpt                   |   50 
 ext/intl/tests/timezone_toDateTimeZone_basic.phpt                     |   38 
 ext/intl/tests/timezone_toDateTimeZone_error.phpt                     |   38 
 ext/intl/timezone/timezone_class.cpp                                  |  185 
 ext/intl/timezone/timezone_class.h                                    |    4 
 ext/intl/timezone/timezone_methods.cpp                                |   64 
 ext/intl/timezone/timezone_methods.h                                  |    6 
 ext/json/json.c                                                       |   24 
 ext/json/php_json.h                                                   |    1 
 ext/json/tests/bug43941.phpt                                          |   21 
 ext/json/tests/bug53946.phpt                                          |   10 
 ext/json/tests/bug54058.phpt                                          |    7 
 ext/json/tests/bug61537.phpt                                          |   30 
 ext/json/tests/bug61978.phpt                                          |   47 
 ext/ldap/tests/ldap_sasl_bind_basic.phpt                              |    7 
 ext/ldap/tests/ldap_set_rebind_proc_error.phpt                        |   10 
 ext/libxml/libxml.c                                                   |   13 
 ext/libxml/tests/bug61367-read.phpt                                   |    6 
 ext/libxml/tests/bug61367-write.phpt                                  |    2 
 ext/mysqli/mysqli.c                                                   |  212 
 ext/mysqli/mysqli_api.c                                               |   58 
 ext/mysqli/mysqli_fe.c                                                |   18 
 ext/mysqli/mysqli_nonapi.c                                            |    3 
 ext/mysqli/mysqli_priv.h                                              |    1 
 ext/mysqli/mysqli_report.h                                            |   64 
 ext/mysqli/package.xml                                                |    1 
 ext/mysqli/php_mysqli_structs.h                                       |   12 
 ext/mysqli/tests/bug62046.phpt                                        |   40 
 ext/mysqli/tests/mysqli_class_mysqli_interface.phpt                   |    6 
 ext/mysqli/tests/mysqli_options_openbasedir.phpt                      |    1 
 ext/mysqli/tests/mysqli_query_local_infile_large.phpt                 |  103 
 ext/mysqli/tests/mysqli_set_local_infile_default.phpt                 |  132 
 ext/mysqli/tests/mysqli_set_local_infile_handler.phpt                 |  196 
 ext/mysqli/tests/mysqli_set_local_infile_handler_bad_character.phpt   |   82 
 ext/mysqli/tests/mysqli_set_local_infile_handler_buffer_overflow.phpt |   60 
 ext/mysqli/tests/mysqli_set_local_infile_handler_close_link.phpt      |   61 
 ext/mysqli/tests/mysqli_set_local_infile_handler_closefile.phpt       |   70 
 ext/mysqli/tests/mysqli_set_local_infile_handler_closures.phpt        |   62 
 ext/mysqli/tests/mysqli_set_local_infile_handler_kill_link.phpt       |   61 
 ext/mysqli/tests/mysqli_set_local_infile_handler_negative_len.phpt    |   58 
 ext/mysqli/tests/mysqli_set_local_infile_handler_nested_call.phpt     |  107 
 ext/mysqli/tests/mysqli_set_local_infile_handler_new_query.phpt       |   71 
 ext/mysqli/tests/mysqli_set_local_infile_handler_nofileop.phpt        |   70 
 ext/mysqli/tests/mysqli_set_local_infile_handler_openbasedir.phpt     |  115 
 ext/mysqli/tests/mysqli_set_local_infile_handler_replace_buffer.phpt  |   78 
 ext/mysqli/tests/mysqli_set_local_infile_handler_short_len.phpt       |  101 
 ext/mysqli/tests/mysqli_set_local_infile_handler_unregister.phpt      |   64 
 ext/mysqlnd/mysqlnd.c                                                 |  693 +-
 ext/mysqlnd/mysqlnd.h                                                 |    6 
 ext/mysqlnd/mysqlnd_debug.h                                           |    3 
 ext/mysqlnd/mysqlnd_driver.c                                          |   26 
 ext/mysqlnd/mysqlnd_enum_n_def.h                                      |    2 
 ext/mysqlnd/mysqlnd_loaddata.c                                        |    8 
 ext/mysqlnd/mysqlnd_net.c                                             |  378 -
 ext/mysqlnd/mysqlnd_plugin.c                                          |   27 
 ext/mysqlnd/mysqlnd_ps.c                                              |   10 
 ext/mysqlnd/mysqlnd_structs.h                                         |   64 
 ext/mysqlnd/mysqlnd_wireprotocol.c                                    |   23 
 ext/mysqlnd/php_mysqlnd.c                                             |   24 
 ext/openssl/CREDITS                                                   |    2 
 ext/openssl/openssl.c                                                 |   65 
 ext/openssl/php_openssl.h                                             |    2 
 ext/openssl/tests/openssl_pbkdf2.phpt                                 |   26 
 ext/pdo/Makefile.frag                                                 |    4 
 ext/pdo/pdo_sql_parser.c                                              |  249 
 ext/pdo/pdo_sql_parser.re                                             |    9 
 ext/pdo_mysql/tests/bug_61411.phpt                                    |   53 
 ext/pdo_mysql/tests/bug_61755.phpt                                    |   41 
 ext/pgsql/pgsql.c                                                     |    6 
 ext/phar/tar.c                                                        |   16 
 ext/phar/tests/fatal_error_webphar.phpt                               |    2 
 ext/phar/tests/files/openssl.cnf                                      |   43 
 ext/phar/tests/phar_buildfromdirectory2-win.phpt                      |   30 
 ext/phar/tests/phar_buildfromdirectory2.phpt                          |    5 
 ext/phar/tests/phar_setsignaturealgo2.phpt                            |    4 
 ext/phar/tests/tar/phar_commitwrite.phpt                              |    5 
 ext/phar/tests/tar/phar_setsignaturealgo2.phpt                        |    4 
 ext/phar/tests/zip/phar_commitwrite.phpt                              |    5 
 ext/phar/tests/zip/phar_setsignaturealgo2.phpt                        |    6 
 ext/posix/tests/posix_getegid_basic.phpt                              |   15 
 ext/posix/tests/posix_setgid_error.phpt                               |    1 
 ext/readline/readline.c                                               |    2 
 ext/reflection/php_reflection.c                                       |    3 
 ext/reflection/tests/bug47254.phpt                                    |    1 
 ext/session/tests/bug42596.phpt                                       |    5 
 ext/session/tests/bug61728.phpt                                       |   39 
 ext/session/tests/rfc1867_invalid_settings-win.phpt                   |   19 
 ext/session/tests/rfc1867_invalid_settings.phpt                       |    6 
 ext/session/tests/rfc1867_invalid_settings_2-win.phpt                 |   19 
 ext/session/tests/rfc1867_invalid_settings_2.phpt                     |    6 
 ext/session/tests/session_set_save_handler_class_002.phpt             |    2 
 ext/session/tests/session_set_save_handler_iface_001.phpt             |    2 
 ext/session/tests/session_set_save_handler_iface_002.phpt             |    2 
 ext/soap/tests/bugs/bug31422-win.phpt                                 |   47 
 ext/soap/tests/bugs/bug31422.phpt                                     |    7 
 ext/soap/tests/bugs/bug47273.phpt                                     |    3 
 ext/soap/tests/server019.phpt                                         |    4 
 ext/soap/tests/server020.phpt                                         |    4 
 ext/sockets/config.m4                                                 |   15 
 ext/sockets/sockets.c                                                 |    3 
 ext/sockets/tests/socket_import_stream-4-win.phpt                     |  106 
 ext/sockets/tests/socket_import_stream-4.phpt                         |    4 
 ext/spl/spl_heap.c                                                    |    2 
 ext/spl/tests/bug62073.phpt                                           |   22 
 ext/spl/tests/heap_005.phpt                                           |  200 
 ext/spl/tests/heap_006.phpt                                           |  200 
 ext/spl/tests/pqueue_001.phpt                                         |   24 
 ext/sqlite3/tests/sqlite3_15_open_error-win.phpt                      |   37 
 ext/sqlite3/tests/sqlite3_15_open_error.phpt                          |    3 
 ext/standard/array.c                                                  |   12 
 ext/standard/basic_functions.c                                        |    5 
 ext/standard/crypt_freesec.c                                          |    3 
 ext/standard/filestat.c                                               |    9 
 ext/standard/iptc.c                                                   |    8 
 ext/standard/math.c                                                   |   24 
 ext/standard/pack.c                                                   |   80 
 ext/standard/php_fopen_wrapper.c                                      |   14 
 ext/standard/php_type.h                                               |    1 
 ext/standard/proc_open.c                                              |    2 
 ext/standard/tests/array/bug61730.phpt                                |   37 
 ext/standard/tests/array/compact.phpt                                 |    3 
 ext/standard/tests/array/locale_sort.phpt                             |    3 
 ext/standard/tests/file/bug51094.phpt                                 |   22 
 ext/standard/tests/file/bug61961.phpt                                 |   14 
 ext/standard/tests/file/popen_pclose_basic-win32.phpt                 |    5 
 ext/standard/tests/file/realpath_cache.phpt                           |    2 
 ext/standard/tests/file/realpath_cache_win32.phpt                     |    2 
 ext/standard/tests/file/rename_variation13-win32.phpt                 |binary
 ext/standard/tests/file/tempnam_variation7-win32.phpt                 |    4 
 ext/standard/tests/file/windows_acls/bug44859.phpt                    |    1 
 ext/standard/tests/file/windows_acls/bug44859_2.phpt                  |    1 
 ext/standard/tests/file/windows_acls/bug44859_3.phpt                  |    1 
 ext/standard/tests/file/windows_acls/bug44859_4.phpt                  |    1 
 ext/standard/tests/file/windows_acls/common.inc                       |   59 
 ext/standard/tests/file/windows_links/bug48746.phpt                   |    9 
 ext/standard/tests/file/windows_links/bug48746_1.phpt                 |   11 
 ext/standard/tests/file/windows_links/bug48746_2.phpt                 |   11 
 ext/standard/tests/file/windows_links/bug48746_3.phpt                 |   10 
 ext/standard/tests/file/windows_links/common.inc                      |   23 
 ext/standard/tests/general_functions/boolval.phpt                     |   29 
 ext/standard/tests/general_functions/bug44295-win.phpt                |   29 
 ext/standard/tests/general_functions/bug44295.phpt                    |    5 
 ext/standard/tests/mail/mail_skipif.inc                               |   10 
 ext/standard/tests/math/bug62112.phpt                                 |binary
 ext/standard/tests/streams/bug60106.phpt                              |   19 
 ext/standard/tests/streams/bug61115-1.phpt                            |    2 
 ext/standard/tests/streams/bug61371-win.phpt                          |   45 
 ext/standard/tests/streams/bug61371.phpt                              |    5 
 ext/standard/tests/strings/bug38770.phpt                              |    6 
 ext/standard/tests/strings/bug61038.phpt                              |   26 
 ext/standard/tests/strings/bug61764.phpt                              |   15 
 ext/standard/tests/strings/crypt_chars.phpt                           |   19 
 ext/standard/tests/strings/htmlentities15.phpt                        |    2 
 ext/standard/tests/strings/pack_A.phpt                                |   25 
 ext/standard/tests/strings/pack_Z.phpt                                |   27 
 ext/standard/tests/strings/unpack_error.phpt                          |    4 
 ext/standard/type.c                                                   |   14 
 ext/tidy/tests/004.phpt                                               |    2 
 ext/tidy/tests/bug54682.phpt                                          |    2 
 ext/wddx/tests/bug48562.phpt                                          |    6 
 ext/xmlwriter/php_xmlwriter.c                                         |    2 
 ext/zip/config.m4                                                     |    9 
 ext/zip/config.w32                                                    |    9 
 ext/zip/lib/zip.h                                                     |  108 
 ext/zip/lib/zip_add.c                                                 |   13 
 ext/zip/lib/zip_add_dir.c                                             |   14 
 ext/zip/lib/zip_close.c                                               |  341 -
 ext/zip/lib/zip_delete.c                                              |   11 
 ext/zip/lib/zip_dirent.c                                              |   11 
 ext/zip/lib/zip_entry_free.c                                          |    3 
 ext/zip/lib/zip_entry_new.c                                           |   17 
 ext/zip/lib/zip_err_str.c                                             |    8 
 ext/zip/lib/zip_error.c                                               |   13 
 ext/zip/lib/zip_error_to_str.c                                        |    4 
 ext/zip/lib/zip_fclose.c                                              |   26 
 ext/zip/lib/zip_fdopen.c                                              |   62 
 ext/zip/lib/zip_filerange_crc.c                                       |    2 
 ext/zip/lib/zip_fopen.c                                               |    4 
 ext/zip/lib/zip_fopen_encrypted.c                                     |   50 
 ext/zip/lib/zip_fopen_index.c                                         |  174 
 ext/zip/lib/zip_fopen_index_encrypted.c                               |  191 
 ext/zip/lib/zip_fread.c                                               |   91 
 ext/zip/lib/zip_free.c                                                |    2 
 ext/zip/lib/zip_get_archive_comment.c                                 |   10 
 ext/zip/lib/zip_get_archive_flag.c                                    |    2 
 ext/zip/lib/zip_get_compression_implementation.c                      |   46 
 ext/zip/lib/zip_get_encryption_implementation.c                       |   46 
 ext/zip/lib/zip_get_file_comment.c                                    |    4 
 ext/zip/lib/zip_get_file_extra.c                                      |   58 
 ext/zip/lib/zip_get_name.c                                            |    7 
 ext/zip/lib/zip_get_num_entries.c                                     |   52 
 ext/zip/lib/zip_name_locate.c                                         |   14 
 ext/zip/lib/zip_new.c                                                 |    1 
 ext/zip/lib/zip_open.c                                                |  115 
 ext/zip/lib/zip_rename.c                                              |    9 
 ext/zip/lib/zip_replace.c                                             |   19 
 ext/zip/lib/zip_set_archive_comment.c                                 |    7 
 ext/zip/lib/zip_set_archive_flag.c                                    |   24 
 ext/zip/lib/zip_set_default_password.c                                |   62 
 ext/zip/lib/zip_set_file_comment.c                                    |   12 
 ext/zip/lib/zip_set_file_extra.c                                      |   72 
 ext/zip/lib/zip_set_name.c                                            |    6 
 ext/zip/lib/zip_source_buffer.c                                       |   22 
 ext/zip/lib/zip_source_close.c                                        |   54 
 ext/zip/lib/zip_source_crc.c                                          |  159 
 ext/zip/lib/zip_source_deflate.c                                      |  394 +
 ext/zip/lib/zip_source_error.c                                        |   87 
 ext/zip/lib/zip_source_file.c                                         |    7 
 ext/zip/lib/zip_source_filep.c                                        |  115 
 ext/zip/lib/zip_source_free.c                                         |   18 
 ext/zip/lib/zip_source_function.c                                     |   29 
 ext/zip/lib/zip_source_layered.c                                      |   59 
 ext/zip/lib/zip_source_open.c                                         |   76 
 ext/zip/lib/zip_source_pkware.c                                       |  241 
 ext/zip/lib/zip_source_pop.c                                          |   63 
 ext/zip/lib/zip_source_read.c                                         |   64 
 ext/zip/lib/zip_source_stat.c                                         |   72 
 ext/zip/lib/zip_source_zip.c                                          |   20 
 ext/zip/lib/zip_stat_index.c                                          |   18 
 ext/zip/lib/zip_stat_init.c                                           |    9 
 ext/zip/lib/zip_unchange.c                                            |    9 
 ext/zip/lib/zip_unchange_archive.c                                    |    2 
 ext/zip/lib/zip_unchange_data.c                                       |    3 
 ext/zip/lib/zipconf.h                                                 |   51 
 ext/zip/lib/zipint.h                                                  |  148 
 ext/zip/php_zip.c                                                     |   17 
 ext/zip/php_zip.h                                                     |    2 
 ext/zlib/tests/bug61443.phpt                                          |   15 
 ext/zlib/tests/bug61820.phpt                                          |   23 
 ext/zlib/tests/gzencode_variation1-win32.phpt                         |   15 
 ext/zlib/zlib.c                                                       |   12 
 main/main.c                                                           |   16 
 main/output.c                                                         |    1 
 main/php_output.h                                                     |    3 
 main/streams/streams.c                                                |   23 
 php.ini-development                                                   |    6 
 php.ini-production                                                    |    6 
 run-tests.php                                                         |   62 
 sapi/cgi/cgi_main.c                                                   |   39 
 sapi/cgi/tests/apache_request_headers.phpt                            |   51 
 sapi/cli/php_cli.c                                                    |   11 
 sapi/cli/php_cli_server.c                                             |  140 
 sapi/cli/tests/bug61546.phpt                                          |   31 
 sapi/cli/tests/bug61977.phpt                                          |  157 
 sapi/cli/tests/php_cli_server.inc                                     |   20 
 sapi/cli/tests/php_cli_server_012.phpt                                |    2 
 sapi/cli/tests/php_cli_server_014.phpt                                |    4 
 sapi/cli/tests/php_cli_server_016.phpt                                |    2 
 sapi/cli/tests/php_cli_server_017.phpt                                |    2 
 sapi/fpm/config.m4                                                    |    5 
 sapi/fpm/fpm/fastcgi.c                                                |   14 
 sapi/fpm/fpm/fpm.c                                                    |    9 
 sapi/fpm/fpm/fpm.h                                                    |   33 
 sapi/fpm/fpm/fpm_children.c                                           |    4 
 sapi/fpm/fpm/fpm_conf.c                                               |   48 
 sapi/fpm/fpm/fpm_conf.h                                               |    2 
 sapi/fpm/fpm/fpm_main.c                                               |   90 
 sapi/fpm/fpm/fpm_php.c                                                |   38 
 sapi/fpm/fpm/fpm_php.h                                                |    1 
 sapi/fpm/fpm/fpm_process_ctl.c                                        |    4 
 sapi/fpm/fpm/fpm_shm.c                                                |    2 
 sapi/fpm/fpm/fpm_signals.c                                            |   12 
 sapi/fpm/fpm/fpm_signals.h                                            |    3 
 sapi/fpm/fpm/fpm_sockets.c                                            |   25 
 sapi/fpm/fpm/fpm_sockets.h                                            |    4 
 sapi/fpm/fpm/fpm_status.c                                             |    9 
 sapi/fpm/fpm/fpm_unix.c                                               |  102 
 sapi/fpm/fpm/zlog.c                                                   |   20 
 sapi/fpm/fpm/zlog.h                                                   |    1 
 sapi/fpm/php-fpm.conf.in                                              |   16 
 tests/basic/021.phpt                                                  |    1 
 tests/basic/bug20539.phpt                                             |    3 
 tests/output/ob_013.phpt                                              |    4 
 travis/compile.sh                                                     |   39 
 travis/ext/curl/setup.sh                                              |    5 
 travis/ext/mysql/setup.sh                                             |    2 
 travis/ext/mysqli/setup.sh                                            |    2 
 travis/ext/pdo_mysql/setup.sh                                         |    2 
 travis/ext/pdo_pgsql/setup.sh                                         |    2 
 travis/ext/pgsql/setup.sh                                             |    4 
 win32/build/confutils.js                                              |    4 
 win32/build/mkdist.php                                                |    2 
 win32/registry.c                                                      |   12 
 win32/time.c                                                          |   18 
 458 files changed, 12955 insertions(+), 6762 deletions(-)

New commits:
commit df20808818f052da92c3cb57b5d52149f213dd68
Merge: bf8b584 11a202e
Author: Xinchen Hui <laruence at php.net>
Date:   Sat Jun 16 14:30:21 2012 +0800

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix potential leak in cli server



commit 11a202ef50fdcd92b5cc3b3e1d5a739cd85b7541
Author: stealth35 <jinmoku at hotmail.com>
Date:   Sat Jun 16 00:56:54 2012 +0300

    Fix potential leak in cli server

diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c
index 87ab7b4..876c57a 100644
--- a/sapi/cli/php_cli_server.c
+++ b/sapi/cli/php_cli_server.c
@@ -1826,6 +1826,9 @@ static int php_cli_server_send_error_page(php_cli_server *server, php_cli_server
 	return SUCCESS;
 
 fail:
+	if (errstr) {
+		pefree(errstr, 1);
+	}
 	efree(escaped_request_uri);
 	return FAILURE;
 } /* }}} */


commit bf8b58429b7eafbf76d63e82e55f9b6f29e0b3a6
Merge: b04e814 280e3a4
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu Jun 14 18:04:13 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fixed bug #62312 ext\sockets\tests\socket_import_stream-4.phpt fails



commit 280e3a4ec8616f4a32a5186463d475592d1eebda
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu Jun 14 18:02:53 2012 +0200

    Fixed bug #62312 ext\sockets\tests\socket_import_stream-4.phpt fails

diff --git a/ext/sockets/tests/socket_import_stream-4-win.phpt b/ext/sockets/tests/socket_import_stream-4-win.phpt
new file mode 100644
index 0000000..68b6582
--- /dev/null
+++ b/ext/sockets/tests/socket_import_stream-4-win.phpt
@@ -0,0 +1,106 @@
+--TEST--
+socket_import_stream: effects of closing
+--SKIPIF--
+<?php
+if (!extension_loaded('sockets')) {
+	die('SKIP sockets extension not available.');
+}
+if(substr(PHP_OS, 0, 3) != 'WIN' ) {
+  die("skip Not Valid for Linux");
+}
+
+--FILE--
+<?php
+
+function test($stream, $sock) {
+	if ($stream !== null) {
+		echo "stream_set_blocking ";
+		print_r(stream_set_blocking($stream, 0));
+		echo "\n";
+	}
+	if ($sock !== null) {
+		echo "socket_set_block ";
+		print_r(socket_set_block($sock));
+		echo "\n";
+		echo "socket_get_option ";
+		print_r(socket_get_option($sock, SOL_SOCKET, SO_TYPE));
+		echo "\n";
+	}
+	echo "\n";
+}
+
+echo "normal\n";
+$stream0 = stream_socket_server("udp://0.0.0.0:58380", $errno, $errstr, STREAM_SERVER_BIND);
+$sock0 = socket_import_stream($stream0);
+test($stream0, $sock0);
+
+echo "\nunset stream\n";
+$stream1 = stream_socket_server("udp://0.0.0.0:58381", $errno, $errstr, STREAM_SERVER_BIND);
+$sock1 = socket_import_stream($stream1);
+unset($stream1);
+test(null, $sock1);
+
+echo "\nunset socket\n";
+$stream2 = stream_socket_server("udp://0.0.0.0:58382", $errno, $errstr, STREAM_SERVER_BIND);
+$sock2 = socket_import_stream($stream2);
+unset($sock2);
+test($stream2, null);
+
+echo "\nclose stream\n";
+$stream3 = stream_socket_server("udp://0.0.0.0:58383", $errno, $errstr, STREAM_SERVER_BIND);
+$sock3 = socket_import_stream($stream3);
+fclose($stream3);
+test($stream3, $sock3);
+
+echo "\nclose socket\n";
+$stream4 = stream_socket_server("udp://0.0.0.0:58384", $errno, $errstr, STREAM_SERVER_BIND);
+$sock4 = socket_import_stream($stream4);
+socket_close($sock4);
+test($stream4, $sock4);
+
+echo "Done.\n";
+--EXPECTF--
+normal
+stream_set_blocking 1
+socket_set_block 1
+socket_get_option 2
+
+
+unset stream
+socket_set_block 1
+socket_get_option 2
+
+
+unset socket
+stream_set_blocking 1
+
+
+close stream
+stream_set_blocking 
+Warning: stream_set_blocking(): %d is not a valid stream resource in %s on line %d
+
+socket_set_block 
+Warning: socket_set_block(): An operation was attempted on something that is not a socket.
+ in %ssocket_import_stream-4-win.php on line %d
+
+Warning: socket_set_block(): unable to set blocking mode [0]: The operation completed successfully.
+ in %ssocket_import_stream-4-win.php on line %d
+
+socket_get_option 
+Warning: socket_get_option(): unable to retrieve socket option [0]: An operation was attempted on something that is not a socket.
+ in %ssocket_import_stream-4-win.php on line %d
+
+
+
+close socket
+stream_set_blocking 
+Warning: stream_set_blocking(): %d is not a valid stream resource in %s on line %d
+
+socket_set_block 
+Warning: socket_set_block(): %d is not a valid Socket resource in %s on line %d
+
+socket_get_option 
+Warning: socket_get_option(): %d is not a valid Socket resource in %s on line %d
+
+
+Done.
diff --git a/ext/sockets/tests/socket_import_stream-4.phpt b/ext/sockets/tests/socket_import_stream-4.phpt
index 33ab104..8095d8d 100644
--- a/ext/sockets/tests/socket_import_stream-4.phpt
+++ b/ext/sockets/tests/socket_import_stream-4.phpt
@@ -5,7 +5,9 @@ socket_import_stream: effects of closing
 if (!extension_loaded('sockets')) {
 	die('SKIP sockets extension not available.');
 }
-
+if(substr(PHP_OS, 0, 3) == 'WIN' ) {
+  die("skip Not Valid for Windows");
+}
 --FILE--
 <?php
 


commit b04e8145c94babcfe76247e6ecfb2da41796f6c0
Merge: 74916d8 3faebe2
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu Jun 14 18:01:23 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug #62270 Test bug - ext/fileinfo/tests/finfo_open_error-win32



commit 3faebe2becdbdf0de134ca4e19542b0014fce162
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu Jun 14 17:59:39 2012 +0200

    Fix bug #62270 Test bug - ext/fileinfo/tests/finfo_open_error-win32

diff --git a/ext/fileinfo/tests/finfo_open_error-win32.phpt b/ext/fileinfo/tests/finfo_open_error-win32.phpt
index bd50327..e168b7f 100644
--- a/ext/fileinfo/tests/finfo_open_error-win32.phpt
+++ b/ext/fileinfo/tests/finfo_open_error-win32.phpt
@@ -17,6 +17,7 @@ $magicFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic';
 
 echo "*** Testing finfo_open() : error functionality ***\n";
 
+// on 5_4, this line generates additional warning messages that 5_3 does not. functionally, it should be fine (should pass)
 var_dump( finfo_open( FILEINFO_MIME, 'foobarfile' ) );
 var_dump( finfo_open( array(), $magicFile ) );
 var_dump( finfo_open( FILEINFO_MIME, $magicFile, 'extraArg' ) );
@@ -29,18 +30,30 @@ var_dump( new finfo('foobar') );
 ===DONE===
 --EXPECTF--
 *** Testing finfo_open() : error functionality ***
+
+Warning: finfo_open(%sfoobarfile): failed to open stream: No such file or directory in %sfinfo_open_error-win32.php on line %d
+
+Warning: finfo_open(%sfoobarfile): failed to open stream: No such file or directory in %sfinfo_open_error-win32.php on line %d
+
+Warning: finfo_open(): Failed to load magic database at '%sfoobarfile'. in %sfinfo_open_error-win32.php on line %d
 bool(false)
 
-Warning: finfo_open() expects parameter 1 to be long, array given in %s on line %d
+Warning: finfo_open() expects parameter 1 to be long, array given in %sfinfo_open_error-win32.php on line %d
 bool(false)
 
-Warning: finfo_open() expects at most 2 parameters, 3 given in %s on line %d
+Warning: finfo_open() expects at most 2 parameters, 3 given in %sfinfo_open_error-win32.php on line %d
+bool(false)
+
+Warning: finfo_open(%smagic): failed to open stream: No such file or directory in %sfinfo_open_error-win32.php on line %d
+
+Warning: finfo_open(%smagic): failed to open stream: No such file or directory in %sfinfo_open_error-win32.php on line %d
+
+Warning: finfo_open(): Failed to load magic database at '%smagic'. in %sfinfo_open_error-win32.php on line %d
 bool(false)
-resource(%d) of type (file_info)
 
-Warning: finfo_open() expects parameter 1 to be long, %unicode_string_optional% given in %s on line %d
+Warning: finfo_open() expects parameter 1 to be long, string given in %sfinfo_open_error-win32.php on line %d
 bool(false)
 
-Warning: finfo::finfo() expects parameter 1 to be long, %unicode_string_optional% given in %s on line %d
+Warning: finfo::finfo() expects parameter 1 to be long, string given in %sfinfo_open_error-win32.php on line %d
 NULL
 ===DONE===


commit 74916d8ec86f10cf5efd91559e956da191dfe3e7
Merge: 784b4cd fef691b
Author: Stanislav Malyshev <stas at php.net>
Date:   Wed Jun 13 12:25:04 2012 -0700

    Merge branch 'PHP-5.4'
    
    Merge reverts from 5.4, but shouldn't actually revert anything
    * PHP-5.4:
      Merge PHP 5.3.14 NEWS
      re-add 61755 to NEWS
      re-add 61755 to NEWS
      Revert "Add PBKDF2 support via openssl()"
      Revert "Rename openssl_pkcs5_pbkdf2_hmac() to something that doesn't sound like a spell."
      add CVE



commit 784b4cddc6fc8170c7992d66f70438d2d4353acf
Author: Stanislav Malyshev <stas at php.net>
Date:   Wed Jun 13 12:01:26 2012 -0700

    simplify boolval()

diff --git a/ext/standard/type.c b/ext/standard/type.c
index 59d7314b..f53107e 100644
--- a/ext/standard/type.c
+++ b/ext/standard/type.c
@@ -186,8 +186,7 @@ PHP_FUNCTION(boolval)
 		return;
 	}
 
-	RETVAL_ZVAL(*val, 1, 0);
-	convert_to_boolean(return_value);
+	RETURN_BOOL(zend_is_true(*val));
 }
 /* }}} */
 


commit fef691b142ae1b2a4c93de4f57a757a3d073c7cb
Merge: 79e44c3 26cb570
Author: Johannes Schlüter <johannes at php.net>
Date:   Wed Jun 13 10:36:49 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Merge PHP 5.3.14 NEWS
      re-add 61755 to NEWS



commit 26cb5706155347815cec5b2fb5af968e31fd55e3
Author: Johannes Schlüter <johannes at php.net>
Date:   Wed Jun 13 10:35:58 2012 +0200

    Merge PHP 5.3.14 NEWS

diff --git a/NEWS b/NEWS
index 0541499..0f2dc7e 100644
--- a/NEWS
+++ b/NEWS
@@ -59,9 +59,62 @@ PHP                                                                        NEWS
 - Zip:
   . Upgraded libzip to 0.10.1 (Anatoliy)
 
-?? ??? 2012, PHP 5.3.14
+14 Jun 2012, PHP 5.3.14
 
-(merge after release)
+- CLI SAPI:
+  . Fixed bug #61546 (functions related to current script failed when chdir() 
+    in cli sapi). (Laruence, reeze.xia at gmail.com)
+
+- CURL:
+  . Fixed bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction).
+    (Laruence)
+
+- COM:
+  . Fixed bug #62146 com_dotnet cannot be built shared. (Johannes)
+
+- Core:
+  . Fixed CVE-2012-2143. (Solar Designer)
+  . Fixed bug #62005 (unexpected behavior when incrementally assigning to a 
+    member of a null object). (Laruence)
+  . Fixed bug #61730 (Segfault from array_walk modifying an array passed by
+    reference). (Laruence)
+  . Fixed missing bound check in iptcparse(). (chris at chiappa.net)
+  . Fixed bug #61764 ('I' unpacks n as signed if n > 2^31-1 on LP64). (Gustavo)
+  . Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename
+    set to null). (Anatoliy)
+  . Fixed bug #61713 (Logic error in charset detection for htmlentities).
+    (Anatoliy)
+  . Fixed bug #61991 (long overflow in realpath_cache_get()). (Anatoliy)
+  . Changed php://fd to be available only for CLI.
+
+- Fileinfo:
+  . Fixed bug #61812 (Uninitialised value used in libmagic). 
+    (Laruence, Gustavo)
+
+- Iconv extension:
+  . Fixed a bug that iconv extension fails to link to the correct library
+    when another extension makes use of a library that links to the iconv
+    library. See https://bugs.gentoo.org/show_bug.cgi?id=364139 for detail.
+    (Moriyoshi)
+
+- Intl:
+  . Fixed bug #62082 (Memory corruption in internal function
+    get_icu_disp_value_src_php()). (Gustavo)
+
+- JSON
+  . Fixed bug #61537 (json_encode() incorrectly truncates/discards
+    information). (Adam)
+
+- PDO:
+  . Fixed bug #61755 (A parsing bug in the prepared statements can lead to
+    access violations). (Johannes)
+
+- Phar:
+  . Fix bug #61065 (Secunia SA44335). (Rasmus)
+
+- Streams:
+  . Fixed bug #61961 (file_get_contents leaks when access empty file with
+    maxlen set). (Reeze)
 
 08 May 2012, PHP 5.3.13
 - CGI


commit 79e44c394fe34c4c902b8a25ffac27a178ab5211
Author: Stanislav Malyshev <stas at php.net>
Date:   Tue Jun 12 11:53:24 2012 -0700

    re-add 61755 to NEWS

diff --git a/NEWS b/NEWS
index 4950763..dfad253 100644
--- a/NEWS
+++ b/NEWS
@@ -112,6 +112,10 @@ PHP                                                                        NEWS
     set to null). (Anatoliy)
   . Changed php://fd to be available only for CLI.
 
+- PDO:
+  . Fixed bug #61755 (A parsing bug in the prepared statements can lead to
+    access violations). (Johannes)
+
 - Phar:
   . Fix bug #61065 (Secunia SA44335, CVE-2012-2386). (Rasmus)
 


commit f0d6059389c0d00e6fa4a890b69d422aab8c3b0d
Author: Stanislav Malyshev <stas at php.net>
Date:   Tue Jun 12 11:49:35 2012 -0700

    re-add 61755 to NEWS

diff --git a/NEWS b/NEWS
index 380979b..0541499 100644
--- a/NEWS
+++ b/NEWS
@@ -42,6 +42,10 @@ PHP                                                                        NEWS
     pattern). (Gustavo)
   . Fixed bug #60785 (memory leak in IntlDateFormatter constructor). (Gustavo)
   
+- PDO:
+  . Fixed bug #61755 (A parsing bug in the prepared statements can lead to
+    access violations). (Johannes)
+
 - Phar:
   . Fixed bug #62227 (Invalid phar stream path causes crash). (Felipe)
 


commit c7be96b08fb457f8a2b4e2a64f59437b230886c1
Author: Stanislav Malyshev <stas at php.net>
Date:   Tue Jun 12 11:22:49 2012 -0700

    Revert "Add PBKDF2 support via openssl()"
    
    This reverts commit b5b8ea1050837fba5a6cee55e41b4574ed64158e.
    Looks like we don't have agreement yet on this for 5.4. Let's keep it in 5.5 for now.

diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 28f7618..7187a96 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -242,16 +242,6 @@ ZEND_BEGIN_ARG_INFO(arginfo_openssl_pkey_get_details, 0)
     ZEND_ARG_INFO(0, key)
 ZEND_END_ARG_INFO()
 
-#if OPENSSL_VERSION_NUMBER >= 0x10000000L
-ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pkcs5_pbkdf2_hmac, 0, 0, 4)
-    ZEND_ARG_INFO(0, password)
-    ZEND_ARG_INFO(0, salt)
-    ZEND_ARG_INFO(0, key_length)
-    ZEND_ARG_INFO(0, iterations)
-    ZEND_ARG_INFO(0, digest_algorithm)
-ZEND_END_ARG_INFO()
-#endif
-
 ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pkcs7_verify, 0, 0, 2)
     ZEND_ARG_INFO(0, filename)
     ZEND_ARG_INFO(0, flags)
@@ -438,10 +428,6 @@ const zend_function_entry openssl_functions[] = {
 	PHP_FE(openssl_seal,				arginfo_openssl_seal)
 	PHP_FE(openssl_open,				arginfo_openssl_open)
 
-#if OPENSSL_VERSION_NUMBER >= 0x10000000L
-	PHP_FE(openssl_pkcs5_pbkdf2_hmac,	arginfo_openssl_pkcs5_pbkdf2_hmac)
-#endif
-
 /* for S/MIME handling */
 	PHP_FE(openssl_pkcs7_verify,		arginfo_openssl_pkcs7_verify)
 	PHP_FE(openssl_pkcs7_decrypt,		arginfo_openssl_pkcs7_decrypt)
@@ -3331,57 +3317,6 @@ PHP_FUNCTION(openssl_pkey_get_details)
 
 /* }}} */
 
-#if OPENSSL_VERSION_NUMBER >= 0x10000000L
-
-/* {{{ proto string openssl_pkcs5_pbkdf2_hmac(string password, string salt, long key_length, long iterations [, string digest_method = "sha1"])
-   Generates a PKCS5 v2 PBKDF2 string, defaults to sha1 */
-PHP_FUNCTION(openssl_pkcs5_pbkdf2_hmac)
-{
-	long key_length = 0, iterations = 0;
-	char *password; int password_len;
-	char *salt; int salt_len;
-	char *method; int method_len = 0;
-	unsigned char *out_buffer;
-
-	const EVP_MD *digest;
-
-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssll|s",
-				&password, &password_len,
-				&salt, &salt_len,
-				&key_length, &iterations,
-				&method, &method_len) == FAILURE) {
-		return;
-	}
-
-	if (key_length <= 0) {
-		RETURN_FALSE;
-	}
-
-	if (method_len) {
-		digest = EVP_get_digestbyname(method);
-	} else {
-		digest = EVP_sha1();
-	}
-
-	if (!digest) {
-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm");
-		RETURN_FALSE;
-	}
-
-	out_buffer = emalloc(key_length + 1);
-	out_buffer[key_length] = '\0';
-
-	if (PKCS5_PBKDF2_HMAC(password, password_len, (unsigned char *)salt, salt_len, iterations, digest, key_length, out_buffer) == 1) {
-		RETVAL_STRINGL((char *)out_buffer, key_length, 0);
-	} else {
-		efree(out_buffer);
-		RETURN_FALSE;
-	}
-}
-/* }}} */
-
-#endif
-
 /* {{{ PKCS7 S/MIME functions */
 
 /* {{{ proto bool openssl_pkcs7_verify(string filename, long flags [, string signerscerts [, array cainfo [, string extracerts [, string content]]]])
diff --git a/ext/openssl/php_openssl.h b/ext/openssl/php_openssl.h
index 0dbe7d2..fc118db 100644
--- a/ext/openssl/php_openssl.h
+++ b/ext/openssl/php_openssl.h
@@ -52,8 +52,6 @@ PHP_FUNCTION(openssl_private_decrypt);
 PHP_FUNCTION(openssl_public_encrypt);
 PHP_FUNCTION(openssl_public_decrypt);
 
-PHP_FUNCTION(openssl_pkcs5_pbkdf2_hmac);
-
 PHP_FUNCTION(openssl_pkcs7_verify);
 PHP_FUNCTION(openssl_pkcs7_decrypt);
 PHP_FUNCTION(openssl_pkcs7_sign);
diff --git a/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt b/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt
deleted file mode 100644
index af1fcb1..0000000
--- a/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt
+++ /dev/null
@@ -1,26 +0,0 @@
---TEST--
-openssl_pkcs5_pbkdf2_hmac() tests
---SKIPIF--
-<?php if (!extension_loaded("openssl") || !function_exists("openssl_pkcs5_pbkdf2_hmac")) print "skip"; ?>
---FILE--
-<?php
-// official test vectors
-var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 1)));
-var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 2)));
-var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 4096)));
-
-/* really slow but should be:
-string(40) "eefe3d61cd4da4e4e9945b3d6ba2158c2634e984"
-var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 16777216)));
-*/
-
-var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('passwordPASSWORDpassword', 'saltSALTsaltSALTsaltSALTsaltSALTsalt', 25, 4096)));
-var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac("pass\0word", "sa\0lt", 16, 4096)));
-
-?>
---EXPECTF--
-string(40) "0c60c80f961f0e71f3a9b524af6012062fe037a6"
-string(40) "ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957"
-string(40) "4b007901b765489abead49d926f721d065a429c1"
-string(50) "3d2eec4fe41c849b80c8d83662c0e44a8b291a964cf2f07038"
-string(32) "56fa6aa75548099dcc37d7f03425e0c3"


commit a2bfad051df022058f19afc5f09fd835cbbcf145
Author: Stanislav Malyshev <stas at php.net>
Date:   Tue Jun 12 11:21:54 2012 -0700

    Revert "Rename openssl_pkcs5_pbkdf2_hmac() to something that doesn't sound like a spell."
    
    This reverts commit bccd1e672fabc3c788e93075221d47d9f077b167.
    Looks like we don't have agreement yet on this for 5.4. Let's keep it in 5.5 for now.

diff --git a/ext/openssl/CREDITS b/ext/openssl/CREDITS
index b685ce1..c2f50d6 100644
--- a/ext/openssl/CREDITS
+++ b/ext/openssl/CREDITS
@@ -1,2 +1,2 @@
 OpenSSL
-Stig Venaas, Wez Furlong, Sascha Kettler, Scott MacVicar
+Stig Venaas, Wez Furlong, Sascha Kettler
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 4d482e8..28f7618 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -243,7 +243,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_openssl_pkey_get_details, 0)
 ZEND_END_ARG_INFO()
 
 #if OPENSSL_VERSION_NUMBER >= 0x10000000L
-ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pbkdf2, 0, 0, 4)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pkcs5_pbkdf2_hmac, 0, 0, 4)
     ZEND_ARG_INFO(0, password)
     ZEND_ARG_INFO(0, salt)
     ZEND_ARG_INFO(0, key_length)
@@ -439,7 +439,7 @@ const zend_function_entry openssl_functions[] = {
 	PHP_FE(openssl_open,				arginfo_openssl_open)
 
 #if OPENSSL_VERSION_NUMBER >= 0x10000000L
-	PHP_FE(openssl_pbkdf2,	arginfo_openssl_pbkdf2)
+	PHP_FE(openssl_pkcs5_pbkdf2_hmac,	arginfo_openssl_pkcs5_pbkdf2_hmac)
 #endif
 
 /* for S/MIME handling */
@@ -3333,9 +3333,9 @@ PHP_FUNCTION(openssl_pkey_get_details)
 
 #if OPENSSL_VERSION_NUMBER >= 0x10000000L
 
-/* {{{ proto string openssl_pbkdf2(string password, string salt, long key_length, long iterations [, string digest_method = "sha1"])
+/* {{{ proto string openssl_pkcs5_pbkdf2_hmac(string password, string salt, long key_length, long iterations [, string digest_method = "sha1"])
    Generates a PKCS5 v2 PBKDF2 string, defaults to sha1 */
-PHP_FUNCTION(openssl_pbkdf2)
+PHP_FUNCTION(openssl_pkcs5_pbkdf2_hmac)
 {
 	long key_length = 0, iterations = 0;
 	char *password; int password_len;
diff --git a/ext/openssl/php_openssl.h b/ext/openssl/php_openssl.h
index 2de211a..0dbe7d2 100644
--- a/ext/openssl/php_openssl.h
+++ b/ext/openssl/php_openssl.h
@@ -52,7 +52,7 @@ PHP_FUNCTION(openssl_private_decrypt);
 PHP_FUNCTION(openssl_public_encrypt);
 PHP_FUNCTION(openssl_public_decrypt);
 
-PHP_FUNCTION(openssl_pbkdf2);
+PHP_FUNCTION(openssl_pkcs5_pbkdf2_hmac);
 
 PHP_FUNCTION(openssl_pkcs7_verify);
 PHP_FUNCTION(openssl_pkcs7_decrypt);
diff --git a/ext/openssl/tests/openssl_pbkdf2.phpt b/ext/openssl/tests/openssl_pbkdf2.phpt
deleted file mode 100644
index 3ec4dce..0000000
--- a/ext/openssl/tests/openssl_pbkdf2.phpt
+++ /dev/null
@@ -1,26 +0,0 @@
---TEST--
-openssl_pbkdf2() tests
---SKIPIF--
-<?php if (!extension_loaded("openssl") || !function_exists("openssl_pbkdf2")) print "skip"; ?>
---FILE--
-<?php
-// official test vectors
-var_dump(bin2hex(openssl_pbkdf2('password', 'salt', 20, 1)));
-var_dump(bin2hex(openssl_pbkdf2('password', 'salt', 20, 2)));
-var_dump(bin2hex(openssl_pbkdf2('password', 'salt', 20, 4096)));
-
-/* really slow but should be:
-string(40) "eefe3d61cd4da4e4e9945b3d6ba2158c2634e984"
-var_dump(bin2hex(openssl_pbkdf2('password', 'salt', 20, 16777216)));
-*/
-
-var_dump(bin2hex(openssl_pbkdf2('passwordPASSWORDpassword', 'saltSALTsaltSALTsaltSALTsaltSALTsalt', 25, 4096)));
-var_dump(bin2hex(openssl_pbkdf2("pass\0word", "sa\0lt", 16, 4096)));
-
-?>
---EXPECTF--
-string(40) "0c60c80f961f0e71f3a9b524af6012062fe037a6"
-string(40) "ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957"
-string(40) "4b007901b765489abead49d926f721d065a429c1"
-string(50) "3d2eec4fe41c849b80c8d83662c0e44a8b291a964cf2f07038"
-string(32) "56fa6aa75548099dcc37d7f03425e0c3"
diff --git a/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt b/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt
new file mode 100644
index 0000000..af1fcb1
--- /dev/null
+++ b/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt
@@ -0,0 +1,26 @@
+--TEST--
+openssl_pkcs5_pbkdf2_hmac() tests
+--SKIPIF--
+<?php if (!extension_loaded("openssl") || !function_exists("openssl_pkcs5_pbkdf2_hmac")) print "skip"; ?>
+--FILE--
+<?php
+// official test vectors
+var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 1)));
+var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 2)));
+var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 4096)));
+
+/* really slow but should be:
+string(40) "eefe3d61cd4da4e4e9945b3d6ba2158c2634e984"
+var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 16777216)));
+*/
+
+var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('passwordPASSWORDpassword', 'saltSALTsaltSALTsaltSALTsaltSALTsalt', 25, 4096)));
+var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac("pass\0word", "sa\0lt", 16, 4096)));
+
+?>
+--EXPECTF--
+string(40) "0c60c80f961f0e71f3a9b524af6012062fe037a6"
+string(40) "ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957"
+string(40) "4b007901b765489abead49d926f721d065a429c1"
+string(50) "3d2eec4fe41c849b80c8d83662c0e44a8b291a964cf2f07038"
+string(32) "56fa6aa75548099dcc37d7f03425e0c3"


commit f8cc363841ecd126c0c43f2773e4d85a54b8484c
Author: Stanislav Malyshev <stas at php.net>
Date:   Tue Jun 12 11:18:43 2012 -0700

    add CVE

diff --git a/NEWS b/NEWS
index b91b5d7..4950763 100644
--- a/NEWS
+++ b/NEWS
@@ -7,8 +7,8 @@ PHP                                                                        NEWS
     crash during execution). (Dmitry)
   . Fixed bug #51094 (parse_ini_file() with INI_SCANNER_RAW cuts a value that
     includes a semi-colon). (Pierrick)
-  . Fixed potential overflow in _php_stream_scandir. (Jason Powell,
-    Stas)
+  . Fixed potential overflow in _php_stream_scandir (CVE-2012-2688). 
+    (Jason Powell, Stas)
 
 - EXIF:
   . Fixed information leak in ext exif (discovered by Martin Noga, 


commit 5b3c9f4fd1fbaa251beea37ff7870f6523320672
Author: Scott MacVicar <scottmac at php.net>
Date:   Mon Jun 11 16:23:27 2012 -0700

    One more time

diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index d0ed15e..938e0e1 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -3328,10 +3328,7 @@ PHP_FUNCTION(openssl_pkey_get_details)
 /* }}} */
 
 #if OPENSSL_VERSION_NUMBER >= 0x10000000L
-<<<<<<< HEAD
-=======
 
->>>>>>> 5.4
 /* {{{ proto string openssl_pbkdf2(string password, string salt, long key_length, long iterations [, string digest_method = "sha1"])
    Generates a PKCS5 v2 PBKDF2 string, defaults to sha1 */
 PHP_FUNCTION(openssl_pbkdf2)


commit bcd671d999bcb9aac3691c59e632d91575ea87a0
Merge: aadf59d bccd1e6
Author: Scott MacVicar <scottmac at php.net>
Date:   Mon Jun 11 16:04:01 2012 -0700

    Merge branch '5.4'
    
    * 5.4:
      Rename openssl_pkcs5_pbkdf2_hmac() to something that doesn't sound like a spell.
      Add PBKDF2 support via openssl()
    
    Conflicts:
    	ext/openssl/openssl.c

diff --cc ext/openssl/openssl.c
index f7db37b,4d482e8..d0ed15e
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@@ -3328,6 -3332,7 +3328,10 @@@ PHP_FUNCTION(openssl_pkey_get_details
  /* }}} */
  
  #if OPENSSL_VERSION_NUMBER >= 0x10000000L
++<<<<<<< HEAD
++=======
+ 
++>>>>>>> 5.4
  /* {{{ proto string openssl_pbkdf2(string password, string salt, long key_length, long iterations [, string digest_method = "sha1"])
     Generates a PKCS5 v2 PBKDF2 string, defaults to sha1 */
  PHP_FUNCTION(openssl_pbkdf2)


commit aadf59dfa4be09147671de33786dc157716705df
Author: Scott MacVicar <scottmac at php.net>
Date:   Mon Jun 11 00:16:30 2012 -0700

    Add PBKDF2 support via openssl()
    
    Summary:
    No easy way to put these in the hash extension since we don't really support optional
    parameters to certain algorithms. Implemented in openssl for now since it has it already
    and is pretty stable.
    
    Only SHA1 is confirmed to work as an algorithm but openssl has a parameter so it can be
    changed in the future.
    
    Will backport to 5.4 potentially with Stas' approval.
    
    Test Plan:
    Ran newly added tests which came from RFC 6070

diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 938e0e1..f7db37b 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -3328,7 +3328,6 @@ PHP_FUNCTION(openssl_pkey_get_details)
 /* }}} */
 
 #if OPENSSL_VERSION_NUMBER >= 0x10000000L
-
 /* {{{ proto string openssl_pbkdf2(string password, string salt, long key_length, long iterations [, string digest_method = "sha1"])
    Generates a PKCS5 v2 PBKDF2 string, defaults to sha1 */
 PHP_FUNCTION(openssl_pbkdf2)


commit bccd1e672fabc3c788e93075221d47d9f077b167
Author: Scott MacVicar <scottmac at php.net>
Date:   Mon Jun 11 12:38:54 2012 -0700

    Rename openssl_pkcs5_pbkdf2_hmac() to something that doesn't sound like a spell.
    
    Summary:
    Stas pointed out that this is named pretty poorly. Go for openssl_pbkdf2()

diff --git a/ext/openssl/CREDITS b/ext/openssl/CREDITS
index c2f50d6..b685ce1 100644
--- a/ext/openssl/CREDITS
+++ b/ext/openssl/CREDITS
@@ -1,2 +1,2 @@
 OpenSSL
-Stig Venaas, Wez Furlong, Sascha Kettler
+Stig Venaas, Wez Furlong, Sascha Kettler, Scott MacVicar
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 28f7618..4d482e8 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -243,7 +243,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_openssl_pkey_get_details, 0)
 ZEND_END_ARG_INFO()
 
 #if OPENSSL_VERSION_NUMBER >= 0x10000000L
-ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pkcs5_pbkdf2_hmac, 0, 0, 4)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pbkdf2, 0, 0, 4)
     ZEND_ARG_INFO(0, password)
     ZEND_ARG_INFO(0, salt)
     ZEND_ARG_INFO(0, key_length)
@@ -439,7 +439,7 @@ const zend_function_entry openssl_functions[] = {
 	PHP_FE(openssl_open,				arginfo_openssl_open)
 
 #if OPENSSL_VERSION_NUMBER >= 0x10000000L
-	PHP_FE(openssl_pkcs5_pbkdf2_hmac,	arginfo_openssl_pkcs5_pbkdf2_hmac)
+	PHP_FE(openssl_pbkdf2,	arginfo_openssl_pbkdf2)
 #endif
 
 /* for S/MIME handling */
@@ -3333,9 +3333,9 @@ PHP_FUNCTION(openssl_pkey_get_details)
 
 #if OPENSSL_VERSION_NUMBER >= 0x10000000L
 
-/* {{{ proto string openssl_pkcs5_pbkdf2_hmac(string password, string salt, long key_length, long iterations [, string digest_method = "sha1"])
+/* {{{ proto string openssl_pbkdf2(string password, string salt, long key_length, long iterations [, string digest_method = "sha1"])
    Generates a PKCS5 v2 PBKDF2 string, defaults to sha1 */
-PHP_FUNCTION(openssl_pkcs5_pbkdf2_hmac)
+PHP_FUNCTION(openssl_pbkdf2)
 {
 	long key_length = 0, iterations = 0;
 	char *password; int password_len;
diff --git a/ext/openssl/php_openssl.h b/ext/openssl/php_openssl.h
index 0dbe7d2..2de211a 100644
--- a/ext/openssl/php_openssl.h
+++ b/ext/openssl/php_openssl.h
@@ -52,7 +52,7 @@ PHP_FUNCTION(openssl_private_decrypt);
 PHP_FUNCTION(openssl_public_encrypt);
 PHP_FUNCTION(openssl_public_decrypt);
 
-PHP_FUNCTION(openssl_pkcs5_pbkdf2_hmac);
+PHP_FUNCTION(openssl_pbkdf2);
 
 PHP_FUNCTION(openssl_pkcs7_verify);
 PHP_FUNCTION(openssl_pkcs7_decrypt);
diff --git a/ext/openssl/tests/openssl_pbkdf2.phpt b/ext/openssl/tests/openssl_pbkdf2.phpt
new file mode 100644
index 0000000..3ec4dce
--- /dev/null
+++ b/ext/openssl/tests/openssl_pbkdf2.phpt
@@ -0,0 +1,26 @@
+--TEST--
+openssl_pbkdf2() tests
+--SKIPIF--
+<?php if (!extension_loaded("openssl") || !function_exists("openssl_pbkdf2")) print "skip"; ?>
+--FILE--
+<?php
+// official test vectors
+var_dump(bin2hex(openssl_pbkdf2('password', 'salt', 20, 1)));
+var_dump(bin2hex(openssl_pbkdf2('password', 'salt', 20, 2)));
+var_dump(bin2hex(openssl_pbkdf2('password', 'salt', 20, 4096)));
+
+/* really slow but should be:
+string(40) "eefe3d61cd4da4e4e9945b3d6ba2158c2634e984"
+var_dump(bin2hex(openssl_pbkdf2('password', 'salt', 20, 16777216)));
+*/
+
+var_dump(bin2hex(openssl_pbkdf2('passwordPASSWORDpassword', 'saltSALTsaltSALTsaltSALTsaltSALTsalt', 25, 4096)));
+var_dump(bin2hex(openssl_pbkdf2("pass\0word", "sa\0lt", 16, 4096)));
+
+?>
+--EXPECTF--
+string(40) "0c60c80f961f0e71f3a9b524af6012062fe037a6"
+string(40) "ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957"
+string(40) "4b007901b765489abead49d926f721d065a429c1"
+string(50) "3d2eec4fe41c849b80c8d83662c0e44a8b291a964cf2f07038"
+string(32) "56fa6aa75548099dcc37d7f03425e0c3"
diff --git a/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt b/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt
deleted file mode 100644
index af1fcb1..0000000
--- a/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt
+++ /dev/null
@@ -1,26 +0,0 @@
---TEST--
-openssl_pkcs5_pbkdf2_hmac() tests
---SKIPIF--
-<?php if (!extension_loaded("openssl") || !function_exists("openssl_pkcs5_pbkdf2_hmac")) print "skip"; ?>
---FILE--
-<?php
-// official test vectors
-var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 1)));
-var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 2)));
-var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 4096)));
-
-/* really slow but should be:
-string(40) "eefe3d61cd4da4e4e9945b3d6ba2158c2634e984"
-var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 16777216)));
-*/
-
-var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('passwordPASSWORDpassword', 'saltSALTsaltSALTsaltSALTsaltSALTsalt', 25, 4096)));
-var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac("pass\0word", "sa\0lt", 16, 4096)));
-
-?>
---EXPECTF--
-string(40) "0c60c80f961f0e71f3a9b524af6012062fe037a6"
-string(40) "ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957"
-string(40) "4b007901b765489abead49d926f721d065a429c1"
-string(50) "3d2eec4fe41c849b80c8d83662c0e44a8b291a964cf2f07038"
-string(32) "56fa6aa75548099dcc37d7f03425e0c3"


commit b5b8ea1050837fba5a6cee55e41b4574ed64158e
Author: Scott MacVicar <scottmac at php.net>
Date:   Mon Jun 11 00:16:30 2012 -0700

    Add PBKDF2 support via openssl()
    
    Summary:
    No easy way to put these in the hash extension since we don't really support optional
    parameters to certain algorithms. Implemented in openssl for now since it has it already
    and is pretty stable.
    
    Only SHA1 is confirmed to work as an algorithm but openssl has a parameter so it can be
    changed in the future.
    
    Will backport to 5.4 potentially with Stas' approval.
    
    Test Plan:
    Ran newly added tests which came from RFC 6070

diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 7187a96..28f7618 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -242,6 +242,16 @@ ZEND_BEGIN_ARG_INFO(arginfo_openssl_pkey_get_details, 0)
     ZEND_ARG_INFO(0, key)
 ZEND_END_ARG_INFO()
 
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pkcs5_pbkdf2_hmac, 0, 0, 4)
+    ZEND_ARG_INFO(0, password)
+    ZEND_ARG_INFO(0, salt)
+    ZEND_ARG_INFO(0, key_length)
+    ZEND_ARG_INFO(0, iterations)
+    ZEND_ARG_INFO(0, digest_algorithm)
+ZEND_END_ARG_INFO()
+#endif
+
 ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pkcs7_verify, 0, 0, 2)
     ZEND_ARG_INFO(0, filename)
     ZEND_ARG_INFO(0, flags)
@@ -428,6 +438,10 @@ const zend_function_entry openssl_functions[] = {
 	PHP_FE(openssl_seal,				arginfo_openssl_seal)
 	PHP_FE(openssl_open,				arginfo_openssl_open)
 
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+	PHP_FE(openssl_pkcs5_pbkdf2_hmac,	arginfo_openssl_pkcs5_pbkdf2_hmac)
+#endif
+
 /* for S/MIME handling */
 	PHP_FE(openssl_pkcs7_verify,		arginfo_openssl_pkcs7_verify)
 	PHP_FE(openssl_pkcs7_decrypt,		arginfo_openssl_pkcs7_decrypt)
@@ -3317,6 +3331,57 @@ PHP_FUNCTION(openssl_pkey_get_details)
 
 /* }}} */
 
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+
+/* {{{ proto string openssl_pkcs5_pbkdf2_hmac(string password, string salt, long key_length, long iterations [, string digest_method = "sha1"])
+   Generates a PKCS5 v2 PBKDF2 string, defaults to sha1 */
+PHP_FUNCTION(openssl_pkcs5_pbkdf2_hmac)
+{
+	long key_length = 0, iterations = 0;
+	char *password; int password_len;
+	char *salt; int salt_len;
+	char *method; int method_len = 0;
+	unsigned char *out_buffer;
+
+	const EVP_MD *digest;
+
+	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssll|s",
+				&password, &password_len,
+				&salt, &salt_len,
+				&key_length, &iterations,
+				&method, &method_len) == FAILURE) {
+		return;
+	}
+
+	if (key_length <= 0) {
+		RETURN_FALSE;
+	}
+
+	if (method_len) {
+		digest = EVP_get_digestbyname(method);
+	} else {
+		digest = EVP_sha1();
+	}
+
+	if (!digest) {
+		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm");
+		RETURN_FALSE;
+	}
+
+	out_buffer = emalloc(key_length + 1);
+	out_buffer[key_length] = '\0';
+
+	if (PKCS5_PBKDF2_HMAC(password, password_len, (unsigned char *)salt, salt_len, iterations, digest, key_length, out_buffer) == 1) {
+		RETVAL_STRINGL((char *)out_buffer, key_length, 0);
+	} else {
+		efree(out_buffer);
+		RETURN_FALSE;
+	}
+}
+/* }}} */
+
+#endif
+
 /* {{{ PKCS7 S/MIME functions */
 
 /* {{{ proto bool openssl_pkcs7_verify(string filename, long flags [, string signerscerts [, array cainfo [, string extracerts [, string content]]]])
diff --git a/ext/openssl/php_openssl.h b/ext/openssl/php_openssl.h
index fc118db..0dbe7d2 100644
--- a/ext/openssl/php_openssl.h
+++ b/ext/openssl/php_openssl.h
@@ -52,6 +52,8 @@ PHP_FUNCTION(openssl_private_decrypt);
 PHP_FUNCTION(openssl_public_encrypt);
 PHP_FUNCTION(openssl_public_decrypt);
 
+PHP_FUNCTION(openssl_pkcs5_pbkdf2_hmac);
+
 PHP_FUNCTION(openssl_pkcs7_verify);
 PHP_FUNCTION(openssl_pkcs7_decrypt);
 PHP_FUNCTION(openssl_pkcs7_sign);
diff --git a/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt b/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt
new file mode 100644
index 0000000..af1fcb1
--- /dev/null
+++ b/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt
@@ -0,0 +1,26 @@
+--TEST--
+openssl_pkcs5_pbkdf2_hmac() tests
+--SKIPIF--
+<?php if (!extension_loaded("openssl") || !function_exists("openssl_pkcs5_pbkdf2_hmac")) print "skip"; ?>
+--FILE--
+<?php
+// official test vectors
+var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 1)));
+var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 2)));
+var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 4096)));
+
+/* really slow but should be:
+string(40) "eefe3d61cd4da4e4e9945b3d6ba2158c2634e984"
+var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 16777216)));
+*/
+
+var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('passwordPASSWORDpassword', 'saltSALTsaltSALTsaltSALTsaltSALTsalt', 25, 4096)));
+var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac("pass\0word", "sa\0lt", 16, 4096)));
+
+?>
+--EXPECTF--
+string(40) "0c60c80f961f0e71f3a9b524af6012062fe037a6"
+string(40) "ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957"
+string(40) "4b007901b765489abead49d926f721d065a429c1"
+string(50) "3d2eec4fe41c849b80c8d83662c0e44a8b291a964cf2f07038"
+string(32) "56fa6aa75548099dcc37d7f03425e0c3"


commit b481ebae5503c54f31d73ef0e2243f5ef9025d0d
Author: Scott MacVicar <scottmac at php.net>
Date:   Mon Jun 11 12:38:54 2012 -0700

    Rename openssl_pkcs5_pbkdf2_hmac() to something that doesn't sound like a spell.
    
    Summary:
    Stas pointed out that this is named pretty poorly. Go for openssl_pbkdf2()

diff --git a/ext/openssl/CREDITS b/ext/openssl/CREDITS
index c2f50d6..b685ce1 100644
--- a/ext/openssl/CREDITS
+++ b/ext/openssl/CREDITS
@@ -1,2 +1,2 @@
 OpenSSL
-Stig Venaas, Wez Furlong, Sascha Kettler
+Stig Venaas, Wez Furlong, Sascha Kettler, Scott MacVicar
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 1f515c7..938e0e1 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -239,7 +239,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_openssl_pkey_get_details, 0)
 ZEND_END_ARG_INFO()
 
 #if OPENSSL_VERSION_NUMBER >= 0x10000000L
-ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pkcs5_pbkdf2_hmac, 0, 0, 4)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pbkdf2, 0, 0, 4)
     ZEND_ARG_INFO(0, password)
     ZEND_ARG_INFO(0, salt)
     ZEND_ARG_INFO(0, key_length)
@@ -435,7 +435,7 @@ const zend_function_entry openssl_functions[] = {
 	PHP_FE(openssl_open,				arginfo_openssl_open)
 
 #if OPENSSL_VERSION_NUMBER >= 0x10000000L
-	PHP_FE(openssl_pkcs5_pbkdf2_hmac,	arginfo_openssl_pkcs5_pbkdf2_hmac)
+	PHP_FE(openssl_pbkdf2,	arginfo_openssl_pbkdf2)
 #endif
 
 /* for S/MIME handling */
@@ -3329,9 +3329,9 @@ PHP_FUNCTION(openssl_pkey_get_details)
 
 #if OPENSSL_VERSION_NUMBER >= 0x10000000L
 
-/* {{{ proto string openssl_pkcs5_pbkdf2_hmac(string password, string salt, long key_length, long iterations [, string digest_method = "sha1"])
+/* {{{ proto string openssl_pbkdf2(string password, string salt, long key_length, long iterations [, string digest_method = "sha1"])
    Generates a PKCS5 v2 PBKDF2 string, defaults to sha1 */
-PHP_FUNCTION(openssl_pkcs5_pbkdf2_hmac)
+PHP_FUNCTION(openssl_pbkdf2)
 {
 	long key_length = 0, iterations = 0;
 	char *password; int password_len;
diff --git a/ext/openssl/php_openssl.h b/ext/openssl/php_openssl.h
index 0dbe7d2..2de211a 100644
--- a/ext/openssl/php_openssl.h
+++ b/ext/openssl/php_openssl.h
@@ -52,7 +52,7 @@ PHP_FUNCTION(openssl_private_decrypt);
 PHP_FUNCTION(openssl_public_encrypt);
 PHP_FUNCTION(openssl_public_decrypt);
 
-PHP_FUNCTION(openssl_pkcs5_pbkdf2_hmac);
+PHP_FUNCTION(openssl_pbkdf2);
 
 PHP_FUNCTION(openssl_pkcs7_verify);
 PHP_FUNCTION(openssl_pkcs7_decrypt);
diff --git a/ext/openssl/tests/openssl_pbkdf2.phpt b/ext/openssl/tests/openssl_pbkdf2.phpt
new file mode 100644
index 0000000..3ec4dce
--- /dev/null
+++ b/ext/openssl/tests/openssl_pbkdf2.phpt
@@ -0,0 +1,26 @@
+--TEST--
+openssl_pbkdf2() tests
+--SKIPIF--
+<?php if (!extension_loaded("openssl") || !function_exists("openssl_pbkdf2")) print "skip"; ?>
+--FILE--
+<?php
+// official test vectors
+var_dump(bin2hex(openssl_pbkdf2('password', 'salt', 20, 1)));
+var_dump(bin2hex(openssl_pbkdf2('password', 'salt', 20, 2)));
+var_dump(bin2hex(openssl_pbkdf2('password', 'salt', 20, 4096)));
+
+/* really slow but should be:
+string(40) "eefe3d61cd4da4e4e9945b3d6ba2158c2634e984"
+var_dump(bin2hex(openssl_pbkdf2('password', 'salt', 20, 16777216)));
+*/
+
+var_dump(bin2hex(openssl_pbkdf2('passwordPASSWORDpassword', 'saltSALTsaltSALTsaltSALTsaltSALTsalt', 25, 4096)));
+var_dump(bin2hex(openssl_pbkdf2("pass\0word", "sa\0lt", 16, 4096)));
+
+?>
+--EXPECTF--
+string(40) "0c60c80f961f0e71f3a9b524af6012062fe037a6"
+string(40) "ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957"
+string(40) "4b007901b765489abead49d926f721d065a429c1"
+string(50) "3d2eec4fe41c849b80c8d83662c0e44a8b291a964cf2f07038"
+string(32) "56fa6aa75548099dcc37d7f03425e0c3"
diff --git a/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt b/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt
deleted file mode 100644
index af1fcb1..0000000
--- a/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt
+++ /dev/null
@@ -1,26 +0,0 @@
---TEST--
-openssl_pkcs5_pbkdf2_hmac() tests
---SKIPIF--
-<?php if (!extension_loaded("openssl") || !function_exists("openssl_pkcs5_pbkdf2_hmac")) print "skip"; ?>
---FILE--
-<?php
-// official test vectors
-var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 1)));
-var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 2)));
-var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 4096)));
-
-/* really slow but should be:
-string(40) "eefe3d61cd4da4e4e9945b3d6ba2158c2634e984"
-var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 16777216)));
-*/
-
-var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('passwordPASSWORDpassword', 'saltSALTsaltSALTsaltSALTsaltSALTsalt', 25, 4096)));
-var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac("pass\0word", "sa\0lt", 16, 4096)));
-
-?>
---EXPECTF--
-string(40) "0c60c80f961f0e71f3a9b524af6012062fe037a6"
-string(40) "ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957"
-string(40) "4b007901b765489abead49d926f721d065a429c1"
-string(50) "3d2eec4fe41c849b80c8d83662c0e44a8b291a964cf2f07038"
-string(32) "56fa6aa75548099dcc37d7f03425e0c3"


commit 733aaf23b1ba58e1a6abb9c0d00aedf67d143167
Author: Felipe Pena <felipensp at gmail.com>
Date:   Mon Jun 11 14:08:38 2012 -0300

    - Fixed build (PKCS5_PBKDF2_HMAC is from 1.0.0)

diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 12ecfa4..1f515c7 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -238,6 +238,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_openssl_pkey_get_details, 0)
     ZEND_ARG_INFO(0, key)
 ZEND_END_ARG_INFO()
 
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
 ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pkcs5_pbkdf2_hmac, 0, 0, 4)
     ZEND_ARG_INFO(0, password)
     ZEND_ARG_INFO(0, salt)
@@ -245,6 +246,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pkcs5_pbkdf2_hmac, 0, 0, 4)
     ZEND_ARG_INFO(0, iterations)
     ZEND_ARG_INFO(0, digest_algorithm)
 ZEND_END_ARG_INFO()
+#endif
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pkcs7_verify, 0, 0, 2)
     ZEND_ARG_INFO(0, filename)
@@ -432,7 +434,9 @@ const zend_function_entry openssl_functions[] = {
 	PHP_FE(openssl_seal,				arginfo_openssl_seal)
 	PHP_FE(openssl_open,				arginfo_openssl_open)
 
-  PHP_FE(openssl_pkcs5_pbkdf2_hmac,	arginfo_openssl_pkcs5_pbkdf2_hmac)
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+	PHP_FE(openssl_pkcs5_pbkdf2_hmac,	arginfo_openssl_pkcs5_pbkdf2_hmac)
+#endif
 
 /* for S/MIME handling */
 	PHP_FE(openssl_pkcs7_verify,		arginfo_openssl_pkcs7_verify)
@@ -3323,6 +3327,8 @@ PHP_FUNCTION(openssl_pkey_get_details)
 
 /* }}} */
 
+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
+
 /* {{{ proto string openssl_pkcs5_pbkdf2_hmac(string password, string salt, long key_length, long iterations [, string digest_method = "sha1"])
    Generates a PKCS5 v2 PBKDF2 string, defaults to sha1 */
 PHP_FUNCTION(openssl_pkcs5_pbkdf2_hmac)
@@ -3370,6 +3376,8 @@ PHP_FUNCTION(openssl_pkcs5_pbkdf2_hmac)
 }
 /* }}} */
 
+#endif
+
 /* {{{ PKCS7 S/MIME functions */
 
 /* {{{ proto bool openssl_pkcs7_verify(string filename, long flags [, string signerscerts [, array cainfo [, string extracerts [, string content]]]])
diff --git a/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt b/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt
index 348d399..af1fcb1 100644
--- a/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt
+++ b/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt
@@ -1,7 +1,7 @@
 --TEST--
 openssl_pkcs5_pbkdf2_hmac() tests
 --SKIPIF--
-<?php if (!extension_loaded("openssl")) print "skip"; ?>
+<?php if (!extension_loaded("openssl") || !function_exists("openssl_pkcs5_pbkdf2_hmac")) print "skip"; ?>
 --FILE--
 <?php
 // official test vectors


commit 0c6351778a2974342f630a25a3bab4d8fee7e0c6
Merge: 32040b5 a18cede
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Jun 11 17:03:14 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug #62271 test bug - ext/wddx/tests/bug48562.phpt



commit a18cede1c5094d5255daeb99cd6debe09938399d
Author: Matt Ficken <mattficken at php.net>
Date:   Mon Jun 11 17:00:36 2012 +0200

    Fix bug #62271 test bug - ext/wddx/tests/bug48562.phpt

diff --git a/ext/wddx/tests/bug48562.phpt b/ext/wddx/tests/bug48562.phpt
index ebd2004..ee9f271 100644
--- a/ext/wddx/tests/bug48562.phpt
+++ b/ext/wddx/tests/bug48562.phpt
@@ -16,6 +16,12 @@ $a['x'] = &$a;
 
 var_dump(wddx_serialize_vars($a));
 
+// replace $a - the recursion detection seems to be causing $a to be not an array here, maybe its internally a pointer
+// replacing $a with a new array() allows this test to still check for 2 things
+//  1. recursion detection in &$a;
+//  2. recursion detection in adding $a to itself and then serializing $a
+// the one thing the test won't check is using $a as an array after doing &$a; which isn't really a wddx problem.
+$a = array();
 $a['x'] = 'foo';
 $a['x'] = $a;
 


commit 32040b574e7b456ca7b03918adaabfec4bbd91e2
Merge: 2065bab f4847ef
Author: Scott MacVicar <scottmac at php.net>
Date:   Mon Jun 11 00:29:02 2012 -0700

    Merge branch '5.4'
    
    * 5.4:
      Add PBKDF2 support via openssl()



commit f4847efc5d58b3375fa0f3269158d5e6ab625c21
Author: Scott MacVicar <scottmac at php.net>
Date:   Mon Jun 11 00:16:30 2012 -0700

    Add PBKDF2 support via openssl()
    
    Summary:
    No easy way to put these in the hash extension since we don't really support optional
    parameters to certain algorithms. Implemented in openssl for now since it has it already
    and is pretty stable.
    
    Only SHA1 is confirmed to work as an algorithm but openssl has a parameter so it can be
    changed in the future.
    
    Will backport to 5.4 potentially with Stas' approval.
    
    Test Plan:
    Ran newly added tests which came from RFC 6070

diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 7187a96..46f60b2 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -242,6 +242,14 @@ ZEND_BEGIN_ARG_INFO(arginfo_openssl_pkey_get_details, 0)
     ZEND_ARG_INFO(0, key)
 ZEND_END_ARG_INFO()
 
+ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pkcs5_pbkdf2_hmac, 0, 0, 4)
+    ZEND_ARG_INFO(0, password)
+    ZEND_ARG_INFO(0, salt)
+    ZEND_ARG_INFO(0, key_length)
+    ZEND_ARG_INFO(0, iterations)
+    ZEND_ARG_INFO(0, digest_algorithm)
+ZEND_END_ARG_INFO()
+
 ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pkcs7_verify, 0, 0, 2)
     ZEND_ARG_INFO(0, filename)
     ZEND_ARG_INFO(0, flags)
@@ -428,6 +436,8 @@ const zend_function_entry openssl_functions[] = {
 	PHP_FE(openssl_seal,				arginfo_openssl_seal)
 	PHP_FE(openssl_open,				arginfo_openssl_open)
 
+  PHP_FE(openssl_pkcs5_pbkdf2_hmac,	arginfo_openssl_pkcs5_pbkdf2_hmac)
+
 /* for S/MIME handling */
 	PHP_FE(openssl_pkcs7_verify,		arginfo_openssl_pkcs7_verify)
 	PHP_FE(openssl_pkcs7_decrypt,		arginfo_openssl_pkcs7_decrypt)
@@ -3317,6 +3327,53 @@ PHP_FUNCTION(openssl_pkey_get_details)
 
 /* }}} */
 
+/* {{{ proto string openssl_pkcs5_pbkdf2_hmac(string password, string salt, long key_length, long iterations [, string digest_method = "sha1"])
+   Generates a PKCS5 v2 PBKDF2 string, defaults to sha1 */
+PHP_FUNCTION(openssl_pkcs5_pbkdf2_hmac)
+{
+	long key_length = 0, iterations = 0;
+	char *password; int password_len;
+	char *salt; int salt_len;
+	char *method; int method_len = 0;
+	unsigned char *out_buffer;
+
+	const EVP_MD *digest;
+
+	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssll|s",
+				&password, &password_len,
+				&salt, &salt_len,
+				&key_length, &iterations,
+				&method, &method_len) == FAILURE) {
+		return;
+	}
+
+	if (key_length <= 0) {
+		RETURN_FALSE;
+	}
+
+	if (method_len) {
+		digest = EVP_get_digestbyname(method);
+	} else {
+		digest = EVP_sha1();
+	}
+
+	if (!digest) {
+		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown signature algorithm");
+		RETURN_FALSE;
+	}
+
+	out_buffer = emalloc(key_length + 1);
+	out_buffer[key_length] = '\0';
+
+	if (PKCS5_PBKDF2_HMAC(password, password_len, (unsigned char *)salt, salt_len, iterations, digest, key_length, out_buffer) == 1) {
+		RETVAL_STRINGL((char *)out_buffer, key_length, 0);
+	} else {
+		efree(out_buffer);
+		RETURN_FALSE;
+	}
+}
+/* }}} */
+
 /* {{{ PKCS7 S/MIME functions */
 
 /* {{{ proto bool openssl_pkcs7_verify(string filename, long flags [, string signerscerts [, array cainfo [, string extracerts [, string content]]]])
diff --git a/ext/openssl/php_openssl.h b/ext/openssl/php_openssl.h
index fc118db..0dbe7d2 100644
--- a/ext/openssl/php_openssl.h
+++ b/ext/openssl/php_openssl.h
@@ -52,6 +52,8 @@ PHP_FUNCTION(openssl_private_decrypt);
 PHP_FUNCTION(openssl_public_encrypt);
 PHP_FUNCTION(openssl_public_decrypt);
 
+PHP_FUNCTION(openssl_pkcs5_pbkdf2_hmac);
+
 PHP_FUNCTION(openssl_pkcs7_verify);
 PHP_FUNCTION(openssl_pkcs7_decrypt);
 PHP_FUNCTION(openssl_pkcs7_sign);
diff --git a/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt b/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt
new file mode 100644
index 0000000..348d399
--- /dev/null
+++ b/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt
@@ -0,0 +1,26 @@
+--TEST--
+openssl_pkcs5_pbkdf2_hmac() tests
+--SKIPIF--
+<?php if (!extension_loaded("openssl")) print "skip"; ?>
+--FILE--
+<?php
+// official test vectors
+var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 1)));
+var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 2)));
+var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 4096)));
+
+/* really slow but should be:
+string(40) "eefe3d61cd4da4e4e9945b3d6ba2158c2634e984"
+var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 16777216)));
+*/
+
+var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('passwordPASSWORDpassword', 'saltSALTsaltSALTsaltSALTsaltSALTsalt', 25, 4096)));
+var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac("pass\0word", "sa\0lt", 16, 4096)));
+
+?>
+--EXPECTF--
+string(40) "0c60c80f961f0e71f3a9b524af6012062fe037a6"
+string(40) "ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957"
+string(40) "4b007901b765489abead49d926f721d065a429c1"
+string(50) "3d2eec4fe41c849b80c8d83662c0e44a8b291a964cf2f07038"
+string(32) "56fa6aa75548099dcc37d7f03425e0c3"


commit 2065bab102d2117340d5b604f0ac55941c78ced8
Merge: 552d80b b55e692
Author: Stanislav Malyshev <stas at php.net>
Date:   Sun Jun 10 20:38:58 2012 -0700

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      typo fix



commit b55e69285bdfa280b94673e8a9434be6c08c65dc
Author: Stanislav Malyshev <stas at php.net>
Date:   Sun Jun 10 20:38:22 2012 -0700

    typo fix

diff --git a/main/main.c b/main/main.c
index c34f952..709c6dd 100644
--- a/main/main.c
+++ b/main/main.c
@@ -1080,7 +1080,7 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
 						PG(display_errors) == PHP_DISPLAY_ERRORS_STDERR
 					) {
 #ifdef PHP_WIN32
-						fprintf(stderr, "%s: %s in %s on line%d\n", error_type_str, buffer, error_filename, error_lineno);
+						fprintf(stderr, "%s: %s in %s on line %d\n", error_type_str, buffer, error_filename, error_lineno);
 						fflush(stderr);
 #else
 						fprintf(stderr, "%s: %s in %s on line %d\n", error_type_str, buffer, error_filename, error_lineno);


commit 552d80bce13840ebf3d1930d2f7011d2a05b2244
Merge: ff13501 51a5e98
Author: David Soria Parra <dsp at php.net>
Date:   Sun Jun 10 18:18:05 2012 +0400

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Make travis silent



commit 51a5e98af66bcba79699a86312c1a14f96cf06ce
Merge: b9babd2 f464ffd
Author: David Soria Parra <dsp at php.net>
Date:   Sun Jun 10 18:17:49 2012 +0400

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Make travis silent



commit f464ffd78046d31eb4bbd6d44dced3cd39d12c69
Author: David Soria Parra <dsp at php.net>
Date:   Sun Jun 10 18:15:34 2012 +0400

    Make travis silent
    
    Travis will always build all branches. As we just have a .travis.yml
    on master, travis will go ahead and checkout PHP-5.3. It fails and
    then sends mails. We really don't want to get spammed, so we add
    a .travis.yml that is just silent.

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..a375a35
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,10 @@
+language: php
+
+php:
+    # We only specify one version so we only get one worker
+    - 5.4
+
+notifications:
+    email: false
+
+script: exit 0


commit ff13501d33de23757d2ecd5a5ab8d23456f0b6a2
Merge: 76a26d8 b9babd2
Author: David Soria Parra <dsp at php.net>
Date:   Sun Jun 10 17:08:10 2012 +0400

    Merge branch 'PHP-5.4'
    
    By Stanislav Malyshev (1) and michelangelo (1)
    * PHP-5.4:
      Adding a test for ext/posix/tests/posix_getegid_basic.phpt
      typo



commit b9babd22e07b069a69ac2faae9644532ad4a1a46
Merge: 503358c cda14b9
Author: David Soria Parra <dsp at php.net>
Date:   Sun Jun 10 17:08:02 2012 +0400

    Merge branch 'PHP-5.3' into PHP-5.4
    
    By Stanislav Malyshev (1) and michelangelo (1)
    * PHP-5.3:
      Adding a test for ext/posix/tests/posix_getegid_basic.phpt
      typo



commit cda14b995c155748f97f6253ff8e2113e3f3e174
Author: michelangelo <dragonbe+github at gmail.com>
Date:   Sat Jun 9 16:07:11 2012 +0000

    Adding a test for ext/posix/tests/posix_getegid_basic.phpt

diff --git a/ext/posix/tests/posix_getegid_basic.phpt b/ext/posix/tests/posix_getegid_basic.phpt
new file mode 100644
index 0000000..d0016f4
--- /dev/null
+++ b/ext/posix/tests/posix_getegid_basic.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Test function posix_getegid() by calling it with its expected arguments
+--CREDITS--
+Michelangelo van Dam dragonbe at gmail.com
+#PHPTestFest Dutch PHP Conference 2012
+--SKIPIF--
+<?php 
+        if(!extension_loaded("posix")) print "skip - POSIX extension not loaded"; 
+?>
+--FILE--
+<?php
+var_dump(posix_getegid());
+?>
+--EXPECTF--
+int(%d)


commit 76a26d841900ff602ad6f9450939aff55a62b5a9
Merge: 0d85a86 503358c
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Sat Jun 9 17:32:18 2012 +0100

    Merge branch '5.4'
    
    * 5.4:
      Fix bug #62266
      rearrange news
      typo
      NEWS File



commit 503358c1797e0f7b05fb49f22dd44bc7f517069f
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Sat Jun 9 17:29:47 2012 +0100

    Fix bug #62266
    
    Custom extension segfaults during xmlParseFile with FPM SAPI
    because the regular list is not prepared during the MINIT phase
    and our custom external entity loader tries to open PHP streams.

diff --git a/NEWS b/NEWS
index 17d1c58..b91b5d7 100644
--- a/NEWS
+++ b/NEWS
@@ -14,7 +14,7 @@ PHP                                                                        NEWS
   . Fixed information leak in ext exif (discovered by Martin Noga, 
     Matthew "j00ru" Jurczyk, Gynvael Coldwind)
 
-- FPM
+- FPM:
   . Fixed bug #62205 (php-fpm segfaults (null passed to strstr)). (fat)
   . Fixed bug #62160 (Add process.priority to set nice(2) priorities). (fat)
   . Fixed bug #62153 (when using unix sockets, multiples FPM instances
@@ -33,7 +33,7 @@ PHP                                                                        NEWS
 - Iconv:
   . Fix bug #55042 (Erealloc in iconv.c unsafe). (Stas)
 
-- Intl
+- Intl:
   . Fixed bug #62083 (grapheme_extract() memory leaks). (Gustavo)
   . ResourceBundle constructor now accepts NULL for the first two arguments.
     (Gustavo)
@@ -43,6 +43,10 @@ PHP                                                                        NEWS
   . Fixed bug #62017 (datefmt_create with incorrectly encoded timezone leaks
     pattern). (Gustavo)
 
+- libxml:
+  . Fixed bug #62266 (Custom extension segfaults during xmlParseFile with FPM
+    SAPI). (Gustavo)
+
 - Readline:
   . Fixed bug #62186 (readline fails to compile - void function should not
     return a value). (Johannes)
diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c
index e42d845..a39c875 100644
--- a/ext/libxml/libxml.c
+++ b/ext/libxml/libxml.c
@@ -677,9 +677,18 @@ is_string:
 static xmlParserInputPtr _php_libxml_pre_ext_ent_loader(const char *URL,
 		const char *ID, xmlParserCtxtPtr context)
 {
+	TSRMLS_FETCH();
+
 	/* Check whether we're running in a PHP context, since the entity loader
-	 * we've defined is an application level (true global) setting */
-	if (xmlGenericError == php_libxml_error_handler) {
+	 * we've defined is an application level (true global) setting.
+	 * If we are, we also want to check whether we've finished activating
+	 * the modules (RINIT phase). Using our external entity loader during a
+	 * RINIT should not be problem per se (though during MINIT it is, because
+	 * we don't even have a resource list by then), but then whether one
+	 * extension would be using the custom external entity loader or not
+	 * could depend on extension loading order
+	 * (if _php_libxml_per_request_initialization */
+	if (xmlGenericError == php_libxml_error_handler && PG(modules_activated)) {
 		return _php_libxml_external_entity_loader(URL, ID, context);
 	} else {
 		return _php_libxml_default_entity_loader(URL, ID, context);


commit 0d85a86bbb151537a2362f17224d076556252ada
Author: David Soria Parra <dsp at php.net>
Date:   Fri Jun 8 22:56:02 2012 +0200

    Disable email notifications for travis-ci

diff --git a/.travis.yml b/.travis.yml
index 5995773..2939e3e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,11 +5,7 @@ php:
     - 5.4
 
 notifications:
-    email:
-        recipients:
-            - php-qa at lists.php.net
-        on_success: never # [always|never|change] default: change
-        on_failure: never # [always|never|change] default: always
+    email: false
 
 env:
     - REPORT_EXIT_STATUS=1 TEST_PHP_EXECUTABLE=./sapi/cli/php


commit c4cc43169c0ae05127eb406fcfd837597b72b71e
Author: Stanislav Malyshev <stas at php.net>
Date:   Fri Jun 8 13:27:24 2012 -0700

    rearrange news

diff --git a/NEWS b/NEWS
index ee7dc76..17d1c58 100644
--- a/NEWS
+++ b/NEWS
@@ -1,13 +1,12 @@
 PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 2012, PHP 5.4.5
-- Zend Engine:
-  . Fixed bug #51094 (parse_ini_file() with INI_SCANNER_RAW cuts a value that
-    includes a semi-colon). (Pierrick)
 
 - Core:
   . Fixed bug #61998 (Using traits with method aliases appears to result in
     crash during execution). (Dmitry)
+  . Fixed bug #51094 (parse_ini_file() with INI_SCANNER_RAW cuts a value that
+    includes a semi-colon). (Pierrick)
   . Fixed potential overflow in _php_stream_scandir. (Jason Powell,
     Stas)
 


commit d1debecd90ea334713a909f5b7ec64416283cf48
Author: Stanislav Malyshev <stas at php.net>
Date:   Fri Jun 8 01:24:49 2012 -0700

    typo

diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index b09e43c..5b991e8 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -1685,7 +1685,7 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
 		zval key;
 
 		if (CG(current_namespace)) {
-			/* Prefix function name with current namespcae name */
+			/* Prefix function name with current namespace name */
 			znode tmp;
 
 			tmp.u.constant = *CG(current_namespace);


commit ba8333cdb0feafbdbe2b7ae07532236c3b043b25
Author: Stanislav Malyshev <stas at php.net>
Date:   Fri Jun 8 01:24:49 2012 -0700

    typo

diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 28f9824..cca7c19 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -1685,7 +1685,7 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
 		zval key;
 
 		if (CG(current_namespace)) {
-			/* Prefix function name with current namespcae name */
+			/* Prefix function name with current namespace name */
 			znode tmp;
 
 			tmp.u.constant = *CG(current_namespace);


commit c467e81c86b3f4d312459553c23792492009a917
Author: Pierrick Charron <pierrick at php.net>
Date:   Fri Jun 8 18:02:49 2012 +0200

    NEWS File

diff --git a/NEWS b/NEWS
index 348a06e..ee7dc76 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,9 @@
 PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 2012, PHP 5.4.5
+- Zend Engine:
+  . Fixed bug #51094 (parse_ini_file() with INI_SCANNER_RAW cuts a value that
+    includes a semi-colon). (Pierrick)
 
 - Core:
   . Fixed bug #61998 (Using traits with method aliases appears to result in
@@ -55,6 +58,7 @@ PHP                                                                        NEWS
 - XML Writer:
   . Fixed bug #62064 (memory leak in the XML Writer module). 
     (jean-pierre dot lozi at lip6 dot fr)
+
 - Zip:
   . Upgraded libzip to 0.10.1 (Anatoliy)
 


commit 17c0ff11949f81c5fb5b32f6f64b3e8ad4063aeb
Author: Stanislav Malyshev <stas at php.net>
Date:   Fri Jun 8 01:24:49 2012 -0700

    typo

diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 17454f8..4c31f7c 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -1336,7 +1336,7 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
 		zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
 
 		if (CG(current_namespace)) {
-			/* Prefix function name with current namespcae name */
+			/* Prefix function name with current namespace name */
 			znode tmp;
 
 			tmp.u.constant = *CG(current_namespace);


commit c83457ed13deabd296dcfb17f3e104572878763e
Merge: 426ccd3 59eaa7c
Author: Stanislav Malyshev <stas at php.net>
Date:   Fri Jun 8 01:23:07 2012 -0700

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      improve overflow checks
      add NEWS
      fix potential overflow in _php_stream_scandir



commit 59eaa7c877e6bacb4783f929b924e2582c4a82f1
Merge: 0e3a650 fc74503
Author: Stanislav Malyshev <stas at php.net>
Date:   Fri Jun 8 01:22:46 2012 -0700

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      improve overflow checks
      fix potential overflow in _php_stream_scandir



commit fc74503792b1ee92e4b813690890f3ed38fa3ad5
Author: Stanislav Malyshev <stas at php.net>
Date:   Fri Jun 8 01:21:37 2012 -0700

    improve overflow checks

diff --git a/main/streams/streams.c b/main/streams/streams.c
index 43cb010..dfd6094 100755
--- a/main/streams/streams.c
+++ b/main/streams/streams.c
@@ -2279,6 +2279,11 @@ PHPAPI int _php_stream_scandir(char *dirname, char **namelist[], int flags, php_
 			if (vector_size == 0) {
 				vector_size = 10;
 			} else {
+				if(vector_size*2 < vector_size) {
+					/* overflow */
+					efree(vector);
+					return FAILURE;
+				}
 				vector_size *= 2;
 			}
 			vector = (char **) safe_erealloc(vector, vector_size, sizeof(char *), 0);
@@ -2287,11 +2292,6 @@ PHPAPI int _php_stream_scandir(char *dirname, char **namelist[], int flags, php_
 		vector[nfiles] = estrdup(sdp.d_name);
 
 		nfiles++;
-		if(vector_size < 10 || nfiles == 0) {
-			/* overflow */
-			efree(vector);
-			return FAILURE;
-		}
 	}
 	php_stream_closedir(stream);
 


commit 0e3a650e748b2bf79147d76a4739e17f3817c10c
Author: Stanislav Malyshev <stas at php.net>
Date:   Thu Jun 7 23:11:28 2012 -0700

    add NEWS

diff --git a/NEWS b/NEWS
index 31a6218..348a06e 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@ PHP                                                                        NEWS
 - Core:
   . Fixed bug #61998 (Using traits with method aliases appears to result in
     crash during execution). (Dmitry)
+  . Fixed potential overflow in _php_stream_scandir. (Jason Powell,
+    Stas)
 
 - EXIF:
   . Fixed information leak in ext exif (discovered by Martin Noga, 


commit 426ccd3e7f9aabc5d4e3b97a51d2c19ba44871d5
Merge: 730493f 10e8da1
Author: Stanislav Malyshev <stas at php.net>
Date:   Thu Jun 7 23:09:37 2012 -0700

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      fix potential overflow in _php_stream_scandir



commit 10e8da1738dc5331c595524837e69fd17ad9236a
Author: Stanislav Malyshev <stas at php.net>
Date:   Thu Jun 7 23:05:23 2012 -0700

    fix potential overflow in _php_stream_scandir

diff --git a/main/streams/streams.c b/main/streams/streams.c
index db6e25f..bf1143c 100755
--- a/main/streams/streams.c
+++ b/main/streams/streams.c
@@ -2332,8 +2332,8 @@ PHPAPI int _php_stream_scandir(char *dirname, char **namelist[], int flags, php_
 	php_stream *stream;
 	php_stream_dirent sdp;
 	char **vector = NULL;
-	int vector_size = 0;
-	int nfiles = 0;
+	unsigned int vector_size = 0;
+	unsigned int nfiles = 0;
 
 	if (!namelist) {
 		return FAILURE;
@@ -2351,12 +2351,17 @@ PHPAPI int _php_stream_scandir(char *dirname, char **namelist[], int flags, php_
 			} else {
 				vector_size *= 2;
 			}
-			vector = (char **) erealloc(vector, vector_size * sizeof(char *));
+			vector = (char **) safe_erealloc(vector, vector_size, sizeof(char *), 0);
 		}
 
 		vector[nfiles] = estrdup(sdp.d_name);
 
 		nfiles++;
+		if(vector_size < 10 || nfiles == 0) {
+			/* overflow */
+			efree(vector);
+			return FAILURE;
+		}
 	}
 	php_stream_closedir(stream);
 


commit 7d04e0fb2ec8be9b1c4b16a9f0b4958f853597f1
Author: Stanislav Malyshev <stas at php.net>
Date:   Thu Jun 7 23:05:23 2012 -0700

    fix potential overflow in _php_stream_scandir

diff --git a/NEWS b/NEWS
index 9d70ebd..380979b 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,8 @@ PHP                                                                        NEWS
 
 - Core:
   . Fixed CVE-2012-2143. (Solar Designer)
+  . Fixed potential overflow in _php_stream_scandir. (Jason Powell,
+    Stas)
 
 - Fileinfo:
   . Fixed magic file regex support. (Felipe)
diff --git a/main/streams/streams.c b/main/streams/streams.c
index fe7800b..43cb010 100755
--- a/main/streams/streams.c
+++ b/main/streams/streams.c
@@ -2262,8 +2262,8 @@ PHPAPI int _php_stream_scandir(char *dirname, char **namelist[], int flags, php_
 	php_stream *stream;
 	php_stream_dirent sdp;
 	char **vector = NULL;
-	int vector_size = 0;
-	int nfiles = 0;
+	unsigned int vector_size = 0;
+	unsigned int nfiles = 0;
 
 	if (!namelist) {
 		return FAILURE;
@@ -2281,12 +2281,17 @@ PHPAPI int _php_stream_scandir(char *dirname, char **namelist[], int flags, php_
 			} else {
 				vector_size *= 2;
 			}
-			vector = (char **) erealloc(vector, vector_size * sizeof(char *));
+			vector = (char **) safe_erealloc(vector, vector_size, sizeof(char *), 0);
 		}
 
 		vector[nfiles] = estrdup(sdp.d_name);
 
 		nfiles++;
+		if(vector_size < 10 || nfiles == 0) {
+			/* overflow */
+			efree(vector);
+			return FAILURE;
+		}
 	}
 	php_stream_closedir(stream);
 


commit 730493f2bb23b60f4fe895e3e0dd04eff904417c
Merge: 0c7ebf5 d24d5b6
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu Jun 7 22:47:00 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      set current versions for libzip and zip ext



commit d24d5b62c1d55af4059c9a220c25cc080895b20c
Merge: 7907dc4 baacc2c
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu Jun 7 22:37:32 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      set current versions for libzip and zip ext



commit baacc2cb135280f18f6c908b4b99160fba262c6a
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu Jun 7 22:32:03 2012 +0200

    set current versions for libzip and zip ext

diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index f3d37c8..e6a30a0 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -2879,7 +2879,7 @@ static PHP_MINFO_FUNCTION(zip)
 	php_info_print_table_row(2, "Zip", "enabled");
 	php_info_print_table_row(2, "Extension Version","$Id$");
 	php_info_print_table_row(2, "Zip version", PHP_ZIP_VERSION_STRING);
-	php_info_print_table_row(2, "Libzip version", "0.9.0");
+	php_info_print_table_row(2, "Libzip version", LIBZIP_VERSION);
 
 	php_info_print_table_end();
 }
diff --git a/ext/zip/php_zip.h b/ext/zip/php_zip.h
index a321d90..c9e88d6 100644
--- a/ext/zip/php_zip.h
+++ b/ext/zip/php_zip.h
@@ -30,7 +30,7 @@ extern zend_module_entry zip_module_entry;
 
 #include "lib/zip.h"
 
-#define PHP_ZIP_VERSION_STRING "1.9.1"
+#define PHP_ZIP_VERSION_STRING "1.9.2"
 
 #if ((PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION >= 2) || PHP_MAJOR_VERSION >= 6)
 # define PHP_ZIP_USE_OO 1


commit 0c7ebf50fbe51e1a1a25ebc83d8e92df65528847
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu Jun 7 21:46:51 2012 +0200

    updated NEWS

diff --git a/NEWS b/NEWS
index 3adefae..e9e70e9 100644
--- a/NEWS
+++ b/NEWS
@@ -53,4 +53,7 @@ PHP                                                                        NEWS
 - pgsql
   . Added pg_escape_literal() and pg_escape_identifier() (Yasuo)
 
+- Zip:
+  . Upgraded libzip to 0.10.1 (Anatoliy)
+
 <<< NOTE: Insert NEWS from last stable release here prior to actual release! >>>


commit 8af8125ec58c4f9e7407f13bc2b1fc054ca2fbaf
Merge: a4cbb60 7907dc4
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu Jun 7 21:46:12 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      updated NEWS



commit 7907dc4d666e9879997c7a9b18074da9d05dadbd
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu Jun 7 21:45:30 2012 +0200

    updated NEWS

diff --git a/NEWS b/NEWS
index 9ab8b62..31a6218 100644
--- a/NEWS
+++ b/NEWS
@@ -53,6 +53,8 @@ PHP                                                                        NEWS
 - XML Writer:
   . Fixed bug #62064 (memory leak in the XML Writer module). 
     (jean-pierre dot lozi at lip6 dot fr)
+- Zip:
+  . Upgraded libzip to 0.10.1 (Anatoliy)
 
 ?? ??? 2012, PHP 5.4.4
 


commit a4cbb605b19981845ffeb14b434917642092187a
Merge: ba4bfad d206206
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu Jun 7 21:44:20 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      updated NEWS



commit d206206c1006ecd9ed73df19d5511838e0752c0f
Merge: 5ebdc46 9ecb67d
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu Jun 7 21:44:08 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      updated NEWS



commit 9ecb67d5a424d132a3e7c1ef6413b58343d72415
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu Jun 7 21:43:07 2012 +0200

    updated NEWS

diff --git a/NEWS b/NEWS
index d56b540..9d70ebd 100644
--- a/NEWS
+++ b/NEWS
@@ -50,6 +50,8 @@ PHP                                                                        NEWS
 - XML Writer:
   . Fixed bug #62064 (memory leak in the XML Writer module). 
     (jean-pierre dot lozi at lip6 dot fr)
+- Zip:
+  . Upgraded libzip to 0.10.1 (Anatoliy)
 
 ?? ??? 2012, PHP 5.3.14
 


commit ba4bfad25745486201eb03b00e76bdbca9b5e6bc
Merge: f8d60e2 5ebdc46
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu Jun 7 21:07:53 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      zip windows fixes
      fixed bc break related to #57905
      fixed a bit overlooked from the last libzip port
      brought the fix for #47667 back
      fixed zip entry freeing
      rechecked the merged libzip, took also the indents from the original to avoid confusion next time
      fixed a double freeing crash
      fixed header include
      initial libzip upgrade patch to 0.10.1
      - BFN



commit 5ebdc46aa067359a34ed7e333e4640dc243ccb28
Merge: 7881158 bde0e8c
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu Jun 7 21:06:31 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      zip windows fixes
      fixed bc break related to #57905
      fixed a bit overlooked from the last libzip port
      brought the fix for #47667 back
      fixed zip entry freeing
      rechecked the merged libzip, took also the indents from the original to avoid confusion next time
      fixed a double freeing crash
      fixed header include
      initial libzip upgrade patch to 0.10.1
      - BFN
    
    Conflicts:
    	NEWS



commit bde0e8c2a14944016d9dbd0653b74e9e2b75c965
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu Jun 7 17:59:57 2012 +0200

    zip windows fixes

diff --git a/ext/zip/config.w32 b/ext/zip/config.w32
index b638170..fa0a518 100644
--- a/ext/zip/config.w32
+++ b/ext/zip/config.w32
@@ -27,14 +27,14 @@ if (PHP_ZIP != "no") {
                      zip_get_archive_comment.c zip_get_file_comment.c \
                      zip_set_archive_comment.c zip_set_file_comment.c \
                      zip_unchange_archive.c zip_memdup.c zip_stat_init.c \
-                     zip_add_dir.c zip_file_error_clear.c zip_error_clear.c
-					 lib/zip_fdopen.c lib/zip_fopen_encrypted.c lib/zip_fopen_index_encrypted.c \
-					 lib/zip_get_compression_implementation.c lib/zip_get_encryption_implementation.c \
-					 lib/zip_get_file_extra.c lib/zip_get_num_entries.c lib/zip_set_default_password.c \
-					 lib/zip_set_file_extra.c lib/zip_source_close.c lib/zip_source_crc.c \
-					 lib/zip_source_deflate.c lib/zip_source_error.c lib/zip_source_layered.c \
-					 lib/zip_source_open.c lib/zip_source_pkware.c lib/zip_source_pop.c \
-					 lib/zip_source_read.c lib/zip_source_stat.c", "zip");
+                     zip_add_dir.c zip_file_error_clear.c zip_error_clear.c \
+                     zip_fdopen.c zip_fopen_encrypted.c zip_fopen_index_encrypted.c \
+                     zip_get_compression_implementation.c zip_get_encryption_implementation.c \
+                     zip_get_file_extra.c zip_get_num_entries.c zip_set_default_password.c \
+                     zip_set_file_extra.c zip_source_close.c zip_source_crc.c \
+                     zip_source_deflate.c zip_source_error.c zip_source_layered.c \
+                     zip_source_open.c zip_source_pkware.c zip_source_pop.c \
+                     zip_source_read.c zip_source_stat.c", "zip");
 
 		AC_DEFINE('HAVE_ZIP', 1);
 	} else {
diff --git a/ext/zip/lib/zipconf.h b/ext/zip/lib/zipconf.h
index b65d91e..2b4340c 100644
--- a/ext/zip/lib/zipconf.h
+++ b/ext/zip/lib/zipconf.h
@@ -13,7 +13,11 @@
 #define LIBZIP_VERSION_MINOR 10
 #define LIBZIP_VERSION_MICRO 0
 
+#ifdef PHP_WIN32
+#include <win32/php_stdint.h>
+#else
 #include <inttypes.h>
+#endif
 
 typedef int8_t zip_int8_t;
 #define ZIP_INT8_MIN INT8_MIN
diff --git a/ext/zip/lib/zipint.h b/ext/zip/lib/zipint.h
index 67fae80..ea21ddd 100644
--- a/ext/zip/lib/zipint.h
+++ b/ext/zip/lib/zipint.h
@@ -46,10 +46,12 @@
 #define ftello(s)	((long)ftell((s)))
 #endif
 
+#ifndef PHP_WIN32
 #ifndef HAVE_MKSTEMP
 int _zip_mkstemp(char *);
 #define mkstemp _zip_mkstemp
 #endif
+#endif
 
 #ifdef PHP_WIN32
 #include <windows.h>


commit 8ca457f64dadff756831bc61abf479a4159b2072
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu Jun 7 16:27:47 2012 +0200

    fixed bc break related to #57905

diff --git a/ext/zip/lib/zip_open.c b/ext/zip/lib/zip_open.c
index 2f56881..a348d98 100644
--- a/ext/zip/lib/zip_open.c
+++ b/ext/zip/lib/zip_open.c
@@ -206,7 +206,9 @@ _zip_readcdir(FILE *fp, off_t buf_offset, unsigned char *buf, unsigned char *eoc
     cd->comment = NULL;
     cd->comment_len = _zip_read2(&cdp);
 
-    if (((zip_uint64_t)cd->offset)+cd->size > buf_offset + (eocd-buf)) {
+	/* without checking the ZIP_CHECKCONS flag we'll not able even to open inconsistent
+	   archives at this place, which would break bc in PHP */
+    if ((ZIP_CHECKCONS == (flags & ZIP_CHECKCONS)) && ((zip_uint64_t)cd->offset)+cd->size > buf_offset + (eocd-buf)) {
 	/* cdir spans past EOCD record */
 	_zip_error_set(error, ZIP_ER_INCONS, 0);
 	cd->nentry = 0;
@@ -237,7 +239,13 @@ _zip_readcdir(FILE *fp, off_t buf_offset, unsigned char *buf, unsigned char *eoc
 	}
     }
 
-    if (cd->offset >= buf_offset) {
+	/* the first if branch goes the old way of libzip 0.9 so we don't loose 
+	   the bc for reading inconsistent files */
+	if ((ZIP_CHECKCONS != (flags & ZIP_CHECKCONS)) && cd->size < (unsigned int)(eocd-buf)) {
+	cdp = eocd - cd->size;
+	bufp = &cdp;
+	}
+	else if (cd->offset >= buf_offset) {
 	/* if buffer already read in, use it */
 	cdp = buf + (cd->offset - buf_offset);
 	bufp = &cdp;


commit e8838926644cfb9a0ec9525a5b519da15b3e022a
Author: Anatoliy Belsky <ab at php.net>
Date:   Wed Jun 6 00:57:12 2012 +0200

    fixed a bit overlooked from the last libzip port

diff --git a/ext/zip/lib/zip_name_locate.c b/ext/zip/lib/zip_name_locate.c
index 08d5b1f..8cdd2c4 100644
--- a/ext/zip/lib/zip_name_locate.c
+++ b/ext/zip/lib/zip_name_locate.c
@@ -68,7 +68,7 @@ _zip_name_locate(struct zip *za, const char *fname, int flags,
         return -1;
     }
 
-    cmp = (flags & ZIP_FL_NOCASE) ? strcasecmp : strcmp;
+    cmp = (flags & ZIP_FL_NOCASE) ? strcmpi : strcmp;
 
     n = (flags & ZIP_FL_UNCHANGED) ? za->cdir->nentry : za->nentry;
     for (i=0; i<n; i++) {
@@ -80,7 +80,7 @@ _zip_name_locate(struct zip *za, const char *fname, int flags,
 	/* newly added (partially filled) entry */
 	if (fn == NULL)
 	    continue;
-
+	
 	if (flags & ZIP_FL_NODIR) {
 	    p = strrchr(fn, '/');
 	    if (p)


commit b8cdc731b840cf3b8fd49d34ede7485180326a9c
Author: Anatoliy Belsky <ab at php.net>
Date:   Tue Jun 5 23:22:27 2012 +0200

    brought the fix for #47667 back

diff --git a/ext/zip/lib/zip_open.c b/ext/zip/lib/zip_open.c
index 5aba34f..2f56881 100644
--- a/ext/zip/lib/zip_open.c
+++ b/ext/zip/lib/zip_open.c
@@ -61,10 +61,16 @@ ZIP_EXTERN(struct zip *)
 zip_open(const char *fn, int flags, int *zep)
 {
     FILE *fp;
-    
+
+    if (flags & ZIP_OVERWRITE) {
+	return _zip_allocate_new(fn, zep);
+    }
+
     switch (_zip_file_exists(fn, flags, zep)) {
     case -1:
-	return NULL;
+			if (!(flags & ZIP_OVERWRITE)) {
+				return NULL;
+			}
     case 0:
 	return _zip_allocate_new(fn, zep);
     default:


commit a37e84e549669dbcca0b94a69a5409591eb0c6bb
Author: Anatoliy Belsky <ab at php.net>
Date:   Tue Jun 5 22:49:31 2012 +0200

    fixed zip entry freeing

diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index 0123315..f3d37c8 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -1148,7 +1148,13 @@ static void php_zip_free_entry(zend_rsrc_list_entry *rsrc TSRMLS_DC)
 
 	if (zr_rsrc) {
 		if (zr_rsrc->zf) {
-			zip_fclose(zr_rsrc->zf);
+			if (zr_rsrc->zf->za) {
+				zip_fclose(zr_rsrc->zf);
+			} else {
+				if (zr_rsrc->zf->src)
+					zip_source_free(zr_rsrc->zf->src);
+				free(zr_rsrc->zf);
+			}
 			zr_rsrc->zf = NULL;
 		}
 		efree(zr_rsrc);
@@ -1321,9 +1327,8 @@ static PHP_NAMED_FUNCTION(zif_zip_entry_open)
 }
 /* }}} */
 
-/* {{{ proto void zip_entry_close(resource zip_ent)
+/* {{{ proto bool zip_entry_close(resource zip_ent)
    Close a zip entry */
-/* another dummy function to fit in the old api*/
 static PHP_NAMED_FUNCTION(zif_zip_entry_close)
 {
 	zval * zip_entry;
@@ -1334,8 +1339,8 @@ static PHP_NAMED_FUNCTION(zif_zip_entry_close)
 	}
 
 	ZEND_FETCH_RESOURCE(zr_rsrc, zip_read_rsrc *, &zip_entry, -1, le_zip_entry_name, le_zip_entry);
-	/*  we got a zip_entry resource, be happy */
-	RETURN_TRUE;
+
+	RETURN_BOOL(SUCCESS == zend_list_delete(Z_LVAL_P(zip_entry)));
 }
 /* }}} */
 


commit f4a44f18b8fe5d23a11d12b048d4effce283379f
Author: Anatoliy Belsky <ab at php.net>
Date:   Tue Jun 5 22:11:07 2012 +0200

    rechecked the merged libzip, took also the indents from the original to
    avoid confusion next time

diff --git a/ext/zip/lib/zip_close.c b/ext/zip/lib/zip_close.c
index b0e3c75..362f92d 100644
--- a/ext/zip/lib/zip_close.c
+++ b/ext/zip/lib/zip_close.c
@@ -316,22 +316,22 @@ zip_close(struct zip *za)
 	free(temp);
 	return -1;
     }
-
-	if (za->zp) {
-		fclose(za->zp);
-		za->zp = NULL;
-		reopen_on_error = 1;
+    
+    if (za->zp) {
+	fclose(za->zp);
+	za->zp = NULL;
+	reopen_on_error = 1;
     }
     if (_zip_rename(temp, za->zn) != 0) {
-		_zip_error_set(&za->error, ZIP_ER_RENAME, errno);
-		remove(temp);
-		free(temp);
-		if (reopen_on_error) {
-	    	/* ignore errors, since we're already in an error case */
-	    	za->zp = fopen(za->zn, "rb");
-		}
-		return -1;
+	_zip_error_set(&za->error, ZIP_ER_RENAME, errno);
+	remove(temp);
+	free(temp);
+	if (reopen_on_error) {
+	    /* ignore errors, since we're already in an error case */
+	    za->zp = fopen(za->zn, "rb");
 	}
+	return -1;
+    }
 #ifndef PHP_WIN32
     mask = umask(0);
     umask(mask);
diff --git a/ext/zip/lib/zip_delete.c b/ext/zip/lib/zip_delete.c
index da3e65b..131d444 100644
--- a/ext/zip/lib/zip_delete.c
+++ b/ext/zip/lib/zip_delete.c
@@ -40,7 +40,7 @@
 ZIP_EXTERN(int)
 zip_delete(struct zip *za, zip_uint64_t idx)
 {
-    if (idx < 0 || idx >= za->nentry) {
+    if (idx >= za->nentry) {
 	_zip_error_set(&za->error, ZIP_ER_INVAL, 0);
 	return -1;
     }
diff --git a/ext/zip/lib/zip_dirent.c b/ext/zip/lib/zip_dirent.c
index 6cb9ee3..b5b9d27 100644
--- a/ext/zip/lib/zip_dirent.c
+++ b/ext/zip/lib/zip_dirent.c
@@ -472,7 +472,7 @@ _zip_dirent_write(struct zip_dirent *zde, FILE *fp, int localp,
 static time_t
 _zip_d2u_time(int dtime, int ddate)
 {
-    struct tm tm = {0};
+    struct tm tm;
 
     memset(&tm, 0, sizeof(tm));
     
diff --git a/ext/zip/lib/zip_fopen_index.c b/ext/zip/lib/zip_fopen_index.c
index 5c777ee..b60fd33 100644
--- a/ext/zip/lib/zip_fopen_index.c
+++ b/ext/zip/lib/zip_fopen_index.c
@@ -39,7 +39,6 @@
 
 #include "zipint.h"
 
-
 
 
 ZIP_EXTERN(struct zip_file *)
diff --git a/ext/zip/lib/zip_fread.c b/ext/zip/lib/zip_fread.c
index 4c828a8..a6c0851 100644
--- a/ext/zip/lib/zip_fread.c
+++ b/ext/zip/lib/zip_fread.c
@@ -60,15 +60,6 @@ zip_fread(struct zip_file *zf, void *outbuf, zip_uint64_t toread)
 	_zip_error_set_from_source(&zf->error, zf->src);
 	return -1;
     }
-    
-	/* XXX the following left from the previous PHP port, let's see how to use it now */
-    /*zf->zstr->next_out = (Bytef *)outbuf;
-    zf->zstr->avail_out = toread;
-    out_before = zf->zstr->total_out;*/
-    
-    /* endless loop until something has been accomplished */
-    /*for (;;) {
-	ret = inflate(zf->zstr, Z_SYNC_FLUSH);*/
 
     return n;
 }
diff --git a/ext/zip/lib/zip_open.c b/ext/zip/lib/zip_open.c
index 11c6fe0..5aba34f 100644
--- a/ext/zip/lib/zip_open.c
+++ b/ext/zip/lib/zip_open.c
@@ -357,17 +357,17 @@ _zip_check_torrentzip(struct zip *za)
     if (za->cdir->comment_len != TORRENT_SIG_LEN+8
 	|| strncmp(za->cdir->comment, TORRENT_SIG, TORRENT_SIG_LEN) != 0)
 	return;
-    
+
     memcpy(buf, za->cdir->comment+TORRENT_SIG_LEN, 8);
     buf[8] = '\0';
     errno = 0;
     crc_should = strtoul(buf, &end, 16);
     if ((crc_should == UINT_MAX && errno != 0) || (end && *end))
 	return;
-    
+
     if (_zip_filerange_crc(za->zp, za->cdir->offset, za->cdir->size,
 			   &crc_got, NULL) < 0)
-	    return;
+	return;
 
     if (crc_got == crc_should)
 	za->flags |= ZIP_AFL_TORRENT;


commit a39bcfc5ee3931c25bdbc5dc2409e6d9dd98ff52
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Jun 4 22:51:31 2012 +0200

    fixed a double freeing crash

diff --git a/ext/zip/lib/zip_close.c b/ext/zip/lib/zip_close.c
index fc1ad02..b0e3c75 100644
--- a/ext/zip/lib/zip_close.c
+++ b/ext/zip/lib/zip_close.c
@@ -337,8 +337,6 @@ zip_close(struct zip *za)
     umask(mask);
     chmod(za->zn, 0666&~mask);
 #endif
-    if (za->ch_comment)
-        free(za->ch_comment);
 
     _zip_free(za);
 	free(temp);


commit 9a2365412e69d452679fe2b834e8c594ae9f57ea
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Jun 4 22:51:00 2012 +0200

    fixed header include

diff --git a/ext/zip/lib/zip.h b/ext/zip/lib/zip.h
index 4a80c9e..f11c9ab 100644
--- a/ext/zip/lib/zip.h
+++ b/ext/zip/lib/zip.h
@@ -52,7 +52,7 @@
 
 BEGIN_EXTERN_C()
 
-#include <lib/zipconf.h>
+#include "zipconf.h"
 
 #include <sys/types.h>
 #include <stdio.h>


commit 335a11b14b35e261c484d44a0e1b5ea9cc758e19
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Jun 4 21:30:04 2012 +0200

    initial libzip upgrade patch to 0.10.1

diff --git a/ext/zip/config.m4 b/ext/zip/config.m4
index d5c24ce..85f9119 100644
--- a/ext/zip/config.m4
+++ b/ext/zip/config.m4
@@ -89,7 +89,14 @@ yes
                          lib/zip_new.c lib/zip_source_file.c lib/zip_stat_index.c \
                          lib/zip_set_archive_comment.c lib/zip_set_file_comment.c \
                          lib/zip_unchange_archive.c lib/zip_memdup.c lib/zip_stat_init.c lib/zip_add_dir.c \
-                         lib/zip_error_clear.c lib/zip_file_error_clear.c"
+                         lib/zip_error_clear.c lib/zip_file_error_clear.c \
+						 lib/zip_fdopen.c lib/zip_fopen_encrypted.c lib/zip_fopen_index_encrypted.c \
+						 lib/zip_get_compression_implementation.c lib/zip_get_encryption_implementation.c \
+						 lib/zip_get_file_extra.c lib/zip_get_num_entries.c lib/zip_set_default_password.c \
+						 lib/zip_set_file_extra.c lib/zip_source_close.c lib/zip_source_crc.c \
+						 lib/zip_source_deflate.c lib/zip_source_error.c lib/zip_source_layered.c \
+						 lib/zip_source_open.c lib/zip_source_pkware.c lib/zip_source_pop.c \
+						 lib/zip_source_read.c lib/zip_source_stat.c"
 
   AC_DEFINE(HAVE_ZIP,1,[ ])
   PHP_NEW_EXTENSION(zip, php_zip.c zip_stream.c $PHP_ZIP_SOURCES, $ext_shared)
diff --git a/ext/zip/config.w32 b/ext/zip/config.w32
index e60a983..b638170 100644
--- a/ext/zip/config.w32
+++ b/ext/zip/config.w32
@@ -27,7 +27,14 @@ if (PHP_ZIP != "no") {
                      zip_get_archive_comment.c zip_get_file_comment.c \
                      zip_set_archive_comment.c zip_set_file_comment.c \
                      zip_unchange_archive.c zip_memdup.c zip_stat_init.c \
-                     zip_add_dir.c zip_file_error_clear.c zip_error_clear.c", "zip");
+                     zip_add_dir.c zip_file_error_clear.c zip_error_clear.c
+					 lib/zip_fdopen.c lib/zip_fopen_encrypted.c lib/zip_fopen_index_encrypted.c \
+					 lib/zip_get_compression_implementation.c lib/zip_get_encryption_implementation.c \
+					 lib/zip_get_file_extra.c lib/zip_get_num_entries.c lib/zip_set_default_password.c \
+					 lib/zip_set_file_extra.c lib/zip_source_close.c lib/zip_source_crc.c \
+					 lib/zip_source_deflate.c lib/zip_source_error.c lib/zip_source_layered.c \
+					 lib/zip_source_open.c lib/zip_source_pkware.c lib/zip_source_pop.c \
+					 lib/zip_source_read.c lib/zip_source_stat.c", "zip");
 
 		AC_DEFINE('HAVE_ZIP', 1);
 	} else {
diff --git a/ext/zip/lib/zip.h b/ext/zip/lib/zip.h
index 14a57bc..4a80c9e 100644
--- a/ext/zip/lib/zip.h
+++ b/ext/zip/lib/zip.h
@@ -3,7 +3,7 @@
 
 /*
   zip.h -- exported declarations.
-  Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2011 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip at nih.at>
@@ -52,6 +52,8 @@
 
 BEGIN_EXTERN_C()
 
+#include <lib/zipconf.h>
+
 #include <sys/types.h>
 #include <stdio.h>
 #include <time.h>
@@ -71,10 +73,19 @@ BEGIN_EXTERN_C()
 #define ZIP_FL_COMPRESSED	4 /* read compressed data */
 #define ZIP_FL_UNCHANGED	8 /* use original data, ignoring changes */
 #define ZIP_FL_RECOMPRESS      16 /* force recompression of data */
+#define ZIP_FL_ENCRYPTED       32 /* read encrypted data
+				     (implies ZIP_FL_COMPRESSED) */
 
 /* archive global flags flags */
 
 #define ZIP_AFL_TORRENT		1 /* torrent zipped */
+#define ZIP_AFL_RDONLY		2 /* read only -- cannot be cleared */
+
+
+/* flags for compression and encryption sources */
+
+#define ZIP_CODEC_ENCODE	1 /* compress/encrypt */
+
 
 /* libzip error codes */
 
@@ -102,7 +113,10 @@ BEGIN_EXTERN_C()
 #define ZIP_ER_INCONS        21  /* N Zip archive inconsistent */
 #define ZIP_ER_REMOVE        22  /* S Can't remove file */
 #define ZIP_ER_DELETED       23  /* N Entry has been deleted */
-
+#define ZIP_ER_ENCRNOTSUPP   24  /* N Encryption method not supported */
+#define ZIP_ER_RDONLY        25  /* N Read-only archive */ 
+#define ZIP_ER_NOPASSWD      26  /* N No password provided */
+#define ZIP_ER_WRONGPASSWD   27  /* N Wrong password provided */
 
 /* type of system error value */
 
@@ -162,69 +176,99 @@ enum zip_source_cmd {
     ZIP_SOURCE_FREE	/* cleanup and free resources */
 };
 
-typedef ssize_t (*zip_source_callback)(void *state, void *data,
-				       size_t len, enum zip_source_cmd cmd);
+#define ZIP_SOURCE_ERR_LOWER	-2
+
+#define ZIP_STAT_NAME			0x0001
+#define ZIP_STAT_INDEX			0x0002
+#define ZIP_STAT_SIZE			0x0004
+#define ZIP_STAT_COMP_SIZE		0x0008
+#define ZIP_STAT_MTIME			0x0010
+#define ZIP_STAT_CRC			0x0020
+#define ZIP_STAT_COMP_METHOD		0x0040
+#define ZIP_STAT_ENCRYPTION_METHOD	0x0080
+#define ZIP_STAT_FLAGS			0x0100
 
 struct zip_stat {
+    zip_uint64_t valid;			/* which fields have valid values */
     const char *name;			/* name of the file */
-    int index;				/* index within archive */
-    unsigned int crc;			/* crc of file data */
+    zip_uint64_t index;			/* index within archive */
+    zip_uint64_t size;			/* size of file (uncompressed) */
+    zip_uint64_t comp_size;		/* size of file (compressed) */
     time_t mtime;			/* modification time */
-    off_t size;				/* size of file (uncompressed) */
-    off_t comp_size;			/* size of file (compressed) */
-    unsigned short comp_method;		/* compression method used */
-    unsigned short encryption_method;	/* encryption method used */
+    zip_uint32_t crc;			/* crc of file data */
+    zip_uint16_t comp_method;		/* compression method used */
+    zip_uint16_t encryption_method;	/* encryption method used */
+    zip_uint32_t flags;			/* reserved for future use */
 };
 
 struct zip;
 struct zip_file;
 struct zip_source;
 
+typedef zip_int64_t (*zip_source_callback)(void *, void *, zip_uint64_t,
+					   enum zip_source_cmd);
+
 
 
-ZIP_EXTERN(int) zip_add(struct zip *, const char *, struct zip_source *);
-ZIP_EXTERN(int) zip_add_dir(struct zip *, const char *);
+ZIP_EXTERN(zip_int64_t) zip_add(struct zip *, const char *, struct zip_source *);
+ZIP_EXTERN(zip_int64_t) zip_add_dir(struct zip *, const char *);
 ZIP_EXTERN(int) zip_close(struct zip *);
-ZIP_EXTERN(int) zip_delete(struct zip *, int);
+ZIP_EXTERN(int) zip_delete(struct zip *, zip_uint64_t);
 ZIP_EXTERN(void) zip_error_clear(struct zip *);
 ZIP_EXTERN(void) zip_error_get(struct zip *, int *, int *);
 ZIP_EXTERN(int) zip_error_get_sys_type(int);
-ZIP_EXTERN(int) zip_error_to_str(char *, size_t, int, int);
+ZIP_EXTERN(int) zip_error_to_str(char *, zip_uint64_t, int, int);
 ZIP_EXTERN(int) zip_fclose(struct zip_file *);
+ZIP_EXTERN(struct zip *)zip_fdopen(int, int, int *);
 ZIP_EXTERN(void) zip_file_error_clear(struct zip_file *);
 ZIP_EXTERN(void) zip_file_error_get(struct zip_file *, int *, int *);
 ZIP_EXTERN(const char *)zip_file_strerror(struct zip_file *);
-ZIP_EXTERN(struct zip_file *)zip_fopen(struct zip *, const char *, int);
-ZIP_EXTERN(struct zip_file *)zip_fopen_index(struct zip *, int, int);
-ZIP_EXTERN(ssize_t) zip_fread(struct zip_file *, void *, size_t);
+ZIP_EXTERN(struct) zip_file *zip_fopen(struct zip *, const char *, int);
+ZIP_EXTERN(struct) zip_file *zip_fopen_encrypted(struct zip *, const char *,
+						int, const char *);
+ZIP_EXTERN(struct zip_file *)zip_fopen_index(struct zip *, zip_uint64_t, int);
+ZIP_EXTERN(struct zip_file *)zip_fopen_index_encrypted(struct zip *,
+						      zip_uint64_t, int,
+						      const char *);
+ZIP_EXTERN(zip_int64_t) zip_fread(struct zip_file *, void *, zip_uint64_t);
 ZIP_EXTERN(const char *)zip_get_archive_comment(struct zip *, int *, int);
 ZIP_EXTERN(int) zip_get_archive_flag(struct zip *, int, int);
-ZIP_EXTERN(const char *)zip_get_file_comment(struct zip *, int, int *, int);
-ZIP_EXTERN(const char *)zip_get_name(struct zip *, int, int);
-ZIP_EXTERN(int) zip_get_num_files(struct zip *);
+ZIP_EXTERN(const char *)zip_get_file_comment(struct zip *, zip_uint64_t,
+					    int *, int);
+ZIP_EXTERN(const char *)zip_get_file_extra(struct zip *, zip_uint64_t,
+					  int *, int);
+ZIP_EXTERN(const char *)zip_get_name(struct zip *, zip_uint64_t, int);
+ZIP_EXTERN(zip_uint64_t) zip_get_num_entries(struct zip *, int);
+ZIP_EXTERN(int) zip_get_num_files(struct zip *);  /* deprecated, use zip_get_num_entries instead */
 ZIP_EXTERN(int) zip_name_locate(struct zip *, const char *, int);
 ZIP_EXTERN(struct zip *)zip_open(const char *, int, int *);
-ZIP_EXTERN(int) zip_rename(struct zip *, int, const char *);
-ZIP_EXTERN(int) zip_replace(struct zip *, int, struct zip_source *);
+ZIP_EXTERN(int) zip_rename(struct zip *, zip_uint64_t, const char *);
+ZIP_EXTERN(int) zip_replace(struct zip *, zip_uint64_t, struct zip_source *);
 ZIP_EXTERN(int) zip_set_archive_comment(struct zip *, const char *, int);
 ZIP_EXTERN(int) zip_set_archive_flag(struct zip *, int, int);
-ZIP_EXTERN(int) zip_set_file_comment(struct zip *, int, const char *, int);
-ZIP_EXTERN(struct zip_source *)zip_source_buffer(struct zip *, const void *,
-						off_t, int);
-ZIP_EXTERN(struct zip_source *)zip_source_file(struct zip *, const char *,
-					      off_t, off_t);
-ZIP_EXTERN(struct zip_source *)zip_source_filep(struct zip *, FILE *,
-					       off_t, off_t);
+ZIP_EXTERN(int) zip_set_default_password(struct zip *, const char *);
+ZIP_EXTERN(int) zip_set_file_comment(struct zip *, zip_uint64_t,
+				    const char *, int);
+ZIP_EXTERN(int) zip_set_file_extra(struct zip *, zip_uint64_t,
+				  const char *, int);
+ZIP_EXTERN(struct) zip_source *zip_source_buffer(struct zip *, const void *,
+						zip_uint64_t, int);
+ZIP_EXTERN(struct) zip_source *zip_source_file(struct zip *, const char *,
+					      zip_uint64_t, zip_int64_t);
+ZIP_EXTERN(struct) zip_source *zip_source_filep(struct zip *, FILE *,
+					       zip_uint64_t, zip_int64_t);
 ZIP_EXTERN(void) zip_source_free(struct zip_source *);
 ZIP_EXTERN(struct zip_source *)zip_source_function(struct zip *,
 						  zip_source_callback, void *);
 ZIP_EXTERN(struct zip_source *)zip_source_zip(struct zip *, struct zip *,
-					     int, int, off_t, off_t);
+					     zip_uint64_t, int,
+					     zip_uint64_t, zip_int64_t);
 ZIP_EXTERN(int) zip_stat(struct zip *, const char *, int, struct zip_stat *);
-ZIP_EXTERN(int) zip_stat_index(struct zip *, int, int, struct zip_stat *);
+ZIP_EXTERN(int) zip_stat_index(struct zip *, zip_uint64_t, int,
+			      struct zip_stat *);
 ZIP_EXTERN(void) zip_stat_init(struct zip_stat *);
 ZIP_EXTERN(const char *)zip_strerror(struct zip *);
-ZIP_EXTERN(int) zip_unchange(struct zip *, int);
+ZIP_EXTERN(int) zip_unchange(struct zip *, zip_uint64_t);
 ZIP_EXTERN(int) zip_unchange_all(struct zip *);
 ZIP_EXTERN(int) zip_unchange_archive(struct zip *);
 
diff --git a/ext/zip/lib/zip_add.c b/ext/zip/lib/zip_add.c
index 85d5997..6067abb 100644
--- a/ext/zip/lib/zip_add.c
+++ b/ext/zip/lib/zip_add.c
@@ -37,13 +37,20 @@
 
 
 
-ZIP_EXTERN(int)
+/*
+  NOTE: Return type is signed so we can return -1 on error.
+        The index can not be larger than ZIP_INT64_MAX since the size
+        of the central directory cannot be larger than
+        ZIP_UINT64_MAX, and each entry is larger than 2 bytes.
+*/
+
+ZIP_EXTERN(zip_int64_t)
 zip_add(struct zip *za, const char *name, struct zip_source *source)
 {
     if (name == NULL || source == NULL) {
 	_zip_error_set(&za->error, ZIP_ER_INVAL, 0);
 	return -1;
     }
-
-    return _zip_replace(za, -1, name, source);
+	
+    return _zip_replace(za, ZIP_UINT64_MAX, name, source);
 }
diff --git a/ext/zip/lib/zip_add_dir.c b/ext/zip/lib/zip_add_dir.c
index 9b23425..0a9d7f4 100644
--- a/ext/zip/lib/zip_add_dir.c
+++ b/ext/zip/lib/zip_add_dir.c
@@ -1,6 +1,6 @@
 /*
   zip_add_dir.c -- add directory
-  Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip at nih.at>
@@ -40,13 +40,21 @@
 
 
 
-ZIP_EXTERN(int)
+/* NOTE: Signed due to -1 on error.  See zip_add.c for more details. */
+
+ZIP_EXTERN(zip_int64_t)
 zip_add_dir(struct zip *za, const char *name)
 {
-    int len, ret;
+    int len;
+    zip_int64_t ret;
     char *s;
     struct zip_source *source;
 
+    if (ZIP_IS_RDONLY(za)) {
+	_zip_error_set(&za->error, ZIP_ER_RDONLY, 0);
+	return -1;
+    }
+
     if (name == NULL) {
 	_zip_error_set(&za->error, ZIP_ER_INVAL, 0);
 	return -1;
diff --git a/ext/zip/lib/zip_close.c b/ext/zip/lib/zip_close.c
index 0796f27..fc1ad02 100644
--- a/ext/zip/lib/zip_close.c
+++ b/ext/zip/lib/zip_close.c
@@ -1,6 +1,6 @@
 /*
   zip_close.c -- close zip archive and update changes
-  Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2011 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip at nih.at>
@@ -33,26 +33,28 @@
 
 
 
+#include "zipint.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 #include <sys/types.h>
 #include <sys/stat.h>
-
-#include "zipint.h"
+#ifdef PHP_WIN32
+#include <io.h>
+#include <fcntl.h>
+#endif
 
 static int add_data(struct zip *, struct zip_source *, struct zip_dirent *,
 		    FILE *);
-static int add_data_comp(zip_source_callback, void *, struct zip_stat *,
-			 FILE *, struct zip_error *);
-static int add_data_uncomp(struct zip *, zip_source_callback, void *,
-			   struct zip_stat *, FILE *);
-static void ch_set_error(struct zip_error *, zip_source_callback, void *);
 static int copy_data(FILE *, off_t, FILE *, struct zip_error *);
+static int copy_source(struct zip *, struct zip_source *, FILE *);
 static int write_cdir(struct zip *, struct zip_cdir *, FILE *);
 static int _zip_cdir_set_comment(struct zip_cdir *, struct zip *);
-static int _zip_changed(struct zip *, int *);
 static char *_zip_create_temp_output(struct zip *, FILE **);
 static int _zip_torrentzip_cmp(const void *, const void *);
 
@@ -72,7 +74,9 @@ zip_close(struct zip *za)
     int i, j, error;
     char *temp;
     FILE *out;
+#ifndef PHP_WIN32
     mode_t mask;
+#endif
     struct zip_cdir *cd;
     struct zip_dirent de;
     struct filelist *filelist;
@@ -99,7 +103,7 @@ zip_close(struct zip *za)
 	}
 	_zip_free(za);
 	return 0;
-    }
+    }	       
 
     if ((filelist=(struct filelist *)malloc(sizeof(filelist[0])*survivors))
 	== NULL)
@@ -126,11 +130,11 @@ zip_close(struct zip *za)
 	cd->comment_len = TORRENT_SIG_LEN + TORRENT_CRC_LEN;
     }
     else if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, ZIP_FL_UNCHANGED) == 0) {
-    if (_zip_cdir_set_comment(cd, za) == -1) {
-	_zip_cdir_free(cd);
+	if (_zip_cdir_set_comment(cd, za) == -1) {
+	    _zip_cdir_free(cd);
 	    free(filelist);
-	return -1;
-    }
+	    return -1;
+	}
     }
 
     if ((temp=_zip_create_temp_output(za, &out)) == NULL) {
@@ -198,8 +202,7 @@ zip_close(struct zip *za)
 		error = 1;
 		break;
 	    }
- 	    memcpy(cd->entry+j, za->cdir->entry+i, sizeof(cd->entry[j]));
-
+	    memcpy(cd->entry+j, za->cdir->entry+i, sizeof(cd->entry[j]));
 	    if (de.bitflags & ZIP_GPBF_DATA_DESCRIPTOR) {
 		de.crc = za->cdir->entry[i].crc;
 		de.comp_size = za->cdir->entry[i].comp_size;
@@ -220,6 +223,22 @@ zip_close(struct zip *za)
 	    cd->entry[j].filename_len = de.filename_len;
 	}
 
+	if (za->entry[i].ch_extra_len != -1) {
+	    free(de.extrafield);
+	    if ((de.extrafield=malloc(za->entry[i].ch_extra_len)) == NULL) {
+		error = 1;
+		break;
+	    }
+	    memcpy(de.extrafield, za->entry[i].ch_extra, za->entry[i].ch_extra_len);
+	    de.extrafield_len = za->entry[i].ch_extra_len;
+	    /* as the rest of cd entries, its malloc/free is done by za */
+	    /* TODO unsure if this should also be set in the CD --
+	     * not done for now
+	    cd->entry[j].extrafield = za->entry[i].ch_extra;
+	    cd->entry[j].extrafield_len = za->entry[i].ch_extra_len;
+	    */
+	}
+
 	if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0) == 0
 	    && za->entry[i].ch_comment_len != -1) {
 	    /* as the rest of cd entries, its malloc/free is done by za */
@@ -234,16 +253,22 @@ zip_close(struct zip *za)
 
 	    zs = NULL;
 	    if (!ZIP_ENTRY_DATA_CHANGED(za->entry+i)) {
-			if ((zs=zip_source_zip(za, za, i, ZIP_FL_RECOMPRESS, 0, -1)) == NULL) {
-				error = 1;
-				break;
-	    	}
+		if ((zs=zip_source_zip(za, za, i, ZIP_FL_RECOMPRESS, 0, -1))
+		    == NULL) {
+		    error = 1;
+		    break;
+		}
 	    }
 
 	    if (add_data(za, zs ? zs : za->entry[i].source, &de, out) < 0) {
 		error = 1;
+		if (zs)
+		    zip_source_free(zs);
 		break;
 	    }
+	    if (zs)
+		zip_source_free(zs);
+	    
 	    cd->entry[j].last_mod = de.last_mod;
 	    cd->entry[j].comp_method = de.comp_method;
 	    cd->entry[j].comp_size = de.comp_size;
@@ -307,9 +332,11 @@ zip_close(struct zip *za)
 		}
 		return -1;
 	}
+#ifndef PHP_WIN32
     mask = umask(0);
     umask(mask);
     chmod(za->zn, 0666&~mask);
+#endif
     if (za->ch_comment)
         free(za->ch_comment);
 
@@ -322,23 +349,17 @@ zip_close(struct zip *za)
 
 
 static int
-add_data(struct zip *za, struct zip_source *zs, struct zip_dirent *de, FILE *ft)
+add_data(struct zip *za, struct zip_source *src, struct zip_dirent *de,
+	 FILE *ft)
 {
-    off_t offstart, offend;
-    zip_source_callback cb;
-    void *ud;
+    off_t offstart, offdata, offend;
     struct zip_stat st;
-
-    cb = zs->f;
-    ud = zs->ud;
-
-    if (cb(ud, &st, sizeof(st), ZIP_SOURCE_STAT) < (ssize_t)sizeof(st)) {
-	ch_set_error(&za->error, cb, ud);
-	return -1;
-    }
-
-    if (cb(ud, NULL, 0, ZIP_SOURCE_OPEN) < 0) {
-	ch_set_error(&za->error, cb, ud);
+    struct zip_source *s2;
+    zip_compression_implementation comp_impl;
+    int ret;
+    
+    if (zip_source_stat(src, &st) < 0) {
+	_zip_error_set_from_source(&za->error, src);
 	return -1;
     }
 
@@ -347,19 +368,49 @@ add_data(struct zip *za, struct zip_source *zs, struct zip_dirent *de, FILE *ft)
     if (_zip_dirent_write(de, ft, 1, &za->error) < 0)
 	return -1;
 
-    if (st.comp_method != ZIP_CM_STORE) {
-	if (add_data_comp(cb, ud, &st, ft, &za->error) < 0)
-	    return -1;
+    if ((s2=zip_source_crc(za, src, 0)) == NULL) {
+	zip_source_pop(s2);
+	return -1;
     }
-    else {
-	if (add_data_uncomp(za, cb, ud, &st, ft) < 0)
+    
+    /* XXX: deflate 0-byte files for torrentzip? */
+    if (((st.valid & ZIP_STAT_COMP_METHOD) == 0
+	 || st.comp_method == ZIP_CM_STORE)
+	&& ((st.valid & ZIP_STAT_SIZE) == 0 || st.size != 0)) {
+	comp_impl = NULL;
+	if ((comp_impl=zip_get_compression_implementation(ZIP_CM_DEFLATE))
+	    == NULL) {
+	    _zip_error_set(&za->error, ZIP_ER_COMPNOTSUPP, 0);
+	    zip_source_pop(s2);
+	    return -1;
+	}
+	if ((s2=comp_impl(za, s2, ZIP_CM_DEFLATE, ZIP_CODEC_ENCODE))
+	    == NULL) {
+	    /* XXX: set error? */
+	    zip_source_pop(s2);
 	    return -1;
+	}
+    }
+    else
+	s2 = src;
+
+    offdata = ftello(ft);
+	
+    ret = copy_source(za, s2, ft);
+	
+    if (zip_source_stat(s2, &st) < 0)
+	ret = -1;
+    
+    while (s2 != src) {
+	if ((s2=zip_source_pop(s2)) == NULL) {
+	    /* XXX: set erorr */
+	    ret = -1;
+	    break;
+	}
     }
 
-    if (cb(ud, NULL, 0, ZIP_SOURCE_CLOSE) < 0) {
-	ch_set_error(&za->error, cb, ud);
+    if (ret < 0)
 	return -1;
-    }
 
     offend = ftello(ft);
 
@@ -368,19 +419,18 @@ add_data(struct zip *za, struct zip_source *zs, struct zip_dirent *de, FILE *ft)
 	return -1;
     }
 
-    
     de->last_mod = st.mtime;
     de->comp_method = st.comp_method;
     de->crc = st.crc;
     de->uncomp_size = st.size;
-    de->comp_size = st.comp_size;
+    de->comp_size = offend - offdata;
 
     if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0))
 	_zip_dirent_torrent_normalize(de);
 
     if (_zip_dirent_write(de, ft, 1, &za->error) < 0)
 	return -1;
-
+    
     if (fseeko(ft, offend, SEEK_SET) < 0) {
 	_zip_error_set(&za->error, ZIP_ER_SEEK, errno);
 	return -1;
@@ -392,133 +442,6 @@ add_data(struct zip *za, struct zip_source *zs, struct zip_dirent *de, FILE *ft)
 
 
 static int
-add_data_comp(zip_source_callback cb, void *ud, struct zip_stat *st,FILE *ft,
-	      struct zip_error *error)
-{
-    char buf[BUFSIZE];
-    ssize_t n;
-
-    st->comp_size = 0;
-    while ((n=cb(ud, buf, sizeof(buf), ZIP_SOURCE_READ)) > 0) {
-	if (fwrite(buf, 1, n, ft) != (size_t)n) {
-	    _zip_error_set(error, ZIP_ER_WRITE, errno);
-	    return -1;
-	}
-
-	st->comp_size += n;
-    }
-    if (n < 0) {
-	ch_set_error(error, cb, ud);
-	return -1;
-    }
-
-    return 0;
-}
-
-
-
-static int
-add_data_uncomp(struct zip *za, zip_source_callback cb, void *ud,
-		struct zip_stat *st, FILE *ft)
-{
-    char b1[BUFSIZE], b2[BUFSIZE];
-    int end, flush, ret;
-    ssize_t n;
-    size_t n2;
-    z_stream zstr;
-    int mem_level;
-
-    st->comp_method = ZIP_CM_DEFLATE;
-    st->comp_size = st->size = 0;
-    st->crc = crc32(0, NULL, 0);
-
-    zstr.zalloc = Z_NULL;
-    zstr.zfree = Z_NULL;
-    zstr.opaque = NULL;
-    zstr.avail_in = 0;
-    zstr.avail_out = 0;
-
-    if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0))
-	mem_level = TORRENT_MEM_LEVEL;
-    else
-	mem_level = MAX_MEM_LEVEL;
-
-    /* -MAX_WBITS: undocumented feature of zlib to _not_ write a zlib header */
-    deflateInit2(&zstr, Z_BEST_COMPRESSION, Z_DEFLATED, -MAX_WBITS, mem_level,
-		 Z_DEFAULT_STRATEGY);
-
-    zstr.next_out = (Bytef *)b2;
-    zstr.avail_out = sizeof(b2);
-    zstr.next_in = NULL;
-    zstr.avail_in = 0;
-
-    flush = 0;
-    end = 0;
-    while (!end) {
-	if (zstr.avail_in == 0 && !flush) {
-	    if ((n=cb(ud, b1, sizeof(b1), ZIP_SOURCE_READ)) < 0) {
-		ch_set_error(&za->error, cb, ud);
-		deflateEnd(&zstr);
-		return -1;
-	    }
-	    if (n > 0) {
-		zstr.avail_in = n;
-		zstr.next_in = (Bytef *)b1;
-		st->size += n;
-		st->crc = crc32(st->crc, (Bytef *)b1, n);
-	    }
-	    else
-		flush = Z_FINISH;
-	}
-
-	ret = deflate(&zstr, flush);
-	if (ret != Z_OK && ret != Z_STREAM_END) {
-	    _zip_error_set(&za->error, ZIP_ER_ZLIB, ret);
-	    return -1;
-	}
-
-	if (zstr.avail_out != sizeof(b2)) {
-	    n2 = sizeof(b2) - zstr.avail_out;
-
-	    if (fwrite(b2, 1, n2, ft) != n2) {
-		_zip_error_set(&za->error, ZIP_ER_WRITE, errno);
-		return -1;
-	    }
-
-	    zstr.next_out = (Bytef *)b2;
-	    zstr.avail_out = sizeof(b2);
-	    st->comp_size += n2;
-	}
-
-	if (ret == Z_STREAM_END) {
-	    deflateEnd(&zstr);
-	    end = 1;
-	}
-    }
-
-    return 0;
-}
-
-
-
-static void
-ch_set_error(struct zip_error *error, zip_source_callback cb, void *ud)
-{
-    int e[2];
-
-    if ((cb(ud, e, sizeof(e), ZIP_SOURCE_ERROR)) < (ssize_t)sizeof(e)) {
-	error->zip_err = ZIP_ER_INTERNAL;
-	error->sys_err = 0;
-    }
-    else {
-	error->zip_err = e[0];
-	error->sys_err = e[1];
-    }
-}
-
-
-
-static int
 copy_data(FILE *fs, off_t len, FILE *ft, struct zip_error *error)
 {
     char buf[BUFSIZE];
@@ -552,6 +475,40 @@ copy_data(FILE *fs, off_t len, FILE *ft, struct zip_error *error)
 
 
 static int
+copy_source(struct zip *za, struct zip_source *src, FILE *ft)
+{
+    char buf[BUFSIZE];
+    zip_int64_t n;
+    int ret;
+
+    if (zip_source_open(src) < 0) {
+	_zip_error_set_from_source(&za->error, src);
+	return -1;
+    }
+
+    ret = 0;
+    while ((n=zip_source_read(src, buf, sizeof(buf))) > 0) {
+	if (fwrite(buf, 1, n, ft) != (size_t)n) {
+	    _zip_error_set(&za->error, ZIP_ER_WRITE, errno);
+	    ret = -1;
+	    break;
+	}
+    }
+    
+    if (n < 0) {
+	if (ret == 0)
+	    _zip_error_set_from_source(&za->error, src);
+	ret = -1;
+    }	
+
+    zip_source_close(src);
+    
+    return ret;
+}
+
+
+
+static int
 write_cdir(struct zip *za, struct zip_cdir *cd, FILE *out)
 {
     off_t offset;
@@ -613,7 +570,7 @@ _zip_cdir_set_comment(struct zip_cdir *dest, struct zip *src)
 
 
 
-static int
+int
 _zip_changed(struct zip *za, int *survivorsp)
 {
     int changed, i, survivors;
@@ -626,13 +583,15 @@ _zip_changed(struct zip *za, int *survivorsp)
 
     for (i=0; i<za->nentry; i++) {
 	if ((za->entry[i].state != ZIP_ST_UNCHANGED)
+	    || (za->entry[i].ch_extra_len != -1)
 	    || (za->entry[i].ch_comment_len != -1))
 	    changed = 1;
 	if (za->entry[i].state != ZIP_ST_DELETED)
 	    survivors++;
     }
 
-    *survivorsp = survivors;
+    if (survivorsp)
+	*survivorsp = survivors;
 
     return changed;
 }
@@ -668,6 +627,10 @@ _zip_create_temp_output(struct zip *za, FILE **outp)
 	return NULL;
     }
 #ifdef PHP_WIN32
+    /*
+      According to Pierre Joye, Windows in some environments per
+      default creates text files, so force binary mode.
+    */
 	_setmode(_fileno(tfp), _O_BINARY );
 #endif
 
diff --git a/ext/zip/lib/zip_delete.c b/ext/zip/lib/zip_delete.c
index 4591ff7..da3e65b 100644
--- a/ext/zip/lib/zip_delete.c
+++ b/ext/zip/lib/zip_delete.c
@@ -1,6 +1,6 @@
 /*
   zip_delete.c -- delete file from zip archive
-  Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip at nih.at>
@@ -38,13 +38,18 @@
 
 
 ZIP_EXTERN(int)
-zip_delete(struct zip *za, int idx)
+zip_delete(struct zip *za, zip_uint64_t idx)
 {
     if (idx < 0 || idx >= za->nentry) {
 	_zip_error_set(&za->error, ZIP_ER_INVAL, 0);
 	return -1;
     }
 
+    if (ZIP_IS_RDONLY(za)) {
+	_zip_error_set(&za->error, ZIP_ER_RDONLY, 0);
+	return -1;
+    }
+
     /* allow duplicate file names, because the file will
      * be removed directly afterwards */
     if (_zip_unchange(za, idx, 1) != 0)
diff --git a/ext/zip/lib/zip_dirent.c b/ext/zip/lib/zip_dirent.c
index 59f8ab0..6cb9ee3 100644
--- a/ext/zip/lib/zip_dirent.c
+++ b/ext/zip/lib/zip_dirent.c
@@ -45,7 +45,6 @@
 static time_t _zip_d2u_time(int, int);
 static char *_zip_readfpstr(FILE *, unsigned int, int, struct zip_error *);
 static char *_zip_readstr(unsigned char **, int, int, struct zip_error *);
-static void _zip_u2d_time(time_t, unsigned short *, unsigned short *);
 static void _zip_write2(unsigned short, FILE *);
 static void _zip_write4(unsigned int, FILE *);
 
@@ -213,13 +212,13 @@ _zip_dirent_init(struct zip_dirent *de)
 
 int
 _zip_dirent_read(struct zip_dirent *zde, FILE *fp,
-		 unsigned char **bufp, unsigned int *leftp, int local,
+		 unsigned char **bufp, zip_uint32_t *leftp, int local,
 		 struct zip_error *error)
 {
     unsigned char buf[CDENTRYSIZE];
     unsigned char *cur;
     unsigned short dostime, dosdate;
-    unsigned int size;
+    zip_uint32_t size;
 
     if (local)
 	size = LENTRYSIZE;
@@ -475,6 +474,8 @@ _zip_d2u_time(int dtime, int ddate)
 {
     struct tm tm = {0};
 
+    memset(&tm, 0, sizeof(tm));
+    
     /* let mktime decide if DST is in effect */
     tm.tm_isdst = -1;
     
@@ -598,7 +599,7 @@ _zip_write4(unsigned int i, FILE *fp)
 
 
 
-static void
+void
 _zip_u2d_time(time_t time, unsigned short *dtime, unsigned short *ddate)
 {
     struct tm *tm;
diff --git a/ext/zip/lib/zip_entry_free.c b/ext/zip/lib/zip_entry_free.c
index c50c943..e8a7770 100644
--- a/ext/zip/lib/zip_entry_free.c
+++ b/ext/zip/lib/zip_entry_free.c
@@ -44,6 +44,9 @@ _zip_entry_free(struct zip_entry *ze)
 {
     free(ze->ch_filename);
     ze->ch_filename = NULL;
+    free(ze->ch_extra);
+    ze->ch_extra = NULL;
+    ze->ch_extra_len = -1;
     free(ze->ch_comment);
     ze->ch_comment = NULL;
     ze->ch_comment_len = -1;
diff --git a/ext/zip/lib/zip_entry_new.c b/ext/zip/lib/zip_entry_new.c
index 7059b1b..ad5d599 100644
--- a/ext/zip/lib/zip_entry_new.c
+++ b/ext/zip/lib/zip_entry_new.c
@@ -1,6 +1,6 @@
 /*
   zip_entry_new.c -- create and init struct zip_entry
-  Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip at nih.at>
@@ -46,20 +46,21 @@ _zip_entry_new(struct zip *za)
     if (!za) {
 	ze = (struct zip_entry *)malloc(sizeof(struct zip_entry));
 	if (!ze) {
-	    _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
 	    return NULL;
 	}
     }
     else {
-	if (za->nentry >= za->nentry_alloc-1) {
+	if (za->nentry+1 >= za->nentry_alloc) {
+	    struct zip_entry *rentries;
 	    za->nentry_alloc += 16;
-	    za->entry = (struct zip_entry *)realloc(za->entry,
-						    sizeof(struct zip_entry)
-						    * za->nentry_alloc);
-	    if (!za->entry) {
+	    rentries = (struct zip_entry *)realloc(za->entry,
+						   sizeof(struct zip_entry)
+						   * za->nentry_alloc);
+	    if (!rentries) {
 		_zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
 		return NULL;
 	    }
+	    za->entry = rentries;
 	}
 	ze = za->entry+za->nentry;
     }
@@ -67,6 +68,8 @@ _zip_entry_new(struct zip *za)
     ze->state = ZIP_ST_UNCHANGED;
 
     ze->ch_filename = NULL;
+    ze->ch_extra = NULL;
+    ze->ch_extra_len = -1;
     ze->ch_comment = NULL;
     ze->ch_comment_len = -1;
     ze->source = NULL;
diff --git a/ext/zip/lib/zip_err_str.c b/ext/zip/lib/zip_err_str.c
index 3fcdf17..8fb6003 100644
--- a/ext/zip/lib/zip_err_str.c
+++ b/ext/zip/lib/zip_err_str.c
@@ -32,6 +32,10 @@ const char * const _zip_err_str[] = {
     "Zip archive inconsistent",
     "Can't remove file",
     "Entry has been deleted",
+    "Encryption method not supported",
+    "Read-only archive", 
+    "No password provided",
+    "Wrong password provided",
 };
 
 const int _zip_nerr_str = sizeof(_zip_err_str)/sizeof(_zip_err_str[0]);
@@ -65,4 +69,8 @@ const int _zip_err_type[] = {
     N,
     S,
     N,
+    N,
+    N, 
+    N,
+    N,
 };
diff --git a/ext/zip/lib/zip_error.c b/ext/zip/lib/zip_error.c
index aab7079..b8d907a 100644
--- a/ext/zip/lib/zip_error.c
+++ b/ext/zip/lib/zip_error.c
@@ -1,6 +1,6 @@
 /*
   zip_error.c -- struct zip_error helper functions
-  Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip at nih.at>
@@ -99,3 +99,14 @@ _zip_error_set(struct zip_error *err, int ze, int se)
 	err->sys_err = se;
     }
 }
+
+
+
+void
+_zip_error_set_from_source(struct zip_error *err, struct zip_source *src)
+{
+    int ze, se;
+    
+    zip_source_error(src, &ze, &se);
+    _zip_error_set(err, ze, se);
+}
diff --git a/ext/zip/lib/zip_error_to_str.c b/ext/zip/lib/zip_error_to_str.c
index 4dea4d6..bafe743 100644
--- a/ext/zip/lib/zip_error_to_str.c
+++ b/ext/zip/lib/zip_error_to_str.c
@@ -1,6 +1,6 @@
 /*
   zip_error_to_str.c -- get string representation of zip error code
-  Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip at nih.at>
@@ -43,7 +43,7 @@
 
 
 ZIP_EXTERN(int)
-zip_error_to_str(char *buf, size_t len, int ze, int se)
+zip_error_to_str(char *buf, zip_uint64_t len, int ze, int se)
 {
     const char *zs, *ss;
 
diff --git a/ext/zip/lib/zip_fclose.c b/ext/zip/lib/zip_fclose.c
index 8f062d9..eb55ddb 100644
--- a/ext/zip/lib/zip_fclose.c
+++ b/ext/zip/lib/zip_fclose.c
@@ -44,28 +44,20 @@ zip_fclose(struct zip_file *zf)
 {
     int i, ret;
     
-    if (zf->zstr)
-	inflateEnd(zf->zstr);
-    free(zf->buffer);
-    free(zf->zstr);
-	if (zf->za) {
-		for (i=0; i<zf->za->nfile; i++) {
-			if (zf->za->file[i] == zf) {
-				zf->za->file[i] = zf->za->file[zf->za->nfile-1];
-				zf->za->nfile--;
-				break;
-			}
-		}
+    if (zf->src)
+	zip_source_free(zf->src);
+
+    for (i=0; i<zf->za->nfile; i++) {
+	if (zf->za->file[i] == zf) {
+	    zf->za->file[i] = zf->za->file[zf->za->nfile-1];
+	    zf->za->nfile--;
+	    break;
 	}
+    }
 
     ret = 0;
     if (zf->error.zip_err)
 	ret = zf->error.zip_err;
-    else if ((zf->flags & ZIP_ZF_CRC) && (zf->flags & ZIP_ZF_EOF)) {
-	/* if EOF, compare CRC */
-	if (zf->crc_orig != zf->crc)
-	    ret = ZIP_ER_CRC;
-    }
 
     free(zf);
     return ret;
diff --git a/ext/zip/lib/zip_fdopen.c b/ext/zip/lib/zip_fdopen.c
new file mode 100644
index 0000000..df70f27
--- /dev/null
+++ b/ext/zip/lib/zip_fdopen.c
@@ -0,0 +1,62 @@
+/*
+  zip_fdopen.c -- open read-only archive from file descriptor
+  Copyright (C) 2009-2010 Dieter Baron and Thomas Klausner
+
+  This file is part of libzip, a library to manipulate ZIP archives.
+  The authors can be contacted at <libzip at nih.at>
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in
+     the documentation and/or other materials provided with the
+     distribution.
+  3. The names of the authors may not be used to endorse or promote
+     products derived from this software without specific prior
+     written permission.
+ 
+  THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
+  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+
+#include "zipint.h"
+
+
+
+ZIP_EXTERN(struct zip *)
+zip_fdopen(int fd_orig, int flags, int *zep)
+{
+    int fd;
+    FILE *fp;
+
+    /* We dup() here to avoid messing with the passed in fd.
+       We could not restore it to the original state in case of error. */
+
+    if ((fd=dup(fd_orig)) < 0) {
+	*zep = ZIP_ER_OPEN;
+	return NULL;
+    }
+
+    if ((fp=fdopen(fd, "rb")) == NULL) {
+	close(fd);
+	*zep = ZIP_ER_OPEN;
+	return NULL;
+    }
+
+    close(fd_orig);
+    return _zip_open(NULL, fp, flags, ZIP_AFL_RDONLY, zep);
+}
diff --git a/ext/zip/lib/zip_filerange_crc.c b/ext/zip/lib/zip_filerange_crc.c
index c689098..4d1ad56 100644
--- a/ext/zip/lib/zip_filerange_crc.c
+++ b/ext/zip/lib/zip_filerange_crc.c
@@ -1,6 +1,6 @@
 /*
   zip_filerange_crc.c -- compute CRC32 for a range of a file
-  Copyright (C) 2008-2009 Dieter Baron and Thomas Klausner
+  Copyright (C) 2008 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip at nih.at>
diff --git a/ext/zip/lib/zip_fopen.c b/ext/zip/lib/zip_fopen.c
index b4b7604..f62adbb 100644
--- a/ext/zip/lib/zip_fopen.c
+++ b/ext/zip/lib/zip_fopen.c
@@ -1,6 +1,6 @@
 /*
   zip_fopen.c -- open file in zip archive for reading
-  Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip at nih.at>
@@ -45,5 +45,5 @@ zip_fopen(struct zip *za, const char *fname, int flags)
     if ((idx=zip_name_locate(za, fname, flags)) < 0)
 	return NULL;
 
-    return zip_fopen_index(za, idx, flags);
+    return zip_fopen_index_encrypted(za, idx, flags, za->default_password);
 }
diff --git a/ext/zip/lib/zip_fopen_encrypted.c b/ext/zip/lib/zip_fopen_encrypted.c
new file mode 100644
index 0000000..8aba062
--- /dev/null
+++ b/ext/zip/lib/zip_fopen_encrypted.c
@@ -0,0 +1,50 @@
+/*
+  zip_fopen_encrypted.c -- open file for reading with password
+  Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner
+
+  This file is part of libzip, a library to manipulate ZIP archives.
+  The authors can be contacted at <libzip at nih.at>
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in
+     the documentation and/or other materials provided with the
+     distribution.
+  3. The names of the authors may not be used to endorse or promote
+     products derived from this software without specific prior
+     written permission.
+ 
+  THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
+  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+
+#include "zipint.h"
+
+
+
+ZIP_EXTERN(struct zip_file *)
+zip_fopen_encrypted(struct zip *za, const char *fname, int flags,
+		    const char *password)
+{
+    int idx;
+
+    if ((idx=zip_name_locate(za, fname, flags)) < 0)
+	return NULL;
+
+    return zip_fopen_index_encrypted(za, idx, flags, password);
+}
diff --git a/ext/zip/lib/zip_fopen_index.c b/ext/zip/lib/zip_fopen_index.c
index 1e7e419..5c777ee 100644
--- a/ext/zip/lib/zip_fopen_index.c
+++ b/ext/zip/lib/zip_fopen_index.c
@@ -1,6 +1,6 @@
 /*
   zip_fopen_index.c -- open file in zip archive for reading by index
-  Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip at nih.at>
@@ -39,178 +39,11 @@
 
 #include "zipint.h"
 
-static struct zip_file *_zip_file_new(struct zip *za);
 
 
 
 ZIP_EXTERN(struct zip_file *)
-zip_fopen_index(struct zip *za, int fileno, int flags)
+zip_fopen_index(struct zip *za, zip_uint64_t fileno, int flags)
 {
-    int len, ret;
-    int zfflags;
-    struct zip_file *zf;
-
-    if ((fileno < 0) || (fileno >= za->nentry)) {
-	_zip_error_set(&za->error, ZIP_ER_INVAL, 0);
-	return NULL;
-    }
-
-    if ((flags & ZIP_FL_UNCHANGED) == 0
-	&& ZIP_ENTRY_DATA_CHANGED(za->entry+fileno)) {
-	_zip_error_set(&za->error, ZIP_ER_CHANGED, 0);
-	return NULL;
-    }
-
-    if (fileno >= za->cdir->nentry) {
-	_zip_error_set(&za->error, ZIP_ER_INVAL, 0);
-	return NULL;
-    }
-
-    zfflags = 0;
-    switch (za->cdir->entry[fileno].comp_method) {
-    case ZIP_CM_STORE:
-	zfflags |= ZIP_ZF_CRC;
-	break;
-
-    case ZIP_CM_DEFLATE:
-	if ((flags & ZIP_FL_COMPRESSED) == 0)
-	    zfflags |= ZIP_ZF_CRC | ZIP_ZF_DECOMP;
-	break;
-    default:
-	if ((flags & ZIP_FL_COMPRESSED) == 0) {
-	    _zip_error_set(&za->error, ZIP_ER_COMPNOTSUPP, 0);
-	    return NULL;
-	}
-	break;
-    }
-
-    zf = _zip_file_new(za);
-
-    zf->flags = zfflags;
-    /* zf->name = za->cdir->entry[fileno].filename; */
-    zf->method = za->cdir->entry[fileno].comp_method;
-    zf->bytes_left = za->cdir->entry[fileno].uncomp_size;
-    zf->cbytes_left = za->cdir->entry[fileno].comp_size;
-    zf->crc_orig = za->cdir->entry[fileno].crc;
-
-    if ((zf->fpos=_zip_file_get_offset(za, fileno)) == 0) {
-	zip_fclose(zf);
-	return NULL;
-    }
-    
-    if ((zf->flags & ZIP_ZF_DECOMP) == 0)
-	zf->bytes_left = zf->cbytes_left;
-    else {
-	if ((zf->buffer=(char *)malloc(BUFSIZE)) == NULL) {
-	    _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
-	    zip_fclose(zf);
-	    return NULL;
-	}
-
-	len = _zip_file_fillbuf(zf->buffer, BUFSIZE, zf);
-	if (len <= 0) {
-	    _zip_error_copy(&za->error, &zf->error);
-	    zip_fclose(zf);
-	return NULL;
-	}
-
-	if ((zf->zstr = (z_stream *)malloc(sizeof(z_stream))) == NULL) {
-	    _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
-	    zip_fclose(zf);
-	    return NULL;
-	}
-	zf->zstr->zalloc = Z_NULL;
-	zf->zstr->zfree = Z_NULL;
-	zf->zstr->opaque = NULL;
-	zf->zstr->next_in = (Bytef *)zf->buffer;
-	zf->zstr->avail_in = len;
-	
-	/* negative value to tell zlib that there is no header */
-	if ((ret=inflateInit2(zf->zstr, -MAX_WBITS)) != Z_OK) {
-	    _zip_error_set(&za->error, ZIP_ER_ZLIB, ret);
-	    zip_fclose(zf);
-	    return NULL;
-	}
-    }
-    
-    return zf;
-}
-
-
-
-int
-_zip_file_fillbuf(void *buf, size_t buflen, struct zip_file *zf)
-{
-    int i, j;
-
-    if (zf->error.zip_err != ZIP_ER_OK)
-	return -1;
-
-    if ((zf->flags & ZIP_ZF_EOF) || zf->cbytes_left <= 0 || buflen <= 0)
-	return 0;
-    
-    if (fseeko(zf->za->zp, zf->fpos, SEEK_SET) < 0) {
-	_zip_error_set(&zf->error, ZIP_ER_SEEK, errno);
-	return -1;
-    }
-    if (buflen < zf->cbytes_left)
-	i = buflen;
-    else
-	i = zf->cbytes_left;
-
-    j = fread(buf, 1, i, zf->za->zp);
-    if (j == 0) {
-	_zip_error_set(&zf->error, ZIP_ER_EOF, 0);
-	j = -1;
-    }
-    else if (j < 0)
-	_zip_error_set(&zf->error, ZIP_ER_READ, errno);
-    else {
-	zf->fpos += j;
-	zf->cbytes_left -= j;
-    }
-
-    return j;	
-}
-
-
-
-static struct zip_file *
-_zip_file_new(struct zip *za)
-{
-    struct zip_file *zf, **file;
-    int n;
-
-    if ((zf=(struct zip_file *)malloc(sizeof(struct zip_file))) == NULL) {
-	_zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
-	return NULL;
-    }
-    
-    if (za->nfile >= za->nfile_alloc-1) {
-	n = za->nfile_alloc + 10;
-	file = (struct zip_file **)realloc(za->file,
-					   n*sizeof(struct zip_file *));
-	if (file == NULL) {
-	    _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
-	    free(zf);
-	    return NULL;
-	}
-	za->nfile_alloc = n;
-	za->file = file;
-    }
-
-    za->file[za->nfile++] = zf;
-
-    zf->za = za;
-    _zip_error_init(&zf->error);
-    zf->flags = 0;
-    zf->crc = crc32(0L, Z_NULL, 0);
-    zf->crc_orig = 0;
-    zf->method = -1;
-    zf->bytes_left = zf->cbytes_left = 0;
-    zf->fpos = 0;
-    zf->buffer = NULL;
-    zf->zstr = NULL;
-
-    return zf;
+    return zip_fopen_index_encrypted(za, fileno, flags, za->default_password);
 }
diff --git a/ext/zip/lib/zip_fopen_index_encrypted.c b/ext/zip/lib/zip_fopen_index_encrypted.c
new file mode 100644
index 0000000..988a78f
--- /dev/null
+++ b/ext/zip/lib/zip_fopen_index_encrypted.c
@@ -0,0 +1,191 @@
+/*
+  zip_fopen_index_encrypted.c -- open file for reading by index w/ password
+  Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner
+
+  This file is part of libzip, a library to manipulate ZIP archives.
+  The authors can be contacted at <libzip at nih.at>
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in
+     the documentation and/or other materials provided with the
+     distribution.
+  3. The names of the authors may not be used to endorse or promote
+     products derived from this software without specific prior
+     written permission.
+ 
+  THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
+  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "zipint.h"
+
+static struct zip_file *_zip_file_new(struct zip *za);
+
+
+
+ZIP_EXTERN(struct zip_file *)
+zip_fopen_index_encrypted(struct zip *za, zip_uint64_t fileno, int flags,
+			  const char *password)
+{
+    struct zip_file *zf;
+    zip_compression_implementation comp_impl;
+    zip_encryption_implementation enc_impl;
+    struct zip_source *src, *s2;
+    zip_uint64_t start;
+    struct zip_stat st;
+
+    if (fileno >= za->nentry) {
+	_zip_error_set(&za->error, ZIP_ER_INVAL, 0);
+	return NULL;
+    }
+
+    if ((flags & ZIP_FL_UNCHANGED) == 0
+	&& ZIP_ENTRY_DATA_CHANGED(za->entry+fileno)) {
+	_zip_error_set(&za->error, ZIP_ER_CHANGED, 0);
+	return NULL;
+    }
+
+    if (fileno >= za->cdir->nentry) {
+	_zip_error_set(&za->error, ZIP_ER_INVAL, 0);
+	return NULL;
+    }
+
+    if (flags & ZIP_FL_ENCRYPTED)
+	flags |= ZIP_FL_COMPRESSED;
+
+    zip_stat_index(za, fileno, flags, &st);
+
+    enc_impl = NULL;
+    if ((flags & ZIP_FL_ENCRYPTED) == 0) {
+	if (st.encryption_method != ZIP_EM_NONE) {
+	    if (password == NULL) {
+		_zip_error_set(&za->error, ZIP_ER_NOPASSWD, 0);
+		return NULL;
+	    }
+	    if ((enc_impl=zip_get_encryption_implementation(
+		     st.encryption_method)) == NULL) {
+		_zip_error_set(&za->error, ZIP_ER_ENCRNOTSUPP, 0);
+		return NULL;
+	    }
+	}
+    }
+
+    comp_impl = NULL;
+    if ((flags & ZIP_FL_COMPRESSED) == 0) {
+	if (st.comp_method != ZIP_CM_STORE) {
+	    if ((comp_impl=zip_get_compression_implementation(
+		     st.comp_method)) == NULL) {
+		_zip_error_set(&za->error, ZIP_ER_COMPNOTSUPP, 0);
+		return NULL;
+	    }
+	}
+    }
+
+    if ((start=_zip_file_get_offset(za, fileno)) == 0)
+	return NULL;
+
+    if (st.comp_size == 0) {
+	if ((src=zip_source_buffer(za, NULL, 0, 0)) == NULL)
+	    return NULL;
+    }
+    else {
+	if ((src=_zip_source_file_or_p(za, NULL, za->zp, start, st.comp_size,
+				       0, &st)) == NULL)
+	    return NULL;
+	if (enc_impl) {
+	    if ((s2=enc_impl(za, src, ZIP_EM_TRAD_PKWARE, 0,
+			     password)) == NULL) {
+		zip_source_free(src);
+		/* XXX: set error (how?) */
+		return NULL;
+	    }
+	    src = s2;
+	}
+	if (comp_impl) {
+	    if ((s2=comp_impl(za, src, za->cdir->entry[fileno].comp_method,
+			      0)) == NULL) {
+		zip_source_free(src);
+		/* XXX: set error (how?) */
+		return NULL;
+	    }
+	    src = s2;
+	}
+	if ((flags & ZIP_FL_COMPRESSED) == 0
+	    || st.comp_method == ZIP_CM_STORE ) {
+	    if ((s2=zip_source_crc(za, src, 1)) == NULL) {
+		zip_source_free(src);
+		/* XXX: set error (how?) */
+		return NULL;
+	    }
+	    src = s2;
+	}
+    }
+
+    if (zip_source_open(src) < 0) {
+	_zip_error_set_from_source(&za->error, src);
+	zip_source_free(src);
+	return NULL;
+    }
+
+    zf = _zip_file_new(za);
+
+    zf->src = src;
+
+    return zf;
+}
+
+
+
+static struct zip_file *
+_zip_file_new(struct zip *za)
+{
+    struct zip_file *zf, **file;
+    int n;
+
+    if ((zf=(struct zip_file *)malloc(sizeof(struct zip_file))) == NULL) {
+	_zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
+	return NULL;
+    }
+    
+    if (za->nfile >= za->nfile_alloc-1) {
+	n = za->nfile_alloc + 10;
+	file = (struct zip_file **)realloc(za->file,
+					   n*sizeof(struct zip_file *));
+	if (file == NULL) {
+	    _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
+	    free(zf);
+	    return NULL;
+	}
+	za->nfile_alloc = n;
+	za->file = file;
+    }
+
+    za->file[za->nfile++] = zf;
+
+    zf->za = za;
+    _zip_error_init(&zf->error);
+    zf->eof = 0;
+    zf->src = NULL;
+
+    return zf;
+}
diff --git a/ext/zip/lib/zip_fread.c b/ext/zip/lib/zip_fread.c
index 00a6bdc..4c828a8 100644
--- a/ext/zip/lib/zip_fread.c
+++ b/ext/zip/lib/zip_fread.c
@@ -1,6 +1,6 @@
 /*
   zip_fread.c -- read from file
-  Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip at nih.at>
@@ -37,12 +37,10 @@
 
 
 
-ZIP_EXTERN(ssize_t)
-zip_fread(struct zip_file *zf, void *outbuf, size_t toread)
+ZIP_EXTERN(zip_int64_t)
+zip_fread(struct zip_file *zf, void *outbuf, zip_uint64_t toread)
 {
-    int ret;
-	size_t out_before, len;
-    int i;
+    zip_int64_t n;
 
     if (!zf)
 	return -1;
@@ -50,81 +48,27 @@ zip_fread(struct zip_file *zf, void *outbuf, size_t toread)
     if (zf->error.zip_err != 0)
 	return -1;
 
-    if ((zf->flags & ZIP_ZF_EOF) || (toread == 0))
-	return 0;
+    if (toread > ZIP_INT64_MAX) {
+	_zip_error_set(&zf->error, ZIP_ER_INVAL, 0);
+	return -1;
+    }
 
-    if (zf->bytes_left == 0) {
-	zf->flags |= ZIP_ZF_EOF;
-	if (zf->flags & ZIP_ZF_CRC) {
-	    if (zf->crc != zf->crc_orig) {
-		_zip_error_set(&zf->error, ZIP_ER_CRC, 0);
-		return -1;
-	    }
-	}
+    if ((zf->eof) || (toread == 0))
 	return 0;
-    }
 
-    if ((zf->flags & ZIP_ZF_DECOMP) == 0) {
-	ret = _zip_file_fillbuf(outbuf, toread, zf);
-	if (ret > 0) {
-	    if (zf->flags & ZIP_ZF_CRC)
-		zf->crc = crc32(zf->crc, (Bytef *)outbuf, ret);
-	    zf->bytes_left -= ret;
-	}
-	return ret;
+    if ((n=zip_source_read(zf->src, outbuf, toread)) < 0) {
+	_zip_error_set_from_source(&zf->error, zf->src);
+	return -1;
     }
     
-    zf->zstr->next_out = (Bytef *)outbuf;
+	/* XXX the following left from the previous PHP port, let's see how to use it now */
+    /*zf->zstr->next_out = (Bytef *)outbuf;
     zf->zstr->avail_out = toread;
-    out_before = zf->zstr->total_out;
+    out_before = zf->zstr->total_out;*/
     
     /* endless loop until something has been accomplished */
-    for (;;) {
-	ret = inflate(zf->zstr, Z_SYNC_FLUSH);
+    /*for (;;) {
+	ret = inflate(zf->zstr, Z_SYNC_FLUSH);*/
 
-	switch (ret) {
-	case Z_STREAM_END:
-	    if (zf->zstr->total_out == out_before) {
-		if (zf->crc != zf->crc_orig) {
-		    _zip_error_set(&zf->error, ZIP_ER_CRC, 0);
-		    return -1;
-		}
-		else
-		    return 0;
-	    }
-
-	    /* fallthrough */
-
-	case Z_OK:
-	    len = zf->zstr->total_out - out_before;
-	    if (len >= zf->bytes_left || len >= toread) {
-		if (zf->flags & ZIP_ZF_CRC)
-		    zf->crc = crc32(zf->crc, (Bytef *)outbuf, len);
-		zf->bytes_left -= len;
-	        return len;
-	    }
-	    break;
-
-	case Z_BUF_ERROR:
-	    if (zf->zstr->avail_in == 0) {
-		i = _zip_file_fillbuf(zf->buffer, BUFSIZE, zf);
-		if (i == 0) {
-		    _zip_error_set(&zf->error, ZIP_ER_INCONS, 0);
-		    return -1;
-		}
-		else if (i < 0)
-		    return -1;
-		zf->zstr->next_in = (Bytef *)zf->buffer;
-		zf->zstr->avail_in = i;
-		continue;
-	    }
-	    /* fallthrough */
-	case Z_NEED_DICT:
-	case Z_DATA_ERROR:
-	case Z_STREAM_ERROR:
-	case Z_MEM_ERROR:
-	    _zip_error_set(&zf->error, ZIP_ER_ZLIB, ret);
-	    return -1;
-	}
-    }
+    return n;
 }
diff --git a/ext/zip/lib/zip_free.c b/ext/zip/lib/zip_free.c
index 76c3a96..9932c14 100644
--- a/ext/zip/lib/zip_free.c
+++ b/ext/zip/lib/zip_free.c
@@ -57,7 +57,9 @@ _zip_free(struct zip *za)
     if (za->zp)
 	fclose(za->zp);
 
+    free(za->default_password);
     _zip_cdir_free(za->cdir);
+    free(za->ch_comment);
 
     if (za->entry) {
 	for (i=0; i<za->nentry; i++) {
diff --git a/ext/zip/lib/zip_get_archive_comment.c b/ext/zip/lib/zip_get_archive_comment.c
index ed1324f..fe97e6e 100644
--- a/ext/zip/lib/zip_get_archive_comment.c
+++ b/ext/zip/lib/zip_get_archive_comment.c
@@ -42,11 +42,11 @@ zip_get_archive_comment(struct zip *za, int *lenp, int flags)
 {
     if ((flags & ZIP_FL_UNCHANGED)
 	|| (za->ch_comment_len == -1)) {
-		if (za->cdir) {
-			if (lenp != NULL)
-				*lenp = za->cdir->comment_len;
-			return za->cdir->comment;
-		}
+	if (za->cdir) {
+	    if (lenp != NULL)
+		*lenp = za->cdir->comment_len;
+	    return za->cdir->comment;
+	}
 	else {
 	    if (lenp != NULL)
 		*lenp = -1;
diff --git a/ext/zip/lib/zip_get_archive_flag.c b/ext/zip/lib/zip_get_archive_flag.c
index a595c51..2d46aa3 100644
--- a/ext/zip/lib/zip_get_archive_flag.c
+++ b/ext/zip/lib/zip_get_archive_flag.c
@@ -1,6 +1,6 @@
 /*
   zip_get_archive_flag.c -- get archive global flag
-  Copyright (C) 2008-2009 Dieter Baron and Thomas Klausner
+  Copyright (C) 2008 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip at nih.at>
diff --git a/ext/zip/lib/zip_get_compression_implementation.c b/ext/zip/lib/zip_get_compression_implementation.c
new file mode 100644
index 0000000..197cd49
--- /dev/null
+++ b/ext/zip/lib/zip_get_compression_implementation.c
@@ -0,0 +1,46 @@
+/*
+  zip_get_compression_implementation.c -- get compression implementation
+  Copyright (C) 2009 Dieter Baron and Thomas Klausner
+
+  This file is part of libzip, a library to manipulate ZIP archives.
+  The authors can be contacted at <libzip at nih.at>
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in
+     the documentation and/or other materials provided with the
+     distribution.
+  3. The names of the authors may not be used to endorse or promote
+     products derived from this software without specific prior
+     written permission.
+ 
+  THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
+  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+
+#include "zipint.h"
+
+
+
+ZIP_EXTERN(zip_compression_implementation)
+zip_get_compression_implementation(zip_uint16_t cm)
+{
+    if (cm == ZIP_CM_DEFLATE)
+	return zip_source_deflate;
+    return NULL;
+}
diff --git a/ext/zip/lib/zip_get_encryption_implementation.c b/ext/zip/lib/zip_get_encryption_implementation.c
new file mode 100644
index 0000000..783d538
--- /dev/null
+++ b/ext/zip/lib/zip_get_encryption_implementation.c
@@ -0,0 +1,46 @@
+/*
+  zip_get_encryption_implementation.c -- get encryption implementation
+  Copyright (C) 2009 Dieter Baron and Thomas Klausner
+
+  This file is part of libzip, a library to manipulate ZIP archives.
+  The authors can be contacted at <libzip at nih.at>
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in
+     the documentation and/or other materials provided with the
+     distribution.
+  3. The names of the authors may not be used to endorse or promote
+     products derived from this software without specific prior
+     written permission.
+ 
+  THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
+  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+
+#include "zipint.h"
+
+
+
+ZIP_EXTERN(zip_encryption_implementation)
+zip_get_encryption_implementation(zip_uint16_t em)
+{
+    if (em == ZIP_EM_TRAD_PKWARE)
+	return zip_source_pkware;
+    return NULL;
+}
diff --git a/ext/zip/lib/zip_get_file_comment.c b/ext/zip/lib/zip_get_file_comment.c
index 57dd902..43c1520 100644
--- a/ext/zip/lib/zip_get_file_comment.c
+++ b/ext/zip/lib/zip_get_file_comment.c
@@ -38,9 +38,9 @@
 
 
 ZIP_EXTERN(const char *)
-zip_get_file_comment(struct zip *za, int idx, int *lenp, int flags)
+zip_get_file_comment(struct zip *za, zip_uint64_t idx, int *lenp, int flags)
 {
-    if (idx < 0 || idx >= za->nentry) {
+    if (idx >= za->nentry) {
 	_zip_error_set(&za->error, ZIP_ER_INVAL, 0);
 	return NULL;
     }
diff --git a/ext/zip/lib/zip_get_file_extra.c b/ext/zip/lib/zip_get_file_extra.c
new file mode 100644
index 0000000..a27edd8
--- /dev/null
+++ b/ext/zip/lib/zip_get_file_extra.c
@@ -0,0 +1,58 @@
+/*
+  zip_get_file_extra.c -- get file extra field
+  Copyright (C) 2006-2010 Dieter Baron and Thomas Klausner
+
+  This file is part of libzip, a library to manipulate ZIP archives.
+  The authors can be contacted at <libzip at nih.at>
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in
+     the documentation and/or other materials provided with the
+     distribution.
+  3. The names of the authors may not be used to endorse or promote
+     products derived from this software without specific prior
+     written permission.
+
+  THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
+  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+
+#include "zipint.h"
+
+
+
+ZIP_EXTERN(const char *)
+zip_get_file_extra(struct zip *za, zip_uint64_t idx, int *lenp, int flags)
+{
+    if (idx >= za->nentry) {
+	_zip_error_set(&za->error, ZIP_ER_INVAL, 0);
+	return NULL;
+    }
+
+    if ((flags & ZIP_FL_UNCHANGED)
+	|| (za->entry[idx].ch_extra_len == -1)) {
+	if (lenp != NULL)
+	    *lenp = za->cdir->entry[idx].extrafield_len;
+	return za->cdir->entry[idx].extrafield;
+    }
+
+    if (lenp != NULL)
+	*lenp = za->entry[idx].ch_extra_len;
+    return za->entry[idx].ch_extra;
+}
diff --git a/ext/zip/lib/zip_get_name.c b/ext/zip/lib/zip_get_name.c
index b58d972..945e24e 100644
--- a/ext/zip/lib/zip_get_name.c
+++ b/ext/zip/lib/zip_get_name.c
@@ -38,7 +38,7 @@
 
 
 ZIP_EXTERN(const char *)
-zip_get_name(struct zip *za, int idx, int flags)
+zip_get_name(struct zip *za, zip_uint64_t idx, int flags)
 {
     return _zip_get_name(za, idx, flags, &za->error);
 }
@@ -46,9 +46,10 @@ zip_get_name(struct zip *za, int idx, int flags)
 
 
 const char *
-_zip_get_name(struct zip *za, int idx, int flags, struct zip_error *error)
+_zip_get_name(struct zip *za, zip_uint64_t idx, int flags,
+	      struct zip_error *error)
 {
-    if (idx < 0 || idx >= za->nentry) {
+    if (idx >= za->nentry) {
 	_zip_error_set(error, ZIP_ER_INVAL, 0);
 	return NULL;
     }
diff --git a/ext/zip/lib/zip_get_num_entries.c b/ext/zip/lib/zip_get_num_entries.c
new file mode 100644
index 0000000..dd392e9
--- /dev/null
+++ b/ext/zip/lib/zip_get_num_entries.c
@@ -0,0 +1,52 @@
+/*
+  zip_get_num_entries.c -- get number of entries in archive
+  Copyright (C) 1999-2011 Dieter Baron and Thomas Klausner
+
+  This file is part of libzip, a library to manipulate ZIP archives.
+  The authors can be contacted at <libzip at nih.at>
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in
+     the documentation and/or other materials provided with the
+     distribution.
+  3. The names of the authors may not be used to endorse or promote
+     products derived from this software without specific prior
+     written permission.
+ 
+  THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
+  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+
+#include "zipint.h"
+
+
+
+ZIP_EXTERN(zip_uint64_t)
+zip_get_num_entries(struct zip *za, int flags)
+{
+    if (za == NULL)
+	return -1;
+
+    if (flags & ZIP_FL_UNCHANGED) {
+      if (za->cdir == NULL)
+	return 0;
+      return za->cdir->nentry;
+    }
+    return za->nentry;
+}
diff --git a/ext/zip/lib/zip_name_locate.c b/ext/zip/lib/zip_name_locate.c
index 96c4f93..08d5b1f 100644
--- a/ext/zip/lib/zip_name_locate.c
+++ b/ext/zip/lib/zip_name_locate.c
@@ -1,6 +1,6 @@
 /*
   zip_name_locate.c -- get index by name
-  Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2011 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip at nih.at>
@@ -17,7 +17,7 @@
   3. The names of the authors may not be used to endorse or promote
      products derived from this software without specific prior
      written permission.
-
+ 
   THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
   OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -55,16 +55,20 @@ _zip_name_locate(struct zip *za, const char *fname, int flags,
     const char *fn, *p;
     int i, n;
 
+    if (za == NULL)
+	return -1;
+
     if (fname == NULL) {
 	_zip_error_set(error, ZIP_ER_INVAL, 0);
 	return -1;
     }
 
-    if((flags & ZIP_FL_UNCHANGED)  && !za->cdir) {
-    	return -1;
+    if ((flags & ZIP_FL_UNCHANGED)  && za->cdir == NULL) {
+        _zip_error_set(error, ZIP_ER_NOENT, 0);
+        return -1;
     }
 
-    cmp = (flags & ZIP_FL_NOCASE) ? strcmpi : strcmp;
+    cmp = (flags & ZIP_FL_NOCASE) ? strcasecmp : strcmp;
 
     n = (flags & ZIP_FL_UNCHANGED) ? za->cdir->nentry : za->nentry;
     for (i=0; i<n; i++) {
diff --git a/ext/zip/lib/zip_new.c b/ext/zip/lib/zip_new.c
index 3e8ccee..7ce1237 100644
--- a/ext/zip/lib/zip_new.c
+++ b/ext/zip/lib/zip_new.c
@@ -65,6 +65,7 @@ _zip_new(struct zip_error *error)
     za->nfile = za->nfile_alloc = 0;
     za->file = NULL;
     za->flags = za->ch_flags = 0;
+    za->default_password = NULL;
     
     return za;
 }
diff --git a/ext/zip/lib/zip_open.c b/ext/zip/lib/zip_open.c
index 31e12f4..11c6fe0 100644
--- a/ext/zip/lib/zip_open.c
+++ b/ext/zip/lib/zip_open.c
@@ -1,6 +1,6 @@
 /*
-  zip_open.c -- open zip archive
-  Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner
+  zip_open.c -- open zip archive by name
+  Copyright (C) 1999-2011 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip at nih.at>
@@ -52,7 +52,7 @@ static int _zip_headercomp(struct zip_dirent *, int,
 			   struct zip_dirent *, int);
 static unsigned char *_zip_memmem(const unsigned char *, int,
 				  const unsigned char *, int);
-static struct zip_cdir *_zip_readcdir(FILE *, unsigned char *, unsigned char *,
+static struct zip_cdir *_zip_readcdir(FILE *, off_t, unsigned char *, unsigned char *,
 				 int, int, struct zip_error *);
 
 
@@ -61,24 +61,12 @@ ZIP_EXTERN(struct zip *)
 zip_open(const char *fn, int flags, int *zep)
 {
     FILE *fp;
-    struct zip *za;
-    struct zip_cdir *cdir;
-    int i;
-    off_t len;
-
-    if (flags & ZIP_OVERWRITE) {
-	return _zip_allocate_new(fn, zep);
-    }
-
+    
     switch (_zip_file_exists(fn, flags, zep)) {
     case -1:
-			if (!(flags & ZIP_OVERWRITE)) {
-				return NULL;
-			}
-
+	return NULL;
     case 0:
 	return _zip_allocate_new(fn, zep);
-
     default:
 	break;
     }
@@ -88,7 +76,23 @@ zip_open(const char *fn, int flags, int *zep)
 	return NULL;
     }
 
-    fseeko(fp, 0, SEEK_END);
+    return _zip_open(fn, fp, flags, 0, zep);
+}
+
+
+
+struct zip *
+_zip_open(const char *fn, FILE *fp, int flags, int aflags, int *zep)
+{
+    struct zip *za;
+    struct zip_cdir *cdir;
+    int i;
+    off_t len;
+
+    if (fseeko(fp, 0, SEEK_END) < 0) {
+	*zep = ZIP_ER_SEEK;
+	return NULL;
+    }
     len = ftello(fp);
 
     /* treat empty files as empty archives */
@@ -156,13 +160,13 @@ set_error(int *zep, struct zip_error *err, int ze)
    entries, or NULL if unsuccessful. */
 
 static struct zip_cdir *
-_zip_readcdir(FILE *fp, unsigned char *buf, unsigned char *eocd, int buflen,
+_zip_readcdir(FILE *fp, off_t buf_offset, unsigned char *buf, unsigned char *eocd, int buflen,
 	      int flags, struct zip_error *error)
 {
     struct zip_cdir *cd;
     unsigned char *cdp, **bufp;
     int i, comlen, nentry;
-    unsigned int left;
+    zip_uint32_t left;
 
     comlen = buf + buflen - eocd - EOCDLEN;
     if (comlen < 0) {
@@ -196,14 +200,24 @@ _zip_readcdir(FILE *fp, unsigned char *buf, unsigned char *eocd, int buflen,
     cd->comment = NULL;
     cd->comment_len = _zip_read2(&cdp);
 
+    if (((zip_uint64_t)cd->offset)+cd->size > buf_offset + (eocd-buf)) {
+	/* cdir spans past EOCD record */
+	_zip_error_set(error, ZIP_ER_INCONS, 0);
+	cd->nentry = 0;
+	_zip_cdir_free(cd);
+	return NULL;
+    }
+
     if ((comlen < cd->comment_len) || (cd->nentry != i)) {
 	_zip_error_set(error, ZIP_ER_NOZIP, 0);
-	free(cd);
+	cd->nentry = 0;
+	_zip_cdir_free(cd);
 	return NULL;
     }
     if ((flags & ZIP_CHECKCONS) && comlen != cd->comment_len) {
 	_zip_error_set(error, ZIP_ER_INCONS, 0);
-	free(cd);
+	cd->nentry = 0;
+	_zip_cdir_free(cd);
 	return NULL;
     }
 
@@ -211,14 +225,15 @@ _zip_readcdir(FILE *fp, unsigned char *buf, unsigned char *eocd, int buflen,
 	if ((cd->comment=(char *)_zip_memdup(eocd+EOCDLEN,
 					     cd->comment_len, error))
 	    == NULL) {
-	    free(cd);
+	    cd->nentry = 0;
+	    _zip_cdir_free(cd);
 	    return NULL;
 	}
     }
 
-    if (cd->size < (unsigned int)(eocd-buf)) {
+    if (cd->offset >= buf_offset) {
 	/* if buffer already read in, use it */
-	cdp = eocd - cd->size;
+	cdp = buf + (cd->offset - buf_offset);
 	bufp = &cdp;
     }
     else {
@@ -234,20 +249,15 @@ _zip_readcdir(FILE *fp, unsigned char *buf, unsigned char *eocd, int buflen,
 		_zip_error_set(error, ZIP_ER_SEEK, errno);
 	    else
 		_zip_error_set(error, ZIP_ER_NOZIP, 0);
-	    free(cd);
+	    cd->nentry = 0;
+	    _zip_cdir_free(cd);
 	    return NULL;
 	}
     }
 
     left = cd->size;
     i=0;
-    do {
-	if (i == cd->nentry && left > 0) {
-	    /* Infozip extension for more than 64k entries:
-	       nentries wraps around, size indicates correct EOCD */
-	    _zip_cdir_grow(cd, cd->nentry+0x10000, error);
-	}
-
+    while (i<cd->nentry && left > 0) {
 	if ((_zip_dirent_read(cd->entry+i, fp, bufp, &left, 0, error)) < 0) {
 	    cd->nentry = i;
 	    _zip_cdir_free(cd);
@@ -255,7 +265,18 @@ _zip_readcdir(FILE *fp, unsigned char *buf, unsigned char *eocd, int buflen,
 	}
 	i++;
 	
-    } while (i<cd->nentry);
+	if (i == cd->nentry && left > 0) {
+	    /* Infozip extension for more than 64k entries:
+	       nentries wraps around, size indicates correct EOCD */
+	    if (_zip_cdir_grow(cd, cd->nentry+ZIP_UINT16_MAX, error) < 0) {
+		cd->nentry = i;
+		_zip_cdir_free(cd);
+		return NULL;
+	    }
+	}
+    }
+
+    cd->nentry = i;
     
     return cd;
 }
@@ -434,12 +455,16 @@ _zip_allocate_new(const char *fn, int *zep)
 	set_error(zep, &error, 0);
 	return NULL;
     }
-	
-    za->zn = strdup(fn);
-    if (!za->zn) {
-	_zip_free(za);
-	set_error(zep, NULL, ZIP_ER_MEMORY);
-	return NULL;
+
+    if (fn == NULL)
+	za->zn = NULL;
+    else {
+	za->zn = strdup(fn);
+	if (!za->zn) {
+	    _zip_free(za);
+	    set_error(zep, NULL, ZIP_ER_MEMORY);
+	    return NULL;
+	}
     }
     return za;
 }
@@ -481,6 +506,7 @@ _zip_find_central_dir(FILE *fp, int flags, int *zep, off_t len)
 {
     struct zip_cdir *cdir, *cdirnew;
     unsigned char *buf, *match;
+    off_t buf_offset;
     int a, best, buflen, i;
     struct zip_error zerr;
 
@@ -490,7 +516,8 @@ _zip_find_central_dir(FILE *fp, int flags, int *zep, off_t len)
 	set_error(zep, NULL, ZIP_ER_SEEK);
 	return NULL;
     }
-
+    buf_offset = ftello(fp);
+    
     /* 64k is too much for stack */
     if ((buf=(unsigned char *)malloc(CDBUFSIZE)) == NULL) {
 	set_error(zep, NULL, ZIP_ER_MEMORY);
@@ -516,7 +543,7 @@ _zip_find_central_dir(FILE *fp, int flags, int *zep, off_t len)
 	/* found match -- check, if good */
 	/* to avoid finding the same match all over again */
 	match++;
-	if ((cdirnew=_zip_readcdir(fp, buf, match-1, buflen, flags,
+	if ((cdirnew=_zip_readcdir(fp, buf_offset, buf, match-1, buflen, flags,
 				   &zerr)) == NULL)
 	    continue;
 
diff --git a/ext/zip/lib/zip_rename.c b/ext/zip/lib/zip_rename.c
index e40ab27..6b5a035 100644
--- a/ext/zip/lib/zip_rename.c
+++ b/ext/zip/lib/zip_rename.c
@@ -40,16 +40,21 @@
 
 
 ZIP_EXTERN(int)
-zip_rename(struct zip *za, int idx, const char *name)
+zip_rename(struct zip *za, zip_uint64_t idx, const char *name)
 {
     const char *old_name;
     int old_is_dir, new_is_dir;
     
-    if (idx >= za->nentry || idx < 0 || name[0] == '\0') {
+    if (idx >= za->nentry || name[0] == '\0') {
 	_zip_error_set(&za->error, ZIP_ER_INVAL, 0);
 	return -1;
     }
 
+    if (ZIP_IS_RDONLY(za)) {
+	_zip_error_set(&za->error, ZIP_ER_RDONLY, 0);
+	return -1;
+    }
+
     if ((old_name=zip_get_name(za, idx, 0)) == NULL)
 	return -1;
 								    
diff --git a/ext/zip/lib/zip_replace.c b/ext/zip/lib/zip_replace.c
index ae69a86..6dc3dd5 100644
--- a/ext/zip/lib/zip_replace.c
+++ b/ext/zip/lib/zip_replace.c
@@ -1,6 +1,6 @@
 /*
   zip_replace.c -- replace file via callback function
-  Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip at nih.at>
@@ -38,9 +38,9 @@
 
 
 ZIP_EXTERN(int)
-zip_replace(struct zip *za, int idx, struct zip_source *source)
+zip_replace(struct zip *za, zip_uint64_t idx, struct zip_source *source)
 {
-    if (idx < 0 || idx >= za->nentry || source == NULL) {
+    if (idx >= za->nentry || source == NULL) {
 	_zip_error_set(&za->error, ZIP_ER_INVAL, 0);
 	return -1;
     }
@@ -54,11 +54,18 @@ zip_replace(struct zip *za, int idx, struct zip_source *source)
 
 
 
-int
-_zip_replace(struct zip *za, int idx, const char *name,
+/* NOTE: Signed due to -1 on error.  See zip_add.c for more details. */
+
+zip_int64_t
+_zip_replace(struct zip *za, zip_uint64_t idx, const char *name,
 	     struct zip_source *source)
 {
-    if (idx == -1) {
+    if (ZIP_IS_RDONLY(za)) {
+	_zip_error_set(&za->error, ZIP_ER_RDONLY, 0);
+	return -1;
+    }
+
+    if (idx == ZIP_UINT64_MAX) {
 	if (_zip_entry_new(za) == NULL)
 	    return -1;
 
diff --git a/ext/zip/lib/zip_set_archive_comment.c b/ext/zip/lib/zip_set_archive_comment.c
index c4bd070..3cd069c 100644
--- a/ext/zip/lib/zip_set_archive_comment.c
+++ b/ext/zip/lib/zip_set_archive_comment.c
@@ -1,6 +1,6 @@
 /*
   zip_set_archive_comment.c -- set archive comment
-  Copyright (C) 2006-2007 Dieter Baron and Thomas Klausner
+  Copyright (C) 2006-2009 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip at nih.at>
@@ -50,6 +50,11 @@ zip_set_archive_comment(struct zip *za, const char *comment, int len)
 	return -1;
     }
 
+    if (ZIP_IS_RDONLY(za)) {
+	_zip_error_set(&za->error, ZIP_ER_RDONLY, 0);
+	return -1;
+    }
+
     if (len > 0) {
 	if ((tmpcom=(char *)_zip_memdup(comment, len, &za->error)) == NULL)
 	    return -1;
diff --git a/ext/zip/lib/zip_set_archive_flag.c b/ext/zip/lib/zip_set_archive_flag.c
index 20316e4..07bcfbe 100644
--- a/ext/zip/lib/zip_set_archive_flag.c
+++ b/ext/zip/lib/zip_set_archive_flag.c
@@ -40,10 +40,30 @@
 ZIP_EXTERN(int)
 zip_set_archive_flag(struct zip *za, int flag, int value)
 {
+    unsigned int new_flags;
+    
     if (value)
-	za->ch_flags |= flag;
+	new_flags = za->ch_flags | flag;
     else
-	za->ch_flags &= ~flag;
+	new_flags = za->ch_flags & ~flag;
+
+    if (new_flags == za->ch_flags)
+	return 0;
+
+    if (ZIP_IS_RDONLY(za)) {
+	_zip_error_set(&za->error, ZIP_ER_RDONLY, 0);
+	return -1;
+    }
+
+    if ((flag & ZIP_AFL_RDONLY) && value
+	&& (za->ch_flags & ZIP_AFL_RDONLY) == 0) {
+	if (_zip_changed(za, NULL)) {
+	    _zip_error_set(&za->error, ZIP_ER_CHANGED, 0);
+	    return -1;
+	}
+    }
+
+    za->ch_flags = new_flags;
 
     return 0;
 }
diff --git a/ext/zip/lib/zip_set_default_password.c b/ext/zip/lib/zip_set_default_password.c
new file mode 100644
index 0000000..c274d11
--- /dev/null
+++ b/ext/zip/lib/zip_set_default_password.c
@@ -0,0 +1,62 @@
+/*
+  zip_set_default_password.c -- set default password for decryption
+  Copyright (C) 2009 Dieter Baron and Thomas Klausner
+
+  This file is part of libzip, a library to manipulate ZIP archives.
+  The authors can be contacted at <libzip at nih.at>
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in
+     the documentation and/or other materials provided with the
+     distribution.
+  3. The names of the authors may not be used to endorse or promote
+     products derived from this software without specific prior
+     written permission.
+ 
+  THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
+  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "zipint.h"
+
+
+
+ZIP_EXTERN(int)
+zip_set_default_password(struct zip *za, const char *passwd)
+{
+    if (za == NULL)
+	return -1;
+
+    if (za->default_password)
+	free(za->default_password);
+    
+    if (passwd) {
+	if ((za->default_password=strdup(passwd)) == NULL) {
+	    _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
+	    return -1;
+	}
+    }
+    else
+	za->default_password = NULL;
+
+    return 0;
+}
diff --git a/ext/zip/lib/zip_set_file_comment.c b/ext/zip/lib/zip_set_file_comment.c
index 3d5dd6b..5e63dc2 100644
--- a/ext/zip/lib/zip_set_file_comment.c
+++ b/ext/zip/lib/zip_set_file_comment.c
@@ -1,6 +1,6 @@
 /*
   zip_set_file_comment.c -- set comment for file in archive
-  Copyright (C) 2006-2007 Dieter Baron and Thomas Klausner
+  Copyright (C) 2006-2009 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip at nih.at>
@@ -40,17 +40,23 @@
 
 
 ZIP_EXTERN(int)
-zip_set_file_comment(struct zip *za, int idx, const char *comment, int len)
+zip_set_file_comment(struct zip *za, zip_uint64_t idx,
+		     const char *comment, int len)
 {
     char *tmpcom;
 
-    if (idx < 0 || idx >= za->nentry
+    if (idx >= za->nentry
 	|| len < 0 || len > MAXCOMLEN
 	|| (len > 0 && comment == NULL)) {
 	_zip_error_set(&za->error, ZIP_ER_INVAL, 0);
 	return -1;
     }
 
+    if (ZIP_IS_RDONLY(za)) {
+	_zip_error_set(&za->error, ZIP_ER_RDONLY, 0);
+	return -1;
+    }
+
     if (len > 0) {
 	if ((tmpcom=(char *)_zip_memdup(comment, len, &za->error)) == NULL)
 	    return -1;
diff --git a/ext/zip/lib/zip_set_file_extra.c b/ext/zip/lib/zip_set_file_extra.c
new file mode 100644
index 0000000..db829e2
--- /dev/null
+++ b/ext/zip/lib/zip_set_file_extra.c
@@ -0,0 +1,72 @@
+/*
+  zip_set_file_extra.c -- set extra field for file in archive
+  Copyright (C) 2006-2010 Dieter Baron and Thomas Klausner
+
+  This file is part of libzip, a library to manipulate ZIP archives.
+  The authors can be contacted at <libzip at nih.at>
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in
+     the documentation and/or other materials provided with the
+     distribution.
+  3. The names of the authors may not be used to endorse or promote
+     products derived from this software without specific prior
+     written permission.
+
+  THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
+  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+
+#include <stdlib.h>
+
+#include "zipint.h"
+
+
+
+ZIP_EXTERN(int)
+zip_set_file_extra(struct zip *za, zip_uint64_t idx,
+		   const char *extra, int len)
+{
+    char *tmpext;
+
+    if (idx >= za->nentry
+	|| len < 0 || len > MAXEXTLEN
+	|| (len > 0 && extra == NULL)) {
+	_zip_error_set(&za->error, ZIP_ER_INVAL, 0);
+	return -1;
+    }
+
+    if (ZIP_IS_RDONLY(za)) {
+	_zip_error_set(&za->error, ZIP_ER_RDONLY, 0);
+	return -1;
+    }
+
+    if (len > 0) {
+	if ((tmpext=(char *)_zip_memdup(extra, len, &za->error)) == NULL)
+	    return -1;
+    }
+    else
+	tmpext = NULL;
+
+    free(za->entry[idx].ch_extra);
+    za->entry[idx].ch_extra = tmpext;
+    za->entry[idx].ch_extra_len = len;
+
+    return 0;
+}
diff --git a/ext/zip/lib/zip_set_name.c b/ext/zip/lib/zip_set_name.c
index 5c7da3d..2a90601 100644
--- a/ext/zip/lib/zip_set_name.c
+++ b/ext/zip/lib/zip_set_name.c
@@ -41,12 +41,12 @@
 
 
 int
-_zip_set_name(struct zip *za, int idx, const char *name)
+_zip_set_name(struct zip *za, zip_uint64_t idx, const char *name)
 {
     char *s;
-    int i;
+    zip_int64_t i;
     
-    if (idx < 0 || idx >= za->nentry || name == NULL) {
+    if (idx >= za->nentry || name == NULL) {
 	_zip_error_set(&za->error, ZIP_ER_INVAL, 0);
 	return -1;
     }
diff --git a/ext/zip/lib/zip_source_buffer.c b/ext/zip/lib/zip_source_buffer.c
index 867d3df..8c9154c 100644
--- a/ext/zip/lib/zip_source_buffer.c
+++ b/ext/zip/lib/zip_source_buffer.c
@@ -1,6 +1,6 @@
 /*
   zip_source_buffer.c -- create zip data source from buffer
-  Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip at nih.at>
@@ -44,13 +44,12 @@ struct read_data {
     int freep;
 };
 
-static ssize_t read_data(void *state, void *data, size_t len,
-			 enum zip_source_cmd cmd);
+static zip_int64_t read_data(void *, void *, zip_uint64_t, enum zip_source_cmd);
 
 
 
 ZIP_EXTERN(struct zip_source *)
-zip_source_buffer(struct zip *za, const void *data, off_t len, int freep)
+zip_source_buffer(struct zip *za, const void *data, zip_uint64_t len, int freep)
 {
     struct read_data *f;
     struct zip_source *zs;
@@ -58,7 +57,7 @@ zip_source_buffer(struct zip *za, const void *data, off_t len, int freep)
     if (za == NULL)
 	return NULL;
 
-    if (len < 0 || (data == NULL && len > 0)) {
+    if (data == NULL && len > 0) {
 	_zip_error_set(&za->error, ZIP_ER_INVAL, 0);
 	return NULL;
     }
@@ -83,12 +82,12 @@ zip_source_buffer(struct zip *za, const void *data, off_t len, int freep)
 
 
 
-static ssize_t
-read_data(void *state, void *data, size_t len, enum zip_source_cmd cmd)
+static zip_int64_t
+read_data(void *state, void *data, zip_uint64_t len, enum zip_source_cmd cmd)
 {
     struct read_data *z;
     char *buf;
-    size_t n;
+    zip_uint64_t n;
 
     z = (struct read_data *)state;
     buf = (char *)data;
@@ -99,6 +98,8 @@ read_data(void *state, void *data, size_t len, enum zip_source_cmd cmd)
 	return 0;
 	
     case ZIP_SOURCE_READ:
+	/* XXX: return error if (len > ZIP_INT64_MAX) */
+
 	n = z->end - z->buf;
 	if (n > len)
 	    n = len;
@@ -125,6 +126,11 @@ read_data(void *state, void *data, size_t len, enum zip_source_cmd cmd)
 	    zip_stat_init(st);
 	    st->mtime = z->mtime;
 	    st->size = z->end - z->data;
+	    st->comp_size = st->size;
+	    st->comp_method = ZIP_CM_STORE;
+	    st->encryption_method = ZIP_EM_NONE;
+	    st->valid = ZIP_STAT_MTIME|ZIP_STAT_SIZE|ZIP_STAT_COMP_SIZE
+		|ZIP_STAT_COMP_METHOD|ZIP_STAT_ENCRYPTION_METHOD;
 	    
 	    return sizeof(*st);
 	}
diff --git a/ext/zip/lib/zip_source_close.c b/ext/zip/lib/zip_source_close.c
new file mode 100644
index 0000000..a3bf7e5
--- /dev/null
+++ b/ext/zip/lib/zip_source_close.c
@@ -0,0 +1,54 @@
+/*
+  zip_source_close.c -- close zip_source (stop reading)
+  Copyright (C) 2009 Dieter Baron and Thomas Klausner
+
+  This file is part of libzip, a library to manipulate ZIP archives.
+  The authors can be contacted at <libzip at nih.at>
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in
+     the documentation and/or other materials provided with the
+     distribution.
+  3. The names of the authors may not be used to endorse or promote
+     products derived from this software without specific prior
+     written permission.
+ 
+  THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
+  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+
+#include "zipint.h"
+
+
+
+ZIP_EXTERN(void)
+zip_source_close(struct zip_source *src)
+{
+    if (!src->is_open)
+	return;
+
+    if (src->src == NULL)
+	(void)src->cb.f(src->ud, NULL, 0, ZIP_SOURCE_CLOSE);
+    else {
+	(void)src->cb.l(src->src, src->ud, NULL, 0, ZIP_SOURCE_CLOSE);
+	zip_source_close(src->src);
+    }
+    
+    src->is_open = 0;
+}
diff --git a/ext/zip/lib/zip_source_crc.c b/ext/zip/lib/zip_source_crc.c
new file mode 100644
index 0000000..7fd78f5
--- /dev/null
+++ b/ext/zip/lib/zip_source_crc.c
@@ -0,0 +1,159 @@
+/*
+  zip_source_crc.c -- pass-through source that calculates CRC32 and size
+  Copyright (C) 2009 Dieter Baron and Thomas Klausner
+
+  This file is part of libzip, a library to manipulate ZIP archives.
+  The authors can be contacted at <libzip at nih.at>
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in
+     the documentation and/or other materials provided with the
+     distribution.
+  3. The names of the authors may not be used to endorse or promote
+     products derived from this software without specific prior
+     written permission.
+ 
+  THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
+  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "zipint.h"
+
+struct crc {
+    int eof;
+    int validate;
+    int e[2];
+    zip_uint64_t size;
+    zip_uint32_t crc;
+};
+
+static zip_int64_t crc_read(struct zip_source *, void *, void *
+			    , zip_uint64_t, enum zip_source_cmd);
+
+
+
+ZIP_EXTERN(struct zip_source *)
+zip_source_crc(struct zip *za, struct zip_source *src, int validate)
+{
+    struct crc *ctx;
+
+    if (src == NULL) {
+	_zip_error_set(&za->error, ZIP_ER_INVAL, 0);
+	return NULL;
+    }
+
+    if ((ctx=(struct crc *)malloc(sizeof(*ctx))) == NULL) {
+	_zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
+	return NULL;
+    }
+
+    ctx->validate = validate;
+
+    return zip_source_layered(za, src, crc_read, ctx);
+}
+
+
+
+static zip_int64_t
+crc_read(struct zip_source *src, void *_ctx, void *data,
+	 zip_uint64_t len, enum zip_source_cmd cmd)
+{
+    struct crc *ctx;
+    zip_int64_t n;
+
+    ctx = (struct crc *)_ctx;
+
+    switch (cmd) {
+    case ZIP_SOURCE_OPEN:
+	ctx->eof = 0;
+	ctx->crc = crc32(0, NULL, 0);
+	ctx->size = 0;
+
+	return 0;
+
+    case ZIP_SOURCE_READ:
+	if (ctx->eof || len == 0)
+	    return 0;
+
+	if ((n=zip_source_read(src, data, len)) < 0)
+	    return ZIP_SOURCE_ERR_LOWER;
+
+	if (n == 0) {
+	    ctx->eof = 1;
+	    if (ctx->validate) {
+		struct zip_stat st;
+
+		if (zip_source_stat(src, &st) < 0)
+		    return ZIP_SOURCE_ERR_LOWER;
+
+		if ((st.valid & ZIP_STAT_CRC) && st.crc != ctx->crc) {
+		    ctx->e[0] = ZIP_ER_CRC;
+		    ctx->e[1] = 0;
+		    
+		    return -1;
+		}
+		if ((st.valid & ZIP_STAT_SIZE) && st.size != ctx->size) {
+		    ctx->e[0] = ZIP_ER_INCONS;
+		    ctx->e[1] = 0;
+		    
+		    return -1;
+		}
+	    }
+	}
+	else {
+	    ctx->size += n;
+	    ctx->crc = crc32(ctx->crc, data, n);
+	}
+	return n;
+
+    case ZIP_SOURCE_CLOSE:
+	return 0;
+
+    case ZIP_SOURCE_STAT:
+	{
+	    struct zip_stat *st;
+
+	    st = (struct zip_stat *)data;
+
+	    if (ctx->eof) {
+		/* XXX: Set comp_size, comp_method, encryption_method?
+		        After all, this only works for uncompressed data. */
+		st->size = ctx->size;
+		st->crc = ctx->crc;
+		st->valid |= ZIP_STAT_SIZE|ZIP_STAT_CRC;
+	    }
+	}
+	return 0;
+	
+    case ZIP_SOURCE_ERROR:
+	memcpy(data, ctx->e, sizeof(ctx->e));
+	return 0;
+
+    case ZIP_SOURCE_FREE:
+	free(ctx);
+	return 0;
+
+    default:
+	return -1;
+    }
+    
+}
diff --git a/ext/zip/lib/zip_source_deflate.c b/ext/zip/lib/zip_source_deflate.c
new file mode 100644
index 0000000..5d9c5e6
--- /dev/null
+++ b/ext/zip/lib/zip_source_deflate.c
@@ -0,0 +1,394 @@
+/*
+  zip_source_deflate.c -- deflate (de)compressoin routines
+  Copyright (C) 2009 Dieter Baron and Thomas Klausner
+
+  This file is part of libzip, a library to manipulate ZIP archives.
+  The authors can be contacted at <libzip at nih.at>
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in
+     the documentation and/or other materials provided with the
+     distribution.
+  3. The names of the authors may not be used to endorse or promote
+     products derived from this software without specific prior
+     written permission.
+ 
+  THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
+  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "zipint.h"
+
+struct deflate {
+    int e[2];
+
+    int eof;
+    int mem_level;
+    zip_uint64_t size;
+    char buffer[BUFSIZE];
+    z_stream zstr;
+};
+
+static zip_int64_t compress_read(struct zip_source *, struct deflate *,
+				 void *, zip_uint64_t);
+static zip_int64_t decompress_read(struct zip_source *, struct deflate *,
+				   void *, zip_uint64_t);
+static zip_int64_t deflate_compress(struct zip_source *, void *, void *,
+				    zip_uint64_t, enum zip_source_cmd);
+static zip_int64_t deflate_decompress(struct zip_source *, void *, void *,
+				      zip_uint64_t, enum zip_source_cmd);
+static void deflate_free(struct deflate *);
+
+
+
+ZIP_EXTERN(struct zip_source *)
+zip_source_deflate(struct zip *za, struct zip_source *src,
+		   zip_uint16_t cm, int flags)
+{
+    struct deflate *ctx;
+    struct zip_source *s2;
+
+    if (src == NULL || cm != ZIP_CM_DEFLATE) {
+	_zip_error_set(&za->error, ZIP_ER_INVAL, 0);
+	return NULL;
+    }
+
+    if ((ctx=(struct deflate *)malloc(sizeof(*ctx))) == NULL) {
+	_zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
+	return NULL;
+    }
+
+    ctx->e[0] = ctx->e[1] = 0;
+    ctx->eof = 0;
+    if (flags & ZIP_CODEC_ENCODE) {
+	if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0))
+	    ctx->mem_level = TORRENT_MEM_LEVEL;
+	else
+	    ctx->mem_level = MAX_MEM_LEVEL;
+    }
+
+    if ((s2=zip_source_layered(za, src,
+			       ((flags & ZIP_CODEC_ENCODE)
+				? deflate_compress : deflate_decompress),
+			       ctx)) == NULL) {
+	deflate_free(ctx);
+	return NULL;
+    }
+
+    return s2;
+}
+
+
+
+static zip_int64_t
+compress_read(struct zip_source *src, struct deflate *ctx,
+	      void *data, zip_uint64_t len)
+{
+    int end, ret;
+    zip_int64_t n;
+
+    if (ctx->e[0] != 0)
+	return -1;
+    
+    if (len == 0)
+	return 0;
+	
+    ctx->zstr.next_out = (Bytef *)data;
+    ctx->zstr.avail_out = len;
+
+    end = 0;
+    while (!end) {
+	ret = deflate(&ctx->zstr, ctx->eof ? Z_FINISH : 0);
+
+	switch (ret) {
+	case Z_OK:
+	case Z_STREAM_END:
+	    /* all ok */
+
+	    if (ctx->zstr.avail_out == 0
+		|| (ctx->eof && ctx->zstr.avail_in == 0))
+		end = 1;
+	    break;
+
+	case Z_BUF_ERROR:
+	    if (ctx->zstr.avail_in == 0) {
+		if (ctx->eof) {
+		    end = 1;
+		    break;
+		}
+
+		if ((n=zip_source_read(src, ctx->buffer,
+				       sizeof(ctx->buffer))) < 0) {
+		    zip_source_error(src, ctx->e, ctx->e+1);
+		    end = 1;
+		    break;
+		}
+		else if (n == 0) {
+		    ctx->eof = 1;
+		    ctx->size = ctx->zstr.total_in;
+		    /* XXX: check against stat of src? */
+		}
+		else {
+		    ctx->zstr.next_in = (Bytef *)ctx->buffer;
+		    ctx->zstr.avail_in = n;
+		}
+		continue;
+	    }
+	    /* fallthrough */
+	case Z_NEED_DICT:
+	case Z_DATA_ERROR:
+	case Z_STREAM_ERROR:
+	case Z_MEM_ERROR:
+	    ctx->e[0] = ZIP_ER_ZLIB;
+	    ctx->e[1] = ret;
+
+	    end = 1;
+	    break;
+	}
+    }
+
+    if (ctx->zstr.avail_out < len)
+	return len - ctx->zstr.avail_out;
+
+    return (ctx->e[0] == 0) ? 0 : -1;
+}
+
+
+
+static zip_int64_t
+decompress_read(struct zip_source *src, struct deflate *ctx,
+		void *data, zip_uint64_t len)
+{
+    int end, ret;
+    zip_int64_t n;
+
+    if (ctx->e[0] != 0)
+	return -1;
+    
+    if (len == 0)
+	return 0;
+	
+    ctx->zstr.next_out = (Bytef *)data;
+    ctx->zstr.avail_out = len;
+
+    end = 0;
+    while (!end && ctx->zstr.avail_out) {
+	ret = inflate(&ctx->zstr, Z_SYNC_FLUSH);
+
+	switch (ret) {
+	case Z_OK:
+	    break;
+	    
+	case Z_STREAM_END:
+	    ctx->eof = 1;
+	    end = 1;
+	    break;
+
+	case Z_BUF_ERROR:
+	    if (ctx->zstr.avail_in == 0) {
+		if (ctx->eof) {
+		    end = 1;
+		    break;
+		}
+
+		if ((n=zip_source_read(src, ctx->buffer,
+			    sizeof(ctx->buffer))) < 0) {
+		    zip_source_error(src, ctx->e, ctx->e+1);
+		    end = 1;
+		    break;
+		}
+		else if (n == 0)
+		    ctx->eof = 1;
+		else {
+		    ctx->zstr.next_in = (Bytef *)ctx->buffer;
+		    ctx->zstr.avail_in = n;
+		}
+		continue;
+	    }
+	    /* fallthrough */
+	case Z_NEED_DICT:
+	case Z_DATA_ERROR:
+	case Z_STREAM_ERROR:
+	case Z_MEM_ERROR:
+	    ctx->e[0] = ZIP_ER_ZLIB;
+	    ctx->e[1] = ret;
+	    end = 1;
+	    break;
+	}
+    }
+
+    if (ctx->zstr.avail_out < len)
+	return len - ctx->zstr.avail_out;
+
+    return (ctx->e[0] == 0) ? 0 : -1;
+}
+
+
+
+static zip_int64_t
+deflate_compress(struct zip_source *src, void *ud, void *data,
+		 zip_uint64_t len, enum zip_source_cmd cmd)
+{
+    struct deflate *ctx;
+    int ret;
+
+    ctx = (struct deflate *)ud;
+
+    switch (cmd) {
+    case ZIP_SOURCE_OPEN:
+	ctx->zstr.zalloc = Z_NULL;
+	ctx->zstr.zfree = Z_NULL;
+	ctx->zstr.opaque = NULL;
+	ctx->zstr.avail_in = 0;
+	ctx->zstr.next_in = NULL;
+	ctx->zstr.avail_out = 0;
+	ctx->zstr.next_out = NULL;
+
+	/* negative value to tell zlib not to write a header */
+	if ((ret=deflateInit2(&ctx->zstr, Z_BEST_COMPRESSION, Z_DEFLATED,
+			      -MAX_WBITS, ctx->mem_level,
+			      Z_DEFAULT_STRATEGY)) != Z_OK) {
+	    ctx->e[0] = ZIP_ER_ZLIB;
+	    ctx->e[1] = ret;
+	    return -1;
+	}
+
+	return 0;
+
+    case ZIP_SOURCE_READ:
+	return compress_read(src, ctx, data, len);
+
+    case ZIP_SOURCE_CLOSE:
+	deflateEnd(&ctx->zstr);
+	return 0;
+
+    case ZIP_SOURCE_STAT:
+    	{
+	    struct zip_stat *st;
+
+	    st = (struct zip_stat *)data;
+
+	    st->comp_method = ZIP_CM_DEFLATE;
+	    st->valid |= ZIP_STAT_COMP_METHOD;
+	    if (ctx->eof) {
+		st->comp_size = ctx->size;
+		st->valid |= ZIP_STAT_COMP_SIZE;
+	    }
+	    else
+		st->valid &= ~ZIP_STAT_COMP_SIZE;
+	}
+	return 0;
+
+    case ZIP_SOURCE_ERROR:
+	memcpy(data, ctx->e, sizeof(int)*2);
+	return sizeof(int)*2;
+
+    case ZIP_SOURCE_FREE:
+	deflate_free(ctx);
+	return 0;
+
+    default:
+	ctx->e[0] = ZIP_ER_INVAL;
+	ctx->e[1] = 0;
+	return -1;
+    }
+}
+
+
+
+static zip_int64_t
+deflate_decompress(struct zip_source *src, void *ud, void *data,
+		   zip_uint64_t len, enum zip_source_cmd cmd)
+{
+    struct deflate *ctx;
+    zip_int64_t n;
+    int ret;
+
+    ctx = (struct deflate *)ud;
+
+    switch (cmd) {
+    case ZIP_SOURCE_OPEN:
+	if ((n=zip_source_read(src, ctx->buffer, sizeof(ctx->buffer))) < 0)
+	    return ZIP_SOURCE_ERR_LOWER;
+
+	ctx->zstr.zalloc = Z_NULL;
+	ctx->zstr.zfree = Z_NULL;
+	ctx->zstr.opaque = NULL;
+	ctx->zstr.next_in = (Bytef *)ctx->buffer;
+	ctx->zstr.avail_in = n;
+
+	/* negative value to tell zlib that there is no header */
+	if ((ret=inflateInit2(&ctx->zstr, -MAX_WBITS)) != Z_OK) {
+	    ctx->e[0] = ZIP_ER_ZLIB;
+	    ctx->e[1] = ret;
+
+	    return -1;
+	}
+	return 0;
+
+    case ZIP_SOURCE_READ:
+	return decompress_read(src, ctx, data, len);
+
+    case ZIP_SOURCE_CLOSE:
+	inflateEnd(&ctx->zstr);
+	return 0;
+
+    case ZIP_SOURCE_STAT:
+	{
+	    struct zip_stat *st;
+
+	    st = (struct zip_stat *)data;
+
+	    st->comp_method = ZIP_CM_STORE;
+	    if (st->comp_size > 0 && st->size > 0)
+		st->comp_size = st->size;
+	}
+	return 0;
+
+    case ZIP_SOURCE_ERROR:
+	if (len < sizeof(int)*2)
+	    return -1;
+
+	memcpy(data, ctx->e, sizeof(int)*2);
+	return sizeof(int)*2;
+
+    case ZIP_SOURCE_FREE:
+	/* XXX: inflateEnd if close was not called */
+	free(ctx);
+	return 0;
+
+    default:
+	ctx->e[0] = ZIP_ER_INVAL;
+	ctx->e[1] = 0;
+	return -1;
+    }
+    
+}
+
+
+
+static void
+deflate_free(struct deflate *ctx)
+{
+    /* XXX: deflateEnd if close was not called */
+    free(ctx);
+}
diff --git a/ext/zip/lib/zip_source_error.c b/ext/zip/lib/zip_source_error.c
new file mode 100644
index 0000000..ffb4652
--- /dev/null
+++ b/ext/zip/lib/zip_source_error.c
@@ -0,0 +1,87 @@
+/*
+  zip_source_error.c -- get last error from zip_source
+  Copyright (C) 2009 Dieter Baron and Thomas Klausner
+
+  This file is part of libzip, a library to manipulate ZIP archives.
+  The authors can be contacted at <libzip at nih.at>
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in
+     the documentation and/or other materials provided with the
+     distribution.
+  3. The names of the authors may not be used to endorse or promote
+     products derived from this software without specific prior
+     written permission.
+ 
+  THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
+  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+
+#include "zipint.h"
+
+
+
+ZIP_EXTERN(void)
+zip_source_error(struct zip_source *src, int *ze, int *se)
+{
+    int e[2];
+
+    if (src->src == NULL) {
+    }
+    else {
+	switch (src->error_source) {
+	case ZIP_LES_NONE:
+	    if (src->src == NULL) {
+		if (src->cb.f(src->ud, e, sizeof(e), ZIP_SOURCE_ERROR) < 0) {
+		    e[0] = ZIP_ER_INTERNAL;
+		    e[1] = 0;
+		}
+	    }
+	    else
+		e[0] = e[1] = 0;
+	    break;
+
+	case ZIP_LES_INVAL:
+	    e[0] = ZIP_ER_INVAL;
+	    e[1] = 0;
+	    break;
+
+	case ZIP_LES_LOWER:
+	    zip_source_error(src->src, ze, se);
+	    return;
+
+	case ZIP_LES_UPPER:
+	    if (src->cb.l(src->src, src->ud, e, sizeof(e),
+			  ZIP_SOURCE_ERROR) < 0) {
+		e[0] = ZIP_ER_INTERNAL;
+		e[1] = 0;
+	    }
+	    break;
+
+	default:
+	    e[0] = ZIP_ER_INTERNAL;
+	    e[1] = 0;
+	}
+    }
+
+    if (ze)
+	*ze = e[0];
+    if (se)
+	*se = e[1];
+}
diff --git a/ext/zip/lib/zip_source_file.c b/ext/zip/lib/zip_source_file.c
index ab6466d..681cc2f 100644
--- a/ext/zip/lib/zip_source_file.c
+++ b/ext/zip/lib/zip_source_file.c
@@ -41,15 +41,16 @@
 
 
 ZIP_EXTERN(struct zip_source *)
-zip_source_file(struct zip *za, const char *fname, off_t start, off_t len)
+zip_source_file(struct zip *za, const char *fname, zip_uint64_t start,
+		zip_int64_t len)
 {
     if (za == NULL)
 	return NULL;
 
-    if (fname == NULL || start < 0 || len < -1) {
+    if (fname == NULL || len < -1) {
 	_zip_error_set(&za->error, ZIP_ER_INVAL, 0);
 	return NULL;
     }
 
-    return _zip_source_file_or_p(za, fname, NULL, start, len);
+    return _zip_source_file_or_p(za, fname, NULL, start, len, 1, NULL);
 }
diff --git a/ext/zip/lib/zip_source_filep.c b/ext/zip/lib/zip_source_filep.c
index 2a06a9f..4d896a4 100644
--- a/ext/zip/lib/zip_source_filep.c
+++ b/ext/zip/lib/zip_source_filep.c
@@ -44,19 +44,23 @@
 struct read_file {
     char *fname;	/* name of file to copy from */
     FILE *f;		/* file to copy from */
-    off_t off;		/* start offset of */
-    off_t len;		/* lengt of data to copy */
-    off_t remain;	/* bytes remaining to be copied */
+    int closep;		/* close f */
+    struct zip_stat st;	/* stat information passed in */
+
+    zip_uint64_t off;	/* start offset of */
+    zip_int64_t len;	/* length of data to copy */
+    zip_int64_t remain;	/* bytes remaining to be copied */
     int e[2];		/* error codes */
 };
 
-static ssize_t read_file(void *state, void *data, size_t len,
+static zip_int64_t read_file(void *state, void *data, zip_uint64_t len,
 		     enum zip_source_cmd cmd);
 
 
 
 ZIP_EXTERN(struct zip_source *)
-zip_source_filep(struct zip *za, FILE *file, off_t start, off_t len)
+zip_source_filep(struct zip *za, FILE *file, zip_uint64_t start,
+		 zip_int64_t len)
 {
     if (za == NULL)
 	return NULL;
@@ -66,14 +70,15 @@ zip_source_filep(struct zip *za, FILE *file, off_t start, off_t len)
 	return NULL;
     }
 
-    return _zip_source_file_or_p(za, NULL, file, start, len);
+    return _zip_source_file_or_p(za, NULL, file, start, len, 1, NULL);
 }
 
 
 
 struct zip_source *
 _zip_source_file_or_p(struct zip *za, const char *fname, FILE *file,
-		      off_t start, off_t len)
+		      zip_uint64_t start, zip_int64_t len, int closep,
+		      const struct zip_stat *st)
 {
     struct read_file *f;
     struct zip_source *zs;
@@ -99,7 +104,12 @@ _zip_source_file_or_p(struct zip *za, const char *fname, FILE *file,
     f->f = file;
     f->off = start;
     f->len = (len ? len : -1);
-    
+    f->closep = f->fname ? 1 : closep;
+    if (st)
+	memcpy(&f->st, st, sizeof(f->st));
+    else
+	zip_stat_init(&f->st);
+
     if ((zs=zip_source_function(za, read_file, f)) == NULL) {
 	free(f);
 	return NULL;
@@ -110,8 +120,8 @@ _zip_source_file_or_p(struct zip *za, const char *fname, FILE *file,
 
 
 
-static ssize_t
-read_file(void *state, void *data, size_t len, enum zip_source_cmd cmd)
+static zip_int64_t
+read_file(void *state, void *data, zip_uint64_t len, enum zip_source_cmd cmd)
 {
     struct read_file *z;
     char *buf;
@@ -130,20 +140,33 @@ read_file(void *state, void *data, size_t len, enum zip_source_cmd cmd)
 	    }
 	}
 
-	if (fseeko(z->f, z->off, SEEK_SET) < 0) {
-	    z->e[0] = ZIP_ER_SEEK;
-	    z->e[1] = errno;
-	    return -1;
+	if (z->closep) {
+	    if (fseeko(z->f, (off_t)z->off, SEEK_SET) < 0) {
+		z->e[0] = ZIP_ER_SEEK;
+		z->e[1] = errno;
+		return -1;
+	    }
 	}
 	z->remain = z->len;
 	return 0;
 	
     case ZIP_SOURCE_READ:
+	/* XXX: return INVAL if len > size_t max */
 	if (z->remain != -1)
 	    n = len > z->remain ? z->remain : len;
 	else
 	    n = len;
-	
+
+	if (!z->closep) {
+	    /* we might share this file with others, so let's be safe */
+	    if (fseeko(z->f, (off_t)(z->off + z->len-z->remain),
+		       SEEK_SET) < 0) {
+		z->e[0] = ZIP_ER_SEEK;
+		z->e[1] = errno;
+		return -1;
+	    }
+	}
+
 	if ((i=fread(buf, 1, n, z->f)) < 0) {
 	    z->e[0] = ZIP_ER_READ;
 	    z->e[1] = errno;
@@ -164,34 +187,42 @@ read_file(void *state, void *data, size_t len, enum zip_source_cmd cmd)
 
     case ZIP_SOURCE_STAT:
         {
-	    struct zip_stat *st;
-	    struct stat fst;
-	    int err;
-	    
-	    if (len < sizeof(*st))
+	    if (len < sizeof(z->st))
 		return -1;
 
-	    if (z->f)
-		err = fstat(fileno(z->f), &fst);
-	    else
-		err = stat(z->fname, &fst);
-
-	    if (err != 0) {
-		z->e[0] = ZIP_ER_READ; /* best match */
-		z->e[1] = errno;
-		return -1;
+	    if (z->st.valid != 0)
+		memcpy(data, &z->st, sizeof(z->st));
+	    else {
+		struct zip_stat *st;
+		struct stat fst;
+		int err;
+	    
+		if (z->f)
+		    err = fstat(fileno(z->f), &fst);
+		else
+		    err = stat(z->fname, &fst);
+
+		if (err != 0) {
+		    z->e[0] = ZIP_ER_READ; /* best match */
+		    z->e[1] = errno;
+		    return -1;
+		}
+
+		st = (struct zip_stat *)data;
+		
+		zip_stat_init(st);
+		st->mtime = fst.st_mtime;
+		st->valid |= ZIP_STAT_MTIME;
+		if (z->len != -1) {
+		    st->size = z->len;
+		    st->valid |= ZIP_STAT_SIZE;
+		}
+		else if ((fst.st_mode&S_IFMT) == S_IFREG) {
+		    st->size = fst.st_size;
+		    st->valid |= ZIP_STAT_SIZE;
+		}
 	    }
-
-	    st = (struct zip_stat *)data;
-
-	    zip_stat_init(st);
-	    st->mtime = fst.st_mtime;
-	    if (z->len != -1)
-		st->size = z->len;
-	    else if ((fst.st_mode&S_IFMT) == S_IFREG)
-		st->size = fst.st_size;
-
-	    return sizeof(*st);
+	    return sizeof(z->st);
 	}
 
     case ZIP_SOURCE_ERROR:
@@ -203,8 +234,8 @@ read_file(void *state, void *data, size_t len, enum zip_source_cmd cmd)
 
     case ZIP_SOURCE_FREE:
 	free(z->fname);
-	if (z->f)
-	fclose(z->f);
+	if (z->closep && z->f)
+	    fclose(z->f);
 	free(z);
 	return 0;
 
diff --git a/ext/zip/lib/zip_source_free.c b/ext/zip/lib/zip_source_free.c
index 293e7f7..f71c71e 100644
--- a/ext/zip/lib/zip_source_free.c
+++ b/ext/zip/lib/zip_source_free.c
@@ -1,6 +1,6 @@
 /*
   zip_source_free.c -- free zip data source
-  Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip at nih.at>
@@ -40,12 +40,20 @@
 
 
 ZIP_EXTERN(void)
-zip_source_free(struct zip_source *source)
+zip_source_free(struct zip_source *src)
 {
-    if (source == NULL)
+    if (src == NULL)
 	return;
 
-    (void)source->f(source->ud, NULL, 0, ZIP_SOURCE_FREE);
+    if (src->is_open)
+	zip_source_close(src);
 
-    free(source);
+    if (src->src == NULL)
+	(void)src->cb.f(src->ud, NULL, 0, ZIP_SOURCE_FREE);
+    else {
+	(void)src->cb.l(src->src, src->ud, NULL, 0, ZIP_SOURCE_FREE);
+	zip_source_free(src->src);
+    }
+
+    free(src);
 }
diff --git a/ext/zip/lib/zip_source_function.c b/ext/zip/lib/zip_source_function.c
index fe3e82a..984b107 100644
--- a/ext/zip/lib/zip_source_function.c
+++ b/ext/zip/lib/zip_source_function.c
@@ -1,6 +1,6 @@
 /*
   zip_source_function.c -- create zip data source from callback function
-  Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip at nih.at>
@@ -47,13 +47,32 @@ zip_source_function(struct zip *za, zip_source_callback zcb, void *ud)
     if (za == NULL)
 	return NULL;
 
-    if ((zs=(struct zip_source *)malloc(sizeof(*zs))) == NULL) {
-	_zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
+    if ((zs=_zip_source_new(za)) == NULL)
 	return NULL;
-    }
 
-    zs->f = zcb;
+    zs->cb.f = zcb;
     zs->ud = ud;
     
     return zs;
 }
+
+
+
+struct zip_source *
+_zip_source_new(struct zip *za)
+{
+    struct zip_source *src;
+
+    if ((src=(struct zip_source *)malloc(sizeof(*src))) == NULL) {
+	_zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
+	return NULL;
+    }
+
+    src->src = NULL;
+    src->cb.f = NULL;
+    src->ud = NULL;
+    src->error_source = ZIP_LES_NONE;
+    src->is_open = 0;
+
+    return src;
+}
diff --git a/ext/zip/lib/zip_source_layered.c b/ext/zip/lib/zip_source_layered.c
new file mode 100644
index 0000000..86ed420
--- /dev/null
+++ b/ext/zip/lib/zip_source_layered.c
@@ -0,0 +1,59 @@
+/*
+  zip_source_layered.c -- create layered source
+  Copyright (C) 2009 Dieter Baron and Thomas Klausner
+
+  This file is part of libzip, a library to manipulate ZIP archives.
+  The authors can be contacted at <libzip at nih.at>
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in
+     the documentation and/or other materials provided with the
+     distribution.
+  3. The names of the authors may not be used to endorse or promote
+     products derived from this software without specific prior
+     written permission.
+ 
+  THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
+  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+
+#include <stdlib.h>
+
+#include "zipint.h"
+
+
+
+ZIP_EXTERN(struct zip_source *)
+zip_source_layered(struct zip *za, struct zip_source *src,
+		   zip_source_layered_callback cb, void *ud)
+{
+    struct zip_source *zs;
+
+    if (za == NULL)
+	return NULL;
+
+    if ((zs=_zip_source_new(za)) == NULL)
+	return NULL;
+
+    zs->src = src;
+    zs->cb.l = cb;
+    zs->ud = ud;
+    
+    return zs;
+}
diff --git a/ext/zip/lib/zip_source_open.c b/ext/zip/lib/zip_source_open.c
new file mode 100644
index 0000000..2c768f7
--- /dev/null
+++ b/ext/zip/lib/zip_source_open.c
@@ -0,0 +1,76 @@
+/*
+  zip_source_open.c -- open zip_source (prepare for reading)
+  Copyright (C) 2009 Dieter Baron and Thomas Klausner
+
+  This file is part of libzip, a library to manipulate ZIP archives.
+  The authors can be contacted at <libzip at nih.at>
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in
+     the documentation and/or other materials provided with the
+     distribution.
+  3. The names of the authors may not be used to endorse or promote
+     products derived from this software without specific prior
+     written permission.
+ 
+  THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
+  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+
+#include "zipint.h"
+
+
+
+ZIP_EXTERN(int)
+zip_source_open(struct zip_source *src)
+{
+    zip_int64_t ret;
+
+    if (src->is_open) {
+	src->error_source = ZIP_LES_INVAL;
+	return -1;
+    }
+
+    if (src->src == NULL) {
+	if (src->cb.f(src->ud, NULL, 0, ZIP_SOURCE_OPEN) < 0)
+	    return -1;
+    }
+    else {
+	if (zip_source_open(src->src) < 0) {
+	    src->error_source = ZIP_LES_LOWER;
+	    return -1;
+	}
+
+	ret = src->cb.l(src->src, src->ud, NULL, 0, ZIP_SOURCE_OPEN);
+	
+	if (ret < 0) {
+	    (void)zip_source_close(src->src);
+	    
+	    if (ret == ZIP_SOURCE_ERR_LOWER)
+		src->error_source = ZIP_LES_LOWER;
+	    else
+		src->error_source = ZIP_LES_UPPER;
+	    return -1;
+	}
+    }
+
+    src->is_open = 1;
+    
+    return 0;
+}
diff --git a/ext/zip/lib/zip_source_pkware.c b/ext/zip/lib/zip_source_pkware.c
new file mode 100644
index 0000000..83b5cc5
--- /dev/null
+++ b/ext/zip/lib/zip_source_pkware.c
@@ -0,0 +1,241 @@
+/*
+  zip_source_pkware.c -- Traditional PKWARE de/encryption routines
+  Copyright (C) 2009 Dieter Baron and Thomas Klausner
+
+  This file is part of libzip, a library to manipulate ZIP archives.
+  The authors can be contacted at <libzip at nih.at>
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in
+     the documentation and/or other materials provided with the
+     distribution.
+  3. The names of the authors may not be used to endorse or promote
+     products derived from this software without specific prior
+     written permission.
+ 
+  THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
+  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "zipint.h"
+
+struct trad_pkware {
+    int e[2];
+
+    zip_uint32_t key[3];
+};
+
+#define HEADERLEN	12
+#define KEY0		305419896
+#define KEY1		591751049
+#define KEY2		878082192
+
+static const uLongf *crc = NULL;
+
+#define CRC32(c, b) (crc[((c) ^ (b)) & 0xff] ^ ((c) >> 8))
+
+
+
+static void decrypt(struct trad_pkware *, zip_uint8_t *,
+		    const zip_uint8_t *, zip_uint64_t, int);
+static int decrypt_header(struct zip_source *, struct trad_pkware *);
+static zip_int64_t pkware_decrypt(struct zip_source *, void *, void *,
+				  zip_uint64_t, enum zip_source_cmd);
+static void pkware_free(struct trad_pkware *);
+
+
+
+ZIP_EXTERN(struct zip_source *)
+zip_source_pkware(struct zip *za, struct zip_source *src,
+		  zip_uint16_t em, int flags, const char *password)
+{
+    struct trad_pkware *ctx;
+    struct zip_source *s2;
+
+    if (password == NULL || src == NULL || em != ZIP_EM_TRAD_PKWARE) {
+	_zip_error_set(&za->error, ZIP_ER_INVAL, 0);
+	return NULL;
+    }
+    if (flags & ZIP_CODEC_ENCODE) {
+	_zip_error_set(&za->error, ZIP_ER_ENCRNOTSUPP, 0);
+	return NULL;
+    }
+
+    if (crc == NULL)
+	crc = get_crc_table();
+
+    if ((ctx=(struct trad_pkware *)malloc(sizeof(*ctx))) == NULL) {
+	_zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
+	return NULL;
+    }
+
+    ctx->e[0] = ctx->e[1] = 0;
+
+    ctx->key[0] = KEY0;
+    ctx->key[1] = KEY1;
+    ctx->key[2] = KEY2;
+    decrypt(ctx, NULL, (const zip_uint8_t *)password, strlen(password), 1);
+
+    if ((s2=zip_source_layered(za, src, pkware_decrypt, ctx)) == NULL) {
+	pkware_free(ctx);
+	return NULL;
+    }
+
+    return s2;
+}
+
+
+
+static void
+decrypt(struct trad_pkware *ctx, zip_uint8_t *out, const zip_uint8_t *in,
+	zip_uint64_t len, int update_only)
+{
+    zip_uint16_t tmp;
+    zip_uint64_t i;
+    Bytef b;
+
+    for (i=0; i<len; i++) {
+	b = in[i];
+
+	if (!update_only) {
+	    /* decrypt next byte */
+	    tmp = ctx->key[2] | 2;
+	    tmp = (tmp * (tmp ^ 1)) >> 8;
+	    b ^= tmp;
+	}
+
+	/* store cleartext */
+	if (out)
+	    out[i] = b;
+
+	/* update keys */
+	ctx->key[0] = CRC32(ctx->key[0], b);
+	ctx->key[1] = (ctx->key[1] + (ctx->key[0] & 0xff)) * 134775813 + 1;
+	b = ctx->key[1] >> 24;
+	ctx->key[2] = CRC32(ctx->key[2], b);
+    }
+}
+
+
+
+static int
+decrypt_header(struct zip_source *src, struct trad_pkware *ctx)
+{
+    zip_uint8_t header[HEADERLEN];
+    struct zip_stat st;
+    zip_int64_t n;
+    unsigned short dostime, dosdate;
+
+    if ((n=zip_source_read(src, header, HEADERLEN)) < 0) {
+	zip_source_error(src, ctx->e, ctx->e+1);
+	return -1;
+    }
+    
+    if (n != HEADERLEN) {
+	ctx->e[0] = ZIP_ER_EOF;
+	ctx->e[1] = 0;
+	return -1;
+    }
+
+    decrypt(ctx, header, header, HEADERLEN, 0);
+
+    if (zip_source_stat(src, &st) < 0) {
+	/* stat failed, skip password validation */
+	return 0;
+    }
+
+    _zip_u2d_time(st.mtime, &dostime, &dosdate);
+
+    if (header[HEADERLEN-1] != st.crc>>24
+	&& header[HEADERLEN-1] != dostime>>8) {
+	ctx->e[0] = ZIP_ER_WRONGPASSWD;
+	ctx->e[1] = 0;
+	return -1;
+    }
+
+    return 0;
+}
+
+
+
+static zip_int64_t
+pkware_decrypt(struct zip_source *src, void *ud, void *data,
+	       zip_uint64_t len, enum zip_source_cmd cmd)
+{
+    struct trad_pkware *ctx;
+    zip_int64_t n;
+
+    ctx = (struct trad_pkware *)ud;
+
+    switch (cmd) {
+    case ZIP_SOURCE_OPEN:
+	if (decrypt_header(src, ctx) < 0)
+	    return -1;
+	return 0;
+
+    case ZIP_SOURCE_READ:
+	if ((n=zip_source_read(src, data, len)) < 0)
+	    return ZIP_SOURCE_ERR_LOWER;
+
+	decrypt(ud, (zip_uint8_t *)data, (zip_uint8_t *)data, (zip_uint64_t)n,
+		0);
+	return n;
+
+    case ZIP_SOURCE_CLOSE:
+	return 0;
+
+    case ZIP_SOURCE_STAT:
+	{
+	    struct zip_stat *st;
+
+	    st = (struct zip_stat *)data;
+
+	    st->encryption_method = ZIP_EM_NONE;
+	    st->valid |= ZIP_STAT_ENCRYPTION_METHOD;
+	    /* XXX: deduce HEADERLEN from size for uncompressed */
+	    if (st->valid & ZIP_STAT_COMP_SIZE)
+		st->comp_size -= HEADERLEN;
+	}
+	return 0;
+
+    case ZIP_SOURCE_ERROR:
+	memcpy(data, ctx->e, sizeof(int)*2);
+	return sizeof(int)*2;
+
+    case ZIP_SOURCE_FREE:
+	pkware_free(ctx);
+	return 0;
+
+    default:
+	ctx->e[0] = ZIP_ER_INVAL;
+	ctx->e[1] = 0;
+	return -1;
+    }
+}
+
+
+
+static void
+pkware_free(struct trad_pkware *ctx)
+{
+    free(ctx);
+}
diff --git a/ext/zip/lib/zip_source_pop.c b/ext/zip/lib/zip_source_pop.c
new file mode 100644
index 0000000..4060938
--- /dev/null
+++ b/ext/zip/lib/zip_source_pop.c
@@ -0,0 +1,63 @@
+/*
+  zip_source_pop.c -- pop top layer from zip data source
+  Copyright (C) 2009 Dieter Baron and Thomas Klausner
+
+  This file is part of libzip, a library to manipulate ZIP archives.
+  The authors can be contacted at <libzip at nih.at>
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in
+     the documentation and/or other materials provided with the
+     distribution.
+  3. The names of the authors may not be used to endorse or promote
+     products derived from this software without specific prior
+     written permission.
+ 
+  THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
+  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+
+#include <stdlib.h>
+
+#include "zipint.h"
+
+
+
+ZIP_EXTERN(struct zip_source *)
+zip_source_pop(struct zip_source *src)
+{
+    struct zip_source *lower;
+
+    if (src == NULL)
+	return NULL;
+
+    lower = src->src;
+
+    if (lower == NULL)
+	zip_source_free(src);
+    else {
+	if (src->is_open)
+	    (void)src->cb.l(src, src->ud, NULL, 0, ZIP_SOURCE_CLOSE);
+	(void)src->cb.l(src, src->ud, NULL, 0, ZIP_SOURCE_FREE);
+	
+	free(src);
+    }
+
+    return lower;
+}
diff --git a/ext/zip/lib/zip_source_read.c b/ext/zip/lib/zip_source_read.c
new file mode 100644
index 0000000..7246f9c
--- /dev/null
+++ b/ext/zip/lib/zip_source_read.c
@@ -0,0 +1,64 @@
+/*
+  zip_source_read.c -- read data from zip_source
+  Copyright (C) 2009 Dieter Baron and Thomas Klausner
+
+  This file is part of libzip, a library to manipulate ZIP archives.
+  The authors can be contacted at <libzip at nih.at>
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in
+     the documentation and/or other materials provided with the
+     distribution.
+  3. The names of the authors may not be used to endorse or promote
+     products derived from this software without specific prior
+     written permission.
+ 
+  THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
+  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+
+#include "zipint.h"
+
+
+
+ZIP_EXTERN(zip_int64_t)
+zip_source_read(struct zip_source *src, void *data, zip_uint64_t len)
+{
+    zip_int64_t ret;
+
+    if (!src->is_open || len > ZIP_INT64_MAX || (len > 0 && data == NULL)) {
+	src->error_source = ZIP_LES_INVAL;
+	return -1;
+    }
+
+    if (src->src == NULL)
+	return src->cb.f(src->ud, data, len, ZIP_SOURCE_READ);
+
+    ret = src->cb.l(src->src, src->ud, data, len, ZIP_SOURCE_READ);
+
+    if (ret < 0) {
+	if (ret == ZIP_SOURCE_ERR_LOWER)
+	    src->error_source = ZIP_LES_LOWER;
+	else
+	    src->error_source = ZIP_LES_UPPER;
+	return -1;
+    }
+    
+    return ret;
+}
diff --git a/ext/zip/lib/zip_source_stat.c b/ext/zip/lib/zip_source_stat.c
new file mode 100644
index 0000000..662779e
--- /dev/null
+++ b/ext/zip/lib/zip_source_stat.c
@@ -0,0 +1,72 @@
+/*
+  zip_source_stat.c -- get meta information from zip_source
+  Copyright (C) 2009 Dieter Baron and Thomas Klausner
+
+  This file is part of libzip, a library to manipulate ZIP archives.
+  The authors can be contacted at <libzip at nih.at>
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in
+     the documentation and/or other materials provided with the
+     distribution.
+  3. The names of the authors may not be used to endorse or promote
+     products derived from this software without specific prior
+     written permission.
+ 
+  THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
+  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+
+#include "zipint.h"
+
+
+
+ZIP_EXTERN(int)
+zip_source_stat(struct zip_source *src, struct zip_stat *st)
+{
+    zip_int64_t ret;
+
+    if (st == NULL) {
+	src->error_source = ZIP_LES_INVAL;
+	return -1;
+    }
+
+    if (src->src == NULL) {
+	if (src->cb.f(src->ud, st, sizeof(*st), ZIP_SOURCE_STAT) < 0)
+	    return -1;
+	return 0;
+    }
+
+    if (zip_source_stat(src->src, st) < 0) {
+	src->error_source = ZIP_LES_LOWER;
+	return -1;
+    }
+
+    ret = src->cb.l(src->src, src->ud, st, sizeof(*st), ZIP_SOURCE_STAT);
+
+    if (ret < 0) {
+	if (ret == ZIP_SOURCE_ERR_LOWER)
+	    src->error_source = ZIP_LES_LOWER;
+	else
+	    src->error_source = ZIP_LES_UPPER;
+	return -1;
+    }
+    
+    return 0;
+}
diff --git a/ext/zip/lib/zip_source_zip.c b/ext/zip/lib/zip_source_zip.c
index 58119dd..228803c 100644
--- a/ext/zip/lib/zip_source_zip.c
+++ b/ext/zip/lib/zip_source_zip.c
@@ -1,6 +1,6 @@
 /*
   zip_source_zip.c -- create data source from zip file
-  Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip at nih.at>
@@ -41,17 +41,18 @@
 struct read_zip {
     struct zip_file *zf;
     struct zip_stat st;
-    off_t off, len;
+    zip_uint64_t off;
+    zip_int64_t len;
 };
 
-static ssize_t read_zip(void *st, void *data, size_t len,
+static zip_int64_t read_zip(void *st, void *data, zip_uint64_t len,
 			enum zip_source_cmd cmd);
 
 
 
 ZIP_EXTERN(struct zip_source *)
-zip_source_zip(struct zip *za, struct zip *srcza, int srcidx, int flags,
-	       off_t start, off_t len)
+zip_source_zip(struct zip *za, struct zip *srcza, zip_uint64_t srcidx,
+	       int flags, zip_uint64_t start, zip_int64_t len)
 {
     struct zip_error error;
     struct zip_source *zs;
@@ -62,7 +63,7 @@ zip_source_zip(struct zip *za, struct zip *srcza, int srcidx, int flags,
     if (za == NULL)
 	return NULL;
 
-    if (srcza == NULL || start < 0 || len < -1 || srcidx < 0 || srcidx >= srcza->nentry) {
+    if (srcza == NULL || len < -1 || srcidx < 0 || srcidx >= srcza->nentry) {
 	_zip_error_set(&za->error, ZIP_ER_INVAL, 0);
 	return NULL;
     }
@@ -115,12 +116,13 @@ zip_source_zip(struct zip *za, struct zip *srcza, int srcidx, int flags,
 
 
 
-static ssize_t
-read_zip(void *state, void *data, size_t len, enum zip_source_cmd cmd)
+static zip_int64_t
+read_zip(void *state, void *data, zip_uint64_t len, enum zip_source_cmd cmd)
 {
     struct read_zip *z;
     char b[8192], *buf;
-    int i, n;
+    int i;
+    zip_uint64_t n;
 
     z = (struct read_zip *)state;
     buf = (char *)data;
diff --git a/ext/zip/lib/zip_stat_index.c b/ext/zip/lib/zip_stat_index.c
index 2642520..8faa8cc 100644
--- a/ext/zip/lib/zip_stat_index.c
+++ b/ext/zip/lib/zip_stat_index.c
@@ -1,6 +1,6 @@
 /*
   zip_stat_index.c -- get information about file by index
-  Copyright (C) 1999-2007 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip at nih.at>
@@ -38,11 +38,12 @@
 
 
 ZIP_EXTERN(int)
-zip_stat_index(struct zip *za, int index, int flags, struct zip_stat *st)
+zip_stat_index(struct zip *za, zip_uint64_t index, int flags,
+	       struct zip_stat *st)
 {
     const char *name;
     
-    if (index < 0 || index >= za->nentry) {
+    if (index >= za->nentry) {
 	_zip_error_set(&za->error, ZIP_ER_INVAL, 0);
 	return -1;
     }
@@ -53,8 +54,7 @@ zip_stat_index(struct zip *za, int index, int flags, struct zip_stat *st)
 
     if ((flags & ZIP_FL_UNCHANGED) == 0
 	&& ZIP_ENTRY_DATA_CHANGED(za->entry+index)) {
-	if (za->entry[index].source->f(za->entry[index].source->ud,
-				     st, sizeof(*st), ZIP_SOURCE_STAT) < 0) {
+	if (zip_source_stat(za->entry[index].source, st) < 0) {
 	    _zip_error_set(&za->error, ZIP_ER_CHANGED, 0);
 	    return -1;
 	}
@@ -64,7 +64,9 @@ zip_stat_index(struct zip *za, int index, int flags, struct zip_stat *st)
 	    _zip_error_set(&za->error, ZIP_ER_INVAL, 0);
 	    return -1;
 	}
-	
+
+	zip_stat_init(st);
+
 	st->crc = za->cdir->entry[index].crc;
 	st->size = za->cdir->entry[index].uncomp_size;
 	st->mtime = za->cdir->entry[index].last_mod;
@@ -80,11 +82,13 @@ zip_stat_index(struct zip *za, int index, int flags, struct zip_stat *st)
 	}
 	else
 	    st->encryption_method = ZIP_EM_NONE;
-	/* st->bitflags = za->cdir->entry[index].bitflags; */
+	st->valid = ZIP_STAT_CRC|ZIP_STAT_SIZE|ZIP_STAT_MTIME
+	    |ZIP_STAT_COMP_SIZE|ZIP_STAT_COMP_METHOD|ZIP_STAT_ENCRYPTION_METHOD;
     }
 
     st->index = index;
     st->name = name;
+    st->valid |= ZIP_STAT_INDEX|ZIP_STAT_NAME;
     
     return 0;
 }
diff --git a/ext/zip/lib/zip_stat_init.c b/ext/zip/lib/zip_stat_init.c
index cb451dc..74e1ffd 100644
--- a/ext/zip/lib/zip_stat_init.c
+++ b/ext/zip/lib/zip_stat_init.c
@@ -1,6 +1,6 @@
 /*
   zip_stat_init.c -- initialize struct zip_stat.
-  Copyright (C) 2006-2007 Dieter Baron and Thomas Klausner
+  Copyright (C) 2006-2009 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip at nih.at>
@@ -40,12 +40,13 @@
 ZIP_EXTERN(void)
 zip_stat_init(struct zip_stat *st)
 {
+    st->valid = 0;
     st->name = NULL;
-    st->index = -1;
+    st->index = ZIP_UINT64_MAX;
     st->crc = 0;
     st->mtime = (time_t)-1;
-    st->size = -1;
-    st->comp_size = -1;
+    st->size = 0;
+    st->comp_size = 0;
     st->comp_method = ZIP_CM_STORE;
     st->encryption_method = ZIP_EM_NONE;
 }
diff --git a/ext/zip/lib/zip_unchange.c b/ext/zip/lib/zip_unchange.c
index 7366c9c..550e8b9 100644
--- a/ext/zip/lib/zip_unchange.c
+++ b/ext/zip/lib/zip_unchange.c
@@ -40,7 +40,7 @@
 
 
 ZIP_EXTERN(int)
-zip_unchange(struct zip *za, int idx)
+zip_unchange(struct zip *za, zip_uint64_t idx)
 {
     return _zip_unchange(za, idx, 0);
 }
@@ -48,11 +48,11 @@ zip_unchange(struct zip *za, int idx)
 
 
 int
-_zip_unchange(struct zip *za, int idx, int allow_duplicates)
+_zip_unchange(struct zip *za, zip_uint64_t idx, int allow_duplicates)
 {
     int i;
     
-    if (idx < 0 || idx >= za->nentry) {
+    if (idx >= za->nentry) {
 	_zip_error_set(&za->error, ZIP_ER_INVAL, 0);
 	return -1;
     }
@@ -72,6 +72,9 @@ _zip_unchange(struct zip *za, int idx, int allow_duplicates)
 	za->entry[idx].ch_filename = NULL;
     }
 
+    free(za->entry[idx].ch_extra);
+    za->entry[idx].ch_extra = NULL;
+    za->entry[idx].ch_extra_len = -1;
     free(za->entry[idx].ch_comment);
     za->entry[idx].ch_comment = NULL;
     za->entry[idx].ch_comment_len = -1;
diff --git a/ext/zip/lib/zip_unchange_archive.c b/ext/zip/lib/zip_unchange_archive.c
index fe30a5a..ca2b678 100644
--- a/ext/zip/lib/zip_unchange_archive.c
+++ b/ext/zip/lib/zip_unchange_archive.c
@@ -1,6 +1,6 @@
 /*
   zip_unchange_archive.c -- undo global changes to ZIP archive
-  Copyright (C) 2006-2009 Dieter Baron and Thomas Klausner
+  Copyright (C) 2006-2008 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip at nih.at>
diff --git a/ext/zip/lib/zip_unchange_data.c b/ext/zip/lib/zip_unchange_data.c
index 6fe89f4..7dd93b7 100644
--- a/ext/zip/lib/zip_unchange_data.c
+++ b/ext/zip/lib/zip_unchange_data.c
@@ -43,8 +43,7 @@ void
 _zip_unchange_data(struct zip_entry *ze)
 {
     if (ze->source) {
-	(void)ze->source->f(ze->source->ud, NULL, 0, ZIP_SOURCE_FREE);
-	free(ze->source);
+	zip_source_free(ze->source);
 	ze->source = NULL;
     }
     
diff --git a/ext/zip/lib/zipconf.h b/ext/zip/lib/zipconf.h
new file mode 100644
index 0000000..b65d91e
--- /dev/null
+++ b/ext/zip/lib/zipconf.h
@@ -0,0 +1,47 @@
+#ifndef _HAD_ZIPCONF_H
+#define _HAD_ZIPCONF_H
+
+/*
+   zipconf.h -- platform specific include file
+
+   This file was generated automatically by ./make_zipconf.sh
+   based on ../config.h.
+ */
+
+#define LIBZIP_VERSION "0.10.1"
+#define LIBZIP_VERSION_MAJOR 0
+#define LIBZIP_VERSION_MINOR 10
+#define LIBZIP_VERSION_MICRO 0
+
+#include <inttypes.h>
+
+typedef int8_t zip_int8_t;
+#define ZIP_INT8_MIN INT8_MIN
+#define ZIP_INT8_MAX INT8_MAX
+
+typedef uint8_t zip_uint8_t;
+#define ZIP_UINT8_MAX UINT8_MAX
+
+typedef int16_t zip_int16_t;
+#define ZIP_INT16_MIN INT16_MIN
+#define ZIP_INT16_MAX INT16_MAX
+
+typedef uint16_t zip_uint16_t;
+#define ZIP_UINT16_MAX UINT16_MAX
+
+typedef int32_t zip_int32_t;
+#define ZIP_INT32_MIN INT32_MIN
+#define ZIP_INT32_MAX INT32_MAX
+
+typedef uint32_t zip_uint32_t;
+#define ZIP_UINT32_MAX UINT32_MAX
+
+typedef int64_t zip_int64_t;
+#define ZIP_INT64_MIN INT64_MIN
+#define ZIP_INT64_MAX INT64_MAX
+
+typedef uint64_t zip_uint64_t;
+#define ZIP_UINT64_MAX UINT64_MAX
+
+
+#endif /* zipconf.h */
diff --git a/ext/zip/lib/zipint.h b/ext/zip/lib/zipint.h
index d72ed14..67fae80 100644
--- a/ext/zip/lib/zipint.h
+++ b/ext/zip/lib/zipint.h
@@ -3,7 +3,7 @@
 
 /*
   zipint.h -- internal declarations.
-  Copyright (C) 1999-2009 Dieter Baron and Thomas Klausner
+  Copyright (C) 1999-2011 Dieter Baron and Thomas Klausner
 
   This file is part of libzip, a library to manipulate ZIP archives.
   The authors can be contacted at <libzip at nih.at>
@@ -38,12 +38,35 @@
 
 #include "zip.h"
 
+#ifndef HAVE_FSEEKO
+#define fseeko(s, o, w)	(fseek((s), (long int)(o), (w)))
+#endif
+
+#ifndef HAVE_FTELLO
+#define ftello(s)	((long)ftell((s)))
+#endif
+
+#ifndef HAVE_MKSTEMP
+int _zip_mkstemp(char *);
+#define mkstemp _zip_mkstemp
+#endif
+
 #ifdef PHP_WIN32
 #include <windows.h>
 #include <wchar.h>
 #define _zip_rename(s, t)						\
 	(!MoveFileExA((s), (t),						\
 		     MOVEFILE_COPY_ALLOWED|MOVEFILE_REPLACE_EXISTING))
+
+/* for dup(), close(), etc. */
+#include <io.h>
+
+#if !defined(HAVE_OPEN)
+#if defined(HAVE__OPEN)
+#define open(a, b, c)	_open((a), (b))
+#endif
+#endif
+
 #else
 #define _zip_rename	rename
 #endif
@@ -52,12 +75,6 @@
 # define strcmpi strcasecmp 
 #endif
 
-#ifndef HAVE_FSEEKO
-#define fseeko(s, o, w)	(fseek((s), (long int)(o), (w)))
-#endif
-#ifndef HAVE_FTELLO
-#define ftello(s)	((long)ftell((s)))
-#endif
 
 
 
@@ -73,22 +90,77 @@
 #define LENTRYSIZE          30
 #undef MAXCOMLEN /* defined as 19 on BSD for max command name */
 #define MAXCOMLEN        65536
+#define MAXEXTLEN        65536
 #define EOCDLEN             22
 #define CDBUFSIZE       (MAXCOMLEN+EOCDLEN)
 #define BUFSIZE		8192
 
 
 
+/* This section contains API that won't materialize like this.  It's
+   placed in the internal section, pending cleanup. */
+
+typedef struct zip_source *(*zip_compression_implementation)(struct zip *,
+						     struct zip_source *,
+						     zip_uint16_t, int);
+typedef struct zip_source *(*zip_encryption_implementation)(struct zip *,
+						    struct zip_source *,
+						    zip_uint16_t, int,
+						    const char *);
+
+ZIP_EXTERN(zip_compression_implementation) zip_get_compression_implementation(
+    zip_uint16_t);
+ZIP_EXTERN(zip_encryption_implementation) zip_get_encryption_implementation(
+    zip_uint16_t);
+
+
+
+
+/* This section contains API that is of limited use until support for
+   user-supplied compression/encryption implementation is finished.
+   Thus we will keep it private for now. */
+
+typedef zip_int64_t (*zip_source_layered_callback)(struct zip_source *, void *,
+						   void *, zip_uint64_t,
+						   enum zip_source_cmd);
+
+ZIP_EXTERN(void) zip_source_close(struct zip_source *);
+ZIP_EXTERN(struct zip_source *)zip_source_crc(struct zip *, struct zip_source *,
+					     int);
+ZIP_EXTERN(struct zip_source *)zip_source_deflate(struct zip *,
+						 struct zip_source *,
+						 zip_uint16_t, int);
+ZIP_EXTERN(void) zip_source_error(struct zip_source *, int *, int *);
+ZIP_EXTERN(struct zip_source *)zip_source_layered(struct zip *,
+						 struct zip_source *,
+						 zip_source_layered_callback,
+						 void *);
+ZIP_EXTERN(int) zip_source_open(struct zip_source *);
+ZIP_EXTERN(struct zip_source *)zip_source_pkware(struct zip *,
+						struct zip_source *,
+						zip_uint16_t, int,
+						const char *);
+ZIP_EXTERN(zip_int64_t) zip_source_read(struct zip_source *, void *,
+				       zip_uint64_t);
+ZIP_EXTERN(int) zip_source_stat(struct zip_source *, struct zip_stat *);
+
+
+/* This function will probably remain private.  It is not needed to
+   implement compression/encryption routines.  (We should probably
+   rename it to _zip_source_pop.) */
+
+ZIP_EXTERN(struct zip_source *)zip_source_pop(struct zip_source *);
+
+
+
 /* state of change of a file in zip archive */
 
 enum zip_state { ZIP_ST_UNCHANGED, ZIP_ST_DELETED, ZIP_ST_REPLACED,
 		 ZIP_ST_ADDED, ZIP_ST_RENAMED };
 
-/* constants for struct zip_file's member flags */
+/* error source for layered sources */
 
-#define ZIP_ZF_EOF	1 /* EOF reached */
-#define ZIP_ZF_DECOMP	2 /* decompress data */
-#define ZIP_ZF_CRC	4 /* compute and compare CRC */
+enum zip_les { ZIP_LES_NONE, ZIP_LES_UPPER, ZIP_LES_LOWER, ZIP_LES_INVAL };
 
 /* directory entry: general purpose bit flags */
 
@@ -114,12 +186,14 @@ struct zip {
     unsigned int flags;		/* archive global flags */
     unsigned int ch_flags;	/* changed archive global flags */
 
+    char *default_password;	/* password used when no other supplied */
+
     struct zip_cdir *cdir;	/* central directory */
     char *ch_comment;		/* changed archive comment */
     int ch_comment_len;		/* length of changed zip archive
 				 * comment, -1 if unchanged */
-    int nentry;			/* number of entries */
-    int nentry_alloc;		/* number of entries allocated */
+    zip_uint64_t nentry;	/* number of entries */
+    zip_uint64_t nentry_alloc;	/* number of entries allocated */
     struct zip_entry *entry;	/* entries */
     int nfile;			/* number of opened files within archive */
     int nfile_alloc;		/* number of files allocated */
@@ -131,18 +205,8 @@ struct zip {
 struct zip_file {
     struct zip *za;		/* zip archive containing this file */
     struct zip_error error;	/* error information */
-    int flags;			/* -1: eof, >0: error */
-
-    int method;			/* compression method */
-    off_t fpos;			/* position within zip file (fread/fwrite) */
-    unsigned long bytes_left;	/* number of bytes left to read */
-    unsigned long cbytes_left;  /* number of bytes of compressed data left */
-
-    unsigned long crc;		/* CRC so far */
-    unsigned long crc_orig;	/* CRC recorded in archive */
-
-    char *buffer;
-    z_stream *zstr;
+    int eof;
+    struct zip_source *src;	/* data source */
 };
 
 /* zip archive directory entry (central or local) */
@@ -183,8 +247,14 @@ struct zip_cdir {
 
 
 struct zip_source {
-    zip_source_callback f;
+    struct zip_source *src;
+    union {
+	zip_source_callback f;
+	zip_source_layered_callback l;
+    } cb;
     void *ud;
+    enum zip_les error_source;
+    int is_open;
 };
 
 /* entry in zip archive directory */
@@ -193,6 +263,8 @@ struct zip_entry {
     enum zip_state state;
     struct zip_source *source;
     char *ch_filename;
+    char *ch_extra;
+    int ch_extra_len;
     char *ch_comment;
     int ch_comment_len;
 };
@@ -209,6 +281,8 @@ extern const int _zip_err_type[];
 			((x)->state == ZIP_ST_REPLACED  \
 			 || (x)->state == ZIP_ST_ADDED)
 
+#define ZIP_IS_RDONLY(za)	((za)->ch_flags & ZIP_AFL_RDONLY)
+
 
 
 int _zip_cdir_compute_crc(struct zip *, uLong *);
@@ -220,7 +294,7 @@ int _zip_cdir_write(struct zip_cdir *, FILE *, struct zip_error *);
 void _zip_dirent_finalize(struct zip_dirent *);
 void _zip_dirent_init(struct zip_dirent *);
 int _zip_dirent_read(struct zip_dirent *, FILE *, unsigned char **,
-		     unsigned int *, int, struct zip_error *);
+		     zip_uint32_t *, int, struct zip_error *);
 void _zip_dirent_torrent_normalize(struct zip_dirent *);
 int _zip_dirent_write(struct zip_dirent *, FILE *, int, struct zip_error *);
 
@@ -234,6 +308,7 @@ void _zip_error_fini(struct zip_error *);
 void _zip_error_get(struct zip_error *, int *, int *);
 void _zip_error_init(struct zip_error *);
 void _zip_error_set(struct zip_error *, int, int);
+void _zip_error_set_from_source(struct zip_error *, struct zip_source *);
 const char *_zip_error_strerror(struct zip_error *);
 
 int _zip_file_fillbuf(void *, size_t, struct zip_file *);
@@ -241,20 +316,27 @@ unsigned int _zip_file_get_offset(struct zip *, int);
 
 int _zip_filerange_crc(FILE *, off_t, off_t, uLong *, struct zip_error *);
 
+struct zip *_zip_open(const char *, FILE *, int, int, int *);
+
 struct zip_source *_zip_source_file_or_p(struct zip *, const char *, FILE *,
-					 off_t, off_t);
+					 zip_uint64_t, zip_int64_t, int,
+					 const struct zip_stat *);
+struct zip_source *_zip_source_new(struct zip *);
 
+int _zip_changed(struct zip *, int *);
 void _zip_free(struct zip *);
-const char *_zip_get_name(struct zip *, int, int, struct zip_error *);
+const char *_zip_get_name(struct zip *, zip_uint64_t, int, struct zip_error *);
 int _zip_local_header_read(struct zip *, int);
 void *_zip_memdup(const void *, size_t, struct zip_error *);
 int _zip_name_locate(struct zip *, const char *, int, struct zip_error *);
 struct zip *_zip_new(struct zip_error *);
 unsigned short _zip_read2(unsigned char **);
 unsigned int _zip_read4(unsigned char **);
-int _zip_replace(struct zip *, int, const char *, struct zip_source *);
-int _zip_set_name(struct zip *, int, const char *);
-int _zip_unchange(struct zip *, int, int);
+zip_int64_t _zip_replace(struct zip *, zip_uint64_t, const char *,
+			 struct zip_source *);
+int _zip_set_name(struct zip *, zip_uint64_t, const char *);
+void _zip_u2d_time(time_t, unsigned short *, unsigned short *);
+int _zip_unchange(struct zip *, zip_uint64_t, int);
 void _zip_unchange_data(struct zip_entry *);
 
 #endif /* zipint.h */


commit f8d60e2f0963da833a024347a3996a7bb8904822
Author: David Soria Parra <dsp at php.net>
Date:   Thu Jun 7 19:45:56 2012 +0200

    Travis stop spamming

diff --git a/.travis.yml b/.travis.yml
index cfb4009..5995773 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,8 +8,8 @@ notifications:
     email:
         recipients:
             - php-qa at lists.php.net
-        on_success: change # [always|never|change] default: change
-        on_failure: always # [always|never|change] default: always
+        on_success: never # [always|never|change] default: change
+        on_failure: never # [always|never|change] default: always
 
 env:
     - REPORT_EXIT_STATUS=1 TEST_PHP_EXECUTABLE=./sapi/cli/php


commit 0eaa6e95125be62688cf422c1e4cad49655ddf0a
Author: David Soria Parra <dsp at php.net>
Date:   Thu Jun 7 19:28:06 2012 +0200

    UPGRADING entry for boolval()

diff --git a/UPGRADING b/UPGRADING
index 0787087..3581b65 100755
--- a/UPGRADING
+++ b/UPGRADING
@@ -94,6 +94,9 @@ PHP X.Y UPGRADE NOTES
 5. New Functions
 ========================================
 
+- Core:
+  - boolval()
+
 - Intl:
   - datefmt_get_calendar_object()
   - datefmt_get_timezone()


commit 7cae4ff02c593ed212a363d65c83c38a67a27f0d
Author: Felipe Pena <felipensp at gmail.com>
Date:   Thu Jun 7 14:23:17 2012 -0300

    - BFN

diff --git a/NEWS b/NEWS
index a6b41f4..d56b540 100644
--- a/NEWS
+++ b/NEWS
@@ -39,6 +39,9 @@ PHP                                                                        NEWS
   . Fixed bug #62017 (datefmt_create with incorrectly encoded timezone leaks
     pattern). (Gustavo)
   . Fixed bug #60785 (memory leak in IntlDateFormatter constructor). (Gustavo)
+  
+- Phar:
+  . Fixed bug #62227 (Invalid phar stream path causes crash). (Felipe)
 
 - Reflection:
   . Fixed bug #62202 (ReflectionParameter::getDefaultValue() memory leaks 


commit 7cb43e7955f8a4983c45556390d2264baa1c5564
Merge: 93b041e 7881158
Author: Felipe Pena <felipensp at gmail.com>
Date:   Thu Jun 7 14:21:20 2012 -0300

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      - Fixed bug #62227 (Invalid phar stream path causes crash)



commit 78811586901e08e284120edf43c53c78451e4f91
Merge: c975320 018a9b3
Author: Felipe Pena <felipensp at gmail.com>
Date:   Thu Jun 7 14:21:10 2012 -0300

    - Fix merge



commit 018a9b321fc1d405dacff7cba4c2623f4ec0fe51
Merge: 4e6f27f 1521376
Author: Felipe Pena <felipensp at gmail.com>
Date:   Thu Jun 7 14:18:34 2012 -0300

    Merge commit '15213768e6cc098ab4e53cacc3b5eb86fa85284a' into PHP-5.3



commit 93b041e6c2860a0aeebf6e7fd6746bf4b5ca226b
Author: Pierrick Charron <pierrick at php.net>
Date:   Thu Jun 7 18:05:25 2012 +0200

    Regenerated files

diff --git a/Zend/zend_ini_scanner.c b/Zend/zend_ini_scanner.c
index 4bbf604..470f5236 100644
--- a/Zend/zend_ini_scanner.c
+++ b/Zend/zend_ini_scanner.c
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Sat Feb 25 22:04:14 2012 */
+/* Generated by re2c 0.13.5 on Thu Jun  7 17:55:40 2012 */
 #line 1 "Zend/zend_ini_scanner.l"
 /*
    +----------------------------------------------------------------------+
@@ -481,7 +481,7 @@ yy4:
 yy5:
 		YYDEBUG(5, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 547 "Zend/zend_ini_scanner.l"
+#line 568 "Zend/zend_ini_scanner.l"
 		{
 	/* eat whitespace */
 	goto restart;
@@ -493,7 +493,7 @@ yy6:
 yy7:
 		YYDEBUG(7, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 552 "Zend/zend_ini_scanner.l"
+#line 573 "Zend/zend_ini_scanner.l"
 		{
 	SCNG(lineno)++;
 	return END_OF_LINE;
@@ -533,7 +533,7 @@ yy10:
 		++YYCURSOR;
 		YYDEBUG(11, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 475 "Zend/zend_ini_scanner.l"
+#line 496 "Zend/zend_ini_scanner.l"
 		{ /* Disallow these chars outside option values */
 	return yytext[0];
 }
@@ -554,7 +554,7 @@ yy14:
 		goto yy54;
 		YYDEBUG(15, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 575 "Zend/zend_ini_scanner.l"
+#line 596 "Zend/zend_ini_scanner.l"
 		{
 	return 0;
 }
@@ -926,7 +926,7 @@ yy55:
 yy56:
 		YYDEBUG(56, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 557 "Zend/zend_ini_scanner.l"
+#line 578 "Zend/zend_ini_scanner.l"
 		{ /* Comment */
 	BEGIN(INITIAL);
 	SCNG(lineno)++;
@@ -1012,7 +1012,7 @@ yy64:
 yy65:
 		YYDEBUG(65, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 563 "Zend/zend_ini_scanner.l"
+#line 584 "Zend/zend_ini_scanner.l"
 		{ /* #Comment */
 	zend_error(E_DEPRECATED, "Comments starting with '#' are deprecated in %s on line %d", zend_ini_scanner_get_filename(TSRMLS_C), SCNG(lineno));
 	BEGIN(INITIAL);
@@ -1159,7 +1159,7 @@ yyc_ST_DOUBLE_QUOTES:
 yy76:
 		YYDEBUG(76, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 507 "Zend/zend_ini_scanner.l"
+#line 528 "Zend/zend_ini_scanner.l"
 		{ /* Escape double quoted string contents */
 	if (YYCURSOR > YYLIMIT) {
 		return 0;
@@ -1204,7 +1204,7 @@ yy77:
 yy78:
 		YYDEBUG(78, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 502 "Zend/zend_ini_scanner.l"
+#line 523 "Zend/zend_ini_scanner.l"
 		{ /* Double quoted '"' string ends */
 	yy_pop_state(TSRMLS_C);
 	return '"';
@@ -1323,7 +1323,7 @@ yy86:
 yy87:
 		YYDEBUG(87, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 493 "Zend/zend_ini_scanner.l"
+#line 514 "Zend/zend_ini_scanner.l"
 		{ /* Get rest as section/offset value */
 	RETURN_TOKEN(TC_STRING, yytext, yyleng);
 }
@@ -1344,7 +1344,7 @@ yy89:
 yy90:
 		YYDEBUG(90, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 575 "Zend/zend_ini_scanner.l"
+#line 596 "Zend/zend_ini_scanner.l"
 		{
 	return 0;
 }
@@ -1355,7 +1355,7 @@ yy91:
 yy92:
 		YYDEBUG(92, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 497 "Zend/zend_ini_scanner.l"
+#line 518 "Zend/zend_ini_scanner.l"
 		{ /* Double quoted '"' string start */
 	yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC);
 	return '"';
@@ -1422,7 +1422,7 @@ yy97:
 yy98:
 		YYDEBUG(98, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 471 "Zend/zend_ini_scanner.l"
+#line 492 "Zend/zend_ini_scanner.l"
 		{ /* Get number option value as string */
 	RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
 }
@@ -1452,7 +1452,7 @@ yy99:
 yy100:
 		YYDEBUG(100, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 467 "Zend/zend_ini_scanner.l"
+#line 488 "Zend/zend_ini_scanner.l"
 		{ /* Get constant option value */
 	RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
 }
@@ -1833,7 +1833,7 @@ yyc_ST_RAW:
 			160, 224,   0, 160, 160,   0, 160, 160, 
 			160, 160, 160, 160, 160, 160, 160, 160, 
 			160, 160, 160, 160, 160, 160, 160, 160, 
-			224, 160, 160, 160, 160, 160, 160, 160, 
+			224, 160,  32, 160, 160, 160, 160, 160, 
 			160, 160, 160, 160, 160, 160, 160, 160, 
 			160, 160, 160, 160, 160, 160, 160, 160, 
 			160, 160, 160,  32, 160, 160, 160, 160, 
@@ -1865,66 +1865,64 @@ yyc_ST_RAW:
 		YYDEBUG(135, *YYCURSOR);
 		YYFILL(3);
 		yych = *YYCURSOR;
-		if (yych <= '\f') {
-			if (yych <= 0x08) {
-				if (yych >= 0x01) goto yy139;
+		if (yych <= '\r') {
+			if (yych <= '\t') {
+				if (yych <= 0x00) goto yy137;
+				if (yych <= 0x08) goto yy139;
+				goto yy141;
 			} else {
-				if (yych <= '\t') goto yy141;
 				if (yych <= '\n') goto yy142;
-				goto yy139;
+				if (yych <= '\f') goto yy139;
+				goto yy144;
 			}
 		} else {
-			if (yych <= ' ') {
-				if (yych <= '\r') goto yy144;
-				if (yych <= 0x1F) goto yy139;
-				goto yy141;
+			if (yych <= '!') {
+				if (yych == ' ') goto yy141;
+				goto yy139;
 			} else {
-				if (yych == ';') goto yy145;
+				if (yych <= '"') goto yy145;
+				if (yych == ';') goto yy147;
 				goto yy139;
 			}
 		}
+yy137:
 		YYDEBUG(137, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(138, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 570 "Zend/zend_ini_scanner.l"
+#line 591 "Zend/zend_ini_scanner.l"
 		{ /* End of option value (if EOF is reached before EOL */
 	BEGIN(INITIAL);
 	return END_OF_LINE;
 }
-#line 1896 "Zend/zend_ini_scanner.c"
+#line 1899 "Zend/zend_ini_scanner.c"
 yy139:
 		YYDEBUG(139, *YYCURSOR);
 		++YYCURSOR;
 		yych = *YYCURSOR;
-		goto yy156;
+		goto yy158;
 yy140:
 		YYDEBUG(140, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 448 "Zend/zend_ini_scanner.l"
+#line 474 "Zend/zend_ini_scanner.l"
 		{ /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
-	/* Eat leading and trailing double quotes */
-	if (yytext[0] == '"' && yytext[yyleng - 1] == '"') {
-		SCNG(yy_text)++;
-		yyleng = yyleng - 2;
-	}
 	RETURN_TOKEN(TC_RAW, yytext, yyleng);
 }
-#line 1914 "Zend/zend_ini_scanner.c"
+#line 1912 "Zend/zend_ini_scanner.c"
 yy141:
 		YYDEBUG(141, *YYCURSOR);
 		yyaccept = 0;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yybm[0+yych] & 64) {
-			goto yy152;
+			goto yy154;
 		}
 		if (yych <= '\f') {
-			if (yych == '\n') goto yy151;
-			goto yy156;
+			if (yych == '\n') goto yy153;
+			goto yy158;
 		} else {
-			if (yych <= '\r') goto yy154;
-			if (yych == ';') goto yy146;
-			goto yy156;
+			if (yych <= '\r') goto yy156;
+			if (yych == ';') goto yy148;
+			goto yy158;
 		}
 yy142:
 		YYDEBUG(142, *YYCURSOR);
@@ -1932,89 +1930,129 @@ yy142:
 yy143:
 		YYDEBUG(143, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 461 "Zend/zend_ini_scanner.l"
+#line 482 "Zend/zend_ini_scanner.l"
 		{ /* End of option value */
 	BEGIN(INITIAL);
 	SCNG(lineno)++;
 	return END_OF_LINE;
 }
-#line 1942 "Zend/zend_ini_scanner.c"
+#line 1940 "Zend/zend_ini_scanner.c"
 yy144:
 		YYDEBUG(144, *YYCURSOR);
 		yych = *++YYCURSOR;
-		if (yych == '\n') goto yy151;
+		if (yych == '\n') goto yy153;
 		goto yy143;
 yy145:
 		YYDEBUG(145, *YYCURSOR);
-		yyaccept = 1;
-		yych = *(YYMARKER = ++YYCURSOR);
-		goto yy147;
-yy146:
-		YYDEBUG(146, *YYCURSOR);
 		++YYCURSOR;
-		YYFILL(2);
-		yych = *YYCURSOR;
+		YYDEBUG(146, *YYCURSOR);
+		yyleng = YYCURSOR - SCNG(yy_text);
+#line 448 "Zend/zend_ini_scanner.l"
+		{
+	while (YYCURSOR < YYLIMIT) {
+		switch (*YYCURSOR++) {
+			case '\n':
+				SCNG(lineno)++;
+				break;
+			case '\r':
+				if (*YYCURSOR != '\n') {
+					SCNG(lineno)++;
+				}
+				break;
+			case '"':
+				yyleng = YYCURSOR - SCNG(yy_text) - 2;
+				SCNG(yy_text)++;
+				RETURN_TOKEN(TC_RAW, yytext, yyleng);
+			case '\\':
+				if (YYCURSOR < YYLIMIT) {
+					YYCURSOR++;
+				}
+				break;
+		}
+	}
+	yyleng = YYCURSOR - SCNG(yy_text);
+	RETURN_TOKEN(TC_RAW, yytext, yyleng);
+}
+#line 1977 "Zend/zend_ini_scanner.c"
 yy147:
 		YYDEBUG(147, *YYCURSOR);
-		if (yybm[0+yych] & 32) {
-			goto yy146;
-		}
-		if (yych >= '\r') goto yy150;
+		yyaccept = 1;
+		yych = *(YYMARKER = ++YYCURSOR);
+		goto yy149;
 yy148:
 		YYDEBUG(148, *YYCURSOR);
 		++YYCURSOR;
+		YYFILL(2);
+		yych = *YYCURSOR;
 yy149:
 		YYDEBUG(149, *YYCURSOR);
+		if (yybm[0+yych] & 32) {
+			goto yy148;
+		}
+		if (yych >= '\r') goto yy152;
+yy150:
+		YYDEBUG(150, *YYCURSOR);
+		++YYCURSOR;
+yy151:
+		YYDEBUG(151, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 557 "Zend/zend_ini_scanner.l"
+#line 578 "Zend/zend_ini_scanner.l"
 		{ /* Comment */
 	BEGIN(INITIAL);
 	SCNG(lineno)++;
 	return END_OF_LINE;
 }
-#line 1976 "Zend/zend_ini_scanner.c"
-yy150:
-		YYDEBUG(150, *YYCURSOR);
+#line 2006 "Zend/zend_ini_scanner.c"
+yy152:
+		YYDEBUG(152, *YYCURSOR);
 		yych = *++YYCURSOR;
-		if (yych == '\n') goto yy148;
-		goto yy149;
-yy151:
-		YYDEBUG(151, *YYCURSOR);
+		if (yych == '\n') goto yy150;
+		goto yy151;
+yy153:
+		YYDEBUG(153, *YYCURSOR);
 		yych = *++YYCURSOR;
 		goto yy143;
-yy152:
-		YYDEBUG(152, *YYCURSOR);
+yy154:
+		YYDEBUG(154, *YYCURSOR);
 		yyaccept = 0;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(2);
 		yych = *YYCURSOR;
-		YYDEBUG(153, *YYCURSOR);
+		YYDEBUG(155, *YYCURSOR);
 		if (yybm[0+yych] & 64) {
-			goto yy152;
+			goto yy154;
 		}
-		if (yych <= '\f') {
-			if (yych <= 0x00) goto yy140;
-			if (yych == '\n') goto yy151;
-			goto yy155;
+		if (yych <= '\r') {
+			if (yych <= '\t') {
+				if (yych <= 0x00) goto yy140;
+				goto yy157;
+			} else {
+				if (yych <= '\n') goto yy153;
+				if (yych <= '\f') goto yy157;
+			}
 		} else {
-			if (yych <= '\r') goto yy154;
-			if (yych == ';') goto yy146;
-			goto yy155;
+			if (yych <= '"') {
+				if (yych <= '!') goto yy157;
+				goto yy140;
+			} else {
+				if (yych == ';') goto yy148;
+				goto yy157;
+			}
 		}
-yy154:
-		YYDEBUG(154, *YYCURSOR);
+yy156:
+		YYDEBUG(156, *YYCURSOR);
 		yych = *++YYCURSOR;
-		if (yych == '\n') goto yy151;
+		if (yych == '\n') goto yy153;
 		goto yy143;
-yy155:
-		YYDEBUG(155, *YYCURSOR);
+yy157:
+		YYDEBUG(157, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-yy156:
-		YYDEBUG(156, *YYCURSOR);
+yy158:
+		YYDEBUG(158, *YYCURSOR);
 		if (yybm[0+yych] & 128) {
-			goto yy155;
+			goto yy157;
 		}
 		goto yy140;
 	}
@@ -2055,44 +2093,44 @@ yyc_ST_SECTION_RAW:
 			128, 128, 128, 128, 128, 128, 128, 128, 
 			128, 128, 128, 128, 128, 128, 128, 128, 
 		};
-		YYDEBUG(157, *YYCURSOR);
+		YYDEBUG(159, *YYCURSOR);
 		YYFILL(3);
 		yych = *YYCURSOR;
 		if (yych <= '\f') {
-			if (yych == '\n') goto yy161;
+			if (yych == '\n') goto yy163;
 		} else {
-			if (yych <= '\r') goto yy161;
-			if (yych == ']') goto yy163;
+			if (yych <= '\r') goto yy163;
+			if (yych == ']') goto yy165;
 		}
-		YYDEBUG(159, *YYCURSOR);
+		YYDEBUG(161, *YYCURSOR);
 		++YYCURSOR;
 		yych = *YYCURSOR;
-		goto yy170;
-yy160:
-		YYDEBUG(160, *YYCURSOR);
+		goto yy172;
+yy162:
+		YYDEBUG(162, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 457 "Zend/zend_ini_scanner.l"
+#line 478 "Zend/zend_ini_scanner.l"
 		{ /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
 	RETURN_TOKEN(TC_RAW, yytext, yyleng);
 }
-#line 2079 "Zend/zend_ini_scanner.c"
-yy161:
-		YYDEBUG(161, *YYCURSOR);
+#line 2117 "Zend/zend_ini_scanner.c"
+yy163:
+		YYDEBUG(163, *YYCURSOR);
 		++YYCURSOR;
-		YYDEBUG(162, *YYCURSOR);
+		YYDEBUG(164, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 575 "Zend/zend_ini_scanner.l"
+#line 596 "Zend/zend_ini_scanner.l"
 		{
 	return 0;
 }
-#line 2089 "Zend/zend_ini_scanner.c"
-yy163:
-		YYDEBUG(163, *YYCURSOR);
+#line 2127 "Zend/zend_ini_scanner.c"
+yy165:
+		YYDEBUG(165, *YYCURSOR);
 		++YYCURSOR;
 		yych = *YYCURSOR;
-		goto yy166;
-yy164:
-		YYDEBUG(164, *YYCURSOR);
+		goto yy168;
+yy166:
+		YYDEBUG(166, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
 #line 377 "Zend/zend_ini_scanner.l"
 		{ /* End of section */
@@ -2100,40 +2138,40 @@ yy164:
 	SCNG(lineno)++;
 	return ']';
 }
-#line 2104 "Zend/zend_ini_scanner.c"
-yy165:
-		YYDEBUG(165, *YYCURSOR);
+#line 2142 "Zend/zend_ini_scanner.c"
+yy167:
+		YYDEBUG(167, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(2);
 		yych = *YYCURSOR;
-yy166:
-		YYDEBUG(166, *YYCURSOR);
-		if (yybm[0+yych] & 64) {
-			goto yy165;
-		}
-		if (yych == '\n') goto yy167;
-		if (yych == '\r') goto yy168;
-		goto yy164;
-yy167:
-		YYDEBUG(167, *YYCURSOR);
-		yych = *++YYCURSOR;
-		goto yy164;
 yy168:
 		YYDEBUG(168, *YYCURSOR);
-		yych = *++YYCURSOR;
-		if (yych == '\n') goto yy167;
-		goto yy164;
+		if (yybm[0+yych] & 64) {
+			goto yy167;
+		}
+		if (yych == '\n') goto yy169;
+		if (yych == '\r') goto yy170;
+		goto yy166;
 yy169:
 		YYDEBUG(169, *YYCURSOR);
+		yych = *++YYCURSOR;
+		goto yy166;
+yy170:
+		YYDEBUG(170, *YYCURSOR);
+		yych = *++YYCURSOR;
+		if (yych == '\n') goto yy169;
+		goto yy166;
+yy171:
+		YYDEBUG(171, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-yy170:
-		YYDEBUG(170, *YYCURSOR);
+yy172:
+		YYDEBUG(172, *YYCURSOR);
 		if (yybm[0+yych] & 128) {
-			goto yy169;
+			goto yy171;
 		}
-		goto yy160;
+		goto yy162;
 	}
 /* *********************************** */
 yyc_ST_SECTION_VALUE:
@@ -2172,203 +2210,203 @@ yyc_ST_SECTION_VALUE:
 			132, 132, 132, 132, 132, 132, 132, 132, 
 			132, 132, 132, 132, 132, 132, 132, 132, 
 		};
-		YYDEBUG(171, *YYCURSOR);
+		YYDEBUG(173, *YYCURSOR);
 		YYFILL(3);
 		yych = *YYCURSOR;
 		if (yych <= '-') {
 			if (yych <= ' ') {
 				if (yych <= '\n') {
-					if (yych <= 0x08) goto yy173;
-					if (yych <= '\t') goto yy175;
-					goto yy176;
+					if (yych <= 0x08) goto yy175;
+					if (yych <= '\t') goto yy177;
+					goto yy178;
 				} else {
-					if (yych == '\r') goto yy176;
-					if (yych >= ' ') goto yy175;
+					if (yych == '\r') goto yy178;
+					if (yych >= ' ') goto yy177;
 				}
 			} else {
 				if (yych <= '$') {
-					if (yych == '"') goto yy178;
-					if (yych >= '$') goto yy180;
+					if (yych == '"') goto yy180;
+					if (yych >= '$') goto yy182;
 				} else {
-					if (yych == '\'') goto yy181;
-					if (yych >= '-') goto yy182;
+					if (yych == '\'') goto yy183;
+					if (yych >= '-') goto yy184;
 				}
 			}
 		} else {
 			if (yych <= 'Z') {
 				if (yych <= '9') {
-					if (yych <= '.') goto yy183;
-					if (yych >= '0') goto yy184;
+					if (yych <= '.') goto yy185;
+					if (yych >= '0') goto yy186;
 				} else {
-					if (yych == ';') goto yy176;
-					if (yych >= 'A') goto yy186;
+					if (yych == ';') goto yy178;
+					if (yych >= 'A') goto yy188;
 				}
 			} else {
 				if (yych <= '^') {
-					if (yych <= '[') goto yy173;
-					if (yych <= '\\') goto yy188;
-					if (yych <= ']') goto yy189;
+					if (yych <= '[') goto yy175;
+					if (yych <= '\\') goto yy190;
+					if (yych <= ']') goto yy191;
 				} else {
-					if (yych == '`') goto yy173;
-					if (yych <= 'z') goto yy186;
+					if (yych == '`') goto yy175;
+					if (yych <= 'z') goto yy188;
 				}
 			}
 		}
-yy173:
-		YYDEBUG(173, *YYCURSOR);
+yy175:
+		YYDEBUG(175, *YYCURSOR);
 		yyaccept = 0;
 		yych = *(YYMARKER = ++YYCURSOR);
-		goto yy196;
-yy174:
-		YYDEBUG(174, *YYCURSOR);
+		goto yy198;
+yy176:
+		YYDEBUG(176, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 493 "Zend/zend_ini_scanner.l"
+#line 514 "Zend/zend_ini_scanner.l"
 		{ /* Get rest as section/offset value */
 	RETURN_TOKEN(TC_STRING, yytext, yyleng);
 }
-#line 2230 "Zend/zend_ini_scanner.c"
-yy175:
-		YYDEBUG(175, *YYCURSOR);
+#line 2268 "Zend/zend_ini_scanner.c"
+yy177:
+		YYDEBUG(177, *YYCURSOR);
 		yyaccept = 0;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= 0x1F) {
-			if (yych == '\t') goto yy222;
-			goto yy196;
+			if (yych == '\t') goto yy224;
+			goto yy198;
 		} else {
-			if (yych <= ' ') goto yy222;
-			if (yych == '"') goto yy224;
-			goto yy196;
+			if (yych <= ' ') goto yy224;
+			if (yych == '"') goto yy226;
+			goto yy198;
 		}
-yy176:
-		YYDEBUG(176, *YYCURSOR);
+yy178:
+		YYDEBUG(178, *YYCURSOR);
 		++YYCURSOR;
-yy177:
-		YYDEBUG(177, *YYCURSOR);
+yy179:
+		YYDEBUG(179, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 575 "Zend/zend_ini_scanner.l"
+#line 596 "Zend/zend_ini_scanner.l"
 		{
 	return 0;
 }
-#line 2253 "Zend/zend_ini_scanner.c"
-yy178:
-		YYDEBUG(178, *YYCURSOR);
+#line 2291 "Zend/zend_ini_scanner.c"
+yy180:
+		YYDEBUG(180, *YYCURSOR);
 		++YYCURSOR;
-yy179:
-		YYDEBUG(179, *YYCURSOR);
+yy181:
+		YYDEBUG(181, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 497 "Zend/zend_ini_scanner.l"
+#line 518 "Zend/zend_ini_scanner.l"
 		{ /* Double quoted '"' string start */
 	yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC);
 	return '"';
 }
-#line 2265 "Zend/zend_ini_scanner.c"
-yy180:
-		YYDEBUG(180, *YYCURSOR);
+#line 2303 "Zend/zend_ini_scanner.c"
+yy182:
+		YYDEBUG(182, *YYCURSOR);
 		yych = *++YYCURSOR;
 		if (yych <= '\\') {
-			if (yych <= 0x00) goto yy177;
-			if (yych <= '[') goto yy195;
-			goto yy200;
+			if (yych <= 0x00) goto yy179;
+			if (yych <= '[') goto yy197;
+			goto yy202;
 		} else {
-			if (yych == '{') goto yy220;
-			goto yy195;
+			if (yych == '{') goto yy222;
+			goto yy197;
 		}
-yy181:
-		YYDEBUG(181, *YYCURSOR);
+yy183:
+		YYDEBUG(183, *YYCURSOR);
 		yyaccept = 1;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yybm[0+yych] & 128) {
-			goto yy216;
+			goto yy218;
 		}
-		goto yy177;
-yy182:
-		YYDEBUG(182, *YYCURSOR);
+		goto yy179;
+yy184:
+		YYDEBUG(184, *YYCURSOR);
 		yyaccept = 0;
 		yych = *(YYMARKER = ++YYCURSOR);
-		if (yych <= '/') goto yy196;
-		if (yych <= '9') goto yy214;
-		goto yy196;
-yy183:
-		YYDEBUG(183, *YYCURSOR);
+		if (yych <= '/') goto yy198;
+		if (yych <= '9') goto yy216;
+		goto yy198;
+yy185:
+		YYDEBUG(185, *YYCURSOR);
 		yyaccept = 0;
 		yych = *(YYMARKER = ++YYCURSOR);
-		if (yych <= '/') goto yy196;
-		if (yych <= '9') goto yy212;
-		goto yy196;
-yy184:
-		YYDEBUG(184, *YYCURSOR);
+		if (yych <= '/') goto yy198;
+		if (yych <= '9') goto yy214;
+		goto yy198;
+yy186:
+		YYDEBUG(186, *YYCURSOR);
 		yyaccept = 2;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '\'') {
 			if (yych <= '\r') {
-				if (yych == '\n') goto yy185;
-				if (yych <= '\f') goto yy196;
+				if (yych == '\n') goto yy187;
+				if (yych <= '\f') goto yy198;
 			} else {
-				if (yych == '"') goto yy185;
-				if (yych <= '&') goto yy196;
+				if (yych == '"') goto yy187;
+				if (yych <= '&') goto yy198;
 			}
 		} else {
 			if (yych <= '9') {
-				if (yych == '.') goto yy208;
-				if (yych <= '/') goto yy196;
-				goto yy210;
+				if (yych == '.') goto yy210;
+				if (yych <= '/') goto yy198;
+				goto yy212;
 			} else {
 				if (yych <= ';') {
-					if (yych <= ':') goto yy196;
+					if (yych <= ':') goto yy198;
 				} else {
-					if (yych != ']') goto yy196;
+					if (yych != ']') goto yy198;
 				}
 			}
 		}
-yy185:
-		YYDEBUG(185, *YYCURSOR);
+yy187:
+		YYDEBUG(187, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 471 "Zend/zend_ini_scanner.l"
+#line 492 "Zend/zend_ini_scanner.l"
 		{ /* Get number option value as string */
 	RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
 }
-#line 2331 "Zend/zend_ini_scanner.c"
-yy186:
-		YYDEBUG(186, *YYCURSOR);
+#line 2369 "Zend/zend_ini_scanner.c"
+yy188:
+		YYDEBUG(188, *YYCURSOR);
 		yyaccept = 3;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yybm[0+yych] & 32) {
-			goto yy206;
+			goto yy208;
 		}
 		if (yych <= '"') {
 			if (yych <= '\f') {
-				if (yych != '\n') goto yy196;
+				if (yych != '\n') goto yy198;
 			} else {
-				if (yych <= '\r') goto yy187;
-				if (yych <= '!') goto yy196;
+				if (yych <= '\r') goto yy189;
+				if (yych <= '!') goto yy198;
 			}
 		} else {
 			if (yych <= ':') {
-				if (yych != '\'') goto yy196;
+				if (yych != '\'') goto yy198;
 			} else {
-				if (yych <= ';') goto yy187;
-				if (yych != ']') goto yy196;
+				if (yych <= ';') goto yy189;
+				if (yych != ']') goto yy198;
 			}
 		}
-yy187:
-		YYDEBUG(187, *YYCURSOR);
+yy189:
+		YYDEBUG(189, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 467 "Zend/zend_ini_scanner.l"
+#line 488 "Zend/zend_ini_scanner.l"
 		{ /* Get constant option value */
 	RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
 }
-#line 2361 "Zend/zend_ini_scanner.c"
-yy188:
-		YYDEBUG(188, *YYCURSOR);
+#line 2399 "Zend/zend_ini_scanner.c"
+yy190:
+		YYDEBUG(190, *YYCURSOR);
 		yych = *++YYCURSOR;
-		goto yy195;
-yy189:
-		YYDEBUG(189, *YYCURSOR);
+		goto yy197;
+yy191:
+		YYDEBUG(191, *YYCURSOR);
 		++YYCURSOR;
 		yych = *YYCURSOR;
-		goto yy192;
-yy190:
-		YYDEBUG(190, *YYCURSOR);
+		goto yy194;
+yy192:
+		YYDEBUG(192, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
 #line 377 "Zend/zend_ini_scanner.l"
 		{ /* End of section */
@@ -2376,97 +2414,86 @@ yy190:
 	SCNG(lineno)++;
 	return ']';
 }
-#line 2380 "Zend/zend_ini_scanner.c"
-yy191:
-		YYDEBUG(191, *YYCURSOR);
+#line 2418 "Zend/zend_ini_scanner.c"
+yy193:
+		YYDEBUG(193, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(2);
 		yych = *YYCURSOR;
-yy192:
-		YYDEBUG(192, *YYCURSOR);
-		if (yybm[0+yych] & 2) {
-			goto yy191;
-		}
-		if (yych == '\n') goto yy193;
-		if (yych == '\r') goto yy194;
-		goto yy190;
-yy193:
-		YYDEBUG(193, *YYCURSOR);
-		yych = *++YYCURSOR;
-		goto yy190;
 yy194:
 		YYDEBUG(194, *YYCURSOR);
-		yych = *++YYCURSOR;
-		if (yych == '\n') goto yy193;
-		goto yy190;
+		if (yybm[0+yych] & 2) {
+			goto yy193;
+		}
+		if (yych == '\n') goto yy195;
+		if (yych == '\r') goto yy196;
+		goto yy192;
 yy195:
 		YYDEBUG(195, *YYCURSOR);
+		yych = *++YYCURSOR;
+		goto yy192;
+yy196:
+		YYDEBUG(196, *YYCURSOR);
+		yych = *++YYCURSOR;
+		if (yych == '\n') goto yy195;
+		goto yy192;
+yy197:
+		YYDEBUG(197, *YYCURSOR);
 		yyaccept = 0;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-yy196:
-		YYDEBUG(196, *YYCURSOR);
+yy198:
+		YYDEBUG(198, *YYCURSOR);
 		if (yybm[0+yych] & 4) {
-			goto yy195;
+			goto yy197;
 		}
-		if (yych == '$') goto yy198;
-		if (yych != '\\') goto yy174;
-yy197:
-		YYDEBUG(197, *YYCURSOR);
+		if (yych == '$') goto yy200;
+		if (yych != '\\') goto yy176;
+yy199:
+		YYDEBUG(199, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		goto yy195;
-yy198:
-		YYDEBUG(198, *YYCURSOR);
+		goto yy197;
+yy200:
+		YYDEBUG(200, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
 		if (yych <= '\\') {
-			if (yych <= 0x00) goto yy199;
-			if (yych <= '[') goto yy195;
-			goto yy200;
+			if (yych <= 0x00) goto yy201;
+			if (yych <= '[') goto yy197;
+			goto yy202;
 		} else {
-			if (yych != '{') goto yy195;
+			if (yych != '{') goto yy197;
 		}
-yy199:
-		YYDEBUG(199, *YYCURSOR);
+yy201:
+		YYDEBUG(201, *YYCURSOR);
 		YYCURSOR = YYMARKER;
 		if (yyaccept <= 1) {
 			if (yyaccept <= 0) {
-				goto yy174;
+				goto yy176;
 			} else {
-				goto yy177;
+				goto yy179;
 			}
 		} else {
 			if (yyaccept <= 2) {
-				goto yy185;
-			} else {
 				goto yy187;
+			} else {
+				goto yy189;
 			}
 		}
-yy200:
-		YYDEBUG(200, *YYCURSOR);
+yy202:
+		YYDEBUG(202, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
 		if (yybm[0+yych] & 8) {
-			goto yy201;
-		}
-		if (yych == '\\') goto yy203;
-		goto yy195;
-yy201:
-		YYDEBUG(201, *YYCURSOR);
-		++YYCURSOR;
-		YYFILL(1);
-		yych = *YYCURSOR;
-		YYDEBUG(202, *YYCURSOR);
-		if (yybm[0+yych] & 8) {
-			goto yy201;
+			goto yy203;
 		}
 		if (yych == '\\') goto yy205;
-		goto yy195;
+		goto yy197;
 yy203:
 		YYDEBUG(203, *YYCURSOR);
 		++YYCURSOR;
@@ -2474,219 +2501,230 @@ yy203:
 		yych = *YYCURSOR;
 		YYDEBUG(204, *YYCURSOR);
 		if (yybm[0+yych] & 8) {
-			goto yy201;
+			goto yy203;
 		}
-		if (yych == '\\') goto yy203;
-		goto yy195;
+		if (yych == '\\') goto yy207;
+		goto yy197;
 yy205:
 		YYDEBUG(205, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
+		YYDEBUG(206, *YYCURSOR);
 		if (yybm[0+yych] & 8) {
-			goto yy201;
+			goto yy203;
 		}
-		if (yych == '\\') goto yy203;
-		goto yy195;
-yy206:
-		YYDEBUG(206, *YYCURSOR);
+		if (yych == '\\') goto yy205;
+		goto yy197;
+yy207:
+		YYDEBUG(207, *YYCURSOR);
+		++YYCURSOR;
+		YYFILL(1);
+		yych = *YYCURSOR;
+		if (yybm[0+yych] & 8) {
+			goto yy203;
+		}
+		if (yych == '\\') goto yy205;
+		goto yy197;
+yy208:
+		YYDEBUG(208, *YYCURSOR);
 		yyaccept = 3;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(207, *YYCURSOR);
+		YYDEBUG(209, *YYCURSOR);
 		if (yybm[0+yych] & 32) {
-			goto yy206;
+			goto yy208;
 		}
 		if (yych <= '$') {
 			if (yych <= '\r') {
-				if (yych == '\n') goto yy187;
-				if (yych <= '\f') goto yy195;
-				goto yy187;
+				if (yych == '\n') goto yy189;
+				if (yych <= '\f') goto yy197;
+				goto yy189;
 			} else {
-				if (yych == '"') goto yy187;
-				if (yych <= '#') goto yy195;
-				goto yy198;
+				if (yych == '"') goto yy189;
+				if (yych <= '#') goto yy197;
+				goto yy200;
 			}
 		} else {
 			if (yych <= ';') {
-				if (yych == '\'') goto yy187;
-				if (yych <= ':') goto yy195;
-				goto yy187;
+				if (yych == '\'') goto yy189;
+				if (yych <= ':') goto yy197;
+				goto yy189;
 			} else {
-				if (yych <= '[') goto yy195;
-				if (yych <= '\\') goto yy197;
-				if (yych <= ']') goto yy187;
-				goto yy195;
+				if (yych <= '[') goto yy197;
+				if (yych <= '\\') goto yy199;
+				if (yych <= ']') goto yy189;
+				goto yy197;
 			}
 		}
-yy208:
-		YYDEBUG(208, *YYCURSOR);
+yy210:
+		YYDEBUG(210, *YYCURSOR);
 		yyaccept = 2;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(209, *YYCURSOR);
+		YYDEBUG(211, *YYCURSOR);
 		if (yybm[0+yych] & 64) {
-			goto yy208;
+			goto yy210;
 		}
 		if (yych <= '$') {
 			if (yych <= '\r') {
-				if (yych == '\n') goto yy185;
-				if (yych <= '\f') goto yy195;
-				goto yy185;
+				if (yych == '\n') goto yy187;
+				if (yych <= '\f') goto yy197;
+				goto yy187;
 			} else {
-				if (yych == '"') goto yy185;
-				if (yych <= '#') goto yy195;
-				goto yy198;
+				if (yych == '"') goto yy187;
+				if (yych <= '#') goto yy197;
+				goto yy200;
 			}
 		} else {
 			if (yych <= ';') {
-				if (yych == '\'') goto yy185;
-				if (yych <= ':') goto yy195;
-				goto yy185;
+				if (yych == '\'') goto yy187;
+				if (yych <= ':') goto yy197;
+				goto yy187;
 			} else {
-				if (yych <= '[') goto yy195;
-				if (yych <= '\\') goto yy197;
-				if (yych <= ']') goto yy185;
-				goto yy195;
+				if (yych <= '[') goto yy197;
+				if (yych <= '\\') goto yy199;
+				if (yych <= ']') goto yy187;
+				goto yy197;
 			}
 		}
-yy210:
-		YYDEBUG(210, *YYCURSOR);
+yy212:
+		YYDEBUG(212, *YYCURSOR);
 		yyaccept = 2;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(211, *YYCURSOR);
+		YYDEBUG(213, *YYCURSOR);
 		if (yych <= '\'') {
 			if (yych <= '!') {
 				if (yych <= '\n') {
-					if (yych <= '\t') goto yy195;
-					goto yy185;
+					if (yych <= '\t') goto yy197;
+					goto yy187;
 				} else {
-					if (yych == '\r') goto yy185;
-					goto yy195;
+					if (yych == '\r') goto yy187;
+					goto yy197;
 				}
 			} else {
 				if (yych <= '#') {
-					if (yych <= '"') goto yy185;
-					goto yy195;
+					if (yych <= '"') goto yy187;
+					goto yy197;
 				} else {
-					if (yych <= '$') goto yy198;
-					if (yych <= '&') goto yy195;
-					goto yy185;
+					if (yych <= '$') goto yy200;
+					if (yych <= '&') goto yy197;
+					goto yy187;
 				}
 			}
 		} else {
 			if (yych <= ':') {
 				if (yych <= '.') {
-					if (yych <= '-') goto yy195;
-					goto yy208;
+					if (yych <= '-') goto yy197;
+					goto yy210;
 				} else {
-					if (yych <= '/') goto yy195;
-					if (yych <= '9') goto yy210;
-					goto yy195;
+					if (yych <= '/') goto yy197;
+					if (yych <= '9') goto yy212;
+					goto yy197;
 				}
 			} else {
 				if (yych <= '[') {
-					if (yych <= ';') goto yy185;
-					goto yy195;
+					if (yych <= ';') goto yy187;
+					goto yy197;
 				} else {
-					if (yych <= '\\') goto yy197;
-					if (yych <= ']') goto yy185;
-					goto yy195;
+					if (yych <= '\\') goto yy199;
+					if (yych <= ']') goto yy187;
+					goto yy197;
 				}
 			}
 		}
-yy212:
-		YYDEBUG(212, *YYCURSOR);
+yy214:
+		YYDEBUG(214, *YYCURSOR);
 		yyaccept = 2;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(213, *YYCURSOR);
+		YYDEBUG(215, *YYCURSOR);
 		if (yych <= '&') {
 			if (yych <= '\r') {
-				if (yych == '\n') goto yy185;
-				if (yych <= '\f') goto yy195;
-				goto yy185;
+				if (yych == '\n') goto yy187;
+				if (yych <= '\f') goto yy197;
+				goto yy187;
 			} else {
 				if (yych <= '"') {
-					if (yych <= '!') goto yy195;
-					goto yy185;
+					if (yych <= '!') goto yy197;
+					goto yy187;
 				} else {
-					if (yych == '$') goto yy198;
-					goto yy195;
+					if (yych == '$') goto yy200;
+					goto yy197;
 				}
 			}
 		} else {
 			if (yych <= ':') {
-				if (yych <= '\'') goto yy185;
-				if (yych <= '/') goto yy195;
-				if (yych <= '9') goto yy212;
-				goto yy195;
+				if (yych <= '\'') goto yy187;
+				if (yych <= '/') goto yy197;
+				if (yych <= '9') goto yy214;
+				goto yy197;
 			} else {
 				if (yych <= '[') {
-					if (yych <= ';') goto yy185;
-					goto yy195;
+					if (yych <= ';') goto yy187;
+					goto yy197;
 				} else {
-					if (yych <= '\\') goto yy197;
-					if (yych <= ']') goto yy185;
-					goto yy195;
+					if (yych <= '\\') goto yy199;
+					if (yych <= ']') goto yy187;
+					goto yy197;
 				}
 			}
 		}
-yy214:
-		YYDEBUG(214, *YYCURSOR);
+yy216:
+		YYDEBUG(216, *YYCURSOR);
 		yyaccept = 2;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(215, *YYCURSOR);
+		YYDEBUG(217, *YYCURSOR);
 		if (yych <= '&') {
 			if (yych <= '\r') {
-				if (yych == '\n') goto yy185;
-				if (yych <= '\f') goto yy195;
-				goto yy185;
+				if (yych == '\n') goto yy187;
+				if (yych <= '\f') goto yy197;
+				goto yy187;
 			} else {
 				if (yych <= '"') {
-					if (yych <= '!') goto yy195;
-					goto yy185;
+					if (yych <= '!') goto yy197;
+					goto yy187;
 				} else {
-					if (yych == '$') goto yy198;
-					goto yy195;
+					if (yych == '$') goto yy200;
+					goto yy197;
 				}
 			}
 		} else {
 			if (yych <= ':') {
-				if (yych <= '\'') goto yy185;
-				if (yych <= '/') goto yy195;
-				if (yych <= '9') goto yy214;
-				goto yy195;
+				if (yych <= '\'') goto yy187;
+				if (yych <= '/') goto yy197;
+				if (yych <= '9') goto yy216;
+				goto yy197;
 			} else {
 				if (yych <= '[') {
-					if (yych <= ';') goto yy185;
-					goto yy195;
+					if (yych <= ';') goto yy187;
+					goto yy197;
 				} else {
-					if (yych <= '\\') goto yy197;
-					if (yych <= ']') goto yy185;
-					goto yy195;
+					if (yych <= '\\') goto yy199;
+					if (yych <= ']') goto yy187;
+					goto yy197;
 				}
 			}
 		}
-yy216:
-		YYDEBUG(216, *YYCURSOR);
+yy218:
+		YYDEBUG(218, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(217, *YYCURSOR);
+		YYDEBUG(219, *YYCURSOR);
 		if (yybm[0+yych] & 128) {
-			goto yy216;
+			goto yy218;
 		}
-		YYDEBUG(218, *YYCURSOR);
+		YYDEBUG(220, *YYCURSOR);
 		++YYCURSOR;
-		YYDEBUG(219, *YYCURSOR);
+		YYDEBUG(221, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
 #line 368 "Zend/zend_ini_scanner.l"
 		{ /* Raw string */
@@ -2697,65 +2735,65 @@ yy216:
 	}
 	RETURN_TOKEN(TC_RAW, yytext, yyleng);
 }
-#line 2701 "Zend/zend_ini_scanner.c"
-yy220:
-		YYDEBUG(220, *YYCURSOR);
+#line 2739 "Zend/zend_ini_scanner.c"
+yy222:
+		YYDEBUG(222, *YYCURSOR);
 		++YYCURSOR;
-		YYDEBUG(221, *YYCURSOR);
+		YYDEBUG(223, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
 #line 401 "Zend/zend_ini_scanner.l"
 		{ /* Variable start */
 	yy_push_state(ST_VARNAME TSRMLS_CC);
 	return TC_DOLLAR_CURLY;
 }
-#line 2712 "Zend/zend_ini_scanner.c"
-yy222:
-		YYDEBUG(222, *YYCURSOR);
+#line 2750 "Zend/zend_ini_scanner.c"
+yy224:
+		YYDEBUG(224, *YYCURSOR);
 		yyaccept = 0;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(223, *YYCURSOR);
+		YYDEBUG(225, *YYCURSOR);
 		if (yych <= '"') {
 			if (yych <= '\f') {
-				if (yych <= 0x08) goto yy195;
-				if (yych <= '\t') goto yy222;
-				if (yych <= '\n') goto yy174;
-				goto yy195;
+				if (yych <= 0x08) goto yy197;
+				if (yych <= '\t') goto yy224;
+				if (yych <= '\n') goto yy176;
+				goto yy197;
 			} else {
 				if (yych <= 0x1F) {
-					if (yych <= '\r') goto yy174;
-					goto yy195;
+					if (yych <= '\r') goto yy176;
+					goto yy197;
 				} else {
-					if (yych <= ' ') goto yy222;
-					if (yych <= '!') goto yy195;
+					if (yych <= ' ') goto yy224;
+					if (yych <= '!') goto yy197;
 				}
 			}
 		} else {
 			if (yych <= ':') {
 				if (yych <= '$') {
-					if (yych <= '#') goto yy195;
-					goto yy198;
+					if (yych <= '#') goto yy197;
+					goto yy200;
 				} else {
-					if (yych == '\'') goto yy174;
-					goto yy195;
+					if (yych == '\'') goto yy176;
+					goto yy197;
 				}
 			} else {
 				if (yych <= '[') {
-					if (yych <= ';') goto yy174;
-					goto yy195;
+					if (yych <= ';') goto yy176;
+					goto yy197;
 				} else {
-					if (yych <= '\\') goto yy197;
-					if (yych <= ']') goto yy174;
-					goto yy195;
+					if (yych <= '\\') goto yy199;
+					if (yych <= ']') goto yy176;
+					goto yy197;
 				}
 			}
 		}
-yy224:
-		YYDEBUG(224, *YYCURSOR);
+yy226:
+		YYDEBUG(226, *YYCURSOR);
 		++YYCURSOR;
 		yych = *YYCURSOR;
-		goto yy179;
+		goto yy181;
 	}
 /* *********************************** */
 yyc_ST_VALUE:
@@ -2794,27 +2832,27 @@ yyc_ST_VALUE:
 			162, 162, 162, 162, 162, 162, 162, 162, 
 			162, 162, 162, 162, 162, 162, 162, 162, 
 		};
-		YYDEBUG(225, *YYCURSOR);
+		YYDEBUG(227, *YYCURSOR);
 		YYFILL(6);
 		yych = *YYCURSOR;
 		YYDEBUG(-1, yych);
 		switch (yych) {
-		case 0x00:	goto yy227;
+		case 0x00:	goto yy229;
 		case '\t':
-		case ' ':	goto yy231;
-		case '\n':	goto yy233;
-		case '\r':	goto yy235;
+		case ' ':	goto yy233;
+		case '\n':	goto yy235;
+		case '\r':	goto yy237;
 		case '!':
 		case '&':
 		case '(':
 		case ')':
 		case '|':
-		case '~':	goto yy236;
-		case '"':	goto yy238;
-		case '$':	goto yy240;
-		case '\'':	goto yy241;
-		case '-':	goto yy242;
-		case '.':	goto yy243;
+		case '~':	goto yy238;
+		case '"':	goto yy240;
+		case '$':	goto yy242;
+		case '\'':	goto yy243;
+		case '-':	goto yy244;
+		case '.':	goto yy245;
 		case '0':
 		case '1':
 		case '2':
@@ -2824,9 +2862,9 @@ yyc_ST_VALUE:
 		case '6':
 		case '7':
 		case '8':
-		case '9':	goto yy244;
-		case ';':	goto yy246;
-		case '=':	goto yy247;
+		case '9':	goto yy246;
+		case ';':	goto yy248;
+		case '=':	goto yy249;
 		case 'A':
 		case 'B':
 		case 'C':
@@ -2869,1529 +2907,1529 @@ yyc_ST_VALUE:
 		case 'v':
 		case 'w':
 		case 'x':
-		case 'z':	goto yy249;
+		case 'z':	goto yy251;
 		case 'F':
-		case 'f':	goto yy251;
+		case 'f':	goto yy253;
 		case 'N':
-		case 'n':	goto yy252;
+		case 'n':	goto yy254;
 		case 'O':
-		case 'o':	goto yy253;
+		case 'o':	goto yy255;
 		case 'T':
-		case 't':	goto yy254;
+		case 't':	goto yy256;
 		case 'Y':
-		case 'y':	goto yy255;
-		default:	goto yy229;
+		case 'y':	goto yy257;
+		default:	goto yy231;
 		}
-yy227:
-		YYDEBUG(227, *YYCURSOR);
+yy229:
+		YYDEBUG(229, *YYCURSOR);
 		++YYCURSOR;
-yy228:
-		YYDEBUG(228, *YYCURSOR);
+yy230:
+		YYDEBUG(230, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 570 "Zend/zend_ini_scanner.l"
+#line 591 "Zend/zend_ini_scanner.l"
 		{ /* End of option value (if EOF is reached before EOL */
 	BEGIN(INITIAL);
 	return END_OF_LINE;
 }
-#line 2897 "Zend/zend_ini_scanner.c"
-yy229:
-		YYDEBUG(229, *YYCURSOR);
+#line 2935 "Zend/zend_ini_scanner.c"
+yy231:
+		YYDEBUG(231, *YYCURSOR);
 		yyaccept = 0;
 		yych = *(YYMARKER = ++YYCURSOR);
-		goto yy257;
-yy230:
-		YYDEBUG(230, *YYCURSOR);
+		goto yy259;
+yy232:
+		YYDEBUG(232, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 489 "Zend/zend_ini_scanner.l"
+#line 510 "Zend/zend_ini_scanner.l"
 		{ /* Get everything else as option/offset value */
 	RETURN_TOKEN(TC_STRING, yytext, yyleng);
 }
-#line 2910 "Zend/zend_ini_scanner.c"
-yy231:
-		YYDEBUG(231, *YYCURSOR);
+#line 2948 "Zend/zend_ini_scanner.c"
+yy233:
+		YYDEBUG(233, *YYCURSOR);
 		yyaccept = 1;
 		yych = *(YYMARKER = ++YYCURSOR);
-		goto yy307;
-yy232:
-		YYDEBUG(232, *YYCURSOR);
+		goto yy309;
+yy234:
+		YYDEBUG(234, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 543 "Zend/zend_ini_scanner.l"
+#line 564 "Zend/zend_ini_scanner.l"
 		{
 	RETURN_TOKEN(TC_WHITESPACE, yytext, yyleng);
 }
-#line 2923 "Zend/zend_ini_scanner.c"
-yy233:
-		YYDEBUG(233, *YYCURSOR);
+#line 2961 "Zend/zend_ini_scanner.c"
+yy235:
+		YYDEBUG(235, *YYCURSOR);
 		++YYCURSOR;
-yy234:
-		YYDEBUG(234, *YYCURSOR);
+yy236:
+		YYDEBUG(236, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 461 "Zend/zend_ini_scanner.l"
+#line 482 "Zend/zend_ini_scanner.l"
 		{ /* End of option value */
 	BEGIN(INITIAL);
 	SCNG(lineno)++;
 	return END_OF_LINE;
 }
-#line 2936 "Zend/zend_ini_scanner.c"
-yy235:
-		YYDEBUG(235, *YYCURSOR);
+#line 2974 "Zend/zend_ini_scanner.c"
+yy237:
+		YYDEBUG(237, *YYCURSOR);
 		yych = *++YYCURSOR;
-		if (yych == '\n') goto yy305;
-		goto yy234;
-yy236:
-		YYDEBUG(236, *YYCURSOR);
+		if (yych == '\n') goto yy307;
+		goto yy236;
+yy238:
+		YYDEBUG(238, *YYCURSOR);
 		++YYCURSOR;
 		yych = *YYCURSOR;
-		goto yy304;
-yy237:
-		YYDEBUG(237, *YYCURSOR);
+		goto yy306;
+yy239:
+		YYDEBUG(239, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 479 "Zend/zend_ini_scanner.l"
+#line 500 "Zend/zend_ini_scanner.l"
 		{ /* Boolean operators */
 	return yytext[0];
 }
-#line 2954 "Zend/zend_ini_scanner.c"
-yy238:
-		YYDEBUG(238, *YYCURSOR);
+#line 2992 "Zend/zend_ini_scanner.c"
+yy240:
+		YYDEBUG(240, *YYCURSOR);
 		++YYCURSOR;
-yy239:
-		YYDEBUG(239, *YYCURSOR);
+yy241:
+		YYDEBUG(241, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 497 "Zend/zend_ini_scanner.l"
+#line 518 "Zend/zend_ini_scanner.l"
 		{ /* Double quoted '"' string start */
 	yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC);
 	return '"';
 }
-#line 2966 "Zend/zend_ini_scanner.c"
-yy240:
-		YYDEBUG(240, *YYCURSOR);
+#line 3004 "Zend/zend_ini_scanner.c"
+yy242:
+		YYDEBUG(242, *YYCURSOR);
 		yych = *++YYCURSOR;
 		if (yych <= '\\') {
-			if (yych <= 0x00) goto yy228;
-			if (yych <= '[') goto yy256;
-			goto yy263;
+			if (yych <= 0x00) goto yy230;
+			if (yych <= '[') goto yy258;
+			goto yy265;
 		} else {
-			if (yych == '{') goto yy301;
-			goto yy256;
+			if (yych == '{') goto yy303;
+			goto yy258;
 		}
-yy241:
-		YYDEBUG(241, *YYCURSOR);
+yy243:
+		YYDEBUG(243, *YYCURSOR);
 		yyaccept = 2;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yybm[0+yych] & 128) {
-			goto yy297;
+			goto yy299;
 		}
-		goto yy228;
-yy242:
-		YYDEBUG(242, *YYCURSOR);
+		goto yy230;
+yy244:
+		YYDEBUG(244, *YYCURSOR);
 		yyaccept = 0;
 		yych = *(YYMARKER = ++YYCURSOR);
-		if (yych <= '/') goto yy257;
-		if (yych <= '9') goto yy295;
-		goto yy257;
-yy243:
-		YYDEBUG(243, *YYCURSOR);
+		if (yych <= '/') goto yy259;
+		if (yych <= '9') goto yy297;
+		goto yy259;
+yy245:
+		YYDEBUG(245, *YYCURSOR);
 		yyaccept = 0;
 		yych = *(YYMARKER = ++YYCURSOR);
-		if (yych <= '/') goto yy257;
-		if (yych <= '9') goto yy293;
-		goto yy257;
-yy244:
-		YYDEBUG(244, *YYCURSOR);
+		if (yych <= '/') goto yy259;
+		if (yych <= '9') goto yy295;
+		goto yy259;
+yy246:
+		YYDEBUG(246, *YYCURSOR);
 		yyaccept = 3;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '.') {
 			if (yych <= '\r') {
 				if (yych <= 0x08) {
-					if (yych >= 0x01) goto yy257;
+					if (yych >= 0x01) goto yy259;
 				} else {
-					if (yych <= '\n') goto yy245;
-					if (yych <= '\f') goto yy257;
+					if (yych <= '\n') goto yy247;
+					if (yych <= '\f') goto yy259;
 				}
 			} else {
 				if (yych <= '%') {
-					if (yych <= 0x1F) goto yy257;
-					if (yych >= '#') goto yy257;
+					if (yych <= 0x1F) goto yy259;
+					if (yych >= '#') goto yy259;
 				} else {
-					if (yych <= ')') goto yy245;
-					if (yych <= '-') goto yy257;
-					goto yy289;
+					if (yych <= ')') goto yy247;
+					if (yych <= '-') goto yy259;
+					goto yy291;
 				}
 			}
 		} else {
 			if (yych <= '<') {
 				if (yych <= '9') {
-					if (yych <= '/') goto yy257;
-					goto yy291;
+					if (yych <= '/') goto yy259;
+					goto yy293;
 				} else {
-					if (yych != ';') goto yy257;
+					if (yych != ';') goto yy259;
 				}
 			} else {
 				if (yych <= '|') {
-					if (yych <= '=') goto yy245;
-					if (yych <= '{') goto yy257;
+					if (yych <= '=') goto yy247;
+					if (yych <= '{') goto yy259;
 				} else {
-					if (yych != '~') goto yy257;
+					if (yych != '~') goto yy259;
 				}
 			}
 		}
-yy245:
-		YYDEBUG(245, *YYCURSOR);
+yy247:
+		YYDEBUG(247, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 471 "Zend/zend_ini_scanner.l"
+#line 492 "Zend/zend_ini_scanner.l"
 		{ /* Get number option value as string */
 	RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
 }
-#line 3046 "Zend/zend_ini_scanner.c"
-yy246:
-		YYDEBUG(246, *YYCURSOR);
+#line 3084 "Zend/zend_ini_scanner.c"
+yy248:
+		YYDEBUG(248, *YYCURSOR);
 		yyaccept = 2;
 		yych = *(YYMARKER = ++YYCURSOR);
-		goto yy285;
-yy247:
-		YYDEBUG(247, *YYCURSOR);
+		goto yy287;
+yy249:
+		YYDEBUG(249, *YYCURSOR);
 		++YYCURSOR;
-		YYDEBUG(248, *YYCURSOR);
+		YYDEBUG(250, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 483 "Zend/zend_ini_scanner.l"
+#line 504 "Zend/zend_ini_scanner.l"
 		{ /* Make = used in option value to trigger error */
 	yyless(0);
 	BEGIN(INITIAL);
 	return END_OF_LINE;
 }
-#line 3063 "Zend/zend_ini_scanner.c"
-yy249:
-		YYDEBUG(249, *YYCURSOR);
+#line 3101 "Zend/zend_ini_scanner.c"
+yy251:
+		YYDEBUG(251, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yybm[0+yych] & 4) {
-			goto yy258;
+			goto yy260;
 		}
 		if (yych <= ')') {
 			if (yych <= '\f') {
-				if (yych <= 0x00) goto yy250;
-				if (yych <= 0x08) goto yy257;
-				if (yych >= '\v') goto yy257;
+				if (yych <= 0x00) goto yy252;
+				if (yych <= 0x08) goto yy259;
+				if (yych >= '\v') goto yy259;
 			} else {
 				if (yych <= 0x1F) {
-					if (yych >= 0x0E) goto yy257;
+					if (yych >= 0x0E) goto yy259;
 				} else {
-					if (yych <= '"') goto yy250;
-					if (yych <= '%') goto yy257;
+					if (yych <= '"') goto yy252;
+					if (yych <= '%') goto yy259;
 				}
 			}
 		} else {
 			if (yych <= '=') {
-				if (yych == ';') goto yy250;
-				if (yych <= '<') goto yy257;
+				if (yych == ';') goto yy252;
+				if (yych <= '<') goto yy259;
 			} else {
 				if (yych <= '|') {
-					if (yych <= '{') goto yy257;
+					if (yych <= '{') goto yy259;
 				} else {
-					if (yych != '~') goto yy257;
+					if (yych != '~') goto yy259;
 				}
 			}
 		}
-yy250:
-		YYDEBUG(250, *YYCURSOR);
+yy252:
+		YYDEBUG(252, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 467 "Zend/zend_ini_scanner.l"
+#line 488 "Zend/zend_ini_scanner.l"
 		{ /* Get constant option value */
 	RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
 }
-#line 3103 "Zend/zend_ini_scanner.c"
-yy251:
-		YYDEBUG(251, *YYCURSOR);
+#line 3141 "Zend/zend_ini_scanner.c"
+yy253:
+		YYDEBUG(253, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '<') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '/') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					goto yy257;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					goto yy259;
 				} else {
-					if (yych <= '9') goto yy258;
-					if (yych == ';') goto yy250;
-					goto yy257;
+					if (yych <= '9') goto yy260;
+					if (yych == ';') goto yy252;
+					goto yy259;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'A') {
-					if (yych <= '=') goto yy250;
-					if (yych <= '@') goto yy257;
-					goto yy281;
+					if (yych <= '=') goto yy252;
+					if (yych <= '@') goto yy259;
+					goto yy283;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych <= 'a') goto yy281;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych <= 'a') goto yy283;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy252:
-		YYDEBUG(252, *YYCURSOR);
+yy254:
+		YYDEBUG(254, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= 'N') {
 			if (yych <= '%') {
 				if (yych <= '\f') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					if (yych <= '\n') goto yy250;
-					goto yy257;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					if (yych <= '\n') goto yy252;
+					goto yy259;
 				} else {
-					if (yych <= '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					if (yych <= '"') goto yy250;
-					goto yy257;
+					if (yych <= '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					if (yych <= '"') goto yy252;
+					goto yy259;
 				}
 			} else {
 				if (yych <= ':') {
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					if (yych <= '9') goto yy258;
-					goto yy257;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					if (yych <= '9') goto yy260;
+					goto yy259;
 				} else {
 					if (yych <= '<') {
-						if (yych <= ';') goto yy250;
-						goto yy257;
+						if (yych <= ';') goto yy252;
+						goto yy259;
 					} else {
-						if (yych <= '=') goto yy250;
-						if (yych <= '@') goto yy257;
-						goto yy258;
+						if (yych <= '=') goto yy252;
+						if (yych <= '@') goto yy259;
+						goto yy260;
 					}
 				}
 			}
 		} else {
 			if (yych <= 'n') {
 				if (yych <= 'Z') {
-					if (yych <= 'O') goto yy277;
-					if (yych == 'U') goto yy278;
-					goto yy258;
+					if (yych <= 'O') goto yy279;
+					if (yych == 'U') goto yy280;
+					goto yy260;
 				} else {
-					if (yych == '_') goto yy258;
-					if (yych <= '`') goto yy257;
-					goto yy258;
+					if (yych == '_') goto yy260;
+					if (yych <= '`') goto yy259;
+					goto yy260;
 				}
 			} else {
 				if (yych <= 'z') {
-					if (yych <= 'o') goto yy277;
-					if (yych == 'u') goto yy278;
-					goto yy258;
+					if (yych <= 'o') goto yy279;
+					if (yych == 'u') goto yy280;
+					goto yy260;
 				} else {
 					if (yych <= '|') {
-						if (yych <= '{') goto yy257;
-						goto yy250;
+						if (yych <= '{') goto yy259;
+						goto yy252;
 					} else {
-						if (yych == '~') goto yy250;
-						goto yy257;
+						if (yych == '~') goto yy252;
+						goto yy259;
 					}
 				}
 			}
 		}
-yy253:
-		YYDEBUG(253, *YYCURSOR);
+yy255:
+		YYDEBUG(255, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= 'E') {
 			if (yych <= '%') {
 				if (yych <= '\f') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					if (yych <= '\n') goto yy250;
-					goto yy257;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					if (yych <= '\n') goto yy252;
+					goto yy259;
 				} else {
-					if (yych <= '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					if (yych <= '"') goto yy250;
-					goto yy257;
+					if (yych <= '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					if (yych <= '"') goto yy252;
+					goto yy259;
 				}
 			} else {
 				if (yych <= ':') {
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					if (yych <= '9') goto yy258;
-					goto yy257;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					if (yych <= '9') goto yy260;
+					goto yy259;
 				} else {
 					if (yych <= '<') {
-						if (yych <= ';') goto yy250;
-						goto yy257;
+						if (yych <= ';') goto yy252;
+						goto yy259;
 					} else {
-						if (yych <= '=') goto yy250;
-						if (yych <= '@') goto yy257;
-						goto yy258;
+						if (yych <= '=') goto yy252;
+						if (yych <= '@') goto yy259;
+						goto yy260;
 					}
 				}
 			}
 		} else {
 			if (yych <= 'e') {
 				if (yych <= 'Z') {
-					if (yych <= 'F') goto yy272;
-					if (yych == 'N') goto yy266;
-					goto yy258;
+					if (yych <= 'F') goto yy274;
+					if (yych == 'N') goto yy268;
+					goto yy260;
 				} else {
-					if (yych == '_') goto yy258;
-					if (yych <= '`') goto yy257;
-					goto yy258;
+					if (yych == '_') goto yy260;
+					if (yych <= '`') goto yy259;
+					goto yy260;
 				}
 			} else {
 				if (yych <= 'z') {
-					if (yych <= 'f') goto yy272;
-					if (yych == 'n') goto yy266;
-					goto yy258;
+					if (yych <= 'f') goto yy274;
+					if (yych == 'n') goto yy268;
+					goto yy260;
 				} else {
 					if (yych <= '|') {
-						if (yych <= '{') goto yy257;
-						goto yy250;
+						if (yych <= '{') goto yy259;
+						goto yy252;
 					} else {
-						if (yych == '~') goto yy250;
-						goto yy257;
+						if (yych == '~') goto yy252;
+						goto yy259;
 					}
 				}
 			}
 		}
-yy254:
-		YYDEBUG(254, *YYCURSOR);
+yy256:
+		YYDEBUG(256, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'R') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'Q') goto yy258;
-					goto yy270;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'Q') goto yy260;
+					goto yy272;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'r') goto yy270;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'r') goto yy272;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy255:
-		YYDEBUG(255, *YYCURSOR);
+yy257:
+		YYDEBUG(257, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'E') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'D') goto yy258;
-					goto yy260;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'D') goto yy260;
+					goto yy262;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'e') goto yy260;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'e') goto yy262;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy256:
-		YYDEBUG(256, *YYCURSOR);
+yy258:
+		YYDEBUG(258, *YYCURSOR);
 		yyaccept = 0;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-yy257:
-		YYDEBUG(257, *YYCURSOR);
+yy259:
+		YYDEBUG(259, *YYCURSOR);
 		if (yybm[0+yych] & 2) {
-			goto yy256;
+			goto yy258;
 		}
-		if (yych == '$') goto yy261;
-		goto yy230;
-yy258:
-		YYDEBUG(258, *YYCURSOR);
+		if (yych == '$') goto yy263;
+		goto yy232;
+yy260:
+		YYDEBUG(260, *YYCURSOR);
 		yyaccept = 4;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(259, *YYCURSOR);
+		YYDEBUG(261, *YYCURSOR);
 		if (yybm[0+yych] & 4) {
-			goto yy258;
+			goto yy260;
 		}
 		if (yych <= '%') {
 			if (yych <= '\r') {
 				if (yych <= 0x08) {
-					if (yych <= 0x00) goto yy250;
-					goto yy256;
+					if (yych <= 0x00) goto yy252;
+					goto yy258;
 				} else {
-					if (yych <= '\n') goto yy250;
-					if (yych <= '\f') goto yy256;
-					goto yy250;
+					if (yych <= '\n') goto yy252;
+					if (yych <= '\f') goto yy258;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '"') {
-					if (yych <= 0x1F) goto yy256;
-					goto yy250;
+					if (yych <= 0x1F) goto yy258;
+					goto yy252;
 				} else {
-					if (yych == '$') goto yy261;
-					goto yy256;
+					if (yych == '$') goto yy263;
+					goto yy258;
 				}
 			}
 		} else {
 			if (yych <= '=') {
 				if (yych <= ':') {
-					if (yych <= ')') goto yy250;
-					goto yy256;
+					if (yych <= ')') goto yy252;
+					goto yy258;
 				} else {
-					if (yych == '<') goto yy256;
-					goto yy250;
+					if (yych == '<') goto yy258;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '|') {
-					if (yych <= '{') goto yy256;
-					goto yy250;
+					if (yych <= '{') goto yy258;
+					goto yy252;
 				} else {
-					if (yych == '~') goto yy250;
-					goto yy256;
+					if (yych == '~') goto yy252;
+					goto yy258;
 				}
 			}
 		}
-yy260:
-		YYDEBUG(260, *YYCURSOR);
+yy262:
+		YYDEBUG(262, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'S') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'R') goto yy258;
-					goto yy266;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'R') goto yy260;
+					goto yy268;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 's') goto yy266;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 's') goto yy268;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy261:
-		YYDEBUG(261, *YYCURSOR);
+yy263:
+		YYDEBUG(263, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
 		if (yych <= '\\') {
-			if (yych <= 0x00) goto yy262;
-			if (yych <= '[') goto yy256;
-			goto yy263;
+			if (yych <= 0x00) goto yy264;
+			if (yych <= '[') goto yy258;
+			goto yy265;
 		} else {
-			if (yych != '{') goto yy256;
+			if (yych != '{') goto yy258;
 		}
-yy262:
-		YYDEBUG(262, *YYCURSOR);
+yy264:
+		YYDEBUG(264, *YYCURSOR);
 		YYCURSOR = YYMARKER;
 		if (yyaccept <= 3) {
 			if (yyaccept <= 1) {
 				if (yyaccept <= 0) {
-					goto yy230;
-				} else {
 					goto yy232;
+				} else {
+					goto yy234;
 				}
 			} else {
 				if (yyaccept <= 2) {
-					goto yy228;
+					goto yy230;
 				} else {
-					goto yy245;
+					goto yy247;
 				}
 			}
 		} else {
 			if (yyaccept <= 5) {
 				if (yyaccept <= 4) {
-					goto yy250;
+					goto yy252;
 				} else {
-					goto yy267;
+					goto yy269;
 				}
 			} else {
-				goto yy274;
+				goto yy276;
 			}
 		}
-yy263:
-		YYDEBUG(263, *YYCURSOR);
+yy265:
+		YYDEBUG(265, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
 		if (yybm[0+yych] & 8) {
-			goto yy264;
+			goto yy266;
 		}
-		goto yy256;
-yy264:
-		YYDEBUG(264, *YYCURSOR);
+		goto yy258;
+yy266:
+		YYDEBUG(266, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(265, *YYCURSOR);
+		YYDEBUG(267, *YYCURSOR);
 		if (yybm[0+yych] & 8) {
-			goto yy264;
+			goto yy266;
 		}
-		if (yych <= 0x00) goto yy230;
-		if (yych == '\\') goto yy263;
-		goto yy256;
-yy266:
-		YYDEBUG(266, *YYCURSOR);
+		if (yych <= 0x00) goto yy232;
+		if (yych == '\\') goto yy265;
+		goto yy258;
+yy268:
+		YYDEBUG(268, *YYCURSOR);
 		yyaccept = 5;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yybm[0+yych] & 16) {
-			goto yy268;
+			goto yy270;
 		}
 		if (yych <= ';') {
 			if (yych <= ' ') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy267;
-					if (yych <= '\t') goto yy257;
+					if (yych <= 0x00) goto yy269;
+					if (yych <= '\t') goto yy259;
 				} else {
-					if (yych != '\r') goto yy257;
+					if (yych != '\r') goto yy259;
 				}
 			} else {
 				if (yych <= ')') {
-					if (yych <= '"') goto yy267;
-					if (yych <= '%') goto yy257;
+					if (yych <= '"') goto yy269;
+					if (yych <= '%') goto yy259;
 				} else {
-					if (yych <= '/') goto yy257;
-					if (yych <= '9') goto yy258;
-					if (yych <= ':') goto yy257;
+					if (yych <= '/') goto yy259;
+					if (yych <= '9') goto yy260;
+					if (yych <= ':') goto yy259;
 				}
 			}
 		} else {
 			if (yych <= '_') {
 				if (yych <= '@') {
-					if (yych != '=') goto yy257;
+					if (yych != '=') goto yy259;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych <= '^') goto yy257;
-					goto yy258;
+					if (yych <= 'Z') goto yy260;
+					if (yych <= '^') goto yy259;
+					goto yy260;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych <= '`') goto yy257;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych <= '`') goto yy259;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych >= 0x7F) goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych >= 0x7F) goto yy259;
 				}
 			}
 		}
-yy267:
-		YYDEBUG(267, *YYCURSOR);
+yy269:
+		YYDEBUG(269, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
 #line 421 "Zend/zend_ini_scanner.l"
 		{ /* TRUE value (when used outside option value/offset this causes parse error!) */
 	RETURN_TOKEN(BOOL_TRUE, "1", 1);
 }
-#line 3599 "Zend/zend_ini_scanner.c"
-yy268:
-		YYDEBUG(268, *YYCURSOR);
+#line 3637 "Zend/zend_ini_scanner.c"
+yy270:
+		YYDEBUG(270, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(269, *YYCURSOR);
+		YYDEBUG(271, *YYCURSOR);
 		if (yybm[0+yych] & 16) {
-			goto yy268;
+			goto yy270;
 		}
-		goto yy267;
-yy270:
-		YYDEBUG(270, *YYCURSOR);
+		goto yy269;
+yy272:
+		YYDEBUG(272, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'U') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'T') goto yy258;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'T') goto yy260;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'u') goto yy271;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'u') goto yy273;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy271:
-		YYDEBUG(271, *YYCURSOR);
+yy273:
+		YYDEBUG(273, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'E') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'D') goto yy258;
-					goto yy266;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'D') goto yy260;
+					goto yy268;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'e') goto yy266;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'e') goto yy268;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy272:
-		YYDEBUG(272, *YYCURSOR);
+yy274:
+		YYDEBUG(274, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'F') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'E') goto yy258;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'E') goto yy260;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'f') goto yy273;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'f') goto yy275;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy273:
-		YYDEBUG(273, *YYCURSOR);
+yy275:
+		YYDEBUG(275, *YYCURSOR);
 		yyaccept = 6;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yybm[0+yych] & 4) {
-			goto yy258;
+			goto yy260;
 		}
 		if (yych <= '%') {
 			if (yych <= '\f') {
 				if (yych <= 0x08) {
-					if (yych >= 0x01) goto yy257;
+					if (yych >= 0x01) goto yy259;
 				} else {
-					if (yych <= '\t') goto yy275;
-					if (yych >= '\v') goto yy257;
+					if (yych <= '\t') goto yy277;
+					if (yych >= '\v') goto yy259;
 				}
 			} else {
 				if (yych <= 0x1F) {
-					if (yych >= 0x0E) goto yy257;
+					if (yych >= 0x0E) goto yy259;
 				} else {
-					if (yych <= ' ') goto yy275;
-					if (yych >= '#') goto yy257;
+					if (yych <= ' ') goto yy277;
+					if (yych >= '#') goto yy259;
 				}
 			}
 		} else {
 			if (yych <= '=') {
 				if (yych <= ':') {
-					if (yych >= '*') goto yy257;
+					if (yych >= '*') goto yy259;
 				} else {
-					if (yych == '<') goto yy257;
+					if (yych == '<') goto yy259;
 				}
 			} else {
 				if (yych <= '|') {
-					if (yych <= '{') goto yy257;
+					if (yych <= '{') goto yy259;
 				} else {
-					if (yych != '~') goto yy257;
+					if (yych != '~') goto yy259;
 				}
 			}
 		}
-yy274:
-		YYDEBUG(274, *YYCURSOR);
+yy276:
+		YYDEBUG(276, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
 #line 425 "Zend/zend_ini_scanner.l"
 		{ /* FALSE value (when used outside option value/offset this causes parse error!)*/
 	RETURN_TOKEN(BOOL_FALSE, "", 0);
 }
-#line 3803 "Zend/zend_ini_scanner.c"
-yy275:
-		YYDEBUG(275, *YYCURSOR);
+#line 3841 "Zend/zend_ini_scanner.c"
+yy277:
+		YYDEBUG(277, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(276, *YYCURSOR);
-		if (yych == '\t') goto yy275;
-		if (yych == ' ') goto yy275;
-		goto yy274;
-yy277:
-		YYDEBUG(277, *YYCURSOR);
+		YYDEBUG(278, *YYCURSOR);
+		if (yych == '\t') goto yy277;
+		if (yych == ' ') goto yy277;
+		goto yy276;
+yy279:
+		YYDEBUG(279, *YYCURSOR);
 		yyaccept = 6;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '<') {
 			if (yych <= ' ') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy274;
-					if (yych <= 0x08) goto yy257;
-					if (yych <= '\t') goto yy275;
-					goto yy274;
+					if (yych <= 0x00) goto yy276;
+					if (yych <= 0x08) goto yy259;
+					if (yych <= '\t') goto yy277;
+					goto yy276;
 				} else {
-					if (yych == '\r') goto yy274;
-					if (yych <= 0x1F) goto yy257;
-					goto yy275;
+					if (yych == '\r') goto yy276;
+					if (yych <= 0x1F) goto yy259;
+					goto yy277;
 				}
 			} else {
 				if (yych <= '/') {
-					if (yych <= '"') goto yy274;
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy274;
-					goto yy257;
+					if (yych <= '"') goto yy276;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy276;
+					goto yy259;
 				} else {
-					if (yych <= '9') goto yy258;
-					if (yych == ';') goto yy274;
-					goto yy257;
+					if (yych <= '9') goto yy260;
+					if (yych == ';') goto yy276;
+					goto yy259;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'N') {
-					if (yych <= '=') goto yy274;
-					if (yych <= '@') goto yy257;
-					if (yych <= 'M') goto yy258;
-					goto yy280;
+					if (yych <= '=') goto yy276;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'M') goto yy260;
+					goto yy282;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'n') goto yy280;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'n') goto yy282;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy274;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy276;
+					goto yy259;
 				}
 			}
 		}
-yy278:
-		YYDEBUG(278, *YYCURSOR);
+yy280:
+		YYDEBUG(280, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'L') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'K') goto yy258;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'K') goto yy260;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'l') goto yy279;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'l') goto yy281;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy279:
-		YYDEBUG(279, *YYCURSOR);
+yy281:
+		YYDEBUG(281, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'L') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'K') goto yy258;
-					goto yy273;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'K') goto yy260;
+					goto yy275;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'l') goto yy273;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'l') goto yy275;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy280:
-		YYDEBUG(280, *YYCURSOR);
+yy282:
+		YYDEBUG(282, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'E') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'D') goto yy258;
-					goto yy273;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'D') goto yy260;
+					goto yy275;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'e') goto yy273;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'e') goto yy275;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy281:
-		YYDEBUG(281, *YYCURSOR);
+yy283:
+		YYDEBUG(283, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'L') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'K') goto yy258;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'K') goto yy260;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'l') goto yy282;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'l') goto yy284;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy282:
-		YYDEBUG(282, *YYCURSOR);
+yy284:
+		YYDEBUG(284, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'S') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'R') goto yy258;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'R') goto yy260;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 's') goto yy283;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 's') goto yy285;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy283:
-		YYDEBUG(283, *YYCURSOR);
+yy285:
+		YYDEBUG(285, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'E') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'D') goto yy258;
-					goto yy273;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'D') goto yy260;
+					goto yy275;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'e') goto yy273;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'e') goto yy275;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy284:
-		YYDEBUG(284, *YYCURSOR);
+yy286:
+		YYDEBUG(286, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(2);
 		yych = *YYCURSOR;
-yy285:
-		YYDEBUG(285, *YYCURSOR);
+yy287:
+		YYDEBUG(287, *YYCURSOR);
 		if (yybm[0+yych] & 32) {
-			goto yy284;
+			goto yy286;
 		}
-		if (yych >= '\r') goto yy288;
-yy286:
-		YYDEBUG(286, *YYCURSOR);
+		if (yych >= '\r') goto yy290;
+yy288:
+		YYDEBUG(288, *YYCURSOR);
 		++YYCURSOR;
-yy287:
-		YYDEBUG(287, *YYCURSOR);
+yy289:
+		YYDEBUG(289, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 557 "Zend/zend_ini_scanner.l"
+#line 578 "Zend/zend_ini_scanner.l"
 		{ /* Comment */
 	BEGIN(INITIAL);
 	SCNG(lineno)++;
 	return END_OF_LINE;
 }
-#line 4185 "Zend/zend_ini_scanner.c"
-yy288:
-		YYDEBUG(288, *YYCURSOR);
+#line 4223 "Zend/zend_ini_scanner.c"
+yy290:
+		YYDEBUG(290, *YYCURSOR);
 		yych = *++YYCURSOR;
-		if (yych == '\n') goto yy286;
-		goto yy287;
-yy289:
-		YYDEBUG(289, *YYCURSOR);
+		if (yych == '\n') goto yy288;
+		goto yy289;
+yy291:
+		YYDEBUG(291, *YYCURSOR);
 		yyaccept = 3;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(290, *YYCURSOR);
+		YYDEBUG(292, *YYCURSOR);
 		if (yybm[0+yych] & 64) {
-			goto yy289;
+			goto yy291;
 		}
 		if (yych <= '%') {
 			if (yych <= '\r') {
 				if (yych <= 0x08) {
-					if (yych <= 0x00) goto yy245;
-					goto yy256;
+					if (yych <= 0x00) goto yy247;
+					goto yy258;
 				} else {
-					if (yych <= '\n') goto yy245;
-					if (yych <= '\f') goto yy256;
-					goto yy245;
+					if (yych <= '\n') goto yy247;
+					if (yych <= '\f') goto yy258;
+					goto yy247;
 				}
 			} else {
 				if (yych <= '"') {
-					if (yych <= 0x1F) goto yy256;
-					goto yy245;
+					if (yych <= 0x1F) goto yy258;
+					goto yy247;
 				} else {
-					if (yych == '$') goto yy261;
-					goto yy256;
+					if (yych == '$') goto yy263;
+					goto yy258;
 				}
 			}
 		} else {
 			if (yych <= '=') {
 				if (yych <= ':') {
-					if (yych <= ')') goto yy245;
-					goto yy256;
+					if (yych <= ')') goto yy247;
+					goto yy258;
 				} else {
-					if (yych == '<') goto yy256;
-					goto yy245;
+					if (yych == '<') goto yy258;
+					goto yy247;
 				}
 			} else {
 				if (yych <= '|') {
-					if (yych <= '{') goto yy256;
-					goto yy245;
+					if (yych <= '{') goto yy258;
+					goto yy247;
 				} else {
-					if (yych == '~') goto yy245;
-					goto yy256;
+					if (yych == '~') goto yy247;
+					goto yy258;
 				}
 			}
 		}
-yy291:
-		YYDEBUG(291, *YYCURSOR);
+yy293:
+		YYDEBUG(293, *YYCURSOR);
 		yyaccept = 3;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(292, *YYCURSOR);
+		YYDEBUG(294, *YYCURSOR);
 		if (yych <= '-') {
 			if (yych <= 0x1F) {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy245;
-					if (yych <= 0x08) goto yy256;
-					goto yy245;
+					if (yych <= 0x00) goto yy247;
+					if (yych <= 0x08) goto yy258;
+					goto yy247;
 				} else {
-					if (yych == '\r') goto yy245;
-					goto yy256;
+					if (yych == '\r') goto yy247;
+					goto yy258;
 				}
 			} else {
 				if (yych <= '$') {
-					if (yych <= '"') goto yy245;
-					if (yych <= '#') goto yy256;
-					goto yy261;
+					if (yych <= '"') goto yy247;
+					if (yych <= '#') goto yy258;
+					goto yy263;
 				} else {
-					if (yych <= '%') goto yy256;
-					if (yych <= ')') goto yy245;
-					goto yy256;
+					if (yych <= '%') goto yy258;
+					if (yych <= ')') goto yy247;
+					goto yy258;
 				}
 			}
 		} else {
 			if (yych <= '<') {
 				if (yych <= '9') {
-					if (yych <= '.') goto yy289;
-					if (yych <= '/') goto yy256;
-					goto yy291;
+					if (yych <= '.') goto yy291;
+					if (yych <= '/') goto yy258;
+					goto yy293;
 				} else {
-					if (yych == ';') goto yy245;
-					goto yy256;
+					if (yych == ';') goto yy247;
+					goto yy258;
 				}
 			} else {
 				if (yych <= '|') {
-					if (yych <= '=') goto yy245;
-					if (yych <= '{') goto yy256;
-					goto yy245;
+					if (yych <= '=') goto yy247;
+					if (yych <= '{') goto yy258;
+					goto yy247;
 				} else {
-					if (yych == '~') goto yy245;
-					goto yy256;
+					if (yych == '~') goto yy247;
+					goto yy258;
 				}
 			}
 		}
-yy293:
-		YYDEBUG(293, *YYCURSOR);
+yy295:
+		YYDEBUG(295, *YYCURSOR);
 		yyaccept = 3;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(294, *YYCURSOR);
+		YYDEBUG(296, *YYCURSOR);
 		if (yych <= ')') {
 			if (yych <= '\r') {
 				if (yych <= 0x08) {
-					if (yych <= 0x00) goto yy245;
-					goto yy256;
+					if (yych <= 0x00) goto yy247;
+					goto yy258;
 				} else {
-					if (yych <= '\n') goto yy245;
-					if (yych <= '\f') goto yy256;
-					goto yy245;
+					if (yych <= '\n') goto yy247;
+					if (yych <= '\f') goto yy258;
+					goto yy247;
 				}
 			} else {
 				if (yych <= '#') {
-					if (yych <= 0x1F) goto yy256;
-					if (yych <= '"') goto yy245;
-					goto yy256;
+					if (yych <= 0x1F) goto yy258;
+					if (yych <= '"') goto yy247;
+					goto yy258;
 				} else {
-					if (yych <= '$') goto yy261;
-					if (yych <= '%') goto yy256;
-					goto yy245;
+					if (yych <= '$') goto yy263;
+					if (yych <= '%') goto yy258;
+					goto yy247;
 				}
 			}
 		} else {
 			if (yych <= '<') {
 				if (yych <= '9') {
-					if (yych <= '/') goto yy256;
-					goto yy293;
+					if (yych <= '/') goto yy258;
+					goto yy295;
 				} else {
-					if (yych == ';') goto yy245;
-					goto yy256;
+					if (yych == ';') goto yy247;
+					goto yy258;
 				}
 			} else {
 				if (yych <= '|') {
-					if (yych <= '=') goto yy245;
-					if (yych <= '{') goto yy256;
-					goto yy245;
+					if (yych <= '=') goto yy247;
+					if (yych <= '{') goto yy258;
+					goto yy247;
 				} else {
-					if (yych == '~') goto yy245;
-					goto yy256;
+					if (yych == '~') goto yy247;
+					goto yy258;
 				}
 			}
 		}
-yy295:
-		YYDEBUG(295, *YYCURSOR);
+yy297:
+		YYDEBUG(297, *YYCURSOR);
 		yyaccept = 3;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(296, *YYCURSOR);
+		YYDEBUG(298, *YYCURSOR);
 		if (yych <= ')') {
 			if (yych <= '\r') {
 				if (yych <= 0x08) {
-					if (yych <= 0x00) goto yy245;
-					goto yy256;
+					if (yych <= 0x00) goto yy247;
+					goto yy258;
 				} else {
-					if (yych <= '\n') goto yy245;
-					if (yych <= '\f') goto yy256;
-					goto yy245;
+					if (yych <= '\n') goto yy247;
+					if (yych <= '\f') goto yy258;
+					goto yy247;
 				}
 			} else {
 				if (yych <= '#') {
-					if (yych <= 0x1F) goto yy256;
-					if (yych <= '"') goto yy245;
-					goto yy256;
+					if (yych <= 0x1F) goto yy258;
+					if (yych <= '"') goto yy247;
+					goto yy258;
 				} else {
-					if (yych <= '$') goto yy261;
-					if (yych <= '%') goto yy256;
-					goto yy245;
+					if (yych <= '$') goto yy263;
+					if (yych <= '%') goto yy258;
+					goto yy247;
 				}
 			}
 		} else {
 			if (yych <= '<') {
 				if (yych <= '9') {
-					if (yych <= '/') goto yy256;
-					goto yy295;
+					if (yych <= '/') goto yy258;
+					goto yy297;
 				} else {
-					if (yych == ';') goto yy245;
-					goto yy256;
+					if (yych == ';') goto yy247;
+					goto yy258;
 				}
 			} else {
 				if (yych <= '|') {
-					if (yych <= '=') goto yy245;
-					if (yych <= '{') goto yy256;
-					goto yy245;
+					if (yych <= '=') goto yy247;
+					if (yych <= '{') goto yy258;
+					goto yy247;
 				} else {
-					if (yych == '~') goto yy245;
-					goto yy256;
+					if (yych == '~') goto yy247;
+					goto yy258;
 				}
 			}
 		}
-yy297:
-		YYDEBUG(297, *YYCURSOR);
+yy299:
+		YYDEBUG(299, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(298, *YYCURSOR);
+		YYDEBUG(300, *YYCURSOR);
 		if (yybm[0+yych] & 128) {
-			goto yy297;
+			goto yy299;
 		}
-		YYDEBUG(299, *YYCURSOR);
+		YYDEBUG(301, *YYCURSOR);
 		++YYCURSOR;
-		YYDEBUG(300, *YYCURSOR);
+		YYDEBUG(302, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
 #line 368 "Zend/zend_ini_scanner.l"
 		{ /* Raw string */
@@ -4402,66 +4440,66 @@ yy297:
 	}
 	RETURN_TOKEN(TC_RAW, yytext, yyleng);
 }
-#line 4406 "Zend/zend_ini_scanner.c"
-yy301:
-		YYDEBUG(301, *YYCURSOR);
+#line 4444 "Zend/zend_ini_scanner.c"
+yy303:
+		YYDEBUG(303, *YYCURSOR);
 		++YYCURSOR;
-		YYDEBUG(302, *YYCURSOR);
+		YYDEBUG(304, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
 #line 401 "Zend/zend_ini_scanner.l"
 		{ /* Variable start */
 	yy_push_state(ST_VARNAME TSRMLS_CC);
 	return TC_DOLLAR_CURLY;
 }
-#line 4417 "Zend/zend_ini_scanner.c"
-yy303:
-		YYDEBUG(303, *YYCURSOR);
+#line 4455 "Zend/zend_ini_scanner.c"
+yy305:
+		YYDEBUG(305, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-yy304:
-		YYDEBUG(304, *YYCURSOR);
-		if (yych == '\t') goto yy303;
-		if (yych == ' ') goto yy303;
-		goto yy237;
-yy305:
-		YYDEBUG(305, *YYCURSOR);
-		yych = *++YYCURSOR;
-		goto yy234;
 yy306:
 		YYDEBUG(306, *YYCURSOR);
+		if (yych == '\t') goto yy305;
+		if (yych == ' ') goto yy305;
+		goto yy239;
+yy307:
+		YYDEBUG(307, *YYCURSOR);
+		yych = *++YYCURSOR;
+		goto yy236;
+yy308:
+		YYDEBUG(308, *YYCURSOR);
 		yyaccept = 1;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(2);
 		yych = *YYCURSOR;
-yy307:
-		YYDEBUG(307, *YYCURSOR);
+yy309:
+		YYDEBUG(309, *YYCURSOR);
 		if (yych <= 0x1F) {
 			if (yych <= '\n') {
-				if (yych <= 0x08) goto yy232;
-				if (yych <= '\t') goto yy306;
-				goto yy305;
+				if (yych <= 0x08) goto yy234;
+				if (yych <= '\t') goto yy308;
+				goto yy307;
 			} else {
-				if (yych == '\r') goto yy309;
-				goto yy232;
+				if (yych == '\r') goto yy311;
+				goto yy234;
 			}
 		} else {
 			if (yych <= '"') {
-				if (yych <= ' ') goto yy306;
-				if (yych <= '!') goto yy232;
+				if (yych <= ' ') goto yy308;
+				if (yych <= '!') goto yy234;
 			} else {
-				if (yych == ';') goto yy284;
-				goto yy232;
+				if (yych == ';') goto yy286;
+				goto yy234;
 			}
 		}
-		YYDEBUG(308, *YYCURSOR);
+		YYDEBUG(310, *YYCURSOR);
 		yych = *++YYCURSOR;
-		goto yy239;
-yy309:
-		YYDEBUG(309, *YYCURSOR);
+		goto yy241;
+yy311:
+		YYDEBUG(311, *YYCURSOR);
 		++YYCURSOR;
-		if ((yych = *YYCURSOR) == '\n') goto yy305;
-		goto yy234;
+		if ((yych = *YYCURSOR) == '\n') goto yy307;
+		goto yy236;
 	}
 /* *********************************** */
 yyc_ST_VARNAME:
@@ -4500,47 +4538,47 @@ yyc_ST_VARNAME:
 			128, 128, 128, 128, 128, 128, 128, 128, 
 			128, 128, 128, 128, 128, 128, 128, 128, 
 		};
-		YYDEBUG(310, *YYCURSOR);
+		YYDEBUG(312, *YYCURSOR);
 		YYFILL(2);
 		yych = *YYCURSOR;
 		if (yych <= '\'') {
 			if (yych <= ' ') {
 				if (yych <= '\n') {
-					if (yych >= '\t') goto yy314;
+					if (yych >= '\t') goto yy316;
 				} else {
-					if (yych == '\r') goto yy314;
+					if (yych == '\r') goto yy316;
 				}
 			} else {
 				if (yych <= '$') {
-					if (yych != '#') goto yy314;
+					if (yych != '#') goto yy316;
 				} else {
-					if (yych == '&') goto yy314;
+					if (yych == '&') goto yy316;
 				}
 			}
 		} else {
 			if (yych <= 'Z') {
 				if (yych <= ';') {
-					if (yych <= ')') goto yy314;
-					if (yych >= ';') goto yy314;
+					if (yych <= ')') goto yy316;
+					if (yych >= ';') goto yy316;
 				} else {
-					if (yych == '=') goto yy314;
+					if (yych == '=') goto yy316;
 				}
 			} else {
 				if (yych <= '|') {
-					if (yych <= '[') goto yy314;
-					if (yych >= '{') goto yy314;
+					if (yych <= '[') goto yy316;
+					if (yych >= '{') goto yy316;
 				} else {
-					if (yych <= '}') goto yy316;
-					if (yych <= '~') goto yy314;
+					if (yych <= '}') goto yy318;
+					if (yych <= '~') goto yy316;
 				}
 			}
 		}
-		YYDEBUG(312, *YYCURSOR);
+		YYDEBUG(314, *YYCURSOR);
 		++YYCURSOR;
 		yych = *YYCURSOR;
-		goto yy319;
-yy313:
-		YYDEBUG(313, *YYCURSOR);
+		goto yy321;
+yy315:
+		YYDEBUG(315, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
 #line 406 "Zend/zend_ini_scanner.l"
 		{ /* Variable name */
@@ -4552,41 +4590,41 @@ yy313:
 
 	RETURN_TOKEN(TC_VARNAME, yytext, yyleng);
 }
-#line 4556 "Zend/zend_ini_scanner.c"
-yy314:
-		YYDEBUG(314, *YYCURSOR);
+#line 4594 "Zend/zend_ini_scanner.c"
+yy316:
+		YYDEBUG(316, *YYCURSOR);
 		++YYCURSOR;
-		YYDEBUG(315, *YYCURSOR);
+		YYDEBUG(317, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 575 "Zend/zend_ini_scanner.l"
+#line 596 "Zend/zend_ini_scanner.l"
 		{
 	return 0;
 }
-#line 4566 "Zend/zend_ini_scanner.c"
-yy316:
-		YYDEBUG(316, *YYCURSOR);
+#line 4604 "Zend/zend_ini_scanner.c"
+yy318:
+		YYDEBUG(318, *YYCURSOR);
 		++YYCURSOR;
-		YYDEBUG(317, *YYCURSOR);
+		YYDEBUG(319, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
 #line 416 "Zend/zend_ini_scanner.l"
 		{ /* Variable end */
 	yy_pop_state(TSRMLS_C);
 	return '}';
 }
-#line 4577 "Zend/zend_ini_scanner.c"
-yy318:
-		YYDEBUG(318, *YYCURSOR);
+#line 4615 "Zend/zend_ini_scanner.c"
+yy320:
+		YYDEBUG(320, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-yy319:
-		YYDEBUG(319, *YYCURSOR);
+yy321:
+		YYDEBUG(321, *YYCURSOR);
 		if (yybm[0+yych] & 128) {
-			goto yy318;
+			goto yy320;
 		}
-		goto yy313;
+		goto yy315;
 	}
 }
-#line 579 "Zend/zend_ini_scanner.l"
+#line 600 "Zend/zend_ini_scanner.l"
 
 }
diff --git a/Zend/zend_ini_scanner_defs.h b/Zend/zend_ini_scanner_defs.h
index 2bd72dc..9c99cc4 100644
--- a/Zend/zend_ini_scanner_defs.h
+++ b/Zend/zend_ini_scanner_defs.h
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Sat Feb 25 22:04:14 2012 */
+/* Generated by re2c 0.13.5 on Thu Jun  7 17:55:41 2012 */
 #line 3 "Zend/zend_ini_scanner_defs.h"
 
 enum YYCONDTYPE {


commit 4c98206a6091af415bd4ab209de71c1417dcca28
Merge: 5b10a65 c975320
Author: Pierrick Charron <pierrick at php.net>
Date:   Thu Jun 7 18:05:01 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Regenerated files
      Regenerated files



commit c975320eb9261b616df8b5dcd904395b5c56ab54
Author: Pierrick Charron <pierrick at php.net>
Date:   Thu Jun 7 18:04:15 2012 +0200

    Regenerated files

diff --git a/Zend/zend_ini_scanner.c b/Zend/zend_ini_scanner.c
index 9d0265e..94c48c8 100644
--- a/Zend/zend_ini_scanner.c
+++ b/Zend/zend_ini_scanner.c
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Fri Mar  2 11:49:21 2012 */
+/* Generated by re2c 0.13.5 on Thu Jun  7 17:48:25 2012 */
 #line 1 "Zend/zend_ini_scanner.l"
 /*
    +----------------------------------------------------------------------+
@@ -481,7 +481,7 @@ yy4:
 yy5:
 		YYDEBUG(5, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 547 "Zend/zend_ini_scanner.l"
+#line 568 "Zend/zend_ini_scanner.l"
 		{
 	/* eat whitespace */
 	goto restart;
@@ -493,7 +493,7 @@ yy6:
 yy7:
 		YYDEBUG(7, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 552 "Zend/zend_ini_scanner.l"
+#line 573 "Zend/zend_ini_scanner.l"
 		{
 	SCNG(lineno)++;
 	return END_OF_LINE;
@@ -533,7 +533,7 @@ yy10:
 		++YYCURSOR;
 		YYDEBUG(11, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 475 "Zend/zend_ini_scanner.l"
+#line 496 "Zend/zend_ini_scanner.l"
 		{ /* Disallow these chars outside option values */
 	return yytext[0];
 }
@@ -554,7 +554,7 @@ yy14:
 		goto yy54;
 		YYDEBUG(15, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 575 "Zend/zend_ini_scanner.l"
+#line 596 "Zend/zend_ini_scanner.l"
 		{
 	return 0;
 }
@@ -926,7 +926,7 @@ yy55:
 yy56:
 		YYDEBUG(56, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 557 "Zend/zend_ini_scanner.l"
+#line 578 "Zend/zend_ini_scanner.l"
 		{ /* Comment */
 	BEGIN(INITIAL);
 	SCNG(lineno)++;
@@ -1012,7 +1012,7 @@ yy64:
 yy65:
 		YYDEBUG(65, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 563 "Zend/zend_ini_scanner.l"
+#line 584 "Zend/zend_ini_scanner.l"
 		{ /* #Comment */
 	zend_error(E_DEPRECATED, "Comments starting with '#' are deprecated in %s on line %d", zend_ini_scanner_get_filename(TSRMLS_C), SCNG(lineno));
 	BEGIN(INITIAL);
@@ -1159,7 +1159,7 @@ yyc_ST_DOUBLE_QUOTES:
 yy76:
 		YYDEBUG(76, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 507 "Zend/zend_ini_scanner.l"
+#line 528 "Zend/zend_ini_scanner.l"
 		{ /* Escape double quoted string contents */
 	if (YYCURSOR > YYLIMIT) {
 		return 0;
@@ -1204,7 +1204,7 @@ yy77:
 yy78:
 		YYDEBUG(78, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 502 "Zend/zend_ini_scanner.l"
+#line 523 "Zend/zend_ini_scanner.l"
 		{ /* Double quoted '"' string ends */
 	yy_pop_state(TSRMLS_C);
 	return '"';
@@ -1323,7 +1323,7 @@ yy86:
 yy87:
 		YYDEBUG(87, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 493 "Zend/zend_ini_scanner.l"
+#line 514 "Zend/zend_ini_scanner.l"
 		{ /* Get rest as section/offset value */
 	RETURN_TOKEN(TC_STRING, yytext, yyleng);
 }
@@ -1344,7 +1344,7 @@ yy89:
 yy90:
 		YYDEBUG(90, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 575 "Zend/zend_ini_scanner.l"
+#line 596 "Zend/zend_ini_scanner.l"
 		{
 	return 0;
 }
@@ -1355,7 +1355,7 @@ yy91:
 yy92:
 		YYDEBUG(92, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 497 "Zend/zend_ini_scanner.l"
+#line 518 "Zend/zend_ini_scanner.l"
 		{ /* Double quoted '"' string start */
 	yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC);
 	return '"';
@@ -1422,7 +1422,7 @@ yy97:
 yy98:
 		YYDEBUG(98, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 471 "Zend/zend_ini_scanner.l"
+#line 492 "Zend/zend_ini_scanner.l"
 		{ /* Get number option value as string */
 	RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
 }
@@ -1452,7 +1452,7 @@ yy99:
 yy100:
 		YYDEBUG(100, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 467 "Zend/zend_ini_scanner.l"
+#line 488 "Zend/zend_ini_scanner.l"
 		{ /* Get constant option value */
 	RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
 }
@@ -1833,7 +1833,7 @@ yyc_ST_RAW:
 			160, 224,   0, 160, 160,   0, 160, 160, 
 			160, 160, 160, 160, 160, 160, 160, 160, 
 			160, 160, 160, 160, 160, 160, 160, 160, 
-			224, 160, 160, 160, 160, 160, 160, 160, 
+			224, 160,  32, 160, 160, 160, 160, 160, 
 			160, 160, 160, 160, 160, 160, 160, 160, 
 			160, 160, 160, 160, 160, 160, 160, 160, 
 			160, 160, 160,  32, 160, 160, 160, 160, 
@@ -1865,66 +1865,64 @@ yyc_ST_RAW:
 		YYDEBUG(135, *YYCURSOR);
 		YYFILL(3);
 		yych = *YYCURSOR;
-		if (yych <= '\f') {
-			if (yych <= 0x08) {
-				if (yych >= 0x01) goto yy139;
+		if (yych <= '\r') {
+			if (yych <= '\t') {
+				if (yych <= 0x00) goto yy137;
+				if (yych <= 0x08) goto yy139;
+				goto yy141;
 			} else {
-				if (yych <= '\t') goto yy141;
 				if (yych <= '\n') goto yy142;
-				goto yy139;
+				if (yych <= '\f') goto yy139;
+				goto yy144;
 			}
 		} else {
-			if (yych <= ' ') {
-				if (yych <= '\r') goto yy144;
-				if (yych <= 0x1F) goto yy139;
-				goto yy141;
+			if (yych <= '!') {
+				if (yych == ' ') goto yy141;
+				goto yy139;
 			} else {
-				if (yych == ';') goto yy145;
+				if (yych <= '"') goto yy145;
+				if (yych == ';') goto yy147;
 				goto yy139;
 			}
 		}
+yy137:
 		YYDEBUG(137, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(138, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 570 "Zend/zend_ini_scanner.l"
+#line 591 "Zend/zend_ini_scanner.l"
 		{ /* End of option value (if EOF is reached before EOL */
 	BEGIN(INITIAL);
 	return END_OF_LINE;
 }
-#line 1896 "Zend/zend_ini_scanner.c"
+#line 1899 "Zend/zend_ini_scanner.c"
 yy139:
 		YYDEBUG(139, *YYCURSOR);
 		++YYCURSOR;
 		yych = *YYCURSOR;
-		goto yy156;
+		goto yy158;
 yy140:
 		YYDEBUG(140, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 448 "Zend/zend_ini_scanner.l"
+#line 474 "Zend/zend_ini_scanner.l"
 		{ /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
-	/* Eat leading and trailing double quotes */
-	if (yytext[0] == '"' && yytext[yyleng - 1] == '"') {
-		SCNG(yy_text)++;
-		yyleng = yyleng - 2;
-	}
 	RETURN_TOKEN(TC_RAW, yytext, yyleng);
 }
-#line 1914 "Zend/zend_ini_scanner.c"
+#line 1912 "Zend/zend_ini_scanner.c"
 yy141:
 		YYDEBUG(141, *YYCURSOR);
 		yyaccept = 0;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yybm[0+yych] & 64) {
-			goto yy152;
+			goto yy154;
 		}
 		if (yych <= '\f') {
-			if (yych == '\n') goto yy151;
-			goto yy156;
+			if (yych == '\n') goto yy153;
+			goto yy158;
 		} else {
-			if (yych <= '\r') goto yy154;
-			if (yych == ';') goto yy146;
-			goto yy156;
+			if (yych <= '\r') goto yy156;
+			if (yych == ';') goto yy148;
+			goto yy158;
 		}
 yy142:
 		YYDEBUG(142, *YYCURSOR);
@@ -1932,89 +1930,129 @@ yy142:
 yy143:
 		YYDEBUG(143, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 461 "Zend/zend_ini_scanner.l"
+#line 482 "Zend/zend_ini_scanner.l"
 		{ /* End of option value */
 	BEGIN(INITIAL);
 	SCNG(lineno)++;
 	return END_OF_LINE;
 }
-#line 1942 "Zend/zend_ini_scanner.c"
+#line 1940 "Zend/zend_ini_scanner.c"
 yy144:
 		YYDEBUG(144, *YYCURSOR);
 		yych = *++YYCURSOR;
-		if (yych == '\n') goto yy151;
+		if (yych == '\n') goto yy153;
 		goto yy143;
 yy145:
 		YYDEBUG(145, *YYCURSOR);
-		yyaccept = 1;
-		yych = *(YYMARKER = ++YYCURSOR);
-		goto yy147;
-yy146:
-		YYDEBUG(146, *YYCURSOR);
 		++YYCURSOR;
-		YYFILL(2);
-		yych = *YYCURSOR;
+		YYDEBUG(146, *YYCURSOR);
+		yyleng = YYCURSOR - SCNG(yy_text);
+#line 448 "Zend/zend_ini_scanner.l"
+		{
+	while (YYCURSOR < YYLIMIT) {
+		switch (*YYCURSOR++) {
+			case '\n':
+				SCNG(lineno)++;
+				break;
+			case '\r':
+				if (*YYCURSOR != '\n') {
+					SCNG(lineno)++;
+				}
+				break;
+			case '"':
+				yyleng = YYCURSOR - SCNG(yy_text) - 2;
+				SCNG(yy_text)++;
+				RETURN_TOKEN(TC_RAW, yytext, yyleng);
+			case '\\':
+				if (YYCURSOR < YYLIMIT) {
+					YYCURSOR++;
+				}
+				break;
+		}
+	}
+	yyleng = YYCURSOR - SCNG(yy_text);
+	RETURN_TOKEN(TC_RAW, yytext, yyleng);
+}
+#line 1977 "Zend/zend_ini_scanner.c"
 yy147:
 		YYDEBUG(147, *YYCURSOR);
-		if (yybm[0+yych] & 32) {
-			goto yy146;
-		}
-		if (yych >= '\r') goto yy150;
+		yyaccept = 1;
+		yych = *(YYMARKER = ++YYCURSOR);
+		goto yy149;
 yy148:
 		YYDEBUG(148, *YYCURSOR);
 		++YYCURSOR;
+		YYFILL(2);
+		yych = *YYCURSOR;
 yy149:
 		YYDEBUG(149, *YYCURSOR);
+		if (yybm[0+yych] & 32) {
+			goto yy148;
+		}
+		if (yych >= '\r') goto yy152;
+yy150:
+		YYDEBUG(150, *YYCURSOR);
+		++YYCURSOR;
+yy151:
+		YYDEBUG(151, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 557 "Zend/zend_ini_scanner.l"
+#line 578 "Zend/zend_ini_scanner.l"
 		{ /* Comment */
 	BEGIN(INITIAL);
 	SCNG(lineno)++;
 	return END_OF_LINE;
 }
-#line 1976 "Zend/zend_ini_scanner.c"
-yy150:
-		YYDEBUG(150, *YYCURSOR);
+#line 2006 "Zend/zend_ini_scanner.c"
+yy152:
+		YYDEBUG(152, *YYCURSOR);
 		yych = *++YYCURSOR;
-		if (yych == '\n') goto yy148;
-		goto yy149;
-yy151:
-		YYDEBUG(151, *YYCURSOR);
+		if (yych == '\n') goto yy150;
+		goto yy151;
+yy153:
+		YYDEBUG(153, *YYCURSOR);
 		yych = *++YYCURSOR;
 		goto yy143;
-yy152:
-		YYDEBUG(152, *YYCURSOR);
+yy154:
+		YYDEBUG(154, *YYCURSOR);
 		yyaccept = 0;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(2);
 		yych = *YYCURSOR;
-		YYDEBUG(153, *YYCURSOR);
+		YYDEBUG(155, *YYCURSOR);
 		if (yybm[0+yych] & 64) {
-			goto yy152;
+			goto yy154;
 		}
-		if (yych <= '\f') {
-			if (yych <= 0x00) goto yy140;
-			if (yych == '\n') goto yy151;
-			goto yy155;
+		if (yych <= '\r') {
+			if (yych <= '\t') {
+				if (yych <= 0x00) goto yy140;
+				goto yy157;
+			} else {
+				if (yych <= '\n') goto yy153;
+				if (yych <= '\f') goto yy157;
+			}
 		} else {
-			if (yych <= '\r') goto yy154;
-			if (yych == ';') goto yy146;
-			goto yy155;
+			if (yych <= '"') {
+				if (yych <= '!') goto yy157;
+				goto yy140;
+			} else {
+				if (yych == ';') goto yy148;
+				goto yy157;
+			}
 		}
-yy154:
-		YYDEBUG(154, *YYCURSOR);
+yy156:
+		YYDEBUG(156, *YYCURSOR);
 		yych = *++YYCURSOR;
-		if (yych == '\n') goto yy151;
+		if (yych == '\n') goto yy153;
 		goto yy143;
-yy155:
-		YYDEBUG(155, *YYCURSOR);
+yy157:
+		YYDEBUG(157, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-yy156:
-		YYDEBUG(156, *YYCURSOR);
+yy158:
+		YYDEBUG(158, *YYCURSOR);
 		if (yybm[0+yych] & 128) {
-			goto yy155;
+			goto yy157;
 		}
 		goto yy140;
 	}
@@ -2055,44 +2093,44 @@ yyc_ST_SECTION_RAW:
 			128, 128, 128, 128, 128, 128, 128, 128, 
 			128, 128, 128, 128, 128, 128, 128, 128, 
 		};
-		YYDEBUG(157, *YYCURSOR);
+		YYDEBUG(159, *YYCURSOR);
 		YYFILL(3);
 		yych = *YYCURSOR;
 		if (yych <= '\f') {
-			if (yych == '\n') goto yy161;
+			if (yych == '\n') goto yy163;
 		} else {
-			if (yych <= '\r') goto yy161;
-			if (yych == ']') goto yy163;
+			if (yych <= '\r') goto yy163;
+			if (yych == ']') goto yy165;
 		}
-		YYDEBUG(159, *YYCURSOR);
+		YYDEBUG(161, *YYCURSOR);
 		++YYCURSOR;
 		yych = *YYCURSOR;
-		goto yy170;
-yy160:
-		YYDEBUG(160, *YYCURSOR);
+		goto yy172;
+yy162:
+		YYDEBUG(162, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 457 "Zend/zend_ini_scanner.l"
+#line 478 "Zend/zend_ini_scanner.l"
 		{ /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
 	RETURN_TOKEN(TC_RAW, yytext, yyleng);
 }
-#line 2079 "Zend/zend_ini_scanner.c"
-yy161:
-		YYDEBUG(161, *YYCURSOR);
+#line 2117 "Zend/zend_ini_scanner.c"
+yy163:
+		YYDEBUG(163, *YYCURSOR);
 		++YYCURSOR;
-		YYDEBUG(162, *YYCURSOR);
+		YYDEBUG(164, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 575 "Zend/zend_ini_scanner.l"
+#line 596 "Zend/zend_ini_scanner.l"
 		{
 	return 0;
 }
-#line 2089 "Zend/zend_ini_scanner.c"
-yy163:
-		YYDEBUG(163, *YYCURSOR);
+#line 2127 "Zend/zend_ini_scanner.c"
+yy165:
+		YYDEBUG(165, *YYCURSOR);
 		++YYCURSOR;
 		yych = *YYCURSOR;
-		goto yy166;
-yy164:
-		YYDEBUG(164, *YYCURSOR);
+		goto yy168;
+yy166:
+		YYDEBUG(166, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
 #line 377 "Zend/zend_ini_scanner.l"
 		{ /* End of section */
@@ -2100,40 +2138,40 @@ yy164:
 	SCNG(lineno)++;
 	return ']';
 }
-#line 2104 "Zend/zend_ini_scanner.c"
-yy165:
-		YYDEBUG(165, *YYCURSOR);
+#line 2142 "Zend/zend_ini_scanner.c"
+yy167:
+		YYDEBUG(167, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(2);
 		yych = *YYCURSOR;
-yy166:
-		YYDEBUG(166, *YYCURSOR);
-		if (yybm[0+yych] & 64) {
-			goto yy165;
-		}
-		if (yych == '\n') goto yy167;
-		if (yych == '\r') goto yy168;
-		goto yy164;
-yy167:
-		YYDEBUG(167, *YYCURSOR);
-		yych = *++YYCURSOR;
-		goto yy164;
 yy168:
 		YYDEBUG(168, *YYCURSOR);
-		yych = *++YYCURSOR;
-		if (yych == '\n') goto yy167;
-		goto yy164;
+		if (yybm[0+yych] & 64) {
+			goto yy167;
+		}
+		if (yych == '\n') goto yy169;
+		if (yych == '\r') goto yy170;
+		goto yy166;
 yy169:
 		YYDEBUG(169, *YYCURSOR);
+		yych = *++YYCURSOR;
+		goto yy166;
+yy170:
+		YYDEBUG(170, *YYCURSOR);
+		yych = *++YYCURSOR;
+		if (yych == '\n') goto yy169;
+		goto yy166;
+yy171:
+		YYDEBUG(171, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-yy170:
-		YYDEBUG(170, *YYCURSOR);
+yy172:
+		YYDEBUG(172, *YYCURSOR);
 		if (yybm[0+yych] & 128) {
-			goto yy169;
+			goto yy171;
 		}
-		goto yy160;
+		goto yy162;
 	}
 /* *********************************** */
 yyc_ST_SECTION_VALUE:
@@ -2172,203 +2210,203 @@ yyc_ST_SECTION_VALUE:
 			132, 132, 132, 132, 132, 132, 132, 132, 
 			132, 132, 132, 132, 132, 132, 132, 132, 
 		};
-		YYDEBUG(171, *YYCURSOR);
+		YYDEBUG(173, *YYCURSOR);
 		YYFILL(3);
 		yych = *YYCURSOR;
 		if (yych <= '-') {
 			if (yych <= ' ') {
 				if (yych <= '\n') {
-					if (yych <= 0x08) goto yy173;
-					if (yych <= '\t') goto yy175;
-					goto yy176;
+					if (yych <= 0x08) goto yy175;
+					if (yych <= '\t') goto yy177;
+					goto yy178;
 				} else {
-					if (yych == '\r') goto yy176;
-					if (yych >= ' ') goto yy175;
+					if (yych == '\r') goto yy178;
+					if (yych >= ' ') goto yy177;
 				}
 			} else {
 				if (yych <= '$') {
-					if (yych == '"') goto yy178;
-					if (yych >= '$') goto yy180;
+					if (yych == '"') goto yy180;
+					if (yych >= '$') goto yy182;
 				} else {
-					if (yych == '\'') goto yy181;
-					if (yych >= '-') goto yy182;
+					if (yych == '\'') goto yy183;
+					if (yych >= '-') goto yy184;
 				}
 			}
 		} else {
 			if (yych <= 'Z') {
 				if (yych <= '9') {
-					if (yych <= '.') goto yy183;
-					if (yych >= '0') goto yy184;
+					if (yych <= '.') goto yy185;
+					if (yych >= '0') goto yy186;
 				} else {
-					if (yych == ';') goto yy176;
-					if (yych >= 'A') goto yy186;
+					if (yych == ';') goto yy178;
+					if (yych >= 'A') goto yy188;
 				}
 			} else {
 				if (yych <= '^') {
-					if (yych <= '[') goto yy173;
-					if (yych <= '\\') goto yy188;
-					if (yych <= ']') goto yy189;
+					if (yych <= '[') goto yy175;
+					if (yych <= '\\') goto yy190;
+					if (yych <= ']') goto yy191;
 				} else {
-					if (yych == '`') goto yy173;
-					if (yych <= 'z') goto yy186;
+					if (yych == '`') goto yy175;
+					if (yych <= 'z') goto yy188;
 				}
 			}
 		}
-yy173:
-		YYDEBUG(173, *YYCURSOR);
+yy175:
+		YYDEBUG(175, *YYCURSOR);
 		yyaccept = 0;
 		yych = *(YYMARKER = ++YYCURSOR);
-		goto yy196;
-yy174:
-		YYDEBUG(174, *YYCURSOR);
+		goto yy198;
+yy176:
+		YYDEBUG(176, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 493 "Zend/zend_ini_scanner.l"
+#line 514 "Zend/zend_ini_scanner.l"
 		{ /* Get rest as section/offset value */
 	RETURN_TOKEN(TC_STRING, yytext, yyleng);
 }
-#line 2230 "Zend/zend_ini_scanner.c"
-yy175:
-		YYDEBUG(175, *YYCURSOR);
+#line 2268 "Zend/zend_ini_scanner.c"
+yy177:
+		YYDEBUG(177, *YYCURSOR);
 		yyaccept = 0;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= 0x1F) {
-			if (yych == '\t') goto yy222;
-			goto yy196;
+			if (yych == '\t') goto yy224;
+			goto yy198;
 		} else {
-			if (yych <= ' ') goto yy222;
-			if (yych == '"') goto yy224;
-			goto yy196;
+			if (yych <= ' ') goto yy224;
+			if (yych == '"') goto yy226;
+			goto yy198;
 		}
-yy176:
-		YYDEBUG(176, *YYCURSOR);
+yy178:
+		YYDEBUG(178, *YYCURSOR);
 		++YYCURSOR;
-yy177:
-		YYDEBUG(177, *YYCURSOR);
+yy179:
+		YYDEBUG(179, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 575 "Zend/zend_ini_scanner.l"
+#line 596 "Zend/zend_ini_scanner.l"
 		{
 	return 0;
 }
-#line 2253 "Zend/zend_ini_scanner.c"
-yy178:
-		YYDEBUG(178, *YYCURSOR);
+#line 2291 "Zend/zend_ini_scanner.c"
+yy180:
+		YYDEBUG(180, *YYCURSOR);
 		++YYCURSOR;
-yy179:
-		YYDEBUG(179, *YYCURSOR);
+yy181:
+		YYDEBUG(181, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 497 "Zend/zend_ini_scanner.l"
+#line 518 "Zend/zend_ini_scanner.l"
 		{ /* Double quoted '"' string start */
 	yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC);
 	return '"';
 }
-#line 2265 "Zend/zend_ini_scanner.c"
-yy180:
-		YYDEBUG(180, *YYCURSOR);
+#line 2303 "Zend/zend_ini_scanner.c"
+yy182:
+		YYDEBUG(182, *YYCURSOR);
 		yych = *++YYCURSOR;
 		if (yych <= '\\') {
-			if (yych <= 0x00) goto yy177;
-			if (yych <= '[') goto yy195;
-			goto yy200;
+			if (yych <= 0x00) goto yy179;
+			if (yych <= '[') goto yy197;
+			goto yy202;
 		} else {
-			if (yych == '{') goto yy220;
-			goto yy195;
+			if (yych == '{') goto yy222;
+			goto yy197;
 		}
-yy181:
-		YYDEBUG(181, *YYCURSOR);
+yy183:
+		YYDEBUG(183, *YYCURSOR);
 		yyaccept = 1;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yybm[0+yych] & 128) {
-			goto yy216;
+			goto yy218;
 		}
-		goto yy177;
-yy182:
-		YYDEBUG(182, *YYCURSOR);
+		goto yy179;
+yy184:
+		YYDEBUG(184, *YYCURSOR);
 		yyaccept = 0;
 		yych = *(YYMARKER = ++YYCURSOR);
-		if (yych <= '/') goto yy196;
-		if (yych <= '9') goto yy214;
-		goto yy196;
-yy183:
-		YYDEBUG(183, *YYCURSOR);
+		if (yych <= '/') goto yy198;
+		if (yych <= '9') goto yy216;
+		goto yy198;
+yy185:
+		YYDEBUG(185, *YYCURSOR);
 		yyaccept = 0;
 		yych = *(YYMARKER = ++YYCURSOR);
-		if (yych <= '/') goto yy196;
-		if (yych <= '9') goto yy212;
-		goto yy196;
-yy184:
-		YYDEBUG(184, *YYCURSOR);
+		if (yych <= '/') goto yy198;
+		if (yych <= '9') goto yy214;
+		goto yy198;
+yy186:
+		YYDEBUG(186, *YYCURSOR);
 		yyaccept = 2;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '\'') {
 			if (yych <= '\r') {
-				if (yych == '\n') goto yy185;
-				if (yych <= '\f') goto yy196;
+				if (yych == '\n') goto yy187;
+				if (yych <= '\f') goto yy198;
 			} else {
-				if (yych == '"') goto yy185;
-				if (yych <= '&') goto yy196;
+				if (yych == '"') goto yy187;
+				if (yych <= '&') goto yy198;
 			}
 		} else {
 			if (yych <= '9') {
-				if (yych == '.') goto yy208;
-				if (yych <= '/') goto yy196;
-				goto yy210;
+				if (yych == '.') goto yy210;
+				if (yych <= '/') goto yy198;
+				goto yy212;
 			} else {
 				if (yych <= ';') {
-					if (yych <= ':') goto yy196;
+					if (yych <= ':') goto yy198;
 				} else {
-					if (yych != ']') goto yy196;
+					if (yych != ']') goto yy198;
 				}
 			}
 		}
-yy185:
-		YYDEBUG(185, *YYCURSOR);
+yy187:
+		YYDEBUG(187, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 471 "Zend/zend_ini_scanner.l"
+#line 492 "Zend/zend_ini_scanner.l"
 		{ /* Get number option value as string */
 	RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
 }
-#line 2331 "Zend/zend_ini_scanner.c"
-yy186:
-		YYDEBUG(186, *YYCURSOR);
+#line 2369 "Zend/zend_ini_scanner.c"
+yy188:
+		YYDEBUG(188, *YYCURSOR);
 		yyaccept = 3;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yybm[0+yych] & 32) {
-			goto yy206;
+			goto yy208;
 		}
 		if (yych <= '"') {
 			if (yych <= '\f') {
-				if (yych != '\n') goto yy196;
+				if (yych != '\n') goto yy198;
 			} else {
-				if (yych <= '\r') goto yy187;
-				if (yych <= '!') goto yy196;
+				if (yych <= '\r') goto yy189;
+				if (yych <= '!') goto yy198;
 			}
 		} else {
 			if (yych <= ':') {
-				if (yych != '\'') goto yy196;
+				if (yych != '\'') goto yy198;
 			} else {
-				if (yych <= ';') goto yy187;
-				if (yych != ']') goto yy196;
+				if (yych <= ';') goto yy189;
+				if (yych != ']') goto yy198;
 			}
 		}
-yy187:
-		YYDEBUG(187, *YYCURSOR);
+yy189:
+		YYDEBUG(189, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 467 "Zend/zend_ini_scanner.l"
+#line 488 "Zend/zend_ini_scanner.l"
 		{ /* Get constant option value */
 	RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
 }
-#line 2361 "Zend/zend_ini_scanner.c"
-yy188:
-		YYDEBUG(188, *YYCURSOR);
+#line 2399 "Zend/zend_ini_scanner.c"
+yy190:
+		YYDEBUG(190, *YYCURSOR);
 		yych = *++YYCURSOR;
-		goto yy195;
-yy189:
-		YYDEBUG(189, *YYCURSOR);
+		goto yy197;
+yy191:
+		YYDEBUG(191, *YYCURSOR);
 		++YYCURSOR;
 		yych = *YYCURSOR;
-		goto yy192;
-yy190:
-		YYDEBUG(190, *YYCURSOR);
+		goto yy194;
+yy192:
+		YYDEBUG(192, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
 #line 377 "Zend/zend_ini_scanner.l"
 		{ /* End of section */
@@ -2376,97 +2414,86 @@ yy190:
 	SCNG(lineno)++;
 	return ']';
 }
-#line 2380 "Zend/zend_ini_scanner.c"
-yy191:
-		YYDEBUG(191, *YYCURSOR);
+#line 2418 "Zend/zend_ini_scanner.c"
+yy193:
+		YYDEBUG(193, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(2);
 		yych = *YYCURSOR;
-yy192:
-		YYDEBUG(192, *YYCURSOR);
-		if (yybm[0+yych] & 2) {
-			goto yy191;
-		}
-		if (yych == '\n') goto yy193;
-		if (yych == '\r') goto yy194;
-		goto yy190;
-yy193:
-		YYDEBUG(193, *YYCURSOR);
-		yych = *++YYCURSOR;
-		goto yy190;
 yy194:
 		YYDEBUG(194, *YYCURSOR);
-		yych = *++YYCURSOR;
-		if (yych == '\n') goto yy193;
-		goto yy190;
+		if (yybm[0+yych] & 2) {
+			goto yy193;
+		}
+		if (yych == '\n') goto yy195;
+		if (yych == '\r') goto yy196;
+		goto yy192;
 yy195:
 		YYDEBUG(195, *YYCURSOR);
+		yych = *++YYCURSOR;
+		goto yy192;
+yy196:
+		YYDEBUG(196, *YYCURSOR);
+		yych = *++YYCURSOR;
+		if (yych == '\n') goto yy195;
+		goto yy192;
+yy197:
+		YYDEBUG(197, *YYCURSOR);
 		yyaccept = 0;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-yy196:
-		YYDEBUG(196, *YYCURSOR);
+yy198:
+		YYDEBUG(198, *YYCURSOR);
 		if (yybm[0+yych] & 4) {
-			goto yy195;
+			goto yy197;
 		}
-		if (yych == '$') goto yy198;
-		if (yych != '\\') goto yy174;
-yy197:
-		YYDEBUG(197, *YYCURSOR);
+		if (yych == '$') goto yy200;
+		if (yych != '\\') goto yy176;
+yy199:
+		YYDEBUG(199, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		goto yy195;
-yy198:
-		YYDEBUG(198, *YYCURSOR);
+		goto yy197;
+yy200:
+		YYDEBUG(200, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
 		if (yych <= '\\') {
-			if (yych <= 0x00) goto yy199;
-			if (yych <= '[') goto yy195;
-			goto yy200;
+			if (yych <= 0x00) goto yy201;
+			if (yych <= '[') goto yy197;
+			goto yy202;
 		} else {
-			if (yych != '{') goto yy195;
+			if (yych != '{') goto yy197;
 		}
-yy199:
-		YYDEBUG(199, *YYCURSOR);
+yy201:
+		YYDEBUG(201, *YYCURSOR);
 		YYCURSOR = YYMARKER;
 		if (yyaccept <= 1) {
 			if (yyaccept <= 0) {
-				goto yy174;
+				goto yy176;
 			} else {
-				goto yy177;
+				goto yy179;
 			}
 		} else {
 			if (yyaccept <= 2) {
-				goto yy185;
-			} else {
 				goto yy187;
+			} else {
+				goto yy189;
 			}
 		}
-yy200:
-		YYDEBUG(200, *YYCURSOR);
+yy202:
+		YYDEBUG(202, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
 		if (yybm[0+yych] & 8) {
-			goto yy201;
-		}
-		if (yych == '\\') goto yy203;
-		goto yy195;
-yy201:
-		YYDEBUG(201, *YYCURSOR);
-		++YYCURSOR;
-		YYFILL(1);
-		yych = *YYCURSOR;
-		YYDEBUG(202, *YYCURSOR);
-		if (yybm[0+yych] & 8) {
-			goto yy201;
+			goto yy203;
 		}
 		if (yych == '\\') goto yy205;
-		goto yy195;
+		goto yy197;
 yy203:
 		YYDEBUG(203, *YYCURSOR);
 		++YYCURSOR;
@@ -2474,219 +2501,230 @@ yy203:
 		yych = *YYCURSOR;
 		YYDEBUG(204, *YYCURSOR);
 		if (yybm[0+yych] & 8) {
-			goto yy201;
+			goto yy203;
 		}
-		if (yych == '\\') goto yy203;
-		goto yy195;
+		if (yych == '\\') goto yy207;
+		goto yy197;
 yy205:
 		YYDEBUG(205, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
+		YYDEBUG(206, *YYCURSOR);
 		if (yybm[0+yych] & 8) {
-			goto yy201;
+			goto yy203;
 		}
-		if (yych == '\\') goto yy203;
-		goto yy195;
-yy206:
-		YYDEBUG(206, *YYCURSOR);
+		if (yych == '\\') goto yy205;
+		goto yy197;
+yy207:
+		YYDEBUG(207, *YYCURSOR);
+		++YYCURSOR;
+		YYFILL(1);
+		yych = *YYCURSOR;
+		if (yybm[0+yych] & 8) {
+			goto yy203;
+		}
+		if (yych == '\\') goto yy205;
+		goto yy197;
+yy208:
+		YYDEBUG(208, *YYCURSOR);
 		yyaccept = 3;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(207, *YYCURSOR);
+		YYDEBUG(209, *YYCURSOR);
 		if (yybm[0+yych] & 32) {
-			goto yy206;
+			goto yy208;
 		}
 		if (yych <= '$') {
 			if (yych <= '\r') {
-				if (yych == '\n') goto yy187;
-				if (yych <= '\f') goto yy195;
-				goto yy187;
+				if (yych == '\n') goto yy189;
+				if (yych <= '\f') goto yy197;
+				goto yy189;
 			} else {
-				if (yych == '"') goto yy187;
-				if (yych <= '#') goto yy195;
-				goto yy198;
+				if (yych == '"') goto yy189;
+				if (yych <= '#') goto yy197;
+				goto yy200;
 			}
 		} else {
 			if (yych <= ';') {
-				if (yych == '\'') goto yy187;
-				if (yych <= ':') goto yy195;
-				goto yy187;
+				if (yych == '\'') goto yy189;
+				if (yych <= ':') goto yy197;
+				goto yy189;
 			} else {
-				if (yych <= '[') goto yy195;
-				if (yych <= '\\') goto yy197;
-				if (yych <= ']') goto yy187;
-				goto yy195;
+				if (yych <= '[') goto yy197;
+				if (yych <= '\\') goto yy199;
+				if (yych <= ']') goto yy189;
+				goto yy197;
 			}
 		}
-yy208:
-		YYDEBUG(208, *YYCURSOR);
+yy210:
+		YYDEBUG(210, *YYCURSOR);
 		yyaccept = 2;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(209, *YYCURSOR);
+		YYDEBUG(211, *YYCURSOR);
 		if (yybm[0+yych] & 64) {
-			goto yy208;
+			goto yy210;
 		}
 		if (yych <= '$') {
 			if (yych <= '\r') {
-				if (yych == '\n') goto yy185;
-				if (yych <= '\f') goto yy195;
-				goto yy185;
+				if (yych == '\n') goto yy187;
+				if (yych <= '\f') goto yy197;
+				goto yy187;
 			} else {
-				if (yych == '"') goto yy185;
-				if (yych <= '#') goto yy195;
-				goto yy198;
+				if (yych == '"') goto yy187;
+				if (yych <= '#') goto yy197;
+				goto yy200;
 			}
 		} else {
 			if (yych <= ';') {
-				if (yych == '\'') goto yy185;
-				if (yych <= ':') goto yy195;
-				goto yy185;
+				if (yych == '\'') goto yy187;
+				if (yych <= ':') goto yy197;
+				goto yy187;
 			} else {
-				if (yych <= '[') goto yy195;
-				if (yych <= '\\') goto yy197;
-				if (yych <= ']') goto yy185;
-				goto yy195;
+				if (yych <= '[') goto yy197;
+				if (yych <= '\\') goto yy199;
+				if (yych <= ']') goto yy187;
+				goto yy197;
 			}
 		}
-yy210:
-		YYDEBUG(210, *YYCURSOR);
+yy212:
+		YYDEBUG(212, *YYCURSOR);
 		yyaccept = 2;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(211, *YYCURSOR);
+		YYDEBUG(213, *YYCURSOR);
 		if (yych <= '\'') {
 			if (yych <= '!') {
 				if (yych <= '\n') {
-					if (yych <= '\t') goto yy195;
-					goto yy185;
+					if (yych <= '\t') goto yy197;
+					goto yy187;
 				} else {
-					if (yych == '\r') goto yy185;
-					goto yy195;
+					if (yych == '\r') goto yy187;
+					goto yy197;
 				}
 			} else {
 				if (yych <= '#') {
-					if (yych <= '"') goto yy185;
-					goto yy195;
+					if (yych <= '"') goto yy187;
+					goto yy197;
 				} else {
-					if (yych <= '$') goto yy198;
-					if (yych <= '&') goto yy195;
-					goto yy185;
+					if (yych <= '$') goto yy200;
+					if (yych <= '&') goto yy197;
+					goto yy187;
 				}
 			}
 		} else {
 			if (yych <= ':') {
 				if (yych <= '.') {
-					if (yych <= '-') goto yy195;
-					goto yy208;
+					if (yych <= '-') goto yy197;
+					goto yy210;
 				} else {
-					if (yych <= '/') goto yy195;
-					if (yych <= '9') goto yy210;
-					goto yy195;
+					if (yych <= '/') goto yy197;
+					if (yych <= '9') goto yy212;
+					goto yy197;
 				}
 			} else {
 				if (yych <= '[') {
-					if (yych <= ';') goto yy185;
-					goto yy195;
+					if (yych <= ';') goto yy187;
+					goto yy197;
 				} else {
-					if (yych <= '\\') goto yy197;
-					if (yych <= ']') goto yy185;
-					goto yy195;
+					if (yych <= '\\') goto yy199;
+					if (yych <= ']') goto yy187;
+					goto yy197;
 				}
 			}
 		}
-yy212:
-		YYDEBUG(212, *YYCURSOR);
+yy214:
+		YYDEBUG(214, *YYCURSOR);
 		yyaccept = 2;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(213, *YYCURSOR);
+		YYDEBUG(215, *YYCURSOR);
 		if (yych <= '&') {
 			if (yych <= '\r') {
-				if (yych == '\n') goto yy185;
-				if (yych <= '\f') goto yy195;
-				goto yy185;
+				if (yych == '\n') goto yy187;
+				if (yych <= '\f') goto yy197;
+				goto yy187;
 			} else {
 				if (yych <= '"') {
-					if (yych <= '!') goto yy195;
-					goto yy185;
+					if (yych <= '!') goto yy197;
+					goto yy187;
 				} else {
-					if (yych == '$') goto yy198;
-					goto yy195;
+					if (yych == '$') goto yy200;
+					goto yy197;
 				}
 			}
 		} else {
 			if (yych <= ':') {
-				if (yych <= '\'') goto yy185;
-				if (yych <= '/') goto yy195;
-				if (yych <= '9') goto yy212;
-				goto yy195;
+				if (yych <= '\'') goto yy187;
+				if (yych <= '/') goto yy197;
+				if (yych <= '9') goto yy214;
+				goto yy197;
 			} else {
 				if (yych <= '[') {
-					if (yych <= ';') goto yy185;
-					goto yy195;
+					if (yych <= ';') goto yy187;
+					goto yy197;
 				} else {
-					if (yych <= '\\') goto yy197;
-					if (yych <= ']') goto yy185;
-					goto yy195;
+					if (yych <= '\\') goto yy199;
+					if (yych <= ']') goto yy187;
+					goto yy197;
 				}
 			}
 		}
-yy214:
-		YYDEBUG(214, *YYCURSOR);
+yy216:
+		YYDEBUG(216, *YYCURSOR);
 		yyaccept = 2;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(215, *YYCURSOR);
+		YYDEBUG(217, *YYCURSOR);
 		if (yych <= '&') {
 			if (yych <= '\r') {
-				if (yych == '\n') goto yy185;
-				if (yych <= '\f') goto yy195;
-				goto yy185;
+				if (yych == '\n') goto yy187;
+				if (yych <= '\f') goto yy197;
+				goto yy187;
 			} else {
 				if (yych <= '"') {
-					if (yych <= '!') goto yy195;
-					goto yy185;
+					if (yych <= '!') goto yy197;
+					goto yy187;
 				} else {
-					if (yych == '$') goto yy198;
-					goto yy195;
+					if (yych == '$') goto yy200;
+					goto yy197;
 				}
 			}
 		} else {
 			if (yych <= ':') {
-				if (yych <= '\'') goto yy185;
-				if (yych <= '/') goto yy195;
-				if (yych <= '9') goto yy214;
-				goto yy195;
+				if (yych <= '\'') goto yy187;
+				if (yych <= '/') goto yy197;
+				if (yych <= '9') goto yy216;
+				goto yy197;
 			} else {
 				if (yych <= '[') {
-					if (yych <= ';') goto yy185;
-					goto yy195;
+					if (yych <= ';') goto yy187;
+					goto yy197;
 				} else {
-					if (yych <= '\\') goto yy197;
-					if (yych <= ']') goto yy185;
-					goto yy195;
+					if (yych <= '\\') goto yy199;
+					if (yych <= ']') goto yy187;
+					goto yy197;
 				}
 			}
 		}
-yy216:
-		YYDEBUG(216, *YYCURSOR);
+yy218:
+		YYDEBUG(218, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(217, *YYCURSOR);
+		YYDEBUG(219, *YYCURSOR);
 		if (yybm[0+yych] & 128) {
-			goto yy216;
+			goto yy218;
 		}
-		YYDEBUG(218, *YYCURSOR);
+		YYDEBUG(220, *YYCURSOR);
 		++YYCURSOR;
-		YYDEBUG(219, *YYCURSOR);
+		YYDEBUG(221, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
 #line 368 "Zend/zend_ini_scanner.l"
 		{ /* Raw string */
@@ -2697,65 +2735,65 @@ yy216:
 	}
 	RETURN_TOKEN(TC_RAW, yytext, yyleng);
 }
-#line 2701 "Zend/zend_ini_scanner.c"
-yy220:
-		YYDEBUG(220, *YYCURSOR);
+#line 2739 "Zend/zend_ini_scanner.c"
+yy222:
+		YYDEBUG(222, *YYCURSOR);
 		++YYCURSOR;
-		YYDEBUG(221, *YYCURSOR);
+		YYDEBUG(223, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
 #line 401 "Zend/zend_ini_scanner.l"
 		{ /* Variable start */
 	yy_push_state(ST_VARNAME TSRMLS_CC);
 	return TC_DOLLAR_CURLY;
 }
-#line 2712 "Zend/zend_ini_scanner.c"
-yy222:
-		YYDEBUG(222, *YYCURSOR);
+#line 2750 "Zend/zend_ini_scanner.c"
+yy224:
+		YYDEBUG(224, *YYCURSOR);
 		yyaccept = 0;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(223, *YYCURSOR);
+		YYDEBUG(225, *YYCURSOR);
 		if (yych <= '"') {
 			if (yych <= '\f') {
-				if (yych <= 0x08) goto yy195;
-				if (yych <= '\t') goto yy222;
-				if (yych <= '\n') goto yy174;
-				goto yy195;
+				if (yych <= 0x08) goto yy197;
+				if (yych <= '\t') goto yy224;
+				if (yych <= '\n') goto yy176;
+				goto yy197;
 			} else {
 				if (yych <= 0x1F) {
-					if (yych <= '\r') goto yy174;
-					goto yy195;
+					if (yych <= '\r') goto yy176;
+					goto yy197;
 				} else {
-					if (yych <= ' ') goto yy222;
-					if (yych <= '!') goto yy195;
+					if (yych <= ' ') goto yy224;
+					if (yych <= '!') goto yy197;
 				}
 			}
 		} else {
 			if (yych <= ':') {
 				if (yych <= '$') {
-					if (yych <= '#') goto yy195;
-					goto yy198;
+					if (yych <= '#') goto yy197;
+					goto yy200;
 				} else {
-					if (yych == '\'') goto yy174;
-					goto yy195;
+					if (yych == '\'') goto yy176;
+					goto yy197;
 				}
 			} else {
 				if (yych <= '[') {
-					if (yych <= ';') goto yy174;
-					goto yy195;
+					if (yych <= ';') goto yy176;
+					goto yy197;
 				} else {
-					if (yych <= '\\') goto yy197;
-					if (yych <= ']') goto yy174;
-					goto yy195;
+					if (yych <= '\\') goto yy199;
+					if (yych <= ']') goto yy176;
+					goto yy197;
 				}
 			}
 		}
-yy224:
-		YYDEBUG(224, *YYCURSOR);
+yy226:
+		YYDEBUG(226, *YYCURSOR);
 		++YYCURSOR;
 		yych = *YYCURSOR;
-		goto yy179;
+		goto yy181;
 	}
 /* *********************************** */
 yyc_ST_VALUE:
@@ -2794,27 +2832,27 @@ yyc_ST_VALUE:
 			162, 162, 162, 162, 162, 162, 162, 162, 
 			162, 162, 162, 162, 162, 162, 162, 162, 
 		};
-		YYDEBUG(225, *YYCURSOR);
+		YYDEBUG(227, *YYCURSOR);
 		YYFILL(6);
 		yych = *YYCURSOR;
 		YYDEBUG(-1, yych);
 		switch (yych) {
-		case 0x00:	goto yy227;
+		case 0x00:	goto yy229;
 		case '\t':
-		case ' ':	goto yy231;
-		case '\n':	goto yy233;
-		case '\r':	goto yy235;
+		case ' ':	goto yy233;
+		case '\n':	goto yy235;
+		case '\r':	goto yy237;
 		case '!':
 		case '&':
 		case '(':
 		case ')':
 		case '|':
-		case '~':	goto yy236;
-		case '"':	goto yy238;
-		case '$':	goto yy240;
-		case '\'':	goto yy241;
-		case '-':	goto yy242;
-		case '.':	goto yy243;
+		case '~':	goto yy238;
+		case '"':	goto yy240;
+		case '$':	goto yy242;
+		case '\'':	goto yy243;
+		case '-':	goto yy244;
+		case '.':	goto yy245;
 		case '0':
 		case '1':
 		case '2':
@@ -2824,9 +2862,9 @@ yyc_ST_VALUE:
 		case '6':
 		case '7':
 		case '8':
-		case '9':	goto yy244;
-		case ';':	goto yy246;
-		case '=':	goto yy247;
+		case '9':	goto yy246;
+		case ';':	goto yy248;
+		case '=':	goto yy249;
 		case 'A':
 		case 'B':
 		case 'C':
@@ -2869,1529 +2907,1529 @@ yyc_ST_VALUE:
 		case 'v':
 		case 'w':
 		case 'x':
-		case 'z':	goto yy249;
+		case 'z':	goto yy251;
 		case 'F':
-		case 'f':	goto yy251;
+		case 'f':	goto yy253;
 		case 'N':
-		case 'n':	goto yy252;
+		case 'n':	goto yy254;
 		case 'O':
-		case 'o':	goto yy253;
+		case 'o':	goto yy255;
 		case 'T':
-		case 't':	goto yy254;
+		case 't':	goto yy256;
 		case 'Y':
-		case 'y':	goto yy255;
-		default:	goto yy229;
+		case 'y':	goto yy257;
+		default:	goto yy231;
 		}
-yy227:
-		YYDEBUG(227, *YYCURSOR);
+yy229:
+		YYDEBUG(229, *YYCURSOR);
 		++YYCURSOR;
-yy228:
-		YYDEBUG(228, *YYCURSOR);
+yy230:
+		YYDEBUG(230, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 570 "Zend/zend_ini_scanner.l"
+#line 591 "Zend/zend_ini_scanner.l"
 		{ /* End of option value (if EOF is reached before EOL */
 	BEGIN(INITIAL);
 	return END_OF_LINE;
 }
-#line 2897 "Zend/zend_ini_scanner.c"
-yy229:
-		YYDEBUG(229, *YYCURSOR);
+#line 2935 "Zend/zend_ini_scanner.c"
+yy231:
+		YYDEBUG(231, *YYCURSOR);
 		yyaccept = 0;
 		yych = *(YYMARKER = ++YYCURSOR);
-		goto yy257;
-yy230:
-		YYDEBUG(230, *YYCURSOR);
+		goto yy259;
+yy232:
+		YYDEBUG(232, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 489 "Zend/zend_ini_scanner.l"
+#line 510 "Zend/zend_ini_scanner.l"
 		{ /* Get everything else as option/offset value */
 	RETURN_TOKEN(TC_STRING, yytext, yyleng);
 }
-#line 2910 "Zend/zend_ini_scanner.c"
-yy231:
-		YYDEBUG(231, *YYCURSOR);
+#line 2948 "Zend/zend_ini_scanner.c"
+yy233:
+		YYDEBUG(233, *YYCURSOR);
 		yyaccept = 1;
 		yych = *(YYMARKER = ++YYCURSOR);
-		goto yy307;
-yy232:
-		YYDEBUG(232, *YYCURSOR);
+		goto yy309;
+yy234:
+		YYDEBUG(234, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 543 "Zend/zend_ini_scanner.l"
+#line 564 "Zend/zend_ini_scanner.l"
 		{
 	RETURN_TOKEN(TC_WHITESPACE, yytext, yyleng);
 }
-#line 2923 "Zend/zend_ini_scanner.c"
-yy233:
-		YYDEBUG(233, *YYCURSOR);
+#line 2961 "Zend/zend_ini_scanner.c"
+yy235:
+		YYDEBUG(235, *YYCURSOR);
 		++YYCURSOR;
-yy234:
-		YYDEBUG(234, *YYCURSOR);
+yy236:
+		YYDEBUG(236, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 461 "Zend/zend_ini_scanner.l"
+#line 482 "Zend/zend_ini_scanner.l"
 		{ /* End of option value */
 	BEGIN(INITIAL);
 	SCNG(lineno)++;
 	return END_OF_LINE;
 }
-#line 2936 "Zend/zend_ini_scanner.c"
-yy235:
-		YYDEBUG(235, *YYCURSOR);
+#line 2974 "Zend/zend_ini_scanner.c"
+yy237:
+		YYDEBUG(237, *YYCURSOR);
 		yych = *++YYCURSOR;
-		if (yych == '\n') goto yy305;
-		goto yy234;
-yy236:
-		YYDEBUG(236, *YYCURSOR);
+		if (yych == '\n') goto yy307;
+		goto yy236;
+yy238:
+		YYDEBUG(238, *YYCURSOR);
 		++YYCURSOR;
 		yych = *YYCURSOR;
-		goto yy304;
-yy237:
-		YYDEBUG(237, *YYCURSOR);
+		goto yy306;
+yy239:
+		YYDEBUG(239, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 479 "Zend/zend_ini_scanner.l"
+#line 500 "Zend/zend_ini_scanner.l"
 		{ /* Boolean operators */
 	return yytext[0];
 }
-#line 2954 "Zend/zend_ini_scanner.c"
-yy238:
-		YYDEBUG(238, *YYCURSOR);
+#line 2992 "Zend/zend_ini_scanner.c"
+yy240:
+		YYDEBUG(240, *YYCURSOR);
 		++YYCURSOR;
-yy239:
-		YYDEBUG(239, *YYCURSOR);
+yy241:
+		YYDEBUG(241, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 497 "Zend/zend_ini_scanner.l"
+#line 518 "Zend/zend_ini_scanner.l"
 		{ /* Double quoted '"' string start */
 	yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC);
 	return '"';
 }
-#line 2966 "Zend/zend_ini_scanner.c"
-yy240:
-		YYDEBUG(240, *YYCURSOR);
+#line 3004 "Zend/zend_ini_scanner.c"
+yy242:
+		YYDEBUG(242, *YYCURSOR);
 		yych = *++YYCURSOR;
 		if (yych <= '\\') {
-			if (yych <= 0x00) goto yy228;
-			if (yych <= '[') goto yy256;
-			goto yy263;
+			if (yych <= 0x00) goto yy230;
+			if (yych <= '[') goto yy258;
+			goto yy265;
 		} else {
-			if (yych == '{') goto yy301;
-			goto yy256;
+			if (yych == '{') goto yy303;
+			goto yy258;
 		}
-yy241:
-		YYDEBUG(241, *YYCURSOR);
+yy243:
+		YYDEBUG(243, *YYCURSOR);
 		yyaccept = 2;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yybm[0+yych] & 128) {
-			goto yy297;
+			goto yy299;
 		}
-		goto yy228;
-yy242:
-		YYDEBUG(242, *YYCURSOR);
+		goto yy230;
+yy244:
+		YYDEBUG(244, *YYCURSOR);
 		yyaccept = 0;
 		yych = *(YYMARKER = ++YYCURSOR);
-		if (yych <= '/') goto yy257;
-		if (yych <= '9') goto yy295;
-		goto yy257;
-yy243:
-		YYDEBUG(243, *YYCURSOR);
+		if (yych <= '/') goto yy259;
+		if (yych <= '9') goto yy297;
+		goto yy259;
+yy245:
+		YYDEBUG(245, *YYCURSOR);
 		yyaccept = 0;
 		yych = *(YYMARKER = ++YYCURSOR);
-		if (yych <= '/') goto yy257;
-		if (yych <= '9') goto yy293;
-		goto yy257;
-yy244:
-		YYDEBUG(244, *YYCURSOR);
+		if (yych <= '/') goto yy259;
+		if (yych <= '9') goto yy295;
+		goto yy259;
+yy246:
+		YYDEBUG(246, *YYCURSOR);
 		yyaccept = 3;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '.') {
 			if (yych <= '\r') {
 				if (yych <= 0x08) {
-					if (yych >= 0x01) goto yy257;
+					if (yych >= 0x01) goto yy259;
 				} else {
-					if (yych <= '\n') goto yy245;
-					if (yych <= '\f') goto yy257;
+					if (yych <= '\n') goto yy247;
+					if (yych <= '\f') goto yy259;
 				}
 			} else {
 				if (yych <= '%') {
-					if (yych <= 0x1F) goto yy257;
-					if (yych >= '#') goto yy257;
+					if (yych <= 0x1F) goto yy259;
+					if (yych >= '#') goto yy259;
 				} else {
-					if (yych <= ')') goto yy245;
-					if (yych <= '-') goto yy257;
-					goto yy289;
+					if (yych <= ')') goto yy247;
+					if (yych <= '-') goto yy259;
+					goto yy291;
 				}
 			}
 		} else {
 			if (yych <= '<') {
 				if (yych <= '9') {
-					if (yych <= '/') goto yy257;
-					goto yy291;
+					if (yych <= '/') goto yy259;
+					goto yy293;
 				} else {
-					if (yych != ';') goto yy257;
+					if (yych != ';') goto yy259;
 				}
 			} else {
 				if (yych <= '|') {
-					if (yych <= '=') goto yy245;
-					if (yych <= '{') goto yy257;
+					if (yych <= '=') goto yy247;
+					if (yych <= '{') goto yy259;
 				} else {
-					if (yych != '~') goto yy257;
+					if (yych != '~') goto yy259;
 				}
 			}
 		}
-yy245:
-		YYDEBUG(245, *YYCURSOR);
+yy247:
+		YYDEBUG(247, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 471 "Zend/zend_ini_scanner.l"
+#line 492 "Zend/zend_ini_scanner.l"
 		{ /* Get number option value as string */
 	RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
 }
-#line 3046 "Zend/zend_ini_scanner.c"
-yy246:
-		YYDEBUG(246, *YYCURSOR);
+#line 3084 "Zend/zend_ini_scanner.c"
+yy248:
+		YYDEBUG(248, *YYCURSOR);
 		yyaccept = 2;
 		yych = *(YYMARKER = ++YYCURSOR);
-		goto yy285;
-yy247:
-		YYDEBUG(247, *YYCURSOR);
+		goto yy287;
+yy249:
+		YYDEBUG(249, *YYCURSOR);
 		++YYCURSOR;
-		YYDEBUG(248, *YYCURSOR);
+		YYDEBUG(250, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 483 "Zend/zend_ini_scanner.l"
+#line 504 "Zend/zend_ini_scanner.l"
 		{ /* Make = used in option value to trigger error */
 	yyless(0);
 	BEGIN(INITIAL);
 	return END_OF_LINE;
 }
-#line 3063 "Zend/zend_ini_scanner.c"
-yy249:
-		YYDEBUG(249, *YYCURSOR);
+#line 3101 "Zend/zend_ini_scanner.c"
+yy251:
+		YYDEBUG(251, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yybm[0+yych] & 4) {
-			goto yy258;
+			goto yy260;
 		}
 		if (yych <= ')') {
 			if (yych <= '\f') {
-				if (yych <= 0x00) goto yy250;
-				if (yych <= 0x08) goto yy257;
-				if (yych >= '\v') goto yy257;
+				if (yych <= 0x00) goto yy252;
+				if (yych <= 0x08) goto yy259;
+				if (yych >= '\v') goto yy259;
 			} else {
 				if (yych <= 0x1F) {
-					if (yych >= 0x0E) goto yy257;
+					if (yych >= 0x0E) goto yy259;
 				} else {
-					if (yych <= '"') goto yy250;
-					if (yych <= '%') goto yy257;
+					if (yych <= '"') goto yy252;
+					if (yych <= '%') goto yy259;
 				}
 			}
 		} else {
 			if (yych <= '=') {
-				if (yych == ';') goto yy250;
-				if (yych <= '<') goto yy257;
+				if (yych == ';') goto yy252;
+				if (yych <= '<') goto yy259;
 			} else {
 				if (yych <= '|') {
-					if (yych <= '{') goto yy257;
+					if (yych <= '{') goto yy259;
 				} else {
-					if (yych != '~') goto yy257;
+					if (yych != '~') goto yy259;
 				}
 			}
 		}
-yy250:
-		YYDEBUG(250, *YYCURSOR);
+yy252:
+		YYDEBUG(252, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 467 "Zend/zend_ini_scanner.l"
+#line 488 "Zend/zend_ini_scanner.l"
 		{ /* Get constant option value */
 	RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
 }
-#line 3103 "Zend/zend_ini_scanner.c"
-yy251:
-		YYDEBUG(251, *YYCURSOR);
+#line 3141 "Zend/zend_ini_scanner.c"
+yy253:
+		YYDEBUG(253, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '<') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '/') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					goto yy257;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					goto yy259;
 				} else {
-					if (yych <= '9') goto yy258;
-					if (yych == ';') goto yy250;
-					goto yy257;
+					if (yych <= '9') goto yy260;
+					if (yych == ';') goto yy252;
+					goto yy259;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'A') {
-					if (yych <= '=') goto yy250;
-					if (yych <= '@') goto yy257;
-					goto yy281;
+					if (yych <= '=') goto yy252;
+					if (yych <= '@') goto yy259;
+					goto yy283;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych <= 'a') goto yy281;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych <= 'a') goto yy283;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy252:
-		YYDEBUG(252, *YYCURSOR);
+yy254:
+		YYDEBUG(254, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= 'N') {
 			if (yych <= '%') {
 				if (yych <= '\f') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					if (yych <= '\n') goto yy250;
-					goto yy257;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					if (yych <= '\n') goto yy252;
+					goto yy259;
 				} else {
-					if (yych <= '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					if (yych <= '"') goto yy250;
-					goto yy257;
+					if (yych <= '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					if (yych <= '"') goto yy252;
+					goto yy259;
 				}
 			} else {
 				if (yych <= ':') {
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					if (yych <= '9') goto yy258;
-					goto yy257;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					if (yych <= '9') goto yy260;
+					goto yy259;
 				} else {
 					if (yych <= '<') {
-						if (yych <= ';') goto yy250;
-						goto yy257;
+						if (yych <= ';') goto yy252;
+						goto yy259;
 					} else {
-						if (yych <= '=') goto yy250;
-						if (yych <= '@') goto yy257;
-						goto yy258;
+						if (yych <= '=') goto yy252;
+						if (yych <= '@') goto yy259;
+						goto yy260;
 					}
 				}
 			}
 		} else {
 			if (yych <= 'n') {
 				if (yych <= 'Z') {
-					if (yych <= 'O') goto yy277;
-					if (yych == 'U') goto yy278;
-					goto yy258;
+					if (yych <= 'O') goto yy279;
+					if (yych == 'U') goto yy280;
+					goto yy260;
 				} else {
-					if (yych == '_') goto yy258;
-					if (yych <= '`') goto yy257;
-					goto yy258;
+					if (yych == '_') goto yy260;
+					if (yych <= '`') goto yy259;
+					goto yy260;
 				}
 			} else {
 				if (yych <= 'z') {
-					if (yych <= 'o') goto yy277;
-					if (yych == 'u') goto yy278;
-					goto yy258;
+					if (yych <= 'o') goto yy279;
+					if (yych == 'u') goto yy280;
+					goto yy260;
 				} else {
 					if (yych <= '|') {
-						if (yych <= '{') goto yy257;
-						goto yy250;
+						if (yych <= '{') goto yy259;
+						goto yy252;
 					} else {
-						if (yych == '~') goto yy250;
-						goto yy257;
+						if (yych == '~') goto yy252;
+						goto yy259;
 					}
 				}
 			}
 		}
-yy253:
-		YYDEBUG(253, *YYCURSOR);
+yy255:
+		YYDEBUG(255, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= 'E') {
 			if (yych <= '%') {
 				if (yych <= '\f') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					if (yych <= '\n') goto yy250;
-					goto yy257;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					if (yych <= '\n') goto yy252;
+					goto yy259;
 				} else {
-					if (yych <= '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					if (yych <= '"') goto yy250;
-					goto yy257;
+					if (yych <= '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					if (yych <= '"') goto yy252;
+					goto yy259;
 				}
 			} else {
 				if (yych <= ':') {
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					if (yych <= '9') goto yy258;
-					goto yy257;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					if (yych <= '9') goto yy260;
+					goto yy259;
 				} else {
 					if (yych <= '<') {
-						if (yych <= ';') goto yy250;
-						goto yy257;
+						if (yych <= ';') goto yy252;
+						goto yy259;
 					} else {
-						if (yych <= '=') goto yy250;
-						if (yych <= '@') goto yy257;
-						goto yy258;
+						if (yych <= '=') goto yy252;
+						if (yych <= '@') goto yy259;
+						goto yy260;
 					}
 				}
 			}
 		} else {
 			if (yych <= 'e') {
 				if (yych <= 'Z') {
-					if (yych <= 'F') goto yy272;
-					if (yych == 'N') goto yy266;
-					goto yy258;
+					if (yych <= 'F') goto yy274;
+					if (yych == 'N') goto yy268;
+					goto yy260;
 				} else {
-					if (yych == '_') goto yy258;
-					if (yych <= '`') goto yy257;
-					goto yy258;
+					if (yych == '_') goto yy260;
+					if (yych <= '`') goto yy259;
+					goto yy260;
 				}
 			} else {
 				if (yych <= 'z') {
-					if (yych <= 'f') goto yy272;
-					if (yych == 'n') goto yy266;
-					goto yy258;
+					if (yych <= 'f') goto yy274;
+					if (yych == 'n') goto yy268;
+					goto yy260;
 				} else {
 					if (yych <= '|') {
-						if (yych <= '{') goto yy257;
-						goto yy250;
+						if (yych <= '{') goto yy259;
+						goto yy252;
 					} else {
-						if (yych == '~') goto yy250;
-						goto yy257;
+						if (yych == '~') goto yy252;
+						goto yy259;
 					}
 				}
 			}
 		}
-yy254:
-		YYDEBUG(254, *YYCURSOR);
+yy256:
+		YYDEBUG(256, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'R') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'Q') goto yy258;
-					goto yy270;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'Q') goto yy260;
+					goto yy272;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'r') goto yy270;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'r') goto yy272;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy255:
-		YYDEBUG(255, *YYCURSOR);
+yy257:
+		YYDEBUG(257, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'E') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'D') goto yy258;
-					goto yy260;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'D') goto yy260;
+					goto yy262;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'e') goto yy260;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'e') goto yy262;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy256:
-		YYDEBUG(256, *YYCURSOR);
+yy258:
+		YYDEBUG(258, *YYCURSOR);
 		yyaccept = 0;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-yy257:
-		YYDEBUG(257, *YYCURSOR);
+yy259:
+		YYDEBUG(259, *YYCURSOR);
 		if (yybm[0+yych] & 2) {
-			goto yy256;
+			goto yy258;
 		}
-		if (yych == '$') goto yy261;
-		goto yy230;
-yy258:
-		YYDEBUG(258, *YYCURSOR);
+		if (yych == '$') goto yy263;
+		goto yy232;
+yy260:
+		YYDEBUG(260, *YYCURSOR);
 		yyaccept = 4;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(259, *YYCURSOR);
+		YYDEBUG(261, *YYCURSOR);
 		if (yybm[0+yych] & 4) {
-			goto yy258;
+			goto yy260;
 		}
 		if (yych <= '%') {
 			if (yych <= '\r') {
 				if (yych <= 0x08) {
-					if (yych <= 0x00) goto yy250;
-					goto yy256;
+					if (yych <= 0x00) goto yy252;
+					goto yy258;
 				} else {
-					if (yych <= '\n') goto yy250;
-					if (yych <= '\f') goto yy256;
-					goto yy250;
+					if (yych <= '\n') goto yy252;
+					if (yych <= '\f') goto yy258;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '"') {
-					if (yych <= 0x1F) goto yy256;
-					goto yy250;
+					if (yych <= 0x1F) goto yy258;
+					goto yy252;
 				} else {
-					if (yych == '$') goto yy261;
-					goto yy256;
+					if (yych == '$') goto yy263;
+					goto yy258;
 				}
 			}
 		} else {
 			if (yych <= '=') {
 				if (yych <= ':') {
-					if (yych <= ')') goto yy250;
-					goto yy256;
+					if (yych <= ')') goto yy252;
+					goto yy258;
 				} else {
-					if (yych == '<') goto yy256;
-					goto yy250;
+					if (yych == '<') goto yy258;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '|') {
-					if (yych <= '{') goto yy256;
-					goto yy250;
+					if (yych <= '{') goto yy258;
+					goto yy252;
 				} else {
-					if (yych == '~') goto yy250;
-					goto yy256;
+					if (yych == '~') goto yy252;
+					goto yy258;
 				}
 			}
 		}
-yy260:
-		YYDEBUG(260, *YYCURSOR);
+yy262:
+		YYDEBUG(262, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'S') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'R') goto yy258;
-					goto yy266;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'R') goto yy260;
+					goto yy268;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 's') goto yy266;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 's') goto yy268;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy261:
-		YYDEBUG(261, *YYCURSOR);
+yy263:
+		YYDEBUG(263, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
 		if (yych <= '\\') {
-			if (yych <= 0x00) goto yy262;
-			if (yych <= '[') goto yy256;
-			goto yy263;
+			if (yych <= 0x00) goto yy264;
+			if (yych <= '[') goto yy258;
+			goto yy265;
 		} else {
-			if (yych != '{') goto yy256;
+			if (yych != '{') goto yy258;
 		}
-yy262:
-		YYDEBUG(262, *YYCURSOR);
+yy264:
+		YYDEBUG(264, *YYCURSOR);
 		YYCURSOR = YYMARKER;
 		if (yyaccept <= 3) {
 			if (yyaccept <= 1) {
 				if (yyaccept <= 0) {
-					goto yy230;
-				} else {
 					goto yy232;
+				} else {
+					goto yy234;
 				}
 			} else {
 				if (yyaccept <= 2) {
-					goto yy228;
+					goto yy230;
 				} else {
-					goto yy245;
+					goto yy247;
 				}
 			}
 		} else {
 			if (yyaccept <= 5) {
 				if (yyaccept <= 4) {
-					goto yy250;
+					goto yy252;
 				} else {
-					goto yy267;
+					goto yy269;
 				}
 			} else {
-				goto yy274;
+				goto yy276;
 			}
 		}
-yy263:
-		YYDEBUG(263, *YYCURSOR);
+yy265:
+		YYDEBUG(265, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
 		if (yybm[0+yych] & 8) {
-			goto yy264;
+			goto yy266;
 		}
-		goto yy256;
-yy264:
-		YYDEBUG(264, *YYCURSOR);
+		goto yy258;
+yy266:
+		YYDEBUG(266, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(265, *YYCURSOR);
+		YYDEBUG(267, *YYCURSOR);
 		if (yybm[0+yych] & 8) {
-			goto yy264;
+			goto yy266;
 		}
-		if (yych <= 0x00) goto yy230;
-		if (yych == '\\') goto yy263;
-		goto yy256;
-yy266:
-		YYDEBUG(266, *YYCURSOR);
+		if (yych <= 0x00) goto yy232;
+		if (yych == '\\') goto yy265;
+		goto yy258;
+yy268:
+		YYDEBUG(268, *YYCURSOR);
 		yyaccept = 5;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yybm[0+yych] & 16) {
-			goto yy268;
+			goto yy270;
 		}
 		if (yych <= ';') {
 			if (yych <= ' ') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy267;
-					if (yych <= '\t') goto yy257;
+					if (yych <= 0x00) goto yy269;
+					if (yych <= '\t') goto yy259;
 				} else {
-					if (yych != '\r') goto yy257;
+					if (yych != '\r') goto yy259;
 				}
 			} else {
 				if (yych <= ')') {
-					if (yych <= '"') goto yy267;
-					if (yych <= '%') goto yy257;
+					if (yych <= '"') goto yy269;
+					if (yych <= '%') goto yy259;
 				} else {
-					if (yych <= '/') goto yy257;
-					if (yych <= '9') goto yy258;
-					if (yych <= ':') goto yy257;
+					if (yych <= '/') goto yy259;
+					if (yych <= '9') goto yy260;
+					if (yych <= ':') goto yy259;
 				}
 			}
 		} else {
 			if (yych <= '_') {
 				if (yych <= '@') {
-					if (yych != '=') goto yy257;
+					if (yych != '=') goto yy259;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych <= '^') goto yy257;
-					goto yy258;
+					if (yych <= 'Z') goto yy260;
+					if (yych <= '^') goto yy259;
+					goto yy260;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych <= '`') goto yy257;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych <= '`') goto yy259;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych >= 0x7F) goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych >= 0x7F) goto yy259;
 				}
 			}
 		}
-yy267:
-		YYDEBUG(267, *YYCURSOR);
+yy269:
+		YYDEBUG(269, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
 #line 421 "Zend/zend_ini_scanner.l"
 		{ /* TRUE value (when used outside option value/offset this causes parse error!) */
 	RETURN_TOKEN(BOOL_TRUE, "1", 1);
 }
-#line 3599 "Zend/zend_ini_scanner.c"
-yy268:
-		YYDEBUG(268, *YYCURSOR);
+#line 3637 "Zend/zend_ini_scanner.c"
+yy270:
+		YYDEBUG(270, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(269, *YYCURSOR);
+		YYDEBUG(271, *YYCURSOR);
 		if (yybm[0+yych] & 16) {
-			goto yy268;
+			goto yy270;
 		}
-		goto yy267;
-yy270:
-		YYDEBUG(270, *YYCURSOR);
+		goto yy269;
+yy272:
+		YYDEBUG(272, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'U') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'T') goto yy258;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'T') goto yy260;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'u') goto yy271;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'u') goto yy273;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy271:
-		YYDEBUG(271, *YYCURSOR);
+yy273:
+		YYDEBUG(273, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'E') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'D') goto yy258;
-					goto yy266;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'D') goto yy260;
+					goto yy268;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'e') goto yy266;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'e') goto yy268;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy272:
-		YYDEBUG(272, *YYCURSOR);
+yy274:
+		YYDEBUG(274, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'F') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'E') goto yy258;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'E') goto yy260;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'f') goto yy273;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'f') goto yy275;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy273:
-		YYDEBUG(273, *YYCURSOR);
+yy275:
+		YYDEBUG(275, *YYCURSOR);
 		yyaccept = 6;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yybm[0+yych] & 4) {
-			goto yy258;
+			goto yy260;
 		}
 		if (yych <= '%') {
 			if (yych <= '\f') {
 				if (yych <= 0x08) {
-					if (yych >= 0x01) goto yy257;
+					if (yych >= 0x01) goto yy259;
 				} else {
-					if (yych <= '\t') goto yy275;
-					if (yych >= '\v') goto yy257;
+					if (yych <= '\t') goto yy277;
+					if (yych >= '\v') goto yy259;
 				}
 			} else {
 				if (yych <= 0x1F) {
-					if (yych >= 0x0E) goto yy257;
+					if (yych >= 0x0E) goto yy259;
 				} else {
-					if (yych <= ' ') goto yy275;
-					if (yych >= '#') goto yy257;
+					if (yych <= ' ') goto yy277;
+					if (yych >= '#') goto yy259;
 				}
 			}
 		} else {
 			if (yych <= '=') {
 				if (yych <= ':') {
-					if (yych >= '*') goto yy257;
+					if (yych >= '*') goto yy259;
 				} else {
-					if (yych == '<') goto yy257;
+					if (yych == '<') goto yy259;
 				}
 			} else {
 				if (yych <= '|') {
-					if (yych <= '{') goto yy257;
+					if (yych <= '{') goto yy259;
 				} else {
-					if (yych != '~') goto yy257;
+					if (yych != '~') goto yy259;
 				}
 			}
 		}
-yy274:
-		YYDEBUG(274, *YYCURSOR);
+yy276:
+		YYDEBUG(276, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
 #line 425 "Zend/zend_ini_scanner.l"
 		{ /* FALSE value (when used outside option value/offset this causes parse error!)*/
 	RETURN_TOKEN(BOOL_FALSE, "", 0);
 }
-#line 3803 "Zend/zend_ini_scanner.c"
-yy275:
-		YYDEBUG(275, *YYCURSOR);
+#line 3841 "Zend/zend_ini_scanner.c"
+yy277:
+		YYDEBUG(277, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(276, *YYCURSOR);
-		if (yych == '\t') goto yy275;
-		if (yych == ' ') goto yy275;
-		goto yy274;
-yy277:
-		YYDEBUG(277, *YYCURSOR);
+		YYDEBUG(278, *YYCURSOR);
+		if (yych == '\t') goto yy277;
+		if (yych == ' ') goto yy277;
+		goto yy276;
+yy279:
+		YYDEBUG(279, *YYCURSOR);
 		yyaccept = 6;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '<') {
 			if (yych <= ' ') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy274;
-					if (yych <= 0x08) goto yy257;
-					if (yych <= '\t') goto yy275;
-					goto yy274;
+					if (yych <= 0x00) goto yy276;
+					if (yych <= 0x08) goto yy259;
+					if (yych <= '\t') goto yy277;
+					goto yy276;
 				} else {
-					if (yych == '\r') goto yy274;
-					if (yych <= 0x1F) goto yy257;
-					goto yy275;
+					if (yych == '\r') goto yy276;
+					if (yych <= 0x1F) goto yy259;
+					goto yy277;
 				}
 			} else {
 				if (yych <= '/') {
-					if (yych <= '"') goto yy274;
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy274;
-					goto yy257;
+					if (yych <= '"') goto yy276;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy276;
+					goto yy259;
 				} else {
-					if (yych <= '9') goto yy258;
-					if (yych == ';') goto yy274;
-					goto yy257;
+					if (yych <= '9') goto yy260;
+					if (yych == ';') goto yy276;
+					goto yy259;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'N') {
-					if (yych <= '=') goto yy274;
-					if (yych <= '@') goto yy257;
-					if (yych <= 'M') goto yy258;
-					goto yy280;
+					if (yych <= '=') goto yy276;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'M') goto yy260;
+					goto yy282;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'n') goto yy280;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'n') goto yy282;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy274;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy276;
+					goto yy259;
 				}
 			}
 		}
-yy278:
-		YYDEBUG(278, *YYCURSOR);
+yy280:
+		YYDEBUG(280, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'L') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'K') goto yy258;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'K') goto yy260;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'l') goto yy279;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'l') goto yy281;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy279:
-		YYDEBUG(279, *YYCURSOR);
+yy281:
+		YYDEBUG(281, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'L') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'K') goto yy258;
-					goto yy273;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'K') goto yy260;
+					goto yy275;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'l') goto yy273;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'l') goto yy275;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy280:
-		YYDEBUG(280, *YYCURSOR);
+yy282:
+		YYDEBUG(282, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'E') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'D') goto yy258;
-					goto yy273;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'D') goto yy260;
+					goto yy275;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'e') goto yy273;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'e') goto yy275;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy281:
-		YYDEBUG(281, *YYCURSOR);
+yy283:
+		YYDEBUG(283, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'L') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'K') goto yy258;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'K') goto yy260;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'l') goto yy282;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'l') goto yy284;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy282:
-		YYDEBUG(282, *YYCURSOR);
+yy284:
+		YYDEBUG(284, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'S') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'R') goto yy258;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'R') goto yy260;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 's') goto yy283;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 's') goto yy285;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy283:
-		YYDEBUG(283, *YYCURSOR);
+yy285:
+		YYDEBUG(285, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'E') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'D') goto yy258;
-					goto yy273;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'D') goto yy260;
+					goto yy275;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'e') goto yy273;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'e') goto yy275;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy284:
-		YYDEBUG(284, *YYCURSOR);
+yy286:
+		YYDEBUG(286, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(2);
 		yych = *YYCURSOR;
-yy285:
-		YYDEBUG(285, *YYCURSOR);
+yy287:
+		YYDEBUG(287, *YYCURSOR);
 		if (yybm[0+yych] & 32) {
-			goto yy284;
+			goto yy286;
 		}
-		if (yych >= '\r') goto yy288;
-yy286:
-		YYDEBUG(286, *YYCURSOR);
+		if (yych >= '\r') goto yy290;
+yy288:
+		YYDEBUG(288, *YYCURSOR);
 		++YYCURSOR;
-yy287:
-		YYDEBUG(287, *YYCURSOR);
+yy289:
+		YYDEBUG(289, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 557 "Zend/zend_ini_scanner.l"
+#line 578 "Zend/zend_ini_scanner.l"
 		{ /* Comment */
 	BEGIN(INITIAL);
 	SCNG(lineno)++;
 	return END_OF_LINE;
 }
-#line 4185 "Zend/zend_ini_scanner.c"
-yy288:
-		YYDEBUG(288, *YYCURSOR);
+#line 4223 "Zend/zend_ini_scanner.c"
+yy290:
+		YYDEBUG(290, *YYCURSOR);
 		yych = *++YYCURSOR;
-		if (yych == '\n') goto yy286;
-		goto yy287;
-yy289:
-		YYDEBUG(289, *YYCURSOR);
+		if (yych == '\n') goto yy288;
+		goto yy289;
+yy291:
+		YYDEBUG(291, *YYCURSOR);
 		yyaccept = 3;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(290, *YYCURSOR);
+		YYDEBUG(292, *YYCURSOR);
 		if (yybm[0+yych] & 64) {
-			goto yy289;
+			goto yy291;
 		}
 		if (yych <= '%') {
 			if (yych <= '\r') {
 				if (yych <= 0x08) {
-					if (yych <= 0x00) goto yy245;
-					goto yy256;
+					if (yych <= 0x00) goto yy247;
+					goto yy258;
 				} else {
-					if (yych <= '\n') goto yy245;
-					if (yych <= '\f') goto yy256;
-					goto yy245;
+					if (yych <= '\n') goto yy247;
+					if (yych <= '\f') goto yy258;
+					goto yy247;
 				}
 			} else {
 				if (yych <= '"') {
-					if (yych <= 0x1F) goto yy256;
-					goto yy245;
+					if (yych <= 0x1F) goto yy258;
+					goto yy247;
 				} else {
-					if (yych == '$') goto yy261;
-					goto yy256;
+					if (yych == '$') goto yy263;
+					goto yy258;
 				}
 			}
 		} else {
 			if (yych <= '=') {
 				if (yych <= ':') {
-					if (yych <= ')') goto yy245;
-					goto yy256;
+					if (yych <= ')') goto yy247;
+					goto yy258;
 				} else {
-					if (yych == '<') goto yy256;
-					goto yy245;
+					if (yych == '<') goto yy258;
+					goto yy247;
 				}
 			} else {
 				if (yych <= '|') {
-					if (yych <= '{') goto yy256;
-					goto yy245;
+					if (yych <= '{') goto yy258;
+					goto yy247;
 				} else {
-					if (yych == '~') goto yy245;
-					goto yy256;
+					if (yych == '~') goto yy247;
+					goto yy258;
 				}
 			}
 		}
-yy291:
-		YYDEBUG(291, *YYCURSOR);
+yy293:
+		YYDEBUG(293, *YYCURSOR);
 		yyaccept = 3;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(292, *YYCURSOR);
+		YYDEBUG(294, *YYCURSOR);
 		if (yych <= '-') {
 			if (yych <= 0x1F) {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy245;
-					if (yych <= 0x08) goto yy256;
-					goto yy245;
+					if (yych <= 0x00) goto yy247;
+					if (yych <= 0x08) goto yy258;
+					goto yy247;
 				} else {
-					if (yych == '\r') goto yy245;
-					goto yy256;
+					if (yych == '\r') goto yy247;
+					goto yy258;
 				}
 			} else {
 				if (yych <= '$') {
-					if (yych <= '"') goto yy245;
-					if (yych <= '#') goto yy256;
-					goto yy261;
+					if (yych <= '"') goto yy247;
+					if (yych <= '#') goto yy258;
+					goto yy263;
 				} else {
-					if (yych <= '%') goto yy256;
-					if (yych <= ')') goto yy245;
-					goto yy256;
+					if (yych <= '%') goto yy258;
+					if (yych <= ')') goto yy247;
+					goto yy258;
 				}
 			}
 		} else {
 			if (yych <= '<') {
 				if (yych <= '9') {
-					if (yych <= '.') goto yy289;
-					if (yych <= '/') goto yy256;
-					goto yy291;
+					if (yych <= '.') goto yy291;
+					if (yych <= '/') goto yy258;
+					goto yy293;
 				} else {
-					if (yych == ';') goto yy245;
-					goto yy256;
+					if (yych == ';') goto yy247;
+					goto yy258;
 				}
 			} else {
 				if (yych <= '|') {
-					if (yych <= '=') goto yy245;
-					if (yych <= '{') goto yy256;
-					goto yy245;
+					if (yych <= '=') goto yy247;
+					if (yych <= '{') goto yy258;
+					goto yy247;
 				} else {
-					if (yych == '~') goto yy245;
-					goto yy256;
+					if (yych == '~') goto yy247;
+					goto yy258;
 				}
 			}
 		}
-yy293:
-		YYDEBUG(293, *YYCURSOR);
+yy295:
+		YYDEBUG(295, *YYCURSOR);
 		yyaccept = 3;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(294, *YYCURSOR);
+		YYDEBUG(296, *YYCURSOR);
 		if (yych <= ')') {
 			if (yych <= '\r') {
 				if (yych <= 0x08) {
-					if (yych <= 0x00) goto yy245;
-					goto yy256;
+					if (yych <= 0x00) goto yy247;
+					goto yy258;
 				} else {
-					if (yych <= '\n') goto yy245;
-					if (yych <= '\f') goto yy256;
-					goto yy245;
+					if (yych <= '\n') goto yy247;
+					if (yych <= '\f') goto yy258;
+					goto yy247;
 				}
 			} else {
 				if (yych <= '#') {
-					if (yych <= 0x1F) goto yy256;
-					if (yych <= '"') goto yy245;
-					goto yy256;
+					if (yych <= 0x1F) goto yy258;
+					if (yych <= '"') goto yy247;
+					goto yy258;
 				} else {
-					if (yych <= '$') goto yy261;
-					if (yych <= '%') goto yy256;
-					goto yy245;
+					if (yych <= '$') goto yy263;
+					if (yych <= '%') goto yy258;
+					goto yy247;
 				}
 			}
 		} else {
 			if (yych <= '<') {
 				if (yych <= '9') {
-					if (yych <= '/') goto yy256;
-					goto yy293;
+					if (yych <= '/') goto yy258;
+					goto yy295;
 				} else {
-					if (yych == ';') goto yy245;
-					goto yy256;
+					if (yych == ';') goto yy247;
+					goto yy258;
 				}
 			} else {
 				if (yych <= '|') {
-					if (yych <= '=') goto yy245;
-					if (yych <= '{') goto yy256;
-					goto yy245;
+					if (yych <= '=') goto yy247;
+					if (yych <= '{') goto yy258;
+					goto yy247;
 				} else {
-					if (yych == '~') goto yy245;
-					goto yy256;
+					if (yych == '~') goto yy247;
+					goto yy258;
 				}
 			}
 		}
-yy295:
-		YYDEBUG(295, *YYCURSOR);
+yy297:
+		YYDEBUG(297, *YYCURSOR);
 		yyaccept = 3;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(296, *YYCURSOR);
+		YYDEBUG(298, *YYCURSOR);
 		if (yych <= ')') {
 			if (yych <= '\r') {
 				if (yych <= 0x08) {
-					if (yych <= 0x00) goto yy245;
-					goto yy256;
+					if (yych <= 0x00) goto yy247;
+					goto yy258;
 				} else {
-					if (yych <= '\n') goto yy245;
-					if (yych <= '\f') goto yy256;
-					goto yy245;
+					if (yych <= '\n') goto yy247;
+					if (yych <= '\f') goto yy258;
+					goto yy247;
 				}
 			} else {
 				if (yych <= '#') {
-					if (yych <= 0x1F) goto yy256;
-					if (yych <= '"') goto yy245;
-					goto yy256;
+					if (yych <= 0x1F) goto yy258;
+					if (yych <= '"') goto yy247;
+					goto yy258;
 				} else {
-					if (yych <= '$') goto yy261;
-					if (yych <= '%') goto yy256;
-					goto yy245;
+					if (yych <= '$') goto yy263;
+					if (yych <= '%') goto yy258;
+					goto yy247;
 				}
 			}
 		} else {
 			if (yych <= '<') {
 				if (yych <= '9') {
-					if (yych <= '/') goto yy256;
-					goto yy295;
+					if (yych <= '/') goto yy258;
+					goto yy297;
 				} else {
-					if (yych == ';') goto yy245;
-					goto yy256;
+					if (yych == ';') goto yy247;
+					goto yy258;
 				}
 			} else {
 				if (yych <= '|') {
-					if (yych <= '=') goto yy245;
-					if (yych <= '{') goto yy256;
-					goto yy245;
+					if (yych <= '=') goto yy247;
+					if (yych <= '{') goto yy258;
+					goto yy247;
 				} else {
-					if (yych == '~') goto yy245;
-					goto yy256;
+					if (yych == '~') goto yy247;
+					goto yy258;
 				}
 			}
 		}
-yy297:
-		YYDEBUG(297, *YYCURSOR);
+yy299:
+		YYDEBUG(299, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(298, *YYCURSOR);
+		YYDEBUG(300, *YYCURSOR);
 		if (yybm[0+yych] & 128) {
-			goto yy297;
+			goto yy299;
 		}
-		YYDEBUG(299, *YYCURSOR);
+		YYDEBUG(301, *YYCURSOR);
 		++YYCURSOR;
-		YYDEBUG(300, *YYCURSOR);
+		YYDEBUG(302, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
 #line 368 "Zend/zend_ini_scanner.l"
 		{ /* Raw string */
@@ -4402,66 +4440,66 @@ yy297:
 	}
 	RETURN_TOKEN(TC_RAW, yytext, yyleng);
 }
-#line 4406 "Zend/zend_ini_scanner.c"
-yy301:
-		YYDEBUG(301, *YYCURSOR);
+#line 4444 "Zend/zend_ini_scanner.c"
+yy303:
+		YYDEBUG(303, *YYCURSOR);
 		++YYCURSOR;
-		YYDEBUG(302, *YYCURSOR);
+		YYDEBUG(304, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
 #line 401 "Zend/zend_ini_scanner.l"
 		{ /* Variable start */
 	yy_push_state(ST_VARNAME TSRMLS_CC);
 	return TC_DOLLAR_CURLY;
 }
-#line 4417 "Zend/zend_ini_scanner.c"
-yy303:
-		YYDEBUG(303, *YYCURSOR);
+#line 4455 "Zend/zend_ini_scanner.c"
+yy305:
+		YYDEBUG(305, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-yy304:
-		YYDEBUG(304, *YYCURSOR);
-		if (yych == '\t') goto yy303;
-		if (yych == ' ') goto yy303;
-		goto yy237;
-yy305:
-		YYDEBUG(305, *YYCURSOR);
-		yych = *++YYCURSOR;
-		goto yy234;
 yy306:
 		YYDEBUG(306, *YYCURSOR);
+		if (yych == '\t') goto yy305;
+		if (yych == ' ') goto yy305;
+		goto yy239;
+yy307:
+		YYDEBUG(307, *YYCURSOR);
+		yych = *++YYCURSOR;
+		goto yy236;
+yy308:
+		YYDEBUG(308, *YYCURSOR);
 		yyaccept = 1;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(2);
 		yych = *YYCURSOR;
-yy307:
-		YYDEBUG(307, *YYCURSOR);
+yy309:
+		YYDEBUG(309, *YYCURSOR);
 		if (yych <= 0x1F) {
 			if (yych <= '\n') {
-				if (yych <= 0x08) goto yy232;
-				if (yych <= '\t') goto yy306;
-				goto yy305;
+				if (yych <= 0x08) goto yy234;
+				if (yych <= '\t') goto yy308;
+				goto yy307;
 			} else {
-				if (yych == '\r') goto yy309;
-				goto yy232;
+				if (yych == '\r') goto yy311;
+				goto yy234;
 			}
 		} else {
 			if (yych <= '"') {
-				if (yych <= ' ') goto yy306;
-				if (yych <= '!') goto yy232;
+				if (yych <= ' ') goto yy308;
+				if (yych <= '!') goto yy234;
 			} else {
-				if (yych == ';') goto yy284;
-				goto yy232;
+				if (yych == ';') goto yy286;
+				goto yy234;
 			}
 		}
-		YYDEBUG(308, *YYCURSOR);
+		YYDEBUG(310, *YYCURSOR);
 		yych = *++YYCURSOR;
-		goto yy239;
-yy309:
-		YYDEBUG(309, *YYCURSOR);
+		goto yy241;
+yy311:
+		YYDEBUG(311, *YYCURSOR);
 		++YYCURSOR;
-		if ((yych = *YYCURSOR) == '\n') goto yy305;
-		goto yy234;
+		if ((yych = *YYCURSOR) == '\n') goto yy307;
+		goto yy236;
 	}
 /* *********************************** */
 yyc_ST_VARNAME:
@@ -4500,47 +4538,47 @@ yyc_ST_VARNAME:
 			128, 128, 128, 128, 128, 128, 128, 128, 
 			128, 128, 128, 128, 128, 128, 128, 128, 
 		};
-		YYDEBUG(310, *YYCURSOR);
+		YYDEBUG(312, *YYCURSOR);
 		YYFILL(2);
 		yych = *YYCURSOR;
 		if (yych <= '\'') {
 			if (yych <= ' ') {
 				if (yych <= '\n') {
-					if (yych >= '\t') goto yy314;
+					if (yych >= '\t') goto yy316;
 				} else {
-					if (yych == '\r') goto yy314;
+					if (yych == '\r') goto yy316;
 				}
 			} else {
 				if (yych <= '$') {
-					if (yych != '#') goto yy314;
+					if (yych != '#') goto yy316;
 				} else {
-					if (yych == '&') goto yy314;
+					if (yych == '&') goto yy316;
 				}
 			}
 		} else {
 			if (yych <= 'Z') {
 				if (yych <= ';') {
-					if (yych <= ')') goto yy314;
-					if (yych >= ';') goto yy314;
+					if (yych <= ')') goto yy316;
+					if (yych >= ';') goto yy316;
 				} else {
-					if (yych == '=') goto yy314;
+					if (yych == '=') goto yy316;
 				}
 			} else {
 				if (yych <= '|') {
-					if (yych <= '[') goto yy314;
-					if (yych >= '{') goto yy314;
+					if (yych <= '[') goto yy316;
+					if (yych >= '{') goto yy316;
 				} else {
-					if (yych <= '}') goto yy316;
-					if (yych <= '~') goto yy314;
+					if (yych <= '}') goto yy318;
+					if (yych <= '~') goto yy316;
 				}
 			}
 		}
-		YYDEBUG(312, *YYCURSOR);
+		YYDEBUG(314, *YYCURSOR);
 		++YYCURSOR;
 		yych = *YYCURSOR;
-		goto yy319;
-yy313:
-		YYDEBUG(313, *YYCURSOR);
+		goto yy321;
+yy315:
+		YYDEBUG(315, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
 #line 406 "Zend/zend_ini_scanner.l"
 		{ /* Variable name */
@@ -4552,41 +4590,41 @@ yy313:
 
 	RETURN_TOKEN(TC_VARNAME, yytext, yyleng);
 }
-#line 4556 "Zend/zend_ini_scanner.c"
-yy314:
-		YYDEBUG(314, *YYCURSOR);
+#line 4594 "Zend/zend_ini_scanner.c"
+yy316:
+		YYDEBUG(316, *YYCURSOR);
 		++YYCURSOR;
-		YYDEBUG(315, *YYCURSOR);
+		YYDEBUG(317, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 575 "Zend/zend_ini_scanner.l"
+#line 596 "Zend/zend_ini_scanner.l"
 		{
 	return 0;
 }
-#line 4566 "Zend/zend_ini_scanner.c"
-yy316:
-		YYDEBUG(316, *YYCURSOR);
+#line 4604 "Zend/zend_ini_scanner.c"
+yy318:
+		YYDEBUG(318, *YYCURSOR);
 		++YYCURSOR;
-		YYDEBUG(317, *YYCURSOR);
+		YYDEBUG(319, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
 #line 416 "Zend/zend_ini_scanner.l"
 		{ /* Variable end */
 	yy_pop_state(TSRMLS_C);
 	return '}';
 }
-#line 4577 "Zend/zend_ini_scanner.c"
-yy318:
-		YYDEBUG(318, *YYCURSOR);
+#line 4615 "Zend/zend_ini_scanner.c"
+yy320:
+		YYDEBUG(320, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-yy319:
-		YYDEBUG(319, *YYCURSOR);
+yy321:
+		YYDEBUG(321, *YYCURSOR);
 		if (yybm[0+yych] & 128) {
-			goto yy318;
+			goto yy320;
 		}
-		goto yy313;
+		goto yy315;
 	}
 }
-#line 579 "Zend/zend_ini_scanner.l"
+#line 600 "Zend/zend_ini_scanner.l"
 
 }
diff --git a/Zend/zend_ini_scanner_defs.h b/Zend/zend_ini_scanner_defs.h
index f7b9e1f..0c04713 100644
--- a/Zend/zend_ini_scanner_defs.h
+++ b/Zend/zend_ini_scanner_defs.h
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Fri Mar  2 11:49:21 2012 */
+/* Generated by re2c 0.13.5 on Thu Jun  7 17:48:25 2012 */
 #line 3 "Zend/zend_ini_scanner_defs.h"
 
 enum YYCONDTYPE {


commit 8e65ce35b930c31d3488d066beb06d0a28710e33
Merge: 494c170 4e6f27f
Author: Pierrick Charron <pierrick at php.net>
Date:   Thu Jun 7 18:02:49 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Regenerated files



commit 4e6f27f4db6121e67f17906b27cc829120738b71
Author: Pierrick Charron <pierrick at php.net>
Date:   Thu Jun 7 18:02:27 2012 +0200

    Regenerated files

diff --git a/Zend/zend_ini_scanner.c b/Zend/zend_ini_scanner.c
index de61aa2..26f9874 100644
--- a/Zend/zend_ini_scanner.c
+++ b/Zend/zend_ini_scanner.c
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Sat Feb 25 22:07:14 2012 */
+/* Generated by re2c 0.13.5 on Thu Jun  7 17:37:03 2012 */
 #line 1 "Zend/zend_ini_scanner.l"
 /*
    +----------------------------------------------------------------------+
@@ -481,7 +481,7 @@ yy4:
 yy5:
 		YYDEBUG(5, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 547 "Zend/zend_ini_scanner.l"
+#line 568 "Zend/zend_ini_scanner.l"
 		{
 	/* eat whitespace */
 	goto restart;
@@ -493,7 +493,7 @@ yy6:
 yy7:
 		YYDEBUG(7, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 552 "Zend/zend_ini_scanner.l"
+#line 573 "Zend/zend_ini_scanner.l"
 		{
 	SCNG(lineno)++;
 	return END_OF_LINE;
@@ -533,7 +533,7 @@ yy10:
 		++YYCURSOR;
 		YYDEBUG(11, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 475 "Zend/zend_ini_scanner.l"
+#line 496 "Zend/zend_ini_scanner.l"
 		{ /* Disallow these chars outside option values */
 	return yytext[0];
 }
@@ -554,7 +554,7 @@ yy14:
 		goto yy54;
 		YYDEBUG(15, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 575 "Zend/zend_ini_scanner.l"
+#line 596 "Zend/zend_ini_scanner.l"
 		{
 	return 0;
 }
@@ -926,7 +926,7 @@ yy55:
 yy56:
 		YYDEBUG(56, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 557 "Zend/zend_ini_scanner.l"
+#line 578 "Zend/zend_ini_scanner.l"
 		{ /* Comment */
 	BEGIN(INITIAL);
 	SCNG(lineno)++;
@@ -1012,7 +1012,7 @@ yy64:
 yy65:
 		YYDEBUG(65, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 563 "Zend/zend_ini_scanner.l"
+#line 584 "Zend/zend_ini_scanner.l"
 		{ /* #Comment */
 	zend_error(E_DEPRECATED, "Comments starting with '#' are deprecated in %s on line %d", zend_ini_scanner_get_filename(TSRMLS_C), SCNG(lineno));
 	BEGIN(INITIAL);
@@ -1159,7 +1159,7 @@ yyc_ST_DOUBLE_QUOTES:
 yy76:
 		YYDEBUG(76, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 507 "Zend/zend_ini_scanner.l"
+#line 528 "Zend/zend_ini_scanner.l"
 		{ /* Escape double quoted string contents */
 	if (YYCURSOR > YYLIMIT) {
 		return 0;
@@ -1204,7 +1204,7 @@ yy77:
 yy78:
 		YYDEBUG(78, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 502 "Zend/zend_ini_scanner.l"
+#line 523 "Zend/zend_ini_scanner.l"
 		{ /* Double quoted '"' string ends */
 	yy_pop_state(TSRMLS_C);
 	return '"';
@@ -1323,7 +1323,7 @@ yy86:
 yy87:
 		YYDEBUG(87, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 493 "Zend/zend_ini_scanner.l"
+#line 514 "Zend/zend_ini_scanner.l"
 		{ /* Get rest as section/offset value */
 	RETURN_TOKEN(TC_STRING, yytext, yyleng);
 }
@@ -1344,7 +1344,7 @@ yy89:
 yy90:
 		YYDEBUG(90, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 575 "Zend/zend_ini_scanner.l"
+#line 596 "Zend/zend_ini_scanner.l"
 		{
 	return 0;
 }
@@ -1355,7 +1355,7 @@ yy91:
 yy92:
 		YYDEBUG(92, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 497 "Zend/zend_ini_scanner.l"
+#line 518 "Zend/zend_ini_scanner.l"
 		{ /* Double quoted '"' string start */
 	yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC);
 	return '"';
@@ -1422,7 +1422,7 @@ yy97:
 yy98:
 		YYDEBUG(98, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 471 "Zend/zend_ini_scanner.l"
+#line 492 "Zend/zend_ini_scanner.l"
 		{ /* Get number option value as string */
 	RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
 }
@@ -1452,7 +1452,7 @@ yy99:
 yy100:
 		YYDEBUG(100, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 467 "Zend/zend_ini_scanner.l"
+#line 488 "Zend/zend_ini_scanner.l"
 		{ /* Get constant option value */
 	RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
 }
@@ -1833,7 +1833,7 @@ yyc_ST_RAW:
 			160, 224,   0, 160, 160,   0, 160, 160, 
 			160, 160, 160, 160, 160, 160, 160, 160, 
 			160, 160, 160, 160, 160, 160, 160, 160, 
-			224, 160, 160, 160, 160, 160, 160, 160, 
+			224, 160,  32, 160, 160, 160, 160, 160, 
 			160, 160, 160, 160, 160, 160, 160, 160, 
 			160, 160, 160, 160, 160, 160, 160, 160, 
 			160, 160, 160,  32, 160, 160, 160, 160, 
@@ -1865,66 +1865,64 @@ yyc_ST_RAW:
 		YYDEBUG(135, *YYCURSOR);
 		YYFILL(3);
 		yych = *YYCURSOR;
-		if (yych <= '\f') {
-			if (yych <= 0x08) {
-				if (yych >= 0x01) goto yy139;
+		if (yych <= '\r') {
+			if (yych <= '\t') {
+				if (yych <= 0x00) goto yy137;
+				if (yych <= 0x08) goto yy139;
+				goto yy141;
 			} else {
-				if (yych <= '\t') goto yy141;
 				if (yych <= '\n') goto yy142;
-				goto yy139;
+				if (yych <= '\f') goto yy139;
+				goto yy144;
 			}
 		} else {
-			if (yych <= ' ') {
-				if (yych <= '\r') goto yy144;
-				if (yych <= 0x1F) goto yy139;
-				goto yy141;
+			if (yych <= '!') {
+				if (yych == ' ') goto yy141;
+				goto yy139;
 			} else {
-				if (yych == ';') goto yy145;
+				if (yych <= '"') goto yy145;
+				if (yych == ';') goto yy147;
 				goto yy139;
 			}
 		}
+yy137:
 		YYDEBUG(137, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(138, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 570 "Zend/zend_ini_scanner.l"
+#line 591 "Zend/zend_ini_scanner.l"
 		{ /* End of option value (if EOF is reached before EOL */
 	BEGIN(INITIAL);
 	return END_OF_LINE;
 }
-#line 1896 "Zend/zend_ini_scanner.c"
+#line 1899 "Zend/zend_ini_scanner.c"
 yy139:
 		YYDEBUG(139, *YYCURSOR);
 		++YYCURSOR;
 		yych = *YYCURSOR;
-		goto yy156;
+		goto yy158;
 yy140:
 		YYDEBUG(140, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 448 "Zend/zend_ini_scanner.l"
+#line 474 "Zend/zend_ini_scanner.l"
 		{ /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
-	/* Eat leading and trailing double quotes */
-	if (yytext[0] == '"' && yytext[yyleng - 1] == '"') {
-		SCNG(yy_text)++;
-		yyleng = yyleng - 2;
-	}
 	RETURN_TOKEN(TC_RAW, yytext, yyleng);
 }
-#line 1914 "Zend/zend_ini_scanner.c"
+#line 1912 "Zend/zend_ini_scanner.c"
 yy141:
 		YYDEBUG(141, *YYCURSOR);
 		yyaccept = 0;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yybm[0+yych] & 64) {
-			goto yy152;
+			goto yy154;
 		}
 		if (yych <= '\f') {
-			if (yych == '\n') goto yy151;
-			goto yy156;
+			if (yych == '\n') goto yy153;
+			goto yy158;
 		} else {
-			if (yych <= '\r') goto yy154;
-			if (yych == ';') goto yy146;
-			goto yy156;
+			if (yych <= '\r') goto yy156;
+			if (yych == ';') goto yy148;
+			goto yy158;
 		}
 yy142:
 		YYDEBUG(142, *YYCURSOR);
@@ -1932,89 +1930,129 @@ yy142:
 yy143:
 		YYDEBUG(143, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 461 "Zend/zend_ini_scanner.l"
+#line 482 "Zend/zend_ini_scanner.l"
 		{ /* End of option value */
 	BEGIN(INITIAL);
 	SCNG(lineno)++;
 	return END_OF_LINE;
 }
-#line 1942 "Zend/zend_ini_scanner.c"
+#line 1940 "Zend/zend_ini_scanner.c"
 yy144:
 		YYDEBUG(144, *YYCURSOR);
 		yych = *++YYCURSOR;
-		if (yych == '\n') goto yy151;
+		if (yych == '\n') goto yy153;
 		goto yy143;
 yy145:
 		YYDEBUG(145, *YYCURSOR);
-		yyaccept = 1;
-		yych = *(YYMARKER = ++YYCURSOR);
-		goto yy147;
-yy146:
-		YYDEBUG(146, *YYCURSOR);
 		++YYCURSOR;
-		YYFILL(2);
-		yych = *YYCURSOR;
+		YYDEBUG(146, *YYCURSOR);
+		yyleng = YYCURSOR - SCNG(yy_text);
+#line 448 "Zend/zend_ini_scanner.l"
+		{
+	while (YYCURSOR < YYLIMIT) {
+		switch (*YYCURSOR++) {
+			case '\n':
+				SCNG(lineno)++;
+				break;
+			case '\r':
+				if (*YYCURSOR != '\n') {
+					SCNG(lineno)++;
+				}
+				break;
+			case '"':
+				yyleng = YYCURSOR - SCNG(yy_text) - 2;
+				SCNG(yy_text)++;
+				RETURN_TOKEN(TC_RAW, yytext, yyleng);
+			case '\\':
+				if (YYCURSOR < YYLIMIT) {
+					YYCURSOR++;
+				}
+				break;
+		}
+	}
+	yyleng = YYCURSOR - SCNG(yy_text);
+	RETURN_TOKEN(TC_RAW, yytext, yyleng);
+}
+#line 1977 "Zend/zend_ini_scanner.c"
 yy147:
 		YYDEBUG(147, *YYCURSOR);
-		if (yybm[0+yych] & 32) {
-			goto yy146;
-		}
-		if (yych >= '\r') goto yy150;
+		yyaccept = 1;
+		yych = *(YYMARKER = ++YYCURSOR);
+		goto yy149;
 yy148:
 		YYDEBUG(148, *YYCURSOR);
 		++YYCURSOR;
+		YYFILL(2);
+		yych = *YYCURSOR;
 yy149:
 		YYDEBUG(149, *YYCURSOR);
+		if (yybm[0+yych] & 32) {
+			goto yy148;
+		}
+		if (yych >= '\r') goto yy152;
+yy150:
+		YYDEBUG(150, *YYCURSOR);
+		++YYCURSOR;
+yy151:
+		YYDEBUG(151, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 557 "Zend/zend_ini_scanner.l"
+#line 578 "Zend/zend_ini_scanner.l"
 		{ /* Comment */
 	BEGIN(INITIAL);
 	SCNG(lineno)++;
 	return END_OF_LINE;
 }
-#line 1976 "Zend/zend_ini_scanner.c"
-yy150:
-		YYDEBUG(150, *YYCURSOR);
+#line 2006 "Zend/zend_ini_scanner.c"
+yy152:
+		YYDEBUG(152, *YYCURSOR);
 		yych = *++YYCURSOR;
-		if (yych == '\n') goto yy148;
-		goto yy149;
-yy151:
-		YYDEBUG(151, *YYCURSOR);
+		if (yych == '\n') goto yy150;
+		goto yy151;
+yy153:
+		YYDEBUG(153, *YYCURSOR);
 		yych = *++YYCURSOR;
 		goto yy143;
-yy152:
-		YYDEBUG(152, *YYCURSOR);
+yy154:
+		YYDEBUG(154, *YYCURSOR);
 		yyaccept = 0;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(2);
 		yych = *YYCURSOR;
-		YYDEBUG(153, *YYCURSOR);
+		YYDEBUG(155, *YYCURSOR);
 		if (yybm[0+yych] & 64) {
-			goto yy152;
+			goto yy154;
 		}
-		if (yych <= '\f') {
-			if (yych <= 0x00) goto yy140;
-			if (yych == '\n') goto yy151;
-			goto yy155;
+		if (yych <= '\r') {
+			if (yych <= '\t') {
+				if (yych <= 0x00) goto yy140;
+				goto yy157;
+			} else {
+				if (yych <= '\n') goto yy153;
+				if (yych <= '\f') goto yy157;
+			}
 		} else {
-			if (yych <= '\r') goto yy154;
-			if (yych == ';') goto yy146;
-			goto yy155;
+			if (yych <= '"') {
+				if (yych <= '!') goto yy157;
+				goto yy140;
+			} else {
+				if (yych == ';') goto yy148;
+				goto yy157;
+			}
 		}
-yy154:
-		YYDEBUG(154, *YYCURSOR);
+yy156:
+		YYDEBUG(156, *YYCURSOR);
 		yych = *++YYCURSOR;
-		if (yych == '\n') goto yy151;
+		if (yych == '\n') goto yy153;
 		goto yy143;
-yy155:
-		YYDEBUG(155, *YYCURSOR);
+yy157:
+		YYDEBUG(157, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-yy156:
-		YYDEBUG(156, *YYCURSOR);
+yy158:
+		YYDEBUG(158, *YYCURSOR);
 		if (yybm[0+yych] & 128) {
-			goto yy155;
+			goto yy157;
 		}
 		goto yy140;
 	}
@@ -2055,44 +2093,44 @@ yyc_ST_SECTION_RAW:
 			128, 128, 128, 128, 128, 128, 128, 128, 
 			128, 128, 128, 128, 128, 128, 128, 128, 
 		};
-		YYDEBUG(157, *YYCURSOR);
+		YYDEBUG(159, *YYCURSOR);
 		YYFILL(3);
 		yych = *YYCURSOR;
 		if (yych <= '\f') {
-			if (yych == '\n') goto yy161;
+			if (yych == '\n') goto yy163;
 		} else {
-			if (yych <= '\r') goto yy161;
-			if (yych == ']') goto yy163;
+			if (yych <= '\r') goto yy163;
+			if (yych == ']') goto yy165;
 		}
-		YYDEBUG(159, *YYCURSOR);
+		YYDEBUG(161, *YYCURSOR);
 		++YYCURSOR;
 		yych = *YYCURSOR;
-		goto yy170;
-yy160:
-		YYDEBUG(160, *YYCURSOR);
+		goto yy172;
+yy162:
+		YYDEBUG(162, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 457 "Zend/zend_ini_scanner.l"
+#line 478 "Zend/zend_ini_scanner.l"
 		{ /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
 	RETURN_TOKEN(TC_RAW, yytext, yyleng);
 }
-#line 2079 "Zend/zend_ini_scanner.c"
-yy161:
-		YYDEBUG(161, *YYCURSOR);
+#line 2117 "Zend/zend_ini_scanner.c"
+yy163:
+		YYDEBUG(163, *YYCURSOR);
 		++YYCURSOR;
-		YYDEBUG(162, *YYCURSOR);
+		YYDEBUG(164, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 575 "Zend/zend_ini_scanner.l"
+#line 596 "Zend/zend_ini_scanner.l"
 		{
 	return 0;
 }
-#line 2089 "Zend/zend_ini_scanner.c"
-yy163:
-		YYDEBUG(163, *YYCURSOR);
+#line 2127 "Zend/zend_ini_scanner.c"
+yy165:
+		YYDEBUG(165, *YYCURSOR);
 		++YYCURSOR;
 		yych = *YYCURSOR;
-		goto yy166;
-yy164:
-		YYDEBUG(164, *YYCURSOR);
+		goto yy168;
+yy166:
+		YYDEBUG(166, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
 #line 377 "Zend/zend_ini_scanner.l"
 		{ /* End of section */
@@ -2100,40 +2138,40 @@ yy164:
 	SCNG(lineno)++;
 	return ']';
 }
-#line 2104 "Zend/zend_ini_scanner.c"
-yy165:
-		YYDEBUG(165, *YYCURSOR);
+#line 2142 "Zend/zend_ini_scanner.c"
+yy167:
+		YYDEBUG(167, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(2);
 		yych = *YYCURSOR;
-yy166:
-		YYDEBUG(166, *YYCURSOR);
-		if (yybm[0+yych] & 64) {
-			goto yy165;
-		}
-		if (yych == '\n') goto yy167;
-		if (yych == '\r') goto yy168;
-		goto yy164;
-yy167:
-		YYDEBUG(167, *YYCURSOR);
-		yych = *++YYCURSOR;
-		goto yy164;
 yy168:
 		YYDEBUG(168, *YYCURSOR);
-		yych = *++YYCURSOR;
-		if (yych == '\n') goto yy167;
-		goto yy164;
+		if (yybm[0+yych] & 64) {
+			goto yy167;
+		}
+		if (yych == '\n') goto yy169;
+		if (yych == '\r') goto yy170;
+		goto yy166;
 yy169:
 		YYDEBUG(169, *YYCURSOR);
+		yych = *++YYCURSOR;
+		goto yy166;
+yy170:
+		YYDEBUG(170, *YYCURSOR);
+		yych = *++YYCURSOR;
+		if (yych == '\n') goto yy169;
+		goto yy166;
+yy171:
+		YYDEBUG(171, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-yy170:
-		YYDEBUG(170, *YYCURSOR);
+yy172:
+		YYDEBUG(172, *YYCURSOR);
 		if (yybm[0+yych] & 128) {
-			goto yy169;
+			goto yy171;
 		}
-		goto yy160;
+		goto yy162;
 	}
 /* *********************************** */
 yyc_ST_SECTION_VALUE:
@@ -2172,203 +2210,203 @@ yyc_ST_SECTION_VALUE:
 			132, 132, 132, 132, 132, 132, 132, 132, 
 			132, 132, 132, 132, 132, 132, 132, 132, 
 		};
-		YYDEBUG(171, *YYCURSOR);
+		YYDEBUG(173, *YYCURSOR);
 		YYFILL(3);
 		yych = *YYCURSOR;
 		if (yych <= '-') {
 			if (yych <= ' ') {
 				if (yych <= '\n') {
-					if (yych <= 0x08) goto yy173;
-					if (yych <= '\t') goto yy175;
-					goto yy176;
+					if (yych <= 0x08) goto yy175;
+					if (yych <= '\t') goto yy177;
+					goto yy178;
 				} else {
-					if (yych == '\r') goto yy176;
-					if (yych >= ' ') goto yy175;
+					if (yych == '\r') goto yy178;
+					if (yych >= ' ') goto yy177;
 				}
 			} else {
 				if (yych <= '$') {
-					if (yych == '"') goto yy178;
-					if (yych >= '$') goto yy180;
+					if (yych == '"') goto yy180;
+					if (yych >= '$') goto yy182;
 				} else {
-					if (yych == '\'') goto yy181;
-					if (yych >= '-') goto yy182;
+					if (yych == '\'') goto yy183;
+					if (yych >= '-') goto yy184;
 				}
 			}
 		} else {
 			if (yych <= 'Z') {
 				if (yych <= '9') {
-					if (yych <= '.') goto yy183;
-					if (yych >= '0') goto yy184;
+					if (yych <= '.') goto yy185;
+					if (yych >= '0') goto yy186;
 				} else {
-					if (yych == ';') goto yy176;
-					if (yych >= 'A') goto yy186;
+					if (yych == ';') goto yy178;
+					if (yych >= 'A') goto yy188;
 				}
 			} else {
 				if (yych <= '^') {
-					if (yych <= '[') goto yy173;
-					if (yych <= '\\') goto yy188;
-					if (yych <= ']') goto yy189;
+					if (yych <= '[') goto yy175;
+					if (yych <= '\\') goto yy190;
+					if (yych <= ']') goto yy191;
 				} else {
-					if (yych == '`') goto yy173;
-					if (yych <= 'z') goto yy186;
+					if (yych == '`') goto yy175;
+					if (yych <= 'z') goto yy188;
 				}
 			}
 		}
-yy173:
-		YYDEBUG(173, *YYCURSOR);
+yy175:
+		YYDEBUG(175, *YYCURSOR);
 		yyaccept = 0;
 		yych = *(YYMARKER = ++YYCURSOR);
-		goto yy196;
-yy174:
-		YYDEBUG(174, *YYCURSOR);
+		goto yy198;
+yy176:
+		YYDEBUG(176, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 493 "Zend/zend_ini_scanner.l"
+#line 514 "Zend/zend_ini_scanner.l"
 		{ /* Get rest as section/offset value */
 	RETURN_TOKEN(TC_STRING, yytext, yyleng);
 }
-#line 2230 "Zend/zend_ini_scanner.c"
-yy175:
-		YYDEBUG(175, *YYCURSOR);
+#line 2268 "Zend/zend_ini_scanner.c"
+yy177:
+		YYDEBUG(177, *YYCURSOR);
 		yyaccept = 0;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= 0x1F) {
-			if (yych == '\t') goto yy222;
-			goto yy196;
+			if (yych == '\t') goto yy224;
+			goto yy198;
 		} else {
-			if (yych <= ' ') goto yy222;
-			if (yych == '"') goto yy224;
-			goto yy196;
+			if (yych <= ' ') goto yy224;
+			if (yych == '"') goto yy226;
+			goto yy198;
 		}
-yy176:
-		YYDEBUG(176, *YYCURSOR);
+yy178:
+		YYDEBUG(178, *YYCURSOR);
 		++YYCURSOR;
-yy177:
-		YYDEBUG(177, *YYCURSOR);
+yy179:
+		YYDEBUG(179, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 575 "Zend/zend_ini_scanner.l"
+#line 596 "Zend/zend_ini_scanner.l"
 		{
 	return 0;
 }
-#line 2253 "Zend/zend_ini_scanner.c"
-yy178:
-		YYDEBUG(178, *YYCURSOR);
+#line 2291 "Zend/zend_ini_scanner.c"
+yy180:
+		YYDEBUG(180, *YYCURSOR);
 		++YYCURSOR;
-yy179:
-		YYDEBUG(179, *YYCURSOR);
+yy181:
+		YYDEBUG(181, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 497 "Zend/zend_ini_scanner.l"
+#line 518 "Zend/zend_ini_scanner.l"
 		{ /* Double quoted '"' string start */
 	yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC);
 	return '"';
 }
-#line 2265 "Zend/zend_ini_scanner.c"
-yy180:
-		YYDEBUG(180, *YYCURSOR);
+#line 2303 "Zend/zend_ini_scanner.c"
+yy182:
+		YYDEBUG(182, *YYCURSOR);
 		yych = *++YYCURSOR;
 		if (yych <= '\\') {
-			if (yych <= 0x00) goto yy177;
-			if (yych <= '[') goto yy195;
-			goto yy200;
+			if (yych <= 0x00) goto yy179;
+			if (yych <= '[') goto yy197;
+			goto yy202;
 		} else {
-			if (yych == '{') goto yy220;
-			goto yy195;
+			if (yych == '{') goto yy222;
+			goto yy197;
 		}
-yy181:
-		YYDEBUG(181, *YYCURSOR);
+yy183:
+		YYDEBUG(183, *YYCURSOR);
 		yyaccept = 1;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yybm[0+yych] & 128) {
-			goto yy216;
+			goto yy218;
 		}
-		goto yy177;
-yy182:
-		YYDEBUG(182, *YYCURSOR);
+		goto yy179;
+yy184:
+		YYDEBUG(184, *YYCURSOR);
 		yyaccept = 0;
 		yych = *(YYMARKER = ++YYCURSOR);
-		if (yych <= '/') goto yy196;
-		if (yych <= '9') goto yy214;
-		goto yy196;
-yy183:
-		YYDEBUG(183, *YYCURSOR);
+		if (yych <= '/') goto yy198;
+		if (yych <= '9') goto yy216;
+		goto yy198;
+yy185:
+		YYDEBUG(185, *YYCURSOR);
 		yyaccept = 0;
 		yych = *(YYMARKER = ++YYCURSOR);
-		if (yych <= '/') goto yy196;
-		if (yych <= '9') goto yy212;
-		goto yy196;
-yy184:
-		YYDEBUG(184, *YYCURSOR);
+		if (yych <= '/') goto yy198;
+		if (yych <= '9') goto yy214;
+		goto yy198;
+yy186:
+		YYDEBUG(186, *YYCURSOR);
 		yyaccept = 2;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '\'') {
 			if (yych <= '\r') {
-				if (yych == '\n') goto yy185;
-				if (yych <= '\f') goto yy196;
+				if (yych == '\n') goto yy187;
+				if (yych <= '\f') goto yy198;
 			} else {
-				if (yych == '"') goto yy185;
-				if (yych <= '&') goto yy196;
+				if (yych == '"') goto yy187;
+				if (yych <= '&') goto yy198;
 			}
 		} else {
 			if (yych <= '9') {
-				if (yych == '.') goto yy208;
-				if (yych <= '/') goto yy196;
-				goto yy210;
+				if (yych == '.') goto yy210;
+				if (yych <= '/') goto yy198;
+				goto yy212;
 			} else {
 				if (yych <= ';') {
-					if (yych <= ':') goto yy196;
+					if (yych <= ':') goto yy198;
 				} else {
-					if (yych != ']') goto yy196;
+					if (yych != ']') goto yy198;
 				}
 			}
 		}
-yy185:
-		YYDEBUG(185, *YYCURSOR);
+yy187:
+		YYDEBUG(187, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 471 "Zend/zend_ini_scanner.l"
+#line 492 "Zend/zend_ini_scanner.l"
 		{ /* Get number option value as string */
 	RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
 }
-#line 2331 "Zend/zend_ini_scanner.c"
-yy186:
-		YYDEBUG(186, *YYCURSOR);
+#line 2369 "Zend/zend_ini_scanner.c"
+yy188:
+		YYDEBUG(188, *YYCURSOR);
 		yyaccept = 3;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yybm[0+yych] & 32) {
-			goto yy206;
+			goto yy208;
 		}
 		if (yych <= '"') {
 			if (yych <= '\f') {
-				if (yych != '\n') goto yy196;
+				if (yych != '\n') goto yy198;
 			} else {
-				if (yych <= '\r') goto yy187;
-				if (yych <= '!') goto yy196;
+				if (yych <= '\r') goto yy189;
+				if (yych <= '!') goto yy198;
 			}
 		} else {
 			if (yych <= ':') {
-				if (yych != '\'') goto yy196;
+				if (yych != '\'') goto yy198;
 			} else {
-				if (yych <= ';') goto yy187;
-				if (yych != ']') goto yy196;
+				if (yych <= ';') goto yy189;
+				if (yych != ']') goto yy198;
 			}
 		}
-yy187:
-		YYDEBUG(187, *YYCURSOR);
+yy189:
+		YYDEBUG(189, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 467 "Zend/zend_ini_scanner.l"
+#line 488 "Zend/zend_ini_scanner.l"
 		{ /* Get constant option value */
 	RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
 }
-#line 2361 "Zend/zend_ini_scanner.c"
-yy188:
-		YYDEBUG(188, *YYCURSOR);
+#line 2399 "Zend/zend_ini_scanner.c"
+yy190:
+		YYDEBUG(190, *YYCURSOR);
 		yych = *++YYCURSOR;
-		goto yy195;
-yy189:
-		YYDEBUG(189, *YYCURSOR);
+		goto yy197;
+yy191:
+		YYDEBUG(191, *YYCURSOR);
 		++YYCURSOR;
 		yych = *YYCURSOR;
-		goto yy192;
-yy190:
-		YYDEBUG(190, *YYCURSOR);
+		goto yy194;
+yy192:
+		YYDEBUG(192, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
 #line 377 "Zend/zend_ini_scanner.l"
 		{ /* End of section */
@@ -2376,97 +2414,86 @@ yy190:
 	SCNG(lineno)++;
 	return ']';
 }
-#line 2380 "Zend/zend_ini_scanner.c"
-yy191:
-		YYDEBUG(191, *YYCURSOR);
+#line 2418 "Zend/zend_ini_scanner.c"
+yy193:
+		YYDEBUG(193, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(2);
 		yych = *YYCURSOR;
-yy192:
-		YYDEBUG(192, *YYCURSOR);
-		if (yybm[0+yych] & 2) {
-			goto yy191;
-		}
-		if (yych == '\n') goto yy193;
-		if (yych == '\r') goto yy194;
-		goto yy190;
-yy193:
-		YYDEBUG(193, *YYCURSOR);
-		yych = *++YYCURSOR;
-		goto yy190;
 yy194:
 		YYDEBUG(194, *YYCURSOR);
-		yych = *++YYCURSOR;
-		if (yych == '\n') goto yy193;
-		goto yy190;
+		if (yybm[0+yych] & 2) {
+			goto yy193;
+		}
+		if (yych == '\n') goto yy195;
+		if (yych == '\r') goto yy196;
+		goto yy192;
 yy195:
 		YYDEBUG(195, *YYCURSOR);
+		yych = *++YYCURSOR;
+		goto yy192;
+yy196:
+		YYDEBUG(196, *YYCURSOR);
+		yych = *++YYCURSOR;
+		if (yych == '\n') goto yy195;
+		goto yy192;
+yy197:
+		YYDEBUG(197, *YYCURSOR);
 		yyaccept = 0;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-yy196:
-		YYDEBUG(196, *YYCURSOR);
+yy198:
+		YYDEBUG(198, *YYCURSOR);
 		if (yybm[0+yych] & 4) {
-			goto yy195;
+			goto yy197;
 		}
-		if (yych == '$') goto yy198;
-		if (yych != '\\') goto yy174;
-yy197:
-		YYDEBUG(197, *YYCURSOR);
+		if (yych == '$') goto yy200;
+		if (yych != '\\') goto yy176;
+yy199:
+		YYDEBUG(199, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		goto yy195;
-yy198:
-		YYDEBUG(198, *YYCURSOR);
+		goto yy197;
+yy200:
+		YYDEBUG(200, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
 		if (yych <= '\\') {
-			if (yych <= 0x00) goto yy199;
-			if (yych <= '[') goto yy195;
-			goto yy200;
+			if (yych <= 0x00) goto yy201;
+			if (yych <= '[') goto yy197;
+			goto yy202;
 		} else {
-			if (yych != '{') goto yy195;
+			if (yych != '{') goto yy197;
 		}
-yy199:
-		YYDEBUG(199, *YYCURSOR);
+yy201:
+		YYDEBUG(201, *YYCURSOR);
 		YYCURSOR = YYMARKER;
 		if (yyaccept <= 1) {
 			if (yyaccept <= 0) {
-				goto yy174;
+				goto yy176;
 			} else {
-				goto yy177;
+				goto yy179;
 			}
 		} else {
 			if (yyaccept <= 2) {
-				goto yy185;
-			} else {
 				goto yy187;
+			} else {
+				goto yy189;
 			}
 		}
-yy200:
-		YYDEBUG(200, *YYCURSOR);
+yy202:
+		YYDEBUG(202, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
 		if (yybm[0+yych] & 8) {
-			goto yy201;
-		}
-		if (yych == '\\') goto yy203;
-		goto yy195;
-yy201:
-		YYDEBUG(201, *YYCURSOR);
-		++YYCURSOR;
-		YYFILL(1);
-		yych = *YYCURSOR;
-		YYDEBUG(202, *YYCURSOR);
-		if (yybm[0+yych] & 8) {
-			goto yy201;
+			goto yy203;
 		}
 		if (yych == '\\') goto yy205;
-		goto yy195;
+		goto yy197;
 yy203:
 		YYDEBUG(203, *YYCURSOR);
 		++YYCURSOR;
@@ -2474,219 +2501,230 @@ yy203:
 		yych = *YYCURSOR;
 		YYDEBUG(204, *YYCURSOR);
 		if (yybm[0+yych] & 8) {
-			goto yy201;
+			goto yy203;
 		}
-		if (yych == '\\') goto yy203;
-		goto yy195;
+		if (yych == '\\') goto yy207;
+		goto yy197;
 yy205:
 		YYDEBUG(205, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
+		YYDEBUG(206, *YYCURSOR);
 		if (yybm[0+yych] & 8) {
-			goto yy201;
+			goto yy203;
 		}
-		if (yych == '\\') goto yy203;
-		goto yy195;
-yy206:
-		YYDEBUG(206, *YYCURSOR);
+		if (yych == '\\') goto yy205;
+		goto yy197;
+yy207:
+		YYDEBUG(207, *YYCURSOR);
+		++YYCURSOR;
+		YYFILL(1);
+		yych = *YYCURSOR;
+		if (yybm[0+yych] & 8) {
+			goto yy203;
+		}
+		if (yych == '\\') goto yy205;
+		goto yy197;
+yy208:
+		YYDEBUG(208, *YYCURSOR);
 		yyaccept = 3;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(207, *YYCURSOR);
+		YYDEBUG(209, *YYCURSOR);
 		if (yybm[0+yych] & 32) {
-			goto yy206;
+			goto yy208;
 		}
 		if (yych <= '$') {
 			if (yych <= '\r') {
-				if (yych == '\n') goto yy187;
-				if (yych <= '\f') goto yy195;
-				goto yy187;
+				if (yych == '\n') goto yy189;
+				if (yych <= '\f') goto yy197;
+				goto yy189;
 			} else {
-				if (yych == '"') goto yy187;
-				if (yych <= '#') goto yy195;
-				goto yy198;
+				if (yych == '"') goto yy189;
+				if (yych <= '#') goto yy197;
+				goto yy200;
 			}
 		} else {
 			if (yych <= ';') {
-				if (yych == '\'') goto yy187;
-				if (yych <= ':') goto yy195;
-				goto yy187;
+				if (yych == '\'') goto yy189;
+				if (yych <= ':') goto yy197;
+				goto yy189;
 			} else {
-				if (yych <= '[') goto yy195;
-				if (yych <= '\\') goto yy197;
-				if (yych <= ']') goto yy187;
-				goto yy195;
+				if (yych <= '[') goto yy197;
+				if (yych <= '\\') goto yy199;
+				if (yych <= ']') goto yy189;
+				goto yy197;
 			}
 		}
-yy208:
-		YYDEBUG(208, *YYCURSOR);
+yy210:
+		YYDEBUG(210, *YYCURSOR);
 		yyaccept = 2;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(209, *YYCURSOR);
+		YYDEBUG(211, *YYCURSOR);
 		if (yybm[0+yych] & 64) {
-			goto yy208;
+			goto yy210;
 		}
 		if (yych <= '$') {
 			if (yych <= '\r') {
-				if (yych == '\n') goto yy185;
-				if (yych <= '\f') goto yy195;
-				goto yy185;
+				if (yych == '\n') goto yy187;
+				if (yych <= '\f') goto yy197;
+				goto yy187;
 			} else {
-				if (yych == '"') goto yy185;
-				if (yych <= '#') goto yy195;
-				goto yy198;
+				if (yych == '"') goto yy187;
+				if (yych <= '#') goto yy197;
+				goto yy200;
 			}
 		} else {
 			if (yych <= ';') {
-				if (yych == '\'') goto yy185;
-				if (yych <= ':') goto yy195;
-				goto yy185;
+				if (yych == '\'') goto yy187;
+				if (yych <= ':') goto yy197;
+				goto yy187;
 			} else {
-				if (yych <= '[') goto yy195;
-				if (yych <= '\\') goto yy197;
-				if (yych <= ']') goto yy185;
-				goto yy195;
+				if (yych <= '[') goto yy197;
+				if (yych <= '\\') goto yy199;
+				if (yych <= ']') goto yy187;
+				goto yy197;
 			}
 		}
-yy210:
-		YYDEBUG(210, *YYCURSOR);
+yy212:
+		YYDEBUG(212, *YYCURSOR);
 		yyaccept = 2;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(211, *YYCURSOR);
+		YYDEBUG(213, *YYCURSOR);
 		if (yych <= '\'') {
 			if (yych <= '!') {
 				if (yych <= '\n') {
-					if (yych <= '\t') goto yy195;
-					goto yy185;
+					if (yych <= '\t') goto yy197;
+					goto yy187;
 				} else {
-					if (yych == '\r') goto yy185;
-					goto yy195;
+					if (yych == '\r') goto yy187;
+					goto yy197;
 				}
 			} else {
 				if (yych <= '#') {
-					if (yych <= '"') goto yy185;
-					goto yy195;
+					if (yych <= '"') goto yy187;
+					goto yy197;
 				} else {
-					if (yych <= '$') goto yy198;
-					if (yych <= '&') goto yy195;
-					goto yy185;
+					if (yych <= '$') goto yy200;
+					if (yych <= '&') goto yy197;
+					goto yy187;
 				}
 			}
 		} else {
 			if (yych <= ':') {
 				if (yych <= '.') {
-					if (yych <= '-') goto yy195;
-					goto yy208;
+					if (yych <= '-') goto yy197;
+					goto yy210;
 				} else {
-					if (yych <= '/') goto yy195;
-					if (yych <= '9') goto yy210;
-					goto yy195;
+					if (yych <= '/') goto yy197;
+					if (yych <= '9') goto yy212;
+					goto yy197;
 				}
 			} else {
 				if (yych <= '[') {
-					if (yych <= ';') goto yy185;
-					goto yy195;
+					if (yych <= ';') goto yy187;
+					goto yy197;
 				} else {
-					if (yych <= '\\') goto yy197;
-					if (yych <= ']') goto yy185;
-					goto yy195;
+					if (yych <= '\\') goto yy199;
+					if (yych <= ']') goto yy187;
+					goto yy197;
 				}
 			}
 		}
-yy212:
-		YYDEBUG(212, *YYCURSOR);
+yy214:
+		YYDEBUG(214, *YYCURSOR);
 		yyaccept = 2;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(213, *YYCURSOR);
+		YYDEBUG(215, *YYCURSOR);
 		if (yych <= '&') {
 			if (yych <= '\r') {
-				if (yych == '\n') goto yy185;
-				if (yych <= '\f') goto yy195;
-				goto yy185;
+				if (yych == '\n') goto yy187;
+				if (yych <= '\f') goto yy197;
+				goto yy187;
 			} else {
 				if (yych <= '"') {
-					if (yych <= '!') goto yy195;
-					goto yy185;
+					if (yych <= '!') goto yy197;
+					goto yy187;
 				} else {
-					if (yych == '$') goto yy198;
-					goto yy195;
+					if (yych == '$') goto yy200;
+					goto yy197;
 				}
 			}
 		} else {
 			if (yych <= ':') {
-				if (yych <= '\'') goto yy185;
-				if (yych <= '/') goto yy195;
-				if (yych <= '9') goto yy212;
-				goto yy195;
+				if (yych <= '\'') goto yy187;
+				if (yych <= '/') goto yy197;
+				if (yych <= '9') goto yy214;
+				goto yy197;
 			} else {
 				if (yych <= '[') {
-					if (yych <= ';') goto yy185;
-					goto yy195;
+					if (yych <= ';') goto yy187;
+					goto yy197;
 				} else {
-					if (yych <= '\\') goto yy197;
-					if (yych <= ']') goto yy185;
-					goto yy195;
+					if (yych <= '\\') goto yy199;
+					if (yych <= ']') goto yy187;
+					goto yy197;
 				}
 			}
 		}
-yy214:
-		YYDEBUG(214, *YYCURSOR);
+yy216:
+		YYDEBUG(216, *YYCURSOR);
 		yyaccept = 2;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(215, *YYCURSOR);
+		YYDEBUG(217, *YYCURSOR);
 		if (yych <= '&') {
 			if (yych <= '\r') {
-				if (yych == '\n') goto yy185;
-				if (yych <= '\f') goto yy195;
-				goto yy185;
+				if (yych == '\n') goto yy187;
+				if (yych <= '\f') goto yy197;
+				goto yy187;
 			} else {
 				if (yych <= '"') {
-					if (yych <= '!') goto yy195;
-					goto yy185;
+					if (yych <= '!') goto yy197;
+					goto yy187;
 				} else {
-					if (yych == '$') goto yy198;
-					goto yy195;
+					if (yych == '$') goto yy200;
+					goto yy197;
 				}
 			}
 		} else {
 			if (yych <= ':') {
-				if (yych <= '\'') goto yy185;
-				if (yych <= '/') goto yy195;
-				if (yych <= '9') goto yy214;
-				goto yy195;
+				if (yych <= '\'') goto yy187;
+				if (yych <= '/') goto yy197;
+				if (yych <= '9') goto yy216;
+				goto yy197;
 			} else {
 				if (yych <= '[') {
-					if (yych <= ';') goto yy185;
-					goto yy195;
+					if (yych <= ';') goto yy187;
+					goto yy197;
 				} else {
-					if (yych <= '\\') goto yy197;
-					if (yych <= ']') goto yy185;
-					goto yy195;
+					if (yych <= '\\') goto yy199;
+					if (yych <= ']') goto yy187;
+					goto yy197;
 				}
 			}
 		}
-yy216:
-		YYDEBUG(216, *YYCURSOR);
+yy218:
+		YYDEBUG(218, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(217, *YYCURSOR);
+		YYDEBUG(219, *YYCURSOR);
 		if (yybm[0+yych] & 128) {
-			goto yy216;
+			goto yy218;
 		}
-		YYDEBUG(218, *YYCURSOR);
+		YYDEBUG(220, *YYCURSOR);
 		++YYCURSOR;
-		YYDEBUG(219, *YYCURSOR);
+		YYDEBUG(221, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
 #line 368 "Zend/zend_ini_scanner.l"
 		{ /* Raw string */
@@ -2697,65 +2735,65 @@ yy216:
 	}
 	RETURN_TOKEN(TC_RAW, yytext, yyleng);
 }
-#line 2701 "Zend/zend_ini_scanner.c"
-yy220:
-		YYDEBUG(220, *YYCURSOR);
+#line 2739 "Zend/zend_ini_scanner.c"
+yy222:
+		YYDEBUG(222, *YYCURSOR);
 		++YYCURSOR;
-		YYDEBUG(221, *YYCURSOR);
+		YYDEBUG(223, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
 #line 401 "Zend/zend_ini_scanner.l"
 		{ /* Variable start */
 	yy_push_state(ST_VARNAME TSRMLS_CC);
 	return TC_DOLLAR_CURLY;
 }
-#line 2712 "Zend/zend_ini_scanner.c"
-yy222:
-		YYDEBUG(222, *YYCURSOR);
+#line 2750 "Zend/zend_ini_scanner.c"
+yy224:
+		YYDEBUG(224, *YYCURSOR);
 		yyaccept = 0;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(223, *YYCURSOR);
+		YYDEBUG(225, *YYCURSOR);
 		if (yych <= '"') {
 			if (yych <= '\f') {
-				if (yych <= 0x08) goto yy195;
-				if (yych <= '\t') goto yy222;
-				if (yych <= '\n') goto yy174;
-				goto yy195;
+				if (yych <= 0x08) goto yy197;
+				if (yych <= '\t') goto yy224;
+				if (yych <= '\n') goto yy176;
+				goto yy197;
 			} else {
 				if (yych <= 0x1F) {
-					if (yych <= '\r') goto yy174;
-					goto yy195;
+					if (yych <= '\r') goto yy176;
+					goto yy197;
 				} else {
-					if (yych <= ' ') goto yy222;
-					if (yych <= '!') goto yy195;
+					if (yych <= ' ') goto yy224;
+					if (yych <= '!') goto yy197;
 				}
 			}
 		} else {
 			if (yych <= ':') {
 				if (yych <= '$') {
-					if (yych <= '#') goto yy195;
-					goto yy198;
+					if (yych <= '#') goto yy197;
+					goto yy200;
 				} else {
-					if (yych == '\'') goto yy174;
-					goto yy195;
+					if (yych == '\'') goto yy176;
+					goto yy197;
 				}
 			} else {
 				if (yych <= '[') {
-					if (yych <= ';') goto yy174;
-					goto yy195;
+					if (yych <= ';') goto yy176;
+					goto yy197;
 				} else {
-					if (yych <= '\\') goto yy197;
-					if (yych <= ']') goto yy174;
-					goto yy195;
+					if (yych <= '\\') goto yy199;
+					if (yych <= ']') goto yy176;
+					goto yy197;
 				}
 			}
 		}
-yy224:
-		YYDEBUG(224, *YYCURSOR);
+yy226:
+		YYDEBUG(226, *YYCURSOR);
 		++YYCURSOR;
 		yych = *YYCURSOR;
-		goto yy179;
+		goto yy181;
 	}
 /* *********************************** */
 yyc_ST_VALUE:
@@ -2794,27 +2832,27 @@ yyc_ST_VALUE:
 			162, 162, 162, 162, 162, 162, 162, 162, 
 			162, 162, 162, 162, 162, 162, 162, 162, 
 		};
-		YYDEBUG(225, *YYCURSOR);
+		YYDEBUG(227, *YYCURSOR);
 		YYFILL(6);
 		yych = *YYCURSOR;
 		YYDEBUG(-1, yych);
 		switch (yych) {
-		case 0x00:	goto yy227;
+		case 0x00:	goto yy229;
 		case '\t':
-		case ' ':	goto yy231;
-		case '\n':	goto yy233;
-		case '\r':	goto yy235;
+		case ' ':	goto yy233;
+		case '\n':	goto yy235;
+		case '\r':	goto yy237;
 		case '!':
 		case '&':
 		case '(':
 		case ')':
 		case '|':
-		case '~':	goto yy236;
-		case '"':	goto yy238;
-		case '$':	goto yy240;
-		case '\'':	goto yy241;
-		case '-':	goto yy242;
-		case '.':	goto yy243;
+		case '~':	goto yy238;
+		case '"':	goto yy240;
+		case '$':	goto yy242;
+		case '\'':	goto yy243;
+		case '-':	goto yy244;
+		case '.':	goto yy245;
 		case '0':
 		case '1':
 		case '2':
@@ -2824,9 +2862,9 @@ yyc_ST_VALUE:
 		case '6':
 		case '7':
 		case '8':
-		case '9':	goto yy244;
-		case ';':	goto yy246;
-		case '=':	goto yy247;
+		case '9':	goto yy246;
+		case ';':	goto yy248;
+		case '=':	goto yy249;
 		case 'A':
 		case 'B':
 		case 'C':
@@ -2869,1529 +2907,1529 @@ yyc_ST_VALUE:
 		case 'v':
 		case 'w':
 		case 'x':
-		case 'z':	goto yy249;
+		case 'z':	goto yy251;
 		case 'F':
-		case 'f':	goto yy251;
+		case 'f':	goto yy253;
 		case 'N':
-		case 'n':	goto yy252;
+		case 'n':	goto yy254;
 		case 'O':
-		case 'o':	goto yy253;
+		case 'o':	goto yy255;
 		case 'T':
-		case 't':	goto yy254;
+		case 't':	goto yy256;
 		case 'Y':
-		case 'y':	goto yy255;
-		default:	goto yy229;
+		case 'y':	goto yy257;
+		default:	goto yy231;
 		}
-yy227:
-		YYDEBUG(227, *YYCURSOR);
+yy229:
+		YYDEBUG(229, *YYCURSOR);
 		++YYCURSOR;
-yy228:
-		YYDEBUG(228, *YYCURSOR);
+yy230:
+		YYDEBUG(230, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 570 "Zend/zend_ini_scanner.l"
+#line 591 "Zend/zend_ini_scanner.l"
 		{ /* End of option value (if EOF is reached before EOL */
 	BEGIN(INITIAL);
 	return END_OF_LINE;
 }
-#line 2897 "Zend/zend_ini_scanner.c"
-yy229:
-		YYDEBUG(229, *YYCURSOR);
+#line 2935 "Zend/zend_ini_scanner.c"
+yy231:
+		YYDEBUG(231, *YYCURSOR);
 		yyaccept = 0;
 		yych = *(YYMARKER = ++YYCURSOR);
-		goto yy257;
-yy230:
-		YYDEBUG(230, *YYCURSOR);
+		goto yy259;
+yy232:
+		YYDEBUG(232, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 489 "Zend/zend_ini_scanner.l"
+#line 510 "Zend/zend_ini_scanner.l"
 		{ /* Get everything else as option/offset value */
 	RETURN_TOKEN(TC_STRING, yytext, yyleng);
 }
-#line 2910 "Zend/zend_ini_scanner.c"
-yy231:
-		YYDEBUG(231, *YYCURSOR);
+#line 2948 "Zend/zend_ini_scanner.c"
+yy233:
+		YYDEBUG(233, *YYCURSOR);
 		yyaccept = 1;
 		yych = *(YYMARKER = ++YYCURSOR);
-		goto yy307;
-yy232:
-		YYDEBUG(232, *YYCURSOR);
+		goto yy309;
+yy234:
+		YYDEBUG(234, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 543 "Zend/zend_ini_scanner.l"
+#line 564 "Zend/zend_ini_scanner.l"
 		{
 	RETURN_TOKEN(TC_WHITESPACE, yytext, yyleng);
 }
-#line 2923 "Zend/zend_ini_scanner.c"
-yy233:
-		YYDEBUG(233, *YYCURSOR);
+#line 2961 "Zend/zend_ini_scanner.c"
+yy235:
+		YYDEBUG(235, *YYCURSOR);
 		++YYCURSOR;
-yy234:
-		YYDEBUG(234, *YYCURSOR);
+yy236:
+		YYDEBUG(236, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 461 "Zend/zend_ini_scanner.l"
+#line 482 "Zend/zend_ini_scanner.l"
 		{ /* End of option value */
 	BEGIN(INITIAL);
 	SCNG(lineno)++;
 	return END_OF_LINE;
 }
-#line 2936 "Zend/zend_ini_scanner.c"
-yy235:
-		YYDEBUG(235, *YYCURSOR);
+#line 2974 "Zend/zend_ini_scanner.c"
+yy237:
+		YYDEBUG(237, *YYCURSOR);
 		yych = *++YYCURSOR;
-		if (yych == '\n') goto yy305;
-		goto yy234;
-yy236:
-		YYDEBUG(236, *YYCURSOR);
+		if (yych == '\n') goto yy307;
+		goto yy236;
+yy238:
+		YYDEBUG(238, *YYCURSOR);
 		++YYCURSOR;
 		yych = *YYCURSOR;
-		goto yy304;
-yy237:
-		YYDEBUG(237, *YYCURSOR);
+		goto yy306;
+yy239:
+		YYDEBUG(239, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 479 "Zend/zend_ini_scanner.l"
+#line 500 "Zend/zend_ini_scanner.l"
 		{ /* Boolean operators */
 	return yytext[0];
 }
-#line 2954 "Zend/zend_ini_scanner.c"
-yy238:
-		YYDEBUG(238, *YYCURSOR);
+#line 2992 "Zend/zend_ini_scanner.c"
+yy240:
+		YYDEBUG(240, *YYCURSOR);
 		++YYCURSOR;
-yy239:
-		YYDEBUG(239, *YYCURSOR);
+yy241:
+		YYDEBUG(241, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 497 "Zend/zend_ini_scanner.l"
+#line 518 "Zend/zend_ini_scanner.l"
 		{ /* Double quoted '"' string start */
 	yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC);
 	return '"';
 }
-#line 2966 "Zend/zend_ini_scanner.c"
-yy240:
-		YYDEBUG(240, *YYCURSOR);
+#line 3004 "Zend/zend_ini_scanner.c"
+yy242:
+		YYDEBUG(242, *YYCURSOR);
 		yych = *++YYCURSOR;
 		if (yych <= '\\') {
-			if (yych <= 0x00) goto yy228;
-			if (yych <= '[') goto yy256;
-			goto yy263;
+			if (yych <= 0x00) goto yy230;
+			if (yych <= '[') goto yy258;
+			goto yy265;
 		} else {
-			if (yych == '{') goto yy301;
-			goto yy256;
+			if (yych == '{') goto yy303;
+			goto yy258;
 		}
-yy241:
-		YYDEBUG(241, *YYCURSOR);
+yy243:
+		YYDEBUG(243, *YYCURSOR);
 		yyaccept = 2;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yybm[0+yych] & 128) {
-			goto yy297;
+			goto yy299;
 		}
-		goto yy228;
-yy242:
-		YYDEBUG(242, *YYCURSOR);
+		goto yy230;
+yy244:
+		YYDEBUG(244, *YYCURSOR);
 		yyaccept = 0;
 		yych = *(YYMARKER = ++YYCURSOR);
-		if (yych <= '/') goto yy257;
-		if (yych <= '9') goto yy295;
-		goto yy257;
-yy243:
-		YYDEBUG(243, *YYCURSOR);
+		if (yych <= '/') goto yy259;
+		if (yych <= '9') goto yy297;
+		goto yy259;
+yy245:
+		YYDEBUG(245, *YYCURSOR);
 		yyaccept = 0;
 		yych = *(YYMARKER = ++YYCURSOR);
-		if (yych <= '/') goto yy257;
-		if (yych <= '9') goto yy293;
-		goto yy257;
-yy244:
-		YYDEBUG(244, *YYCURSOR);
+		if (yych <= '/') goto yy259;
+		if (yych <= '9') goto yy295;
+		goto yy259;
+yy246:
+		YYDEBUG(246, *YYCURSOR);
 		yyaccept = 3;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '.') {
 			if (yych <= '\r') {
 				if (yych <= 0x08) {
-					if (yych >= 0x01) goto yy257;
+					if (yych >= 0x01) goto yy259;
 				} else {
-					if (yych <= '\n') goto yy245;
-					if (yych <= '\f') goto yy257;
+					if (yych <= '\n') goto yy247;
+					if (yych <= '\f') goto yy259;
 				}
 			} else {
 				if (yych <= '%') {
-					if (yych <= 0x1F) goto yy257;
-					if (yych >= '#') goto yy257;
+					if (yych <= 0x1F) goto yy259;
+					if (yych >= '#') goto yy259;
 				} else {
-					if (yych <= ')') goto yy245;
-					if (yych <= '-') goto yy257;
-					goto yy289;
+					if (yych <= ')') goto yy247;
+					if (yych <= '-') goto yy259;
+					goto yy291;
 				}
 			}
 		} else {
 			if (yych <= '<') {
 				if (yych <= '9') {
-					if (yych <= '/') goto yy257;
-					goto yy291;
+					if (yych <= '/') goto yy259;
+					goto yy293;
 				} else {
-					if (yych != ';') goto yy257;
+					if (yych != ';') goto yy259;
 				}
 			} else {
 				if (yych <= '|') {
-					if (yych <= '=') goto yy245;
-					if (yych <= '{') goto yy257;
+					if (yych <= '=') goto yy247;
+					if (yych <= '{') goto yy259;
 				} else {
-					if (yych != '~') goto yy257;
+					if (yych != '~') goto yy259;
 				}
 			}
 		}
-yy245:
-		YYDEBUG(245, *YYCURSOR);
+yy247:
+		YYDEBUG(247, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 471 "Zend/zend_ini_scanner.l"
+#line 492 "Zend/zend_ini_scanner.l"
 		{ /* Get number option value as string */
 	RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
 }
-#line 3046 "Zend/zend_ini_scanner.c"
-yy246:
-		YYDEBUG(246, *YYCURSOR);
+#line 3084 "Zend/zend_ini_scanner.c"
+yy248:
+		YYDEBUG(248, *YYCURSOR);
 		yyaccept = 2;
 		yych = *(YYMARKER = ++YYCURSOR);
-		goto yy285;
-yy247:
-		YYDEBUG(247, *YYCURSOR);
+		goto yy287;
+yy249:
+		YYDEBUG(249, *YYCURSOR);
 		++YYCURSOR;
-		YYDEBUG(248, *YYCURSOR);
+		YYDEBUG(250, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 483 "Zend/zend_ini_scanner.l"
+#line 504 "Zend/zend_ini_scanner.l"
 		{ /* Make = used in option value to trigger error */
 	yyless(0);
 	BEGIN(INITIAL);
 	return END_OF_LINE;
 }
-#line 3063 "Zend/zend_ini_scanner.c"
-yy249:
-		YYDEBUG(249, *YYCURSOR);
+#line 3101 "Zend/zend_ini_scanner.c"
+yy251:
+		YYDEBUG(251, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yybm[0+yych] & 4) {
-			goto yy258;
+			goto yy260;
 		}
 		if (yych <= ')') {
 			if (yych <= '\f') {
-				if (yych <= 0x00) goto yy250;
-				if (yych <= 0x08) goto yy257;
-				if (yych >= '\v') goto yy257;
+				if (yych <= 0x00) goto yy252;
+				if (yych <= 0x08) goto yy259;
+				if (yych >= '\v') goto yy259;
 			} else {
 				if (yych <= 0x1F) {
-					if (yych >= 0x0E) goto yy257;
+					if (yych >= 0x0E) goto yy259;
 				} else {
-					if (yych <= '"') goto yy250;
-					if (yych <= '%') goto yy257;
+					if (yych <= '"') goto yy252;
+					if (yych <= '%') goto yy259;
 				}
 			}
 		} else {
 			if (yych <= '=') {
-				if (yych == ';') goto yy250;
-				if (yych <= '<') goto yy257;
+				if (yych == ';') goto yy252;
+				if (yych <= '<') goto yy259;
 			} else {
 				if (yych <= '|') {
-					if (yych <= '{') goto yy257;
+					if (yych <= '{') goto yy259;
 				} else {
-					if (yych != '~') goto yy257;
+					if (yych != '~') goto yy259;
 				}
 			}
 		}
-yy250:
-		YYDEBUG(250, *YYCURSOR);
+yy252:
+		YYDEBUG(252, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 467 "Zend/zend_ini_scanner.l"
+#line 488 "Zend/zend_ini_scanner.l"
 		{ /* Get constant option value */
 	RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
 }
-#line 3103 "Zend/zend_ini_scanner.c"
-yy251:
-		YYDEBUG(251, *YYCURSOR);
+#line 3141 "Zend/zend_ini_scanner.c"
+yy253:
+		YYDEBUG(253, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '<') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '/') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					goto yy257;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					goto yy259;
 				} else {
-					if (yych <= '9') goto yy258;
-					if (yych == ';') goto yy250;
-					goto yy257;
+					if (yych <= '9') goto yy260;
+					if (yych == ';') goto yy252;
+					goto yy259;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'A') {
-					if (yych <= '=') goto yy250;
-					if (yych <= '@') goto yy257;
-					goto yy281;
+					if (yych <= '=') goto yy252;
+					if (yych <= '@') goto yy259;
+					goto yy283;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych <= 'a') goto yy281;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych <= 'a') goto yy283;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy252:
-		YYDEBUG(252, *YYCURSOR);
+yy254:
+		YYDEBUG(254, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= 'N') {
 			if (yych <= '%') {
 				if (yych <= '\f') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					if (yych <= '\n') goto yy250;
-					goto yy257;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					if (yych <= '\n') goto yy252;
+					goto yy259;
 				} else {
-					if (yych <= '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					if (yych <= '"') goto yy250;
-					goto yy257;
+					if (yych <= '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					if (yych <= '"') goto yy252;
+					goto yy259;
 				}
 			} else {
 				if (yych <= ':') {
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					if (yych <= '9') goto yy258;
-					goto yy257;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					if (yych <= '9') goto yy260;
+					goto yy259;
 				} else {
 					if (yych <= '<') {
-						if (yych <= ';') goto yy250;
-						goto yy257;
+						if (yych <= ';') goto yy252;
+						goto yy259;
 					} else {
-						if (yych <= '=') goto yy250;
-						if (yych <= '@') goto yy257;
-						goto yy258;
+						if (yych <= '=') goto yy252;
+						if (yych <= '@') goto yy259;
+						goto yy260;
 					}
 				}
 			}
 		} else {
 			if (yych <= 'n') {
 				if (yych <= 'Z') {
-					if (yych <= 'O') goto yy277;
-					if (yych == 'U') goto yy278;
-					goto yy258;
+					if (yych <= 'O') goto yy279;
+					if (yych == 'U') goto yy280;
+					goto yy260;
 				} else {
-					if (yych == '_') goto yy258;
-					if (yych <= '`') goto yy257;
-					goto yy258;
+					if (yych == '_') goto yy260;
+					if (yych <= '`') goto yy259;
+					goto yy260;
 				}
 			} else {
 				if (yych <= 'z') {
-					if (yych <= 'o') goto yy277;
-					if (yych == 'u') goto yy278;
-					goto yy258;
+					if (yych <= 'o') goto yy279;
+					if (yych == 'u') goto yy280;
+					goto yy260;
 				} else {
 					if (yych <= '|') {
-						if (yych <= '{') goto yy257;
-						goto yy250;
+						if (yych <= '{') goto yy259;
+						goto yy252;
 					} else {
-						if (yych == '~') goto yy250;
-						goto yy257;
+						if (yych == '~') goto yy252;
+						goto yy259;
 					}
 				}
 			}
 		}
-yy253:
-		YYDEBUG(253, *YYCURSOR);
+yy255:
+		YYDEBUG(255, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= 'E') {
 			if (yych <= '%') {
 				if (yych <= '\f') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					if (yych <= '\n') goto yy250;
-					goto yy257;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					if (yych <= '\n') goto yy252;
+					goto yy259;
 				} else {
-					if (yych <= '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					if (yych <= '"') goto yy250;
-					goto yy257;
+					if (yych <= '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					if (yych <= '"') goto yy252;
+					goto yy259;
 				}
 			} else {
 				if (yych <= ':') {
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					if (yych <= '9') goto yy258;
-					goto yy257;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					if (yych <= '9') goto yy260;
+					goto yy259;
 				} else {
 					if (yych <= '<') {
-						if (yych <= ';') goto yy250;
-						goto yy257;
+						if (yych <= ';') goto yy252;
+						goto yy259;
 					} else {
-						if (yych <= '=') goto yy250;
-						if (yych <= '@') goto yy257;
-						goto yy258;
+						if (yych <= '=') goto yy252;
+						if (yych <= '@') goto yy259;
+						goto yy260;
 					}
 				}
 			}
 		} else {
 			if (yych <= 'e') {
 				if (yych <= 'Z') {
-					if (yych <= 'F') goto yy272;
-					if (yych == 'N') goto yy266;
-					goto yy258;
+					if (yych <= 'F') goto yy274;
+					if (yych == 'N') goto yy268;
+					goto yy260;
 				} else {
-					if (yych == '_') goto yy258;
-					if (yych <= '`') goto yy257;
-					goto yy258;
+					if (yych == '_') goto yy260;
+					if (yych <= '`') goto yy259;
+					goto yy260;
 				}
 			} else {
 				if (yych <= 'z') {
-					if (yych <= 'f') goto yy272;
-					if (yych == 'n') goto yy266;
-					goto yy258;
+					if (yych <= 'f') goto yy274;
+					if (yych == 'n') goto yy268;
+					goto yy260;
 				} else {
 					if (yych <= '|') {
-						if (yych <= '{') goto yy257;
-						goto yy250;
+						if (yych <= '{') goto yy259;
+						goto yy252;
 					} else {
-						if (yych == '~') goto yy250;
-						goto yy257;
+						if (yych == '~') goto yy252;
+						goto yy259;
 					}
 				}
 			}
 		}
-yy254:
-		YYDEBUG(254, *YYCURSOR);
+yy256:
+		YYDEBUG(256, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'R') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'Q') goto yy258;
-					goto yy270;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'Q') goto yy260;
+					goto yy272;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'r') goto yy270;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'r') goto yy272;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy255:
-		YYDEBUG(255, *YYCURSOR);
+yy257:
+		YYDEBUG(257, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'E') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'D') goto yy258;
-					goto yy260;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'D') goto yy260;
+					goto yy262;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'e') goto yy260;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'e') goto yy262;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy256:
-		YYDEBUG(256, *YYCURSOR);
+yy258:
+		YYDEBUG(258, *YYCURSOR);
 		yyaccept = 0;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-yy257:
-		YYDEBUG(257, *YYCURSOR);
+yy259:
+		YYDEBUG(259, *YYCURSOR);
 		if (yybm[0+yych] & 2) {
-			goto yy256;
+			goto yy258;
 		}
-		if (yych == '$') goto yy261;
-		goto yy230;
-yy258:
-		YYDEBUG(258, *YYCURSOR);
+		if (yych == '$') goto yy263;
+		goto yy232;
+yy260:
+		YYDEBUG(260, *YYCURSOR);
 		yyaccept = 4;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(259, *YYCURSOR);
+		YYDEBUG(261, *YYCURSOR);
 		if (yybm[0+yych] & 4) {
-			goto yy258;
+			goto yy260;
 		}
 		if (yych <= '%') {
 			if (yych <= '\r') {
 				if (yych <= 0x08) {
-					if (yych <= 0x00) goto yy250;
-					goto yy256;
+					if (yych <= 0x00) goto yy252;
+					goto yy258;
 				} else {
-					if (yych <= '\n') goto yy250;
-					if (yych <= '\f') goto yy256;
-					goto yy250;
+					if (yych <= '\n') goto yy252;
+					if (yych <= '\f') goto yy258;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '"') {
-					if (yych <= 0x1F) goto yy256;
-					goto yy250;
+					if (yych <= 0x1F) goto yy258;
+					goto yy252;
 				} else {
-					if (yych == '$') goto yy261;
-					goto yy256;
+					if (yych == '$') goto yy263;
+					goto yy258;
 				}
 			}
 		} else {
 			if (yych <= '=') {
 				if (yych <= ':') {
-					if (yych <= ')') goto yy250;
-					goto yy256;
+					if (yych <= ')') goto yy252;
+					goto yy258;
 				} else {
-					if (yych == '<') goto yy256;
-					goto yy250;
+					if (yych == '<') goto yy258;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '|') {
-					if (yych <= '{') goto yy256;
-					goto yy250;
+					if (yych <= '{') goto yy258;
+					goto yy252;
 				} else {
-					if (yych == '~') goto yy250;
-					goto yy256;
+					if (yych == '~') goto yy252;
+					goto yy258;
 				}
 			}
 		}
-yy260:
-		YYDEBUG(260, *YYCURSOR);
+yy262:
+		YYDEBUG(262, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'S') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'R') goto yy258;
-					goto yy266;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'R') goto yy260;
+					goto yy268;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 's') goto yy266;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 's') goto yy268;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy261:
-		YYDEBUG(261, *YYCURSOR);
+yy263:
+		YYDEBUG(263, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
 		if (yych <= '\\') {
-			if (yych <= 0x00) goto yy262;
-			if (yych <= '[') goto yy256;
-			goto yy263;
+			if (yych <= 0x00) goto yy264;
+			if (yych <= '[') goto yy258;
+			goto yy265;
 		} else {
-			if (yych != '{') goto yy256;
+			if (yych != '{') goto yy258;
 		}
-yy262:
-		YYDEBUG(262, *YYCURSOR);
+yy264:
+		YYDEBUG(264, *YYCURSOR);
 		YYCURSOR = YYMARKER;
 		if (yyaccept <= 3) {
 			if (yyaccept <= 1) {
 				if (yyaccept <= 0) {
-					goto yy230;
-				} else {
 					goto yy232;
+				} else {
+					goto yy234;
 				}
 			} else {
 				if (yyaccept <= 2) {
-					goto yy228;
+					goto yy230;
 				} else {
-					goto yy245;
+					goto yy247;
 				}
 			}
 		} else {
 			if (yyaccept <= 5) {
 				if (yyaccept <= 4) {
-					goto yy250;
+					goto yy252;
 				} else {
-					goto yy267;
+					goto yy269;
 				}
 			} else {
-				goto yy274;
+				goto yy276;
 			}
 		}
-yy263:
-		YYDEBUG(263, *YYCURSOR);
+yy265:
+		YYDEBUG(265, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
 		if (yybm[0+yych] & 8) {
-			goto yy264;
+			goto yy266;
 		}
-		goto yy256;
-yy264:
-		YYDEBUG(264, *YYCURSOR);
+		goto yy258;
+yy266:
+		YYDEBUG(266, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(265, *YYCURSOR);
+		YYDEBUG(267, *YYCURSOR);
 		if (yybm[0+yych] & 8) {
-			goto yy264;
+			goto yy266;
 		}
-		if (yych <= 0x00) goto yy230;
-		if (yych == '\\') goto yy263;
-		goto yy256;
-yy266:
-		YYDEBUG(266, *YYCURSOR);
+		if (yych <= 0x00) goto yy232;
+		if (yych == '\\') goto yy265;
+		goto yy258;
+yy268:
+		YYDEBUG(268, *YYCURSOR);
 		yyaccept = 5;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yybm[0+yych] & 16) {
-			goto yy268;
+			goto yy270;
 		}
 		if (yych <= ';') {
 			if (yych <= ' ') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy267;
-					if (yych <= '\t') goto yy257;
+					if (yych <= 0x00) goto yy269;
+					if (yych <= '\t') goto yy259;
 				} else {
-					if (yych != '\r') goto yy257;
+					if (yych != '\r') goto yy259;
 				}
 			} else {
 				if (yych <= ')') {
-					if (yych <= '"') goto yy267;
-					if (yych <= '%') goto yy257;
+					if (yych <= '"') goto yy269;
+					if (yych <= '%') goto yy259;
 				} else {
-					if (yych <= '/') goto yy257;
-					if (yych <= '9') goto yy258;
-					if (yych <= ':') goto yy257;
+					if (yych <= '/') goto yy259;
+					if (yych <= '9') goto yy260;
+					if (yych <= ':') goto yy259;
 				}
 			}
 		} else {
 			if (yych <= '_') {
 				if (yych <= '@') {
-					if (yych != '=') goto yy257;
+					if (yych != '=') goto yy259;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych <= '^') goto yy257;
-					goto yy258;
+					if (yych <= 'Z') goto yy260;
+					if (yych <= '^') goto yy259;
+					goto yy260;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych <= '`') goto yy257;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych <= '`') goto yy259;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych >= 0x7F) goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych >= 0x7F) goto yy259;
 				}
 			}
 		}
-yy267:
-		YYDEBUG(267, *YYCURSOR);
+yy269:
+		YYDEBUG(269, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
 #line 421 "Zend/zend_ini_scanner.l"
 		{ /* TRUE value (when used outside option value/offset this causes parse error!) */
 	RETURN_TOKEN(BOOL_TRUE, "1", 1);
 }
-#line 3599 "Zend/zend_ini_scanner.c"
-yy268:
-		YYDEBUG(268, *YYCURSOR);
+#line 3637 "Zend/zend_ini_scanner.c"
+yy270:
+		YYDEBUG(270, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(269, *YYCURSOR);
+		YYDEBUG(271, *YYCURSOR);
 		if (yybm[0+yych] & 16) {
-			goto yy268;
+			goto yy270;
 		}
-		goto yy267;
-yy270:
-		YYDEBUG(270, *YYCURSOR);
+		goto yy269;
+yy272:
+		YYDEBUG(272, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'U') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'T') goto yy258;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'T') goto yy260;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'u') goto yy271;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'u') goto yy273;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy271:
-		YYDEBUG(271, *YYCURSOR);
+yy273:
+		YYDEBUG(273, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'E') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'D') goto yy258;
-					goto yy266;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'D') goto yy260;
+					goto yy268;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'e') goto yy266;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'e') goto yy268;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy272:
-		YYDEBUG(272, *YYCURSOR);
+yy274:
+		YYDEBUG(274, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'F') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'E') goto yy258;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'E') goto yy260;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'f') goto yy273;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'f') goto yy275;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy273:
-		YYDEBUG(273, *YYCURSOR);
+yy275:
+		YYDEBUG(275, *YYCURSOR);
 		yyaccept = 6;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yybm[0+yych] & 4) {
-			goto yy258;
+			goto yy260;
 		}
 		if (yych <= '%') {
 			if (yych <= '\f') {
 				if (yych <= 0x08) {
-					if (yych >= 0x01) goto yy257;
+					if (yych >= 0x01) goto yy259;
 				} else {
-					if (yych <= '\t') goto yy275;
-					if (yych >= '\v') goto yy257;
+					if (yych <= '\t') goto yy277;
+					if (yych >= '\v') goto yy259;
 				}
 			} else {
 				if (yych <= 0x1F) {
-					if (yych >= 0x0E) goto yy257;
+					if (yych >= 0x0E) goto yy259;
 				} else {
-					if (yych <= ' ') goto yy275;
-					if (yych >= '#') goto yy257;
+					if (yych <= ' ') goto yy277;
+					if (yych >= '#') goto yy259;
 				}
 			}
 		} else {
 			if (yych <= '=') {
 				if (yych <= ':') {
-					if (yych >= '*') goto yy257;
+					if (yych >= '*') goto yy259;
 				} else {
-					if (yych == '<') goto yy257;
+					if (yych == '<') goto yy259;
 				}
 			} else {
 				if (yych <= '|') {
-					if (yych <= '{') goto yy257;
+					if (yych <= '{') goto yy259;
 				} else {
-					if (yych != '~') goto yy257;
+					if (yych != '~') goto yy259;
 				}
 			}
 		}
-yy274:
-		YYDEBUG(274, *YYCURSOR);
+yy276:
+		YYDEBUG(276, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
 #line 425 "Zend/zend_ini_scanner.l"
 		{ /* FALSE value (when used outside option value/offset this causes parse error!)*/
 	RETURN_TOKEN(BOOL_FALSE, "", 0);
 }
-#line 3803 "Zend/zend_ini_scanner.c"
-yy275:
-		YYDEBUG(275, *YYCURSOR);
+#line 3841 "Zend/zend_ini_scanner.c"
+yy277:
+		YYDEBUG(277, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(276, *YYCURSOR);
-		if (yych == '\t') goto yy275;
-		if (yych == ' ') goto yy275;
-		goto yy274;
-yy277:
-		YYDEBUG(277, *YYCURSOR);
+		YYDEBUG(278, *YYCURSOR);
+		if (yych == '\t') goto yy277;
+		if (yych == ' ') goto yy277;
+		goto yy276;
+yy279:
+		YYDEBUG(279, *YYCURSOR);
 		yyaccept = 6;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '<') {
 			if (yych <= ' ') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy274;
-					if (yych <= 0x08) goto yy257;
-					if (yych <= '\t') goto yy275;
-					goto yy274;
+					if (yych <= 0x00) goto yy276;
+					if (yych <= 0x08) goto yy259;
+					if (yych <= '\t') goto yy277;
+					goto yy276;
 				} else {
-					if (yych == '\r') goto yy274;
-					if (yych <= 0x1F) goto yy257;
-					goto yy275;
+					if (yych == '\r') goto yy276;
+					if (yych <= 0x1F) goto yy259;
+					goto yy277;
 				}
 			} else {
 				if (yych <= '/') {
-					if (yych <= '"') goto yy274;
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy274;
-					goto yy257;
+					if (yych <= '"') goto yy276;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy276;
+					goto yy259;
 				} else {
-					if (yych <= '9') goto yy258;
-					if (yych == ';') goto yy274;
-					goto yy257;
+					if (yych <= '9') goto yy260;
+					if (yych == ';') goto yy276;
+					goto yy259;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'N') {
-					if (yych <= '=') goto yy274;
-					if (yych <= '@') goto yy257;
-					if (yych <= 'M') goto yy258;
-					goto yy280;
+					if (yych <= '=') goto yy276;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'M') goto yy260;
+					goto yy282;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'n') goto yy280;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'n') goto yy282;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy274;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy276;
+					goto yy259;
 				}
 			}
 		}
-yy278:
-		YYDEBUG(278, *YYCURSOR);
+yy280:
+		YYDEBUG(280, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'L') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'K') goto yy258;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'K') goto yy260;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'l') goto yy279;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'l') goto yy281;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy279:
-		YYDEBUG(279, *YYCURSOR);
+yy281:
+		YYDEBUG(281, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'L') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'K') goto yy258;
-					goto yy273;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'K') goto yy260;
+					goto yy275;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'l') goto yy273;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'l') goto yy275;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy280:
-		YYDEBUG(280, *YYCURSOR);
+yy282:
+		YYDEBUG(282, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'E') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'D') goto yy258;
-					goto yy273;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'D') goto yy260;
+					goto yy275;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'e') goto yy273;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'e') goto yy275;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy281:
-		YYDEBUG(281, *YYCURSOR);
+yy283:
+		YYDEBUG(283, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'L') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'K') goto yy258;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'K') goto yy260;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'l') goto yy282;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'l') goto yy284;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy282:
-		YYDEBUG(282, *YYCURSOR);
+yy284:
+		YYDEBUG(284, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'S') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'R') goto yy258;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'R') goto yy260;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 's') goto yy283;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 's') goto yy285;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy283:
-		YYDEBUG(283, *YYCURSOR);
+yy285:
+		YYDEBUG(285, *YYCURSOR);
 		yyaccept = 4;
 		yych = *(YYMARKER = ++YYCURSOR);
 		if (yych <= '=') {
 			if (yych <= '"') {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy250;
-					if (yych <= 0x08) goto yy257;
-					goto yy250;
+					if (yych <= 0x00) goto yy252;
+					if (yych <= 0x08) goto yy259;
+					goto yy252;
 				} else {
-					if (yych == '\r') goto yy250;
-					if (yych <= 0x1F) goto yy257;
-					goto yy250;
+					if (yych == '\r') goto yy252;
+					if (yych <= 0x1F) goto yy259;
+					goto yy252;
 				}
 			} else {
 				if (yych <= '9') {
-					if (yych <= '%') goto yy257;
-					if (yych <= ')') goto yy250;
-					if (yych <= '/') goto yy257;
-					goto yy258;
+					if (yych <= '%') goto yy259;
+					if (yych <= ')') goto yy252;
+					if (yych <= '/') goto yy259;
+					goto yy260;
 				} else {
-					if (yych == ';') goto yy250;
-					if (yych <= '<') goto yy257;
-					goto yy250;
+					if (yych == ';') goto yy252;
+					if (yych <= '<') goto yy259;
+					goto yy252;
 				}
 			}
 		} else {
 			if (yych <= '`') {
 				if (yych <= 'E') {
-					if (yych <= '@') goto yy257;
-					if (yych <= 'D') goto yy258;
-					goto yy273;
+					if (yych <= '@') goto yy259;
+					if (yych <= 'D') goto yy260;
+					goto yy275;
 				} else {
-					if (yych <= 'Z') goto yy258;
-					if (yych == '_') goto yy258;
-					goto yy257;
+					if (yych <= 'Z') goto yy260;
+					if (yych == '_') goto yy260;
+					goto yy259;
 				}
 			} else {
 				if (yych <= '{') {
-					if (yych == 'e') goto yy273;
-					if (yych <= 'z') goto yy258;
-					goto yy257;
+					if (yych == 'e') goto yy275;
+					if (yych <= 'z') goto yy260;
+					goto yy259;
 				} else {
-					if (yych == '}') goto yy257;
-					if (yych <= '~') goto yy250;
-					goto yy257;
+					if (yych == '}') goto yy259;
+					if (yych <= '~') goto yy252;
+					goto yy259;
 				}
 			}
 		}
-yy284:
-		YYDEBUG(284, *YYCURSOR);
+yy286:
+		YYDEBUG(286, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(2);
 		yych = *YYCURSOR;
-yy285:
-		YYDEBUG(285, *YYCURSOR);
+yy287:
+		YYDEBUG(287, *YYCURSOR);
 		if (yybm[0+yych] & 32) {
-			goto yy284;
+			goto yy286;
 		}
-		if (yych >= '\r') goto yy288;
-yy286:
-		YYDEBUG(286, *YYCURSOR);
+		if (yych >= '\r') goto yy290;
+yy288:
+		YYDEBUG(288, *YYCURSOR);
 		++YYCURSOR;
-yy287:
-		YYDEBUG(287, *YYCURSOR);
+yy289:
+		YYDEBUG(289, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 557 "Zend/zend_ini_scanner.l"
+#line 578 "Zend/zend_ini_scanner.l"
 		{ /* Comment */
 	BEGIN(INITIAL);
 	SCNG(lineno)++;
 	return END_OF_LINE;
 }
-#line 4185 "Zend/zend_ini_scanner.c"
-yy288:
-		YYDEBUG(288, *YYCURSOR);
+#line 4223 "Zend/zend_ini_scanner.c"
+yy290:
+		YYDEBUG(290, *YYCURSOR);
 		yych = *++YYCURSOR;
-		if (yych == '\n') goto yy286;
-		goto yy287;
-yy289:
-		YYDEBUG(289, *YYCURSOR);
+		if (yych == '\n') goto yy288;
+		goto yy289;
+yy291:
+		YYDEBUG(291, *YYCURSOR);
 		yyaccept = 3;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(290, *YYCURSOR);
+		YYDEBUG(292, *YYCURSOR);
 		if (yybm[0+yych] & 64) {
-			goto yy289;
+			goto yy291;
 		}
 		if (yych <= '%') {
 			if (yych <= '\r') {
 				if (yych <= 0x08) {
-					if (yych <= 0x00) goto yy245;
-					goto yy256;
+					if (yych <= 0x00) goto yy247;
+					goto yy258;
 				} else {
-					if (yych <= '\n') goto yy245;
-					if (yych <= '\f') goto yy256;
-					goto yy245;
+					if (yych <= '\n') goto yy247;
+					if (yych <= '\f') goto yy258;
+					goto yy247;
 				}
 			} else {
 				if (yych <= '"') {
-					if (yych <= 0x1F) goto yy256;
-					goto yy245;
+					if (yych <= 0x1F) goto yy258;
+					goto yy247;
 				} else {
-					if (yych == '$') goto yy261;
-					goto yy256;
+					if (yych == '$') goto yy263;
+					goto yy258;
 				}
 			}
 		} else {
 			if (yych <= '=') {
 				if (yych <= ':') {
-					if (yych <= ')') goto yy245;
-					goto yy256;
+					if (yych <= ')') goto yy247;
+					goto yy258;
 				} else {
-					if (yych == '<') goto yy256;
-					goto yy245;
+					if (yych == '<') goto yy258;
+					goto yy247;
 				}
 			} else {
 				if (yych <= '|') {
-					if (yych <= '{') goto yy256;
-					goto yy245;
+					if (yych <= '{') goto yy258;
+					goto yy247;
 				} else {
-					if (yych == '~') goto yy245;
-					goto yy256;
+					if (yych == '~') goto yy247;
+					goto yy258;
 				}
 			}
 		}
-yy291:
-		YYDEBUG(291, *YYCURSOR);
+yy293:
+		YYDEBUG(293, *YYCURSOR);
 		yyaccept = 3;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(292, *YYCURSOR);
+		YYDEBUG(294, *YYCURSOR);
 		if (yych <= '-') {
 			if (yych <= 0x1F) {
 				if (yych <= '\n') {
-					if (yych <= 0x00) goto yy245;
-					if (yych <= 0x08) goto yy256;
-					goto yy245;
+					if (yych <= 0x00) goto yy247;
+					if (yych <= 0x08) goto yy258;
+					goto yy247;
 				} else {
-					if (yych == '\r') goto yy245;
-					goto yy256;
+					if (yych == '\r') goto yy247;
+					goto yy258;
 				}
 			} else {
 				if (yych <= '$') {
-					if (yych <= '"') goto yy245;
-					if (yych <= '#') goto yy256;
-					goto yy261;
+					if (yych <= '"') goto yy247;
+					if (yych <= '#') goto yy258;
+					goto yy263;
 				} else {
-					if (yych <= '%') goto yy256;
-					if (yych <= ')') goto yy245;
-					goto yy256;
+					if (yych <= '%') goto yy258;
+					if (yych <= ')') goto yy247;
+					goto yy258;
 				}
 			}
 		} else {
 			if (yych <= '<') {
 				if (yych <= '9') {
-					if (yych <= '.') goto yy289;
-					if (yych <= '/') goto yy256;
-					goto yy291;
+					if (yych <= '.') goto yy291;
+					if (yych <= '/') goto yy258;
+					goto yy293;
 				} else {
-					if (yych == ';') goto yy245;
-					goto yy256;
+					if (yych == ';') goto yy247;
+					goto yy258;
 				}
 			} else {
 				if (yych <= '|') {
-					if (yych <= '=') goto yy245;
-					if (yych <= '{') goto yy256;
-					goto yy245;
+					if (yych <= '=') goto yy247;
+					if (yych <= '{') goto yy258;
+					goto yy247;
 				} else {
-					if (yych == '~') goto yy245;
-					goto yy256;
+					if (yych == '~') goto yy247;
+					goto yy258;
 				}
 			}
 		}
-yy293:
-		YYDEBUG(293, *YYCURSOR);
+yy295:
+		YYDEBUG(295, *YYCURSOR);
 		yyaccept = 3;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(294, *YYCURSOR);
+		YYDEBUG(296, *YYCURSOR);
 		if (yych <= ')') {
 			if (yych <= '\r') {
 				if (yych <= 0x08) {
-					if (yych <= 0x00) goto yy245;
-					goto yy256;
+					if (yych <= 0x00) goto yy247;
+					goto yy258;
 				} else {
-					if (yych <= '\n') goto yy245;
-					if (yych <= '\f') goto yy256;
-					goto yy245;
+					if (yych <= '\n') goto yy247;
+					if (yych <= '\f') goto yy258;
+					goto yy247;
 				}
 			} else {
 				if (yych <= '#') {
-					if (yych <= 0x1F) goto yy256;
-					if (yych <= '"') goto yy245;
-					goto yy256;
+					if (yych <= 0x1F) goto yy258;
+					if (yych <= '"') goto yy247;
+					goto yy258;
 				} else {
-					if (yych <= '$') goto yy261;
-					if (yych <= '%') goto yy256;
-					goto yy245;
+					if (yych <= '$') goto yy263;
+					if (yych <= '%') goto yy258;
+					goto yy247;
 				}
 			}
 		} else {
 			if (yych <= '<') {
 				if (yych <= '9') {
-					if (yych <= '/') goto yy256;
-					goto yy293;
+					if (yych <= '/') goto yy258;
+					goto yy295;
 				} else {
-					if (yych == ';') goto yy245;
-					goto yy256;
+					if (yych == ';') goto yy247;
+					goto yy258;
 				}
 			} else {
 				if (yych <= '|') {
-					if (yych <= '=') goto yy245;
-					if (yych <= '{') goto yy256;
-					goto yy245;
+					if (yych <= '=') goto yy247;
+					if (yych <= '{') goto yy258;
+					goto yy247;
 				} else {
-					if (yych == '~') goto yy245;
-					goto yy256;
+					if (yych == '~') goto yy247;
+					goto yy258;
 				}
 			}
 		}
-yy295:
-		YYDEBUG(295, *YYCURSOR);
+yy297:
+		YYDEBUG(297, *YYCURSOR);
 		yyaccept = 3;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(296, *YYCURSOR);
+		YYDEBUG(298, *YYCURSOR);
 		if (yych <= ')') {
 			if (yych <= '\r') {
 				if (yych <= 0x08) {
-					if (yych <= 0x00) goto yy245;
-					goto yy256;
+					if (yych <= 0x00) goto yy247;
+					goto yy258;
 				} else {
-					if (yych <= '\n') goto yy245;
-					if (yych <= '\f') goto yy256;
-					goto yy245;
+					if (yych <= '\n') goto yy247;
+					if (yych <= '\f') goto yy258;
+					goto yy247;
 				}
 			} else {
 				if (yych <= '#') {
-					if (yych <= 0x1F) goto yy256;
-					if (yych <= '"') goto yy245;
-					goto yy256;
+					if (yych <= 0x1F) goto yy258;
+					if (yych <= '"') goto yy247;
+					goto yy258;
 				} else {
-					if (yych <= '$') goto yy261;
-					if (yych <= '%') goto yy256;
-					goto yy245;
+					if (yych <= '$') goto yy263;
+					if (yych <= '%') goto yy258;
+					goto yy247;
 				}
 			}
 		} else {
 			if (yych <= '<') {
 				if (yych <= '9') {
-					if (yych <= '/') goto yy256;
-					goto yy295;
+					if (yych <= '/') goto yy258;
+					goto yy297;
 				} else {
-					if (yych == ';') goto yy245;
-					goto yy256;
+					if (yych == ';') goto yy247;
+					goto yy258;
 				}
 			} else {
 				if (yych <= '|') {
-					if (yych <= '=') goto yy245;
-					if (yych <= '{') goto yy256;
-					goto yy245;
+					if (yych <= '=') goto yy247;
+					if (yych <= '{') goto yy258;
+					goto yy247;
 				} else {
-					if (yych == '~') goto yy245;
-					goto yy256;
+					if (yych == '~') goto yy247;
+					goto yy258;
 				}
 			}
 		}
-yy297:
-		YYDEBUG(297, *YYCURSOR);
+yy299:
+		YYDEBUG(299, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-		YYDEBUG(298, *YYCURSOR);
+		YYDEBUG(300, *YYCURSOR);
 		if (yybm[0+yych] & 128) {
-			goto yy297;
+			goto yy299;
 		}
-		YYDEBUG(299, *YYCURSOR);
+		YYDEBUG(301, *YYCURSOR);
 		++YYCURSOR;
-		YYDEBUG(300, *YYCURSOR);
+		YYDEBUG(302, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
 #line 368 "Zend/zend_ini_scanner.l"
 		{ /* Raw string */
@@ -4402,66 +4440,66 @@ yy297:
 	}
 	RETURN_TOKEN(TC_RAW, yytext, yyleng);
 }
-#line 4406 "Zend/zend_ini_scanner.c"
-yy301:
-		YYDEBUG(301, *YYCURSOR);
+#line 4444 "Zend/zend_ini_scanner.c"
+yy303:
+		YYDEBUG(303, *YYCURSOR);
 		++YYCURSOR;
-		YYDEBUG(302, *YYCURSOR);
+		YYDEBUG(304, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
 #line 401 "Zend/zend_ini_scanner.l"
 		{ /* Variable start */
 	yy_push_state(ST_VARNAME TSRMLS_CC);
 	return TC_DOLLAR_CURLY;
 }
-#line 4417 "Zend/zend_ini_scanner.c"
-yy303:
-		YYDEBUG(303, *YYCURSOR);
+#line 4455 "Zend/zend_ini_scanner.c"
+yy305:
+		YYDEBUG(305, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-yy304:
-		YYDEBUG(304, *YYCURSOR);
-		if (yych == '\t') goto yy303;
-		if (yych == ' ') goto yy303;
-		goto yy237;
-yy305:
-		YYDEBUG(305, *YYCURSOR);
-		yych = *++YYCURSOR;
-		goto yy234;
 yy306:
 		YYDEBUG(306, *YYCURSOR);
+		if (yych == '\t') goto yy305;
+		if (yych == ' ') goto yy305;
+		goto yy239;
+yy307:
+		YYDEBUG(307, *YYCURSOR);
+		yych = *++YYCURSOR;
+		goto yy236;
+yy308:
+		YYDEBUG(308, *YYCURSOR);
 		yyaccept = 1;
 		YYMARKER = ++YYCURSOR;
 		YYFILL(2);
 		yych = *YYCURSOR;
-yy307:
-		YYDEBUG(307, *YYCURSOR);
+yy309:
+		YYDEBUG(309, *YYCURSOR);
 		if (yych <= 0x1F) {
 			if (yych <= '\n') {
-				if (yych <= 0x08) goto yy232;
-				if (yych <= '\t') goto yy306;
-				goto yy305;
+				if (yych <= 0x08) goto yy234;
+				if (yych <= '\t') goto yy308;
+				goto yy307;
 			} else {
-				if (yych == '\r') goto yy309;
-				goto yy232;
+				if (yych == '\r') goto yy311;
+				goto yy234;
 			}
 		} else {
 			if (yych <= '"') {
-				if (yych <= ' ') goto yy306;
-				if (yych <= '!') goto yy232;
+				if (yych <= ' ') goto yy308;
+				if (yych <= '!') goto yy234;
 			} else {
-				if (yych == ';') goto yy284;
-				goto yy232;
+				if (yych == ';') goto yy286;
+				goto yy234;
 			}
 		}
-		YYDEBUG(308, *YYCURSOR);
+		YYDEBUG(310, *YYCURSOR);
 		yych = *++YYCURSOR;
-		goto yy239;
-yy309:
-		YYDEBUG(309, *YYCURSOR);
+		goto yy241;
+yy311:
+		YYDEBUG(311, *YYCURSOR);
 		++YYCURSOR;
-		if ((yych = *YYCURSOR) == '\n') goto yy305;
-		goto yy234;
+		if ((yych = *YYCURSOR) == '\n') goto yy307;
+		goto yy236;
 	}
 /* *********************************** */
 yyc_ST_VARNAME:
@@ -4500,47 +4538,47 @@ yyc_ST_VARNAME:
 			128, 128, 128, 128, 128, 128, 128, 128, 
 			128, 128, 128, 128, 128, 128, 128, 128, 
 		};
-		YYDEBUG(310, *YYCURSOR);
+		YYDEBUG(312, *YYCURSOR);
 		YYFILL(2);
 		yych = *YYCURSOR;
 		if (yych <= '\'') {
 			if (yych <= ' ') {
 				if (yych <= '\n') {
-					if (yych >= '\t') goto yy314;
+					if (yych >= '\t') goto yy316;
 				} else {
-					if (yych == '\r') goto yy314;
+					if (yych == '\r') goto yy316;
 				}
 			} else {
 				if (yych <= '$') {
-					if (yych != '#') goto yy314;
+					if (yych != '#') goto yy316;
 				} else {
-					if (yych == '&') goto yy314;
+					if (yych == '&') goto yy316;
 				}
 			}
 		} else {
 			if (yych <= 'Z') {
 				if (yych <= ';') {
-					if (yych <= ')') goto yy314;
-					if (yych >= ';') goto yy314;
+					if (yych <= ')') goto yy316;
+					if (yych >= ';') goto yy316;
 				} else {
-					if (yych == '=') goto yy314;
+					if (yych == '=') goto yy316;
 				}
 			} else {
 				if (yych <= '|') {
-					if (yych <= '[') goto yy314;
-					if (yych >= '{') goto yy314;
+					if (yych <= '[') goto yy316;
+					if (yych >= '{') goto yy316;
 				} else {
-					if (yych <= '}') goto yy316;
-					if (yych <= '~') goto yy314;
+					if (yych <= '}') goto yy318;
+					if (yych <= '~') goto yy316;
 				}
 			}
 		}
-		YYDEBUG(312, *YYCURSOR);
+		YYDEBUG(314, *YYCURSOR);
 		++YYCURSOR;
 		yych = *YYCURSOR;
-		goto yy319;
-yy313:
-		YYDEBUG(313, *YYCURSOR);
+		goto yy321;
+yy315:
+		YYDEBUG(315, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
 #line 406 "Zend/zend_ini_scanner.l"
 		{ /* Variable name */
@@ -4552,41 +4590,41 @@ yy313:
 
 	RETURN_TOKEN(TC_VARNAME, yytext, yyleng);
 }
-#line 4556 "Zend/zend_ini_scanner.c"
-yy314:
-		YYDEBUG(314, *YYCURSOR);
+#line 4594 "Zend/zend_ini_scanner.c"
+yy316:
+		YYDEBUG(316, *YYCURSOR);
 		++YYCURSOR;
-		YYDEBUG(315, *YYCURSOR);
+		YYDEBUG(317, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 575 "Zend/zend_ini_scanner.l"
+#line 596 "Zend/zend_ini_scanner.l"
 		{
 	return 0;
 }
-#line 4566 "Zend/zend_ini_scanner.c"
-yy316:
-		YYDEBUG(316, *YYCURSOR);
+#line 4604 "Zend/zend_ini_scanner.c"
+yy318:
+		YYDEBUG(318, *YYCURSOR);
 		++YYCURSOR;
-		YYDEBUG(317, *YYCURSOR);
+		YYDEBUG(319, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
 #line 416 "Zend/zend_ini_scanner.l"
 		{ /* Variable end */
 	yy_pop_state(TSRMLS_C);
 	return '}';
 }
-#line 4577 "Zend/zend_ini_scanner.c"
-yy318:
-		YYDEBUG(318, *YYCURSOR);
+#line 4615 "Zend/zend_ini_scanner.c"
+yy320:
+		YYDEBUG(320, *YYCURSOR);
 		++YYCURSOR;
 		YYFILL(1);
 		yych = *YYCURSOR;
-yy319:
-		YYDEBUG(319, *YYCURSOR);
+yy321:
+		YYDEBUG(321, *YYCURSOR);
 		if (yybm[0+yych] & 128) {
-			goto yy318;
+			goto yy320;
 		}
-		goto yy313;
+		goto yy315;
 	}
 }
-#line 579 "Zend/zend_ini_scanner.l"
+#line 600 "Zend/zend_ini_scanner.l"
 
 }
diff --git a/Zend/zend_ini_scanner_defs.h b/Zend/zend_ini_scanner_defs.h
index b2563e3..f5a158a 100644
--- a/Zend/zend_ini_scanner_defs.h
+++ b/Zend/zend_ini_scanner_defs.h
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Sat Feb 25 22:07:14 2012 */
+/* Generated by re2c 0.13.5 on Thu Jun  7 17:37:03 2012 */
 #line 3 "Zend/zend_ini_scanner_defs.h"
 
 enum YYCONDTYPE {


commit 5b10a6561770db11d68c5b10ceca06dbe23c094b
Merge: 814e7bc 494c170
Author: Pierrick Charron <pierrick at php.net>
Date:   Thu Jun 7 17:51:56 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fixed bug #51094 (parse_ini_file() with INI_SCANNER_RAW cuts a value that includes a semi-colon)



commit 494c170e6ffcc989363a43f940c3c6414b05e08a
Merge: deac80e fed5923
Author: Pierrick Charron <pierrick at php.net>
Date:   Thu Jun 7 17:45:43 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fixed bug #51094 (parse_ini_file() with INI_SCANNER_RAW cuts a value that includes a semi-colon)



commit fed5923dbc849659321a4f9aa96634ddd1655229
Author: Pierrick Charron <pierrick at php.net>
Date:   Thu Jun 7 17:44:20 2012 +0200

    Fixed bug #51094 (parse_ini_file() with INI_SCANNER_RAW cuts a value that includes a semi-colon)
    
    Modify the scanner to check if the first char of the raw data is an opening " in which case we
    need to find the closing one. Otherwise just search for the next end of value char [\r\n;\000]

diff --git a/NEWS b/NEWS
index 42eb5b4..a6b41f4 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,10 @@
 PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 2012, PHP 5.3.15
+- Zend Engine:
+  . Fixed bug #51094 (parse_ini_file() with INI_SCANNER_RAW cuts a value that
+    includes a semi-colon). (Pierrick)
+
 - COM:
   . Fixed bug #62146 com_dotnet cannot be built shared. (Johannes)
 
diff --git a/Zend/zend_ini_scanner.l b/Zend/zend_ini_scanner.l
index 0c452e6..8aeb076 100644
--- a/Zend/zend_ini_scanner.l
+++ b/Zend/zend_ini_scanner.l
@@ -347,7 +347,7 @@ DOLLAR_CURLY "${"
 
 SECTION_RAW_CHARS [^\]\n\r]
 SINGLE_QUOTED_CHARS [^']
-RAW_VALUE_CHARS [^\n\r;\000]
+RAW_VALUE_CHARS [^"\n\r;\000]
 
 LITERAL_DOLLAR ("$"([^{\000]|("\\"{ANY_CHAR})))
 VALUE_CHARS         ([^$= \t\n\r;&|~()!"'\000]|{LITERAL_DOLLAR})
@@ -445,12 +445,33 @@ SECTION_VALUE_CHARS ([^$\n\r;"'\]\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR})
 	return '=';
 }
 
-<ST_RAW>{RAW_VALUE_CHARS}+ { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
-	/* Eat leading and trailing double quotes */
-	if (yytext[0] == '"' && yytext[yyleng - 1] == '"') {
-		SCNG(yy_text)++;
-		yyleng = yyleng - 2;
+<ST_RAW>["] {
+	while (YYCURSOR < YYLIMIT) {
+		switch (*YYCURSOR++) {
+			case '\n':
+				SCNG(lineno)++;
+				break;
+			case '\r':
+				if (*YYCURSOR != '\n') {
+					SCNG(lineno)++;
+				}
+				break;
+			case '"':
+				yyleng = YYCURSOR - SCNG(yy_text) - 2;
+				SCNG(yy_text)++;
+				RETURN_TOKEN(TC_RAW, yytext, yyleng);
+			case '\\':
+				if (YYCURSOR < YYLIMIT) {
+					YYCURSOR++;
+				}
+				break;
+		}
 	}
+	yyleng = YYCURSOR - SCNG(yy_text);
+	RETURN_TOKEN(TC_RAW, yytext, yyleng);
+}
+
+<ST_RAW>{RAW_VALUE_CHARS}+ { /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
 	RETURN_TOKEN(TC_RAW, yytext, yyleng);
 }
 
diff --git a/ext/standard/tests/file/bug51094.phpt b/ext/standard/tests/file/bug51094.phpt
new file mode 100644
index 0000000..7823558
--- /dev/null
+++ b/ext/standard/tests/file/bug51094.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Fixed bug #51094 (parse_ini_file() with INI_SCANNER_RAW cuts a value that includes a semi-colon).
+--FILE--
+<?php
+
+$ini = parse_ini_string('ini="ini;raw"', null, INI_SCANNER_RAW);
+var_dump($ini['ini']);
+$ini = parse_ini_string('ini="ini;raw', null, INI_SCANNER_RAW);
+var_dump($ini['ini']);
+$ini = parse_ini_string('ini=ini;raw', null, INI_SCANNER_RAW);
+var_dump($ini['ini']);
+$ini = parse_ini_string('ini=ini"raw', null, INI_SCANNER_RAW);
+var_dump($ini['ini']);
+$ini = parse_ini_string("ini=\r\niniraw", null, INI_SCANNER_RAW);
+var_dump($ini['ini']);
+--EXPECTF--
+string(7) "ini;raw"
+string(8) ""ini;raw"
+string(3) "ini"
+string(7) "ini"raw"
+string(0) ""
+


commit 814e7bcf6ce3a2bc56d23cbc9301e94286418ffa
Merge: 753c336 deac80e
Author: David Soria Parra <dsp at php.net>
Date:   Thu Jun 7 09:45:12 2012 +0200

    Merge branch 'PHP-5.4'
    
    By Till Klampaeckel
    * PHP-5.4:
      Don't depend on a fixed path for PHP shebang but use /usr/bin/env (cherry picked from commit 89c5d981603ed4a2a54f86c20cec4f263c58ded6)



commit deac80eb9a50e788ecd292e104486699c5387ed8
Merge: 83542dc c56ff39
Author: David Soria Parra <dsp at php.net>
Date:   Thu Jun 7 09:44:59 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    By Till Klampaeckel
    * PHP-5.3:
      Don't depend on a fixed path for PHP shebang but use /usr/bin/env (cherry picked from commit 89c5d981603ed4a2a54f86c20cec4f263c58ded6)



commit c56ff39c05be5b846973760ef8bdad8401defe24
Author: Till Klampaeckel <till at php.net>
Date:   Wed Jun 6 19:49:47 2012 +0300

    Don't depend on a fixed path for PHP shebang but use /usr/bin/env
    (cherry picked from commit 89c5d981603ed4a2a54f86c20cec4f263c58ded6)

diff --git a/run-tests.php b/run-tests.php
index 2b37ec4..9a01f56 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -1,4 +1,4 @@
-#!/usr/bin/php
+#!/usr/bin/env php
 <?php
 /*
    +----------------------------------------------------------------------+


commit 753c3367c044fa54eac9b7233f72b58e63b2ac67
Merge: 07d0eab 6af01ed
Author: David Soria Parra <dsp at php.net>
Date:   Thu Jun 7 09:38:17 2012 +0200

    Merge branch 'pull-request/60'
    
    By David Soria Parra (1) and Jille Timmermans (1)
    * pull-request/60:
      NEWS entry for boolval()
      Implement boolval() with a test



commit 6af01ed5a0a2be2aa2fb7bd39ad1e3c286d54cf5
Author: David Soria Parra <dsp at php.net>
Date:   Thu Jun 7 09:37:26 2012 +0200

    NEWS entry for boolval()

diff --git a/NEWS b/NEWS
index 87ecf08..3adefae 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,7 @@ PHP                                                                        NEWS
     (Nikita Popov)
 
 - Core:
+  . Added boolval(). (Jille Timmermans).
   . Fixed bug #61681 (Malformed grammar). (Nikita Popov, Etienne, Laruence).
   . Fixed bug #61038 (unpack("a5", "str\0\0") does not work as expected).
     (srgoogleguy, Gustavo)


commit 07d0eab204c19ceca259319c38af79e64b61aecd
Merge: c22a29b 83542dc
Author: Xinchen Hui <laruence at php.net>
Date:   Thu Jun 7 14:42:35 2012 +0800

    Merge branch 'PHP-5.4'
    
    By Gustavo André dos Santos Lopes (4) and others
    via Felipe Pena (2) and Xinchen Hui (2)
    * PHP-5.4:
      Remove unused codes
      based on microsoft's description,the direct convert from FILETIME struct to __int64 is unsafe.
      merge 5.3 entries
      restore NEWS
      Fix ext/intl build on ICU < 4.8
      Optimization in ext/intl/msgformat
      Fixed tests in ext/intl
      Changed XFAILed collator_get_sort_key.phpt



commit 83542dcf3b84767cc950e2def7b35ec3b4839edc
Merge: e118a07 6ecc9f1
Author: Xinchen Hui <laruence at php.net>
Date:   Thu Jun 7 14:32:47 2012 +0800

    Merge branch 'PHP-5.3' into PHP-5.4
    
    By Gustavo André dos Santos Lopes (4) and others
    via Felipe Pena (1) and Xinchen Hui (1)
    * PHP-5.3:
      Remove unused codes
      based on microsoft's description,the direct convert from FILETIME struct to __int64 is unsafe.
      Fix ext/intl build on ICU < 4.8
      Optimization in ext/intl/msgformat
      Fixed tests in ext/intl
      Changed XFAILed collator_get_sort_key.phpt



commit 6ecc9f1d9dfbfa264725aabcf52b75e31ce59deb
Author: Xinchen Hui <laruence at php.net>
Date:   Thu Jun 7 14:31:35 2012 +0800

    Remove unused codes

diff --git a/win32/time.c b/win32/time.c
index 8b847b0..391a8a8 100644
--- a/win32/time.c
+++ b/win32/time.c
@@ -34,23 +34,21 @@
 
 int getfilesystemtime(struct timeval *time_Info) 
 {
-FILETIME ft;
-__int64 ff;
-ULARGE_INTEGER convFromft;
+    FILETIME ft;
+    __int64 ff;
+    ULARGE_INTEGER convFromft;
 
     GetSystemTimeAsFileTime(&ft);   /* 100 ns blocks since 01-Jan-1641 */
-                                    /* resolution seems to be 0.01 sec */ 
-    /* ff = *(__int64*)(&ft); */
+                                    /* resolution seems to be 0.01 sec */
     /*
-            Do not cast a pointer to a FILETIME structure to either a 
-            ULARGE_INTEGER* or __int64* value because it can cause alignment faults on 64-bit Windows.
-            
-            via  http://technet.microsoft.com/en-us/library/ms724284(v=vs.85).aspx
+     * Do not cast a pointer to a FILETIME structure to either a 
+     * ULARGE_INTEGER* or __int64* value because it can cause alignment faults on 64-bit Windows.
+     * via  http://technet.microsoft.com/en-us/library/ms724284(v=vs.85).aspx
      */
     convFromft.HighPart = ft.dwHighDateTime;
     convFromft.LowPart = ft.dwLowDateTime;
     ff = convFromft.QuadPart;
-    
+
     time_Info->tv_sec = (int)(ff/(__int64)10000000-(__int64)11644473600);
     time_Info->tv_usec = (int)(ff % 10000000)/10;
     return 0;


commit d9810af45ae9e3cbd2c97543b5dfa2d7c93e81c1
Author: slayercat <llz916148 at yahoo.com.cn>
Date:   Wed May 23 20:30:16 2012 +0800

    based on microsoft's description,the direct convert from FILETIME struct to __int64 is unsafe.
    
    via http://technet.microsoft.com/en-us/library/ms724284(v=vs.85).aspx
    
    "Do not cast a pointer to a FILETIME structure to either a
    ULARGE_INTEGER* or __int64* value because it can cause alignment faults on 64-bit Windows."

diff --git a/win32/time.c b/win32/time.c
index a376fd6..8b847b0 100644
--- a/win32/time.c
+++ b/win32/time.c
@@ -1,4 +1,3 @@
-
 /*****************************************************************************
  *                                                                           *
  * DH_TIME.C                                                                 *
@@ -37,10 +36,21 @@ int getfilesystemtime(struct timeval *time_Info)
 {
 FILETIME ft;
 __int64 ff;
+ULARGE_INTEGER convFromft;
 
     GetSystemTimeAsFileTime(&ft);   /* 100 ns blocks since 01-Jan-1641 */
                                     /* resolution seems to be 0.01 sec */ 
-    ff = *(__int64*)(&ft);
+    /* ff = *(__int64*)(&ft); */
+    /*
+            Do not cast a pointer to a FILETIME structure to either a 
+            ULARGE_INTEGER* or __int64* value because it can cause alignment faults on 64-bit Windows.
+            
+            via  http://technet.microsoft.com/en-us/library/ms724284(v=vs.85).aspx
+     */
+    convFromft.HighPart = ft.dwHighDateTime;
+    convFromft.LowPart = ft.dwLowDateTime;
+    ff = convFromft.QuadPart;
+    
     time_Info->tv_sec = (int)(ff/(__int64)10000000-(__int64)11644473600);
     time_Info->tv_usec = (int)(ff % 10000000)/10;
     return 0;


commit e118a0794a93e54d97ac42636e56c9b7e5904ecd
Author: Stanislav Malyshev <stas at php.net>
Date:   Wed Jun 6 23:20:14 2012 -0700

    merge 5.3 entries

diff --git a/NEWS b/NEWS
index d3448e9..9ab8b62 100644
--- a/NEWS
+++ b/NEWS
@@ -30,16 +30,22 @@ PHP                                                                        NEWS
   . Fix bug #55042 (Erealloc in iconv.c unsafe). (Stas)
 
 - Intl
+  . Fixed bug #62083 (grapheme_extract() memory leaks). (Gustavo)
   . ResourceBundle constructor now accepts NULL for the first two arguments.
     (Gustavo)
+  . Fixed bug #62081 (IntlDateFormatter constructor leaks memory when called
+    twice). (Gustavo)
+  . Fixed bug #62070 (Collator::getSortKey() returns garbage). (Gustavo)
+  . Fixed bug #62017 (datefmt_create with incorrectly encoded timezone leaks
+    pattern). (Gustavo)
 
 - Readline:
   . Fixed bug #62186 (readline fails to compile - void function should not
     return a value). (Johannes)
 
 - Reflection:
-	. Fixed bug #62202 (ReflectionParameter::getDefaultValue() memory leaks 
-	  with constant). (Laruence)
+   . Fixed bug #62202 (ReflectionParameter::getDefaultValue() memory leaks 
+     with constant). (Laruence)
 
 - Sockets:
   . Fixed bug #62025 (__ss_family was changed on AIX 5.3). (Felipe)
@@ -104,6 +110,10 @@ PHP                                                                        NEWS
 - Fileinfo
   . Fixed bug #61812 (Uninitialised value used in libmagic). 
     (Laruence, Gustavo)
+  . Fixed bug #61566 failure caused by the posix lseek and read versions
+    under windows in cdf_read(). (Anatoliy)
+  . Fixed bug #61565 where php_stream_open_wrapper_ex tries to open a
+    directory descriptor under windows. (Anatoliy)
 
 - Intl
   . Fixed bug #62082 (Memory corruption in internal function 
@@ -697,6 +707,14 @@ PHP                                                                        NEWS
   . Fixed bug #55544 (ob_gzhandler always conflicts with zlib.output_compression).
     (Mike)
 
+08 May 2012, PHP 5.3.13
+- CGI
+  . Improve fix for PHP-CGI query string parameter vulnerability, CVE-2012-2311.
+    (Stas)
+
+03 May 2012, PHP 5.3.12
+- Fix PHP-CGI query string parameter vulnerability, CVE-2012-1823. (Rasmus)
+
 26 Apr 2012, PHP 5.3.11
 
 - Core:


commit db1e425b1aecb152498bf908f188d5041767a33a
Author: Stanislav Malyshev <stas at php.net>
Date:   Wed Jun 6 23:00:33 2012 -0700

    restore NEWS

diff --git a/NEWS b/NEWS
index 363a8b7..d3448e9 100644
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,58 @@
 PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+?? ??? 2012, PHP 5.4.5
+
+- Core:
+  . Fixed bug #61998 (Using traits with method aliases appears to result in
+    crash during execution). (Dmitry)
+
+- EXIF:
+  . Fixed information leak in ext exif (discovered by Martin Noga, 
+    Matthew "j00ru" Jurczyk, Gynvael Coldwind)
+
+- FPM
+  . Fixed bug #62205 (php-fpm segfaults (null passed to strstr)). (fat)
+  . Fixed bug #62160 (Add process.priority to set nice(2) priorities). (fat)
+  . Fixed bug #62153 (when using unix sockets, multiples FPM instances
+  . Fixed bug #62033 (php-fpm exits with status 0 on some failures to start).
+    (fat)
+  . Fixed bug #61839 (Unable to cross-compile PHP with --enable-fpm). (fat)
+  . Fixed bug #61835 (php-fpm is not allowed to run as root). (fat)
+  . Fixed bug #61295 (php-fpm should not fail with commented 'user'
+  . Fixed bug #61218 (FPM drops connection while receiving some binary values
+    in FastCGI requests). (fat)
+  . Fixed bug #61045 (fpm don't send error log to fastcgi clients). (fat)
+    for non-root start). (fat)
+  . Fixed bug #61026 (FPM pools can listen on the same address). (fat)
+    can be launched without errors). (fat)
+
+- Iconv:
+  . Fix bug #55042 (Erealloc in iconv.c unsafe). (Stas)
+
+- Intl
+  . ResourceBundle constructor now accepts NULL for the first two arguments.
+    (Gustavo)
+
+- Readline:
+  . Fixed bug #62186 (readline fails to compile - void function should not
+    return a value). (Johannes)
+
+- Reflection:
+	. Fixed bug #62202 (ReflectionParameter::getDefaultValue() memory leaks 
+	  with constant). (Laruence)
+
+- Sockets:
+  . Fixed bug #62025 (__ss_family was changed on AIX 5.3). (Felipe)
+    
+- XML Writer:
+  . Fixed bug #62064 (memory leak in the XML Writer module). 
+    (jean-pierre dot lozi at lip6 dot fr)
+
 ?? ??? 2012, PHP 5.4.4
 
+- COM:
+  . Fixed bug #62146 com_dotnet cannot be built shared. (Johannes)
+
 - CLI Server:
   . Implemented FR #61977 (Need CLI web-server support for files with .htm & 
     svg extensions). (Sixd, Laruence)
@@ -17,10 +68,10 @@ PHP                                                                        NEWS
 
 - Core:
   . Fixed missing bound check in iptcparse(). (chris at chiappa.net)
+  . Fixed CVE-2012-2143. (Solar Designer)
+  . Fixed bug #62097 (fix for for bug #54547). (Gustavo)
   . Fixed bug #62005 (unexpected behavior when incrementally assigning to a 
     member of a null object). (Laruence)
-  . Fixed bug #61998 (Using traits with method aliases appears to result in
-    crash during execution). (Dmitry)
   . Fixed bug #61978 (Object recursion not detected for classes that implement
     JsonSerializable). (Felipe)
   . Fixed bug #61991 (long overflow in realpath_cache_get()). (Anatoliy)
@@ -45,7 +96,7 @@ PHP                                                                        NEWS
   . Changed php://fd to be available only for CLI.
 
 - Phar:
-  . Fix bug #61065 (Secunia SA44335). (Rasmus)
+  . Fix bug #61065 (Secunia SA44335, CVE-2012-2386). (Rasmus)
 
 - Pgsql:
   . Added pg_escape_identifier/pg_escape_literal. (Yasuo Ohgaki)
@@ -54,36 +105,13 @@ PHP                                                                        NEWS
   . Fixed bug #61812 (Uninitialised value used in libmagic). 
     (Laruence, Gustavo)
 
-- FPM
-  . Fixed bug #61045 (fpm don't send error log to fastcgi clients). (fat)
-  . Fixed bug #61835 (php-fpm is not allowed to run as root). (fat)
-  . Fixed bug #61295 (php-fpm should not fail with commented 'user'
-    for non-root start). (fat)
-  . Fixed bug #61839 (Unable to cross-compile PHP with --enable-fpm). (fat)
-  . Fixed bug #61026 (FPM pools can listen on the same address). (fat)
-  . Fixed bug #62033 (php-fpm exits with status 0 on some failures to start).
-    (fat)
-  . Fixed bug #62153 (when using unix sockets, multiples FPM instances
-    can be launched without errors). (fat)
-  . Fixed bug #62160 (Add process.priority to set nice(2) priorities). (fat)
-  . Fixed bug #61218 (FPM drops connection while receiving some binary values
-    in FastCGI requests). (fat)
-  . Fixed bug #62205 (php-fpm segfaults (null passed to strstr)). (fat)
-
 - Intl
-  . ResourceBundle constructor now accepts NULL for the first two arguments.
-    (Gustavo)
+  . Fixed bug #62082 (Memory corruption in internal function 
+    get_icu_disp_value_src_php()). (Gustavo)
 
 - Libxml:
   . Fixed bug #61617 (Libxml tests failed(ht is already destroyed)).
     (Laruence)
-    
-- Sockets:
-  . Fixed bug #62025 (__ss_family was changed on AIX 5.3). (Felipe)
-    
-- XML Writer:
-  . Fixed bug #62064 (memory leak in the XML Writer module). 
-    (jean-pierre dot lozi at lip6 dot fr)
 
 - Zlib:
   . Fixed bug #61820 (using ob_gzhandler will complain about headers already 


commit 74b4ef5036ccdb2d71a514732c6b521aa2aa62d3
Author: Jille Timmermans <jille at quis.cx>
Date:   Wed Jun 6 22:34:51 2012 +0200

    Implement boolval() with a test

diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 528e4f6..63d40ef 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -2522,6 +2522,10 @@ ZEND_BEGIN_ARG_INFO(arginfo_strval, 0)
 	ZEND_ARG_INFO(0, var)
 ZEND_END_ARG_INFO()
 
+ZEND_BEGIN_ARG_INFO(arginfo_boolval, 0)
+	ZEND_ARG_INFO(0, var)
+ZEND_END_ARG_INFO()
+
 ZEND_BEGIN_ARG_INFO(arginfo_is_null, 0)
 	ZEND_ARG_INFO(0, var)
 ZEND_END_ARG_INFO()
@@ -3045,6 +3049,7 @@ const zend_function_entry basic_functions[] = { /* {{{ */
 	PHP_FE(floatval,														arginfo_floatval)
 	PHP_FALIAS(doubleval,			floatval,								arginfo_floatval)
 	PHP_FE(strval,															arginfo_strval)
+	PHP_FE(boolval,															arginfo_boolval)
 	PHP_FE(gettype,															arginfo_gettype)
 	PHP_FE(settype,															arginfo_settype)
 	PHP_FE(is_null,															arginfo_is_null)
diff --git a/ext/standard/php_type.h b/ext/standard/php_type.h
index 1927ded..12e916b 100644
--- a/ext/standard/php_type.h
+++ b/ext/standard/php_type.h
@@ -24,6 +24,7 @@
 PHP_FUNCTION(intval);
 PHP_FUNCTION(floatval);
 PHP_FUNCTION(strval);
+PHP_FUNCTION(boolval);
 PHP_FUNCTION(gettype);
 PHP_FUNCTION(settype);
 PHP_FUNCTION(is_null);
diff --git a/ext/standard/tests/general_functions/boolval.phpt b/ext/standard/tests/general_functions/boolval.phpt
new file mode 100644
index 0000000..9d0eac4
--- /dev/null
+++ b/ext/standard/tests/general_functions/boolval.phpt
@@ -0,0 +1,29 @@
+--TEST--
+Testing boolval()
+--FILE--
+<?php
+	var_dump(boolval(false));
+	var_dump(boolval(NULL));
+	var_dump(boolval(""));
+	var_dump(boolval(0));
+	var_dump(boolval(array()));
+
+	var_dump(boolval(true));
+	var_dump(boolval("abc"));
+	var_dump(boolval(0.5));
+	var_dump(boolval(100));
+	var_dump(boolval(new stdClass()));
+	var_dump(boolval(STDIN));
+?>
+--EXPECTF--
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
diff --git a/ext/standard/type.c b/ext/standard/type.c
index 543fdea..59d7314b 100644
--- a/ext/standard/type.c
+++ b/ext/standard/type.c
@@ -176,6 +176,21 @@ PHP_FUNCTION(floatval)
 }
 /* }}} */
 
+/* {{{ proto bool boolval(mixed var)
+   Get the boolean value of a variable */
+PHP_FUNCTION(boolval)
+{
+	zval **val;
+
+	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &val) == FAILURE) {
+		return;
+	}
+
+	RETVAL_ZVAL(*val, 1, 0);
+	convert_to_boolean(return_value);
+}
+/* }}} */
+
 /* {{{ proto string strval(mixed var)
    Get the string value of a variable */
 PHP_FUNCTION(strval)


commit c1ac3252288c2eeb0b9278458ad15e19912a945a
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Wed Jun 6 12:10:00 2012 +0200

    Fix ext/intl build on ICU < 4.8

diff --git a/ext/intl/msgformat/msgformat_data.c b/ext/intl/msgformat/msgformat_data.c
index 4f93d6d..527c1d4 100755
--- a/ext/intl/msgformat/msgformat_data.c
+++ b/ext/intl/msgformat/msgformat_data.c
@@ -21,6 +21,8 @@
 #include <unicode/ustring.h>
 #include "msgformat_data.h"
 
+#include "msgformat_class.h"
+
 /* {{{ void msgformat_data_init( msgformat_data* mf_data )
  * Initialize internals of msgformat_data.
  */


commit 52d541a3149d4a21e9f45fa80b26c338636f92c4
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Wed Jun 6 11:36:00 2012 +0200

    Optimization in ext/intl/msgformat
    
    Don't transform the string to make it apostrophe friendly in ICU 4.8+
    as that it is now the default.

diff --git a/ext/intl/msgformat/msgformat.c b/ext/intl/msgformat/msgformat.c
index 84f14de..0a01204 100755
--- a/ext/intl/msgformat/msgformat.c
+++ b/ext/intl/msgformat/msgformat.c
@@ -64,9 +64,11 @@ static void msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
 		locale = INTL_G(default_locale);
 	}
 
+#ifdef MSG_FORMAT_QUOTE_APOS
 	if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) {
 		INTL_CTOR_CHECK_STATUS(mfo, "msgfmt_create: error converting pattern to quote-friendly format");
 	}
+#endif
 
 	if ((mfo)->mf_data.orig_format) {
 		msgformat_data_free(&mfo->mf_data TSRMLS_CC);
diff --git a/ext/intl/msgformat/msgformat_attr.c b/ext/intl/msgformat/msgformat_attr.c
index cf34665..ed2dae2 100755
--- a/ext/intl/msgformat/msgformat_attr.c
+++ b/ext/intl/msgformat/msgformat_attr.c
@@ -82,11 +82,13 @@ PHP_FUNCTION( msgfmt_set_pattern )
 	intl_convert_utf8_to_utf16(&spattern, &spattern_len, value, value_len, &INTL_DATA_ERROR_CODE(mfo));
 	INTL_METHOD_CHECK_STATUS(mfo, "Error converting pattern to UTF-16" );
 
+#ifdef MSG_FORMAT_QUOTE_APOS
 	if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) {
 		intl_error_set( NULL, U_INVALID_FORMAT_ERROR,
 			"msgfmt_set_pattern: error converting pattern to quote-friendly format", 0 TSRMLS_CC );
 		RETURN_FALSE;
 	}
+#endif
 
 	/* TODO: add parse error information */
 	umsg_applyPattern(MSG_FORMAT_OBJECT(mfo), spattern, spattern_len, NULL, &INTL_DATA_ERROR_CODE(mfo));
diff --git a/ext/intl/msgformat/msgformat_class.h b/ext/intl/msgformat/msgformat_class.h
index 0afa792..b6b8e33 100755
--- a/ext/intl/msgformat/msgformat_class.h
+++ b/ext/intl/msgformat/msgformat_class.h
@@ -19,9 +19,11 @@
 
 #include <php.h>
 
-#include "intl_common.h"
-#include "intl_error.h"
-#include "intl_data.h"
+#include <unicode/uconfig.h>
+
+#include "../intl_common.h"
+#include "../intl_error.h"
+#include "../intl_data.h"
 #include "msgformat_data.h"
 
 typedef struct {
@@ -38,4 +40,8 @@ extern zend_class_entry *MessageFormatter_ce_ptr;
 #define MSG_FORMAT_METHOD_FETCH_OBJECT	INTL_METHOD_FETCH_OBJECT(MessageFormatter, mfo)
 #define MSG_FORMAT_OBJECT(mfo)			(mfo)->mf_data.umsgf
 
+#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM < 48
+# define MSG_FORMAT_QUOTE_APOS 1
+#endif
+
 #endif // #ifndef MSG_FORMAT_CLASS_H
diff --git a/ext/intl/msgformat/msgformat_data.c b/ext/intl/msgformat/msgformat_data.c
index 95e81d3..4f93d6d 100755
--- a/ext/intl/msgformat/msgformat_data.c
+++ b/ext/intl/msgformat/msgformat_data.c
@@ -69,6 +69,7 @@ msgformat_data* msgformat_data_create( TSRMLS_D )
 }
 /* }}} */
 
+#ifdef MSG_FORMAT_QUOTE_APOS
 int msgformat_fix_quotes(UChar **spattern, uint32_t *spattern_len, UErrorCode *ec) 
 {
 	if(*spattern && *spattern_len && u_strchr(*spattern, (UChar)'\'')) {
@@ -86,6 +87,7 @@ int msgformat_fix_quotes(UChar **spattern, uint32_t *spattern_len, UErrorCode *e
 	}
 	return SUCCESS;
 }
+#endif
 
 
 /*
diff --git a/ext/intl/msgformat/msgformat_data.h b/ext/intl/msgformat/msgformat_data.h
index 4400175..6479888 100755
--- a/ext/intl/msgformat/msgformat_data.h
+++ b/ext/intl/msgformat/msgformat_data.h
@@ -19,9 +19,9 @@
 
 #include <php.h>
 
-#include <unicode/umsg.h>
+#include "../intl_error.h"
 
-#include "intl_error.h"
+#include <unicode/umsg.h>
 
 typedef struct {
 	// error hangling
@@ -36,6 +36,9 @@ typedef struct {
 msgformat_data* msgformat_data_create( TSRMLS_D );
 void msgformat_data_init( msgformat_data* mf_data TSRMLS_DC );
 void msgformat_data_free( msgformat_data* mf_data TSRMLS_DC );
+
+#ifdef MSG_FORMAT_QUOTE_APOS
 int msgformat_fix_quotes(UChar **spattern, uint32_t *spattern_len, UErrorCode *ec);
+#endif
 
 #endif // MSG_FORMAT_DATA_H
diff --git a/ext/intl/msgformat/msgformat_format.c b/ext/intl/msgformat/msgformat_format.c
index b664c83..9a18ac0 100755
--- a/ext/intl/msgformat/msgformat_format.c
+++ b/ext/intl/msgformat/msgformat_format.c
@@ -154,11 +154,13 @@ PHP_FUNCTION( msgfmt_format_message )
 		slocale = INTL_G(default_locale);
 	}
 
+#ifdef MSG_FORMAT_QUOTE_APOS
 	if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) {
 		intl_error_set( NULL, U_INVALID_FORMAT_ERROR,
 			"msgfmt_format_message: error converting pattern to quote-friendly format", 0 TSRMLS_CC );
 		RETURN_FALSE;
 	}
+#endif
 
 	/* Create an ICU message formatter. */
 	MSG_FORMAT_OBJECT(mfo) = umsg_open(spattern, spattern_len, slocale, NULL, &INTL_DATA_ERROR_CODE(mfo));
diff --git a/ext/intl/msgformat/msgformat_parse.c b/ext/intl/msgformat/msgformat_parse.c
index 8393d4c..f540b1d 100755
--- a/ext/intl/msgformat/msgformat_parse.c
+++ b/ext/intl/msgformat/msgformat_parse.c
@@ -129,11 +129,13 @@ PHP_FUNCTION( msgfmt_parse_message )
 		slocale = INTL_G(default_locale);
 	}
 
+#ifdef MSG_FORMAT_QUOTE_APOS
 	if(msgformat_fix_quotes(&spattern, &spattern_len, &INTL_DATA_ERROR_CODE(mfo)) != SUCCESS) {
 		intl_error_set( NULL, U_INVALID_FORMAT_ERROR,
 			"msgfmt_parse_message: error converting pattern to quote-friendly format", 0 TSRMLS_CC );
 		RETURN_FALSE;
 	}
+#endif
 
 	/* Create an ICU message formatter. */
 	MSG_FORMAT_OBJECT(mfo) = umsg_open(spattern, spattern_len, slocale, NULL, &INTL_DATA_ERROR_CODE(mfo));


commit 45b3fa4deea739c8a3bf8778efac2f748a2685bc
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Tue Jun 5 16:47:00 2012 +0200

    Fixed tests in ext/intl
    
    21 is not a valid value for UNUM_PADDING_POSITION. Changed the test to
    use 2 instead.
    
    Remove ICU 4.2- test. No one cares.

diff --git a/ext/intl/tests/formatter_get_set_attribute.phpt b/ext/intl/tests/formatter_get_set_attribute.phpt
index cb5e415..51c7d36 100755
--- a/ext/intl/tests/formatter_get_set_attribute.phpt
+++ b/ext/intl/tests/formatter_get_set_attribute.phpt
@@ -1,8 +1,8 @@
 --TEST--
-numfmt_get/set_attribute() icu < 4.2
+numfmt_get/set_attribute()
 --SKIPIF--
 <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
-<?php if(version_compare(INTL_ICU_VERSION, '4.2', '<') != 1) print 'skip'; ?>
+<?php if(version_compare(INTL_ICU_VERSION, '4.2', '<') != 1) print 'skip for ICU 4.4+'; ?>
 --FILE--
 <?php
 
@@ -29,7 +29,7 @@ function ut_main()
         'ROUNDING_MODE' => array( NumberFormatter::ROUNDING_MODE, 1, 12345.123456 ),
         'ROUNDING_INCREMENT' => array( NumberFormatter::ROUNDING_INCREMENT, (float)2, 12345.123456 ),
         'FORMAT_WIDTH' => array( NumberFormatter::FORMAT_WIDTH, 27, 12345.123456 ),
-        'PADDING_POSITION' => array( NumberFormatter::PADDING_POSITION, 21, 12345.123456 ),
+        'PADDING_POSITION' => array( NumberFormatter::PADDING_POSITION, 2, 12345.123456 ),
         'SECONDARY_GROUPING_SIZE' => array( NumberFormatter::SECONDARY_GROUPING_SIZE, 2, 12345.123456 ),
         'SIGNIFICANT_DIGITS_USED' => array( NumberFormatter::SIGNIFICANT_DIGITS_USED, 1, 12345.123456 ),
         'MIN_SIGNIFICANT_DIGITS' => array( NumberFormatter::MIN_SIGNIFICANT_DIGITS, 3, 1 ),
@@ -159,7 +159,7 @@ Setting attribute: ok
 New attribute value: 1 ;  Format result: '0,012,345.12345' ; Parse result: 12345.12345
 
 Attribute ROUNDING_INCREMENT
-Old attribute value: 1.0E-5 ;  Format result: '0,012,345.12346' ; Parse result: 12345.12346
+Old attribute value: 0 ;  Format result: '0,012,345.12346' ; Parse result: 12345.12346
 Setting attribute: ok
 New attribute value: 2 ;  Format result: '0,012,346.00000' ; Parse result: 12346
 
@@ -171,7 +171,7 @@ New attribute value: 27 ;  Format result: '************0,012,345.12346' ; Parse
 Attribute PADDING_POSITION
 Old attribute value: 0 ;  Format result: '************0,012,345.12346' ; Parse result: 12345.12346
 Setting attribute: ok
-New attribute value: 21 ;  Format result: '0,012,345.12346' ; Parse result: 12345.12346
+New attribute value: 2 ;  Format result: '0,012,345.12346************' ; Parse result: 12345.12346
 
 Attribute SECONDARY_GROUPING_SIZE
 Old attribute value: 0 ;  Format result: '************0,012,345.12346' ; Parse result: 12345.12346
diff --git a/ext/intl/tests/formatter_get_set_attribute2.phpt b/ext/intl/tests/formatter_get_set_attribute2.phpt
deleted file mode 100644
index 7d5fe69..0000000
--- a/ext/intl/tests/formatter_get_set_attribute2.phpt
+++ /dev/null
@@ -1,194 +0,0 @@
---TEST--
-numfmt_get/set_attribute() icu >= 4.8
---SKIPIF--
-<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
-<?php if(version_compare(INTL_ICU_VERSION, '4.8') < 0) print 'skip'; ?>
---FILE--
-<?php
-
-/*
- * Get/set various number formatting attributes.
- */
-
-
-function ut_main()
-{
-    // attr_name => array( attr, value )
-    $attributes = array(
-        'PARSE_INT_ONLY' => array( NumberFormatter::PARSE_INT_ONLY, 1, 12345.123456 ),
-        'GROUPING_USED' => array( NumberFormatter::GROUPING_USED, 0, 12345.123456 ),
-        'DECIMAL_ALWAYS_SHOWN' => array( NumberFormatter::DECIMAL_ALWAYS_SHOWN, 1, 12345 ),
-        'MAX_INTEGER_DIGITS' => array( NumberFormatter::MAX_INTEGER_DIGITS, 2, 12345.123456 ),
-        'MIN_INTEGER_DIGITS' => array( NumberFormatter::MIN_INTEGER_DIGITS, 20, 12345.123456 ),
-        'INTEGER_DIGITS' => array( NumberFormatter::INTEGER_DIGITS, 7, 12345.123456 ),
-        'MAX_FRACTION_DIGITS' => array( NumberFormatter::MAX_FRACTION_DIGITS, 2, 12345.123456 ),
-        'MIN_FRACTION_DIGITS' => array( NumberFormatter::MIN_FRACTION_DIGITS, 20, 12345.123456 ),
-        'FRACTION_DIGITS' => array( NumberFormatter::FRACTION_DIGITS, 5, 12345.123456 ),
-        'MULTIPLIER' => array( NumberFormatter::MULTIPLIER, 2, 12345.123456 ),
-        'GROUPING_SIZE' => array( NumberFormatter::GROUPING_SIZE, 2, 12345.123456 ),
-        'ROUNDING_MODE' => array( NumberFormatter::ROUNDING_MODE, 1, 12345.123456 ),
-        'ROUNDING_INCREMENT' => array( NumberFormatter::ROUNDING_INCREMENT, (float)2, 12345.123456 ),
-        'FORMAT_WIDTH' => array( NumberFormatter::FORMAT_WIDTH, 27, 12345.123456 ),
-        'PADDING_POSITION' => array( NumberFormatter::PADDING_POSITION, 21, 12345.123456 ),
-        'SECONDARY_GROUPING_SIZE' => array( NumberFormatter::SECONDARY_GROUPING_SIZE, 2, 12345.123456 ),
-        'SIGNIFICANT_DIGITS_USED' => array( NumberFormatter::SIGNIFICANT_DIGITS_USED, 1, 12345.123456 ),
-        'MIN_SIGNIFICANT_DIGITS' => array( NumberFormatter::MIN_SIGNIFICANT_DIGITS, 3, 1 ),
-        'MAX_SIGNIFICANT_DIGITS' => array( NumberFormatter::MAX_SIGNIFICANT_DIGITS, 4, 12345.123456 ),
-        // 'LENIENT_PARSE' => array( NumberFormatter::LENIENT_PARSE, 2, 12345.123456 )
-    );
-
-    $res_str = '';
-
-    $fmt = ut_nfmt_create( "en_US", NumberFormatter::DECIMAL );
-
-    foreach( $attributes as $attr_name => $args )
-    {
-        list( $attr, $new_val, $number ) = $args;
-        $res_str .= "\nAttribute $attr_name\n";
-
-        // Get original value of the attribute.
-        $orig_val = ut_nfmt_get_attribute( $fmt, $attr );
-
-        // Format the number using the original attribute value.
-        $rc = ut_nfmt_format( $fmt, $number );
-
-        $ps = ut_nfmt_parse( $fmt, $rc );
-
-        $res_str .= sprintf( "Old attribute value: %s ;  Format result: %s ; Parse result: %s\n",
-                             dump( $orig_val ),
-                             dump( $rc ),
-                             dump( $ps ) );
-
-        // Set new attribute value.
-        $rc = ut_nfmt_set_attribute( $fmt, $attr, $new_val );
-        if( $rc )
-            $res_str .= "Setting attribute: ok\n";
-        else
-            $res_str .= sprintf( "Setting attribute failed: %s\n", ut_nfmt_get_error_message( $fmt ) );
-
-        // Format the number using the new value.
-        $rc = ut_nfmt_format( $fmt, $number );
-
-        // Get current value of the attribute and check if it equals $new_val.
-        $attr_val_check = ut_nfmt_get_attribute( $fmt, $attr );
-        if( $attr_val_check !== $new_val )
-            $res_str .= "ERROR: New $attr_name attribute value has not been set correctly.\n";
-
-        $ps = ut_nfmt_parse( $fmt, $rc );
-
-        $res_str .= sprintf( "New attribute value: %s ;  Format result: %s ; Parse result: %s\n",
-                             dump( $new_val ),
-                             dump( $rc ),
-                             dump( $ps ) );
-
-
-        // Restore original attribute of the  value
-        if( $attr != NumberFormatter::INTEGER_DIGITS && $attr != NumberFormatter::FRACTION_DIGITS
-             && $attr != NumberFormatter::FORMAT_WIDTH && $attr != NumberFormatter::SIGNIFICANT_DIGITS_USED )
-            ut_nfmt_set_attribute( $fmt, $attr, $orig_val );
-    }
-
-    return $res_str;
-}
-
-include_once( 'ut_common.inc' );
-
-// Run the test
-ut_run();
-
-?>
---EXPECT--
-Attribute PARSE_INT_ONLY
-Old attribute value: 0 ;  Format result: '12,345.123' ; Parse result: 12345.123
-Setting attribute: ok
-New attribute value: 1 ;  Format result: '12,345.123' ; Parse result: 12345
-
-Attribute GROUPING_USED
-Old attribute value: 1 ;  Format result: '12,345.123' ; Parse result: 12345.123
-Setting attribute: ok
-New attribute value: 0 ;  Format result: '12345.123' ; Parse result: 12345.123
-
-Attribute DECIMAL_ALWAYS_SHOWN
-Old attribute value: 0 ;  Format result: '12,345' ; Parse result: 12345
-Setting attribute: ok
-New attribute value: 1 ;  Format result: '12,345.' ; Parse result: 12345
-
-Attribute MAX_INTEGER_DIGITS
-Old attribute value: 309 ;  Format result: '12,345.123' ; Parse result: 12345.123
-Setting attribute: ok
-New attribute value: 2 ;  Format result: '45.123' ; Parse result: 45.123
-
-Attribute MIN_INTEGER_DIGITS
-Old attribute value: 1 ;  Format result: '12,345.123' ; Parse result: 12345.123
-Setting attribute: ok
-New attribute value: 20 ;  Format result: '00,000,000,000,000,012,345.123' ; Parse result: 12345.123
-
-Attribute INTEGER_DIGITS
-Old attribute value: 1 ;  Format result: '12,345.123' ; Parse result: 12345.123
-Setting attribute: ok
-New attribute value: 7 ;  Format result: '0,012,345.123' ; Parse result: 12345.123
-
-Attribute MAX_FRACTION_DIGITS
-Old attribute value: 3 ;  Format result: '0,012,345.123' ; Parse result: 12345.123
-Setting attribute: ok
-New attribute value: 2 ;  Format result: '0,012,345.12' ; Parse result: 12345.12
-
-Attribute MIN_FRACTION_DIGITS
-Old attribute value: 0 ;  Format result: '0,012,345.123' ; Parse result: 12345.123
-Setting attribute: ok
-New attribute value: 20 ;  Format result: '0,012,345.12345600000000000000' ; Parse result: 12345.123456
-
-Attribute FRACTION_DIGITS
-Old attribute value: 0 ;  Format result: '0,012,345.123456' ; Parse result: 12345.123456
-Setting attribute: ok
-New attribute value: 5 ;  Format result: '0,012,345.12346' ; Parse result: 12345.12346
-
-Attribute MULTIPLIER
-Old attribute value: 1 ;  Format result: '0,012,345.12346' ; Parse result: 12345.12346
-Setting attribute: ok
-New attribute value: 2 ;  Format result: '0,024,690.24691' ; Parse result: 12345.123455
-
-Attribute GROUPING_SIZE
-Old attribute value: 3 ;  Format result: '0,012,345.12346' ; Parse result: 12345.12346
-Setting attribute: ok
-New attribute value: 2 ;  Format result: '0,01,23,45.12346' ; Parse result: 12345.12346
-
-Attribute ROUNDING_MODE
-Old attribute value: 4 ;  Format result: '0,012,345.12346' ; Parse result: 12345.12346
-Setting attribute: ok
-New attribute value: 1 ;  Format result: '0,012,345.12345' ; Parse result: 12345.12345
-
-Attribute ROUNDING_INCREMENT
-Old attribute value: 0 ;  Format result: '0,012,345.12346' ; Parse result: 12345.12346
-Setting attribute: ok
-New attribute value: 2 ;  Format result: '0,012,346.00000' ; Parse result: 12346
-
-Attribute FORMAT_WIDTH
-Old attribute value: 0 ;  Format result: '0,012,345.12346' ; Parse result: 12345.12346
-Setting attribute: ok
-New attribute value: 27 ;  Format result: '************0,012,345.12346' ; Parse result: 12345.12346
-
-Attribute PADDING_POSITION
-Old attribute value: 0 ;  Format result: '************0,012,345.12346' ; Parse result: 12345.12346
-Setting attribute: ok
-New attribute value: 21 ;  Format result: '0,012,345.12346' ; Parse result: 12345.12346
-
-Attribute SECONDARY_GROUPING_SIZE
-Old attribute value: 0 ;  Format result: '************0,012,345.12346' ; Parse result: 12345.12346
-Setting attribute: ok
-New attribute value: 2 ;  Format result: '************00,12,345.12346' ; Parse result: 12345.12346
-
-Attribute SIGNIFICANT_DIGITS_USED
-Old attribute value: 0 ;  Format result: '************0,012,345.12346' ; Parse result: 12345.12346
-Setting attribute: ok
-New attribute value: 1 ;  Format result: '*******************12,345.1' ; Parse result: 12345.1
-
-Attribute MIN_SIGNIFICANT_DIGITS
-Old attribute value: 1 ;  Format result: '**************************1' ; Parse result: 1
-Setting attribute: ok
-New attribute value: 3 ;  Format result: '***********************1.00' ; Parse result: 1
-
-Attribute MAX_SIGNIFICANT_DIGITS
-Old attribute value: 6 ;  Format result: '*******************12,345.1' ; Parse result: 12345.1
-Setting attribute: ok
-New attribute value: 4 ;  Format result: '*********************12,350' ; Parse result: 12350


commit 15213768e6cc098ab4e53cacc3b5eb86fa85284a
Author: Felipe Pena <felipensp at gmail.com>
Date:   Mon Jun 4 20:07:14 2012 -0300

    - Fixed bug #62227 (Invalid phar stream path causes crash)

diff --git a/ext/phar/phar.c b/ext/phar/phar.c
index 4ab2b86..8a0ebfa 100644
--- a/ext/phar/phar.c
+++ b/ext/phar/phar.c
@@ -1799,7 +1799,11 @@ static int phar_analyze_path(const char *fname, const char *ext, int ext_len, in
 #ifdef PHP_WIN32
 				phar_unixify_path_separators(realpath, strlen(realpath));
 #endif
-				a = strstr(realpath, fname) + ((ext - fname) + ext_len);
+				if ((a = strstr(realpath, fname)) == NULL) {
+					return FAILURE;
+				}
+				
+				a += ((ext - fname) + ext_len);
 				*a = '\0';
 				slash = strrchr(realpath, '/');
 


commit c22a29b57639178581210ec377ea4e9909f828c9
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Mon Jun 4 18:21:39 2012 +0100

    Updated UPGRADING for the changes in eb346ef

diff --git a/UPGRADING b/UPGRADING
index 73cf106..0787087 100755
--- a/UPGRADING
+++ b/UPGRADING
@@ -63,12 +63,42 @@ PHP X.Y UPGRADE NOTES
 - MessageFormatter::parse() and MessageFormat::format() (and their static
   equivalents) now don't throw away better than second precision in the
   arguments.
+- IntlDateFormatter::__construct and datefmt_create() now accept for the
+  $timezone argument time zone identifiers, IntlTimeZone objects, DateTimeZone
+  objects and NULL. It used to accept only time zone identifiers and NULL.
+  Invalid time zone identifiers are no longer accepted. Emptry strings are
+  no longer accepted.
+- The default time zone used in IntlDateFormatter::__construct and
+  datefmt_create() (when the corresponding argument is not passed or NULL is
+  passed) is now the one given by date_default_timezone_get(), not the
+  default ICU time zone.
+- The time zone passed to the IntlDateFormatter is ignored if it is NULL and if
+  the calendar passed is an IntlCalendar object -- in this case, the
+  IntlCalendar's time zone will be used instead. Otherwise, the time zone
+  specified in the $timezone argument is used instead. This does not affect
+  old code, as IntlCalendar was introduced in this version.
+- IntlDateFormatter::__construct and datefmt_create() now accept for the
+  $calendar argument also IntlCalendar objects.
+- IntlDateFormatter::getCalendar() and datefmt_get_calendar() return false
+  if the IntlDateFormatter was set up with an IntlCalendar instead of the
+  constants IntlDateFormatter::GREGORIAN/TRADITIONAL. IntlCalendar did not
+  exist before this version.
+- IntlDateFormatter::setCalendar() and datefmt_set_calendar() now also accept
+  an IntlCalendar object, in which case its time zone is taken. Passing a
+  constant is still allowed, and still keeps the time zone.
+- IntlDateFormatter::setTimeZoneID() and datefmt_set_timezone_id() are
+  deprecated. Use IntlDateFormatter::setTimeZone() or datefmt_set_timezone()
+  instead.
 
 ========================================
 5. New Functions
 ========================================
 
 - Intl:
+  - datefmt_get_calendar_object()
+  - datefmt_get_timezone()
+  - datefmt_set_timezone()
+  - datefmt_get_calendar_object()
   - intlcal_create_instance()
   - intlcal_get_keyword_values_for_locale()
   - intlcal_get_now()
@@ -140,6 +170,10 @@ PHP X.Y UPGRADE NOTES
   - intltz_get_error_code()
   - intltz_get_error_message()
 
+  - IntlDateFormatter::getCalendarObject()
+  - IntlDateFormatter::getTimeZone()
+  - IntlDateFormatter::setTimeZone()
+
 - SPL:
   - SplFixedArray::__wakeup()
 


commit 9b233b7e5ec236774c84dc83b4020b1258762c17
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Mon Jun 4 10:18:24 2012 +0200

    Changed XFAILed collator_get_sort_key.phpt
    
    Ressurected and limited to ICU 4.8 in the hope that the sort keys
    will remain stable in more recent ICU versions. I have only tested
    with ICU 4.8 so far.

diff --git a/ext/intl/tests/collator_get_sort_key.phpt b/ext/intl/tests/collator_get_sort_key.phpt
index 0fedde0..a9c4d71 100755
--- a/ext/intl/tests/collator_get_sort_key.phpt
+++ b/ext/intl/tests/collator_get_sort_key.phpt
@@ -2,8 +2,7 @@
 collator_get_sort_key()
 --SKIPIF--
 <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
---XFAIL--
-Sort keys are not fixed, comparing them to fixed strings doesn't work.
+<?php if(version_compare(INTL_ICU_VERSION, '4.8') < 0) print 'skip ICU >= 4.8 only'; ?>
 --FILE--
 <?php
 
@@ -18,8 +17,8 @@ function sort_arrays( $locale, $data )
 
 	foreach($data as $value) {
 		$res_val = ut_coll_get_sort_key( $coll, $value );
-		$res_str .= "source: ".urlencode($value)."\n".
-					"key: ".urlencode($res_val)."\n";
+		$res_str .= "source: ".$value."\n".
+					"key: ".bin2hex($res_val)."\n";
 	}
 
     return $res_str;
@@ -58,42 +57,42 @@ ut_run();
 ?>
 --EXPECT--
 source: abc
-key: %29%2B-%01%07%01%07%00
+key: 27292b01070107
 source: abd
-key: %29%2B%2F%01%07%01%07%00
+key: 27292d01070107
 source: aaa
-key: %29%29%29%01%07%01%07%00
-source: %D0%B0%D0%B0
-key: _++%01%06%01%06%00
-source: %D0%B0
-key: _+%01%05%01%05%00
+key: 27272701070107
+source: аа
+key: 5c0a0a01060106
+source: а
+key: 5c0a01050105
 source: z
-key: %5B%01%05%01%05%00
-source:
-key: %01%01%00
-source:
-key: %01%01%00
+key: 5901050105
+source: 
+key: 0101
+source: 
+key: 0101
 source: 3
-key: %26%80%01%05%01%05%00
+key: 1801050105
 source: y
-key: Y%01%05%01%05%00
+key: 5701050105
 source: i
-key: 9%01%05%01%05%00
+key: 3701050105
 source: k
-key: %3D%01%05%01%05%00
-source: %D0%B0%D0%B1%D0%B3
-key: _+%2C0%01%07%01%07%00
-source: %D0%B0%D0%B1%D0%B2
-key: _+%2C.%01%07%01%07%00
-source: %D0%B6%D0%B6%D0%B6
-key: _LLL%01%07%01%07%00
-source: %D1%8D%D1%8E%D1%8F
-key: %60%05%09%0B%01%07%01%07%00
-source: %D0%B0%D0%B1%D0%B3
-key: _+%2C0%01%07%01%07%00
-source: %D0%B0%D0%B1%D0%B2
-key: _+%2C.%01%07%01%07%00
-source: %D0%B6%D0%B6%D0%B6
-key: _LLL%01%07%01%07%00
-source: %D1%8D%D1%8E%D1%8F
-key: %60%05%09%0B%01%07%01%07%00
\ No newline at end of file
+key: 3b01050105
+source: абг
+key: 5c0a161a01070107
+source: абв
+key: 5c0a161801070107
+source: жжж
+key: 5c3a3a3a01070107
+source: эюя
+key: 5d3b3f4501070107
+source: абг
+key: 5c0a161a01070107
+source: абв
+key: 5c0a161801070107
+source: жжж
+key: 5c3a3a3a01070107
+source: эюя
+key: 5d3b3f4501070107
\ No newline at end of file


commit 6efc877826d327186dbf8055a10856363bc94aa2
Merge: 9434f5e 758f068
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Sun Jun 3 23:08:19 2012 +0100

    Merge branch 'datefmt_tz_cal_interop'
    
    * datefmt_tz_cal_interop:
      Added and fixed tests given eb346ef
      DateFormat plays nice with Calendar, TimeZone
      Added private constructor to IntlTimeZone.
      Fixed write in constant memory.



commit 758f0686d41cd39176f5055c50f0b094580cbbf0
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Mon Jun 4 00:02:35 2012 +0200

    Added and fixed tests given eb346ef

diff --git a/ext/intl/tests/bug50590.phpt b/ext/intl/tests/bug50590.phpt
index c39c333..4784d37 100644
--- a/ext/intl/tests/bug50590.phpt
+++ b/ext/intl/tests/bug50590.phpt
@@ -1,5 +1,7 @@
 --TEST--
 Bug #50590 (IntlDateFormatter::parse result is limited to the integer range)
+--INI--
+date.timezone=Atlantic/Azores
 --SKIPIF--
 <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
 --FILE--
diff --git a/ext/intl/tests/bug62017.phpt b/ext/intl/tests/bug62017.phpt
index 13c4fe5..50aeae4 100644
--- a/ext/intl/tests/bug62017.phpt
+++ b/ext/intl/tests/bug62017.phpt
@@ -14,7 +14,7 @@ var_dump(
 	new IntlDateFormatter('', IntlDateFormatter::NONE, IntlDateFormatter::NONE, "Europe/Lisbon",
 		IntlDateFormatter::GREGORIAN, "\x80"));
 --EXPECTF--
-Warning: datefmt_create(): datefmt_create: error converting timezone_str to UTF-16 in %s on line %d
+Warning: datefmt_create(): datefmt_create: Time zone identifier given is not a valid UTF-8 string in %s on line %d
 NULL
 
 Warning: IntlDateFormatter::__construct(): datefmt_create: error converting pattern to UTF-16 in %s on line %d
diff --git a/ext/intl/tests/bug62081.phpt b/ext/intl/tests/bug62081.phpt
index 7d9e2ce..44ad4be 100644
--- a/ext/intl/tests/bug62081.phpt
+++ b/ext/intl/tests/bug62081.phpt
@@ -1,5 +1,7 @@
 --TEST--
 Bug #62081: IntlDateFormatter leaks memory if called twice
+--INI--
+date.timezone=Atlantic/Azores
 --SKIPIF--
 <?php
 if (!extension_loaded('intl'))
@@ -7,8 +9,8 @@ if (!extension_loaded('intl'))
 --FILE--
 <?php
 ini_set('intl.error_level', E_WARNING);
-$x = new IntlDateFormatter(1,1,1,1,1);
-var_dump($x->__construct(1,1,1,1,1));
+$x = new IntlDateFormatter('en', 1, 1);
+var_dump($x->__construct('en', 1, 1));
 --EXPECTF--
 Warning: IntlDateFormatter::__construct(): datefmt_create: cannot call constructor twice in %s on line %d
 NULL
diff --git a/ext/intl/tests/dateformat___construct_bad_tz_cal.phpt b/ext/intl/tests/dateformat___construct_bad_tz_cal.phpt
new file mode 100644
index 0000000..1f682dd
--- /dev/null
+++ b/ext/intl/tests/dateformat___construct_bad_tz_cal.phpt
@@ -0,0 +1,28 @@
+--TEST--
+IntlDateFormatter::__construct(): bad timezone or calendar
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+ini_set("intl.default_locale", "pt_PT");
+ini_set("date.timezone", 'Atlantic/Azores');
+
+var_dump(new IntlDateFormatter(NULL, 0, 0, 'bad timezone'));
+
+var_dump(new IntlDateFormatter(NULL, 0, 0, NULL, 3));
+
+var_dump(new IntlDateFormatter(NULL, 0, 0, NULL, new stdclass));
+
+
+?>
+==DONE==
+--EXPECTF--
+
+Warning: IntlDateFormatter::__construct(): datefmt_create: no such time zone: 'bad timezone' in %s on line %d
+NULL
+
+Warning: IntlDateFormatter::__construct(): datefmt_create: invalid value for calendar type; it must be one of IntlDateFormatter::TRADITIONAL (locale's default calendar) or IntlDateFormatter::GREGORIAN. Alternatively, it can be an IntlCalendar object in %s on line %d
+NULL
+
+Warning: IntlDateFormatter::__construct(): datefmt_create: Invalid calendar argument; should be an integer or an IntlCalendar instance in %s on line %d
+NULL
+==DONE==
diff --git a/ext/intl/tests/dateformat_calendars.phpt b/ext/intl/tests/dateformat_calendars.phpt
index 27f380c..6af02e5 100644
--- a/ext/intl/tests/dateformat_calendars.phpt
+++ b/ext/intl/tests/dateformat_calendars.phpt
@@ -41,5 +41,5 @@ string(44) "Sunday, January 1, 2012 5:12:00 AM GMT+05:12"
 string(44) "Sunday, January 1, 2012 5:12:00 AM GMT+05:12"
 string(42) "Sunday, Tevet 6, 5772 5:12:00 AM GMT+05:12"
 
-Warning: IntlDateFormatter::__construct(): datefmt_create: invalid value for calendar type; it must be one of IntlDateFormatter::TRADITIONAL (locale's default calendar) or IntlDateFormatter::GREGORIAN in %s on line %d
+Warning: IntlDateFormatter::__construct(): datefmt_create: invalid value for calendar type; it must be one of IntlDateFormatter::TRADITIONAL (locale's default calendar) or IntlDateFormatter::GREGORIAN. Alternatively, it can be an IntlCalendar object in %s on line %d
 ==DONE==
diff --git a/ext/intl/tests/dateformat_create_cal_arg.phpt b/ext/intl/tests/dateformat_create_cal_arg.phpt
new file mode 100644
index 0000000..8e5f942
--- /dev/null
+++ b/ext/intl/tests/dateformat_create_cal_arg.phpt
@@ -0,0 +1,49 @@
+--TEST--
+IntlDateFormatter: several forms of the calendar arg
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+ini_set("intl.default_locale", "pt_PT");
+ini_set("date.timezone", 'Atlantic/Azores');
+
+$ts = strtotime('2012-01-01 00:00:00 UTC');
+
+$cal = new IntlGregorianCalendar('UTC', NULL);
+$df = new IntlDateFormatter('es_ES', 0, 0, NULL, $cal);
+echo $df->format($ts), "\n";
+
+$cal = IntlCalendar::createInstance('UTC', 'en at calendar=islamic');
+$df = new IntlDateFormatter('es_ES', 0, 0, NULL, $cal);
+echo $df->format($ts), "\n";
+
+//override calendar's timezone
+$cal = new IntlGregorianCalendar('UTC', NULL);
+$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Madrid', $cal);
+echo $df->format($ts), "\n";
+
+//default calendar is gregorian
+$df = new IntlDateFormatter('es_ES at calendar=islamic', 0, 0);
+echo $df->format($ts), "\n";
+
+//try now with traditional
+$df = new IntlDateFormatter('es_ES at calendar=islamic', 0, 0, NULL, IntlDateFormatter::TRADITIONAL);
+echo $df->format($ts), "\n";
+
+//the timezone can be overridden when not specifying a calendar
+$df = new IntlDateFormatter('es_ES at calendar=islamic', 0, 0, 'UTC', IntlDateFormatter::TRADITIONAL);
+echo $df->format($ts), "\n";
+
+$df = new IntlDateFormatter('es_ES', 0, 0, 'UTC', 0);
+echo $df->format($ts), "\n";
+
+?>
+==DONE==
+--EXPECT--
+domingo, 1 de enero de 2012 00:00:00 GMT
+domingo, 8 de Safar de 1433 00:00:00 GMT
+domingo, 1 de enero de 2012 01:00:00 Hora estándar de Europa Central
+sábado, 31 de diciembre de 2011 d.C. 23:00:00 Hora estándar de las Azores
+sábado, 7 de Safar de 1433 AH 23:00:00 Hora estándar de las Azores
+domingo, 8 de Safar de 1433 AH 00:00:00 GMT
+domingo, 1 de enero de 2012 00:00:00 GMT
+==DONE==
diff --git a/ext/intl/tests/dateformat_format.phpt b/ext/intl/tests/dateformat_format.phpt
index e554819..98f9d34 100755
--- a/ext/intl/tests/dateformat_format.phpt
+++ b/ext/intl/tests/dateformat_format.phpt
@@ -5,6 +5,8 @@ datefmt_format_code()
 --FILE--
 <?php
 
+//ini_set("intl.error_level", E_WARNING);
+
 /*
  * Test for the datefmt_format  function
  */
@@ -12,7 +14,7 @@ datefmt_format_code()
 
 function ut_main()
 {
-	$timezone = 'GMT-10';
+	$timezone = 'GMT-10:00';
 
 	$locale_arr = array (
 		'en_US'
diff --git a/ext/intl/tests/dateformat_format_parse.phpt b/ext/intl/tests/dateformat_format_parse.phpt
index bd41d71..6bd3d8a 100755
--- a/ext/intl/tests/dateformat_format_parse.phpt
+++ b/ext/intl/tests/dateformat_format_parse.phpt
@@ -12,7 +12,7 @@ datefmt_format_code() and datefmt_parse_code()
 
 function ut_main()
 {
-	$timezone = 'GMT+5'; 
+	$timezone = 'GMT+05:00'; 
 
 	$locale_arr = array (
 		'en_US'
diff --git a/ext/intl/tests/dateformat_getCalendarObject_error.phpt b/ext/intl/tests/dateformat_getCalendarObject_error.phpt
new file mode 100644
index 0000000..22f12cb
--- /dev/null
+++ b/ext/intl/tests/dateformat_getCalendarObject_error.phpt
@@ -0,0 +1,39 @@
+--TEST--
+IntlDateFormatter::getCalendarObject(): bad args
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+ini_set("intl.default_locale", "pt_PT");
+ini_set("date.timezone", 'Atlantic/Azores');
+
+$df = new IntlDateFormatter(NULL, 0, 0);
+
+var_dump($df->getCalendarObject(9));
+var_dump(datefmt_get_calendar_object($df, 9));
+var_dump(datefmt_get_calendar_object($df, 9));
+var_dump(datefmt_get_calendar_object(new stdclass));
+
+?>
+==DONE==
+--EXPECTF--
+
+Warning: IntlDateFormatter::getCalendarObject() expects exactly 0 parameters, 1 given in %s on line %d
+
+Warning: IntlDateFormatter::getCalendarObject(): datefmt_get_calendar_object: unable to parse input params in %s on line %d
+bool(false)
+
+Warning: datefmt_get_calendar_object() expects exactly 1 parameter, 2 given in %s on line %d
+
+Warning: datefmt_get_calendar_object(): datefmt_get_calendar_object: unable to parse input params in %s on line %d
+bool(false)
+
+Warning: datefmt_get_calendar_object() expects exactly 1 parameter, 2 given in %s on line %d
+
+Warning: datefmt_get_calendar_object(): datefmt_get_calendar_object: unable to parse input params in %s on line %d
+bool(false)
+
+Warning: datefmt_get_calendar_object() expects parameter 1 to be IntlDateFormatter, object given in %s on line %d
+
+Warning: datefmt_get_calendar_object(): datefmt_get_calendar_object: unable to parse input params in %s on line %d
+bool(false)
+==DONE==
diff --git a/ext/intl/tests/dateformat_getTimeZone_error.phpt b/ext/intl/tests/dateformat_getTimeZone_error.phpt
new file mode 100644
index 0000000..c9d49fd
--- /dev/null
+++ b/ext/intl/tests/dateformat_getTimeZone_error.phpt
@@ -0,0 +1,39 @@
+--TEST--
+IntlDateFormatter::getTimeZone(): bad args
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+ini_set("intl.default_locale", "pt_PT");
+ini_set("date.timezone", 'Atlantic/Azores');
+
+$df = new IntlDateFormatter(NULL, 0, 0);
+
+var_dump($df->getTimeZone(9));
+var_dump(datefmt_get_timezone($df, 9));
+var_dump(datefmt_get_timezone($df, 9));
+var_dump(datefmt_get_timezone(new stdclass));
+
+?>
+==DONE==
+--EXPECTF--
+
+Warning: IntlDateFormatter::getTimeZone() expects exactly 0 parameters, 1 given in %s on line %d
+
+Warning: IntlDateFormatter::getTimeZone(): datefmt_get_timezone: unable to parse input params in %s on line %d
+bool(false)
+
+Warning: datefmt_get_timezone() expects exactly 1 parameter, 2 given in %s on line %d
+
+Warning: datefmt_get_timezone(): datefmt_get_timezone: unable to parse input params in %s on line %d
+bool(false)
+
+Warning: datefmt_get_timezone() expects exactly 1 parameter, 2 given in %s on line %d
+
+Warning: datefmt_get_timezone(): datefmt_get_timezone: unable to parse input params in %s on line %d
+bool(false)
+
+Warning: datefmt_get_timezone() expects parameter 1 to be IntlDateFormatter, object given in %s on line %d
+
+Warning: datefmt_get_timezone(): datefmt_get_timezone: unable to parse input params in %s on line %d
+bool(false)
+==DONE==
diff --git a/ext/intl/tests/dateformat_get_set_calendar.phpt b/ext/intl/tests/dateformat_get_set_calendar.phpt
index bfd4e57..e792ea3 100755
--- a/ext/intl/tests/dateformat_get_set_calendar.phpt
+++ b/ext/intl/tests/dateformat_get_set_calendar.phpt
@@ -1,60 +1,51 @@
 --TEST--
-datefmt_get_calendar_code() datefmt_set_calendar_code()
---SKIPIF--
-<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+IntlDateFormatter: setCalendar()/getCalendar()/getCalendarObject()
 --FILE--
 <?php
+ini_set("intl.error_level", E_WARNING);
+ini_set("intl.default_locale", "pt_PT");
+ini_set("date.timezone", 'Atlantic/Azores');
+
+$ts = strtotime('2012-01-01 00:00:00 UTC');
+
+function d(IntlDateFormatter $df) {
+global $ts;
+echo $df->format($ts), "\n";
+var_dump($df->getCalendar(),
+$df->getCalendarObject()->getType(),
+$df->getCalendarObject()->getTimeZone()->getId());
+echo "\n";
+}
 
-/*
- * Test for the datefmt_get_calendar  and datefmt_set_calendar functions
- */
-
-
-function ut_main()
-{
-	$calendar_arr = array (
-		IntlDateFormatter::GREGORIAN,
-		IntlDateFormatter::TRADITIONAL,
-		3
-	);
-	
-	$res_str = '';
-
-	$start_calendar = IntlDateFormatter::GREGORIAN;
-	$res_str .= "\nCreating IntlDateFormatter with calendar = $start_calendar";
-	$fmt = ut_datefmt_create( "de-DE",  IntlDateFormatter::SHORT, IntlDateFormatter::SHORT ,'America/Los_Angeles', IntlDateFormatter::GREGORIAN);
-	$calendar = ut_datefmt_get_calendar( $fmt);
-	$res_str .= "\nAfter call to get_calendar :  calendar= $calendar";
-	$res_str .= "\n-------------------";
-
-	foreach( $calendar_arr as $calendar_entry )
-	{
-		$res_str .= "\nSetting IntlDateFormatter with calendar = $calendar_entry";
-		ut_datefmt_set_calendar( $fmt, $calendar_entry);
-		$calendar = ut_datefmt_get_calendar( $fmt);
-		$res_str .= "\nAfter call to get_calendar :  calendar= $calendar";
-		$res_str .= "\n-------------------";
-	}
-
-	return $res_str;
+$df = new IntlDateFormatter('fr at calendar=islamic', 0, 0, 'Europe/Minsk');
+d($df);
 
-}
 
-include_once( 'ut_common.inc' );
+//changing the calendar with a cal type should not change tz
+$df->setCalendar(IntlDateFormatter::TRADITIONAL);
+d($df);
+
+//but changing with an actual calendar should
+$cal = IntlCalendar::createInstance("UTC");
+$df->setCalendar($cal);
+d($df);
 
-// Run the test
-ut_run();
 ?>
+==DONE==
 --EXPECT--
-Creating IntlDateFormatter with calendar = 1
-After call to get_calendar :  calendar= 1
--------------------
-Setting IntlDateFormatter with calendar = 1
-After call to get_calendar :  calendar= 1
--------------------
-Setting IntlDateFormatter with calendar = 0
-After call to get_calendar :  calendar= 0
--------------------
-Setting IntlDateFormatter with calendar = 3
-After call to get_calendar :  calendar= 0
--------------------
\ No newline at end of file
+dimanche 1 janvier 2012 ap. J.-C. 03:00:00 UTC+03:00
+int(1)
+string(9) "gregorian"
+string(12) "Europe/Minsk"
+
+dimanche 8 Safar 1433 AH 03:00:00 UTC+03:00
+int(0)
+string(7) "islamic"
+string(12) "Europe/Minsk"
+
+dimanche 1 janvier 2012 ap. J.-C. 00:00:00 UTC
+bool(false)
+string(9) "gregorian"
+string(3) "UTC"
+
+==DONE==
diff --git a/ext/intl/tests/dateformat_get_set_timezone.phpt b/ext/intl/tests/dateformat_get_set_timezone.phpt
new file mode 100644
index 0000000..50b036e
--- /dev/null
+++ b/ext/intl/tests/dateformat_get_set_timezone.phpt
@@ -0,0 +1,58 @@
+--TEST--
+IntlDateFormatter: get/setTimeZone()
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+ini_set("intl.default_locale", "pt_PT");
+ini_set("date.timezone", 'Atlantic/Azores');
+
+$ts = strtotime('2012-01-01 00:00:00 UTC');
+
+function d(IntlDateFormatter $df) {
+global $ts;
+echo $df->format($ts), "\n";
+var_dump(
+$df->getTimeZoneID(),
+$df->getTimeZone()->getID());
+echo "\n";
+}
+
+$df = new IntlDateFormatter('pt_PT', 0, 0, 'Europe/Minsk');
+d($df);
+
+$df->setTimeZone(NULL);
+d($df);
+
+$df->setTimeZone('Europe/Madrid');
+d($df);
+
+$df->setTimeZone(IntlTimeZone::createTimeZone('Europe/Paris'));
+d($df);
+
+$df->setTimeZone(new DateTimeZone('Europe/Amsterdam'));
+d($df);
+
+?>
+==DONE==
+--EXPECT--
+Domingo, 1 de Janeiro de 2012 3:00:00 GMT+03:00
+string(12) "Europe/Minsk"
+string(12) "Europe/Minsk"
+
+Sábado, 31 de Dezembro de 2011 23:00:00 Hora Padrão dos Açores
+string(15) "Atlantic/Azores"
+string(15) "Atlantic/Azores"
+
+Domingo, 1 de Janeiro de 2012 1:00:00 Hora Padrão da Europa Central
+string(13) "Europe/Madrid"
+string(13) "Europe/Madrid"
+
+Domingo, 1 de Janeiro de 2012 1:00:00 Hora Padrão da Europa Central
+string(12) "Europe/Paris"
+string(12) "Europe/Paris"
+
+Domingo, 1 de Janeiro de 2012 1:00:00 Hora Padrão da Europa Central
+string(16) "Europe/Amsterdam"
+string(16) "Europe/Amsterdam"
+
+==DONE==
diff --git a/ext/intl/tests/dateformat_get_timezone_id.phpt b/ext/intl/tests/dateformat_get_timezone_id.phpt
index 80cbdbb..a9701c3 100755
--- a/ext/intl/tests/dateformat_get_timezone_id.phpt
+++ b/ext/intl/tests/dateformat_get_timezone_id.phpt
@@ -1,5 +1,8 @@
 --TEST--
 datefmt_get_timezone_id_code()
+--INI--
+date.timezone=Atlantic/Azores
+intl.error_level=E_WARNING
 --SKIPIF--
 <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
 --FILE--
@@ -14,8 +17,8 @@ function ut_main()
 {
 	$timezone_id_arr = array (
 		'America/New_York',
-		'America/Los_Angeles',
-		'America/Dallas'
+		'US/Pacific',
+		'US/Central'
 	);
 	
 	$res_str = '';
@@ -42,8 +45,8 @@ ut_run();
 Creating IntlDateFormatter with timezone_id = America/New_York
 After call to get_timezone_id :  timezone_id= America/New_York
 
-Creating IntlDateFormatter with timezone_id = America/Los_Angeles
-After call to get_timezone_id :  timezone_id= America/Los_Angeles
+Creating IntlDateFormatter with timezone_id = US/Pacific
+After call to get_timezone_id :  timezone_id= US/Pacific
 
-Creating IntlDateFormatter with timezone_id = America/Dallas
-After call to get_timezone_id :  timezone_id= America/Dallas
+Creating IntlDateFormatter with timezone_id = US/Central
+After call to get_timezone_id :  timezone_id= US/Central
diff --git a/ext/intl/tests/dateformat_setTimeZoneID_deprecation.phpt b/ext/intl/tests/dateformat_setTimeZoneID_deprecation.phpt
new file mode 100644
index 0000000..ccc477d
--- /dev/null
+++ b/ext/intl/tests/dateformat_setTimeZoneID_deprecation.phpt
@@ -0,0 +1,18 @@
+--TEST--
+IntlDateFormatter: setTimeZoneID() deprecation
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+ini_set("intl.default_locale", "pt_PT");
+ini_set("date.timezone", 'Atlantic/Azores');
+
+$df = new IntlDateFormatter('pt_PT', 0, 0, 'Europe/Minsk');
+
+$df->setTimeZoneId('Europe/Madrid');
+
+?>
+==DONE==
+--EXPECTF--
+
+Deprecated: IntlDateFormatter::setTimeZoneId(): Use datefmt_set_timezone() instead, which also accepts a plain time zone identifier and for which this function is now an alias in %s on line %d
+==DONE==
diff --git a/ext/intl/tests/dateformat_setTimeZone_error.phpt b/ext/intl/tests/dateformat_setTimeZone_error.phpt
new file mode 100644
index 0000000..8200197
--- /dev/null
+++ b/ext/intl/tests/dateformat_setTimeZone_error.phpt
@@ -0,0 +1,49 @@
+--TEST--
+IntlDateFormatter::setTimeZone() bad args
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+ini_set("intl.default_locale", "pt_PT");
+ini_set("date.timezone", 'Atlantic/Azores');
+
+$df = new IntlDateFormatter(NULL, 0, 0);
+
+var_dump($df->setTimeZone());
+var_dump(datefmt_set_timezone());
+var_dump($df->setTimeZone(array()));
+var_dump($df->setTimeZone(1, 2));
+var_dump($df->setTimeZone('non existing timezone'));
+var_dump(datefmt_set_timezone(new stdclass, 'UTC'));
+
+?>
+==DONE==
+--EXPECTF--
+
+Warning: IntlDateFormatter::setTimeZone() expects exactly 1 parameter, 0 given in %s on line %d
+
+Warning: IntlDateFormatter::setTimeZone(): datefmt_set_timezone: unable to parse input params in %s on line %d
+bool(false)
+
+Warning: datefmt_set_timezone() expects exactly 2 parameters, 0 given in %s on line %d
+
+Warning: datefmt_set_timezone(): datefmt_set_timezone: unable to parse input params in %s on line %d
+bool(false)
+
+Notice: Array to string conversion in %s on line %d
+
+Warning: IntlDateFormatter::setTimeZone(): datefmt_set_timezone: no such time zone: 'Array' in %s on line %d
+bool(false)
+
+Warning: IntlDateFormatter::setTimeZone() expects exactly 1 parameter, 2 given in %s on line %d
+
+Warning: IntlDateFormatter::setTimeZone(): datefmt_set_timezone: unable to parse input params in %s on line %d
+bool(false)
+
+Warning: IntlDateFormatter::setTimeZone(): datefmt_set_timezone: no such time zone: 'non existing timezone' in %s on line %d
+bool(false)
+
+Warning: datefmt_set_timezone() expects parameter 1 to be IntlDateFormatter, object given in %s on line %d
+
+Warning: datefmt_set_timezone(): datefmt_set_timezone: unable to parse input params in %s on line %d
+bool(false)
+==DONE==
diff --git a/ext/intl/tests/dateformat_set_timezone_id2.phpt b/ext/intl/tests/dateformat_set_timezone_id2.phpt
index 23aacda..ce9b89d 100644
--- a/ext/intl/tests/dateformat_set_timezone_id2.phpt
+++ b/ext/intl/tests/dateformat_set_timezone_id2.phpt
@@ -1,11 +1,16 @@
 --TEST--
 datefmt_set_timezone_id_code() icu >= 4.8
+--INI--
+date.timezone=Atlantic/Azores
 --SKIPIF--
 <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
 <?php if(version_compare(INTL_ICU_VERSION, '4.8') < 0) print 'skip'; ?>
 --FILE--
 <?php
 
+ini_set("intl.error_level", E_WARNING);
+ini_set("error_reporting", ~E_DEPRECATED);
+
 /*
  * Test for the datefmt_set_timezone_id  function
  */
@@ -23,7 +28,7 @@ function ut_main()
 
 	$res_str = '';
 
-	$fmt = ut_datefmt_create( "en_US",  IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'America/San_Francisco' , IntlDateFormatter::GREGORIAN  );
+	$fmt = ut_datefmt_create( "en_US",  IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'US/Pacific' , IntlDateFormatter::GREGORIAN  );
 	$timezone_id = ut_datefmt_get_timezone_id( $fmt );
 	$res_str .= "\nAfter creation of the dateformatter :  timezone_id= $timezone_id\n";
 
@@ -52,8 +57,13 @@ include_once( 'ut_common.inc' );
 // Run the test
 ut_run();
 ?>
---EXPECT--
-After creation of the dateformatter :  timezone_id= America/San_Francisco
+--EXPECTF--
+
+Warning: IntlDateFormatter::setTimeZoneId(): datefmt_set_timezone: no such time zone: 'CN' in %s on line %d
+
+Warning: datefmt_set_timezone_id(): datefmt_set_timezone: no such time zone: 'CN' in %s on line %d
+
+After creation of the dateformatter :  timezone_id= US/Pacific
 -----------
 Trying to set timezone_id= America/New_York
 After call to set_timezone_id :  timezone_id= America/New_York
@@ -71,6 +81,6 @@ Formatting timestamp=0 resulted in  Wednesday, December 31, 1969 6:00:00 PM Cent
 Formatting timestamp=3600 resulted in  Wednesday, December 31, 1969 7:00:00 PM Central Standard Time
 -----------
 Trying to set timezone_id= CN
-After call to set_timezone_id :  timezone_id= CN
-Formatting timestamp=0 resulted in  Thursday, January 1, 1970 12:00:00 AM GMT
-Formatting timestamp=3600 resulted in  Thursday, January 1, 1970 1:00:00 AM GMT
+After call to set_timezone_id :  timezone_id= America/Chicago
+Formatting timestamp=0 resulted in  Wednesday, December 31, 1969 6:00:00 PM Central Standard Time
+Formatting timestamp=3600 resulted in  Wednesday, December 31, 1969 7:00:00 PM Central Standard Time
diff --git a/ext/intl/tests/dateformat_timezone_arg_variations.phpt b/ext/intl/tests/dateformat_timezone_arg_variations.phpt
new file mode 100644
index 0000000..df3ebd8
--- /dev/null
+++ b/ext/intl/tests/dateformat_timezone_arg_variations.phpt
@@ -0,0 +1,41 @@
+--TEST--
+IntlDateFormatter: several forms of the timezone arg
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+ini_set("date.timezone", 'Atlantic/Azores');
+
+$ts = strtotime('2012-01-01 00:00:00 UTC');
+
+//should use Atlantic/Azores
+$df = new IntlDateFormatter('es_ES', 0, 0, NULL);
+echo $df->format($ts), "\n";
+
+$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam');
+echo $df->format($ts), "\n";
+
+$df = new IntlDateFormatter('es_ES', 0, 0, new DateTimeZone('Europe/Lisbon'));
+echo $df->format($ts), "\n";
+
+$df = new IntlDateFormatter('es_ES', 0, 0, IntlTimeZone::createTimeZone('America/New_York'));
+echo $df->format($ts), "\n";
+
+//time zone has priority
+$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam', new IntlGregorianCalendar('Europe/Lisbon'));
+echo $df->format($ts), "\n";
+
+//calendar has priority
+$df = new IntlDateFormatter('es_ES', 0, 0, NULL, new IntlGregorianCalendar('Europe/Lisbon'));
+echo $df->format($ts), "\n";
+
+$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam', 0);
+echo $df->format($ts), "\n";
+
+--EXPECTF--
+sábado%S 31 de diciembre de 2011 23:00:00 Hora%S de las Azores
+domingo%S 1 de enero de 2012 01:00:00 Hora estándar de Europa Central
+domingo%S 1 de enero de 2012 00:00:00 Hora%S de Europa Occidental
+sábado%S 31 de diciembre de 2011 19:00:00 Hora estándar oriental
+domingo%S 1 de enero de 2012 01:00:00 Hora estándar de Europa Central
+domingo%S 1 de enero de 2012 00:00:00 Hora%S de Europa Occidental
+domingo%S 1 de enero de 2012 01:00:00 Hora estándar de Europa Central


commit 9434f5e41fd321e9e8a893451c6fabb3c658fa27
Merge: 913b2c7 e59b6dc
Author: Felipe Pena <felipensp at gmail.com>
Date:   Sun Jun 3 19:02:00 2012 -0300

    Merge commit 'e59b6dc0ae803d49c3f620818285f98dfb61fd57'



commit 8779a9aad572618ce8aa94fc21479b63c471fef1
Merge: 60c5f991 e59b6dc
Author: Felipe Pena <felipensp at gmail.com>
Date:   Sun Jun 3 19:01:50 2012 -0300

    Merge commit 'e59b6dc0ae803d49c3f620818285f98dfb61fd57' into PHP-5.4



commit eb346ef0f419b90739aadfb6cc7b7436c5b521d9
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Mon Jun 4 00:01:48 2012 +0200

    DateFormat plays nice with Calendar, TimeZone
    
    The following changes were made:
    
    * The IntlDateFormatter constructor now accepts the usual values
      for its $timezone argument. This includes timezone identifiers,
      IntlTimeZone objects, DateTimeZone objects and NULL. An empty
      string is not accepted. An invalid time zone is no longer accepted
      (it used to use UTC in this case).
    * When NULL is passed to IntlDateFormatter, the time zone specified in
      date.timezone is used instead of the ICU default.
    * The IntlDateFormatter $calendar argument now accepts also an
      IntlCalendar. In this case, IntlDateFormatter::getCalendar() will
      return false.
    * The time zone passed to the IntlDateFormatter is ignored if it is
      NULL and if the calendar passed is an IntlCalendar object -- in this
      case, the IntlCalendar time zone will be used instead. Otherwise,
      the time zone specified in the $timezone argument is used instead.
    * Added IntlDateFormatter::getCalendarObject(), which always returns
      the IntlCalendar object that backs the DateFormat, even if a
      constant was passed to the constructor, i.e., if an IntlCalendar
      was not passed to the constructor.
    * Added IntlDateFormatter::setTimeZone(). It accepts the usual values
      for time zone arguments. If NULL is passed, the time zone of the
      IntlDateFormatter WILL be overridden with the default time zone,
      even if an IntlCalendar object was passed to the constructor.
    * Added IntlDateFormatter::getTimeZone(), which returns the time zone
      that's associated with the DateFormat.
    * Depreacated IntlDateFormatter::setTimeZoneId() and made it an alias
      for IntlDateFormatter::setTimeZone(), as the new ::setTimeZone()
      also accepts plain identifiers, besides other types.
      IntlDateFormatter::getTimeZoneId() is not deprecated however.
    * IntlDateFormatter::setCalendar() with a constant passed should now
      work correctly. This requires saving the requested locale to the
      constructor.
    * Centralized the hacks required to avoid compilation disasters on
      Windows due to some headers being included inside and outside of
      extern "C" blocks.

diff --git a/ext/intl/calendar/calendar_class.cpp b/ext/intl/calendar/calendar_class.cpp
index 130c6b5..beb65f7 100644
--- a/ext/intl/calendar/calendar_class.cpp
+++ b/ext/intl/calendar/calendar_class.cpp
@@ -18,6 +18,8 @@
 #include "config.h"
 #endif
 
+#include "../intl_cppshims.h"
+
 #include <unicode/calendar.h>
 #include <unicode/gregocal.h>
 
@@ -55,6 +57,14 @@ U_CFUNC	void calendar_object_create(zval *object,
 	calendar_object_construct(object, calendar TSRMLS_CC);
 }
 
+U_CFUNC Calendar *calendar_fetch_native_calendar(zval *object TSRMLS_DC)
+{
+	Calendar_object *co = (Calendar_object*)
+			zend_object_store_get_object(object TSRMLS_CC);
+
+	return co->ucal;
+}
+
 U_CFUNC void calendar_object_construct(zval *object,
 									   Calendar *calendar TSRMLS_DC)
 {
diff --git a/ext/intl/calendar/calendar_class.h b/ext/intl/calendar/calendar_class.h
index abf9555..140389b 100644
--- a/ext/intl/calendar/calendar_class.h
+++ b/ext/intl/calendar/calendar_class.h
@@ -56,6 +56,8 @@ typedef struct {
 
 void calendar_object_create(zval *object, Calendar *calendar TSRMLS_DC);
 
+Calendar *calendar_fetch_native_calendar(zval *object TSRMLS_DC);
+
 void calendar_object_construct(zval *object, Calendar *calendar TSRMLS_DC);
 
 void calendar_register_IntlCalendar_class(TSRMLS_D);
diff --git a/ext/intl/calendar/calendar_methods.cpp b/ext/intl/calendar/calendar_methods.cpp
index 1e8c9e7..8562a2d 100644
--- a/ext/intl/calendar/calendar_methods.cpp
+++ b/ext/intl/calendar/calendar_methods.cpp
@@ -18,6 +18,8 @@
 #include "config.h"
 #endif
 
+#include "../intl_cppshims.h"
+
 #include <unicode/locid.h>
 #include <unicode/calendar.h>
 #include <unicode/ustring.h>
@@ -31,7 +33,6 @@ extern "C" {
 #include "../locale/locale.h"
 #include <zend_exceptions.h>
 #include <zend_interfaces.h>
-#define _MSC_STDINT_H_ /* avoid redefinitions */
 #include <ext/date/php_date.h>
 }
 #include "../common/common_enum.h"
diff --git a/ext/intl/calendar/gregoriancalendar_methods.cpp b/ext/intl/calendar/gregoriancalendar_methods.cpp
index 4f26cc5..47e8463 100644
--- a/ext/intl/calendar/gregoriancalendar_methods.cpp
+++ b/ext/intl/calendar/gregoriancalendar_methods.cpp
@@ -18,6 +18,8 @@
 #include "config.h"
 #endif
 
+#include "../intl_cppshims.h"
+
 #include <unicode/locid.h>
 #include <unicode/calendar.h>
 #include <unicode/gregocal.h>
@@ -27,8 +29,6 @@ extern "C" {
 #define USE_CALENDAR_POINTER 1
 #include "calendar_class.h"
 #include "../locale/locale.h"
-/* avoid redefinition of int8_t, already defined in unicode/pwin32.h */
-#define _MSC_STDINT_H_ 1
 #include <ext/date/php_date.h>
 }
 
diff --git a/ext/intl/common/common_enum.cpp b/ext/intl/common/common_enum.cpp
index 14265d4..a0e3460 100644
--- a/ext/intl/common/common_enum.cpp
+++ b/ext/intl/common/common_enum.cpp
@@ -18,6 +18,8 @@
 #include "config.h"
 #endif
 
+#include "../intl_cppshims.h"
+
 // Fix build on Windows/old versions of ICU
 #include <stdio.h>
 
diff --git a/ext/intl/config.m4 b/ext/intl/config.m4
index b1845d8..431deeb 100755
--- a/ext/intl/config.m4
+++ b/ext/intl/config.m4
@@ -52,6 +52,9 @@ if test "$PHP_INTL" != "no"; then
     dateformat/dateformat_data.c \
     dateformat/dateformat_format.c \
     dateformat/dateformat_parse.c \
+    dateformat/dateformat_create.cpp \
+    dateformat/dateformat_attrcpp.cpp \
+    dateformat/dateformat_helpers.cpp \
     msgformat/msgformat.c \
     msgformat/msgformat_attr.c \
     msgformat/msgformat_class.c \
@@ -67,11 +70,11 @@ if test "$PHP_INTL" != "no"; then
     transliterator/transliterator.c \
     transliterator/transliterator_class.c \
     transliterator/transliterator_methods.c \
-	timezone/timezone_class.cpp \
-	timezone/timezone_methods.cpp \
-	calendar/calendar_class.cpp \
-	calendar/calendar_methods.cpp \
-	calendar/gregoriancalendar_methods.cpp \
+    timezone/timezone_class.cpp \
+    timezone/timezone_methods.cpp \
+    calendar/calendar_class.cpp \
+    calendar/calendar_methods.cpp \
+    calendar/gregoriancalendar_methods.cpp \
     idn/idn.c \
     $icu_spoof_src, $ext_shared,,$ICU_INCS -Wno-write-strings)
   PHP_ADD_BUILD_DIR($ext_builddir/collator)
diff --git a/ext/intl/config.w32 b/ext/intl/config.w32
index ce12d9d..735749a 100755
--- a/ext/intl/config.w32
+++ b/ext/intl/config.w32
@@ -63,6 +63,9 @@ if (PHP_INTL != "no") {
 				dateformat_format.c \
 				dateformat_parse.c \
 				dateformat_data.c \
+				dateformat_attrcpp.cpp \
+				dateformat_helpers.cpp \
+				dateformat_create.cpp \
 				", "intl");
 		ADD_SOURCES(configure_module_dirname + "/idn", "\
 				idn.c",
diff --git a/ext/intl/dateformat/dateformat.c b/ext/intl/dateformat/dateformat.c
index b399a39..fb83eee 100755
--- a/ext/intl/dateformat/dateformat.c
+++ b/ext/intl/dateformat/dateformat.c
@@ -17,12 +17,9 @@
 #include "config.h"
 #endif
 
-#include <unicode/ustring.h>
 #include <unicode/udat.h>
-#include <unicode/ucal.h>
 
 #include "php_intl.h"
-#include "intl_convert.h"
 #include "dateformat_class.h"
 #include "dateformat.h"
 
@@ -67,157 +64,6 @@ void dateformat_register_constants( INIT_FUNC_ARGS )
 }
 /* }}} */
 
-/* {{{ */
-static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
-{
-    char*       locale;
-	int         locale_len = 0;
-	zval*       object;
-    long        date_type = 0;
-    long        time_type = 0;
-    long        calendar = UCAL_GREGORIAN;
-    char*       timezone_str = NULL;
-    int         timezone_str_len = 0;
-    char*       pattern_str = NULL;
-    int         pattern_str_len = 0;
-    UChar*      svalue = NULL;		/* UTF-16 pattern_str */
-    int         slength = 0;
-    UChar*      timezone_utf16 = NULL;		/* UTF-16 timezone_str */
-    int         timezone_utf16_len = 0;
-	UCalendar   ucal_obj = NULL;
-	IntlDateFormatter_object* dfo;
-	
-	intl_error_reset( NULL TSRMLS_CC );
-	object = return_value;
-	/* Parse parameters. */
-    if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "sll|sls",
-		&locale, &locale_len, &date_type, &time_type, &timezone_str, &timezone_str_len, &calendar,&pattern_str, &pattern_str_len ) == FAILURE )
-    {
-		intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,	"datefmt_create: unable to parse input parameters", 0 TSRMLS_CC );
-		zval_dtor(return_value);
-		RETURN_NULL();
-    }
-
-	INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value);
-	
-	if (calendar != UCAL_TRADITIONAL && calendar != UCAL_GREGORIAN) {
-		intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_create: "
-				"invalid value for calendar type; it must be one of "
-				"IntlDateFormatter::TRADITIONAL (locale's default calendar) "
-				"or IntlDateFormatter::GREGORIAN", 0 TSRMLS_CC);
-		goto error;
-	}
-	
-	DATE_FORMAT_METHOD_FETCH_OBJECT;
-	
-	if (DATE_FORMAT_OBJECT(dfo) != NULL) {
-		intl_errors_set(INTL_DATA_ERROR_P(dfo), U_ILLEGAL_ARGUMENT_ERROR,
-				"datefmt_create: cannot call constructor twice", 0 TSRMLS_CC);
-		return;
-	}
-	
-	/* Convert pattern (if specified) to UTF-16. */
-	if( pattern_str && pattern_str_len>0 ){
-		intl_convert_utf8_to_utf16(&svalue, &slength,
-				pattern_str, pattern_str_len, &INTL_DATA_ERROR_CODE(dfo));
-		if (U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
-			/* object construction -> only set global error */
-			intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create: "
-					"error converting pattern to UTF-16", 0 TSRMLS_CC);
-			goto error;
-		}
-	}
-	
-	/* resources allocated from now on */
-
-	/* Convert pattern (if specified) to UTF-16. */
-	if( timezone_str && timezone_str_len >0 ){
-		intl_convert_utf8_to_utf16(&timezone_utf16, &timezone_utf16_len,
-				timezone_str, timezone_str_len, &INTL_DATA_ERROR_CODE(dfo));
-		if (U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
-			intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create: "
-					"error converting timezone_str to UTF-16", 0 TSRMLS_CC);
-			goto error;
-		}
-	}
-
-	if(locale_len == 0) {
-		locale = INTL_G(default_locale);
-	}
-
-	if( pattern_str && pattern_str_len>0 ){
-		DATE_FORMAT_OBJECT(dfo) = udat_open(UDAT_IGNORE, UDAT_IGNORE, locale, timezone_utf16, timezone_utf16_len, svalue, slength, &INTL_DATA_ERROR_CODE(dfo));
-	} else {
-		DATE_FORMAT_OBJECT(dfo) = udat_open(time_type, date_type, locale, timezone_utf16, timezone_utf16_len, svalue, slength, &INTL_DATA_ERROR_CODE(dfo));
-	}
-
-    if (!U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
-		if (calendar != UCAL_TRADITIONAL) {
-			ucal_obj = ucal_open(timezone_utf16, timezone_utf16_len, locale,
-					calendar, &INTL_DATA_ERROR_CODE(dfo));
-			if (!U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
-				udat_setCalendar(DATE_FORMAT_OBJECT(dfo), ucal_obj);
-				ucal_close(ucal_obj);
-			} else {
-				intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create"
-						": error opening calendar", 0 TSRMLS_CC);
-				goto error;
-			}
-		}
-    } else {
-		intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo),	"datefmt_create: date "
-				"formatter creation failed", 0 TSRMLS_CC);
-		goto error;
-	}
-
-	/* Set the class variables */
-	dfo->date_type = date_type;
-	dfo->time_type = time_type;
-	dfo->calendar  = calendar;
-	if( timezone_str && timezone_str_len > 0){
-		dfo->timezone_id = estrndup( timezone_str, timezone_str_len);
-	}
-	
-error:
-	if (svalue) {
-		efree(svalue);
-	}
-	if (timezone_utf16) {
-		efree(timezone_utf16);
-	}
-	if (U_FAILURE(intl_error_get_code(NULL TSRMLS_CC))) {
-		/* free_object handles partially constructed instances fine */
-		zval_dtor(return_value);
-		RETVAL_NULL();
-	}
-}
-/* }}} */
-
-/* {{{ proto IntlDateFormatter IntlDateFormatter::create(string $locale, long date_type, long time_type[, string $timezone_str, long $calendar, string $pattern] )
- * Create formatter. }}} */
-/* {{{ proto IntlDateFormatter datefmt_create(string $locale, long date_type, long time_type[, string $timezone_str, long $calendar, string $pattern] )
- 
- * Create formatter.
- */
-PHP_FUNCTION( datefmt_create )
-{
-    object_init_ex( return_value, IntlDateFormatter_ce_ptr );
-	datefmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU);
-}
-/* }}} */
-
-/* {{{ proto void IntlDateFormatter::__construct(string $locale, long date_type, long time_type[, string $timezone_str, long $calendar, string $pattern])
- * IntlDateFormatter object constructor.
- */
-PHP_METHOD( IntlDateFormatter, __construct )
-{
-	/* return_value param is being changed, therefore we will always return
-	 * NULL here */
-	return_value = getThis();
-	datefmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU);
-}
-/* }}} */
-
 /* {{{ proto int IntlDateFormatter::getErrorCode()
  * Get formatter's last error code. }}} */
 /* {{{ proto int datefmt_get_error_code( IntlDateFormatter $nf )
diff --git a/ext/intl/dateformat/dateformat_attr.c b/ext/intl/dateformat/dateformat_attr.c
index 6131ced..a32a486 100755
--- a/ext/intl/dateformat/dateformat_attr.c
+++ b/ext/intl/dateformat/dateformat_attr.c
@@ -24,39 +24,6 @@
 
 #include <unicode/ustring.h>
 #include <unicode/udat.h>
-#include <unicode/ucal.h>
-
-static void internal_set_calendar(IntlDateFormatter_object *dfo, char* timezone_id, int timezone_id_len, int calendar, zval* return_value TSRMLS_DC){
-	int         timezone_utf16_len = 0;
-	UChar*      timezone_utf16  = NULL; /* timezone_id in UTF-16 */
-	char*       locale = NULL;
-
-	UCalendar*   ucal_obj = NULL;
-
-	/* check for the validity  of value of calendar passed */
-	intl_error_reset( NULL TSRMLS_CC );
-	if( calendar > 1){
-		intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
-			"datefmt_set_calendar: calendar value specified is out of valid range", 0 TSRMLS_CC);
-		RETURN_FALSE;
-	}
-
-	/* Convert timezone to UTF-16. */
-	intl_convert_utf8_to_utf16(&timezone_utf16, &timezone_utf16_len, timezone_id, timezone_id_len, &INTL_DATA_ERROR_CODE(dfo));
-	INTL_METHOD_CHECK_STATUS(dfo, "Error converting timezone to UTF-16" );
-
-	/* Get the locale for the dateformatter */
-	locale = (char *)udat_getLocaleByType(DATE_FORMAT_OBJECT(dfo), ULOC_ACTUAL_LOCALE, &INTL_DATA_ERROR_CODE(dfo));
-
-	/* Set the calendar if passed */
-	ucal_obj = ucal_open(timezone_utf16, timezone_utf16_len, locale, calendar, &INTL_DATA_ERROR_CODE(dfo) );
-	udat_setCalendar( DATE_FORMAT_OBJECT(dfo), ucal_obj );
-	INTL_METHOD_CHECK_STATUS(dfo, "Error setting the calendar.");
-
-	if( timezone_utf16){
-		efree(timezone_utf16);
-	}
-}
 
 /* {{{ proto unicode IntlDateFormatter::getDateType( )
  * Get formatter datetype. }}} */
@@ -110,97 +77,6 @@ PHP_FUNCTION( datefmt_get_timetype )
 }
 /* }}} */
 
-
-/* {{{ proto unicode IntlDateFormatter::getCalendar( )
- * Get formatter calendar. }}} */
-/* {{{ proto string datefmt_get_calendar( IntlDateFormatter $mf )
- * Get formatter calendar.
- */
-PHP_FUNCTION( datefmt_get_calendar )
-{
-	DATE_FORMAT_METHOD_INIT_VARS;
-
-	/* Parse parameters. */
-	if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE )
-	{
-		intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,	
-			"datefmt_get_calendar: unable to parse input params", 0 TSRMLS_CC );
-		RETURN_FALSE;
-	}
-
-	/* Fetch the object. */
-	DATE_FORMAT_METHOD_FETCH_OBJECT;
-
-	INTL_METHOD_CHECK_STATUS(dfo, "Error getting formatter calendar." );
-
-	RETURN_LONG(dfo->calendar);
-}
-/* }}} */
-
-/* {{{ proto unicode IntlDateFormatter::getTimeZoneId( )
- * Get formatter timezone_id. }}} */
-/* {{{ proto string datefmt_get_timezone_id( IntlDateFormatter $mf )
- * Get formatter timezone_id.
- */
-PHP_FUNCTION( datefmt_get_timezone_id )
-{
-	DATE_FORMAT_METHOD_INIT_VARS;
-
-	/* Parse parameters. */
-	if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &object, IntlDateFormatter_ce_ptr ) == FAILURE )
-	{
-		intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,	
-			"datefmt_get_timezone_id: unable to parse input params", 0 TSRMLS_CC );
-		RETURN_FALSE;
-	}
-
-	/* Fetch the object. */
-	DATE_FORMAT_METHOD_FETCH_OBJECT;
-
-	INTL_METHOD_CHECK_STATUS(dfo, "Error getting formatter timezone_id." );
-
-	if( dfo->timezone_id ){
-		RETURN_STRING((char*)dfo->timezone_id, TRUE );
-	}else{
-		RETURN_NULL();
-	}
-}
-
-/* {{{ proto boolean IntlDateFormatter::setTimeZoneId( $timezone_id)
- * Set formatter timezone_id. }}} */
-/* {{{ proto boolean datefmt_set_timezone_id( IntlDateFormatter $mf,$timezone_id)
- * Set formatter timezone_id.
- */
-PHP_FUNCTION( datefmt_set_timezone_id )
-{
-	char* 		timezone_id 		= NULL;
-	int 		timezone_id_len 	= 0;
-
-	DATE_FORMAT_METHOD_INIT_VARS;
-
-	/* Parse parameters. */
-	if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Os", &object, IntlDateFormatter_ce_ptr,&timezone_id, &timezone_id_len) == FAILURE )
-	{
-		intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
-			"datefmt_set_timezone_id: unable to parse input params", 0 TSRMLS_CC );
-		RETURN_FALSE;
-	}
-
-	/* Fetch the object. */
-	DATE_FORMAT_METHOD_FETCH_OBJECT;
-
-	/* set the timezone for the calendar */
-	internal_set_calendar( dfo, timezone_id, timezone_id_len, dfo->calendar, return_value TSRMLS_CC );
-
-	/* Set the IntlDateFormatter variable */
-        if( dfo->timezone_id ){
-		efree(dfo->timezone_id);
-	}
-	dfo->timezone_id = estrndup(timezone_id, timezone_id_len);
-
-	RETURN_TRUE;
-}
-
 /* {{{ proto string IntlDateFormatter::getPattern( )
  * Get formatter pattern. }}} */
 /* {{{ proto string datefmt_get_pattern( IntlDateFormatter $mf )
@@ -369,43 +245,3 @@ PHP_FUNCTION( datefmt_set_lenient )
 	udat_setLenient(DATE_FORMAT_OBJECT(dfo), (UBool)isLenient );
 }
 /* }}} */
-
-/* {{{ proto bool IntlDateFormatter::setPattern( int $calendar )
- * Set formatter calendar. }}} */
-/* {{{ proto bool datefmt_set_calendar( IntlDateFormatter $mf, int $calendar )
- * Set formatter calendar.
- */
-PHP_FUNCTION( datefmt_set_calendar )
-{
-	long	calendar = 0;
-
-	DATE_FORMAT_METHOD_INIT_VARS;
-
-	/* Parse parameters. */
-	if( zend_parse_method_parameters( ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol",
-		&object, IntlDateFormatter_ce_ptr, &calendar ) == FAILURE ) {
-		intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
-			"datefmt_set_calendar: unable to parse input params", 0 TSRMLS_CC);
-		RETURN_FALSE;
-	}
-
-	/* check for the validity  of value of calendar passed */
-	intl_error_reset( NULL TSRMLS_CC );
-	if (calendar > 1) {
-		intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
-			"datefmt_set_calendar: calendar value specified is out of valid range", 0 TSRMLS_CC);
-		RETURN_FALSE;
-	}
-
-	DATE_FORMAT_METHOD_FETCH_OBJECT;
-
-	internal_set_calendar( dfo, dfo->timezone_id, strlen(dfo->timezone_id), calendar, return_value TSRMLS_CC );
-
-	/* Set the calendar  value in the IntlDateFormatter object */
-	dfo->calendar = calendar;
-
-	RETURN_TRUE;
-}
-/* }}} */
-
-
diff --git a/ext/intl/dateformat/dateformat_attr.h b/ext/intl/dateformat/dateformat_attr.h
index bf28824..6fe82a6 100755
--- a/ext/intl/dateformat/dateformat_attr.h
+++ b/ext/intl/dateformat/dateformat_attr.h
@@ -21,11 +21,7 @@
 //PHP_FUNCTION( datefmt_get_timezone );
 PHP_FUNCTION( datefmt_get_datetype );
 PHP_FUNCTION( datefmt_get_timetype );
-PHP_FUNCTION( datefmt_get_calendar );
-PHP_FUNCTION( datefmt_set_calendar );
 PHP_FUNCTION( datefmt_get_locale );
-PHP_FUNCTION( datefmt_get_timezone_id );
-PHP_FUNCTION( datefmt_set_timezone_id );
 PHP_FUNCTION( datefmt_get_pattern );
 PHP_FUNCTION( datefmt_set_pattern );
 PHP_FUNCTION( datefmt_is_lenient );
diff --git a/ext/intl/dateformat/dateformat_attrcpp.cpp b/ext/intl/dateformat/dateformat_attrcpp.cpp
new file mode 100644
index 0000000..b68abec
--- /dev/null
+++ b/ext/intl/dateformat/dateformat_attrcpp.cpp
@@ -0,0 +1,261 @@
+/*
+   +----------------------------------------------------------------------+
+   | PHP Version 5                                                        |
+   +----------------------------------------------------------------------+
+   | This source file is subject to version 3.01 of the PHP license,      |
+   | that is bundled with this package in the file LICENSE, and is        |
+   | available through the world-wide-web at the following url:           |
+   | http://www.php.net/license/3_01.txt                                  |
+   | If you did not receive a copy of the PHP license and are unable to   |
+   | obtain it through the world-wide-web, please send a note to          |
+   | license at php.net so we can mail you a copy immediately.               |
+   +----------------------------------------------------------------------+
+   | Authors: Gustavo Lopes <cataphract at php.net>                          |
+   +----------------------------------------------------------------------+
+*/
+
+#include "../intl_cppshims.h"
+
+#include <unicode/timezone.h>
+#include <unicode/calendar.h>
+#include <unicode/datefmt.h>
+
+extern "C" {
+#include "../php_intl.h"
+#include "dateformat_class.h"
+#include "dateformat_attrcpp.h"
+#define USE_TIMEZONE_POINTER 1
+#include "../timezone/timezone_class.h"
+#define USE_CALENDAR_POINTER 1
+#include "../calendar/calendar_class.h"
+}
+
+#include "../intl_convertcpp.h"
+#include "dateformat_helpers.h"
+
+static inline DateFormat *fetch_datefmt(IntlDateFormatter_object *dfo) {
+	return (DateFormat *)dfo->datef_data.udatf;
+}
+
+/* {{{ proto string IntlDateFormatter::getTimeZoneId()
+ * Get formatter timezone_id. }}} */
+/* {{{ proto string datefmt_get_timezone_id(IntlDateFormatter $mf)
+ * Get formatter timezone_id.
+ */
+U_CFUNC PHP_FUNCTION(datefmt_get_timezone_id)
+{
+	DATE_FORMAT_METHOD_INIT_VARS;
+
+	if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+			&object, IntlDateFormatter_ce_ptr ) == FAILURE) {
+		intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,	"datefmt_get_timezone_"
+				"id: unable to parse input params", 0 TSRMLS_CC);
+		RETURN_FALSE;
+	}
+
+	DATE_FORMAT_METHOD_FETCH_OBJECT;
+
+	UnicodeString res = UnicodeString();
+	fetch_datefmt(dfo)->getTimeZone().getID(res);
+	intl_charFromString(res, &Z_STRVAL_P(return_value),
+			&Z_STRLEN_P(return_value), &INTL_DATA_ERROR_CODE(dfo));
+	INTL_METHOD_CHECK_STATUS(dfo, "Could not convert time zone id to UTF-8");
+
+	Z_TYPE_P(return_value) = IS_STRING;
+}
+
+/* {{{ proto IntlTimeZone IntlDateFormatter::getTimeZone()
+ * Get formatter timezone. }}} */
+/* {{{ proto IntlTimeZone datefmt_get_timezone(IntlDateFormatter $mf)
+ * Get formatter timezone.
+ */
+U_CFUNC PHP_FUNCTION(datefmt_get_timezone)
+{
+	DATE_FORMAT_METHOD_INIT_VARS;
+
+	if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+			&object, IntlDateFormatter_ce_ptr ) == FAILURE) {
+		intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
+			"datefmt_get_timezone: unable to parse input params", 0 TSRMLS_CC );
+		RETURN_FALSE;
+	}
+
+	DATE_FORMAT_METHOD_FETCH_OBJECT;
+
+	const TimeZone& tz = fetch_datefmt(dfo)->getTimeZone();
+	TimeZone *tz_clone = tz.clone();
+	if (tz_clone == NULL) {
+		intl_errors_set(INTL_DATA_ERROR_P(dfo), U_MEMORY_ALLOCATION_ERROR,
+				"datefmt_get_timezone: Out of memory when cloning time zone",
+				0 TSRMLS_CC);
+		RETURN_FALSE;
+	}
+
+	object_init_ex(return_value, TimeZone_ce_ptr);
+	timezone_object_construct(tz_clone, return_value, 1 TSRMLS_CC);
+}
+
+U_CFUNC PHP_FUNCTION(datefmt_set_timezone_id)
+{
+	php_error_docref0(NULL TSRMLS_CC, E_DEPRECATED,
+			"Use datefmt_set_timezone() instead, which also accepts a plain "
+			"time zone identifier and for which this function is now an "
+			"alias");
+	PHP_FN(datefmt_set_timezone)(INTERNAL_FUNCTION_PARAM_PASSTHRU);
+}
+
+/* {{{ proto boolean IntlDateFormatter::setTimeZone(mixed $timezone)
+ * Set formatter's timezone. }}} */
+/* {{{ proto boolean datefmt_set_timezone_id(IntlDateFormatter $mf, $timezone_id)
+ * Set formatter timezone_id.
+ */
+U_CFUNC PHP_FUNCTION(datefmt_set_timezone)
+{
+	zval		**timezone_zv;
+	TimeZone	*timezone;
+
+	DATE_FORMAT_METHOD_INIT_VARS;
+
+	if ( zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+			"OZ", &object, IntlDateFormatter_ce_ptr, &timezone_zv) == FAILURE) {
+		intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_set_timezone: "
+				"unable to parse input params", 0 TSRMLS_CC);
+		RETURN_FALSE;
+	}
+
+	DATE_FORMAT_METHOD_FETCH_OBJECT;
+
+	timezone = timezone_process_timezone_argument(timezone_zv,
+			INTL_DATA_ERROR_P(dfo), "datefmt_set_timezone" TSRMLS_CC);
+	if (timezone == NULL) {
+		RETURN_FALSE;
+	}
+
+	fetch_datefmt(dfo)->adoptTimeZone(timezone);
+}
+
+/* {{{ proto int IntlDateFormatter::getCalendar( )
+ * Get formatter calendar type. }}} */
+/* {{{ proto int datefmt_get_calendar(IntlDateFormatter $mf)
+ * Get formatter calendar type.
+ */
+U_CFUNC PHP_FUNCTION(datefmt_get_calendar)
+{
+	DATE_FORMAT_METHOD_INIT_VARS;
+
+	if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+			&object, IntlDateFormatter_ce_ptr ) == FAILURE) {
+		intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
+			"datefmt_get_calendar: unable to parse input params", 0 TSRMLS_CC);
+		RETURN_FALSE;
+	}
+
+	DATE_FORMAT_METHOD_FETCH_OBJECT;
+
+	if (dfo->calendar == -1) {
+		/* an IntlCalendar was provided to the constructor */
+		RETURN_FALSE;
+	}
+
+	RETURN_LONG(dfo->calendar);
+}
+/* }}} */
+
+/* {{{ proto IntlCalendar IntlDateFormatter::getCalendarObject()
+ * Get formatter calendar. }}} */
+/* {{{ proto IntlCalendar datefmt_get_calendar_object(IntlDateFormatter $mf)
+ * Get formatter calendar.
+ */
+U_CFUNC PHP_FUNCTION(datefmt_get_calendar_object)
+{
+	DATE_FORMAT_METHOD_INIT_VARS;
+
+	if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+			&object, IntlDateFormatter_ce_ptr ) == FAILURE) {
+		intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
+				"datefmt_get_calendar_object: unable to parse input params",
+				0 TSRMLS_CC);
+		RETURN_FALSE;
+	}
+
+	DATE_FORMAT_METHOD_FETCH_OBJECT;
+
+	const Calendar *cal = fetch_datefmt(dfo)->getCalendar();
+	if (cal == NULL) {
+		RETURN_NULL();
+	}
+
+	Calendar *cal_clone = cal->clone();
+	if (cal_clone == NULL) {
+		intl_errors_set(INTL_DATA_ERROR_P(dfo), U_MEMORY_ALLOCATION_ERROR,
+				"datefmt_get_calendar_object: Out of memory when cloning "
+				"calendar", 0 TSRMLS_CC);
+		RETURN_FALSE;
+	}
+
+	calendar_object_create(return_value, cal_clone TSRMLS_CC);
+}
+/* }}} */
+
+/* {{{ proto bool IntlDateFormatter::setCalendar(mixed $calendar)
+ * Set formatter's calendar. }}} */
+/* {{{ proto bool datefmt_set_calendar(IntlDateFormatter $mf, mixed $calendar)
+ * Set formatter's calendar.
+ */
+U_CFUNC PHP_FUNCTION(datefmt_set_calendar)
+{
+	zval	*calendar_zv;
+	DATE_FORMAT_METHOD_INIT_VARS;
+
+	if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oz",
+			&object, IntlDateFormatter_ce_ptr, &calendar_zv) == FAILURE) {
+		intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
+			"datefmt_set_calendar: unable to parse input params", 0 TSRMLS_CC);
+		RETURN_FALSE;
+	}
+
+	DATE_FORMAT_METHOD_FETCH_OBJECT;
+
+	Calendar	*cal;
+	long		cal_type;
+	bool		cal_owned;
+	Locale		locale = Locale::createFromName(dfo->requested_locale);
+	// getting the actual locale from the DateFormat is not enough
+	// because we would have lost modifiers such as @calendar. We
+	// must store the requested locale on object creation
+
+	if (datefmt_process_calendar_arg(calendar_zv, locale,
+			"datefmt_set_calendar",	INTL_DATA_ERROR_P(dfo), cal, cal_type,
+			cal_owned TSRMLS_CC) == FAILURE) {
+		RETURN_FALSE;
+	}
+
+	if (cal_owned) {
+		/* a non IntlCalendar was specified, we want to keep the timezone */
+		TimeZone *old_timezone = fetch_datefmt(dfo)->getTimeZone().clone();
+		if (old_timezone == NULL) {
+			intl_errors_set(INTL_DATA_ERROR_P(dfo), U_MEMORY_ALLOCATION_ERROR,
+					"datefmt_set_calendar: Out of memory when cloning calendar",
+					0 TSRMLS_CC);
+			delete cal;
+			RETURN_FALSE;
+		}
+		cal->adoptTimeZone(old_timezone);
+	} else {
+		cal = cal->clone();
+		if (cal == NULL) {
+			intl_errors_set(INTL_DATA_ERROR_P(dfo), U_MEMORY_ALLOCATION_ERROR,
+					"datefmt_set_calendar: Out of memory when cloning calendar",
+					0 TSRMLS_CC);
+			RETURN_FALSE;
+		}
+	}
+
+	fetch_datefmt(dfo)->adoptCalendar(cal);
+
+	dfo->calendar = cal_type;
+
+	RETURN_TRUE;
+}
+/* }}} */
+
diff --git a/ext/intl/dateformat/dateformat_attrcpp.h b/ext/intl/dateformat/dateformat_attrcpp.h
new file mode 100644
index 0000000..408232f
--- /dev/null
+++ b/ext/intl/dateformat/dateformat_attrcpp.h
@@ -0,0 +1,35 @@
+/*
+   +----------------------------------------------------------------------+
+   | PHP Version 5                                                        |
+   +----------------------------------------------------------------------+
+   | This source file is subject to version 3.01 of the PHP license,      |
+   | that is bundled with this package in the file LICENSE, and is        |
+   | available through the world-wide-web at the following url:           |
+   | http://www.php.net/license/3_01.txt                                  |
+   | If you did not receive a copy of the PHP license and are unable to   |
+   | obtain it through the world-wide-web, please send a note to          |
+   | license at php.net so we can mail you a copy immediately.               |
+   +----------------------------------------------------------------------+
+   | Authors: Gustavo Lopes <cataphract at php.net>                          |
+   +----------------------------------------------------------------------+
+*/
+
+#ifndef DATEFORMAT_ATTRCPP_H
+#define	DATEFORMAT_ATTRCPP_H
+
+PHP_FUNCTION(datefmt_get_timezone_id);
+
+PHP_FUNCTION(datefmt_set_timezone_id);
+
+PHP_FUNCTION(datefmt_get_timezone);
+
+PHP_FUNCTION(datefmt_set_timezone);
+
+PHP_FUNCTION(datefmt_get_calendar);
+
+PHP_FUNCTION(datefmt_set_calendar);
+
+PHP_FUNCTION(datefmt_get_calendar_object);
+
+#endif	/* DATEFORMAT_ATTRCPP_H */
+
diff --git a/ext/intl/dateformat/dateformat_class.c b/ext/intl/dateformat/dateformat_class.c
index c66610f..fda67f1 100755
--- a/ext/intl/dateformat/dateformat_class.c
+++ b/ext/intl/dateformat/dateformat_class.c
@@ -22,6 +22,7 @@
 #include "dateformat_parse.h"
 #include "dateformat.h"
 #include "dateformat_attr.h"
+#include "dateformat_attrcpp.h"
 
 zend_class_entry *IntlDateFormatter_ce_ptr = NULL;
 static zend_object_handlers IntlDateFormatter_handlers;
@@ -44,12 +45,12 @@ void IntlDateFormatter_object_free( zend_object *object TSRMLS_DC )
 
 	zend_object_std_dtor( &dfo->zo TSRMLS_CC );
 
-	dateformat_data_free( &dfo->datef_data TSRMLS_CC );
-	
-	if( dfo->timezone_id ){
-		efree(dfo->timezone_id);
+	if (dfo->requested_locale) {
+		efree( dfo->requested_locale );
 	}
 
+	dateformat_data_free( &dfo->datef_data TSRMLS_CC );
+
 	efree( dfo );
 }
 /* }}} */
@@ -63,10 +64,10 @@ zend_object_value IntlDateFormatter_object_create(zend_class_entry *ce TSRMLS_DC
 	intern = ecalloc( 1, sizeof(IntlDateFormatter_object) );
 	dateformat_data_init( &intern->datef_data TSRMLS_CC );
 	zend_object_std_init( &intern->zo, ce TSRMLS_CC );
-	intern->date_type = 0;
-	intern->time_type = 0;
-	intern->calendar  = 1;		/* Gregorian calendar */
-	intern->timezone_id =  NULL;
+	intern->date_type			= 0;
+	intern->time_type			= 0;
+	intern->calendar			= -1;
+	intern->requested_locale	= NULL;
 
 	retval.handle = zend_objects_store_put(
 		intern,
@@ -157,9 +158,12 @@ static zend_function_entry IntlDateFormatter_class_functions[] = {
 	PHP_NAMED_FE( getDateType, ZEND_FN( datefmt_get_datetype ), arginfo_intldateformatter_getdatetype )
 	PHP_NAMED_FE( getTimeType, ZEND_FN( datefmt_get_timetype ), arginfo_intldateformatter_getdatetype )
 	PHP_NAMED_FE( getCalendar, ZEND_FN( datefmt_get_calendar ), arginfo_intldateformatter_getdatetype )
+	PHP_NAMED_FE( getCalendarObject, ZEND_FN( datefmt_get_calendar_object ), arginfo_intldateformatter_getdatetype )
 	PHP_NAMED_FE( setCalendar, ZEND_FN( datefmt_set_calendar ), arginfo_intldateformatter_setcalendar )
 	PHP_NAMED_FE( getTimeZoneId, ZEND_FN( datefmt_get_timezone_id ), arginfo_intldateformatter_getdatetype )
 	PHP_NAMED_FE( setTimeZoneId, ZEND_FN( datefmt_set_timezone_id ), arginfo_intldateformatter_settimezoneid )
+	PHP_NAMED_FE( getTimeZone, ZEND_FN( datefmt_get_timezone ), arginfo_intldateformatter_getdatetype )
+	PHP_NAMED_FE( setTimeZone, ZEND_FN( datefmt_set_timezone ), arginfo_intldateformatter_settimezoneid )
 	PHP_NAMED_FE( setPattern, ZEND_FN( datefmt_set_pattern ), arginfo_intldateformatter_setpattern )
 	PHP_NAMED_FE( getPattern, ZEND_FN( datefmt_get_pattern ), arginfo_intldateformatter_getdatetype )
 	PHP_NAMED_FE( getLocale, ZEND_FN( datefmt_get_locale ), arginfo_intldateformatter_getdatetype )
diff --git a/ext/intl/dateformat/dateformat_class.h b/ext/intl/dateformat/dateformat_class.h
index 9ad83ee..de5cf4a 100755
--- a/ext/intl/dateformat/dateformat_class.h
+++ b/ext/intl/dateformat/dateformat_class.h
@@ -24,12 +24,12 @@
 #include "dateformat_data.h"
 
 typedef struct {
-	zend_object     	zo;
-	dateformat_data  	datef_data;
-	int			date_type ;
-	int			time_type ;
-	int			calendar ;
-	char*			timezone_id;
+	zend_object		zo;
+	dateformat_data	datef_data;
+	int				date_type;
+	int				time_type;
+	int				calendar;
+	char			*requested_locale;
 } IntlDateFormatter_object;
 
 void dateformat_register_IntlDateFormatter_class( TSRMLS_D );
diff --git a/ext/intl/dateformat/dateformat_create.cpp b/ext/intl/dateformat/dateformat_create.cpp
new file mode 100644
index 0000000..fef93e9
--- /dev/null
+++ b/ext/intl/dateformat/dateformat_create.cpp
@@ -0,0 +1,193 @@
+/*
+   +----------------------------------------------------------------------+
+   | PHP Version 5                                                        |
+   +----------------------------------------------------------------------+
+   | This source file is subject to version 3.01 of the PHP license,      |
+   | that is bundled with this package in the file LICENSE, and is        |
+   | available through the world-wide-web at the following url:           |
+   | http://www.php.net/license/3_01.txt                                  |
+   | If you did not receive a copy of the PHP license and are unable to   |
+   | obtain it through the world-wide-web, please send a note to          |
+   | license at php.net so we can mail you a copy immediately.               |
+   +----------------------------------------------------------------------+
+   | Authors: Kirti Velankar <kirtig at yahoo-inc.com>                       |
+   |          Gustavo Lopes <cataphract at php.net>                          |
+   +----------------------------------------------------------------------+
+*/
+
+#include "../intl_cppshims.h"
+
+#include <unicode/timezone.h>
+#include <unicode/calendar.h>
+#include <unicode/datefmt.h>
+
+extern "C" {
+#include <unicode/ustring.h>
+#include <unicode/udat.h>
+
+#include "php_intl.h"
+#include "dateformat_create.h"
+#include "dateformat_class.h"
+#define USE_TIMEZONE_POINTER 1
+#include "../timezone/timezone_class.h"
+#include "../intl_convert.h"
+}
+
+#include "dateformat_helpers.h"
+
+/* {{{ */
+static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
+{
+	zval		*object;
+
+    char		*locale_str;
+	int			locale_len		= 0;
+	Locale		locale;
+    long		date_type		= 0;
+    long		time_type		= 0;
+	zval		*calendar_zv	= NULL;
+	Calendar	*calendar		= NULL;
+	long		calendar_type;
+	bool		calendar_owned;
+	zval		**timezone_zv	= NULL;
+	TimeZone	*timezone		= NULL;
+	bool		explicit_tz;
+    char*       pattern_str		= NULL;
+    int         pattern_str_len	= 0;
+    UChar*      svalue			= NULL;		/* UTF-16 pattern_str */
+    int         slength			= 0;
+	IntlDateFormatter_object* dfo;
+
+	intl_error_reset(NULL TSRMLS_CC);
+	object = return_value;
+	/* Parse parameters. */
+    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sll|Zzs",
+			&locale_str, &locale_len, &date_type, &time_type, &timezone_zv,
+			&calendar_zv, &pattern_str, &pattern_str_len) == FAILURE) {
+		intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,	"datefmt_create: "
+				"unable to parse input parameters", 0 TSRMLS_CC);
+		zval_dtor(return_value);
+		RETURN_NULL();
+    }
+
+	INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value);
+	if (locale_len == 0) {
+		locale_str = INTL_G(default_locale);
+	}
+	locale = Locale::createFromName(locale_str);
+
+	DATE_FORMAT_METHOD_FETCH_OBJECT;
+
+	if (DATE_FORMAT_OBJECT(dfo) != NULL) {
+		intl_errors_set(INTL_DATA_ERROR_P(dfo), U_ILLEGAL_ARGUMENT_ERROR,
+				"datefmt_create: cannot call constructor twice", 0 TSRMLS_CC);
+		return;
+	}
+
+	/* process calendar */
+	if (datefmt_process_calendar_arg(calendar_zv, locale, "datefmt_create",
+			INTL_DATA_ERROR_P(dfo), calendar, calendar_type,
+			calendar_owned TSRMLS_CC)
+			== FAILURE) {
+		goto error;
+	}
+
+	/* process timezone */
+	explicit_tz = timezone_zv != NULL && Z_TYPE_PP(timezone_zv) != IS_NULL;
+
+	if (explicit_tz || calendar_owned ) {
+		//we have an explicit time zone or a non-object calendar
+		timezone = timezone_process_timezone_argument(timezone_zv,
+				INTL_DATA_ERROR_P(dfo), "datefmt_create" TSRMLS_CC);
+		if (timezone == NULL) {
+			goto error;
+		}
+	}
+
+	/* Convert pattern (if specified) to UTF-16. */
+	if (pattern_str && pattern_str_len > 0) {
+		intl_convert_utf8_to_utf16(&svalue, &slength,
+				pattern_str, pattern_str_len, &INTL_DATA_ERROR_CODE(dfo));
+		if (U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
+			/* object construction -> only set global error */
+			intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create: "
+					"error converting pattern to UTF-16", 0 TSRMLS_CC);
+			goto error;
+		}
+	}
+
+	if (pattern_str && pattern_str_len > 0) {
+		DATE_FORMAT_OBJECT(dfo) = udat_open(UDAT_IGNORE, UDAT_IGNORE,
+				locale_str, NULL, 0, svalue, slength,
+				&INTL_DATA_ERROR_CODE(dfo));
+	} else {
+		DATE_FORMAT_OBJECT(dfo) = udat_open((UDateFormatStyle)time_type,
+				(UDateFormatStyle)date_type, locale_str, NULL, 0, svalue,
+				slength, &INTL_DATA_ERROR_CODE(dfo));
+	}
+
+    if (!U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
+		DateFormat *df = (DateFormat*)DATE_FORMAT_OBJECT(dfo);
+		if (calendar_owned) {
+			df->adoptCalendar(calendar);
+			calendar_owned = false;
+		} else {
+			df->setCalendar(*calendar);
+		}
+
+		if (timezone != NULL) {
+			df->adoptTimeZone(timezone);
+		}
+    } else {
+		intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo),	"datefmt_create: date "
+				"formatter creation failed", 0 TSRMLS_CC);
+		goto error;
+	}
+
+	/* Set the class variables */
+	dfo->date_type			= date_type;
+	dfo->time_type			= time_type;
+	dfo->calendar			= calendar_type;
+	dfo->requested_locale	= estrdup(locale_str);
+
+error:
+	if (svalue) {
+		efree(svalue);
+	}
+	if (timezone != NULL && DATE_FORMAT_OBJECT(dfo) == NULL) {
+		delete timezone;
+	}
+	if (calendar != NULL && calendar_owned) {
+		delete calendar;
+	}
+	if (U_FAILURE(intl_error_get_code(NULL TSRMLS_CC))) {
+		/* free_object handles partially constructed instances fine */
+		zval_dtor(return_value);
+		RETVAL_NULL();
+	}
+}
+/* }}} */
+
+/* {{{ proto IntlDateFormatter IntlDateFormatter::create(string $locale, long date_type, long time_type[, string $timezone_str, long $calendar, string $pattern] )
+ * Create formatter. }}} */
+/* {{{ proto IntlDateFormatter datefmt_create(string $locale, long date_type, long time_type[, string $timezone_str, long $calendar, string $pattern)
+ * Create formatter.
+ */
+U_CFUNC PHP_FUNCTION( datefmt_create )
+{
+    object_init_ex( return_value, IntlDateFormatter_ce_ptr );
+	datefmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU);
+}
+/* }}} */
+
+/* {{{ proto void IntlDateFormatter::__construct(string $locale, long date_type, long time_type[, string $timezone_str, long $calendar, string $pattern])
+ * IntlDateFormatter object constructor.
+ */
+U_CFUNC PHP_METHOD( IntlDateFormatter, __construct )
+{
+	/* return_value param is being changed, therefore we will always return
+	 * NULL here */
+	return_value = getThis();
+	datefmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU);
+}
+/* }}} */
diff --git a/ext/intl/dateformat/dateformat_create.h b/ext/intl/dateformat/dateformat_create.h
new file mode 100644
index 0000000..47e67c2
--- /dev/null
+++ b/ext/intl/dateformat/dateformat_create.h
@@ -0,0 +1,25 @@
+/*
+   +----------------------------------------------------------------------+
+   | PHP Version 5                                                        |
+   +----------------------------------------------------------------------+
+   | This source file is subject to version 3.01 of the PHP license,      |
+   | that is bundled with this package in the file LICENSE, and is        |
+   | available through the world-wide-web at the following url:           |
+   | http://www.php.net/license/3_01.txt                                  |
+   | If you did not receive a copy of the PHP license and are unable to   |
+   | obtain it through the world-wide-web, please send a note to          |
+   | license at php.net so we can mail you a copy immediately.               |
+   +----------------------------------------------------------------------+
+   | Authors: Gustavo Lopes <cataphract at php.net>                          |
+   +----------------------------------------------------------------------+
+*/
+#ifndef DATE_FORMATTER_H
+#define DATE_FORMATTER_H
+
+#include <php.h>
+
+PHP_FUNCTION( datefmt_create );
+PHP_METHOD( IntlDateFormatter, __construct );
+void dateformat_register_constants( INIT_FUNC_ARGS );
+
+#endif // DATE_FORMATTER_H
diff --git a/ext/intl/dateformat/dateformat_format.c b/ext/intl/dateformat/dateformat_format.c
index 4d03d92..82f825f 100755
--- a/ext/intl/dateformat/dateformat_format.c
+++ b/ext/intl/dateformat/dateformat_format.c
@@ -27,6 +27,8 @@
 #include "dateformat_class.h"
 #include "dateformat_format.h"
 #include "dateformat_data.h"
+/* avoid redefinition of int8_t, already defined in unicode/pwin32.h */
+#define _MSC_STDINT_H_ 1
 #include "ext/date/php_date.h"
 
 /* {{{ 
@@ -91,7 +93,7 @@ static UDate internal_get_timestamp(IntlDateFormatter_object *dfo, HashTable* ha
 	long yday =0;
 	long mday =0;
 	UBool isInDST = FALSE;
-	UCalendar *pcal;
+	const UCalendar *pcal;
 
 	/* Fetch  values from the incoming array */
 	year = internal_get_arr_ele( dfo, hash_arr, CALENDAR_YEAR TSRMLS_CC) + 1900; /* tm_year is years since 1900 */
diff --git a/ext/intl/dateformat/dateformat_helpers.cpp b/ext/intl/dateformat/dateformat_helpers.cpp
new file mode 100644
index 0000000..74758bb
--- /dev/null
+++ b/ext/intl/dateformat/dateformat_helpers.cpp
@@ -0,0 +1,106 @@
+/*
+   +----------------------------------------------------------------------+
+   | PHP Version 5                                                        |
+   +----------------------------------------------------------------------+
+   | This source file is subject to version 3.01 of the PHP license,      |
+   | that is bundled with this package in the file LICENSE, and is        |
+   | available through the world-wide-web at the following url:           |
+   | http://www.php.net/license/3_01.txt                                  |
+   | If you did not receive a copy of the PHP license and are unable to   |
+   | obtain it through the world-wide-web, please send a note to          |
+   | license at php.net so we can mail you a copy immediately.               |
+   +----------------------------------------------------------------------+
+   | Authors: Gustavo Lopes <cataphract at php.net>                          |
+   +----------------------------------------------------------------------+
+*/
+
+#include "../intl_cppshims.h"
+
+#include <unicode/calendar.h>
+#include <unicode/gregocal.h>
+
+#include "dateformat_helpers.h"
+
+extern "C" {
+#include "../php_intl.h"
+#include <Zend/zend_operators.h>
+#define USE_CALENDAR_POINTER 1
+#include "../calendar/calendar_class.h"
+}
+
+int datefmt_process_calendar_arg(zval* calendar_zv,
+								 Locale const& locale,
+								 const char *func_name,
+								 intl_error *err,
+								 Calendar*& cal,
+								 long& cal_int_type,
+								 bool& calendar_owned TSRMLS_DC)
+{
+	char *msg;
+	UErrorCode status = UErrorCode();
+
+	if (calendar_zv == NULL || Z_TYPE_P(calendar_zv) == IS_NULL) {
+
+		// default requested
+		cal = new GregorianCalendar(locale, status);
+		calendar_owned = true;
+
+		cal_int_type = UCAL_GREGORIAN;
+
+	} else if (Z_TYPE_P(calendar_zv) == IS_LONG) {
+
+		long v = Z_LVAL_P(calendar_zv);
+		if (v != (long)UCAL_TRADITIONAL && v != (long)UCAL_GREGORIAN) {
+			spprintf(&msg, 0, "%s: invalid value for calendar type; it must be "
+					"one of IntlDateFormatter::TRADITIONAL (locale's default "
+					"calendar) or IntlDateFormatter::GREGORIAN. "
+					"Alternatively, it can be an IntlCalendar object",
+					func_name);
+			intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, msg, 1 TSRMLS_CC);
+			efree(msg);
+			return FAILURE;
+		} else if (v == (long)UCAL_TRADITIONAL) {
+			cal = Calendar::createInstance(locale, status);
+		} else { //UCAL_GREGORIAN
+			cal = new GregorianCalendar(locale, status);
+		}
+		calendar_owned = true;
+
+		cal_int_type = Z_LVAL_P(calendar_zv);
+
+	} else if (Z_TYPE_P(calendar_zv) == IS_OBJECT &&
+			instanceof_function_ex(Z_OBJCE_P(calendar_zv),
+			Calendar_ce_ptr, 0 TSRMLS_CC)) {
+
+		cal = calendar_fetch_native_calendar(calendar_zv TSRMLS_CC);
+		if (cal == NULL) {
+			spprintf(&msg, 0, "%s: Found unconstructed IntlCalendar object",
+					func_name);
+			intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, msg, 1 TSRMLS_CC);
+			efree(msg);
+			return FAILURE;
+		}
+		calendar_owned = false;
+
+		cal_int_type = -1;
+
+	} else {
+		spprintf(&msg, 0, "%s: Invalid calendar argument; should be an integer "
+				"or an IntlCalendar instance", func_name);
+		intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, msg, 1 TSRMLS_CC);
+		efree(msg);
+		return FAILURE;
+	}
+
+	if (cal == NULL && !U_FAILURE(status)) {
+		status = U_MEMORY_ALLOCATION_ERROR;
+	}
+	if (U_FAILURE(status)) {
+		spprintf(&msg, 0, "%s: Failure instantiating calendar", func_name);
+		intl_errors_set(err, U_ILLEGAL_ARGUMENT_ERROR, msg, 1 TSRMLS_CC);
+		efree(msg);
+		return FAILURE;
+	}
+
+	return SUCCESS;
+}
diff --git a/ext/intl/dateformat/dateformat_helpers.h b/ext/intl/dateformat/dateformat_helpers.h
new file mode 100644
index 0000000..bded0b7
--- /dev/null
+++ b/ext/intl/dateformat/dateformat_helpers.h
@@ -0,0 +1,39 @@
+/*
+   +----------------------------------------------------------------------+
+   | PHP Version 5                                                        |
+   +----------------------------------------------------------------------+
+   | This source file is subject to version 3.01 of the PHP license,      |
+   | that is bundled with this package in the file LICENSE, and is        |
+   | available through the world-wide-web at the following url:           |
+   | http://www.php.net/license/3_01.txt                                  |
+   | If you did not receive a copy of the PHP license and are unable to   |
+   | obtain it through the world-wide-web, please send a note to          |
+   | license at php.net so we can mail you a copy immediately.               |
+   +----------------------------------------------------------------------+
+   | Authors: Gustavo Lopes <cataphract at php.net>                          |
+   +----------------------------------------------------------------------+
+*/
+
+#ifndef DATEFORMAT_HELPERS_H
+#define	DATEFORMAT_HELPERS_H
+
+#ifndef __cplusplus
+#error For C++ only
+#endif
+
+#include <unicode/calendar.h>
+
+extern "C" {
+#include "../php_intl.h"
+}
+
+int datefmt_process_calendar_arg(zval* calendar_zv,
+								 Locale const& locale,
+								 const char *func_name,
+								 intl_error *err,
+								 Calendar*& cal,
+								 long& cal_int_type,
+								 bool& calendar_owned TSRMLS_DC);
+
+#endif	/* DATEFORMAT_HELPERS_H */
+
diff --git a/ext/intl/grapheme/grapheme.h b/ext/intl/grapheme/grapheme.h
index c0e697a..756ce91 100755
--- a/ext/intl/grapheme/grapheme.h
+++ b/ext/intl/grapheme/grapheme.h
@@ -19,7 +19,6 @@
 
 #include <php.h>
 #include <unicode/utypes.h>
-#include <unicode/ubrk.h>
 
 PHP_FUNCTION(grapheme_strlen);
 PHP_FUNCTION(grapheme_strpos);
diff --git a/ext/intl/intl_convertcpp.cpp b/ext/intl/intl_convertcpp.cpp
index 5034028..f699a3c 100644
--- a/ext/intl/intl_convertcpp.cpp
+++ b/ext/intl/intl_convertcpp.cpp
@@ -16,8 +16,7 @@
 
 /* $Id$ */
 
-//Fixes the build on old versions of ICU with Windows
-#include <stdio.h>
+#include "intl_cppshims.h"
 
 #include "intl_convertcpp.h"
 #include <unicode/ustring.h>
diff --git a/ext/intl/intl_cppshims.h b/ext/intl/intl_cppshims.h
new file mode 100644
index 0000000..2fb70ed
--- /dev/null
+++ b/ext/intl/intl_cppshims.h
@@ -0,0 +1,34 @@
+/*
+   +----------------------------------------------------------------------+
+   | PHP Version 5                                                        |
+   +----------------------------------------------------------------------+
+   | This source file is subject to version 3.01 of the PHP license,      |
+   | that is bundled with this package in the file LICENSE, and is        |
+   | available through the world-wide-web at the following url:           |
+   | http://www.php.net/license/3_01.txt                                  |
+   | If you did not receive a copy of the PHP license and are unable to   |
+   | obtain it through the world-wide-web, please send a note to          |
+   | license at php.net so we can mail you a copy immediately.               |
+   +----------------------------------------------------------------------+
+   | Authors: Gustavo Lopes <cataphract at php.net>                          |
+   +----------------------------------------------------------------------+
+*/
+
+#ifndef INTL_CPPSHIMS_H
+#define INTL_CPPSHIMS_H
+
+#ifndef __cplusplus
+#error For inclusion form C++ files only
+#endif
+
+#ifdef _MSC_VER
+//This is only required for old versions of ICU only
+#include <stdio.h>
+
+#include <math.h>
+
+/* avoid redefinition of int8_t, also defined in unicode/pwin32.h */
+#define _MSC_STDINT_H_ 1
+#endif
+
+#endif
\ No newline at end of file
diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp
index 6f4615e..fd8df1a 100755
--- a/ext/intl/msgformat/msgformat_helpers.cpp
+++ b/ext/intl/msgformat/msgformat_helpers.cpp
@@ -18,10 +18,8 @@
 #include "config.h"
 #endif
 
-// Fix build on Windows / old versions of ICU
-#include <stdio.h>
+#include "../intl_cppshims.h"
 
-#include <math.h>
 #include <limits.h>
 #include <unicode/msgfmt.h>
 #include <unicode/chariter.h>
diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c
index db8e003..59272db 100755
--- a/ext/intl/php_intl.c
+++ b/ext/intl/php_intl.c
@@ -41,6 +41,8 @@
 #include "formatter/formatter_main.h"
 #include "formatter/formatter_parse.h"
 
+#include "grapheme/grapheme.h"
+
 #include "msgformat/msgformat.h"
 #include "msgformat/msgformat_class.h"
 #include "msgformat/msgformat_attr.h"
@@ -58,6 +60,7 @@
 #include "dateformat/dateformat.h"
 #include "dateformat/dateformat_class.h"
 #include "dateformat/dateformat_attr.h"
+#include "dateformat/dateformat_attrcpp.h"
 #include "dateformat/dateformat_format.h"
 #include "dateformat/dateformat_parse.h"
 #include "dateformat/dateformat_data.h"
@@ -321,6 +324,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_datefmt_set_pattern, 0, 0, 2)
 	ZEND_ARG_INFO(0, pattern)
 ZEND_END_ARG_INFO()
 
+ZEND_BEGIN_ARG_INFO_EX(arginfo_datefmt_set_timezone, 0, 0, 2)
+	ZEND_ARG_INFO(0, mf)
+	ZEND_ARG_INFO(0, timezone)
+ZEND_END_ARG_INFO()
+
 ZEND_BEGIN_ARG_INFO_EX(arginfo_datefmt_set_calendar, 0, 0, 2)
 	ZEND_ARG_INFO(0, mf)
 	ZEND_ARG_INFO(0, calendar)
@@ -675,10 +683,13 @@ zend_function_entry intl_functions[] = {
 	PHP_FE( datefmt_get_datetype, arginfo_msgfmt_get_locale )
 	PHP_FE( datefmt_get_timetype, arginfo_msgfmt_get_locale )
 	PHP_FE( datefmt_get_calendar, arginfo_msgfmt_get_locale )
+	PHP_FE( datefmt_get_calendar_object, arginfo_msgfmt_get_locale )
 	PHP_FE( datefmt_set_calendar, arginfo_datefmt_set_calendar )
 	PHP_FE( datefmt_get_locale, arginfo_msgfmt_get_locale )
 	PHP_FE( datefmt_get_timezone_id, arginfo_msgfmt_get_locale )
-	PHP_FE( datefmt_set_timezone_id, arginfo_msgfmt_get_locale )
+	PHP_FE( datefmt_set_timezone_id, arginfo_datefmt_set_timezone )
+	PHP_FE( datefmt_get_timezone, arginfo_msgfmt_get_locale )
+	PHP_FE( datefmt_set_timezone, arginfo_datefmt_set_timezone )
 	PHP_FE( datefmt_get_pattern, arginfo_msgfmt_get_locale )
 	PHP_FE( datefmt_set_pattern, arginfo_datefmt_set_pattern )
 	PHP_FE( datefmt_is_lenient, arginfo_msgfmt_get_locale )
diff --git a/ext/intl/php_intl.h b/ext/intl/php_intl.h
index 38f61ad..c3d5c60 100755
--- a/ext/intl/php_intl.h
+++ b/ext/intl/php_intl.h
@@ -22,8 +22,13 @@
 
 #include <php.h>
 
+/* Even if we're included from C++, don't introduce C++ definitions
+ * because we were included with extern "C". The effect would be that
+ * when the headers defined any method, they would do so with C linkage */
+#undef U_SHOW_CPLUSPLUS_API
+#define U_SHOW_CPLUSPLUS_API 0
 #include "collator/collator_sort.h"
-#include "grapheme/grapheme.h"
+#include <unicode/ubrk.h>
 #include "intl_error.h"
 
 extern zend_module_entry intl_module_entry;
diff --git a/ext/intl/timezone/timezone_class.cpp b/ext/intl/timezone/timezone_class.cpp
index c976eb1..6e62c34 100644
--- a/ext/intl/timezone/timezone_class.cpp
+++ b/ext/intl/timezone/timezone_class.cpp
@@ -19,6 +19,8 @@
 #include "config.h"
 #endif
 
+#include "../intl_cppshims.h"
+
 #include <unicode/timezone.h>
 #include <unicode/calendar.h>
 #include "../intl_convertcpp.h"
@@ -30,8 +32,6 @@ extern "C" {
 #include "timezone_methods.h"
 #include <zend_exceptions.h>
 #include <zend_interfaces.h>
-/* avoid redefinition of int8_t, already defined in unicode/pwin32.h */
-#define _MSC_STDINT_H_ 1
 #include <ext/date/php_date.h>
 }
 
diff --git a/ext/intl/timezone/timezone_methods.cpp b/ext/intl/timezone/timezone_methods.cpp
index b7f31c3..1435679 100644
--- a/ext/intl/timezone/timezone_methods.cpp
+++ b/ext/intl/timezone/timezone_methods.cpp
@@ -18,6 +18,8 @@
 #include "config.h"
 #endif
 
+#include "../intl_cppshims.h"
+
 #include <unicode/locid.h>
 #include <unicode/timezone.h>
 #include <unicode/ustring.h>
@@ -28,8 +30,6 @@ extern "C" {
 #include "intl_convert.h"
 #include "../locale/locale.h"
 #include <zend_exceptions.h>
-/* avoid redefinition of int8_t, already defined in unicode/pwin32.h */
-#define _MSC_STDINT_H_ 1
 #include <ext/date/php_date.h>
 }
 #include "common/common_enum.h"
diff --git a/ext/intl/timezone/timezone_methods.h b/ext/intl/timezone/timezone_methods.h
index e153418..28c39f4 100644
--- a/ext/intl/timezone/timezone_methods.h
+++ b/ext/intl/timezone/timezone_methods.h
@@ -19,7 +19,7 @@
 
 #include <php.h>
 
-PHP_METHOD(IntlTimeZone, __construct)
+PHP_METHOD(IntlTimeZone, __construct);
 
 PHP_FUNCTION(intltz_create_time_zone);
 


commit 4fc49c04df699b50c6d714d2505ddb5af06a12fd
Merge: d57b278 e59b6dc
Author: Felipe Pena <felipensp at gmail.com>
Date:   Sun Jun 3 19:00:49 2012 -0300

    Merge commit 'e59b6dc0ae803d49c3f620818285f98dfb61fd57' into PHP-5.3



commit 72beff0d414ef45c06f118f7f60d5cd194c6a013
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Fri Jun 1 17:17:35 2012 +0200

    Added private constructor to IntlTimeZone.

diff --git a/ext/intl/timezone/timezone_class.cpp b/ext/intl/timezone/timezone_class.cpp
index 850da4a..c976eb1 100644
--- a/ext/intl/timezone/timezone_class.cpp
+++ b/ext/intl/timezone/timezone_class.cpp
@@ -524,6 +524,7 @@ ZEND_END_ARG_INFO()
  * Every 'IntlTimeZone' class method has an entry in this table
  */
 static zend_function_entry TimeZone_class_functions[] = {
+	PHP_ME(IntlTimeZone,				__construct,					ainfo_tz_void,				ZEND_ACC_PRIVATE)
 	PHP_ME_MAPPING(createTimeZone,		intltz_create_time_zone,		ainfo_tz_idarg,				ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
 	PHP_ME_MAPPING(fromDateTimeZone,	intltz_from_date_time_zone,		ainfo_tz_idarg,				ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
 	PHP_ME_MAPPING(createDefault,		intltz_create_default,			ainfo_tz_void,				ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
diff --git a/ext/intl/timezone/timezone_methods.cpp b/ext/intl/timezone/timezone_methods.cpp
index e596cc5..b7f31c3 100644
--- a/ext/intl/timezone/timezone_methods.cpp
+++ b/ext/intl/timezone/timezone_methods.cpp
@@ -34,6 +34,13 @@ extern "C" {
 }
 #include "common/common_enum.h"
 
+U_CFUNC PHP_METHOD(IntlTimeZone, __construct)
+{
+	zend_throw_exception( NULL,
+		"An object of this type cannot be created with the new operator",
+		0 TSRMLS_CC );
+}
+
 U_CFUNC PHP_FUNCTION(intltz_create_time_zone)
 {
 	char	*str_id;
diff --git a/ext/intl/timezone/timezone_methods.h b/ext/intl/timezone/timezone_methods.h
index 824f72a..e153418 100644
--- a/ext/intl/timezone/timezone_methods.h
+++ b/ext/intl/timezone/timezone_methods.h
@@ -19,6 +19,8 @@
 
 #include <php.h>
 
+PHP_METHOD(IntlTimeZone, __construct)
+
 PHP_FUNCTION(intltz_create_time_zone);
 
 PHP_FUNCTION(intltz_from_date_time_zone);


commit f3802db7a087d056ae1a0804ea0f7b503dd9c9a3
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Fri Jun 1 15:13:59 2012 +0200

    Fixed write in constant memory.
    
    clang did not forgive.

diff --git a/ext/intl/timezone/timezone_class.cpp b/ext/intl/timezone/timezone_class.cpp
index 4034838..850da4a 100644
--- a/ext/intl/timezone/timezone_class.cpp
+++ b/ext/intl/timezone/timezone_class.cpp
@@ -62,7 +62,7 @@ U_CFUNC TimeZone *timezone_convert_datetimezone(int type,
 												intl_error *outside_error,
 												const char *func TSRMLS_DC)
 {
-	const char	*id = NULL,
+	char		*id = NULL,
 				offset_id[] = "GMT+00:00";
 	int			id_len = 0;
 	char		*message;
@@ -93,7 +93,7 @@ U_CFUNC TimeZone *timezone_convert_datetimezone(int type,
 			}
 
 			id = offset_id;
-			id_len = slprintf((char*)id, sizeof(offset_id), "GMT%+03d:%02d",
+			id_len = slprintf(id, sizeof(offset_id), "GMT%+03d:%02d",
 				hours, minutes);
 			break;
 		}


commit 913b2c700f630bf6b8d74c0fb675d05aaac9e6d6
Merge: 160b5b5 60c5f991
Author: Felipe Pena <felipensp at gmail.com>
Date:   Sun Jun 3 18:23:57 2012 -0300

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      - Optimize comparison between same HashTable pointer
      - Fixed bug #62205 (php-fpm segfaults (null passed to strstr))
      - fix missing include for unix sockets
      - Comment unused function to avoid warnings
      - Fixed bug #62205 (php-fpm segfaults (null passed to strstr))
      - fix missing include for unix sockets
      - Comment unused function to avoid warnings



commit 60c5f9910fbc5bd21fca8a624c6486ad8a41273a
Merge: 1fa8ecd d57b278
Author: Felipe Pena <felipensp at gmail.com>
Date:   Sun Jun 3 18:20:26 2012 -0300

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      - Optimize comparison between same HashTable pointer
      - Fixed bug #62205 (php-fpm segfaults (null passed to strstr))
      - fix missing include for unix sockets
      - Comment unused function to avoid warnings



commit d57b278ad1f490094b0c3331cf02312b785a8a78
Author: Felipe Pena <felipensp at gmail.com>
Date:   Sun Jun 3 18:16:57 2012 -0300

    - Optimize comparison between same HashTable pointer

diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
index da11a6c..e6fe67e 100644
--- a/Zend/zend_operators.c
+++ b/Zend/zend_operators.c
@@ -1575,7 +1575,8 @@ ZEND_API int is_identical_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
 				&& (!memcmp(Z_STRVAL_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op1))));
 			break;
 		case IS_ARRAY:
-			Z_LVAL_P(result) = zend_hash_compare(Z_ARRVAL_P(op1), Z_ARRVAL_P(op2), (compare_func_t) hash_zval_identical_function, 1 TSRMLS_CC)==0;
+			Z_LVAL_P(result) = (Z_ARRVAL_P(op1) == Z_ARRVAL_P(op2) ||
+				zend_hash_compare(Z_ARRVAL_P(op1), Z_ARRVAL_P(op2), (compare_func_t) hash_zval_identical_function, 1 TSRMLS_CC)==0);
 			break;
 		case IS_OBJECT:
 			if (Z_OBJ_HT_P(op1) == Z_OBJ_HT_P(op2)) {
@@ -2029,13 +2030,13 @@ static int hash_zval_compare_function(const zval **z1, const zval **z2 TSRMLS_DC
 
 ZEND_API int zend_compare_symbol_tables_i(HashTable *ht1, HashTable *ht2 TSRMLS_DC) /* {{{ */
 {
-	return zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC);
+	return ht1 == ht2 ? 0 : zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC);
 }
 /* }}} */
 
 ZEND_API void zend_compare_symbol_tables(zval *result, HashTable *ht1, HashTable *ht2 TSRMLS_DC) /* {{{ */
 {
-	ZVAL_LONG(result, zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC));
+	ZVAL_LONG(result, ht1 == ht2 ? 0 : zend_hash_compare(ht1, ht2, (compare_func_t) hash_zval_compare_function, 0 TSRMLS_CC));
 }
 /* }}} */
 


commit e59b6dc0ae803d49c3f620818285f98dfb61fd57
Author: Felipe Pena <felipensp at gmail.com>
Date:   Sun Jun 3 15:23:07 2012 -0300

    - Fixed information leak in ext exif (discovered by Martin Noga, Matthew "j00ru" Jurczyk, Gynvael Coldwind)

diff --git a/ext/exif/exif.c b/ext/exif/exif.c
index 9468c23..604010b 100644
--- a/ext/exif/exif.c
+++ b/ext/exif/exif.c
@@ -3278,7 +3278,7 @@ static void exif_process_APP12(image_info_type *ImageInfo, char *buffer, size_t
 	if ((l1 = php_strnlen(buffer+2, length-2)) > 0) {
 		exif_iif_add_tag(ImageInfo, SECTION_APP12, "Company", TAG_NONE, TAG_FMT_STRING, l1, buffer+2 TSRMLS_CC);
 		if (length > 2+l1+1) {
-			l2 = php_strnlen(buffer+2+l1+1, length-2-l1+1);
+			l2 = php_strnlen(buffer+2+l1+1, length-2-l1-1);
 			exif_iif_add_tag(ImageInfo, SECTION_APP12, "Info", TAG_NONE, TAG_FMT_STRING, l2, buffer+2+l1+1 TSRMLS_CC);
 		}
 	}
@@ -3428,6 +3428,10 @@ static int exif_scan_JPEG_header(image_info_type *ImageInfo TSRMLS_DC)
 			case M_SOF13:
 			case M_SOF14:
 			case M_SOF15:
+				if ((itemlen - 2) < 6) {
+					return FALSE;
+				}
+		
 				exif_process_SOFn(Data, marker, &sof_info);
 				ImageInfo->Width  = sof_info.width;
 				ImageInfo->Height = sof_info.height;


commit 160b5b564cde00c6243381e225445fdce83a0997
Author: David Soria Parra <dsp at php.net>
Date:   Sun Jun 3 19:20:17 2012 +0200

    Fix indention

diff --git a/.travis.yml b/.travis.yml
index c1f72e4..cfb4009 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,11 +5,11 @@ php:
     - 5.4
 
 notifications:
-email:
-    recipients:
-        - php-qa at lists.php.net
-    on_success: change # [always|never|change] default: change
-    on_failure: always # [always|never|change] default: always
+    email:
+        recipients:
+            - php-qa at lists.php.net
+        on_success: change # [always|never|change] default: change
+        on_failure: always # [always|never|change] default: always
 
 env:
     - REPORT_EXIT_STATUS=1 TEST_PHP_EXECUTABLE=./sapi/cli/php


commit 1fc6b3c4d9f364aab0353cce979f582908eab61b
Author: David Soria Parra <dsp at php.net>
Date:   Sun Jun 3 19:11:10 2012 +0200

    Send mails to php-qa at lists.php.net whenever a build is failing

diff --git a/.travis.yml b/.travis.yml
index c51a332..c1f72e4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,6 +4,13 @@ php:
     # We only specify one version so we only get one worker
     - 5.4
 
+notifications:
+email:
+    recipients:
+        - php-qa at lists.php.net
+    on_success: change # [always|never|change] default: change
+    on_failure: always # [always|never|change] default: always
+
 env:
     - REPORT_EXIT_STATUS=1 TEST_PHP_EXECUTABLE=./sapi/cli/php
 


commit 54d85308ebd53b580f42e476dd869929acd8777a
Author: David Soria Parra <dsp at php.net>
Date:   Sun Jun 3 18:49:47 2012 +0200

    Add preliminary README.md for github
    
    Github uses a special markdown syntax and display the content of the README
    formatted on the front page of the repo. This readme contains information for
    github users.

diff --git a/README.md b/README.md
new file mode 100644
index 0000000..5197385
--- /dev/null
+++ b/README.md
@@ -0,0 +1,30 @@
+The PHP Interpreter
+===================
+
+This is the github mirror of the official PHP repository located at
+http://git.php.net.
+
+[![Build Status](https://secure.travis-ci.org/php/php-src.png?branch=master)](http://travis-ci.org/php/php-src)
+
+Pull Requests
+=============
+PHP accepts pull requests via github. Discussions are done on github, but
+depending on the topic can also be relayed to the official PHP developer
+mailinglist internals at lists.php.net.
+
+New features require an RFC and must be accepted by the developers.
+See https://wiki.php.net/rfc and https://wiki.php.net/rfc/voting for more
+information on the process.
+
+Bug fixes **do not** require an RFC, but require a bugtracker ticket. Always
+open a ticket at http://bugs.php.net and reference the bug id using #NNNNNN.
+
+    Fix #55371: get_magic_quotes_gpc() throws deprecation warning
+
+    After removing magic quotes, the get_magic_quotes_gpc function caused
+    a deprecate warning. get_magic_quotes_gpc can be used to detected
+    the magic_quotes behavior and therefore should not raise a warning at any
+    time. The patch removes this warning
+
+We do not merge pull requests directly on github. All PRs will be
+pulled and pushed through http://git.php.net.


commit 8b0da0bb73ef1d6795fc666acc2f0a6c4674cd40
Merge: 2c230fb 5ef46fe
Author: David Soria Parra <dsp at php.net>
Date:   Sun Jun 3 18:22:14 2012 +0200

    Merge branch 'pull-request/68'
    
    By Davey Shafik
    via Davey Shafik
    * pull-request/68:
      Fix boolean casting and whitespace (@dsp / #68)
      Add curl extension config, uses cli-server to test
      Source all extension scripts for ENV vars
      Add extension configs, compile more extensions
      Reformat, setup MySQL DB, call run-tests directly
      Add support for Travis CI



commit 2c230fb574fb2b3e17a74b6678ab36b6572a3c7a
Author: andrey <andrey at php.net>
Date:   Fri Jun 1 22:12:08 2012 +0300

    close the underlying stream as early as possible and so notify the
    NET layer

diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c
index 705dac3..cc3a391 100644
--- a/ext/mysqlnd/mysqlnd.c
+++ b/ext/mysqlnd/mysqlnd.c
@@ -1849,8 +1849,9 @@ MYSQLND_METHOD(mysqlnd_conn_data, send_close)(MYSQLND_CONN_DATA * const conn TSR
 			DBG_INF("Connection clean, sending COM_QUIT");
 			if (net_stream) {
 				ret = conn->m->simple_command(conn, COM_QUIT, NULL, 0, PROT_LAST, TRUE, TRUE TSRMLS_CC);
+				net->data->m.close_stream(net, conn->stats, conn->error_info TSRMLS_CC);
 			}
-			/* Do nothing */
+			CONN_SET_STATE(conn, CONN_QUIT_SENT);
 			break;
 		case CONN_SENDING_LOAD_DATA:
 			/*
@@ -1866,6 +1867,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, send_close)(MYSQLND_CONN_DATA * const conn TSR
 			  Do nothing, the connection will be brutally closed
 			  and the server will catch it and free close from its side.
 			*/
+			/* Fall-through */
 		case CONN_ALLOCED:
 			/*
 			  Allocated but not connected or there was failure when trying
@@ -1873,16 +1875,13 @@ MYSQLND_METHOD(mysqlnd_conn_data, send_close)(MYSQLND_CONN_DATA * const conn TSR
 
 			  Fall-through
 			*/
+			CONN_SET_STATE(conn, CONN_QUIT_SENT);
+			net->data->m.close_stream(net, conn->stats, conn->error_info TSRMLS_CC);
+			/* Fall-through */
 		case CONN_QUIT_SENT:
 			/* The user has killed its own connection */
 			break;
 	}
-	/*
-	  We hold one reference, and every other object which needs the
-	  connection does increase it by 1.
-	*/
-	CONN_SET_STATE(conn, CONN_QUIT_SENT);
-	net->data->m.close_stream(net, conn->stats, conn->error_info TSRMLS_CC);
 
 	DBG_RETURN(ret);
 }
diff --git a/ext/mysqlnd/mysqlnd_net.c b/ext/mysqlnd/mysqlnd_net.c
index a641a41..7458f76 100644
--- a/ext/mysqlnd/mysqlnd_net.c
+++ b/ext/mysqlnd/mysqlnd_net.c
@@ -239,17 +239,19 @@ MYSQLND_METHOD(mysqlnd_net, post_connect_set_opt)(MYSQLND_NET * const net,
 {
 	php_stream * net_stream = net->data->m.get_stream(net TSRMLS_CC);
 	DBG_ENTER("mysqlnd_net::post_connect_set_opt");
-	if (net->data->options.timeout_read) {
-		struct timeval tv;
-		DBG_INF_FMT("setting %u as PHP_STREAM_OPTION_READ_TIMEOUT", net->data->options.timeout_read);
-		tv.tv_sec = net->data->options.timeout_read;
-		tv.tv_usec = 0;
-		php_stream_set_option(net_stream, PHP_STREAM_OPTION_READ_TIMEOUT, 0, &tv);
-	}
+	if (net_stream) {
+		if (net->data->options.timeout_read) {
+			struct timeval tv;
+			DBG_INF_FMT("setting %u as PHP_STREAM_OPTION_READ_TIMEOUT", net->data->options.timeout_read);
+			tv.tv_sec = net->data->options.timeout_read;
+			tv.tv_usec = 0;
+			php_stream_set_option(net_stream, PHP_STREAM_OPTION_READ_TIMEOUT, 0, &tv);
+		}
 
-	if (!memcmp(scheme, "tcp://", sizeof("tcp://") - 1)) {
-		/* TCP -> Set TCP_NODELAY */
-		mysqlnd_set_sock_no_delay(net_stream TSRMLS_CC);
+		if (!memcmp(scheme, "tcp://", sizeof("tcp://") - 1)) {
+			/* TCP -> Set TCP_NODELAY */
+			mysqlnd_set_sock_no_delay(net_stream TSRMLS_CC);
+		}
 	}
 
 	DBG_VOID_RETURN;
@@ -1051,6 +1053,7 @@ static php_stream *
 MYSQLND_METHOD(mysqlnd_net, get_stream)(const MYSQLND_NET * const net TSRMLS_DC)
 {
 	DBG_ENTER("mysqlnd_net::get_stream");
+	DBG_INF_FMT("%p", net? net->data->stream:NULL);
 	DBG_RETURN(net? net->data->stream:NULL);
 }
 /* }}} */


commit 1fa8ecd082607858084994ad7081ef06e37db5f5
Merge: 238caeb b548d9a
Author: Jerome Loyet <fat at php.net>
Date:   Fri Jun 1 11:30:49 2012 +0200

    Merge branch 'PHP-5.4' of git.php.net:php-src into PHP-5.4
    
    * 'PHP-5.4' of git.php.net:php-src: (27 commits)
      Fixed Bug #62202 (ReflectionParameter::getDefaultValue() memory leaks with constant)
      sort NEWS
      fix bug #55042 - erealloc without updating pointer
      Fix bug #62186 readline fails to compile
      fix unchecked emalloc (cherry picked from commit 158d8a6b088662ce9d31e0c777c6ebe90efdc854)
      fix test
      fix test
      Typofix in comment in proc_open.c
      fix CVE-2012-2143
      updated the libmagic patch after Felipes regex fix
      Fix bug #62150 Test Bug - ext/fileinfo/tests/finfo_open_error.phpt
      Bug #62177 deactivate the linux test version on win
      Fix bug #62177 Test Bug - finfo_file_regex.phpt
      Fixed bug #62176 Test Bug - sapi/cli/tests/bug61546.phpt
      fix unchecked emalloc
      add CVE
      add bug 62146
      add bug #62082
      sync with HEAD
      sync with HEAD
      ...



commit ad60e181d6829c740abc5cf0c2bd283e77484f18
Merge: 4fc989f ba23ddd
Author: Jerome Loyet <fat at php.net>
Date:   Fri Jun 1 11:30:13 2012 +0200

    Merge branch 'master' of git.php.net:php-src
    
    * 'master' of git.php.net:php-src: (43 commits)
      close the stream whenever possible, no need to keep it open altough the connection is marked as unusable
      Fixed Bug #62202 (ReflectionParameter::getDefaultValue() memory leaks with constant)
      more refactoring stuff. Reduced code duplication in the authentication code
      sort NEWS
      fix bug #55042 - erealloc without updating pointer
      Fix bug #62186 readline fails to compile
      fix unchecked emalloc (cherry picked from commit 158d8a6b088662ce9d31e0c777c6ebe90efdc854)
      small refactoring - factour out code from connection establishment. Add a define for the default authentication protocol - get away from the hardcoded magic value
      fix test
      fix test
      Typofix in comment in proc_open.c
      fix CVE-2012-2143
      updated the libmagic patch after Felipes regex fix
      Fix bug #62150 Test Bug - ext/fileinfo/tests/finfo_open_error.phpt
      Bug #62177 deactivate the linux test version on win
      Fix bug #62177 Test Bug - finfo_file_regex.phpt
      Fixed bug #62176 Test Bug - sapi/cli/tests/bug61546.phpt
      fix unchecked emalloc
      add CVE
      add bug 62146
      ...



commit 4fc989fbbd0405d200872219b409f685a495f3aa
Author: Jerome Loyet <fat at php.net>
Date:   Fri Jun 1 11:27:19 2012 +0200

    - Fixed bug #62205 (php-fpm segfaults (null passed to strstr))

diff --git a/sapi/fpm/fpm/fpm_php.c b/sapi/fpm/fpm/fpm_php.c
index 840eec7..cd4d3ae 100644
--- a/sapi/fpm/fpm/fpm_php.c
+++ b/sapi/fpm/fpm/fpm_php.c
@@ -257,3 +257,41 @@ int fpm_php_limit_extensions(char *path) /* {{{ */
 	return 1; /* extension not found: not allowed  */
 }
 /* }}} */
+
+char* fpm_php_get_string_from_table(char *table, char *key TSRMLS_DC) /* {{{ */
+{
+	zval **data, **tmp;
+	char *string_key;
+	uint string_len;
+	ulong num_key;
+	if (!table || !key) {
+		return NULL;
+	}
+
+	/* inspired from ext/standard/info.c */
+
+	zend_is_auto_global(table, strlen(table) TSRMLS_CC);
+
+	/* find the table and ensure it's an array */
+	if (zend_hash_find(&EG(symbol_table), table, strlen(table) + 1, (void **) &data) == SUCCESS && Z_TYPE_PP(data) == IS_ARRAY) {
+
+		/* reset the internal pointer */
+		zend_hash_internal_pointer_reset(Z_ARRVAL_PP(data));
+
+		/* parse the array to look for our key */
+		while (zend_hash_get_current_data(Z_ARRVAL_PP(data), (void **) &tmp) == SUCCESS) {
+			/* ensure the key is a string */
+			if (zend_hash_get_current_key_ex(Z_ARRVAL_PP(data), &string_key, &string_len, &num_key, 0, NULL) == HASH_KEY_IS_STRING) {
+				/* compare to our key */
+				if (!strncmp(string_key, key, string_len)) {
+					return Z_STRVAL_PP(tmp);
+				}
+			}
+			zend_hash_move_forward(Z_ARRVAL_PP(data));
+		}
+	}
+
+	return NULL;
+}
+/* }}} */
+
diff --git a/sapi/fpm/fpm/fpm_php.h b/sapi/fpm/fpm/fpm_php.h
index a2c7ed3..d605473 100644
--- a/sapi/fpm/fpm/fpm_php.h
+++ b/sapi/fpm/fpm/fpm_php.h
@@ -44,6 +44,7 @@ void fpm_php_soft_quit();
 int fpm_php_init_main();
 int fpm_php_apply_defines_ex(struct key_value_s *kv, int mode);
 int fpm_php_limit_extensions(char *path);
+char* fpm_php_get_string_from_table(char *table, char *key TSRMLS_DC);
 
 #endif
 
diff --git a/sapi/fpm/fpm/fpm_status.c b/sapi/fpm/fpm/fpm_status.c
index 83de76d..5f2c852 100644
--- a/sapi/fpm/fpm/fpm_status.c
+++ b/sapi/fpm/fpm/fpm_status.c
@@ -14,6 +14,7 @@
 #include "zlog.h"
 #include "fpm_atomic.h"
 #include "fpm_conf.h"
+#include "fpm_php.h"
 #include <ext/standard/html.h>
 
 static char *fpm_status_uri = NULL;
@@ -125,13 +126,13 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
 		}
 
 		/* full status ? */
-		full = SG(request_info).request_uri && strstr(SG(request_info).query_string, "full");
+		full = (fpm_php_get_string_from_table("_GET", "full" TSRMLS_CC) != NULL);
 		short_syntax = short_post = NULL;
 		full_separator = full_pre = full_syntax = full_post = NULL;
 		encode = 0;
 
 		/* HTML */
-		if (SG(request_info).query_string && strstr(SG(request_info).query_string, "html")) {
+		if (fpm_php_get_string_from_table("_GET", "html" TSRMLS_CC)) {
 			sapi_add_header_ex(ZEND_STRL("Content-Type: text/html"), 1, 1 TSRMLS_CC);
 			time_format = "%d/%b/%Y:%H:%M:%S %z";
 			encode = 1;
@@ -205,7 +206,7 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
 			}
 
 		/* XML */
-		} else if (SG(request_info).request_uri && strstr(SG(request_info).query_string, "xml")) {
+		} else if (fpm_php_get_string_from_table("_GET", "xml" TSRMLS_CC)) {
 			sapi_add_header_ex(ZEND_STRL("Content-Type: text/xml"), 1, 1 TSRMLS_CC);
 			time_format = "%s";
 			encode = 1;
@@ -256,7 +257,7 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
 				}
 
 			/* JSON */
-		} else if (SG(request_info).request_uri && strstr(SG(request_info).query_string, "json")) {
+		} else if (fpm_php_get_string_from_table("_GET", "json" TSRMLS_CC)) {
 			sapi_add_header_ex(ZEND_STRL("Content-Type: application/json"), 1, 1 TSRMLS_CC);
 			time_format = "%s";
 


commit 487e2fc0d50aca979864b59ff01450cf5e381874
Author: Jerome Loyet <fat at php.net>
Date:   Fri Jun 1 11:26:55 2012 +0200

    - fix missing include for unix sockets

diff --git a/sapi/fpm/fpm/fpm_sockets.h b/sapi/fpm/fpm/fpm_sockets.h
index 5b9c698..499ba6b 100644
--- a/sapi/fpm/fpm/fpm_sockets.h
+++ b/sapi/fpm/fpm/fpm_sockets.h
@@ -7,6 +7,7 @@
 
 #include <sys/types.h>
 #include <sys/socket.h>
+#include <sys/un.h>
 #include <unistd.h>
 #include <fcntl.h>
 


commit 34b6a9b32cb1271441a8fa9f39f13d33f3a3e9ec
Author: Jerome Loyet <fat at php.net>
Date:   Fri Jun 1 11:26:39 2012 +0200

    - Comment unused function to avoid warnings

diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c
index 1f3258f..dfe6792 100644
--- a/sapi/fpm/fpm/fpm_conf.c
+++ b/sapi/fpm/fpm/fpm_conf.c
@@ -53,7 +53,9 @@
 
 static int fpm_conf_load_ini_file(char *filename TSRMLS_DC);
 static char *fpm_conf_set_integer(zval *value, void **config, intptr_t offset);
+#if 0 /* not used for now */
 static char *fpm_conf_set_long(zval *value, void **config, intptr_t offset);
+#endif
 static char *fpm_conf_set_time(zval *value, void **config, intptr_t offset);
 static char *fpm_conf_set_boolean(zval *value, void **config, intptr_t offset);
 static char *fpm_conf_set_string(zval *value, void **config, intptr_t offset);
@@ -242,6 +244,7 @@ static char *fpm_conf_set_integer(zval *value, void **config, intptr_t offset) /
 }
 /* }}} */
 
+#if 0 /* not used for now */
 static char *fpm_conf_set_long(zval *value, void **config, intptr_t offset) /* {{{ */
 {
 	char *val = Z_STRVAL_P(value);
@@ -257,6 +260,7 @@ static char *fpm_conf_set_long(zval *value, void **config, intptr_t offset) /* {
 	return NULL;
 }
 /* }}} */
+#endif
 
 static char *fpm_conf_set_time(zval *value, void **config, intptr_t offset) /* {{{ */
 {


commit 238caeb63c4f4faf67b9f8de62a753eb3e954dbe
Author: Jerome Loyet <fat at php.net>
Date:   Fri Jun 1 11:23:01 2012 +0200

    - Fixed bug #62205 (php-fpm segfaults (null passed to strstr))

diff --git a/NEWS b/NEWS
index eed55f1..363a8b7 100644
--- a/NEWS
+++ b/NEWS
@@ -68,6 +68,7 @@ PHP                                                                        NEWS
   . Fixed bug #62160 (Add process.priority to set nice(2) priorities). (fat)
   . Fixed bug #61218 (FPM drops connection while receiving some binary values
     in FastCGI requests). (fat)
+  . Fixed bug #62205 (php-fpm segfaults (null passed to strstr)). (fat)
 
 - Intl
   . ResourceBundle constructor now accepts NULL for the first two arguments.
diff --git a/sapi/fpm/fpm/fpm_php.c b/sapi/fpm/fpm/fpm_php.c
index 840eec7..cd4d3ae 100644
--- a/sapi/fpm/fpm/fpm_php.c
+++ b/sapi/fpm/fpm/fpm_php.c
@@ -257,3 +257,41 @@ int fpm_php_limit_extensions(char *path) /* {{{ */
 	return 1; /* extension not found: not allowed  */
 }
 /* }}} */
+
+char* fpm_php_get_string_from_table(char *table, char *key TSRMLS_DC) /* {{{ */
+{
+	zval **data, **tmp;
+	char *string_key;
+	uint string_len;
+	ulong num_key;
+	if (!table || !key) {
+		return NULL;
+	}
+
+	/* inspired from ext/standard/info.c */
+
+	zend_is_auto_global(table, strlen(table) TSRMLS_CC);
+
+	/* find the table and ensure it's an array */
+	if (zend_hash_find(&EG(symbol_table), table, strlen(table) + 1, (void **) &data) == SUCCESS && Z_TYPE_PP(data) == IS_ARRAY) {
+
+		/* reset the internal pointer */
+		zend_hash_internal_pointer_reset(Z_ARRVAL_PP(data));
+
+		/* parse the array to look for our key */
+		while (zend_hash_get_current_data(Z_ARRVAL_PP(data), (void **) &tmp) == SUCCESS) {
+			/* ensure the key is a string */
+			if (zend_hash_get_current_key_ex(Z_ARRVAL_PP(data), &string_key, &string_len, &num_key, 0, NULL) == HASH_KEY_IS_STRING) {
+				/* compare to our key */
+				if (!strncmp(string_key, key, string_len)) {
+					return Z_STRVAL_PP(tmp);
+				}
+			}
+			zend_hash_move_forward(Z_ARRVAL_PP(data));
+		}
+	}
+
+	return NULL;
+}
+/* }}} */
+
diff --git a/sapi/fpm/fpm/fpm_php.h b/sapi/fpm/fpm/fpm_php.h
index a2c7ed3..d605473 100644
--- a/sapi/fpm/fpm/fpm_php.h
+++ b/sapi/fpm/fpm/fpm_php.h
@@ -44,6 +44,7 @@ void fpm_php_soft_quit();
 int fpm_php_init_main();
 int fpm_php_apply_defines_ex(struct key_value_s *kv, int mode);
 int fpm_php_limit_extensions(char *path);
+char* fpm_php_get_string_from_table(char *table, char *key TSRMLS_DC);
 
 #endif
 
diff --git a/sapi/fpm/fpm/fpm_status.c b/sapi/fpm/fpm/fpm_status.c
index 83de76d..5f2c852 100644
--- a/sapi/fpm/fpm/fpm_status.c
+++ b/sapi/fpm/fpm/fpm_status.c
@@ -14,6 +14,7 @@
 #include "zlog.h"
 #include "fpm_atomic.h"
 #include "fpm_conf.h"
+#include "fpm_php.h"
 #include <ext/standard/html.h>
 
 static char *fpm_status_uri = NULL;
@@ -125,13 +126,13 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
 		}
 
 		/* full status ? */
-		full = SG(request_info).request_uri && strstr(SG(request_info).query_string, "full");
+		full = (fpm_php_get_string_from_table("_GET", "full" TSRMLS_CC) != NULL);
 		short_syntax = short_post = NULL;
 		full_separator = full_pre = full_syntax = full_post = NULL;
 		encode = 0;
 
 		/* HTML */
-		if (SG(request_info).query_string && strstr(SG(request_info).query_string, "html")) {
+		if (fpm_php_get_string_from_table("_GET", "html" TSRMLS_CC)) {
 			sapi_add_header_ex(ZEND_STRL("Content-Type: text/html"), 1, 1 TSRMLS_CC);
 			time_format = "%d/%b/%Y:%H:%M:%S %z";
 			encode = 1;
@@ -205,7 +206,7 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
 			}
 
 		/* XML */
-		} else if (SG(request_info).request_uri && strstr(SG(request_info).query_string, "xml")) {
+		} else if (fpm_php_get_string_from_table("_GET", "xml" TSRMLS_CC)) {
 			sapi_add_header_ex(ZEND_STRL("Content-Type: text/xml"), 1, 1 TSRMLS_CC);
 			time_format = "%s";
 			encode = 1;
@@ -256,7 +257,7 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
 				}
 
 			/* JSON */
-		} else if (SG(request_info).request_uri && strstr(SG(request_info).query_string, "json")) {
+		} else if (fpm_php_get_string_from_table("_GET", "json" TSRMLS_CC)) {
 			sapi_add_header_ex(ZEND_STRL("Content-Type: application/json"), 1, 1 TSRMLS_CC);
 			time_format = "%s";
 


commit ec4a1d576b07f05e65a649842ed701def21adadd
Author: Jerome Loyet <fat at php.net>
Date:   Fri Jun 1 11:22:18 2012 +0200

    - fix missing include for unix sockets

diff --git a/sapi/fpm/fpm/fpm_sockets.h b/sapi/fpm/fpm/fpm_sockets.h
index 5b9c698..499ba6b 100644
--- a/sapi/fpm/fpm/fpm_sockets.h
+++ b/sapi/fpm/fpm/fpm_sockets.h
@@ -7,6 +7,7 @@
 
 #include <sys/types.h>
 #include <sys/socket.h>
+#include <sys/un.h>
 #include <unistd.h>
 #include <fcntl.h>
 


commit 43ec7088829338decce93ea4aada34f0bb6f069b
Author: Jerome Loyet <fat at php.net>
Date:   Fri Jun 1 11:22:02 2012 +0200

    - Comment unused function to avoid warnings

diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c
index 1f3258f..dfe6792 100644
--- a/sapi/fpm/fpm/fpm_conf.c
+++ b/sapi/fpm/fpm/fpm_conf.c
@@ -53,7 +53,9 @@
 
 static int fpm_conf_load_ini_file(char *filename TSRMLS_DC);
 static char *fpm_conf_set_integer(zval *value, void **config, intptr_t offset);
+#if 0 /* not used for now */
 static char *fpm_conf_set_long(zval *value, void **config, intptr_t offset);
+#endif
 static char *fpm_conf_set_time(zval *value, void **config, intptr_t offset);
 static char *fpm_conf_set_boolean(zval *value, void **config, intptr_t offset);
 static char *fpm_conf_set_string(zval *value, void **config, intptr_t offset);
@@ -242,6 +244,7 @@ static char *fpm_conf_set_integer(zval *value, void **config, intptr_t offset) /
 }
 /* }}} */
 
+#if 0 /* not used for now */
 static char *fpm_conf_set_long(zval *value, void **config, intptr_t offset) /* {{{ */
 {
 	char *val = Z_STRVAL_P(value);
@@ -257,6 +260,7 @@ static char *fpm_conf_set_long(zval *value, void **config, intptr_t offset) /* {
 	return NULL;
 }
 /* }}} */
+#endif
 
 static char *fpm_conf_set_time(zval *value, void **config, intptr_t offset) /* {{{ */
 {


commit 38ca8cb7a12548b44b942ddd4fb2628b70bc6612
Author: Jerome Loyet <fat at php.net>
Date:   Fri Jun 1 11:18:48 2012 +0200

    - Fixed bug #62205 (php-fpm segfaults (null passed to strstr))

diff --git a/NEWS b/NEWS
index d031c3c..42eb5b4 100644
--- a/NEWS
+++ b/NEWS
@@ -23,6 +23,7 @@ PHP                                                                        NEWS
   . Fixed bug #62160 (Add process.priority to set nice(2) priorities). (fat)
   . Fixed bug #61218 (FPM drops connection while receiving some binary values
     in FastCGI requests). (fat)
+  . Fixed bug #62205 (php-fpm segfaults (null passed to strstr)). (fat)
 
 - Intl:
   . Fixed bug #62083 (grapheme_extract() memory leaks). (Gustavo)
diff --git a/sapi/fpm/fpm/fpm_php.c b/sapi/fpm/fpm/fpm_php.c
index 840eec7..cd4d3ae 100644
--- a/sapi/fpm/fpm/fpm_php.c
+++ b/sapi/fpm/fpm/fpm_php.c
@@ -257,3 +257,41 @@ int fpm_php_limit_extensions(char *path) /* {{{ */
 	return 1; /* extension not found: not allowed  */
 }
 /* }}} */
+
+char* fpm_php_get_string_from_table(char *table, char *key TSRMLS_DC) /* {{{ */
+{
+	zval **data, **tmp;
+	char *string_key;
+	uint string_len;
+	ulong num_key;
+	if (!table || !key) {
+		return NULL;
+	}
+
+	/* inspired from ext/standard/info.c */
+
+	zend_is_auto_global(table, strlen(table) TSRMLS_CC);
+
+	/* find the table and ensure it's an array */
+	if (zend_hash_find(&EG(symbol_table), table, strlen(table) + 1, (void **) &data) == SUCCESS && Z_TYPE_PP(data) == IS_ARRAY) {
+
+		/* reset the internal pointer */
+		zend_hash_internal_pointer_reset(Z_ARRVAL_PP(data));
+
+		/* parse the array to look for our key */
+		while (zend_hash_get_current_data(Z_ARRVAL_PP(data), (void **) &tmp) == SUCCESS) {
+			/* ensure the key is a string */
+			if (zend_hash_get_current_key_ex(Z_ARRVAL_PP(data), &string_key, &string_len, &num_key, 0, NULL) == HASH_KEY_IS_STRING) {
+				/* compare to our key */
+				if (!strncmp(string_key, key, string_len)) {
+					return Z_STRVAL_PP(tmp);
+				}
+			}
+			zend_hash_move_forward(Z_ARRVAL_PP(data));
+		}
+	}
+
+	return NULL;
+}
+/* }}} */
+
diff --git a/sapi/fpm/fpm/fpm_php.h b/sapi/fpm/fpm/fpm_php.h
index a2c7ed3..d605473 100644
--- a/sapi/fpm/fpm/fpm_php.h
+++ b/sapi/fpm/fpm/fpm_php.h
@@ -44,6 +44,7 @@ void fpm_php_soft_quit();
 int fpm_php_init_main();
 int fpm_php_apply_defines_ex(struct key_value_s *kv, int mode);
 int fpm_php_limit_extensions(char *path);
+char* fpm_php_get_string_from_table(char *table, char *key TSRMLS_DC);
 
 #endif
 
diff --git a/sapi/fpm/fpm/fpm_status.c b/sapi/fpm/fpm/fpm_status.c
index e64a645..3b09d3b 100644
--- a/sapi/fpm/fpm/fpm_status.c
+++ b/sapi/fpm/fpm/fpm_status.c
@@ -14,6 +14,7 @@
 #include "zlog.h"
 #include "fpm_atomic.h"
 #include "fpm_conf.h"
+#include "fpm_php.h"
 #include <ext/standard/html.h>
 
 static char *fpm_status_uri = NULL;
@@ -125,13 +126,13 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
 		}
 
 		/* full status ? */
-		full = SG(request_info).request_uri && strstr(SG(request_info).query_string, "full");
+		full = (fpm_php_get_string_from_table("_GET", "full" TSRMLS_CC) != NULL);
 		short_syntax = short_post = NULL;
 		full_separator = full_pre = full_syntax = full_post = NULL;
 		encode = 0;
 
 		/* HTML */
-		if (SG(request_info).query_string && strstr(SG(request_info).query_string, "html")) {
+		if (fpm_php_get_string_from_table("_GET", "html" TSRMLS_CC)) {
 			sapi_add_header_ex(ZEND_STRL("Content-Type: text/html"), 1, 1 TSRMLS_CC);
 			time_format = "%d/%b/%Y:%H:%M:%S %z";
 			encode = 1;
@@ -205,7 +206,7 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
 			}
 
 		/* XML */
-		} else if (SG(request_info).request_uri && strstr(SG(request_info).query_string, "xml")) {
+		} else if (fpm_php_get_string_from_table("_GET", "xml" TSRMLS_CC)) {
 			sapi_add_header_ex(ZEND_STRL("Content-Type: text/xml"), 1, 1 TSRMLS_CC);
 			time_format = "%s";
 			encode = 1;
@@ -256,7 +257,7 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
 				}
 
 			/* JSON */
-		} else if (SG(request_info).request_uri && strstr(SG(request_info).query_string, "json")) {
+		} else if (fpm_php_get_string_from_table("_GET", "json" TSRMLS_CC)) {
 			sapi_add_header_ex(ZEND_STRL("Content-Type: application/json"), 1, 1 TSRMLS_CC);
 			time_format = "%s";
 


commit 35abf3f20c36109b4afdcbd62db9a1846575ac3d
Author: Jerome Loyet <fat at php.net>
Date:   Fri Jun 1 11:16:53 2012 +0200

    - fix missing include for unix sockets

diff --git a/sapi/fpm/fpm/fpm_sockets.h b/sapi/fpm/fpm/fpm_sockets.h
index 5b9c698..499ba6b 100644
--- a/sapi/fpm/fpm/fpm_sockets.h
+++ b/sapi/fpm/fpm/fpm_sockets.h
@@ -7,6 +7,7 @@
 
 #include <sys/types.h>
 #include <sys/socket.h>
+#include <sys/un.h>
 #include <unistd.h>
 #include <fcntl.h>
 


commit 59e0930d37e2a559317e2c08ecfee5a84bde925d
Author: Jerome Loyet <fat at php.net>
Date:   Fri Jun 1 11:16:00 2012 +0200

    - Comment unused function to avoid warnings

diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c
index 1f3258f..dfe6792 100644
--- a/sapi/fpm/fpm/fpm_conf.c
+++ b/sapi/fpm/fpm/fpm_conf.c
@@ -53,7 +53,9 @@
 
 static int fpm_conf_load_ini_file(char *filename TSRMLS_DC);
 static char *fpm_conf_set_integer(zval *value, void **config, intptr_t offset);
+#if 0 /* not used for now */
 static char *fpm_conf_set_long(zval *value, void **config, intptr_t offset);
+#endif
 static char *fpm_conf_set_time(zval *value, void **config, intptr_t offset);
 static char *fpm_conf_set_boolean(zval *value, void **config, intptr_t offset);
 static char *fpm_conf_set_string(zval *value, void **config, intptr_t offset);
@@ -242,6 +244,7 @@ static char *fpm_conf_set_integer(zval *value, void **config, intptr_t offset) /
 }
 /* }}} */
 
+#if 0 /* not used for now */
 static char *fpm_conf_set_long(zval *value, void **config, intptr_t offset) /* {{{ */
 {
 	char *val = Z_STRVAL_P(value);
@@ -257,6 +260,7 @@ static char *fpm_conf_set_long(zval *value, void **config, intptr_t offset) /* {
 	return NULL;
 }
 /* }}} */
+#endif
 
 static char *fpm_conf_set_time(zval *value, void **config, intptr_t offset) /* {{{ */
 {


commit ba23ddd06ccf24b00a92ca4bef2b63acf661c36e
Merge: f96d19f fc6462e
Author: andrey <andrey at php.net>
Date:   Fri Jun 1 11:22:52 2012 +0300

    Merge branch 'master' of git.php.net:php-src



commit f96d19fa7078df9a131f3bd0dd6e5a4429ee7037
Author: andrey <andrey at php.net>
Date:   Fri Jun 1 11:22:19 2012 +0300

    close the stream whenever possible, no need to keep it open altough the
    connection is marked as unusable

diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c
index 02a2401..705dac3 100644
--- a/ext/mysqlnd/mysqlnd.c
+++ b/ext/mysqlnd/mysqlnd.c
@@ -354,6 +354,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, simple_command_send_request)(MYSQLND_CONN_DATA
 			php_error(E_WARNING, "Error while sending %s packet. PID=%d", mysqlnd_command_to_text[command], getpid());
 		}
 		CONN_SET_STATE(conn, CONN_QUIT_SENT);
+		conn->m->send_close(conn TSRMLS_CC);
 		DBG_ERR("Server is gone");
 		ret = FAIL;
 	}
@@ -468,6 +469,7 @@ mysqlnd_switch_to_ssl_if_needed(
 		DBG_INF("Switching to SSL");
 		if (!PACKET_WRITE(auth_packet, conn)) {
 			CONN_SET_STATE(conn, CONN_QUIT_SENT);
+			conn->m->send_close(conn TSRMLS_CC);
 			SET_CLIENT_ERROR(*conn->error_info, CR_SERVER_GONE_ERROR, UNKNOWN_SQLSTATE, mysqlnd_server_gone);
 			goto end;
 		}
@@ -1732,6 +1734,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, kill)(MYSQLND_CONN_DATA * conn, unsigned int p
 			SET_ERROR_AFF_ROWS(conn);
 		} else if (PASS == (ret = conn->m->simple_command(conn, COM_PROCESS_KILL, buff, 4, PROT_LAST, FALSE, TRUE TSRMLS_CC))) {
 			CONN_SET_STATE(conn, CONN_QUIT_SENT);
+			conn->m->send_close(conn TSRMLS_CC);
 		}
 
 		conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
@@ -1879,6 +1882,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, send_close)(MYSQLND_CONN_DATA * const conn TSR
 	  connection does increase it by 1.
 	*/
 	CONN_SET_STATE(conn, CONN_QUIT_SENT);
+	net->data->m.close_stream(net, conn->stats, conn->error_info TSRMLS_CC);
 
 	DBG_RETURN(ret);
 }
@@ -2118,6 +2122,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, next_result)(MYSQLND_CONN_DATA * const conn TS
 					DBG_ERR_FMT("Serious error. %s::%u", __FILE__, __LINE__);
 					php_error_docref(NULL TSRMLS_CC, E_WARNING, "Serious error. PID=%d", getpid());
 					CONN_SET_STATE(conn, CONN_QUIT_SENT);
+					conn->m->send_close(conn TSRMLS_CC);
 				} else {
 					DBG_INF_FMT("Error from the server : (%u) %s", conn->error_info->error_no, conn->error_info->error);
 				}


commit fc6462ec7b447e14f5209f2448e3577d628f3458
Merge: 9a64a23 b548d9a
Author: Xinchen Hui <laruence at php.net>
Date:   Fri Jun 1 15:00:55 2012 +0800

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fixed Bug #62202 (ReflectionParameter::getDefaultValue() memory leaks with constant)
      sort NEWS



commit b548d9ad2e02f3f216320b5f47e26046021a5bac
Merge: 5ebb0e5 1f5327a
Author: Xinchen Hui <laruence at php.net>
Date:   Fri Jun 1 15:00:02 2012 +0800

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fixed Bug #62202 (ReflectionParameter::getDefaultValue() memory leaks with constant)

diff --cc ext/reflection/php_reflection.c
index 1cf65ce,ca90269..9346587
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@@ -2559,9 -2418,10 +2559,10 @@@ ZEND_METHOD(reflection_parameter, getDe
  		return;
  	}
  
 -	*return_value = precv->op2.u.constant;
 +	*return_value = *precv->op2.zv;
  	INIT_PZVAL(return_value);
- 	if (Z_TYPE_P(return_value) != IS_CONSTANT && Z_TYPE_P(return_value) != IS_CONSTANT_ARRAY) {
+ 	if ((Z_TYPE_P(return_value) & IS_CONSTANT_TYPE_MASK) != IS_CONSTANT
+ 			&& (Z_TYPE_P(return_value) & IS_CONSTANT_TYPE_MASK) != IS_CONSTANT_ARRAY) {
  		zval_copy_ctor(return_value);
  	}
  	zval_update_constant_ex(&return_value, (void*)0, param->fptr->common.scope TSRMLS_CC);


commit 1f5327a6022fedc1985d2daa6d189313d808b08b
Author: Xinchen Hui <laruence at php.net>
Date:   Fri Jun 1 14:55:14 2012 +0800

    Fixed Bug #62202 (ReflectionParameter::getDefaultValue() memory leaks with constant)

diff --git a/NEWS b/NEWS
index 0297393..d031c3c 100644
--- a/NEWS
+++ b/NEWS
@@ -35,6 +35,10 @@ PHP                                                                        NEWS
     pattern). (Gustavo)
   . Fixed bug #60785 (memory leak in IntlDateFormatter constructor). (Gustavo)
 
+- Reflection:
+  . Fixed bug #62202 (ReflectionParameter::getDefaultValue() memory leaks 
+    with constant). (Laruence)
+
 - XML Writer:
   . Fixed bug #62064 (memory leak in the XML Writer module). 
     (jean-pierre dot lozi at lip6 dot fr)
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 8141275..ca90269 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -2420,7 +2420,8 @@ ZEND_METHOD(reflection_parameter, getDefaultValue)
 
 	*return_value = precv->op2.u.constant;
 	INIT_PZVAL(return_value);
-	if (Z_TYPE_P(return_value) != IS_CONSTANT && Z_TYPE_P(return_value) != IS_CONSTANT_ARRAY) {
+	if ((Z_TYPE_P(return_value) & IS_CONSTANT_TYPE_MASK) != IS_CONSTANT
+			&& (Z_TYPE_P(return_value) & IS_CONSTANT_TYPE_MASK) != IS_CONSTANT_ARRAY) {
 		zval_copy_ctor(return_value);
 	}
 	zval_update_constant_ex(&return_value, (void*)0, param->fptr->common.scope TSRMLS_CC);


commit 9a64a23caf0ad65cfe553569e2b010797ac5dca7
Merge: 0d1bc3e 0c658c3
Author: andrey <andrey at php.net>
Date:   Thu May 31 15:46:55 2012 +0300

    Merge branch 'master' of git.php.net:php-src



commit 0d1bc3e8e57977265f1543e35d877b632b56cce9
Author: andrey <andrey at php.net>
Date:   Thu May 31 15:46:26 2012 +0300

    more refactoring stuff. Reduced code duplication in the authentication
    code

diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c
index fc0e46a..02a2401 100644
--- a/ext/mysqlnd/mysqlnd.c
+++ b/ext/mysqlnd/mysqlnd.c
@@ -303,17 +303,16 @@ MYSQLND_METHOD(mysqlnd_conn_data, simple_command_handle_response)(MYSQLND_CONN_D
 /* }}} */
 
 
-/* {{{ mysqlnd_conn_data::simple_command */
+/* {{{ mysqlnd_conn_data::simple_command_send_request */
 static enum_func_status
-MYSQLND_METHOD(mysqlnd_conn_data, simple_command)(MYSQLND_CONN_DATA * conn, enum php_mysqlnd_server_command command,
-			   const zend_uchar * const arg, size_t arg_len, enum mysqlnd_packet_type ok_packet, zend_bool silent,
-			   zend_bool ignore_upsert_status TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_conn_data, simple_command_send_request)(MYSQLND_CONN_DATA * conn, enum php_mysqlnd_server_command command,
+			   const zend_uchar * const arg, size_t arg_len, zend_bool silent, zend_bool ignore_upsert_status TSRMLS_DC)
 {
 	enum_func_status ret = PASS;
 	MYSQLND_PACKET_COMMAND * cmd_packet;
 
-	DBG_ENTER("mysqlnd_conn_data::simple_command");
-	DBG_INF_FMT("command=%s ok_packet=%u silent=%u", mysqlnd_command_to_text[command], ok_packet, silent);
+	DBG_ENTER("mysqlnd_conn_data::simple_command_send_request");
+	DBG_INF_FMT("command=%s silent=%u", mysqlnd_command_to_text[command], silent);
 
 	switch (CONN_GET_STATE(conn)) {
 		case CONN_READY:
@@ -357,11 +356,27 @@ MYSQLND_METHOD(mysqlnd_conn_data, simple_command)(MYSQLND_CONN_DATA * conn, enum
 		CONN_SET_STATE(conn, CONN_QUIT_SENT);
 		DBG_ERR("Server is gone");
 		ret = FAIL;
-	} else if (ok_packet != PROT_LAST) {
+	}
+	PACKET_FREE(cmd_packet);
+	DBG_RETURN(ret);
+}
+/* }}} */
+
+
+/* {{{ mysqlnd_conn_data::simple_command */
+static enum_func_status
+MYSQLND_METHOD(mysqlnd_conn_data, simple_command)(MYSQLND_CONN_DATA * conn, enum php_mysqlnd_server_command command,
+			   const zend_uchar * const arg, size_t arg_len, enum mysqlnd_packet_type ok_packet, zend_bool silent,
+			   zend_bool ignore_upsert_status TSRMLS_DC)
+{
+	enum_func_status ret;
+	DBG_ENTER("mysqlnd_conn_data::simple_command");
+
+	ret = conn->m->simple_command_send_request(conn, command, arg, arg_len, silent, ignore_upsert_status TSRMLS_CC);
+	if (PASS == ret && ok_packet != PROT_LAST) {
 		ret = conn->m->simple_command_handle_response(conn, ok_packet, silent, command, ignore_upsert_status TSRMLS_CC);
 	}
 
-	PACKET_FREE(cmd_packet);
 	DBG_INF(ret == PASS ? "PASS":"FAIL");
 	DBG_RETURN(ret);
 }
@@ -472,132 +487,150 @@ end:
 /* }}} */
 
 
-/* {{{ mysqlnd_connect_run_authentication */
+/* {{{ mysqlnd_conn_data::fetch_auth_plugin_by_name */
+static struct st_mysqlnd_authentication_plugin *
+MYSQLND_METHOD(mysqlnd_conn_data, fetch_auth_plugin_by_name)(const char * const requested_protocol TSRMLS_DC)
+{
+	struct st_mysqlnd_authentication_plugin * auth_plugin;
+	char * plugin_name = NULL;
+	DBG_ENTER("mysqlnd_conn_data::fetch_auth_plugin_by_name");
+
+	mnd_sprintf(&plugin_name, 0, "auth_plugin_%s", requested_protocol);
+	DBG_INF_FMT("looking for %s auth plugin", plugin_name);
+	auth_plugin = mysqlnd_plugin_find(plugin_name);
+	mnd_sprintf_free(plugin_name);
+
+	DBG_RETURN(auth_plugin);
+}
+/* }}} */
+
+
+/* {{{ mysqlnd_run_authentication */
 static enum_func_status
-mysqlnd_connect_run_authentication(
+mysqlnd_run_authentication(
 			MYSQLND_CONN_DATA * conn,
 			const char * const user,
 			const char * const passwd,
+			const size_t passwd_len,
 			const char * const db,
-			size_t db_len,
-			size_t passwd_len,
-			const MYSQLND_PACKET_GREET * const greet_packet,
+			const size_t db_len,
+			const zend_uchar * const auth_plugin_data,
+			const size_t auth_plugin_data_len,
+			const char * const auth_protocol,
+			unsigned int charset_no,
 			const MYSQLND_OPTIONS * const options,
-			unsigned long mysql_flags
+			unsigned long mysql_flags,
+			zend_bool silent,
+			zend_bool is_change_user
 			TSRMLS_DC)
 {
 	enum_func_status ret = FAIL;
-	DBG_ENTER("mysqlnd_connect_run_authentication");
+	zend_bool first_call = TRUE;
 
-	ret = mysqlnd_switch_to_ssl_if_needed(conn, greet_packet, options, mysql_flags TSRMLS_CC);
-	if (PASS == ret) {
-		zend_bool first_call = TRUE;
+	char * switch_to_auth_protocol = NULL;
+	size_t switch_to_auth_protocol_len = 0;
+	char * requested_protocol = NULL;
+	zend_uchar * plugin_data;
+	size_t plugin_data_len;
 
-		char * switch_to_auth_protocol = NULL;
-		size_t switch_to_auth_protocol_len = 0;
-		char * requested_protocol = NULL;
-		zend_uchar * plugin_data;
-		size_t plugin_data_len;
+	DBG_ENTER("mysqlnd_run_authentication");
 
-		plugin_data_len = greet_packet->auth_plugin_data_len;
-		plugin_data = mnd_emalloc(plugin_data_len + 1);
-		if (!plugin_data) {
-			ret = FAIL;
-			goto end;
-		}
-		memcpy(plugin_data, greet_packet->auth_plugin_data, plugin_data_len);
-		plugin_data[plugin_data_len] = '\0';
+	plugin_data_len = auth_plugin_data_len;
+	plugin_data = mnd_emalloc(plugin_data_len + 1);
+	if (!plugin_data) {
+		goto end;
+	}
+	memcpy(plugin_data, auth_plugin_data, plugin_data_len);
+	plugin_data[plugin_data_len] = '\0';
 
-		requested_protocol = mnd_pestrdup(greet_packet->auth_protocol? greet_packet->auth_protocol: "mysql_native_password", FALSE);
-		if (!requested_protocol) {
-			ret = FAIL;
+	requested_protocol = mnd_pestrdup(auth_protocol? auth_protocol : MYSQLND_DEFAULT_AUTH_PROTOCOL, FALSE);
+	if (!requested_protocol) {
+		goto end;
+	}
+
+	do {
+		struct st_mysqlnd_authentication_plugin * auth_plugin = conn->m->fetch_auth_plugin_by_name(requested_protocol TSRMLS_CC);
+
+		if (!auth_plugin) {
+			php_error_docref(NULL TSRMLS_CC, E_WARNING, "The server requested authentication method unknown to the client [%s]", requested_protocol);
+			SET_CLIENT_ERROR(*conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, "The server requested authentication method umknown to the client");
 			goto end;
 		}
+		DBG_INF("plugin found");
 
-		do {
-			struct st_mysqlnd_authentication_plugin * auth_plugin;
-			{
-				char * plugin_name = NULL;
-
-				mnd_sprintf(&plugin_name, 0, "auth_plugin_%s", requested_protocol);
+		{
+			zend_uchar * switch_to_auth_protocol_data = NULL;
+			size_t switch_to_auth_protocol_data_len = 0;
+			zend_uchar * scrambled_data = NULL;
+			size_t scrambled_data_len = 0;
 
-				DBG_INF_FMT("looking for %s auth plugin", plugin_name);
-				auth_plugin = mysqlnd_plugin_find(plugin_name);
-				mnd_sprintf_free(plugin_name);
+			switch_to_auth_protocol = NULL;
+			switch_to_auth_protocol_len = 0;
 
-				if (!auth_plugin) {
-					php_error_docref(NULL TSRMLS_CC, E_WARNING, "The server requested authentication method unknown to the client [%s]", requested_protocol);
-					SET_CLIENT_ERROR(*conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, "The server requested authentication method umknown to the client");
-					break;
-				}
+			if (conn->auth_plugin_data) {
+				mnd_pefree(conn->auth_plugin_data, conn->persistent);
+				conn->auth_plugin_data = NULL;
 			}
-			DBG_INF("plugin found");
-
-			{
-				zend_uchar * switch_to_auth_protocol_data = NULL;
-				size_t switch_to_auth_protocol_data_len = 0;
-				zend_uchar * scrambled_data = NULL;
-				size_t scrambled_data_len = 0;
-
-				switch_to_auth_protocol = NULL;
-				switch_to_auth_protocol_len = 0;
-
-				if (conn->auth_plugin_data) {
-					mnd_pefree(conn->auth_plugin_data, conn->persistent);
-					conn->auth_plugin_data = NULL;
-				}
-				conn->auth_plugin_data_len = plugin_data_len;
-				conn->auth_plugin_data = mnd_pemalloc(conn->auth_plugin_data_len, conn->persistent);
-				if (!conn->auth_plugin_data) {
-					SET_OOM_ERROR(*conn->error_info);
-					goto end;
-				}
-				memcpy(conn->auth_plugin_data, plugin_data, plugin_data_len);
-
-				DBG_INF_FMT("salt=[%*s]", plugin_data_len - 1, plugin_data);
-				/* The data should be allocated with malloc() */
-				scrambled_data =
-					auth_plugin->methods.get_auth_data(NULL, &scrambled_data_len, conn, user, passwd, passwd_len,
-													   plugin_data, plugin_data_len, options, mysql_flags TSRMLS_CC);
+			conn->auth_plugin_data_len = plugin_data_len;
+			conn->auth_plugin_data = mnd_pemalloc(conn->auth_plugin_data_len, conn->persistent);
+			if (!conn->auth_plugin_data) {
+				SET_OOM_ERROR(*conn->error_info);
+				goto end;
+			}
+			memcpy(conn->auth_plugin_data, plugin_data, plugin_data_len);
 
+			DBG_INF_FMT("salt=[%*s]", plugin_data_len - 1, plugin_data);
+			/* The data should be allocated with malloc() */
+			scrambled_data =
+				auth_plugin->methods.get_auth_data(NULL, &scrambled_data_len, conn, user, passwd, passwd_len,
+												   plugin_data, plugin_data_len, options, mysql_flags TSRMLS_CC);
 
+			if (FALSE == is_change_user) {
 				ret = mysqlnd_auth_handshake(conn, user, passwd, passwd_len, db, db_len, options, mysql_flags,
-											greet_packet->charset_no,
+											charset_no,
 											first_call,
 											requested_protocol,
 											scrambled_data, scrambled_data_len,
 											&switch_to_auth_protocol, &switch_to_auth_protocol_len,
 											&switch_to_auth_protocol_data, &switch_to_auth_protocol_data_len
 											TSRMLS_CC);
-				first_call = FALSE;
-				free(scrambled_data);
+			} else {
+				ret = mysqlnd_auth_change_user(conn, user, strlen(user), passwd, passwd_len, db, db_len, silent,
+											   first_call,
+											   requested_protocol,
+											   scrambled_data, scrambled_data_len,
+											   &switch_to_auth_protocol, &switch_to_auth_protocol_len,
+											   &switch_to_auth_protocol_data, &switch_to_auth_protocol_data_len
+											   TSRMLS_CC);				
+			}
+			first_call = FALSE;
+			free(scrambled_data);
 
-				DBG_INF_FMT("switch_to_auth_protocol=%s", switch_to_auth_protocol? switch_to_auth_protocol:"n/a");
-				if (requested_protocol && switch_to_auth_protocol) {
-					mnd_efree(requested_protocol);
-					requested_protocol = switch_to_auth_protocol;
-				}
+			DBG_INF_FMT("switch_to_auth_protocol=%s", switch_to_auth_protocol? switch_to_auth_protocol:"n/a");
+			if (requested_protocol && switch_to_auth_protocol) {
+				mnd_efree(requested_protocol);
+				requested_protocol = switch_to_auth_protocol;
+			}
 
-				if (plugin_data) {
-					mnd_efree(plugin_data);
-				}
-				plugin_data_len = switch_to_auth_protocol_data_len;
-				plugin_data = switch_to_auth_protocol_data;
+			if (plugin_data) {
+				mnd_efree(plugin_data);
 			}
-			DBG_INF_FMT("conn->error_info->error_no = %d", conn->error_info->error_no);
-		} while (ret == FAIL && conn->error_info->error_no == 0 && switch_to_auth_protocol != NULL);
-		if (plugin_data) {
-			mnd_efree(plugin_data);
+			plugin_data_len = switch_to_auth_protocol_data_len;
+			plugin_data = switch_to_auth_protocol_data;
 		}
+		DBG_INF_FMT("conn->error_info->error_no = %d", conn->error_info->error_no);
+	} while (ret == FAIL && conn->error_info->error_no == 0 && switch_to_auth_protocol != NULL);
+	if (plugin_data) {
+		mnd_efree(plugin_data);
+	}
 		
-		if (ret == PASS) {
-			DBG_INF_FMT("saving requested_protocol=%s", requested_protocol);
-			conn->m->set_client_option(conn, MYSQLND_OPT_AUTH_PROTOCOL, requested_protocol TSRMLS_CC);
-		}
+	if (ret == PASS) {
+		DBG_INF_FMT("saving requested_protocol=%s", requested_protocol);
+		conn->m->set_client_option(conn, MYSQLND_OPT_AUTH_PROTOCOL, requested_protocol TSRMLS_CC);
+	}
 
-		if (requested_protocol) {
-			mnd_efree(requested_protocol);
-		}
+	if (requested_protocol) {
+		mnd_efree(requested_protocol);
 	}
 end:
 	DBG_RETURN(ret);
@@ -605,6 +638,34 @@ end:
 /* }}} */
 
 
+/* {{{ mysqlnd_connect_run_authentication */
+static enum_func_status
+mysqlnd_connect_run_authentication(
+			MYSQLND_CONN_DATA * conn,
+			const char * const user,
+			const char * const passwd,
+			const char * const db,
+			size_t db_len,
+			size_t passwd_len,
+			const MYSQLND_PACKET_GREET * const greet_packet,
+			const MYSQLND_OPTIONS * const options,
+			unsigned long mysql_flags
+			TSRMLS_DC)
+{
+	enum_func_status ret = FAIL;
+	DBG_ENTER("mysqlnd_connect_run_authentication");
+
+	ret = mysqlnd_switch_to_ssl_if_needed(conn, greet_packet, options, mysql_flags TSRMLS_CC);
+	if (PASS == ret) {
+		ret = mysqlnd_run_authentication(conn, user, passwd, passwd_len, db, db_len,
+										 greet_packet->auth_plugin_data, greet_packet->auth_plugin_data_len, greet_packet->auth_protocol,
+										 greet_packet->charset_no, options, mysql_flags, FALSE /*silent*/, FALSE/*is_change*/ TSRMLS_CC);
+	}
+	DBG_RETURN(ret);
+}
+/* }}} */
+
+
 /* {{{ mysqlnd_conn_data::execute_init_commands */
 static enum_func_status
 MYSQLND_METHOD(mysqlnd_conn_data, execute_init_commands)(MYSQLND_CONN_DATA * conn TSRMLS_DC)
@@ -2136,13 +2197,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, change_user)(MYSQLND_CONN_DATA * const conn,
 										  TSRMLS_DC)
 {
 	size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, change_user);
-	/*
-	  User could be max 16 * 3 (utf8), pass is 20 usually, db is up to 64*3
-	  Stack space is not that expensive, so use a bit more to be protected against
-	  buffer overflows.
-	*/
 	enum_func_status ret = FAIL;
-	zend_bool local_tx_started = FALSE;
 
 	DBG_ENTER("mysqlnd_conn_data::change_user");
 	DBG_INF_FMT("conn=%llu user=%s passwd=%s db=%s silent=%u",
@@ -2151,7 +2206,6 @@ MYSQLND_METHOD(mysqlnd_conn_data, change_user)(MYSQLND_CONN_DATA * const conn,
 	if (PASS != conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
 		goto end;
 	}
-	local_tx_started = TRUE;
 
 	SET_EMPTY_ERROR(*conn->error_info);
 	SET_ERROR_AFF_ROWS(conn);
@@ -2164,122 +2218,20 @@ MYSQLND_METHOD(mysqlnd_conn_data, change_user)(MYSQLND_CONN_DATA * const conn,
 	}
 	if (!db) {
 		db = "";
-	}
 
-	{
-		zend_bool first_call = TRUE;
-		char * switch_to_auth_protocol = NULL;
-		size_t switch_to_auth_protocol_len = 0;
-		char * requested_protocol = NULL;
-		zend_uchar * plugin_data;
-		size_t plugin_data_len;
-
-		plugin_data_len = conn->auth_plugin_data_len;
-		plugin_data = mnd_emalloc(plugin_data_len);
-		if (!plugin_data) {
-			ret = FAIL;
-			goto end;
-		}
-		memcpy(plugin_data, conn->auth_plugin_data, plugin_data_len);
-
-		requested_protocol = mnd_pestrdup(conn->options->auth_protocol? conn->options->auth_protocol:MYSQLND_DEFAULT_AUTH_PROTOCOL, FALSE);
-		if (!requested_protocol) {
-			ret = FAIL;
-			goto end;
-		}
-
-		do {
-			struct st_mysqlnd_authentication_plugin * auth_plugin;
-			{
-				char * plugin_name = NULL;
-
-				mnd_sprintf(&plugin_name, 0, "auth_plugin_%s", requested_protocol);
-
-				DBG_INF_FMT("looking for %s auth plugin", plugin_name);
-				auth_plugin = mysqlnd_plugin_find(plugin_name);
-				mnd_sprintf_free(plugin_name);
-
-				if (!auth_plugin) {
-					php_error_docref(NULL TSRMLS_CC, E_WARNING, "The server requested authentication method unknown to the client [%s]", requested_protocol);
-					SET_CLIENT_ERROR(*conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, "The server requested authentication method umknown to the client");
-					break;
-				}
-			}
-			DBG_INF("plugin found");
-
-			{
-				zend_uchar * switch_to_auth_protocol_data = NULL;
-				size_t switch_to_auth_protocol_data_len = 0;
-				zend_uchar * scrambled_data = NULL;
-				size_t scrambled_data_len = 0;
-
-				switch_to_auth_protocol = NULL;
-				switch_to_auth_protocol_len = 0;
-
-				if (conn->auth_plugin_data) {
-					mnd_pefree(conn->auth_plugin_data, conn->persistent);
-					conn->auth_plugin_data = NULL;
-				}
-				conn->auth_plugin_data_len = plugin_data_len;
-				conn->auth_plugin_data = mnd_pemalloc(conn->auth_plugin_data_len, conn->persistent);
-				if (!conn->auth_plugin_data) {
-					SET_OOM_ERROR(*conn->error_info);
-					ret = FAIL;
-					goto end;
-				}
-				memcpy(conn->auth_plugin_data, plugin_data, plugin_data_len);
-
-				DBG_INF_FMT("salt=[%*s]", plugin_data_len - 1, plugin_data);
-
-				/* The data should be allocated with malloc() */
-				scrambled_data =
-						auth_plugin->methods.get_auth_data(NULL, &scrambled_data_len, conn, user, passwd, passwd_len,
-														   plugin_data, plugin_data_len, 0, conn->server_capabilities TSRMLS_CC);
-
-
-				ret = mysqlnd_auth_change_user(conn, user, strlen(user), passwd, passwd_len, db, strlen(db), silent,
-											   first_call,
-											   requested_protocol,
-											   scrambled_data, scrambled_data_len,
-											   &switch_to_auth_protocol, &switch_to_auth_protocol_len,
-											   &switch_to_auth_protocol_data, &switch_to_auth_protocol_data_len
-											   TSRMLS_CC);
-
-				first_call = FALSE;
-				free(scrambled_data);
+	}
 
-				DBG_INF_FMT("switch_to_auth_protocol=%s", switch_to_auth_protocol? switch_to_auth_protocol:"n/a");
-				if (requested_protocol) {
-					mnd_efree(requested_protocol);
-				}
-				requested_protocol = switch_to_auth_protocol;
+	/* XXX: passwords that have \0 inside work during auth, but in this case won't work with change user */
+	ret = mysqlnd_run_authentication(conn, user, passwd, strlen(passwd), db, strlen(db),
+									conn->auth_plugin_data, conn->auth_plugin_data_len, conn->options->auth_protocol,
+									0 /*charset not used*/, conn->options, conn->server_capabilities, silent, TRUE/*is_change*/ TSRMLS_CC);
 
-				if (plugin_data) {
-					mnd_efree(plugin_data);
-				}
-				plugin_data_len = switch_to_auth_protocol_data_len;
-				plugin_data = switch_to_auth_protocol_data;
-			}
-			DBG_INF_FMT("conn->error_info->error_no = %d", conn->error_info->error_no);
-		} while (ret == FAIL && conn->error_info->error_no == 0 && switch_to_auth_protocol != NULL);
-		if (plugin_data) {
-			mnd_efree(plugin_data);
-		}
-		if (ret == PASS) {
-			conn->m->set_client_option(conn, MYSQLND_OPT_AUTH_PROTOCOL, requested_protocol TSRMLS_CC);
-		}
-		if (requested_protocol) {
-			mnd_efree(requested_protocol);
-		}
-	}
 	/*
 	  Here we should close all statements. Unbuffered queries should not be a
 	  problem as we won't allow sending COM_CHANGE_USER.
 	*/
+	conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);	
 end:
-	if (TRUE == local_tx_started) {
-		conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);	
-	}
 	DBG_INF(ret == PASS? "PASS":"FAIL");
 	DBG_RETURN(ret);
 }
@@ -2698,7 +2650,9 @@ MYSQLND_CLASS_METHODS_START(mysqlnd_conn_data)
 	MYSQLND_METHOD(mysqlnd_conn_data, local_tx_end),
 	MYSQLND_METHOD(mysqlnd_conn_data, execute_init_commands),
 	MYSQLND_METHOD(mysqlnd_conn_data, get_updated_connect_flags),
-	MYSQLND_METHOD(mysqlnd_conn_data, connect_handshake)
+	MYSQLND_METHOD(mysqlnd_conn_data, connect_handshake),
+	MYSQLND_METHOD(mysqlnd_conn_data, simple_command_send_request),
+	MYSQLND_METHOD(mysqlnd_conn_data, fetch_auth_plugin_by_name)	
 MYSQLND_CLASS_METHODS_END;
 
 
diff --git a/ext/mysqlnd/mysqlnd_structs.h b/ext/mysqlnd/mysqlnd_structs.h
index 4b3db99..856ebd2 100644
--- a/ext/mysqlnd/mysqlnd_structs.h
+++ b/ext/mysqlnd/mysqlnd_structs.h
@@ -476,7 +476,8 @@ typedef enum_func_status	(*func_mysqlnd_conn_data__local_tx_end)(MYSQLND_CONN_DA
 typedef enum_func_status	(*func_mysqlnd_conn_data__execute_init_commands)(MYSQLND_CONN_DATA * conn TSRMLS_DC);
 typedef unsigned int		(*func_mysqlnd_conn_data__get_updated_connect_flags)(MYSQLND_CONN_DATA * conn, unsigned int mysql_flags TSRMLS_DC);
 typedef enum_func_status	(*func_mysqlnd_conn_data__connect_handshake)(MYSQLND_CONN_DATA * conn, const char * const host, const char * const user, const char * const passwd, const unsigned int passwd_len, const char * const db, const unsigned int db_len, const unsigned int mysql_flags TSRMLS_DC);
-
+typedef enum_func_status	(*func_mysqlnd_conn_data__simple_command_send_request)(MYSQLND_CONN_DATA * conn, enum php_mysqlnd_server_command command, const zend_uchar * const arg, size_t arg_len, zend_bool silent, zend_bool ignore_upsert_status TSRMLS_DC);
+typedef struct st_mysqlnd_authentication_plugin * (*func_mysqlnd_conn_data__fetch_auth_plugin_by_name)(const char * const requested_protocol TSRMLS_DC);
 
 struct st_mysqlnd_conn_data_methods
 {
@@ -560,6 +561,8 @@ struct st_mysqlnd_conn_data_methods
 	func_mysqlnd_conn_data__execute_init_commands execute_init_commands;
 	func_mysqlnd_conn_data__get_updated_connect_flags get_updated_connect_flags;
 	func_mysqlnd_conn_data__connect_handshake connect_handshake;
+	func_mysqlnd_conn_data__simple_command_send_request simple_command_send_request;
+	func_mysqlnd_conn_data__fetch_auth_plugin_by_name fetch_auth_plugin_by_name;
 };
 
 


commit 5ebb0e520f4c31d09d9e5acd323162eca3fee0e3
Author: Stanislav Malyshev <stas at php.net>
Date:   Wed May 30 22:34:29 2012 -0700

    sort NEWS

diff --git a/NEWS b/NEWS
index d738ebe..4af38a3 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,44 @@
 PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+?? ??? 2012, PHP 5.4.5
+
+- Core:
+  . Fixed bug #61998 (Using traits with method aliases appears to result in
+    crash during execution). (Dmitry)
+
+- FPM
+  . Fixed bug #61045 (fpm don't send error log to fastcgi clients). (fat)
+  . Fixed bug #61835 (php-fpm is not allowed to run as root). (fat)
+  . Fixed bug #61295 (php-fpm should not fail with commented 'user'
+    for non-root start). (fat)
+  . Fixed bug #61839 (Unable to cross-compile PHP with --enable-fpm). (fat)
+  . Fixed bug #61026 (FPM pools can listen on the same address). (fat)
+  . Fixed bug #62033 (php-fpm exits with status 0 on some failures to start).
+    (fat)
+  . Fixed bug #62153 (when using unix sockets, multiples FPM instances
+    can be launched without errors). (fat)
+  . Fixed bug #62160 (Add process.priority to set nice(2) priorities). (fat)
+  . Fixed bug #61218 (FPM drops connection while receiving some binary values
+    in FastCGI requests). (fat)
+
+- Iconv:
+  . Fix bug #55042 (Erealloc in iconv.c unsafe). (Stas)
+
+- Intl
+  . ResourceBundle constructor now accepts NULL for the first two arguments.
+    (Gustavo)
+
+- Readline:
+  . Fixed bug #62186 (readline fails to compile - void function should not
+    return a value). (Johannes)
+
+- Sockets:
+  . Fixed bug #62025 (__ss_family was changed on AIX 5.3). (Felipe)
+    
+- XML Writer:
+  . Fixed bug #62064 (memory leak in the XML Writer module). 
+    (jean-pierre dot lozi at lip6 dot fr)
+
 ?? ??? 2012, PHP 5.4.4
 
 - COM:
@@ -21,10 +60,9 @@ PHP                                                                        NEWS
 - Core:
   . Fixed missing bound check in iptcparse(). (chris at chiappa.net)
   . Fixed CVE-2012-2143. (Solar Designer)
+  . Fixed bug #62097 (fix for for bug #54547). (Gustavo)
   . Fixed bug #62005 (unexpected behavior when incrementally assigning to a 
     member of a null object). (Laruence)
-  . Fixed bug #61998 (Using traits with method aliases appears to result in
-    crash during execution). (Dmitry)
   . Fixed bug #61978 (Object recursion not detected for classes that implement
     JsonSerializable). (Felipe)
   . Fixed bug #61991 (long overflow in realpath_cache_get()). (Anatoliy)
@@ -58,24 +96,7 @@ PHP                                                                        NEWS
   . Fixed bug #61812 (Uninitialised value used in libmagic). 
     (Laruence, Gustavo)
 
-- FPM
-  . Fixed bug #61045 (fpm don't send error log to fastcgi clients). (fat)
-  . Fixed bug #61835 (php-fpm is not allowed to run as root). (fat)
-  . Fixed bug #61295 (php-fpm should not fail with commented 'user'
-    for non-root start). (fat)
-  . Fixed bug #61839 (Unable to cross-compile PHP with --enable-fpm). (fat)
-  . Fixed bug #61026 (FPM pools can listen on the same address). (fat)
-  . Fixed bug #62033 (php-fpm exits with status 0 on some failures to start).
-    (fat)
-  . Fixed bug #62153 (when using unix sockets, multiples FPM instances
-    can be launched without errors). (fat)
-  . Fixed bug #62160 (Add process.priority to set nice(2) priorities). (fat)
-  . Fixed bug #61218 (FPM drops connection while receiving some binary values
-    in FastCGI requests). (fat)
-
 - Intl
-  . ResourceBundle constructor now accepts NULL for the first two arguments.
-    (Gustavo)
   . Fixed bug #62082 (Memory corruption in internal function 
     get_icu_disp_value_src_php()). (Gustavo)
 
@@ -83,17 +104,6 @@ PHP                                                                        NEWS
   . Fixed bug #61617 (Libxml tests failed(ht is already destroyed)).
     (Laruence)
 
-- Readline:
-  . Fixed bug #62186 (readline fails to compile - void function should not
-    return a value). (Johannes)
-
-- Sockets:
-  . Fixed bug #62025 (__ss_family was changed on AIX 5.3). (Felipe)
-    
-- XML Writer:
-  . Fixed bug #62064 (memory leak in the XML Writer module). 
-    (jean-pierre dot lozi at lip6 dot fr)
-
 - Zlib:
   . Fixed bug #61820 (using ob_gzhandler will complain about headers already 
     sent when no compression). (Mike)


commit 0c658c39f6b44438715a6185b6a22a793652dc0c
Merge: 33849c2 ed6ce83
Author: Stanislav Malyshev <stas at php.net>
Date:   Wed May 30 22:27:54 2012 -0700

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      fix bug #55042 - erealloc without updating pointer



commit ed6ce831013d8c6f6f585e814ee9b542da283749
Author: Stanislav Malyshev <stas at php.net>
Date:   Wed May 30 22:26:26 2012 -0700

    fix bug #55042 - erealloc without updating pointer

diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index 92675eb..9cae535 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -190,7 +190,7 @@ typedef enum _php_iconv_enc_scheme_t {
 #define PHP_ICONV_MIME_DECODE_STRICT            (1<<0)
 #define PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR (1<<1)
 
-/* {{{ prototypes */ 
+/* {{{ prototypes */
 static php_iconv_err_t _php_iconv_appendl(smart_str *d, const char *s, size_t l, iconv_t cd);
 static php_iconv_err_t _php_iconv_appendc(smart_str *d, const char c, iconv_t cd);
 
@@ -249,7 +249,7 @@ PHP_MINIT_FUNCTION(miconv)
 	{
 		static char buf[16];
 		snprintf(buf, sizeof(buf), "%d.%d",
-		    ((_libiconv_version >> 8) & 0x0f), (_libiconv_version & 0x0f)); 
+		    ((_libiconv_version >> 8) & 0x0f), (_libiconv_version & 0x0f));
 		version = buf;
 	}
 #elif HAVE_GLIBC_ICONV
@@ -354,7 +354,7 @@ static int php_iconv_output_handler(void **nothing, php_output_context *output_c
 
 		if (mimetype != NULL && !(output_context->op & PHP_OUTPUT_HANDLER_CLEAN)) {
 			int len;
-			char *p = strstr(ICONVG(output_encoding), "//"); 
+			char *p = strstr(ICONVG(output_encoding), "//");
 
 			if (p) {
 				len = spprintf(&content_type, 0, "Content-Type:%.*s; charset=%.*s", mimetype_len ? mimetype_len : (int) strlen(mimetype), mimetype, (int)(p - ICONVG(output_encoding)), ICONVG(output_encoding));
@@ -375,7 +375,7 @@ static int php_iconv_output_handler(void **nothing, php_output_context *output_c
 
 	return SUCCESS;
 }
-       
+
 /* {{{ _php_iconv_appendl() */
 static php_iconv_err_t _php_iconv_appendl(smart_str *d, const char *s, size_t l, iconv_t cd)
 {
@@ -400,7 +400,7 @@ static php_iconv_err_t _php_iconv_appendl(smart_str *d, const char *s, size_t l,
 
 			if (iconv(cd, (char **)&in_p, &in_left, (char **) &out_p, &out_left) == (size_t)-1) {
 #if ICONV_SUPPORTS_ERRNO
-				switch (errno) { 
+				switch (errno) {
 					case EINVAL:
 						return PHP_ICONV_ERR_ILLEGAL_CHAR;
 
@@ -415,7 +415,7 @@ static php_iconv_err_t _php_iconv_appendl(smart_str *d, const char *s, size_t l,
 				}
 #else
 				if (prev_in_left == in_left) {
-					return PHP_ICONV_ERR_UNKNOWN;		
+					return PHP_ICONV_ERR_UNKNOWN;
 				}
 #endif
 			}
@@ -446,7 +446,7 @@ static php_iconv_err_t _php_iconv_appendl(smart_str *d, const char *s, size_t l,
 #else
 				if (out_left != 0) {
 					return PHP_ICONV_ERR_UNKNOWN;
-				}	
+				}
 #endif
 			}
 			(d)->len += (buf_growth - out_left);
@@ -492,31 +492,35 @@ PHP_ICONV_API php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
 	in_size = in_len;
 
 	cd = iconv_open(out_charset, in_charset);
-	
+
 	if (cd == (iconv_t)(-1)) {
 		return PHP_ICONV_ERR_UNKNOWN;
 	}
 
 	out_buffer = (char *) emalloc(out_size + 1);
 	out_p = out_buffer;
-	
+
 #ifdef NETWARE
 	result = iconv(cd, (char **) &in_p, &in_size, (char **)
 #else
 	result = iconv(cd, (const char **) &in_p, &in_size, (char **)
 #endif
 				&out_p, &out_left);
-	
+
 	if (result == (size_t)(-1)) {
 		efree(out_buffer);
 		return PHP_ICONV_ERR_UNKNOWN;
 	}
 
 	if (out_left < 8) {
-		out_buffer = (char *) erealloc(out_buffer, out_size + 8);
+		size_t pos = out_p - out_buffer;
+		out_buffer = (char *) safe_erealloc(out_buffer, out_size, 1, 8);
+		out_p = out_buffer+pos;
+		out_size += 7;
+		out_left += 7;
 	}
 
-	/* flush the shift-out sequences */ 
+	/* flush the shift-out sequences */
 	result = iconv(cd, NULL, NULL, &out_p, &out_left);
 
 	if (result == (size_t)(-1)) {
@@ -555,10 +559,10 @@ PHP_ICONV_API php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
 		}
 	}
 	in_left= in_len;
-	out_left = in_len + 32; /* Avoid realloc() most cases */ 
+	out_left = in_len + 32; /* Avoid realloc() most cases */
 	out_size = 0;
 	bsz = out_left;
-	out_buf = (char *) emalloc(bsz+1); 
+	out_buf = (char *) emalloc(bsz+1);
 	out_p = out_buf;
 
 	while (in_left > 0) {
@@ -573,14 +577,14 @@ PHP_ICONV_API php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
 				out_p = out_buf = tmp_buf;
 				out_p += out_size;
 				out_left = bsz - out_size;
-				continue;	
+				continue;
 			}
 		}
 		break;
 	}
 
 	if (result != (size_t)(-1)) {
-		/* flush the shift-out sequences */ 
+		/* flush the shift-out sequences */
 		for (;;) {
 		   	result = iconv(cd, NULL, NULL, (char **) &out_p, &out_left);
 			out_size = bsz - out_left;
@@ -592,7 +596,7 @@ PHP_ICONV_API php_iconv_err_t php_iconv_string(const char *in_p, size_t in_len,
 			if (errno == E2BIG) {
 				bsz += 16;
 				tmp_buf = (char *) erealloc(out_buf, bsz);
-				
+
 				out_p = out_buf = tmp_buf;
 				out_p += out_size;
 				out_left = bsz - out_size;
@@ -684,7 +688,7 @@ static php_iconv_err_t _php_iconv_strlen(unsigned int *pretval, const char *str,
 	}
 
 	if (out_left > 0) {
-		cnt -= out_left / GENERIC_SUPERSET_NBYTES; 
+		cnt -= out_left / GENERIC_SUPERSET_NBYTES;
 	}
 
 #if ICONV_SUPPORTS_ERRNO
@@ -735,12 +739,12 @@ static php_iconv_err_t _php_iconv_substr(smart_str *pretval,
 
 	unsigned int cnt;
 	int total_len;
-	
+
 	err = _php_iconv_strlen(&total_len, str, nbytes, enc);
 	if (err != PHP_ICONV_ERR_SUCCESS) {
 		return err;
 	}
-	
+
 	if (len < 0) {
 		if ((len += (total_len - offset)) < 0) {
 			return PHP_ICONV_ERR_SUCCESS;
@@ -772,7 +776,7 @@ static php_iconv_err_t _php_iconv_substr(smart_str *pretval,
 		smart_str_0(pretval);
 		return PHP_ICONV_ERR_SUCCESS;
 	}
-	
+
 	cd1 = iconv_open(GENERIC_SUPERSET_NAME, enc);
 
 	if (cd1 == (iconv_t)(-1)) {
@@ -857,7 +861,7 @@ static php_iconv_err_t _php_iconv_substr(smart_str *pretval,
 
 	if (cd2 != (iconv_t)NULL) {
 		iconv_close(cd2);
-	}	
+	}
 	return err;
 }
 
@@ -1042,7 +1046,7 @@ static php_iconv_err_t _php_iconv_strpos(unsigned int *pretval,
 	if (ndl_buf) {
 		efree(ndl_buf);
 	}
-	
+
 	iconv_close(cd);
 
 	return err;
@@ -1089,7 +1093,7 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn
 	if ((fname_nbytes + 2) >= max_line_len
 		|| (out_charset_len + 12) >= max_line_len) {
 		/* field name is too long */
-		err = PHP_ICONV_ERR_TOO_BIG; 
+		err = PHP_ICONV_ERR_TOO_BIG;
 		goto out;
 	}
 
@@ -1131,7 +1135,7 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn
 	char_cnt -= 2;
 
 	in_p = fval;
-	in_left = fval_nbytes; 
+	in_left = fval_nbytes;
 
 	do {
 		size_t prev_in_left;
@@ -1142,8 +1146,8 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn
 			smart_str_appendl(pretval, lfchars, lfchars_len);
 			smart_str_appendc(pretval, ' ');
 			char_cnt = max_line_len - 1;
-		} 
- 
+		}
+
 		smart_str_appendl(pretval, "=?", sizeof("=?") - 1);
 		char_cnt -= 2;
 		smart_str_appendl(pretval, out_charset, out_charset_len);
@@ -1195,7 +1199,7 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn
 									goto out;
 								}
 								break;
-	
+
 							default:
 								err = PHP_ICONV_ERR_UNKNOWN;
 								goto out;
@@ -1295,7 +1299,7 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn
 									goto out;
 								}
 								break;
-	
+
 							default:
 								err = PHP_ICONV_ERR_UNKNOWN;
 								goto out;
@@ -1372,7 +1376,7 @@ out:
 	}
 	if (encoded != NULL) {
 		efree(encoded);
-	}	
+	}
 	if (buf != NULL) {
 		efree(buf);
 	}
@@ -1391,7 +1395,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
 	size_t str_left;
 	unsigned int scan_stat = 0;
 	const char *csname = NULL;
-	size_t csname_len; 
+	size_t csname_len;
 	const char *encoded_text = NULL;
 	size_t encoded_text_len = 0;
 	const char *encoded_word = NULL;
@@ -1430,7 +1434,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
 						break;
 
 					case '\n':
-						scan_stat = 8;	
+						scan_stat = 8;
 						break;
 
 					case '=': /* first letter of an encoded chunk */
@@ -1455,7 +1459,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
 
 			case 1: /* expecting a delimiter */
 				if (*p1 != '?') {
-					err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); 
+					err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
 					if (err != PHP_ICONV_ERR_SUCCESS) {
 						goto out;
 					}
@@ -1470,7 +1474,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
 				csname = p1 + 1;
 				scan_stat = 2;
 				break;
-			
+
 			case 2: /* expecting a charset name */
 				switch (*p1) {
 					case '?': /* normal delimiter: encoding scheme follows */
@@ -1480,7 +1484,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
 					case '*': /* new style delimiter: locale id follows */
 						scan_stat = 10;
 						break;
-				} 
+				}
 				if (scan_stat != 2) {
 					char tmpbuf[80];
 
@@ -1493,7 +1497,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
 
 					if (csname_len > sizeof(tmpbuf) - 1) {
 						if ((mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR)) {
-							err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); 
+							err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
 							if (err != PHP_ICONV_ERR_SUCCESS) {
 								goto out;
 							}
@@ -1549,7 +1553,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
 								--str_left;
 							}
 
-							err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); 
+							err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
 							if (err != PHP_ICONV_ERR_SUCCESS) {
 								goto out;
 							}
@@ -1608,12 +1612,12 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
 						}
 				}
 				break;
-		
+
 			case 4: /* expecting a delimiter */
 				if (*p1 != '?') {
 					if ((mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR)) {
 						/* pass the entire chunk through the converter */
-						err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); 
+						err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
 						if (err != PHP_ICONV_ERR_SUCCESS) {
 							goto out;
 						}
@@ -1669,7 +1673,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
 				if (*p1 != '=') {
 					if ((mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR)) {
 						/* pass the entire chunk through the converter */
-						err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); 
+						err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
 						if (err != PHP_ICONV_ERR_SUCCESS) {
 							goto out;
 						}
@@ -1696,17 +1700,17 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
 				switch (*p1) {
 					default:
 						/* Handle non-RFC-compliant formats
-						 * 
+						 *
 						 * RFC2047 requires the character that comes right
 						 * after an encoded word (chunk) to be a whitespace,
 						 * while there are lots of broken implementations that
 						 * generate such malformed headers that don't fulfill
 						 * that requirement.
-						 */ 
-						if (!eos) { 
+						 */
+						if (!eos) {
 							if ((mode & PHP_ICONV_MIME_DECODE_STRICT)) {
 								/* pass the entire chunk through the converter */
-								err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); 
+								err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
 								if (err != PHP_ICONV_ERR_SUCCESS) {
 									goto out;
 								}
@@ -1738,7 +1742,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
 						if (decoded_text == NULL) {
 							if ((mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR)) {
 								/* pass the entire chunk through the converter */
-								err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl); 
+								err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
 								if (err != PHP_ICONV_ERR_SUCCESS) {
 									goto out;
 								}
@@ -1761,7 +1765,7 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
 						if (err != PHP_ICONV_ERR_SUCCESS) {
 							if ((mode & PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR)) {
 								/* pass the entire chunk through the converter */
-								err = _php_iconv_appendl(pretval, encoded_word, (size_t)(p1 - encoded_word), cd_pl); 
+								err = _php_iconv_appendl(pretval, encoded_word, (size_t)(p1 - encoded_word), cd_pl);
 								encoded_word = NULL;
 								if (err != PHP_ICONV_ERR_SUCCESS) {
 									break;
@@ -1956,7 +1960,7 @@ PHP_FUNCTION(iconv_strlen)
 	char *charset = ICONVG(internal_encoding);
 	int charset_len = 0;
 	char *str;
-	int str_len; 
+	int str_len;
 
 	php_iconv_err_t err;
 
@@ -1972,7 +1976,7 @@ PHP_FUNCTION(iconv_strlen)
 		RETURN_FALSE;
 	}
 
-	err = _php_iconv_strlen(&retval, str, str_len, charset); 
+	err = _php_iconv_strlen(&retval, str, str_len, charset);
 	_php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC);
 	if (err == PHP_ICONV_ERR_SUCCESS) {
 		RETVAL_LONG(retval);
@@ -1989,7 +1993,7 @@ PHP_FUNCTION(iconv_substr)
 	char *charset = ICONVG(internal_encoding);
 	int charset_len = 0;
 	char *str;
-	int str_len; 
+	int str_len;
 	long offset, length = 0;
 
 	php_iconv_err_t err;
@@ -2008,10 +2012,10 @@ PHP_FUNCTION(iconv_substr)
 	}
 
 	if (ZEND_NUM_ARGS() < 3) {
-		length = str_len; 
+		length = str_len;
 	}
 
-	err = _php_iconv_substr(&retval, str, str_len, offset, length, charset); 
+	err = _php_iconv_substr(&retval, str, str_len, offset, length, charset);
 	_php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC);
 
 	if (err == PHP_ICONV_ERR_SUCCESS && str != NULL && retval.c != NULL) {
@@ -2029,7 +2033,7 @@ PHP_FUNCTION(iconv_strpos)
 	char *charset = ICONVG(internal_encoding);
 	int charset_len = 0;
 	char *haystk;
-	int haystk_len; 
+	int haystk_len;
 	char *ndl;
 	int ndl_len;
 	long offset = 0;
@@ -2059,7 +2063,7 @@ PHP_FUNCTION(iconv_strpos)
 	}
 
 	err = _php_iconv_strpos(&retval, haystk, haystk_len, ndl, ndl_len,
-	                        offset, charset); 
+	                        offset, charset);
 	_php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC);
 
 	if (err == PHP_ICONV_ERR_SUCCESS && retval != (unsigned int)-1) {
@@ -2077,7 +2081,7 @@ PHP_FUNCTION(iconv_strrpos)
 	char *charset = ICONVG(internal_encoding);
 	int charset_len = 0;
 	char *haystk;
-	int haystk_len; 
+	int haystk_len;
 	char *ndl;
 	int ndl_len;
 
@@ -2101,7 +2105,7 @@ PHP_FUNCTION(iconv_strrpos)
 	}
 
 	err = _php_iconv_strpos(&retval, haystk, haystk_len, ndl, ndl_len,
-	                        -1, charset); 
+	                        -1, charset);
 	_php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC);
 
 	if (err == PHP_ICONV_ERR_SUCCESS && retval != (unsigned int)-1) {
@@ -2241,7 +2245,7 @@ PHP_FUNCTION(iconv_mime_decode)
 	char *charset = ICONVG(internal_encoding);
 	int charset_len = 0;
 	long mode = 0;
-	
+
 	smart_str retval = {0};
 
 	php_iconv_err_t err;
@@ -2282,7 +2286,7 @@ PHP_FUNCTION(iconv_mime_decode_headers)
 	char *charset = ICONVG(internal_encoding);
 	int charset_len = 0;
 	long mode = 0;
-	
+
 	php_iconv_err_t err = PHP_ICONV_ERR_SUCCESS;
 
 	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ls",
@@ -2350,14 +2354,14 @@ PHP_FUNCTION(iconv_mime_decode_headers)
 					zend_hash_update(Z_ARRVAL_P(return_value), header_name, header_name_len, (void *)&new_elem, sizeof(new_elem), NULL);
 
 					elem = &new_elem;
-				}	
+				}
 				add_next_index_stringl(*elem, header_value, header_value_len, 1);
 			} else {
 				add_assoc_stringl_ex(return_value, header_name, header_name_len, header_value, header_value_len, 1);
 			}
 		}
 		encoded_str_len -= next_pos - encoded_str;
-		encoded_str = next_pos;	
+		encoded_str = next_pos;
 
 		smart_str_free(&decoded_header);
 	}
@@ -2378,7 +2382,7 @@ PHP_NAMED_FUNCTION(php_if_iconv)
 	size_t out_len;
 	int in_charset_len = 0, out_charset_len = 0, in_buffer_len;
 	php_iconv_err_t err;
-	
+
 	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss",
 		&in_charset, &in_charset_len, &out_charset, &out_charset_len, &in_buffer, &in_buffer_len) == FAILURE)
 		return;
@@ -2390,7 +2394,7 @@ PHP_NAMED_FUNCTION(php_if_iconv)
 
 	err = php_iconv_string(in_buffer, (size_t)in_buffer_len,
 		&out_buffer, &out_len, out_charset, in_charset);
-	_php_iconv_show_error(err, out_charset, in_charset TSRMLS_CC); 
+	_php_iconv_show_error(err, out_charset, in_charset TSRMLS_CC);
 	if (err == PHP_ICONV_ERR_SUCCESS && out_buffer != NULL) {
 		RETVAL_STRINGL(out_buffer, out_len, 0);
 	} else {
@@ -2539,7 +2543,7 @@ static int php_iconv_stream_filter_append_bucket(
 		icnt = buf_len;
 	}
 
-	out_buf_size = ocnt = prev_ocnt = initial_out_buf_size; 
+	out_buf_size = ocnt = prev_ocnt = initial_out_buf_size;
 	if (NULL == (out_buf = pemalloc(out_buf_size, persistent))) {
 		return FAILURE;
 	}


commit 33849c2211891cc69d26b3633412635016d05626
Merge: 5653289 303dd7f
Author: Johannes Schlüter <johannes at php.net>
Date:   Thu May 31 01:18:02 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug #62186 readline fails to compile
      fix unchecked emalloc (cherry picked from commit 158d8a6b088662ce9d31e0c777c6ebe90efdc854)



commit 303dd7f3469106f8cd91a8648de1c4fed51374b3
Merge: 428dddd fa05f03
Author: Johannes Schlüter <johannes at php.net>
Date:   Thu May 31 01:16:42 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      fix unchecked emalloc (cherry picked from commit 158d8a6b088662ce9d31e0c777c6ebe90efdc854)



commit 428dddd3e8dc8abaf99e22cf6ecf2cff00378fe5
Author: Johannes Schlüter <johannes at php.net>
Date:   Thu May 31 01:15:22 2012 +0200

    Fix bug #62186 readline fails to compile

diff --git a/NEWS b/NEWS
index 898325a..d738ebe 100644
--- a/NEWS
+++ b/NEWS
@@ -82,7 +82,11 @@ PHP                                                                        NEWS
 - Libxml:
   . Fixed bug #61617 (Libxml tests failed(ht is already destroyed)).
     (Laruence)
-    
+
+- Readline:
+  . Fixed bug #62186 (readline fails to compile - void function should not
+    return a value). (Johannes)
+
 - Sockets:
   . Fixed bug #62025 (__ss_family was changed on AIX 5.3). (Felipe)
     
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 1054b0e..92236a5 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -198,7 +198,7 @@ PHP_RSHUTDOWN_FUNCTION(readline)
 
 PHP_MINFO_FUNCTION(readline)
 {
-	return PHP_MINFO(cli_readline)(ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU);
+	PHP_MINFO(cli_readline)(ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU);
 }
 
 /* }}} */


commit fa05f038cb2cd9e9fa17efd2286c42dcb3e9aa05
Author: Stanislav Malyshev <stas at php.net>
Date:   Mon May 28 18:54:15 2012 -0700

    fix unchecked emalloc
    (cherry picked from commit 158d8a6b088662ce9d31e0c777c6ebe90efdc854)

diff --git a/ext/phar/tar.c b/ext/phar/tar.c
index b914db1..917734c 100644
--- a/ext/phar/tar.c
+++ b/ext/phar/tar.c
@@ -38,7 +38,7 @@ static php_uint32 phar_tar_number(char *buf, int len) /* {{{ */
 /* }}} */
 
 /* adapted from format_octal() in libarchive
- * 
+ *
  * Copyright (c) 2003-2009 Tim Kientzle
  * All rights reserved.
  *
@@ -161,7 +161,7 @@ static int phar_tar_process_metadata(phar_entry_info *entry, php_stream *fp TSRM
 	size_t save = php_stream_tell(fp), read;
 	phar_entry_info *mentry;
 
-	metadata = (char *) emalloc(entry->uncompressed_filesize + 1);
+	metadata = (char *) safe_emalloc(1, entry->uncompressed_filesize, 1);
 
 	read = php_stream_read(fp, metadata, entry->uncompressed_filesize);
 	if (read != entry->uncompressed_filesize) {
@@ -377,7 +377,7 @@ bail:
 			}
 
 			read = php_stream_read(fp, buf, sizeof(buf));
-	
+
 			if (read != sizeof(buf)) {
 				efree(entry.filename);
 				if (error) {


commit 56532895a851851b4eacebb58cd3a0c7294031b3
Merge: 5a2578a ec2029a
Author: andrey <andrey at php.net>
Date:   Wed May 30 15:25:26 2012 +0300

    Merge branch 'master' of git.php.net:php-src



commit 5a2578a333aaa5f72216f28510705ae0676e9266
Author: andrey <andrey at php.net>
Date:   Wed May 30 15:24:17 2012 +0300

    small refactoring - factour out code from connection establishment.
    Add a define for the default authentication protocol - get away from
    the hardcoded magic value

diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c
index 300a7ee..fc0e46a 100644
--- a/ext/mysqlnd/mysqlnd.c
+++ b/ext/mysqlnd/mysqlnd.c
@@ -605,6 +605,148 @@ end:
 /* }}} */
 
 
+/* {{{ mysqlnd_conn_data::execute_init_commands */
+static enum_func_status
+MYSQLND_METHOD(mysqlnd_conn_data, execute_init_commands)(MYSQLND_CONN_DATA * conn TSRMLS_DC)
+{
+	enum_func_status ret = PASS;
+
+	DBG_ENTER("mysqlnd_conn_data::execute_init_commands");
+	if (conn->options->init_commands) {
+		unsigned int current_command = 0;
+		for (; current_command < conn->options->num_commands; ++current_command) {
+			const char * const command = conn->options->init_commands[current_command];
+			if (command) {
+				MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_INIT_COMMAND_EXECUTED_COUNT);
+				if (PASS != conn->m->query(conn, command, strlen(command) TSRMLS_CC)) {
+					MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_INIT_COMMAND_FAILED_COUNT);
+					ret = FAIL;
+					break;
+				}
+				if (conn->last_query_type == QUERY_SELECT) {
+					MYSQLND_RES * result = conn->m->use_result(conn TSRMLS_CC);
+					if (result) {
+						result->m.free_result(result, TRUE TSRMLS_CC);
+					}
+				}
+			}
+		}
+	}
+	DBG_RETURN(ret);
+}
+/* }}} */
+
+
+/* {{{ mysqlnd_conn_data::get_updated_connect_flags */
+static unsigned int
+MYSQLND_METHOD(mysqlnd_conn_data, get_updated_connect_flags)(MYSQLND_CONN_DATA * conn, unsigned int mysql_flags TSRMLS_DC)
+{
+	MYSQLND_NET * net = conn->net;
+
+	DBG_ENTER("mysqlnd_conn_data::get_updated_connect_flags");
+	/* we allow load data local infile by default */
+	mysql_flags |= MYSQLND_CAPABILITIES;
+
+	if (PG(open_basedir) && strlen(PG(open_basedir))) {
+		mysql_flags ^= CLIENT_LOCAL_FILES;
+	}
+
+#ifndef MYSQLND_COMPRESSION_ENABLED
+	if (mysql_flags & CLIENT_COMPRESS) {
+		mysql_flags &= ~CLIENT_COMPRESS;
+	}
+#else
+	if (net && net->data->options.flags & MYSQLND_NET_FLAG_USE_COMPRESSION) {
+		mysql_flags |= CLIENT_COMPRESS;
+	}
+#endif
+#ifndef MYSQLND_SSL_SUPPORTED
+	if (mysql_flags & CLIENT_SSL) {
+		mysql_flags &= ~CLIENT_SSL;
+	}
+#else
+	if (net && (net->data->options.ssl_key || net->data->options.ssl_cert ||
+		net->data->options.ssl_ca || net->data->options.ssl_capath || net->data->options.ssl_cipher))
+	{
+		mysql_flags |= CLIENT_SSL;
+	}
+#endif
+
+	DBG_RETURN(mysql_flags);
+}
+/* }}} */
+
+
+/* {{{ mysqlnd_conn_data::connect_handshake */
+static enum_func_status
+MYSQLND_METHOD(mysqlnd_conn_data, connect_handshake)(MYSQLND_CONN_DATA * conn,
+						const char * const host, const char * const user,
+						const char * const passwd, const unsigned int passwd_len,
+						const char * const db, const unsigned int db_len,
+						const unsigned int mysql_flags TSRMLS_DC)
+{
+	MYSQLND_PACKET_GREET * greet_packet;
+	MYSQLND_NET * net = conn->net;
+
+	DBG_ENTER("mysqlnd_conn_data::connect_handshake");
+
+	greet_packet = conn->protocol->m.get_greet_packet(conn->protocol, FALSE TSRMLS_CC);
+	if (!greet_packet) {
+		SET_OOM_ERROR(*conn->error_info);
+		DBG_RETURN(FAIL); /* OOM */
+	}
+
+	if (FAIL == net->data->m.connect_ex(conn->net, conn->scheme, conn->scheme_len, conn->persistent,
+										conn->stats, conn->error_info TSRMLS_CC))
+	{
+		goto err;
+	}
+
+	DBG_INF_FMT("stream=%p", net->data->m.get_stream(net TSRMLS_CC));
+
+	if (FAIL == PACKET_READ(greet_packet, conn)) {
+		DBG_ERR("Error while reading greeting packet");
+		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading greeting packet. PID=%d", getpid());
+		goto err;
+	} else if (greet_packet->error_no) {
+		DBG_ERR_FMT("errorno=%u error=%s", greet_packet->error_no, greet_packet->error);
+		SET_CLIENT_ERROR(*conn->error_info, greet_packet->error_no, greet_packet->sqlstate, greet_packet->error);
+		goto err;
+	} else if (greet_packet->pre41) {
+		DBG_ERR_FMT("Connecting to 3.22, 3.23 & 4.0 is not supported. Server is %-.32s", greet_packet->server_version);
+		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Connecting to 3.22, 3.23 & 4.0 "
+						" is not supported. Server is %-.32s", greet_packet->server_version);
+		SET_CLIENT_ERROR(*conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE,
+						 "Connecting to 3.22, 3.23 & 4.0 servers is not supported");
+		goto err;
+	}
+
+	conn->thread_id			= greet_packet->thread_id;
+	conn->protocol_version	= greet_packet->protocol_version;
+	conn->server_version	= mnd_pestrdup(greet_packet->server_version, conn->persistent);
+
+	conn->greet_charset = mysqlnd_find_charset_nr(greet_packet->charset_no);
+
+	if (FAIL == mysqlnd_connect_run_authentication(conn, user, passwd, db, db_len, (size_t) passwd_len,
+												   greet_packet, conn->options, mysql_flags TSRMLS_CC))
+	{
+		goto err;
+	}
+	conn->client_flag			= mysql_flags;
+	conn->server_capabilities 	= greet_packet->server_capabilities;
+	conn->upsert_status->warning_count = 0;
+	conn->upsert_status->server_status = greet_packet->server_status;
+	conn->upsert_status->affected_rows = 0;
+
+	PACKET_FREE(greet_packet);
+	DBG_RETURN(PASS);
+err:
+	PACKET_FREE(greet_packet);
+	DBG_RETURN(FAIL);
+}
+/* }}} */
+
+
 /* {{{ mysqlnd_conn_data::connect */
 static enum_func_status
 MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
@@ -625,8 +767,6 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
 	zend_bool local_tx_started = FALSE;
 	MYSQLND_NET * net = conn->net;
 
-	MYSQLND_PACKET_GREET * greet_packet = NULL;
-
 	DBG_ENTER("mysqlnd_conn_data::connect");
 
 	if (PASS != conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
@@ -686,6 +826,8 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
 		DBG_INF_FMT("no db given, using empty string");
 		db = "";
 		db_len = 0;
+	} else {
+		mysql_flags |= CLIENT_CONNECT_WITH_DB;	
 	}
 
 	host_len = strlen(host);
@@ -729,77 +871,9 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
 		}
 	}
 
-	greet_packet = conn->protocol->m.get_greet_packet(conn->protocol, FALSE TSRMLS_CC);
-	if (!greet_packet) {
-		SET_OOM_ERROR(*conn->error_info);
-		goto err; /* OOM */
-	}
+	mysql_flags = conn->m->get_updated_connect_flags(conn, mysql_flags TSRMLS_CC);
 
-	if (FAIL == net->data->m.connect_ex(conn->net, conn->scheme, conn->scheme_len, conn->persistent,
-										conn->stats, conn->error_info TSRMLS_CC))
-	{
-		goto err;
-	}
-
-	DBG_INF_FMT("stream=%p", net->data->m.get_stream(net TSRMLS_CC));
-
-	if (FAIL == PACKET_READ(greet_packet, conn)) {
-		DBG_ERR("Error while reading greeting packet");
-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading greeting packet. PID=%d", getpid());
-		goto err;
-	} else if (greet_packet->error_no) {
-		DBG_ERR_FMT("errorno=%u error=%s", greet_packet->error_no, greet_packet->error);
-		SET_CLIENT_ERROR(*conn->error_info, greet_packet->error_no, greet_packet->sqlstate, greet_packet->error);
-		goto err;
-	} else if (greet_packet->pre41) {
-		DBG_ERR_FMT("Connecting to 3.22, 3.23 & 4.0 is not supported. Server is %-.32s", greet_packet->server_version);
-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Connecting to 3.22, 3.23 & 4.0 "
-						" is not supported. Server is %-.32s", greet_packet->server_version);
-		SET_CLIENT_ERROR(*conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE,
-						 "Connecting to 3.22, 3.23 & 4.0 servers is not supported");
-		goto err;
-	}
-
-	conn->thread_id			= greet_packet->thread_id;
-	conn->protocol_version	= greet_packet->protocol_version;
-	conn->server_version	= mnd_pestrdup(greet_packet->server_version, conn->persistent);
-
-	conn->greet_charset = mysqlnd_find_charset_nr(greet_packet->charset_no);
-	/* we allow load data local infile by default */
-	mysql_flags |= MYSQLND_CAPABILITIES;
-
-	if (db) {
-		mysql_flags |= CLIENT_CONNECT_WITH_DB;
-	}
-
-	if (PG(open_basedir) && strlen(PG(open_basedir))) {
-		mysql_flags ^= CLIENT_LOCAL_FILES;
-	}
-
-#ifndef MYSQLND_COMPRESSION_ENABLED
-	if (mysql_flags & CLIENT_COMPRESS) {
-		mysql_flags &= ~CLIENT_COMPRESS;
-	}
-#else
-	if (net->data->options.flags & MYSQLND_NET_FLAG_USE_COMPRESSION) {
-		mysql_flags |= CLIENT_COMPRESS;
-	}
-#endif
-#ifndef MYSQLND_SSL_SUPPORTED
-	if (mysql_flags & CLIENT_SSL) {
-		mysql_flags &= ~CLIENT_SSL;
-	}
-#else
-	if (net->data->options.ssl_key || net->data->options.ssl_cert ||
-		net->data->options.ssl_ca || net->data->options.ssl_capath || net->data->options.ssl_cipher)
-	{
-		mysql_flags |= CLIENT_SSL;
-	}
-#endif
-
-	if (FAIL == mysqlnd_connect_run_authentication(conn, user, passwd, db, db_len, (size_t) passwd_len,
-												   greet_packet, conn->options, mysql_flags TSRMLS_CC))
-	{
+	if (FAIL == conn->m->connect_handshake(conn, host, user, passwd, passwd_len, db, db_len, mysql_flags TSRMLS_CC)) {
 		goto err;
 	}
 
@@ -876,13 +950,8 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
 			}
 			conn->unix_socket_len = strlen(conn->unix_socket);
 		}
-		conn->client_flag		= mysql_flags;
 		conn->max_packet_size	= MYSQLND_ASSEMBLED_PACKET_MAX_SIZE;
 		/* todo: check if charset is available */
-		conn->server_capabilities = greet_packet->server_capabilities;
-		conn->upsert_status->warning_count = 0;
-		conn->upsert_status->server_status = greet_packet->server_status;
-		conn->upsert_status->affected_rows = 0;
 
 		SET_EMPTY_ERROR(*conn->error_info);
 
@@ -895,27 +964,10 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
 			DBG_INF("unicode set");
 		}
 #endif
-		if (conn->options->init_commands) {
-			unsigned int current_command = 0;
-			for (; current_command < conn->options->num_commands; ++current_command) {
-				const char * const command = conn->options->init_commands[current_command];
-				if (command) {
-					MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_INIT_COMMAND_EXECUTED_COUNT);
-					if (PASS != conn->m->query(conn, command, strlen(command) TSRMLS_CC)) {
-						MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_INIT_COMMAND_FAILED_COUNT);
-						goto err;
-					}
-					if (conn->last_query_type == QUERY_SELECT) {
-						MYSQLND_RES * result = conn->m->use_result(conn TSRMLS_CC);
-						if (result) {
-							result->m.free_result(result, TRUE TSRMLS_CC);
-						}
-					}
-				}
-			}
+		if (FAIL == conn->m->execute_init_commands(conn TSRMLS_CC)) {
+			goto err;
 		}
 
-
 		MYSQLND_INC_CONN_STATISTIC_W_VALUE2(conn->stats, STAT_CONNECT_SUCCESS, 1, STAT_OPENED_CONNECTIONS, 1);
 		if (reconnect) {
 			MYSQLND_INC_GLOBAL_STATISTIC(STAT_RECONNECT);
@@ -926,13 +978,10 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
 
 		DBG_INF_FMT("connection_id=%llu", conn->thread_id);
 
-		PACKET_FREE(greet_packet);
-
 		conn->m->local_tx_end(conn, this_func, PASS TSRMLS_CC);
 		DBG_RETURN(PASS);
 	}
 err:
-	PACKET_FREE(greet_packet);
 
 	DBG_ERR_FMT("[%u] %.128s (trying to connect via %s)", conn->error_info->error_no, conn->error_info->error, conn->scheme);
 	if (!conn->error_info->error_no) {
@@ -2133,7 +2182,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, change_user)(MYSQLND_CONN_DATA * const conn,
 		}
 		memcpy(plugin_data, conn->auth_plugin_data, plugin_data_len);
 
-		requested_protocol = mnd_pestrdup(conn->options->auth_protocol? conn->options->auth_protocol:"mysql_native_password", FALSE);
+		requested_protocol = mnd_pestrdup(conn->options->auth_protocol? conn->options->auth_protocol:MYSQLND_DEFAULT_AUTH_PROTOCOL, FALSE);
 		if (!requested_protocol) {
 			ret = FAIL;
 			goto end;
@@ -2646,7 +2695,10 @@ MYSQLND_CLASS_METHODS_START(mysqlnd_conn_data)
 	MYSQLND_METHOD(mysqlnd_conn_data, tx_commit),
 	MYSQLND_METHOD(mysqlnd_conn_data, tx_rollback),
 	MYSQLND_METHOD(mysqlnd_conn_data, local_tx_start),
-	MYSQLND_METHOD(mysqlnd_conn_data, local_tx_end)
+	MYSQLND_METHOD(mysqlnd_conn_data, local_tx_end),
+	MYSQLND_METHOD(mysqlnd_conn_data, execute_init_commands),
+	MYSQLND_METHOD(mysqlnd_conn_data, get_updated_connect_flags),
+	MYSQLND_METHOD(mysqlnd_conn_data, connect_handshake)
 MYSQLND_CLASS_METHODS_END;
 
 
diff --git a/ext/mysqlnd/mysqlnd_debug.h b/ext/mysqlnd/mysqlnd_debug.h
index 3372e73..aa5a9e5 100644
--- a/ext/mysqlnd/mysqlnd_debug.h
+++ b/ext/mysqlnd/mysqlnd_debug.h
@@ -117,6 +117,7 @@ PHPAPI char * mysqlnd_get_backtrace(uint max_levels, size_t * length TSRMLS_DC);
 					if ((dbg_obj)) { \
 						dbg_skip_trace = !(dbg_obj)->m->func_enter((dbg_obj), __LINE__, __FILE__, func_name, strlen(func_name)); \
 					} \
+					if (dbg_skip_trace); /* shut compiler's mouth */\ 
 					do { \
 						if ((dbg_obj) && (dbg_obj)->flags & MYSQLND_DEBUG_PROFILE_CALLS) { \
 							DBG_PROFILE_START_TIME(); \
diff --git a/ext/mysqlnd/mysqlnd_enum_n_def.h b/ext/mysqlnd/mysqlnd_enum_n_def.h
index b0fe886..c8daa0c 100644
--- a/ext/mysqlnd/mysqlnd_enum_n_def.h
+++ b/ext/mysqlnd/mysqlnd_enum_n_def.h
@@ -37,6 +37,8 @@
 
 #define MYSQLND_ASSEMBLED_PACKET_MAX_SIZE 3UL*1024UL*1024UL*1024UL
 
+#define MYSQLND_DEFAULT_AUTH_PROTOCOL "mysql_native_password"
+
 #define MYSQLND_ERRMSG_SIZE			512
 #define MYSQLND_SQLSTATE_LENGTH		5
 #define MYSQLND_SQLSTATE_NULL		"00000"
diff --git a/ext/mysqlnd/mysqlnd_structs.h b/ext/mysqlnd/mysqlnd_structs.h
index b355a0d..4b3db99 100644
--- a/ext/mysqlnd/mysqlnd_structs.h
+++ b/ext/mysqlnd/mysqlnd_structs.h
@@ -473,6 +473,9 @@ typedef enum_func_status	(*func_mysqlnd_conn_data__tx_rollback)(MYSQLND_CONN_DAT
 
 typedef enum_func_status	(*func_mysqlnd_conn_data__local_tx_start)(MYSQLND_CONN_DATA * conn, size_t this_func TSRMLS_DC);
 typedef enum_func_status	(*func_mysqlnd_conn_data__local_tx_end)(MYSQLND_CONN_DATA * conn, size_t this_func, enum_func_status status TSRMLS_DC);
+typedef enum_func_status	(*func_mysqlnd_conn_data__execute_init_commands)(MYSQLND_CONN_DATA * conn TSRMLS_DC);
+typedef unsigned int		(*func_mysqlnd_conn_data__get_updated_connect_flags)(MYSQLND_CONN_DATA * conn, unsigned int mysql_flags TSRMLS_DC);
+typedef enum_func_status	(*func_mysqlnd_conn_data__connect_handshake)(MYSQLND_CONN_DATA * conn, const char * const host, const char * const user, const char * const passwd, const unsigned int passwd_len, const char * const db, const unsigned int db_len, const unsigned int mysql_flags TSRMLS_DC);
 
 
 struct st_mysqlnd_conn_data_methods
@@ -553,6 +556,10 @@ struct st_mysqlnd_conn_data_methods
 
 	func_mysqlnd_conn_data__local_tx_start local_tx_start;
 	func_mysqlnd_conn_data__local_tx_end local_tx_end;
+
+	func_mysqlnd_conn_data__execute_init_commands execute_init_commands;
+	func_mysqlnd_conn_data__get_updated_connect_flags get_updated_connect_flags;
+	func_mysqlnd_conn_data__connect_handshake connect_handshake;
 };
 
 


commit ec2029a894e86d7feb9a184d03a9e41db7f8c53a
Merge: 4770fe2 9b98cf7
Author: Stanislav Malyshev <stas at php.net>
Date:   Tue May 29 23:53:01 2012 -0700

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      fix test
      fix test



commit 9b98cf78651af55b85b094f30037b7a55cb7735e
Author: Stanislav Malyshev <stas at php.net>
Date:   Tue May 29 23:52:07 2012 -0700

    fix test

diff --git a/ext/intl/tests/bug59597_64.phpt b/ext/intl/tests/bug59597_64.phpt
index 4b96bf7..f96c72d 100644
--- a/ext/intl/tests/bug59597_64.phpt
+++ b/ext/intl/tests/bug59597_64.phpt
@@ -15,7 +15,7 @@ $value = $formatter->parse('2147483650', \NumberFormatter::TYPE_INT64);
 var_dump($value);
 
 ?>
---EXPECTREGEX--
+--EXPECT--
 int(2147483647)
 int(2147483650)
 


commit abe6362716ba1835250e24bff5927b19b9481315
Author: Stanislav Malyshev <stas at php.net>
Date:   Tue May 29 23:42:37 2012 -0700

    fix test

diff --git a/Zend/tests/bug62097.phpt b/Zend/tests/bug62097.phpt
index bee72e7..07e93bf 100644
--- a/Zend/tests/bug62097.phpt
+++ b/Zend/tests/bug62097.phpt
@@ -1,7 +1,7 @@
 --TEST--
 Bug #62097: fix for bug #54547 is wrong for 32-bit machines
 --SKIPIF--
-<php
+<?php
 if (PHP_INT_MAX !== 2147483647)
 	die('skip for system with 32-bit wide longs only');
 --FILE--


commit 4770fe2c97d1b4d70e624ab876df715ce428639e
Merge: f428578 7511f97
Author: Xinchen Hui <laruence at php.net>
Date:   Wed May 30 14:44:35 2012 +0800

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Typofix in comment in proc_open.c



commit 7511f972fdc395c4770896576bb8752370e46c21
Merge: 692b3bc a331f43
Author: Xinchen Hui <laruence at php.net>
Date:   Wed May 30 14:43:55 2012 +0800

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Typofix in comment in proc_open.c



commit a331f43f8cc8f2b9c23ddee95632b765e2e440e5
Author: Jille Timmermans <jille at quis.cx>
Date:   Tue May 29 15:44:04 2012 +0200

    Typofix in comment in proc_open.c

diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c
index 98288e4..db63a67 100644
--- a/ext/standard/proc_open.c
+++ b/ext/standard/proc_open.c
@@ -57,7 +57,7 @@
 
 /* This symbol is defined in ext/standard/config.m4.
  * Essentially, it is set if you HAVE_FORK || PHP_WIN32
- * Otherplatforms may modify that configure check and add suitable #ifdefs
+ * Other platforms may modify that configure check and add suitable #ifdefs
  * around the alternate code.
  * */
 #ifdef PHP_CAN_SUPPORT_PROC_OPEN


commit f4285781382606f17c357506c11f47ce9ca7b3cc
Merge: 9a9362c 692b3bc
Author: Stanislav Malyshev <stas at php.net>
Date:   Tue May 29 23:14:09 2012 -0700

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      fix CVE-2012-2143



commit 692b3bcd88ece3eefbc5131ecdf971ff18f191cf
Merge: 6074da9 aab49e9
Author: Stanislav Malyshev <stas at php.net>
Date:   Tue May 29 23:07:27 2012 -0700

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      fix CVE-2012-2143

diff --cc NEWS
index 4a7cbd4,0297393..898325a
--- a/NEWS
+++ b/NEWS
@@@ -5,59 -4,13 +5,60 @@@ PH
  - COM:
    . Fixed bug #62146 com_dotnet cannot be built shared. (Johannes)
  
 +- CLI Server:
 +  . Implemented FR #61977 (Need CLI web-server support for files with .htm & 
 +    svg extensions). (Sixd, Laruence)
 +  . Improved performance while sending error page, this also fixed
 +    bug #61785 (Memory leak when access a non-exists file without router).
 +    (Laruence)
 +  . Fixed bug #61546 (functions related to current script failed when chdir() 
 +    in cli sapi). (Laruence, reeze.xia at gmail.com)
 +
 +- CURL:
 +  . Fixed bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction).
 +    (Laruence)
 +
  - Core:
 +  . Fixed missing bound check in iptcparse(). (chris at chiappa.net)
+   . Fixed CVE-2012-2143. (Solar Designer)
 +  . Fixed bug #62005 (unexpected behavior when incrementally assigning to a 
 +    member of a null object). (Laruence)
 +  . Fixed bug #61998 (Using traits with method aliases appears to result in
 +    crash during execution). (Dmitry)
 +  . Fixed bug #61978 (Object recursion not detected for classes that implement
 +    JsonSerializable). (Felipe)
 +  . Fixed bug #61991 (long overflow in realpath_cache_get()). (Anatoliy)
 +  . Fixed bug #61922 (ZTS build doesn't accept zend.script_encoding config).
 +    (Laruence)
 +  . Fixed bug #61827 (incorrect \e processing on Windows) (Anatoliy)
 +  . Fixed bug #61782 (__clone/__destruct do not match other methods when checking
 +    access controls). (Stas)
 +  . Fixed bug #61761 ('Overriding' a private static method with a different 
 +    signature causes crash). (Laruence)
 +  . Fixed bug #61730 (Segfault from array_walk modifying an array passed by
 +    reference). (Laruence)
 +  . Fixed bug #61728 (PHP crash when calling ob_start in request_shutdown 
 +    phase). (Laruence)
 +  . Fixed bug #61660 (bin2hex(hex2bin($data)) != $data). (Nikita Popov)
 +  . Fixed bug #61650 (ini parser crashes when using ${xxxx} ini variables
 +    (without apache2)). (Laruence)
 +  . Fixed bug #61605 (header_remove() does not remove all headers). (Laruence)
 +  . Fixed bug #54547 (wrong equality of string numbers). (Gustavo)
 +  . Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename
 +    set to null). (Anatoliy)
 +  . Changed php://fd to be available only for CLI.
  
 -- Fileinfo:
 -  . Fixed magic file regex support. (Felipe)
 +- Phar:
 +  . Fix bug #61065 (Secunia SA44335, CVE-2012-2386). (Rasmus)
 +
 +- Pgsql:
 +  . Added pg_escape_identifier/pg_escape_literal. (Yasuo Ohgaki)
  
 -- FPM:
 +- Fileinfo
 +  . Fixed bug #61812 (Uninitialised value used in libmagic). 
 +    (Laruence, Gustavo)
 +
 +- FPM
    . Fixed bug #61045 (fpm don't send error log to fastcgi clients). (fat)
    . Fixed bug #61835 (php-fpm is not allowed to run as root). (fat)
    . Fixed bug #61295 (php-fpm should not fail with commented 'user'


commit aab49e934de1fff046e659cbec46e3d053b41c34
Author: Stanislav Malyshev <stas at php.net>
Date:   Thu May 24 13:54:51 2012 -0500

    fix CVE-2012-2143

diff --git a/NEWS b/NEWS
index 6863a73..0297393 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,9 @@ PHP                                                                        NEWS
 - COM:
   . Fixed bug #62146 com_dotnet cannot be built shared. (Johannes)
 
+- Core:
+  . Fixed CVE-2012-2143. (Solar Designer)
+
 - Fileinfo:
   . Fixed magic file regex support. (Felipe)
 
diff --git a/ext/standard/crypt_freesec.c b/ext/standard/crypt_freesec.c
index 49c397c..0a5c3ba 100644
--- a/ext/standard/crypt_freesec.c
+++ b/ext/standard/crypt_freesec.c
@@ -629,7 +629,8 @@ _crypt_extended_r(const char *key, const char *setting,
 	 */
 	q = (u_char *) keybuf;
 	while (q - (u_char *) keybuf < sizeof(keybuf)) {
-		if ((*q++ = *key << 1))
+		*q++ = *key << 1;
+		if (*key)
 			key++;
 	}
 	if (des_setkey((u_char *) keybuf, data))
diff --git a/ext/standard/tests/strings/crypt_chars.phpt b/ext/standard/tests/strings/crypt_chars.phpt
new file mode 100644
index 0000000..09cd868
--- /dev/null
+++ b/ext/standard/tests/strings/crypt_chars.phpt
@@ -0,0 +1,19 @@
+--TEST--
+crypt() function - characters > 0x80
+--SKIPIF--
+<?php
+if (!function_exists('crypt')) {
+        die("SKIP crypt() is not available");
+}
+?>
+--FILE--
+<?php
+var_dump(crypt("À1234abcd", "99"));
+var_dump(crypt("À9234abcd", "99"));
+var_dump(crypt("À1234abcd", "_01234567"));
+var_dump(crypt("À9234abcd", "_01234567"));
+--EXPECT--
+string(13) "99PxawtsTfX56"
+string(13) "99jcVcGxUZOWk"
+string(20) "_01234567IBjxKliXXRQ"
+string(20) "_012345678OSGpGQRVHA"


commit 9a9362cb0922005a5fb79b4de05d0dfa6e90ac71
Merge: 3a35479 6074da9
Author: Anatoliy Belsky <ab at php.net>
Date:   Tue May 29 17:42:35 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      updated the libmagic patch after Felipes regex fix



commit 6074da9809dec8018e6affe6faf1a77f524bff97
Merge: c0e046a 8d5e953
Author: Anatoliy Belsky <ab at php.net>
Date:   Tue May 29 17:41:57 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      updated the libmagic patch after Felipes regex fix



commit 8d5e953a19a08e562448f2a0562228fd1be60715
Author: Anatoliy Belsky <ab at php.net>
Date:   Tue May 29 17:38:30 2012 +0200

    updated the libmagic patch after Felipes regex fix

diff --git a/ext/fileinfo/libmagic.patch b/ext/fileinfo/libmagic.patch
index baeac1d..48a0236 100644
--- a/ext/fileinfo/libmagic.patch
+++ b/ext/fileinfo/libmagic.patch
@@ -1,6 +1,6 @@
 diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
---- libmagic.orig/apprentice.c	2012-04-22 19:30:43.182305355 +0800
-+++ libmagic/apprentice.c	2012-04-22 19:28:57.346309536 +0800
+--- libmagic.orig/apprentice.c	2012-05-29 14:40:41.710960045 +0200
++++ libmagic/apprentice.c	2012-04-22 18:57:16.215980866 +0200
 @@ -29,6 +29,8 @@
   * apprentice - make one pass through /etc/magic, learning its secrets.
   */
@@ -729,8 +729,8 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
  		m->str_flags = swap4(m->str_flags);
  	}
 diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
---- libmagic.orig/ascmagic.c	2012-04-22 19:30:43.182305355 +0800
-+++ libmagic/ascmagic.c	2012-04-22 19:28:57.330309533 +0800
+--- libmagic.orig/ascmagic.c	2012-05-29 14:40:41.710960045 +0200
++++ libmagic/ascmagic.c	2012-04-22 18:57:16.215980866 +0200
 @@ -139,10 +139,8 @@
  		/* malloc size is a conservative overestimate; could be
  		   improved, or at least realloced after conversion. */
@@ -755,8 +755,8 @@ diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
  	return rv;
  }
 diff -u libmagic.orig/cdf.c libmagic/cdf.c
---- libmagic.orig/cdf.c	2012-04-22 19:30:43.182305355 +0800
-+++ libmagic/cdf.c	2012-04-22 19:28:57.370309531 +0800
+--- libmagic.orig/cdf.c	2012-05-29 14:40:41.710960045 +0200
++++ libmagic/cdf.c	2012-04-22 18:57:16.219978162 +0200
 @@ -43,7 +43,17 @@
  #include <err.h>
  #endif
@@ -819,8 +819,8 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
  				(void)fprintf(stderr, "timestamp %s\n", buf);
  			} else {
 diff -u libmagic.orig/cdf.h libmagic/cdf.h
---- libmagic.orig/cdf.h	2012-04-22 19:30:43.182305355 +0800
-+++ libmagic/cdf.h	2012-04-22 19:28:57.370309531 +0800
+--- libmagic.orig/cdf.h	2012-05-29 14:40:41.710960045 +0200
++++ libmagic/cdf.h	2012-04-22 18:57:16.219978162 +0200
 @@ -35,7 +35,7 @@
  #ifndef _H_CDF_
  #define _H_CDF_
@@ -857,8 +857,8 @@ diff -u libmagic.orig/cdf.h libmagic/cdf.h
  void cdf_swap_header(cdf_header_t *);
  void cdf_unpack_header(cdf_header_t *, char *);
 diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
---- libmagic.orig/cdf_time.c	2012-04-22 19:30:43.182305355 +0800
-+++ libmagic/cdf_time.c	2012-04-22 19:28:57.326309537 +0800
+--- libmagic.orig/cdf_time.c	2012-05-29 14:40:41.710960045 +0200
++++ libmagic/cdf_time.c	2012-04-22 18:57:16.219978162 +0200
 @@ -96,7 +96,7 @@
  }
  
@@ -916,8 +916,8 @@ diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
  	static const char *ref = "Sat Apr 23 01:30:00 1977";
  	char *p, *q;
 diff -u libmagic.orig/compress.c libmagic/compress.c
---- libmagic.orig/compress.c	2012-04-22 19:30:43.182305355 +0800
-+++ libmagic/compress.c	2012-04-22 19:28:57.314309548 +0800
+--- libmagic.orig/compress.c	2012-05-29 14:40:41.710960045 +0200
++++ libmagic/compress.c	2012-04-22 18:57:16.219978162 +0200
 @@ -32,6 +32,7 @@
   *	uncompress(method, old, n, newch) - uncompress old into new, 
   *					    using method, return sizeof new
@@ -1079,8 +1079,8 @@ diff -u libmagic.orig/compress.c libmagic/compress.c
 -#endif
 +#endif /* if PHP_FILEINFO_UNCOMPRESS */
 diff -u libmagic.orig/file.h libmagic/file.h
---- libmagic.orig/file.h	2012-04-22 19:30:43.186305188 +0800
-+++ libmagic/file.h	2012-04-22 19:49:58.922256776 +0800
+--- libmagic.orig/file.h	2012-05-29 14:40:41.710960045 +0200
++++ libmagic/file.h	2012-04-22 18:57:16.219978162 +0200
 @@ -33,11 +33,9 @@
  #ifndef __file_h__
  #define __file_h__
@@ -1252,8 +1252,8 @@ diff -u libmagic.orig/file.h libmagic/file.h
 +
  #endif /* __file_h__ */
 diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
---- libmagic.orig/fsmagic.c	2012-04-22 19:30:43.186305188 +0800
-+++ libmagic/fsmagic.c	2012-04-22 19:28:57.298309521 +0800
+--- libmagic.orig/fsmagic.c	2012-05-29 14:40:41.710960045 +0200
++++ libmagic/fsmagic.c	2012-04-22 18:57:16.219978162 +0200
 @@ -59,27 +59,21 @@
  # define minor(dev)  ((dev) & 0xff)
  #endif
@@ -1577,8 +1577,8 @@ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
  
  	/*
 diff -u libmagic.orig/funcs.c libmagic/funcs.c
---- libmagic.orig/funcs.c	2012-04-22 19:30:43.186305188 +0800
-+++ libmagic/funcs.c	2012-04-22 19:28:57.370309531 +0800
+--- libmagic.orig/funcs.c	2012-05-29 14:40:41.710960045 +0200
++++ libmagic/funcs.c	2012-04-22 18:57:16.219978162 +0200
 @@ -41,52 +41,42 @@
  #if defined(HAVE_WCTYPE_H)
  #include <wctype.h>
@@ -1872,11 +1872,9 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
 +	return rep_cnt;
  }
 +
-Only in libmagic.orig: funcs.c.orig
-Only in libmagic.orig: funcs.c.rej
 diff -u libmagic.orig/magic.c libmagic/magic.c
---- libmagic.orig/magic.c	2012-04-22 19:30:43.186305188 +0800
-+++ libmagic/magic.c	2012-04-22 19:28:57.370309531 +0800
+--- libmagic.orig/magic.c	2012-05-29 14:40:41.710960045 +0200
++++ libmagic/magic.c	2012-04-22 18:57:16.219978162 +0200
 @@ -25,11 +25,6 @@
   * SUCH DAMAGE.
   */
@@ -2253,8 +2251,8 @@ diff -u libmagic.orig/magic.c libmagic/magic.c
  public const char *
  magic_error(struct magic_set *ms)
 diff -u libmagic.orig/magic.h libmagic/magic.h
---- libmagic.orig/magic.h	2012-04-22 19:30:43.190305058 +0800
-+++ libmagic/magic.h	2012-04-22 19:28:57.326309537 +0800
+--- libmagic.orig/magic.h	2012-05-29 14:40:41.710960045 +0200
++++ libmagic/magic.h	2012-04-22 18:57:16.219978162 +0200
 @@ -85,6 +85,7 @@
  
  const char *magic_getpath(const char *, int);
@@ -2272,8 +2270,8 @@ diff -u libmagic.orig/magic.h libmagic/magic.h
  int magic_errno(magic_t);
  
 diff -u libmagic.orig/print.c libmagic/print.c
---- libmagic.orig/print.c	2012-04-22 19:30:43.190305058 +0800
-+++ libmagic/print.c	2012-04-22 19:28:57.326309537 +0800
+--- libmagic.orig/print.c	2012-05-29 14:40:41.710960045 +0200
++++ libmagic/print.c	2012-05-29 14:34:03.770376387 +0200
 @@ -29,6 +29,9 @@
   * print.c - debugging printout routines
   */
@@ -2467,8 +2465,8 @@ diff -u libmagic.orig/print.c libmagic/print.c
  
  protected const char *
 diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
---- libmagic.orig/readcdf.c	2012-04-22 19:30:43.190305058 +0800
-+++ libmagic/readcdf.c	2012-04-22 19:28:57.326309537 +0800
+--- libmagic.orig/readcdf.c	2012-05-29 14:40:41.710960045 +0200
++++ libmagic/readcdf.c	2012-04-22 18:57:16.219978162 +0200
 @@ -30,7 +30,11 @@
  #endif
  
@@ -2515,8 +2513,8 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
                                          if ((ec = strchr(c, '\n')) != NULL)
                                                  *ec = '\0';
 diff -u libmagic.orig/readelf.c libmagic/readelf.c
---- libmagic.orig/readelf.c	2012-04-22 19:30:43.190305058 +0800
-+++ libmagic/readelf.c	2012-04-22 19:28:57.378309534 +0800
+--- libmagic.orig/readelf.c	2012-05-29 14:40:41.710960045 +0200
++++ libmagic/readelf.c	2012-04-22 18:57:16.219978162 +0200
 @@ -49,7 +49,7 @@
      off_t, int *, int);
  private int doshn(struct magic_set *, int, int, int, off_t, int, size_t,
@@ -2672,8 +2670,8 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
  
  	if (fstat(fd, &st) == -1) {
 diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
---- libmagic.orig/softmagic.c	2012-04-22 19:30:43.194304945 +0800
-+++ libmagic/softmagic.c	2012-04-22 19:28:57.286309597 +0800
+--- libmagic.orig/softmagic.c	2012-05-29 14:40:41.710960045 +0200
++++ libmagic/softmagic.c	2012-05-29 14:34:31.900417647 +0200
 @@ -41,6 +41,11 @@
  #include <stdlib.h>
  #include <time.h>
@@ -2860,7 +2858,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
  		}
  	}
  
-@@ -1669,6 +1642,65 @@
+@@ -1669,6 +1642,42 @@
  	return file_strncmp(a, b, len, flags);
  }
  
@@ -2876,29 +2874,6 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
 +		
 +		for (i=0; i<Z_STRLEN_P(pattern); i++, j++) {
 +			switch (Z_STRVAL_P(pattern)[i]) {
-+				case '?':
-+					t[j] = '.';
-+					break;
-+				case '*':
-+					t[j++] = '.';
-+					t[j] = '*';
-+					break;
-+				case '.':
-+					t[j++] = '\\';
-+					t[j] = '.';
-+					break;
-+				case '\\':
-+					t[j++] = '\\';
-+					t[j] = '\\';
-+					break;
-+				case '(':
-+					t[j++] = '\\';
-+					t[j] = '(';
-+					break;
-+				case ')':
-+					t[j++] = '\\';
-+					t[j] = ')';
-+					break;
 +				case '~':
 +					t[j++] = '\\';
 +					t[j] = '~';
@@ -2926,7 +2901,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
  private int
  magiccheck(struct magic_set *ms, struct magic *m)
  {
-@@ -1825,67 +1857,163 @@
+@@ -1825,67 +1834,163 @@
  		break;
  	}
  	case FILE_REGEX: {
@@ -2937,23 +2912,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
 -		if (ms->search.s == NULL)
 -			return 0;
 -
-+		zval *pattern;
-+		int options = 0;
-+		pcre_cache_entry *pce;
-+		TSRMLS_FETCH();
-+		
-+		MAKE_STD_ZVAL(pattern);
-+		ZVAL_STRINGL(pattern, (char *)m->value.s, m->vallen, 0);
-+	
-+		options |= PCRE_MULTILINE;
-+		
-+		if (m->str_flags & STRING_IGNORE_CASE) {
-+			options |= PCRE_CASELESS;
-+		}
-+		
-+		convert_libmagic_pattern(pattern, options);
-+		
- 		l = 0;
+-		l = 0;
 -		rc = regcomp(&rx, m->value.s,
 -		    REG_EXTENDED|REG_NEWLINE|
 -		    ((m->str_flags & STRING_IGNORE_CASE) ? REG_ICASE : 0));
@@ -2970,6 +2929,23 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
 -			size_t l = ms->search.s_len - 1;
 -			char c = ms->search.s[l];
 -			((char *)(intptr_t)ms->search.s)[l] = '\0';
++		zval *pattern;
++		int options = 0;
++		pcre_cache_entry *pce;
++		TSRMLS_FETCH();
++		
++		MAKE_STD_ZVAL(pattern);
++		ZVAL_STRINGL(pattern, (char *)m->value.s, m->vallen, 0);
++	
++		options |= PCRE_MULTILINE;
++		
++		if (m->str_flags & STRING_IGNORE_CASE) {
++			options |= PCRE_CASELESS;
++		}
++		
++		convert_libmagic_pattern(pattern, options);
++		
++		l = v = 0;
 +#if (PHP_MAJOR_VERSION < 6)
 +		if ((pce = pcre_get_compiled_regex_cache(Z_STRVAL_P(pattern), Z_STRLEN_P(pattern) TSRMLS_CC)) == NULL) {
  #else


commit 3a35479e5915542477b87eee2481e746a4d24065
Merge: dffbc98 c0e046a
Author: Anatoliy Belsky <ab at php.net>
Date:   Tue May 29 16:43:40 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug #62150 Test Bug - ext/fileinfo/tests/finfo_open_error.phpt
      Bug #62177 deactivate the linux test version on win
      Fix bug #62177 Test Bug - finfo_file_regex.phpt



commit c0e046a130c420b337960f7f54e3ff03e8b472ab
Merge: c4f9b01 ad0371a
Author: Anatoliy Belsky <ab at php.net>
Date:   Tue May 29 16:43:20 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug #62150 Test Bug - ext/fileinfo/tests/finfo_open_error.phpt
      Bug #62177 deactivate the linux test version on win
      Fix bug #62177 Test Bug - finfo_file_regex.phpt



commit ad0371ac7ecff5fedf1786c3aa720760f98c6269
Author: Matt Ficken <mattficken at php.net>
Date:   Tue May 29 16:38:57 2012 +0200

    Fix bug #62150 Test Bug - ext/fileinfo/tests/finfo_open_error.phpt

diff --git a/ext/fileinfo/tests/finfo_open_error-win32.phpt b/ext/fileinfo/tests/finfo_open_error-win32.phpt
new file mode 100644
index 0000000..bd50327
--- /dev/null
+++ b/ext/fileinfo/tests/finfo_open_error-win32.phpt
@@ -0,0 +1,46 @@
+--TEST--
+Test finfo_open() function : error functionality 
+--SKIPIF--
+<?php require_once(dirname(__FILE__) . '/skipif.inc'); 
+if(substr(PHP_OS, 0, 3) != 'WIN' )
+  die("skip Not Valid for Linux");
+?>
+--FILE--
+<?php
+/* Prototype  : resource finfo_open([int options [, string arg]])
+ * Description: Create a new fileinfo resource. 
+ * Source code: ext/fileinfo/fileinfo.c
+ * Alias to functions: 
+ */
+
+$magicFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic';
+
+echo "*** Testing finfo_open() : error functionality ***\n";
+
+var_dump( finfo_open( FILEINFO_MIME, 'foobarfile' ) );
+var_dump( finfo_open( array(), $magicFile ) );
+var_dump( finfo_open( FILEINFO_MIME, $magicFile, 'extraArg' ) );
+var_dump( finfo_open( PHP_INT_MAX - 1, $magicFile ) );
+var_dump( finfo_open( 'foobar' ) );
+
+var_dump( new finfo('foobar') );
+
+?>
+===DONE===
+--EXPECTF--
+*** Testing finfo_open() : error functionality ***
+bool(false)
+
+Warning: finfo_open() expects parameter 1 to be long, array given in %s on line %d
+bool(false)
+
+Warning: finfo_open() expects at most 2 parameters, 3 given in %s on line %d
+bool(false)
+resource(%d) of type (file_info)
+
+Warning: finfo_open() expects parameter 1 to be long, %unicode_string_optional% given in %s on line %d
+bool(false)
+
+Warning: finfo::finfo() expects parameter 1 to be long, %unicode_string_optional% given in %s on line %d
+NULL
+===DONE===
diff --git a/ext/fileinfo/tests/finfo_open_error.phpt b/ext/fileinfo/tests/finfo_open_error.phpt
index aae229f..7bf60bf 100644
--- a/ext/fileinfo/tests/finfo_open_error.phpt
+++ b/ext/fileinfo/tests/finfo_open_error.phpt
@@ -1,7 +1,10 @@
 --TEST--
 Test finfo_open() function : error functionality 
 --SKIPIF--
-<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
+<?php require_once(dirname(__FILE__) . '/skipif.inc'); 
+if(substr(PHP_OS, 0, 3) == 'WIN' )
+  die("skip Not Valid for Windows");
+?>
 --FILE--
 <?php
 /* Prototype  : resource finfo_open([int options [, string arg]])


commit b4b0aaae9331edcd8de7ca9062c0c8478265b008
Author: Matt Ficken <mattficken at php.net>
Date:   Tue May 29 16:37:19 2012 +0200

    Bug #62177 deactivate the linux test version on win

diff --git a/ext/fileinfo/tests/finfo_file_regex.phpt b/ext/fileinfo/tests/finfo_file_regex.phpt
index c1cc36f..ee4c8b0 100644
--- a/ext/fileinfo/tests/finfo_file_regex.phpt
+++ b/ext/fileinfo/tests/finfo_file_regex.phpt
@@ -1,7 +1,11 @@
 --TEST--
 Test finfo_file() function : regex rules
 --SKIPIF--
-<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
+<?php require_once(dirname(__FILE__) . '/skipif.inc'); 
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+    die('skip.. only for Non Windows Systems');
+}
+?>
 --FILE--
 <?php
 /**


commit dbc727373c6b9a086a4b3d28608acb6fadf7a8fd
Author: Matt Ficken <mattficken at php.net>
Date:   Tue May 29 16:31:47 2012 +0200

    Fix bug #62177 Test Bug - finfo_file_regex.phpt

diff --git a/ext/fileinfo/tests/finfo_file_regex-win32.phpt b/ext/fileinfo/tests/finfo_file_regex-win32.phpt
new file mode 100644
index 0000000..1eda48c
--- /dev/null
+++ b/ext/fileinfo/tests/finfo_file_regex-win32.phpt
@@ -0,0 +1,36 @@
+--TEST--
+Test finfo_file() function : regex rules
+--SKIPIF--
+<?php require_once(dirname(__FILE__) . '/skipif.inc'); 
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+    die('skip.. only for Windows');
+}
+?>
+--FILE--
+<?php
+/**
+ * Works with the unix file command:
+ * $ file -m magic resources/test.awk
+ * resources/test.awk: awk script, ASCII text
+ */
+$magicFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic';
+$finfo = finfo_open( FILEINFO_MIME, $magicFile );
+
+echo "*** Testing finfo_file() : regex rules ***\n";
+
+// Calling finfo_file() with all possible arguments
+$file = __DIR__ . '/resources/test.awk';
+var_dump( finfo_file( $finfo, $file ) );
+var_dump( finfo_file( $finfo, $file, FILEINFO_CONTINUE ) );
+
+// Windows uses libfileinfo 1.0.5-dev
+// this may be causing the slightly different output from the first
+// finfo_file() call
+
+?>
+===DONE===
+--EXPECTF--
+*** Testing finfo_file() : regex rules ***
+string(10) "text/plain"
+string(22) "awk script, ASCII text"
+===DONE===


commit dffbc98239a3d10250627a0b08eecce1d8f93460
Merge: fde8762 c4f9b01
Author: Anatoliy Belsky <ab at php.net>
Date:   Tue May 29 12:25:25 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4: (21 commits)
      Fixed bug #62176 Test Bug - sapi/cli/tests/bug61546.phpt
      fix unchecked emalloc
      add CVE
      add bug 62146
      add bug #62082
      sync with HEAD
      sync with HEAD
      Fixed bug #61218 (the previous patch was not enough restritive on fcgi name string checks)
      Fixed bug #61218 (the previous patch was not enough restritive on fcgi name string checks)
      Fixed bug #61218 (FPM drops connection while receiving some binary values in FastCGI requests)
      Fixed bug #61218 (FPM drops connection while receiving some binary valuesin FastCGI requests)
      Fixed bug #62033 (USR2 signal was sent even if not catch when daemonize and an error occured)
      - Fixed bug #62033 (USR2 signal was sent even if not catch when daemonize and an error occured)
      - Fixed bug #62160 (Add process.priority to set nice(2) priorities)
      - Fixed bug #62160 (Add process.priority to set nice(2) priorities)
      - add missing headers to avoid warnings
      - add missing headers to avoid warnings
      - Fixed bug #62153 (when using unix sockets, multiples FPM instances can be launched without errors)
      - Fixed bug #62153 (when using unix sockets, multiples FPM instances can be launched without errors)
      - Fixed bug #62033 (php-fpm exits with status 0 on some failures to start)
      ...
    
    Conflicts:
    	NEWS



commit c4f9b01422e8aa892624e811b9b329519185bcb4
Merge: 158d8a6 4054890
Author: Anatoliy Belsky <ab at php.net>
Date:   Tue May 29 12:19:20 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fixed bug #62176 Test Bug - sapi/cli/tests/bug61546.phpt
      sync with HEAD
      Fixed bug #61218 (the previous patch was not enough restritive on fcgi name string checks)
      Fixed bug #61218 (FPM drops connection while receiving some binary valuesin FastCGI requests)
      - Fixed bug #62033 (USR2 signal was sent even if not catch when daemonize and an error occured)
      - Fixed bug #62160 (Add process.priority to set nice(2) priorities)
      - add missing headers to avoid warnings
      - Fixed bug #62153 (when using unix sockets, multiples FPM instances can be launched without errors)
      - Fixed bug #62033 (php-fpm exits with status 0 on some failures to start)
    
    Conflicts:
    	NEWS
    	sapi/fpm/fpm/fpm_main.c



commit 4054890b26c4d146cfbcd56d75aab7a7aebc8c89
Author: Matt Ficken <mattficken at php.net>
Date:   Tue May 29 11:41:44 2012 +0200

    Fixed bug #62176 Test Bug - sapi/cli/tests/bug61546.phpt

diff --git a/sapi/cli/tests/bug61546.phpt b/sapi/cli/tests/bug61546.phpt
index 2cd690f..071edb7 100644
--- a/sapi/cli/tests/bug61546.phpt
+++ b/sapi/cli/tests/bug61546.phpt
@@ -2,13 +2,22 @@
 Bug #61546 (functions related to current script failed when chdir() in cli sapi)
 --FILE--
 <?php
+// reference doc for getmyinode() on php.net states that it returns an integer or FALSE on error
+// on Windows, getmyinode() returns 0 which normally casts to FALSE
+// however, the implementation of getmyinode() (in pageinfo.c) returns an explicit FALSE in the
+// event that the internal page_inode structure is less than 0, otherwise it returns the long value
+// of page_inode. therefore, an explicit 0 should be a passing value for this test.
+//
+// the ext/standard/tests/file/statpage.phpt test also tests getmyinode() returns an integer and will
+// pass even if that integer is 0. on Windows, the getmyinode() call in statpage.phpt returns 0 and
+// passes on Windows.
 $php = getenv("TEST_PHP_EXECUTABLE");
 $test_code = <<<PHP
 <?php
 chdir('..');
 var_dump(get_current_user() != "");
 chdir('..');
-var_dump(getmyinode() != false);
+var_dump(getmyinode() !== false);
 var_dump(getlastmod() != false);
 PHP;
 


commit 158d8a6b088662ce9d31e0c777c6ebe90efdc854
Author: Stanislav Malyshev <stas at php.net>
Date:   Mon May 28 18:54:15 2012 -0700

    fix unchecked emalloc

diff --git a/ext/phar/tar.c b/ext/phar/tar.c
index b914db1..917734c 100644
--- a/ext/phar/tar.c
+++ b/ext/phar/tar.c
@@ -38,7 +38,7 @@ static php_uint32 phar_tar_number(char *buf, int len) /* {{{ */
 /* }}} */
 
 /* adapted from format_octal() in libarchive
- * 
+ *
  * Copyright (c) 2003-2009 Tim Kientzle
  * All rights reserved.
  *
@@ -161,7 +161,7 @@ static int phar_tar_process_metadata(phar_entry_info *entry, php_stream *fp TSRM
 	size_t save = php_stream_tell(fp), read;
 	phar_entry_info *mentry;
 
-	metadata = (char *) emalloc(entry->uncompressed_filesize + 1);
+	metadata = (char *) safe_emalloc(1, entry->uncompressed_filesize, 1);
 
 	read = php_stream_read(fp, metadata, entry->uncompressed_filesize);
 	if (read != entry->uncompressed_filesize) {
@@ -377,7 +377,7 @@ bail:
 			}
 
 			read = php_stream_read(fp, buf, sizeof(buf));
-	
+
 			if (read != sizeof(buf)) {
 				efree(entry.filename);
 				if (error) {


commit 213119c83ffdbe518ea33941e00d141ff49e27b6
Author: Stanislav Malyshev <stas at php.net>
Date:   Mon May 28 18:54:02 2012 -0700

    add CVE

diff --git a/NEWS b/NEWS
index a7d2b7f..4a7cbd4 100644
--- a/NEWS
+++ b/NEWS
@@ -48,7 +48,7 @@ PHP                                                                        NEWS
   . Changed php://fd to be available only for CLI.
 
 - Phar:
-  . Fix bug #61065 (Secunia SA44335). (Rasmus)
+  . Fix bug #61065 (Secunia SA44335, CVE-2012-2386). (Rasmus)
 
 - Pgsql:
   . Added pg_escape_identifier/pg_escape_literal. (Yasuo Ohgaki)


commit 0a90643e5391dc2e3483536d7be8923993c0ac8c
Author: Stanislav Malyshev <stas at php.net>
Date:   Mon May 28 17:43:36 2012 -0700

    add bug 62146

diff --git a/NEWS b/NEWS
index 911fef9..a7d2b7f 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,9 @@ PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 2012, PHP 5.4.4
 
+- COM:
+  . Fixed bug #62146 com_dotnet cannot be built shared. (Johannes)
+
 - CLI Server:
   . Implemented FR #61977 (Need CLI web-server support for files with .htm & 
     svg extensions). (Sixd, Laruence)


commit 4b04bf8793379cf2f4d1418939b65c6d81b072ec
Author: Stanislav Malyshev <stas at php.net>
Date:   Thu May 24 13:38:36 2012 -0500

    add bug #62082

diff --git a/NEWS b/NEWS
index eed55f1..911fef9 100644
--- a/NEWS
+++ b/NEWS
@@ -72,6 +72,8 @@ PHP                                                                        NEWS
 - Intl
   . ResourceBundle constructor now accepts NULL for the first two arguments.
     (Gustavo)
+  . Fixed bug #62082 (Memory corruption in internal function 
+    get_icu_disp_value_src_php()). (Gustavo)
 
 - Libxml:
   . Fixed bug #61617 (Libxml tests failed(ht is already destroyed)).


commit 5ef46fe43c25996a8fd6eb8c513e4114569d79b6
Author: Davey Shafik <me at daveyshafik.com>
Date:   Mon May 28 06:18:44 2012 -0400

    Fix boolean casting and whitespace (@dsp / #68)

diff --git a/run-tests.php b/run-tests.php
index 4af9a4f..753e1dd 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -311,7 +311,7 @@ VALGRIND    : " . ($leak_check ? $valgrind_header : 'Not used') . "
 define('PHP_QA_EMAIL', 'qa-reports at lists.php.net');
 define('QA_SUBMISSION_PAGE', 'http://qa.php.net/buildtest-process.php');
 define('QA_REPORTS_PAGE', 'http://qa.php.net/reports');
-define('TRAVIS_CI' , !!getenv('TRAVIS_PHP_VERSION')); 
+define('TRAVIS_CI' , (bool) getenv('TRAVIS_PHP_VERSION'));
 
 function save_or_mail_results()
 {
@@ -349,9 +349,9 @@ function save_or_mail_results()
 			}
 
 			/* Ask the user to provide an email address, so that QA team can contact the user */
-            if (TRAVIS_CI) {
-                $user_email = 'travis at php dot net';
-            } elseif (!strncasecmp($user_input, 'y', 1) || strlen(trim($user_input)) == 0) {
+			if (TRAVIS_CI) {
+				$user_email = 'travis at php dot net';
+			} elseif (!strncasecmp($user_input, 'y', 1) || strlen(trim($user_input)) == 0) {
 				echo "\nPlease enter your email address.\n(Your address will be mangled so that it will not go out on any\nmailinglist in plain text): ";
 				flush();
 				$user_email = trim(fgets($fp, 1024));


commit e2ebe6ce4ed9b149143949008f930007dfcb855f
Author: Davey Shafik <me at daveyshafik.com>
Date:   Fri Apr 27 23:53:53 2012 -0400

    Add curl extension config, uses cli-server to test

diff --git a/travis/ext/curl/setup.sh b/travis/ext/curl/setup.sh
new file mode 100755
index 0000000..74dad16
--- /dev/null
+++ b/travis/ext/curl/setup.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+export PHP_CURL_HTTP_REMOTE_SERVER="http://localhost"
+cd ./ext/curl/tests/responder
+sudo php -S localhost:80 &
+cd -
\ No newline at end of file


commit 3db6d59a63b3ad4c76cb489a228e8ea40387996f
Author: Davey Shafik <me at daveyshafik.com>
Date:   Fri Apr 27 23:53:24 2012 -0400

    Source all extension scripts for ENV vars

diff --git a/.travis.yml b/.travis.yml
index 8f61d7f..c51a332 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -11,11 +11,11 @@ before_script:
     # Compile PHP
     - ./travis/compile.sh
     # Setup Extensions 
-    - ./travis/ext/mysql/setup.sh
-    - ./travis/ext/mysqli/setup.sh
-    - ./travis/ext/pdo_mysql/setup.sh
-    - ./travis/ext/pgsql/setup.sh
-    - ./travis/ext/pdo_pgsql/setup.sh
+    - . ./travis/ext/mysql/setup.sh
+    - . ./travis/ext/mysqli/setup.sh
+    - . ./travis/ext/pdo_mysql/setup.sh
+    - . ./travis/ext/pgsql/setup.sh
+    - . ./travis/ext/pdo_pgsql/setup.sh
 
 # Run PHPs run-tests.php 
 script: ./sapi/cli/php run-tests.php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP"


commit 0fe8b495add557251519050bb94b5dd451d9f7cb
Author: Davey Shafik <me at daveyshafik.com>
Date:   Fri Apr 27 21:27:29 2012 -0400

    Add extension configs, compile more extensions

diff --git a/.travis.yml b/.travis.yml
index 9bc335b..8f61d7f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,13 +5,17 @@ php:
     - 5.4
 
 env:
-    - REPORT_EXIT_STATUS=1 TEST_PHP_EXECUTABLE=./sapi/cli/php DB=mysql
+    - REPORT_EXIT_STATUS=1 TEST_PHP_EXECUTABLE=./sapi/cli/php
 
 before_script:
     # Compile PHP
     - ./travis/compile.sh
-    # Create the MySQL test DB
-    - mysql -u root -e "CREATE DATABASE test"
+    # Setup Extensions 
+    - ./travis/ext/mysql/setup.sh
+    - ./travis/ext/mysqli/setup.sh
+    - ./travis/ext/pdo_mysql/setup.sh
+    - ./travis/ext/pgsql/setup.sh
+    - ./travis/ext/pdo_pgsql/setup.sh
 
 # Run PHPs run-tests.php 
 script: ./sapi/cli/php run-tests.php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP"
diff --git a/travis/compile.sh b/travis/compile.sh
index f80cc6b..a0fc167 100755
--- a/travis/compile.sh
+++ b/travis/compile.sh
@@ -1,4 +1,39 @@
 #!/bin/bash
 ./buildconf
-./configure --with-pdo-mysql --with-mysql --with-sqlite --with-pdo-sqlite
-make
+./configure \
+--with-pdo-mysql \
+--with-mysql \
+--with-mysqli \
+--with-pgsql \
+--with-pdo-pgsql \
+--with-pdo-sqlite \
+--enable-intl \
+--without-pear \
+--with-gd \
+--with-jpeg-dir=/usr \
+--with-png-dir=/usr \
+--enable-exif \
+--enable-zip \
+--with-zlib \
+--with-zlib-dir=/usr \
+--with-mcrypt=/usr \
+--enable-soap \
+--enable-xmlreader \
+--with-xsl \
+--with-curl=/usr \
+--with-tidy \
+--with-xmlrpc \
+--enable-sysvsem \
+--enable-sysvshm \
+--enable-shmop \
+--enable-pcntl \
+--with-readline \
+--enable-mbstring \
+--with-curl \
+--with-gettext \
+--enable-sockets \
+--with-bz2 \
+--enable-bcmath \
+--enable-fastcgi \
+--with-mime-magic
+make
\ No newline at end of file
diff --git a/travis/ext/mysql/setup.sh b/travis/ext/mysql/setup.sh
new file mode 100755
index 0000000..994fad1
--- /dev/null
+++ b/travis/ext/mysql/setup.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+mysql -u root -e "CREATE DATABASE IF NOT EXISTS test"
diff --git a/travis/ext/mysqli/setup.sh b/travis/ext/mysqli/setup.sh
new file mode 100755
index 0000000..994fad1
--- /dev/null
+++ b/travis/ext/mysqli/setup.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+mysql -u root -e "CREATE DATABASE IF NOT EXISTS test"
diff --git a/travis/ext/pdo_mysql/setup.sh b/travis/ext/pdo_mysql/setup.sh
new file mode 100755
index 0000000..994fad1
--- /dev/null
+++ b/travis/ext/pdo_mysql/setup.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+mysql -u root -e "CREATE DATABASE IF NOT EXISTS test"
diff --git a/travis/ext/pdo_pgsql/setup.sh b/travis/ext/pdo_pgsql/setup.sh
new file mode 100755
index 0000000..6f16f72
--- /dev/null
+++ b/travis/ext/pdo_pgsql/setup.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+export PDO_PGSQL_TEST_DSN='pgsql:host=localhost port=5432 dbname=test user=postgres password='
\ No newline at end of file
diff --git a/travis/ext/pgsql/setup.sh b/travis/ext/pgsql/setup.sh
new file mode 100755
index 0000000..32b39a4
--- /dev/null
+++ b/travis/ext/pgsql/setup.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+echo '                         
+<?php $conn_str .= " user=postgres"; ?>' >> "./ext/pgsql/tests/config.inc"
+psql -c 'create database test;' -U postgres
\ No newline at end of file


commit f15beda158a8fbb16823baf3801409356b79cb4f
Author: Davey Shafik <me at daveyshafik.com>
Date:   Fri Apr 27 10:36:33 2012 -0400

    Reformat, setup MySQL DB, call run-tests directly

diff --git a/.travis.yml b/.travis.yml
index feff37e..9bc335b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,11 +1,17 @@
 language: php
-# We only specify one version so we only get one worker
+
 php:
+    # We only specify one version so we only get one worker
     - 5.4
-# Compile PHP
+
+env:
+    - REPORT_EXIT_STATUS=1 TEST_PHP_EXECUTABLE=./sapi/cli/php DB=mysql
+
 before_script:
+    # Compile PHP
     - ./travis/compile.sh
-# Return 1 with failed testso
-env: REPORT_EXIT_STATUS=1
-# Run PHP's make test
-script: make test
+    # Create the MySQL test DB
+    - mysql -u root -e "CREATE DATABASE test"
+
+# Run PHPs run-tests.php 
+script: ./sapi/cli/php run-tests.php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP"


commit 3966df7fc83093766e5e6862b18b8ef03ef58e09
Author: Davey Shafik <me at daveyshafik.com>
Date:   Thu Apr 26 07:48:49 2012 -0400

    Add support for Travis CI

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..feff37e
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,11 @@
+language: php
+# We only specify one version so we only get one worker
+php:
+    - 5.4
+# Compile PHP
+before_script:
+    - ./travis/compile.sh
+# Return 1 with failed testso
+env: REPORT_EXIT_STATUS=1
+# Run PHP's make test
+script: make test
diff --git a/run-tests.php b/run-tests.php
index 2b37ec4..4af9a4f 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -311,6 +311,7 @@ VALGRIND    : " . ($leak_check ? $valgrind_header : 'Not used') . "
 define('PHP_QA_EMAIL', 'qa-reports at lists.php.net');
 define('QA_SUBMISSION_PAGE', 'http://qa.php.net/buildtest-process.php');
 define('QA_REPORTS_PAGE', 'http://qa.php.net/reports');
+define('TRAVIS_CI' , !!getenv('TRAVIS_PHP_VERSION')); 
 
 function save_or_mail_results()
 {
@@ -318,7 +319,7 @@ function save_or_mail_results()
 		   $PHP_FAILED_TESTS, $CUR_DIR, $php, $output_file, $compression;
 
 	/* We got failed Tests, offer the user to send an e-mail to QA team, unless NO_INTERACTION is set */
-	if (!getenv('NO_INTERACTION')) {
+	if (!getenv('NO_INTERACTION') && !TRAVIS_CI) {
 		$fp = fopen("php://stdin", "r+");
 		if ($sum_results['FAILED'] || $sum_results['BORKED'] || $sum_results['WARNED'] || $sum_results['LEAKED'] || $sum_results['XFAILED']) {
 			echo "\nYou may have found a problem in PHP.";
@@ -335,8 +336,8 @@ function save_or_mail_results()
 		$just_save_results = (strtolower($user_input[0]) == 's');
 	}
 
-	if ($just_save_results || !getenv('NO_INTERACTION')) {
-		if ($just_save_results || strlen(trim($user_input)) == 0 || strtolower($user_input[0]) == 'y') {
+	if ($just_save_results || !getenv('NO_INTERACTION') || TRAVIS_CI) {
+		if ($just_save_results || TRAVIS_CI || strlen(trim($user_input)) == 0 || strtolower($user_input[0]) == 'y') {
 			/*
 			 * Collect information about the host system for our report
 			 * Fetch phpinfo() output so that we can see the PHP enviroment
@@ -348,7 +349,9 @@ function save_or_mail_results()
 			}
 
 			/* Ask the user to provide an email address, so that QA team can contact the user */
-			if (!strncasecmp($user_input, 'y', 1) || strlen(trim($user_input)) == 0) {
+            if (TRAVIS_CI) {
+                $user_email = 'travis at php dot net';
+            } elseif (!strncasecmp($user_input, 'y', 1) || strlen(trim($user_input)) == 0) {
 				echo "\nPlease enter your email address.\n(Your address will be mangled so that it will not go out on any\nmailinglist in plain text): ";
 				flush();
 				$user_email = trim(fgets($fp, 1024));
@@ -424,7 +427,7 @@ function save_or_mail_results()
 			$failed_tests_data .= $sep . "PHPINFO" . $sep;
 			$failed_tests_data .= shell_exec($php . ' -ddisplay_errors=stderr -dhtml_errors=0 -i 2> /dev/null');
 
-			if ($just_save_results || !mail_qa_team($failed_tests_data, $compression, $status)) {
+			if ($just_save_results || !mail_qa_team($failed_tests_data, $compression, $status) && !TRAVIS_CI) {
 				file_put_contents($output_file, $failed_tests_data);
 
 				if (!$just_save_results) {
@@ -432,7 +435,7 @@ function save_or_mail_results()
 				}
 
 				echo "Please send " . $output_file . " to " . PHP_QA_EMAIL . " manually, thank you.\n";
-			} else {
+			} elseif (!getenv('NO_INTERACTION') && !TRAVIS_CI) {
 				fwrite($fp, "\nThank you for helping to make PHP better.\n");
 				fclose($fp);
 			}
diff --git a/travis/compile.sh b/travis/compile.sh
new file mode 100755
index 0000000..f80cc6b
--- /dev/null
+++ b/travis/compile.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+./buildconf
+./configure --with-pdo-mysql --with-mysql --with-sqlite --with-pdo-sqlite
+make


commit fde8762e9034f006826bec12bc6c0aac6b450055
Merge: 77b086f 60c4728
Author: Pierrick Charron <pierrick at php.net>
Date:   Sun May 27 23:43:52 2012 -0400

    Added support for CURLOPT_MAIL_AUTH
    
    pull-request/92:
      Added support for CURLOPT_MAIL_AUTH for libcurl >= 7.25.0



commit 339508d6ace868b022cd59f20630e3218e52732a
Author: Nuno Lopes <nlopess at php.net>
Date:   Sun May 27 20:14:31 2012 -0400

    sync with HEAD

diff --git a/run-tests.php b/run-tests.php
index 1fe0deb..2b37ec4 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -239,10 +239,7 @@ $ini_overwrites = array(
 		'magic_quotes_runtime=0',
 		'ignore_repeated_errors=0',
 		'precision=14',
-		'unicode.runtime_encoding=ISO-8859-1',
-		'unicode.script_encoding=UTF-8',
-		'unicode.output_encoding=UTF-8',
-		'unicode.from_error_mode=U_INVALID_SUBSTITUTE',
+		'memory_limit=128M',
 	);
 
 function write_information($show_html)


commit 72911237b55d9eaaa48a046cbd7cbc4c195c1ee3
Author: Nuno Lopes <nlopess at php.net>
Date:   Sun May 27 20:13:09 2012 -0400

    sync with HEAD

diff --git a/run-tests.php b/run-tests.php
index 1fe0deb..2b37ec4 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -239,10 +239,7 @@ $ini_overwrites = array(
 		'magic_quotes_runtime=0',
 		'ignore_repeated_errors=0',
 		'precision=14',
-		'unicode.runtime_encoding=ISO-8859-1',
-		'unicode.script_encoding=UTF-8',
-		'unicode.output_encoding=UTF-8',
-		'unicode.from_error_mode=U_INVALID_SUBSTITUTE',
+		'memory_limit=128M',
 	);
 
 function write_information($show_html)


commit 77b086f3f0a2207386289b8acf5717d42037ee0d
Author: Nuno Lopes <nlopess at php.net>
Date:   Sun May 27 20:03:58 2012 -0400

    128 MB is enough for everyone (TM)
    
    this is an initial tentative to avoid some testcases go crazy and consume 16 GB of memory. Additional measures will have to be taken if the problem persists.
    Please patch individual tests that really require more than 128MB of memory

diff --git a/run-tests.php b/run-tests.php
index 929de4a..2b37ec4 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -239,6 +239,7 @@ $ini_overwrites = array(
 		'magic_quotes_runtime=0',
 		'ignore_repeated_errors=0',
 		'precision=14',
+		'memory_limit=128M',
 	);
 
 function write_information($show_html)


commit c5d054d3a5fc5cb3ec59fe9205e5dcb3ed8ff0ab
Merge: af2d6a6 e7a7f53
Author: Nuno Lopes <nlopess at php.net>
Date:   Sun May 27 19:58:00 2012 -0400

    Merge branch 'master' of https://git.php.net/push/php-src



commit af2d6a63bf6a187a68164a3cc3384539357ac7b8
Author: Nuno Lopes <nlopess at php.net>
Date:   Sun May 27 19:57:34 2012 -0400

    remove remaining traces of unicode.* ini settings

diff --git a/ext/soap/tests/bugs/bug47273.phpt b/ext/soap/tests/bugs/bug47273.phpt
index 174948f..1cfb0f3 100644
--- a/ext/soap/tests/bugs/bug47273.phpt
+++ b/ext/soap/tests/bugs/bug47273.phpt
@@ -2,9 +2,6 @@
 Bug #47273 (Encoding bug in SoapServer->fault)
 --SKIPIF--
 <?php require_once('skipif.inc'); ?>
---INI--
-unicode.script_encoding=ISO-8859-1
-unicode.output_encoding=ISO-8859-1
 --FILE--
 <?php
 $request1 = <<<EOF
diff --git a/ext/standard/tests/array/compact.phpt b/ext/standard/tests/array/compact.phpt
index 4b4bfbb..02df44e 100644
--- a/ext/standard/tests/array/compact.phpt
+++ b/ext/standard/tests/array/compact.phpt
@@ -1,8 +1,5 @@
 --TEST--
 compact()
---INI--
-unicode.script_encoding=UTF-8
-unicode.output_encoding=UTF-8
 --FILE--
 <?php
 
diff --git a/ext/standard/tests/array/locale_sort.phpt b/ext/standard/tests/array/locale_sort.phpt
index 1db9604..c2f66c0 100644
--- a/ext/standard/tests/array/locale_sort.phpt
+++ b/ext/standard/tests/array/locale_sort.phpt
@@ -9,9 +9,6 @@ if (false == setlocale(LC_CTYPE, "fr_FR.ISO8859-1", "fr_FR")) {
   die("skip setlocale() failed\n");
 }
 ?>
---INI--
-unicode.script_encoding=ISO8859-1
-unicode.output_encoding=ISO8859-1
 --FILE--
 <?php
 setlocale(LC_ALL, 'fr_FR.ISO8859-1', 'fr_FR');
diff --git a/run-tests.php b/run-tests.php
index 1fe0deb..929de4a 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -239,10 +239,6 @@ $ini_overwrites = array(
 		'magic_quotes_runtime=0',
 		'ignore_repeated_errors=0',
 		'precision=14',
-		'unicode.runtime_encoding=ISO-8859-1',
-		'unicode.script_encoding=UTF-8',
-		'unicode.output_encoding=UTF-8',
-		'unicode.from_error_mode=U_INVALID_SUBSTITUTE',
 	);
 
 function write_information($show_html)


commit 60c47285941490a5cc91aada4a7f0cfbbc42561d
Author: Your Name <william.betts at gmail.com>
Date:   Sun May 27 15:39:45 2012 -0700

    VIM uses spaces as tabs and that doesn't comply with the coding
    standard. I think I'd fixed it so it's using real tabs now.

diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index c066d6b..14836cc 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -2219,7 +2219,7 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
 		case CURLOPT_DNS_SERVERS:
 #endif	
 #if LIBCURL_VERSION_NUM >= 0x071900 /* Available since 7.25.0 */
-        case CURLOPT_MAIL_AUTH:
+		case CURLOPT_MAIL_AUTH:
 #endif
 		{
 #if LIBCURL_VERSION_NUM < 0x071100


commit 0667da8cb42d7df70175b47a910ae127d5cf6246
Author: Your Name <william.betts at gmail.com>
Date:   Sun May 27 01:50:29 2012 -0700

    Removed syslog.h. That should never have been commited.

diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index f6e0b05..c066d6b 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -18,7 +18,6 @@
 
 /* $Id$ */
 
-#include <syslog.h>
 #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
 
 #ifdef HAVE_CONFIG_H


commit d41fb16a52a374b070d35253c9599c8d6f609b7a
Author: Your Name <william.betts at gmail.com>
Date:   Sun May 27 00:21:08 2012 -0700

    Fixed the libcurl version checking for CURLOPT_MAIL_AUTH

diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index 09f4974..f6e0b05 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -1036,7 +1036,6 @@ PHP_MINIT_FUNCTION(curl)
 	REGISTER_CURL_CONSTANT(CURLINFO_RTSP_SERVER_CSEQ);
 	REGISTER_CURL_CONSTANT(CURLINFO_RTSP_SESSION_ID);
 	REGISTER_CURL_CONSTANT(CURLOPT_FTP_USE_PRET);
-	REGISTER_CURL_CONSTANT(CURLOPT_MAIL_AUTH);
 	REGISTER_CURL_CONSTANT(CURLOPT_MAIL_FROM);
 	REGISTER_CURL_CONSTANT(CURLOPT_MAIL_RCPT);
 	REGISTER_CURL_CONSTANT(CURLOPT_RTSP_CLIENT_CSEQ);
@@ -1107,6 +1106,10 @@ PHP_MINIT_FUNCTION(curl)
 	REGISTER_CURL_CONSTANT(CURLOPT_DNS_SERVERS);
 #endif
 
+#if LIBCURL_VERSION_NUM >= 0x071900 /* Available since 7.25.0 */
+	REGISTER_CURL_CONSTANT(CURLOPT_MAIL_AUTH);
+#endif
+
 #if CURLOPT_FTPASCII != 0
 	REGISTER_CURL_CONSTANT(CURLOPT_FTPASCII);
 #endif


commit f75c1ed201102aedfe9e04b24c6d74fe2f74b53d
Author: Your Name <william.betts at gmail.com>
Date:   Sun May 27 00:02:53 2012 -0700

    Added support for CURLOPT_MAIL_AUTH

diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index 3533991..09f4974 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -18,6 +18,7 @@
 
 /* $Id$ */
 
+#include <syslog.h>
 #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
 
 #ifdef HAVE_CONFIG_H
@@ -1035,6 +1036,7 @@ PHP_MINIT_FUNCTION(curl)
 	REGISTER_CURL_CONSTANT(CURLINFO_RTSP_SERVER_CSEQ);
 	REGISTER_CURL_CONSTANT(CURLINFO_RTSP_SESSION_ID);
 	REGISTER_CURL_CONSTANT(CURLOPT_FTP_USE_PRET);
+	REGISTER_CURL_CONSTANT(CURLOPT_MAIL_AUTH);
 	REGISTER_CURL_CONSTANT(CURLOPT_MAIL_FROM);
 	REGISTER_CURL_CONSTANT(CURLOPT_MAIL_RCPT);
 	REGISTER_CURL_CONSTANT(CURLOPT_RTSP_CLIENT_CSEQ);
@@ -2214,6 +2216,9 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
 #if LIBCURL_VERSION_NUM >= 0x071800 /* Available since 7.24.0 */
 		case CURLOPT_DNS_SERVERS:
 #endif	
+#if LIBCURL_VERSION_NUM >= 0x071900 /* Available since 7.25.0 */
+        case CURLOPT_MAIL_AUTH:
+#endif
 		{
 #if LIBCURL_VERSION_NUM < 0x071100
 			char *copystr = NULL;


commit e7a7f533e32813b13255efa236b711f6d1f6325d
Author: Jerome Loyet <fat at php.net>
Date:   Sat May 26 19:37:24 2012 +0200

    Fixed bug #61218 (the previous patch was not enough restritive on fcgi name string checks)

diff --git a/sapi/fpm/fpm/fastcgi.c b/sapi/fpm/fpm/fastcgi.c
index 9df26f1..e2e208a 100644
--- a/sapi/fpm/fpm/fastcgi.c
+++ b/sapi/fpm/fpm/fastcgi.c
@@ -395,12 +395,39 @@ static inline size_t fcgi_get_params_len( int *result, unsigned char *p, unsigne
 	return ret;
 }
 
+static inline int fcgi_param_get_eff_len( unsigned char *p, unsigned char *end, uint *eff_len)
+{
+	int ret = 1;
+	int zero_found = 0;
+	*eff_len = 0;
+	for (; p != end; ++p) {
+		if (*p == '\0') {
+			zero_found = 1;
+		}
+		else {
+			if (zero_found) {
+				ret = 0;
+				break;
+			}
+			if (*eff_len < ((uint)-1)) {
+				++*eff_len;
+			}
+			else {
+				ret = 0;
+				break;
+			}
+		}
+	}
+	return ret;
+}
+
 static int fcgi_get_params(fcgi_request *req, unsigned char *p, unsigned char *end)
 {
 	char buf[128];
 	char *tmp = buf;
 	size_t buf_size = sizeof(buf);
 	int name_len, val_len;
+	uint eff_name_len;
 	char *s;
 	int ret = 1;
 	size_t bytes_consumed;
@@ -427,26 +454,35 @@ static int fcgi_get_params(fcgi_request *req, unsigned char *p, unsigned char *e
 			break;
 		}
 
-		if (name_len >= buf_size-1) {
-			if (name_len > ((uint)-1)-64) { 
+		/*
+		 * get the effective length of the name in case it's not a valid string
+		 * don't do this on the value because it can be binary data
+		 */
+		if (!fcgi_param_get_eff_len(p, p+name_len, &eff_name_len)){
+			/* Malicious request */
+			ret = 0;
+			break;
+		}
+		if (eff_name_len >= buf_size-1) {
+			if (eff_name_len > ((uint)-1)-64) { 
 				ret = 0;
 				break;
 			}
-			buf_size = name_len + 64;
+			buf_size = eff_name_len + 64;
 			tmp = (tmp == buf ? emalloc(buf_size): erealloc(tmp, buf_size));
 			if (tmp == NULL) {
 				ret = 0;
 				break;
 			}
 		}
-		memcpy(tmp, p, name_len);
-		tmp[name_len] = 0;
+		memcpy(tmp, p, eff_name_len);
+		tmp[eff_name_len] = 0;
 		s = estrndup((char*)p + name_len, val_len);
 		if (s == NULL) {
 			ret = 0;
 			break;
 		}
-		zend_hash_update(req->env, tmp, name_len+1, &s, sizeof(char*), NULL);
+		zend_hash_update(req->env, tmp, eff_name_len+1, &s, sizeof(char*), NULL);
 		p += name_len + val_len;
 	}
 	if (tmp != buf && tmp != NULL) {


commit 773e85a788de7dc557201d4af2cb10250c049052
Author: Jerome Loyet <fat at php.net>
Date:   Sat May 26 19:37:09 2012 +0200

    Fixed bug #61218 (the previous patch was not enough restritive on fcgi name string checks)

diff --git a/sapi/fpm/fpm/fastcgi.c b/sapi/fpm/fpm/fastcgi.c
index 9df26f1..e2e208a 100644
--- a/sapi/fpm/fpm/fastcgi.c
+++ b/sapi/fpm/fpm/fastcgi.c
@@ -395,12 +395,39 @@ static inline size_t fcgi_get_params_len( int *result, unsigned char *p, unsigne
 	return ret;
 }
 
+static inline int fcgi_param_get_eff_len( unsigned char *p, unsigned char *end, uint *eff_len)
+{
+	int ret = 1;
+	int zero_found = 0;
+	*eff_len = 0;
+	for (; p != end; ++p) {
+		if (*p == '\0') {
+			zero_found = 1;
+		}
+		else {
+			if (zero_found) {
+				ret = 0;
+				break;
+			}
+			if (*eff_len < ((uint)-1)) {
+				++*eff_len;
+			}
+			else {
+				ret = 0;
+				break;
+			}
+		}
+	}
+	return ret;
+}
+
 static int fcgi_get_params(fcgi_request *req, unsigned char *p, unsigned char *end)
 {
 	char buf[128];
 	char *tmp = buf;
 	size_t buf_size = sizeof(buf);
 	int name_len, val_len;
+	uint eff_name_len;
 	char *s;
 	int ret = 1;
 	size_t bytes_consumed;
@@ -427,26 +454,35 @@ static int fcgi_get_params(fcgi_request *req, unsigned char *p, unsigned char *e
 			break;
 		}
 
-		if (name_len >= buf_size-1) {
-			if (name_len > ((uint)-1)-64) { 
+		/*
+		 * get the effective length of the name in case it's not a valid string
+		 * don't do this on the value because it can be binary data
+		 */
+		if (!fcgi_param_get_eff_len(p, p+name_len, &eff_name_len)){
+			/* Malicious request */
+			ret = 0;
+			break;
+		}
+		if (eff_name_len >= buf_size-1) {
+			if (eff_name_len > ((uint)-1)-64) { 
 				ret = 0;
 				break;
 			}
-			buf_size = name_len + 64;
+			buf_size = eff_name_len + 64;
 			tmp = (tmp == buf ? emalloc(buf_size): erealloc(tmp, buf_size));
 			if (tmp == NULL) {
 				ret = 0;
 				break;
 			}
 		}
-		memcpy(tmp, p, name_len);
-		tmp[name_len] = 0;
+		memcpy(tmp, p, eff_name_len);
+		tmp[eff_name_len] = 0;
 		s = estrndup((char*)p + name_len, val_len);
 		if (s == NULL) {
 			ret = 0;
 			break;
 		}
-		zend_hash_update(req->env, tmp, name_len+1, &s, sizeof(char*), NULL);
+		zend_hash_update(req->env, tmp, eff_name_len+1, &s, sizeof(char*), NULL);
 		p += name_len + val_len;
 	}
 	if (tmp != buf && tmp != NULL) {


commit 2f7bd57f930bcfdc97b7472fbe6a502cafdc5a59
Author: Jerome Loyet <fat at php.net>
Date:   Sat May 26 19:36:01 2012 +0200

    Fixed bug #61218 (the previous patch was not enough restritive on fcgi name string checks)

diff --git a/sapi/fpm/fpm/fastcgi.c b/sapi/fpm/fpm/fastcgi.c
index 9df26f1..e2e208a 100644
--- a/sapi/fpm/fpm/fastcgi.c
+++ b/sapi/fpm/fpm/fastcgi.c
@@ -395,12 +395,39 @@ static inline size_t fcgi_get_params_len( int *result, unsigned char *p, unsigne
 	return ret;
 }
 
+static inline int fcgi_param_get_eff_len( unsigned char *p, unsigned char *end, uint *eff_len)
+{
+	int ret = 1;
+	int zero_found = 0;
+	*eff_len = 0;
+	for (; p != end; ++p) {
+		if (*p == '\0') {
+			zero_found = 1;
+		}
+		else {
+			if (zero_found) {
+				ret = 0;
+				break;
+			}
+			if (*eff_len < ((uint)-1)) {
+				++*eff_len;
+			}
+			else {
+				ret = 0;
+				break;
+			}
+		}
+	}
+	return ret;
+}
+
 static int fcgi_get_params(fcgi_request *req, unsigned char *p, unsigned char *end)
 {
 	char buf[128];
 	char *tmp = buf;
 	size_t buf_size = sizeof(buf);
 	int name_len, val_len;
+	uint eff_name_len;
 	char *s;
 	int ret = 1;
 	size_t bytes_consumed;
@@ -427,26 +454,35 @@ static int fcgi_get_params(fcgi_request *req, unsigned char *p, unsigned char *e
 			break;
 		}
 
-		if (name_len >= buf_size-1) {
-			if (name_len > ((uint)-1)-64) { 
+		/*
+		 * get the effective length of the name in case it's not a valid string
+		 * don't do this on the value because it can be binary data
+		 */
+		if (!fcgi_param_get_eff_len(p, p+name_len, &eff_name_len)){
+			/* Malicious request */
+			ret = 0;
+			break;
+		}
+		if (eff_name_len >= buf_size-1) {
+			if (eff_name_len > ((uint)-1)-64) { 
 				ret = 0;
 				break;
 			}
-			buf_size = name_len + 64;
+			buf_size = eff_name_len + 64;
 			tmp = (tmp == buf ? emalloc(buf_size): erealloc(tmp, buf_size));
 			if (tmp == NULL) {
 				ret = 0;
 				break;
 			}
 		}
-		memcpy(tmp, p, name_len);
-		tmp[name_len] = 0;
+		memcpy(tmp, p, eff_name_len);
+		tmp[eff_name_len] = 0;
 		s = estrndup((char*)p + name_len, val_len);
 		if (s == NULL) {
 			ret = 0;
 			break;
 		}
-		zend_hash_update(req->env, tmp, name_len+1, &s, sizeof(char*), NULL);
+		zend_hash_update(req->env, tmp, eff_name_len+1, &s, sizeof(char*), NULL);
 		p += name_len + val_len;
 	}
 	if (tmp != buf && tmp != NULL) {


commit 78de6eb03d3a24691d9f535e2cbe768a9ba8bd48
Author: Jerome Loyet <fat at php.net>
Date:   Sat May 26 19:29:01 2012 +0200

    Fixed bug #61218 (FPM drops connection while receiving some binary values in FastCGI requests)

diff --git a/sapi/fpm/fpm/fastcgi.c b/sapi/fpm/fpm/fastcgi.c
index 212b6ff..9df26f1 100644
--- a/sapi/fpm/fpm/fastcgi.c
+++ b/sapi/fpm/fpm/fastcgi.c
@@ -395,39 +395,12 @@ static inline size_t fcgi_get_params_len( int *result, unsigned char *p, unsigne
 	return ret;
 }
 
-static inline int fcgi_param_get_eff_len( unsigned char *p, unsigned char *end, uint *eff_len)
-{
-	int ret = 1;
-	int zero_found = 0;
-        *eff_len = 0;
-	for (; p != end; ++p) {
-		if (*p == '\0') {
-			zero_found = 1;
-		}
-		else {
-			if (zero_found) {
-				ret = 0;
-				break;
-			}
-			if (*eff_len < ((uint)-1)) {
-				++*eff_len;
-			}
-			else {
-				ret = 0;
-				break;
-			}
-		}
-	}
-	return ret;
-}
-
 static int fcgi_get_params(fcgi_request *req, unsigned char *p, unsigned char *end)
 {
 	char buf[128];
 	char *tmp = buf;
 	size_t buf_size = sizeof(buf);
 	int name_len, val_len;
-	uint eff_name_len, eff_val_len;
 	char *s;
 	int ret = 1;
 	size_t bytes_consumed;
@@ -453,32 +426,27 @@ static int fcgi_get_params(fcgi_request *req, unsigned char *p, unsigned char *e
 			ret = 0;
 			break;
 		}
-		if (!fcgi_param_get_eff_len(p, p+name_len, &eff_name_len) ||
-		    !fcgi_param_get_eff_len(p+name_len, p+name_len+val_len, &eff_val_len)) {
-			/* Malicious request */
-			ret = 0;
-			break;
-		}
-		if (eff_name_len >= buf_size-1) {
-			if (eff_name_len > ((uint)-1)-64) { 
+
+		if (name_len >= buf_size-1) {
+			if (name_len > ((uint)-1)-64) { 
 				ret = 0;
 				break;
 			}
-			buf_size = eff_name_len + 64;
+			buf_size = name_len + 64;
 			tmp = (tmp == buf ? emalloc(buf_size): erealloc(tmp, buf_size));
 			if (tmp == NULL) {
 				ret = 0;
 				break;
 			}
 		}
-		memcpy(tmp, p, eff_name_len);
-		tmp[eff_name_len] = 0;
-		s = estrndup((char*)p + name_len, eff_val_len);
+		memcpy(tmp, p, name_len);
+		tmp[name_len] = 0;
+		s = estrndup((char*)p + name_len, val_len);
 		if (s == NULL) {
 			ret = 0;
 			break;
 		}
-		zend_hash_update(req->env, tmp, eff_name_len+1, &s, sizeof(char*), NULL);
+		zend_hash_update(req->env, tmp, name_len+1, &s, sizeof(char*), NULL);
 		p += name_len + val_len;
 	}
 	if (tmp != buf && tmp != NULL) {


commit 60cca8b9c9b879295dbf1f76e305882e347dcb53
Author: Jerome Loyet <fat at php.net>
Date:   Sat May 26 19:27:45 2012 +0200

    Fixed bug #61218 (FPM drops connection while receiving some binary values in FastCGI requests)

diff --git a/NEWS b/NEWS
index 8314eda..eed55f1 100644
--- a/NEWS
+++ b/NEWS
@@ -66,6 +66,8 @@ PHP                                                                        NEWS
   . Fixed bug #62153 (when using unix sockets, multiples FPM instances
     can be launched without errors). (fat)
   . Fixed bug #62160 (Add process.priority to set nice(2) priorities). (fat)
+  . Fixed bug #61218 (FPM drops connection while receiving some binary values
+    in FastCGI requests). (fat)
 
 - Intl
   . ResourceBundle constructor now accepts NULL for the first two arguments.
diff --git a/sapi/fpm/fpm/fastcgi.c b/sapi/fpm/fpm/fastcgi.c
index 212b6ff..9df26f1 100644
--- a/sapi/fpm/fpm/fastcgi.c
+++ b/sapi/fpm/fpm/fastcgi.c
@@ -395,39 +395,12 @@ static inline size_t fcgi_get_params_len( int *result, unsigned char *p, unsigne
 	return ret;
 }
 
-static inline int fcgi_param_get_eff_len( unsigned char *p, unsigned char *end, uint *eff_len)
-{
-	int ret = 1;
-	int zero_found = 0;
-        *eff_len = 0;
-	for (; p != end; ++p) {
-		if (*p == '\0') {
-			zero_found = 1;
-		}
-		else {
-			if (zero_found) {
-				ret = 0;
-				break;
-			}
-			if (*eff_len < ((uint)-1)) {
-				++*eff_len;
-			}
-			else {
-				ret = 0;
-				break;
-			}
-		}
-	}
-	return ret;
-}
-
 static int fcgi_get_params(fcgi_request *req, unsigned char *p, unsigned char *end)
 {
 	char buf[128];
 	char *tmp = buf;
 	size_t buf_size = sizeof(buf);
 	int name_len, val_len;
-	uint eff_name_len, eff_val_len;
 	char *s;
 	int ret = 1;
 	size_t bytes_consumed;
@@ -453,32 +426,27 @@ static int fcgi_get_params(fcgi_request *req, unsigned char *p, unsigned char *e
 			ret = 0;
 			break;
 		}
-		if (!fcgi_param_get_eff_len(p, p+name_len, &eff_name_len) ||
-		    !fcgi_param_get_eff_len(p+name_len, p+name_len+val_len, &eff_val_len)) {
-			/* Malicious request */
-			ret = 0;
-			break;
-		}
-		if (eff_name_len >= buf_size-1) {
-			if (eff_name_len > ((uint)-1)-64) { 
+
+		if (name_len >= buf_size-1) {
+			if (name_len > ((uint)-1)-64) { 
 				ret = 0;
 				break;
 			}
-			buf_size = eff_name_len + 64;
+			buf_size = name_len + 64;
 			tmp = (tmp == buf ? emalloc(buf_size): erealloc(tmp, buf_size));
 			if (tmp == NULL) {
 				ret = 0;
 				break;
 			}
 		}
-		memcpy(tmp, p, eff_name_len);
-		tmp[eff_name_len] = 0;
-		s = estrndup((char*)p + name_len, eff_val_len);
+		memcpy(tmp, p, name_len);
+		tmp[name_len] = 0;
+		s = estrndup((char*)p + name_len, val_len);
 		if (s == NULL) {
 			ret = 0;
 			break;
 		}
-		zend_hash_update(req->env, tmp, eff_name_len+1, &s, sizeof(char*), NULL);
+		zend_hash_update(req->env, tmp, name_len+1, &s, sizeof(char*), NULL);
 		p += name_len + val_len;
 	}
 	if (tmp != buf && tmp != NULL) {


commit e7ff3e839b4c2a3423729b07ba1d40f45f1d2983
Author: Jerome Loyet <fat at php.net>
Date:   Sat May 26 19:27:02 2012 +0200

    Fixed bug #61218 (FPM drops connection while receiving some binary valuesin FastCGI requests)

diff --git a/NEWS b/NEWS
index 3981b1f..6863a73 100644
--- a/NEWS
+++ b/NEWS
@@ -18,6 +18,8 @@ PHP                                                                        NEWS
   . Fixed bug #62153 (when using unix sockets, multiples FPM instances
     can be launched without errors). (fat)
   . Fixed bug #62160 (Add process.priority to set nice(2) priorities). (fat)
+  . Fixed bug #61218 (FPM drops connection while receiving some binary values
+    in FastCGI requests). (fat)
 
 - Intl:
   . Fixed bug #62083 (grapheme_extract() memory leaks). (Gustavo)
diff --git a/sapi/fpm/fpm/fastcgi.c b/sapi/fpm/fpm/fastcgi.c
index 212b6ff..9df26f1 100644
--- a/sapi/fpm/fpm/fastcgi.c
+++ b/sapi/fpm/fpm/fastcgi.c
@@ -395,39 +395,12 @@ static inline size_t fcgi_get_params_len( int *result, unsigned char *p, unsigne
 	return ret;
 }
 
-static inline int fcgi_param_get_eff_len( unsigned char *p, unsigned char *end, uint *eff_len)
-{
-	int ret = 1;
-	int zero_found = 0;
-        *eff_len = 0;
-	for (; p != end; ++p) {
-		if (*p == '\0') {
-			zero_found = 1;
-		}
-		else {
-			if (zero_found) {
-				ret = 0;
-				break;
-			}
-			if (*eff_len < ((uint)-1)) {
-				++*eff_len;
-			}
-			else {
-				ret = 0;
-				break;
-			}
-		}
-	}
-	return ret;
-}
-
 static int fcgi_get_params(fcgi_request *req, unsigned char *p, unsigned char *end)
 {
 	char buf[128];
 	char *tmp = buf;
 	size_t buf_size = sizeof(buf);
 	int name_len, val_len;
-	uint eff_name_len, eff_val_len;
 	char *s;
 	int ret = 1;
 	size_t bytes_consumed;
@@ -453,32 +426,27 @@ static int fcgi_get_params(fcgi_request *req, unsigned char *p, unsigned char *e
 			ret = 0;
 			break;
 		}
-		if (!fcgi_param_get_eff_len(p, p+name_len, &eff_name_len) ||
-		    !fcgi_param_get_eff_len(p+name_len, p+name_len+val_len, &eff_val_len)) {
-			/* Malicious request */
-			ret = 0;
-			break;
-		}
-		if (eff_name_len >= buf_size-1) {
-			if (eff_name_len > ((uint)-1)-64) { 
+
+		if (name_len >= buf_size-1) {
+			if (name_len > ((uint)-1)-64) { 
 				ret = 0;
 				break;
 			}
-			buf_size = eff_name_len + 64;
+			buf_size = name_len + 64;
 			tmp = (tmp == buf ? emalloc(buf_size): erealloc(tmp, buf_size));
 			if (tmp == NULL) {
 				ret = 0;
 				break;
 			}
 		}
-		memcpy(tmp, p, eff_name_len);
-		tmp[eff_name_len] = 0;
-		s = estrndup((char*)p + name_len, eff_val_len);
+		memcpy(tmp, p, name_len);
+		tmp[name_len] = 0;
+		s = estrndup((char*)p + name_len, val_len);
 		if (s == NULL) {
 			ret = 0;
 			break;
 		}
-		zend_hash_update(req->env, tmp, eff_name_len+1, &s, sizeof(char*), NULL);
+		zend_hash_update(req->env, tmp, name_len+1, &s, sizeof(char*), NULL);
 		p += name_len + val_len;
 	}
 	if (tmp != buf && tmp != NULL) {


commit 0225300b7067f4396e2bce57d549b8da9126c33e
Author: Jerome Loyet <fat at php.net>
Date:   Sat May 26 18:48:56 2012 +0200

    Fixed bug #62033 (USR2 signal was sent even if not catch when daemonize and an error occured)

diff --git a/sapi/fpm/fpm/fpm.c b/sapi/fpm/fpm/fpm.c
index 176dbaf..dab415d 100644
--- a/sapi/fpm/fpm/fpm.c
+++ b/sapi/fpm/fpm/fpm.c
@@ -39,6 +39,7 @@ struct fpm_globals_s fpm_globals = {
 	.test_successful = 0,
 	.heartbeat = 0,
 	.run_as_root = 0,
+	.send_config_signal = 0,
 };
 
 int fpm_init(int argc, char **argv, char *config, char *prefix, char *pid, int test_conf, int run_as_root) /* {{{ */
diff --git a/sapi/fpm/fpm/fpm.h b/sapi/fpm/fpm/fpm.h
index b0bed0a..7a2903d 100644
--- a/sapi/fpm/fpm/fpm.h
+++ b/sapi/fpm/fpm/fpm.h
@@ -55,6 +55,7 @@ struct fpm_globals_s {
 	int test_successful;
 	int heartbeat;
 	int run_as_root;
+	int send_config_signal;
 };
 
 extern struct fpm_globals_s fpm_globals;
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index c3fd2bc..83b461b 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -1799,14 +1799,14 @@ consult the installation file that came with this distribution, or visit \n\
 
 	if (0 > fpm_init(argc, argv, fpm_config ? fpm_config : CGIG(fpm_config), fpm_prefix, fpm_pid, test_conf, php_allow_to_run_as_root)) {
 
-		if (fpm_global_config.daemonize) {
+		if (fpm_globals.send_config_signal) {
 			zlog(ZLOG_DEBUG, "Sending SIGUSR2 (error) to parent %d", getppid());
 			kill(getppid(), SIGUSR2);
 		}
 		return FPM_EXIT_CONFIG;
 	}
 
-	if (fpm_global_config.daemonize) {
+	if (fpm_globals.send_config_signal) {
 		zlog(ZLOG_DEBUG, "Sending SIGUSR1 (OK) to parent %d", getppid());
 		kill(getppid(), SIGUSR1);
 	}
diff --git a/sapi/fpm/fpm/fpm_unix.c b/sapi/fpm/fpm/fpm_unix.c
index 0f4d383..5c5e37c 100644
--- a/sapi/fpm/fpm/fpm_unix.c
+++ b/sapi/fpm/fpm/fpm_unix.c
@@ -305,6 +305,7 @@ int fpm_unix_init_main() /* {{{ */
 				/* restore USR1 and USR2 sigaction */
 				sigaction(SIGUSR1, &oldact_usr1, NULL);
 				sigaction(SIGUSR2, &oldact_usr2, NULL);
+				fpm_globals.send_config_signal = 1;
 				break;
 
 			default : /* parent */


commit e052da3a6bc353636fa4bf9cb488573c50adf9a0
Author: Jerome Loyet <fat at php.net>
Date:   Sat May 26 18:48:40 2012 +0200

    Fixed bug #62033 (USR2 signal was sent even if not catch when daemonize and an error occured)

diff --git a/sapi/fpm/fpm/fpm.c b/sapi/fpm/fpm/fpm.c
index 176dbaf..dab415d 100644
--- a/sapi/fpm/fpm/fpm.c
+++ b/sapi/fpm/fpm/fpm.c
@@ -39,6 +39,7 @@ struct fpm_globals_s fpm_globals = {
 	.test_successful = 0,
 	.heartbeat = 0,
 	.run_as_root = 0,
+	.send_config_signal = 0,
 };
 
 int fpm_init(int argc, char **argv, char *config, char *prefix, char *pid, int test_conf, int run_as_root) /* {{{ */
diff --git a/sapi/fpm/fpm/fpm.h b/sapi/fpm/fpm/fpm.h
index b0bed0a..7a2903d 100644
--- a/sapi/fpm/fpm/fpm.h
+++ b/sapi/fpm/fpm/fpm.h
@@ -55,6 +55,7 @@ struct fpm_globals_s {
 	int test_successful;
 	int heartbeat;
 	int run_as_root;
+	int send_config_signal;
 };
 
 extern struct fpm_globals_s fpm_globals;
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index c3fd2bc..83b461b 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -1799,14 +1799,14 @@ consult the installation file that came with this distribution, or visit \n\
 
 	if (0 > fpm_init(argc, argv, fpm_config ? fpm_config : CGIG(fpm_config), fpm_prefix, fpm_pid, test_conf, php_allow_to_run_as_root)) {
 
-		if (fpm_global_config.daemonize) {
+		if (fpm_globals.send_config_signal) {
 			zlog(ZLOG_DEBUG, "Sending SIGUSR2 (error) to parent %d", getppid());
 			kill(getppid(), SIGUSR2);
 		}
 		return FPM_EXIT_CONFIG;
 	}
 
-	if (fpm_global_config.daemonize) {
+	if (fpm_globals.send_config_signal) {
 		zlog(ZLOG_DEBUG, "Sending SIGUSR1 (OK) to parent %d", getppid());
 		kill(getppid(), SIGUSR1);
 	}
diff --git a/sapi/fpm/fpm/fpm_unix.c b/sapi/fpm/fpm/fpm_unix.c
index 0f4d383..5c5e37c 100644
--- a/sapi/fpm/fpm/fpm_unix.c
+++ b/sapi/fpm/fpm/fpm_unix.c
@@ -305,6 +305,7 @@ int fpm_unix_init_main() /* {{{ */
 				/* restore USR1 and USR2 sigaction */
 				sigaction(SIGUSR1, &oldact_usr1, NULL);
 				sigaction(SIGUSR2, &oldact_usr2, NULL);
+				fpm_globals.send_config_signal = 1;
 				break;
 
 			default : /* parent */


commit 0298b92b69e5637e8d151790ad6369f7980a406a
Author: Jerome Loyet <fat at php.net>
Date:   Sat May 26 18:44:35 2012 +0200

    - Fixed bug #62033 (USR2 signal was sent even if not catch when daemonize and an error occured)

diff --git a/sapi/fpm/fpm/fpm.c b/sapi/fpm/fpm/fpm.c
index 176dbaf..dab415d 100644
--- a/sapi/fpm/fpm/fpm.c
+++ b/sapi/fpm/fpm/fpm.c
@@ -39,6 +39,7 @@ struct fpm_globals_s fpm_globals = {
 	.test_successful = 0,
 	.heartbeat = 0,
 	.run_as_root = 0,
+	.send_config_signal = 0,
 };
 
 int fpm_init(int argc, char **argv, char *config, char *prefix, char *pid, int test_conf, int run_as_root) /* {{{ */
diff --git a/sapi/fpm/fpm/fpm.h b/sapi/fpm/fpm/fpm.h
index b0bed0a..7a2903d 100644
--- a/sapi/fpm/fpm/fpm.h
+++ b/sapi/fpm/fpm/fpm.h
@@ -55,6 +55,7 @@ struct fpm_globals_s {
 	int test_successful;
 	int heartbeat;
 	int run_as_root;
+	int send_config_signal;
 };
 
 extern struct fpm_globals_s fpm_globals;
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index 08477da..9c314f5 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -1804,14 +1804,14 @@ consult the installation file that came with this distribution, or visit \n\
 
 	if (0 > fpm_init(argc, argv, fpm_config ? fpm_config : CGIG(fpm_config), fpm_prefix, fpm_pid, test_conf, php_allow_to_run_as_root)) {
 
-		if (fpm_global_config.daemonize) {
+		if (fpm_globals.send_config_signal) {
 			zlog(ZLOG_DEBUG, "Sending SIGUSR2 (error) to parent %d", getppid());
 			kill(getppid(), SIGUSR2);
 		}
 		return FPM_EXIT_CONFIG;
 	}
 
-	if (fpm_global_config.daemonize) {
+	if (fpm_globals.send_config_signal) {
 		zlog(ZLOG_DEBUG, "Sending SIGUSR1 (OK) to parent %d", getppid());
 		kill(getppid(), SIGUSR1);
 	}
diff --git a/sapi/fpm/fpm/fpm_unix.c b/sapi/fpm/fpm/fpm_unix.c
index 0f4d383..5c5e37c 100644
--- a/sapi/fpm/fpm/fpm_unix.c
+++ b/sapi/fpm/fpm/fpm_unix.c
@@ -305,6 +305,7 @@ int fpm_unix_init_main() /* {{{ */
 				/* restore USR1 and USR2 sigaction */
 				sigaction(SIGUSR1, &oldact_usr1, NULL);
 				sigaction(SIGUSR2, &oldact_usr2, NULL);
+				fpm_globals.send_config_signal = 1;
 				break;
 
 			default : /* parent */


commit 7127135c8705d947a01ee637444c1db2adf37b1d
Author: Jerome Loyet <fat at php.net>
Date:   Sat May 26 18:24:28 2012 +0200

    - Fixed bug #62160 (Add process.priority to set nice(2) priorities)

diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c
index a4283a2..1f3258f 100644
--- a/sapi/fpm/fpm/fpm_conf.c
+++ b/sapi/fpm/fpm/fpm_conf.c
@@ -70,6 +70,7 @@ struct fpm_global_config_s fpm_global_config = {
 	.syslog_facility = -1,
 #endif
 	.process_max = 0,
+	.process_priority = 64, /* 64 means unset */
 };
 static struct fpm_worker_pool_s *current_wp = NULL;
 static int ini_recursion = 0;
@@ -92,6 +93,7 @@ static struct ini_value_parser_s ini_fpm_global_options[] = {
 	{ "emergency_restart_interval",  &fpm_conf_set_time,            GO(emergency_restart_interval) },
 	{ "process_control_timeout",     &fpm_conf_set_time,            GO(process_control_timeout) },
 	{ "process.max",                 &fpm_conf_set_integer,         GO(process_max) },
+	{ "process.priority",            &fpm_conf_set_integer,         GO(process_priority) },
 	{ "daemonize",                   &fpm_conf_set_boolean,         GO(daemonize) },
 	{ "rlimit_files",                &fpm_conf_set_integer,         GO(rlimit_files) },
 	{ "rlimit_core",                 &fpm_conf_set_rlimit_core,     GO(rlimit_core) },
@@ -112,6 +114,7 @@ static struct ini_value_parser_s ini_fpm_pool_options[] = {
 	{ "listen.group",              &fpm_conf_set_string,      WPO(listen_group) },
 	{ "listen.mode",               &fpm_conf_set_string,      WPO(listen_mode) },
 	{ "listen.allowed_clients",    &fpm_conf_set_string,      WPO(listen_allowed_clients) },
+	{ "process.priority",          &fpm_conf_set_integer,     WPO(process_priority) },
 	{ "pm",                        &fpm_conf_set_pm,          WPO(pm) },
 	{ "pm.max_children",           &fpm_conf_set_integer,     WPO(pm_max_children) },
 	{ "pm.start_servers",          &fpm_conf_set_integer,     WPO(pm_start_servers) },
@@ -577,6 +580,7 @@ static void *fpm_worker_pool_config_alloc() /* {{{ */
 	memset(wp->config, 0, sizeof(struct fpm_worker_pool_config_s));
 	wp->config->listen_backlog = FPM_BACKLOG_DEFAULT;
 	wp->config->pm_process_idle_timeout = 10; /* 10s by default */
+	wp->config->process_priority = 64; /* 64 means unset */
 
 	if (!fpm_worker_all_pools) {
 		fpm_worker_all_pools = wp;
@@ -741,6 +745,11 @@ static int fpm_conf_process_all_pools() /* {{{ */
 			return -1;
 		}
 
+		if (wp->config->process_priority != 64 && (wp->config->process_priority < -19 || wp->config->process_priority > 20)) {
+			zlog(ZLOG_ERROR, "[pool %s] process.priority must be included into [-19,20]", wp->config->name);
+			return -1;
+		}
+
 		/* pm */
 		if (wp->config->pm != PM_STYLE_STATIC && wp->config->pm != PM_STYLE_DYNAMIC && wp->config->pm != PM_STYLE_ONDEMAND) {
 			zlog(ZLOG_ALERT, "[pool %s] the process manager is missing (static, dynamic or ondemand)", wp->config->name);
@@ -1117,6 +1126,11 @@ static int fpm_conf_post_process(TSRMLS_D) /* {{{ */
 		return -1;
 	}
 
+	if (fpm_global_config.process_priority != 64 && (fpm_global_config.process_priority < -19 || fpm_global_config.process_priority > 20)) {
+		zlog(ZLOG_ERROR, "process.priority must be included into [-19,20]");
+		return -1;
+	}
+
 	if (!fpm_global_config.error_log) {
 		fpm_global_config.error_log = strdup("log/php-fpm.log");
 	}
@@ -1499,6 +1513,11 @@ static void fpm_conf_dump() /* {{{ */
 	zlog(ZLOG_NOTICE, "\temergency_restart_threshold = %d", fpm_global_config.emergency_restart_threshold);
 	zlog(ZLOG_NOTICE, "\tprocess_control_timeout = %ds",    fpm_global_config.process_control_timeout);
 	zlog(ZLOG_NOTICE, "\tprocess.max = %d",                 fpm_global_config.process_max);
+	if (fpm_global_config.process_priority == 64) {
+		zlog(ZLOG_NOTICE, "\tprocess.priority = undefined");
+	} else {
+		zlog(ZLOG_NOTICE, "\tprocess.priority = %d", fpm_global_config.process_priority);
+	}
 	zlog(ZLOG_NOTICE, "\tdaemonize = %s",                   BOOL2STR(fpm_global_config.daemonize));
 	zlog(ZLOG_NOTICE, "\trlimit_files = %d",                fpm_global_config.rlimit_files);
 	zlog(ZLOG_NOTICE, "\trlimit_core = %d",                 fpm_global_config.rlimit_core);
@@ -1518,6 +1537,11 @@ static void fpm_conf_dump() /* {{{ */
 		zlog(ZLOG_NOTICE, "\tlisten.group = %s",               STR2STR(wp->config->listen_group));
 		zlog(ZLOG_NOTICE, "\tlisten.mode = %s",                STR2STR(wp->config->listen_mode));
 		zlog(ZLOG_NOTICE, "\tlisten.allowed_clients = %s",     STR2STR(wp->config->listen_allowed_clients));
+		if (wp->config->process_priority == 64) {
+			zlog(ZLOG_NOTICE, "\tprocess.priority = undefined");
+		} else {
+			zlog(ZLOG_NOTICE, "\tprocess.priority = %d", wp->config->process_priority);
+		}
 		zlog(ZLOG_NOTICE, "\tpm = %s",                         PM2STR(wp->config->pm));
 		zlog(ZLOG_NOTICE, "\tpm.max_children = %d",            wp->config->pm_max_children);
 		zlog(ZLOG_NOTICE, "\tpm.start_servers = %d",           wp->config->pm_start_servers);
diff --git a/sapi/fpm/fpm/fpm_conf.h b/sapi/fpm/fpm/fpm_conf.h
index 9fbd506..f780f03 100644
--- a/sapi/fpm/fpm/fpm_conf.h
+++ b/sapi/fpm/fpm/fpm_conf.h
@@ -35,6 +35,7 @@ struct fpm_global_config_s {
 	int emergency_restart_interval;
 	int process_control_timeout;
 	int process_max;
+	int process_priority;
 	int daemonize;
 	int rlimit_files;
 	int rlimit_core;
@@ -57,6 +58,7 @@ struct fpm_worker_pool_config_s {
 	char *listen_group;
 	char *listen_mode;
 	char *listen_allowed_clients;
+	int process_priority;
 	int pm;
 	int pm_max_children;
 	int pm_start_servers;
diff --git a/sapi/fpm/fpm/fpm_unix.c b/sapi/fpm/fpm/fpm_unix.c
index 1ab8189..0f4d383 100644
--- a/sapi/fpm/fpm/fpm_unix.c
+++ b/sapi/fpm/fpm/fpm_unix.c
@@ -129,6 +129,9 @@ static int fpm_unix_conf_wp(struct fpm_worker_pool_s *wp) /* {{{ */
 		if (wp->config->chroot && *wp->config->chroot) {
 			zlog(ZLOG_WARNING, "[pool %s] 'chroot' directive is ignored when FPM is not running as root", wp->config->name);
 		}
+		if (wp->config->process_priority != 64) {
+			zlog(ZLOG_WARNING, "[pool %s] 'process.priority' directive is ignored when FPM is not running as root", wp->config->name);
+		}
 
 		/* set up HOME and USER anyway */
 		pwd = getpwuid(getuid());
@@ -184,6 +187,14 @@ int fpm_unix_init_child(struct fpm_worker_pool_s *wp) /* {{{ */
 	}
 
 	if (is_root) {
+
+		if (wp->config->process_priority != 64) {
+			if (setpriority(PRIO_PROCESS, 0, wp->config->process_priority) < 0) {
+				zlog(ZLOG_SYSERROR, "[pool %s] Unable to set priority for this new process", wp->config->name);
+				return -1;
+			}
+		}
+
 		if (wp->set_gid) {
 			if (0 > setgid(wp->set_gid)) {
 				zlog(ZLOG_SYSERROR, "[pool %s] failed to setgid(%d)", wp->config->name, wp->set_gid);
@@ -218,6 +229,7 @@ int fpm_unix_init_child(struct fpm_worker_pool_s *wp) /* {{{ */
 int fpm_unix_init_main() /* {{{ */
 {
 	struct fpm_worker_pool_s *wp;
+	int is_root = !geteuid();
 
 	if (fpm_global_config.rlimit_files) {
 		struct rlimit r;
@@ -317,6 +329,17 @@ int fpm_unix_init_main() /* {{{ */
 		return -1;
 	}
 
+	if (fpm_global_config.process_priority != 64) {
+		if (is_root) {
+			if (setpriority(PRIO_PROCESS, 0, fpm_global_config.process_priority) < 0) {
+				zlog(ZLOG_SYSERROR, "Unable to set priority for the master process");
+				return -1;
+			}
+		} else {
+			zlog(ZLOG_WARNING, "'process.priority' directive is ignored when FPM is not running as root");
+		}
+	}
+
 	fpm_globals.parent_pid = getpid();
 	for (wp = fpm_worker_all_pools; wp; wp = wp->next) {
 		if (0 > fpm_unix_conf_wp(wp)) {
diff --git a/sapi/fpm/php-fpm.conf.in b/sapi/fpm/php-fpm.conf.in
index 2dad9d7..a63dec7 100644
--- a/sapi/fpm/php-fpm.conf.in
+++ b/sapi/fpm/php-fpm.conf.in
@@ -76,6 +76,14 @@
 ; Default Value: 0
 ; process.max = 128
 
+; Specify the nice(2) priority to apply to the master process (only if set)
+; The value can vary from -19 (highest priority) to 20 (lower priority)
+; Note: - It will only work if the FPM master process is launched as root
+;       - The pool process will inherit the master process priority
+;         unless it specified otherwise
+; Default Value: no set
+; process.priority = -19
+
 ; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
 ; Default Value: yes
 ;daemonize = yes
@@ -163,6 +171,14 @@ listen = 127.0.0.1:9000
 ; Default Value: any
 ;listen.allowed_clients = 127.0.0.1
 
+; Specify the nice(2) priority to apply to the pool processes (only if set)
+; The value can vary from -19 (highest priority) to 20 (lower priority)
+; Note: - It will only work if the FPM master process is launched as root
+;       - The pool processes will inherit the master process priority
+;         unless it specified otherwise
+; Default Value: no set
+; priority = -19
+
 ; Choose how the process manager will control the number of child processes.
 ; Possible Values:
 ;   static  - a fixed number (pm.max_children) of child processes;


commit decc394a2089b955a175aed0091044d0fc3d1aab
Author: Jerome Loyet <fat at php.net>
Date:   Sat May 26 18:24:08 2012 +0200

    - Fixed bug #62160 (Add process.priority to set nice(2) priorities)

diff --git a/NEWS b/NEWS
index f14ad6c..8314eda 100644
--- a/NEWS
+++ b/NEWS
@@ -65,6 +65,7 @@ PHP                                                                        NEWS
     (fat)
   . Fixed bug #62153 (when using unix sockets, multiples FPM instances
     can be launched without errors). (fat)
+  . Fixed bug #62160 (Add process.priority to set nice(2) priorities). (fat)
 
 - Intl
   . ResourceBundle constructor now accepts NULL for the first two arguments.
diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c
index a4283a2..1f3258f 100644
--- a/sapi/fpm/fpm/fpm_conf.c
+++ b/sapi/fpm/fpm/fpm_conf.c
@@ -70,6 +70,7 @@ struct fpm_global_config_s fpm_global_config = {
 	.syslog_facility = -1,
 #endif
 	.process_max = 0,
+	.process_priority = 64, /* 64 means unset */
 };
 static struct fpm_worker_pool_s *current_wp = NULL;
 static int ini_recursion = 0;
@@ -92,6 +93,7 @@ static struct ini_value_parser_s ini_fpm_global_options[] = {
 	{ "emergency_restart_interval",  &fpm_conf_set_time,            GO(emergency_restart_interval) },
 	{ "process_control_timeout",     &fpm_conf_set_time,            GO(process_control_timeout) },
 	{ "process.max",                 &fpm_conf_set_integer,         GO(process_max) },
+	{ "process.priority",            &fpm_conf_set_integer,         GO(process_priority) },
 	{ "daemonize",                   &fpm_conf_set_boolean,         GO(daemonize) },
 	{ "rlimit_files",                &fpm_conf_set_integer,         GO(rlimit_files) },
 	{ "rlimit_core",                 &fpm_conf_set_rlimit_core,     GO(rlimit_core) },
@@ -112,6 +114,7 @@ static struct ini_value_parser_s ini_fpm_pool_options[] = {
 	{ "listen.group",              &fpm_conf_set_string,      WPO(listen_group) },
 	{ "listen.mode",               &fpm_conf_set_string,      WPO(listen_mode) },
 	{ "listen.allowed_clients",    &fpm_conf_set_string,      WPO(listen_allowed_clients) },
+	{ "process.priority",          &fpm_conf_set_integer,     WPO(process_priority) },
 	{ "pm",                        &fpm_conf_set_pm,          WPO(pm) },
 	{ "pm.max_children",           &fpm_conf_set_integer,     WPO(pm_max_children) },
 	{ "pm.start_servers",          &fpm_conf_set_integer,     WPO(pm_start_servers) },
@@ -577,6 +580,7 @@ static void *fpm_worker_pool_config_alloc() /* {{{ */
 	memset(wp->config, 0, sizeof(struct fpm_worker_pool_config_s));
 	wp->config->listen_backlog = FPM_BACKLOG_DEFAULT;
 	wp->config->pm_process_idle_timeout = 10; /* 10s by default */
+	wp->config->process_priority = 64; /* 64 means unset */
 
 	if (!fpm_worker_all_pools) {
 		fpm_worker_all_pools = wp;
@@ -741,6 +745,11 @@ static int fpm_conf_process_all_pools() /* {{{ */
 			return -1;
 		}
 
+		if (wp->config->process_priority != 64 && (wp->config->process_priority < -19 || wp->config->process_priority > 20)) {
+			zlog(ZLOG_ERROR, "[pool %s] process.priority must be included into [-19,20]", wp->config->name);
+			return -1;
+		}
+
 		/* pm */
 		if (wp->config->pm != PM_STYLE_STATIC && wp->config->pm != PM_STYLE_DYNAMIC && wp->config->pm != PM_STYLE_ONDEMAND) {
 			zlog(ZLOG_ALERT, "[pool %s] the process manager is missing (static, dynamic or ondemand)", wp->config->name);
@@ -1117,6 +1126,11 @@ static int fpm_conf_post_process(TSRMLS_D) /* {{{ */
 		return -1;
 	}
 
+	if (fpm_global_config.process_priority != 64 && (fpm_global_config.process_priority < -19 || fpm_global_config.process_priority > 20)) {
+		zlog(ZLOG_ERROR, "process.priority must be included into [-19,20]");
+		return -1;
+	}
+
 	if (!fpm_global_config.error_log) {
 		fpm_global_config.error_log = strdup("log/php-fpm.log");
 	}
@@ -1499,6 +1513,11 @@ static void fpm_conf_dump() /* {{{ */
 	zlog(ZLOG_NOTICE, "\temergency_restart_threshold = %d", fpm_global_config.emergency_restart_threshold);
 	zlog(ZLOG_NOTICE, "\tprocess_control_timeout = %ds",    fpm_global_config.process_control_timeout);
 	zlog(ZLOG_NOTICE, "\tprocess.max = %d",                 fpm_global_config.process_max);
+	if (fpm_global_config.process_priority == 64) {
+		zlog(ZLOG_NOTICE, "\tprocess.priority = undefined");
+	} else {
+		zlog(ZLOG_NOTICE, "\tprocess.priority = %d", fpm_global_config.process_priority);
+	}
 	zlog(ZLOG_NOTICE, "\tdaemonize = %s",                   BOOL2STR(fpm_global_config.daemonize));
 	zlog(ZLOG_NOTICE, "\trlimit_files = %d",                fpm_global_config.rlimit_files);
 	zlog(ZLOG_NOTICE, "\trlimit_core = %d",                 fpm_global_config.rlimit_core);
@@ -1518,6 +1537,11 @@ static void fpm_conf_dump() /* {{{ */
 		zlog(ZLOG_NOTICE, "\tlisten.group = %s",               STR2STR(wp->config->listen_group));
 		zlog(ZLOG_NOTICE, "\tlisten.mode = %s",                STR2STR(wp->config->listen_mode));
 		zlog(ZLOG_NOTICE, "\tlisten.allowed_clients = %s",     STR2STR(wp->config->listen_allowed_clients));
+		if (wp->config->process_priority == 64) {
+			zlog(ZLOG_NOTICE, "\tprocess.priority = undefined");
+		} else {
+			zlog(ZLOG_NOTICE, "\tprocess.priority = %d", wp->config->process_priority);
+		}
 		zlog(ZLOG_NOTICE, "\tpm = %s",                         PM2STR(wp->config->pm));
 		zlog(ZLOG_NOTICE, "\tpm.max_children = %d",            wp->config->pm_max_children);
 		zlog(ZLOG_NOTICE, "\tpm.start_servers = %d",           wp->config->pm_start_servers);
diff --git a/sapi/fpm/fpm/fpm_conf.h b/sapi/fpm/fpm/fpm_conf.h
index 9fbd506..f780f03 100644
--- a/sapi/fpm/fpm/fpm_conf.h
+++ b/sapi/fpm/fpm/fpm_conf.h
@@ -35,6 +35,7 @@ struct fpm_global_config_s {
 	int emergency_restart_interval;
 	int process_control_timeout;
 	int process_max;
+	int process_priority;
 	int daemonize;
 	int rlimit_files;
 	int rlimit_core;
@@ -57,6 +58,7 @@ struct fpm_worker_pool_config_s {
 	char *listen_group;
 	char *listen_mode;
 	char *listen_allowed_clients;
+	int process_priority;
 	int pm;
 	int pm_max_children;
 	int pm_start_servers;
diff --git a/sapi/fpm/fpm/fpm_unix.c b/sapi/fpm/fpm/fpm_unix.c
index 1ab8189..0f4d383 100644
--- a/sapi/fpm/fpm/fpm_unix.c
+++ b/sapi/fpm/fpm/fpm_unix.c
@@ -129,6 +129,9 @@ static int fpm_unix_conf_wp(struct fpm_worker_pool_s *wp) /* {{{ */
 		if (wp->config->chroot && *wp->config->chroot) {
 			zlog(ZLOG_WARNING, "[pool %s] 'chroot' directive is ignored when FPM is not running as root", wp->config->name);
 		}
+		if (wp->config->process_priority != 64) {
+			zlog(ZLOG_WARNING, "[pool %s] 'process.priority' directive is ignored when FPM is not running as root", wp->config->name);
+		}
 
 		/* set up HOME and USER anyway */
 		pwd = getpwuid(getuid());
@@ -184,6 +187,14 @@ int fpm_unix_init_child(struct fpm_worker_pool_s *wp) /* {{{ */
 	}
 
 	if (is_root) {
+
+		if (wp->config->process_priority != 64) {
+			if (setpriority(PRIO_PROCESS, 0, wp->config->process_priority) < 0) {
+				zlog(ZLOG_SYSERROR, "[pool %s] Unable to set priority for this new process", wp->config->name);
+				return -1;
+			}
+		}
+
 		if (wp->set_gid) {
 			if (0 > setgid(wp->set_gid)) {
 				zlog(ZLOG_SYSERROR, "[pool %s] failed to setgid(%d)", wp->config->name, wp->set_gid);
@@ -218,6 +229,7 @@ int fpm_unix_init_child(struct fpm_worker_pool_s *wp) /* {{{ */
 int fpm_unix_init_main() /* {{{ */
 {
 	struct fpm_worker_pool_s *wp;
+	int is_root = !geteuid();
 
 	if (fpm_global_config.rlimit_files) {
 		struct rlimit r;
@@ -317,6 +329,17 @@ int fpm_unix_init_main() /* {{{ */
 		return -1;
 	}
 
+	if (fpm_global_config.process_priority != 64) {
+		if (is_root) {
+			if (setpriority(PRIO_PROCESS, 0, fpm_global_config.process_priority) < 0) {
+				zlog(ZLOG_SYSERROR, "Unable to set priority for the master process");
+				return -1;
+			}
+		} else {
+			zlog(ZLOG_WARNING, "'process.priority' directive is ignored when FPM is not running as root");
+		}
+	}
+
 	fpm_globals.parent_pid = getpid();
 	for (wp = fpm_worker_all_pools; wp; wp = wp->next) {
 		if (0 > fpm_unix_conf_wp(wp)) {
diff --git a/sapi/fpm/php-fpm.conf.in b/sapi/fpm/php-fpm.conf.in
index 2dad9d7..a63dec7 100644
--- a/sapi/fpm/php-fpm.conf.in
+++ b/sapi/fpm/php-fpm.conf.in
@@ -76,6 +76,14 @@
 ; Default Value: 0
 ; process.max = 128
 
+; Specify the nice(2) priority to apply to the master process (only if set)
+; The value can vary from -19 (highest priority) to 20 (lower priority)
+; Note: - It will only work if the FPM master process is launched as root
+;       - The pool process will inherit the master process priority
+;         unless it specified otherwise
+; Default Value: no set
+; process.priority = -19
+
 ; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
 ; Default Value: yes
 ;daemonize = yes
@@ -163,6 +171,14 @@ listen = 127.0.0.1:9000
 ; Default Value: any
 ;listen.allowed_clients = 127.0.0.1
 
+; Specify the nice(2) priority to apply to the pool processes (only if set)
+; The value can vary from -19 (highest priority) to 20 (lower priority)
+; Note: - It will only work if the FPM master process is launched as root
+;       - The pool processes will inherit the master process priority
+;         unless it specified otherwise
+; Default Value: no set
+; priority = -19
+
 ; Choose how the process manager will control the number of child processes.
 ; Possible Values:
 ;   static  - a fixed number (pm.max_children) of child processes;


commit f6655b62d8273a4d1276d98491bf49bb197821fe
Author: Jerome Loyet <fat at php.net>
Date:   Sat May 26 18:22:12 2012 +0200

    - Fixed bug #62160 (Add process.priority to set nice(2) priorities)

diff --git a/NEWS b/NEWS
index 60991b6..3981b1f 100644
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,7 @@ PHP                                                                        NEWS
     (fat)
   . Fixed bug #62153 (when using unix sockets, multiples FPM instances
     can be launched without errors). (fat)
+  . Fixed bug #62160 (Add process.priority to set nice(2) priorities). (fat)
 
 - Intl:
   . Fixed bug #62083 (grapheme_extract() memory leaks). (Gustavo)
diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c
index a4283a2..1f3258f 100644
--- a/sapi/fpm/fpm/fpm_conf.c
+++ b/sapi/fpm/fpm/fpm_conf.c
@@ -70,6 +70,7 @@ struct fpm_global_config_s fpm_global_config = {
 	.syslog_facility = -1,
 #endif
 	.process_max = 0,
+	.process_priority = 64, /* 64 means unset */
 };
 static struct fpm_worker_pool_s *current_wp = NULL;
 static int ini_recursion = 0;
@@ -92,6 +93,7 @@ static struct ini_value_parser_s ini_fpm_global_options[] = {
 	{ "emergency_restart_interval",  &fpm_conf_set_time,            GO(emergency_restart_interval) },
 	{ "process_control_timeout",     &fpm_conf_set_time,            GO(process_control_timeout) },
 	{ "process.max",                 &fpm_conf_set_integer,         GO(process_max) },
+	{ "process.priority",            &fpm_conf_set_integer,         GO(process_priority) },
 	{ "daemonize",                   &fpm_conf_set_boolean,         GO(daemonize) },
 	{ "rlimit_files",                &fpm_conf_set_integer,         GO(rlimit_files) },
 	{ "rlimit_core",                 &fpm_conf_set_rlimit_core,     GO(rlimit_core) },
@@ -112,6 +114,7 @@ static struct ini_value_parser_s ini_fpm_pool_options[] = {
 	{ "listen.group",              &fpm_conf_set_string,      WPO(listen_group) },
 	{ "listen.mode",               &fpm_conf_set_string,      WPO(listen_mode) },
 	{ "listen.allowed_clients",    &fpm_conf_set_string,      WPO(listen_allowed_clients) },
+	{ "process.priority",          &fpm_conf_set_integer,     WPO(process_priority) },
 	{ "pm",                        &fpm_conf_set_pm,          WPO(pm) },
 	{ "pm.max_children",           &fpm_conf_set_integer,     WPO(pm_max_children) },
 	{ "pm.start_servers",          &fpm_conf_set_integer,     WPO(pm_start_servers) },
@@ -577,6 +580,7 @@ static void *fpm_worker_pool_config_alloc() /* {{{ */
 	memset(wp->config, 0, sizeof(struct fpm_worker_pool_config_s));
 	wp->config->listen_backlog = FPM_BACKLOG_DEFAULT;
 	wp->config->pm_process_idle_timeout = 10; /* 10s by default */
+	wp->config->process_priority = 64; /* 64 means unset */
 
 	if (!fpm_worker_all_pools) {
 		fpm_worker_all_pools = wp;
@@ -741,6 +745,11 @@ static int fpm_conf_process_all_pools() /* {{{ */
 			return -1;
 		}
 
+		if (wp->config->process_priority != 64 && (wp->config->process_priority < -19 || wp->config->process_priority > 20)) {
+			zlog(ZLOG_ERROR, "[pool %s] process.priority must be included into [-19,20]", wp->config->name);
+			return -1;
+		}
+
 		/* pm */
 		if (wp->config->pm != PM_STYLE_STATIC && wp->config->pm != PM_STYLE_DYNAMIC && wp->config->pm != PM_STYLE_ONDEMAND) {
 			zlog(ZLOG_ALERT, "[pool %s] the process manager is missing (static, dynamic or ondemand)", wp->config->name);
@@ -1117,6 +1126,11 @@ static int fpm_conf_post_process(TSRMLS_D) /* {{{ */
 		return -1;
 	}
 
+	if (fpm_global_config.process_priority != 64 && (fpm_global_config.process_priority < -19 || fpm_global_config.process_priority > 20)) {
+		zlog(ZLOG_ERROR, "process.priority must be included into [-19,20]");
+		return -1;
+	}
+
 	if (!fpm_global_config.error_log) {
 		fpm_global_config.error_log = strdup("log/php-fpm.log");
 	}
@@ -1499,6 +1513,11 @@ static void fpm_conf_dump() /* {{{ */
 	zlog(ZLOG_NOTICE, "\temergency_restart_threshold = %d", fpm_global_config.emergency_restart_threshold);
 	zlog(ZLOG_NOTICE, "\tprocess_control_timeout = %ds",    fpm_global_config.process_control_timeout);
 	zlog(ZLOG_NOTICE, "\tprocess.max = %d",                 fpm_global_config.process_max);
+	if (fpm_global_config.process_priority == 64) {
+		zlog(ZLOG_NOTICE, "\tprocess.priority = undefined");
+	} else {
+		zlog(ZLOG_NOTICE, "\tprocess.priority = %d", fpm_global_config.process_priority);
+	}
 	zlog(ZLOG_NOTICE, "\tdaemonize = %s",                   BOOL2STR(fpm_global_config.daemonize));
 	zlog(ZLOG_NOTICE, "\trlimit_files = %d",                fpm_global_config.rlimit_files);
 	zlog(ZLOG_NOTICE, "\trlimit_core = %d",                 fpm_global_config.rlimit_core);
@@ -1518,6 +1537,11 @@ static void fpm_conf_dump() /* {{{ */
 		zlog(ZLOG_NOTICE, "\tlisten.group = %s",               STR2STR(wp->config->listen_group));
 		zlog(ZLOG_NOTICE, "\tlisten.mode = %s",                STR2STR(wp->config->listen_mode));
 		zlog(ZLOG_NOTICE, "\tlisten.allowed_clients = %s",     STR2STR(wp->config->listen_allowed_clients));
+		if (wp->config->process_priority == 64) {
+			zlog(ZLOG_NOTICE, "\tprocess.priority = undefined");
+		} else {
+			zlog(ZLOG_NOTICE, "\tprocess.priority = %d", wp->config->process_priority);
+		}
 		zlog(ZLOG_NOTICE, "\tpm = %s",                         PM2STR(wp->config->pm));
 		zlog(ZLOG_NOTICE, "\tpm.max_children = %d",            wp->config->pm_max_children);
 		zlog(ZLOG_NOTICE, "\tpm.start_servers = %d",           wp->config->pm_start_servers);
diff --git a/sapi/fpm/fpm/fpm_conf.h b/sapi/fpm/fpm/fpm_conf.h
index 9fbd506..f780f03 100644
--- a/sapi/fpm/fpm/fpm_conf.h
+++ b/sapi/fpm/fpm/fpm_conf.h
@@ -35,6 +35,7 @@ struct fpm_global_config_s {
 	int emergency_restart_interval;
 	int process_control_timeout;
 	int process_max;
+	int process_priority;
 	int daemonize;
 	int rlimit_files;
 	int rlimit_core;
@@ -57,6 +58,7 @@ struct fpm_worker_pool_config_s {
 	char *listen_group;
 	char *listen_mode;
 	char *listen_allowed_clients;
+	int process_priority;
 	int pm;
 	int pm_max_children;
 	int pm_start_servers;
diff --git a/sapi/fpm/fpm/fpm_unix.c b/sapi/fpm/fpm/fpm_unix.c
index 1ab8189..0f4d383 100644
--- a/sapi/fpm/fpm/fpm_unix.c
+++ b/sapi/fpm/fpm/fpm_unix.c
@@ -129,6 +129,9 @@ static int fpm_unix_conf_wp(struct fpm_worker_pool_s *wp) /* {{{ */
 		if (wp->config->chroot && *wp->config->chroot) {
 			zlog(ZLOG_WARNING, "[pool %s] 'chroot' directive is ignored when FPM is not running as root", wp->config->name);
 		}
+		if (wp->config->process_priority != 64) {
+			zlog(ZLOG_WARNING, "[pool %s] 'process.priority' directive is ignored when FPM is not running as root", wp->config->name);
+		}
 
 		/* set up HOME and USER anyway */
 		pwd = getpwuid(getuid());
@@ -184,6 +187,14 @@ int fpm_unix_init_child(struct fpm_worker_pool_s *wp) /* {{{ */
 	}
 
 	if (is_root) {
+
+		if (wp->config->process_priority != 64) {
+			if (setpriority(PRIO_PROCESS, 0, wp->config->process_priority) < 0) {
+				zlog(ZLOG_SYSERROR, "[pool %s] Unable to set priority for this new process", wp->config->name);
+				return -1;
+			}
+		}
+
 		if (wp->set_gid) {
 			if (0 > setgid(wp->set_gid)) {
 				zlog(ZLOG_SYSERROR, "[pool %s] failed to setgid(%d)", wp->config->name, wp->set_gid);
@@ -218,6 +229,7 @@ int fpm_unix_init_child(struct fpm_worker_pool_s *wp) /* {{{ */
 int fpm_unix_init_main() /* {{{ */
 {
 	struct fpm_worker_pool_s *wp;
+	int is_root = !geteuid();
 
 	if (fpm_global_config.rlimit_files) {
 		struct rlimit r;
@@ -317,6 +329,17 @@ int fpm_unix_init_main() /* {{{ */
 		return -1;
 	}
 
+	if (fpm_global_config.process_priority != 64) {
+		if (is_root) {
+			if (setpriority(PRIO_PROCESS, 0, fpm_global_config.process_priority) < 0) {
+				zlog(ZLOG_SYSERROR, "Unable to set priority for the master process");
+				return -1;
+			}
+		} else {
+			zlog(ZLOG_WARNING, "'process.priority' directive is ignored when FPM is not running as root");
+		}
+	}
+
 	fpm_globals.parent_pid = getpid();
 	for (wp = fpm_worker_all_pools; wp; wp = wp->next) {
 		if (0 > fpm_unix_conf_wp(wp)) {
diff --git a/sapi/fpm/php-fpm.conf.in b/sapi/fpm/php-fpm.conf.in
index 845eae75..44e4dba 100644
--- a/sapi/fpm/php-fpm.conf.in
+++ b/sapi/fpm/php-fpm.conf.in
@@ -76,6 +76,14 @@
 ; Default Value: 0
 ; process.max = 128
 
+; Specify the nice(2) priority to apply to the master process (only if set)
+; The value can vary from -19 (highest priority) to 20 (lower priority)
+; Note: - It will only work if the FPM master process is launched as root
+;       - The pool process will inherit the master process priority
+;         unless it specified otherwise
+; Default Value: no set
+; process.priority = -19
+
 ; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
 ; Default Value: yes
 ;daemonize = yes
@@ -163,6 +171,14 @@ listen = 127.0.0.1:9000
 ; Default Value: any
 ;listen.allowed_clients = 127.0.0.1
 
+; Specify the nice(2) priority to apply to the pool processes (only if set)
+; The value can vary from -19 (highest priority) to 20 (lower priority)
+; Note: - It will only work if the FPM master process is launched as root
+;       - The pool processes will inherit the master process priority
+;         unless it specified otherwise
+; Default Value: no set
+; priority = -19
+
 ; Choose how the process manager will control the number of child processes.
 ; Possible Values:
 ;   static  - a fixed number (pm.max_children) of child processes;


commit 18cd5772d61ec302bba6be2baee742a1890c12f8
Author: Jerome Loyet <fat at php.net>
Date:   Sat May 26 17:38:39 2012 +0200

    - add missing headers to avoid warnings

diff --git a/sapi/fpm/fpm/fpm_sockets.h b/sapi/fpm/fpm/fpm_sockets.h
index b7ff0b2..5b9c698 100644
--- a/sapi/fpm/fpm/fpm_sockets.h
+++ b/sapi/fpm/fpm/fpm_sockets.h
@@ -5,6 +5,8 @@
 #ifndef FPM_MISC_H
 #define FPM_MISC_H 1
 
+#include <sys/types.h>
+#include <sys/socket.h>
 #include <unistd.h>
 #include <fcntl.h>
 


commit 0037598252b8cbe117a592cf4f5261aa786fa722
Author: Jerome Loyet <fat at php.net>
Date:   Sat May 26 17:38:08 2012 +0200

    - add missing headers to avoid warnings

diff --git a/sapi/fpm/fpm/fpm_sockets.h b/sapi/fpm/fpm/fpm_sockets.h
index b7ff0b2..5b9c698 100644
--- a/sapi/fpm/fpm/fpm_sockets.h
+++ b/sapi/fpm/fpm/fpm_sockets.h
@@ -5,6 +5,8 @@
 #ifndef FPM_MISC_H
 #define FPM_MISC_H 1
 
+#include <sys/types.h>
+#include <sys/socket.h>
 #include <unistd.h>
 #include <fcntl.h>
 


commit 63e11f90258d26de20f1756120da6f351eff3f91
Author: Jerome Loyet <fat at php.net>
Date:   Sat May 26 17:37:33 2012 +0200

    - add missing headers to avoid warnings

diff --git a/sapi/fpm/fpm/fpm_sockets.h b/sapi/fpm/fpm/fpm_sockets.h
index b7ff0b2..5b9c698 100644
--- a/sapi/fpm/fpm/fpm_sockets.h
+++ b/sapi/fpm/fpm/fpm_sockets.h
@@ -5,6 +5,8 @@
 #ifndef FPM_MISC_H
 #define FPM_MISC_H 1
 
+#include <sys/types.h>
+#include <sys/socket.h>
 #include <unistd.h>
 #include <fcntl.h>
 


commit eeba67914ebe02de279f0188be739b78c7a76958
Author: Jerome Loyet <fat at php.net>
Date:   Fri May 25 21:23:39 2012 +0200

    - Fixed bug #62153 (when using unix sockets, multiples FPM instances can be launched without errors)

diff --git a/sapi/fpm/fpm/fpm_sockets.c b/sapi/fpm/fpm/fpm_sockets.c
index cb4897e..d24dccc 100644
--- a/sapi/fpm/fpm/fpm_sockets.c
+++ b/sapi/fpm/fpm/fpm_sockets.c
@@ -179,6 +179,10 @@ static int fpm_sockets_new_listening_socket(struct fpm_worker_pool_s *wp, struct
 	setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &flags, sizeof(flags));
 
 	if (wp->listen_address_domain == FPM_AF_UNIX) {
+		if (fpm_socket_unix_test_connect((struct sockaddr_un *)sa, socklen) == 0) {
+			zlog(ZLOG_ERROR, "An another FPM instance seems to already listen on %s", ((struct sockaddr_un *) sa)->sun_path);
+			return -1;
+		}
 		unlink( ((struct sockaddr_un *) sa)->sun_path);
 		saved_umask = umask(0777 ^ wp->socket_mode);
 	}
@@ -450,3 +454,24 @@ int fpm_socket_get_listening_queue(int sock, unsigned *cur_lq, unsigned *max_lq)
 }
 
 #endif
+
+int fpm_socket_unix_test_connect(struct sockaddr_un *sun, size_t socklen) /* {{{ */
+{
+	int fd;
+
+	if (!sun || sun->sun_family != AF_UNIX) {
+		return -1;
+	}
+
+	if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
+		return -1;
+	}
+
+	if (connect(fd, (struct sockaddr *)sun, socklen) == -1) {
+		return -1;
+	}
+
+	close(fd);
+	return 0;
+}
+/* }}} */
diff --git a/sapi/fpm/fpm/fpm_sockets.h b/sapi/fpm/fpm/fpm_sockets.h
index 447fbff..b7ff0b2 100644
--- a/sapi/fpm/fpm/fpm_sockets.h
+++ b/sapi/fpm/fpm/fpm_sockets.h
@@ -22,6 +22,7 @@
 enum fpm_address_domain fpm_sockets_domain_from_address(char *addr);
 int fpm_sockets_init_main();
 int fpm_socket_get_listening_queue(int sock, unsigned *cur_lq, unsigned *max_lq);
+int fpm_socket_unix_test_connect(struct sockaddr_un *sun, size_t socklen);
 
 
 static inline int fd_set_blocked(int fd, int blocked) /* {{{ */


commit d90003b5491c576ab28c3999c8f3121d6c0d06f1
Author: Jerome Loyet <fat at php.net>
Date:   Fri May 25 21:22:54 2012 +0200

    - Fixed bug #62153 (when using unix sockets, multiples FPM instances can be launched without errors)

diff --git a/NEWS b/NEWS
index 3da506f..f14ad6c 100644
--- a/NEWS
+++ b/NEWS
@@ -63,6 +63,8 @@ PHP                                                                        NEWS
   . Fixed bug #61026 (FPM pools can listen on the same address). (fat)
   . Fixed bug #62033 (php-fpm exits with status 0 on some failures to start).
     (fat)
+  . Fixed bug #62153 (when using unix sockets, multiples FPM instances
+    can be launched without errors). (fat)
 
 - Intl
   . ResourceBundle constructor now accepts NULL for the first two arguments.
diff --git a/sapi/fpm/fpm/fpm_sockets.c b/sapi/fpm/fpm/fpm_sockets.c
index cb4897e..d24dccc 100644
--- a/sapi/fpm/fpm/fpm_sockets.c
+++ b/sapi/fpm/fpm/fpm_sockets.c
@@ -179,6 +179,10 @@ static int fpm_sockets_new_listening_socket(struct fpm_worker_pool_s *wp, struct
 	setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &flags, sizeof(flags));
 
 	if (wp->listen_address_domain == FPM_AF_UNIX) {
+		if (fpm_socket_unix_test_connect((struct sockaddr_un *)sa, socklen) == 0) {
+			zlog(ZLOG_ERROR, "An another FPM instance seems to already listen on %s", ((struct sockaddr_un *) sa)->sun_path);
+			return -1;
+		}
 		unlink( ((struct sockaddr_un *) sa)->sun_path);
 		saved_umask = umask(0777 ^ wp->socket_mode);
 	}
@@ -450,3 +454,24 @@ int fpm_socket_get_listening_queue(int sock, unsigned *cur_lq, unsigned *max_lq)
 }
 
 #endif
+
+int fpm_socket_unix_test_connect(struct sockaddr_un *sun, size_t socklen) /* {{{ */
+{
+	int fd;
+
+	if (!sun || sun->sun_family != AF_UNIX) {
+		return -1;
+	}
+
+	if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
+		return -1;
+	}
+
+	if (connect(fd, (struct sockaddr *)sun, socklen) == -1) {
+		return -1;
+	}
+
+	close(fd);
+	return 0;
+}
+/* }}} */
diff --git a/sapi/fpm/fpm/fpm_sockets.h b/sapi/fpm/fpm/fpm_sockets.h
index 447fbff..b7ff0b2 100644
--- a/sapi/fpm/fpm/fpm_sockets.h
+++ b/sapi/fpm/fpm/fpm_sockets.h
@@ -22,6 +22,7 @@
 enum fpm_address_domain fpm_sockets_domain_from_address(char *addr);
 int fpm_sockets_init_main();
 int fpm_socket_get_listening_queue(int sock, unsigned *cur_lq, unsigned *max_lq);
+int fpm_socket_unix_test_connect(struct sockaddr_un *sun, size_t socklen);
 
 
 static inline int fd_set_blocked(int fd, int blocked) /* {{{ */


commit a7761262f70d660cd20ec698c453b8daa922f422
Author: Jerome Loyet <fat at php.net>
Date:   Fri May 25 21:21:44 2012 +0200

    - Fixed bug #62153 (when using unix sockets, multiples FPM instances can be launched without errors)

diff --git a/NEWS b/NEWS
index bb6a36e..60991b6 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,8 @@ PHP                                                                        NEWS
   . Fixed bug #61026 (FPM pools can listen on the same address). (fat)
   . Fixed bug #62033 (php-fpm exits with status 0 on some failures to start).
     (fat)
+  . Fixed bug #62153 (when using unix sockets, multiples FPM instances
+    can be launched without errors). (fat)
 
 - Intl:
   . Fixed bug #62083 (grapheme_extract() memory leaks). (Gustavo)
diff --git a/sapi/fpm/fpm/fpm_sockets.c b/sapi/fpm/fpm/fpm_sockets.c
index cb4897e..d24dccc 100644
--- a/sapi/fpm/fpm/fpm_sockets.c
+++ b/sapi/fpm/fpm/fpm_sockets.c
@@ -179,6 +179,10 @@ static int fpm_sockets_new_listening_socket(struct fpm_worker_pool_s *wp, struct
 	setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &flags, sizeof(flags));
 
 	if (wp->listen_address_domain == FPM_AF_UNIX) {
+		if (fpm_socket_unix_test_connect((struct sockaddr_un *)sa, socklen) == 0) {
+			zlog(ZLOG_ERROR, "An another FPM instance seems to already listen on %s", ((struct sockaddr_un *) sa)->sun_path);
+			return -1;
+		}
 		unlink( ((struct sockaddr_un *) sa)->sun_path);
 		saved_umask = umask(0777 ^ wp->socket_mode);
 	}
@@ -450,3 +454,24 @@ int fpm_socket_get_listening_queue(int sock, unsigned *cur_lq, unsigned *max_lq)
 }
 
 #endif
+
+int fpm_socket_unix_test_connect(struct sockaddr_un *sun, size_t socklen) /* {{{ */
+{
+	int fd;
+
+	if (!sun || sun->sun_family != AF_UNIX) {
+		return -1;
+	}
+
+	if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
+		return -1;
+	}
+
+	if (connect(fd, (struct sockaddr *)sun, socklen) == -1) {
+		return -1;
+	}
+
+	close(fd);
+	return 0;
+}
+/* }}} */
diff --git a/sapi/fpm/fpm/fpm_sockets.h b/sapi/fpm/fpm/fpm_sockets.h
index 447fbff..b7ff0b2 100644
--- a/sapi/fpm/fpm/fpm_sockets.h
+++ b/sapi/fpm/fpm/fpm_sockets.h
@@ -22,6 +22,7 @@
 enum fpm_address_domain fpm_sockets_domain_from_address(char *addr);
 int fpm_sockets_init_main();
 int fpm_socket_get_listening_queue(int sock, unsigned *cur_lq, unsigned *max_lq);
+int fpm_socket_unix_test_connect(struct sockaddr_un *sun, size_t socklen);
 
 
 static inline int fd_set_blocked(int fd, int blocked) /* {{{ */


commit a28fe034f2d5253e0fbefafc6a7938df9db7319e
Author: Jerome Loyet <fat at php.net>
Date:   Fri May 25 21:15:06 2012 +0200

    - Fixed bug #62033 (php-fpm exits with status 0 on some failures to start).

diff --git a/sapi/fpm/config.m4 b/sapi/fpm/config.m4
index 6c860c9..ad46717 100644
--- a/sapi/fpm/config.m4
+++ b/sapi/fpm/config.m4
@@ -16,6 +16,7 @@ AC_DEFUN([AC_FPM_STDLIBS],
   AC_CHECK_HEADERS([errno.h fcntl.h stdio.h stdlib.h unistd.h sys/uio.h])
   AC_CHECK_HEADERS([sys/select.h sys/socket.h sys/time.h])
   AC_CHECK_HEADERS([arpa/inet.h netinet/in.h])
+  AC_CHECK_HEADERS([sysexits.h])
 ])
 
 AC_DEFUN([AC_FPM_PRCTL],
diff --git a/sapi/fpm/fpm/fpm.c b/sapi/fpm/fpm/fpm.c
index 909902b..176dbaf 100644
--- a/sapi/fpm/fpm/fpm.c
+++ b/sapi/fpm/fpm/fpm.c
@@ -66,7 +66,7 @@ int fpm_init(int argc, char **argv, char *config, char *prefix, char *pid, int t
 	    0 > fpm_event_init_main()) {
 
 		if (fpm_globals.test_successful) {
-			exit(0);
+			exit(FPM_EXIT_OK);
 		} else {
 			zlog(ZLOG_ERROR, "FPM initialization failed");
 			return -1;
diff --git a/sapi/fpm/fpm/fpm.h b/sapi/fpm/fpm/fpm.h
index 2a69cb2..b0bed0a 100644
--- a/sapi/fpm/fpm/fpm.h
+++ b/sapi/fpm/fpm/fpm.h
@@ -7,6 +7,35 @@
 
 #include <unistd.h>
 
+#ifdef HAVE_SYSEXITS_H
+#include <sysexits.h>
+#endif
+
+#ifdef EX_OK
+#define FPM_EXIT_OK EX_OK
+#else
+#define FPM_EXIT_OK 0
+#endif
+
+#ifdef EX_USAGE
+#define FPM_EXIT_USAGE EX_USAGE
+#else
+#define FPM_EXIT_USAGE 64
+#endif
+
+#ifdef EX_SOFTWARE
+#define FPM_EXIT_SOFTWARE EX_SOFTWARE
+#else
+#define FPM_EXIT_SOFTWARE 70
+#endif
+
+#ifdef EX_CONFIG
+#define FPM_EXIT_CONFIG EX_CONFIG
+#else
+#define FPM_EXIT_CONFIG 78
+#endif
+
+
 int fpm_run(int *max_requests);
 int fpm_init(int argc, char **argv, char *config, char *prefix, char *pid, int test_conf, int run_as_root);
 
diff --git a/sapi/fpm/fpm/fpm_children.c b/sapi/fpm/fpm/fpm_children.c
index 35058b0..84a9474 100644
--- a/sapi/fpm/fpm/fpm_children.c
+++ b/sapi/fpm/fpm/fpm_children.c
@@ -156,7 +156,7 @@ static void fpm_child_init(struct fpm_worker_pool_s *wp) /* {{{ */
 	    0 > fpm_php_init_child(wp)) {
 
 		zlog(ZLOG_ERROR, "[pool %s] child failed to initialize", wp->config->name);
-		exit(255);
+		exit(FPM_EXIT_SOFTWARE);
 	}
 }
 /* }}} */
@@ -198,7 +198,7 @@ void fpm_children_bury() /* {{{ */
 				restart_child = 0;
 			}
 
-			if (WEXITSTATUS(status) != 0) {
+			if (WEXITSTATUS(status) != FPM_EXIT_OK) {
 				severity = ZLOG_WARNING;
 			}
 
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index 130673f..c3fd2bc 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -1528,7 +1528,7 @@ static zend_module_entry cgi_module_entry = {
  */
 int main(int argc, char *argv[])
 {
-	int exit_status = SUCCESS;
+	int exit_status = FPM_EXIT_OK;
 	int cgi = 0, c, use_extended_info = 0;
 	zend_file_handle file_handle;
 
@@ -1659,7 +1659,7 @@ int main(int argc, char *argv[])
 				php_output_end_all(TSRMLS_C);
 				php_output_deactivate(TSRMLS_C);
 				fcgi_shutdown();
-				exit_status = 0;
+				exit_status = FPM_EXIT_OK;
 				goto out;
 
 			case 'i': /* php info & quit */
@@ -1680,7 +1680,7 @@ int main(int argc, char *argv[])
 				php_output_end_all(TSRMLS_C);
 				php_output_deactivate(TSRMLS_C);
 				fcgi_shutdown();
-				exit_status = 0;
+				exit_status = (c == 'h') ? FPM_EXIT_OK : FPM_EXIT_USAGE;
 				goto out;
 
 			case 'v': /* show php version & quit */
@@ -1688,7 +1688,7 @@ int main(int argc, char *argv[])
 				if (php_request_startup(TSRMLS_C) == FAILURE) {
 					SG(server_context) = NULL;
 					php_module_shutdown(TSRMLS_C);
-					return FAILURE;
+					return FPM_EXIT_SOFTWARE;
 				}
 				SG(headers_sent) = 1;
 				SG(request_info).no_headers = 1;
@@ -1700,7 +1700,7 @@ int main(int argc, char *argv[])
 #endif
 				php_request_shutdown((void *) 0);
 				fcgi_shutdown();
-				exit_status = 0;
+				exit_status = FPM_EXIT_OK;
 				goto out;
 		}
 	}
@@ -1711,14 +1711,14 @@ int main(int argc, char *argv[])
 		if (php_request_startup(TSRMLS_C) == FAILURE) {
 			SG(server_context) = NULL;
 			php_module_shutdown(TSRMLS_C);
-			return FAILURE;
+			return FPM_EXIT_SOFTWARE;
 		}
 		SG(headers_sent) = 1;
 		SG(request_info).no_headers = 1;
 		php_print_info(0xFFFFFFFF TSRMLS_CC);
 		php_request_shutdown((void *) 0);
 		fcgi_shutdown();
-		exit_status = 0;
+		exit_status = FPM_EXIT_OK;
 		goto out;
 	}
 
@@ -1731,7 +1731,7 @@ int main(int argc, char *argv[])
 		php_output_end_all(TSRMLS_C);
 		php_output_deactivate(TSRMLS_C);
 		fcgi_shutdown();
-		exit_status = 0;
+		exit_status = FPM_EXIT_USAGE;
 		goto out;
 	}
 
@@ -1750,7 +1750,7 @@ int main(int argc, char *argv[])
 #ifdef ZTS
 		tsrm_shutdown();
 #endif
-		return FAILURE;
+		return FPM_EXIT_SOFTWARE;
 	}
 	
 	if (use_extended_info) {
@@ -1793,14 +1793,23 @@ consult the installation file that came with this distribution, or visit \n\
 			 */
 			tsrm_shutdown();
 #endif
-			return FAILURE;
+			return FPM_EXIT_SOFTWARE;
 		}
 	}
 
 	if (0 > fpm_init(argc, argv, fpm_config ? fpm_config : CGIG(fpm_config), fpm_prefix, fpm_pid, test_conf, php_allow_to_run_as_root)) {
-		return FAILURE;
+
+		if (fpm_global_config.daemonize) {
+			zlog(ZLOG_DEBUG, "Sending SIGUSR2 (error) to parent %d", getppid());
+			kill(getppid(), SIGUSR2);
+		}
+		return FPM_EXIT_CONFIG;
 	}
 
+	if (fpm_global_config.daemonize) {
+		zlog(ZLOG_DEBUG, "Sending SIGUSR1 (OK) to parent %d", getppid());
+		kill(getppid(), SIGUSR1);
+	}
 	fpm_is_running = 1;
 
 	fcgi_fd = fpm_run(&max_requests);
@@ -1832,7 +1841,7 @@ consult the installation file that came with this distribution, or visit \n\
 				fcgi_finish_request(&request, 1);
 				SG(server_context) = NULL;
 				php_module_shutdown(TSRMLS_C);
-				return FAILURE;
+				return FPM_EXIT_SOFTWARE;
 			}
 
 			/* check if request_method has been sent.
@@ -1920,17 +1929,9 @@ fastcgi_request_done:
 
 			php_request_shutdown((void *) 0);
 
-			if (exit_status == 0) {
-				exit_status = EG(exit_status);
-			}
-
 			requests++;
 			if (max_requests && (requests == max_requests)) {
 				fcgi_finish_request(&request, 1);
-				if (max_requests != 1) {
-					/* no need to return exit_status of the last request */
-					exit_status = 0;
-				}
 				break;
 			}
 			/* end of fastcgi loop */
@@ -1944,7 +1945,7 @@ fastcgi_request_done:
 			free(cgi_sapi_module.ini_entries);
 		}
 	} zend_catch {
-		exit_status = 255;
+		exit_status = FPM_EXIT_SOFTWARE;
 	} zend_end_try();
 
 out:
diff --git a/sapi/fpm/fpm/fpm_process_ctl.c b/sapi/fpm/fpm/fpm_process_ctl.c
index e698eb0..7840d17 100644
--- a/sapi/fpm/fpm/fpm_process_ctl.c
+++ b/sapi/fpm/fpm/fpm_process_ctl.c
@@ -71,7 +71,7 @@ static void fpm_pctl_exit() /* {{{ */
 
 	fpm_conf_unlink_pid();
 	fpm_cleanups_run(FPM_CLEANUP_PARENT_EXIT_MAIN);
-	exit(0);
+	exit(FPM_EXIT_OK);
 }
 /* }}} */
 
@@ -100,7 +100,7 @@ static void fpm_pctl_exec() /* {{{ */
 	fpm_cleanups_run(FPM_CLEANUP_PARENT_EXEC);
 	execvp(saved_argv[0], saved_argv);
 	zlog(ZLOG_SYSERROR, "failed to reload: execvp() failed");
-	exit(1);
+	exit(FPM_EXIT_SOFTWARE);
 }
 /* }}} */
 
diff --git a/sapi/fpm/fpm/fpm_signals.c b/sapi/fpm/fpm/fpm_signals.c
index 8993a86..656269f 100644
--- a/sapi/fpm/fpm/fpm_signals.c
+++ b/sapi/fpm/fpm/fpm_signals.c
@@ -249,3 +249,15 @@ int fpm_signals_get_fd() /* {{{ */
 }
 /* }}} */
 
+void fpm_signals_sighandler_exit_ok(pid_t pid) /* {{{ */
+{
+	exit(FPM_EXIT_OK);
+}
+/* }}} */
+
+void fpm_signals_sighandler_exit_config(pid_t pid) /* {{{ */
+{
+	exit(FPM_EXIT_CONFIG);
+}
+/* }}} */
+
diff --git a/sapi/fpm/fpm/fpm_signals.h b/sapi/fpm/fpm/fpm_signals.h
index eb80fae..13484cb 100644
--- a/sapi/fpm/fpm/fpm_signals.h
+++ b/sapi/fpm/fpm/fpm_signals.h
@@ -11,6 +11,9 @@ int fpm_signals_init_main();
 int fpm_signals_init_child();
 int fpm_signals_get_fd();
 
+void fpm_signals_sighandler_exit_ok(pid_t pid);
+void fpm_signals_sighandler_exit_config(pid_t pid);
+
 extern const char *fpm_signal_names[NSIG + 1];
 
 #endif
diff --git a/sapi/fpm/fpm/fpm_unix.c b/sapi/fpm/fpm/fpm_unix.c
index fb61d63..1ab8189 100644
--- a/sapi/fpm/fpm/fpm_unix.c
+++ b/sapi/fpm/fpm/fpm_unix.c
@@ -23,6 +23,7 @@
 #include "fpm_clock.h"
 #include "fpm_stdio.h"
 #include "fpm_unix.h"
+#include "fpm_signals.h"
 #include "zlog.h"
 
 size_t fpm_pagesize;
@@ -242,18 +243,75 @@ int fpm_unix_init_main() /* {{{ */
 
 	fpm_pagesize = getpagesize();
 	if (fpm_global_config.daemonize) {
-		switch (fork()) {
-			case -1 :
+		/*
+		 * If daemonize, the calling process will die soon
+		 * and the master process continues to initialize itself.
+		 *
+		 * The parent process has then to wait for the master
+		 * process to initialize to return a consistent exit
+		 * value. For this pupose, the master process will
+		 * send USR1 if everything went well and USR2
+		 * otherwise.
+		 */
+
+		struct sigaction act;
+		struct sigaction oldact_usr1;
+		struct sigaction oldact_usr2;
+		struct timeval tv;
+
+		/*
+		 * set sigaction for USR1 before fork
+		 * save old sigaction to restore it after
+		 * fork in the child process (the master process)
+		 */
+		memset(&act, 0, sizeof(act));
+		memset(&act, 0, sizeof(oldact_usr1));
+		act.sa_handler = fpm_signals_sighandler_exit_ok;
+		sigfillset(&act.sa_mask);
+		sigaction(SIGUSR1, &act, &oldact_usr1);
+
+		/*
+		 * set sigaction for USR2 before fork
+		 * save old sigaction to restore it after
+		 * fork in the child process (the master process)
+		 */
+		memset(&act, 0, sizeof(act));
+		memset(&act, 0, sizeof(oldact_usr2));
+		act.sa_handler = fpm_signals_sighandler_exit_config;
+		sigfillset(&act.sa_mask);
+		sigaction(SIGUSR2, &act, &oldact_usr2);
+
+		/* then fork */
+		pid_t pid = fork();
+		switch (pid) {
+
+			case -1 : /* error */
 				zlog(ZLOG_SYSERROR, "failed to daemonize");
 				return -1;
-			case 0 :
+
+			case 0 : /* children */
+				/* restore USR1 and USR2 sigaction */
+				sigaction(SIGUSR1, &oldact_usr1, NULL);
+				sigaction(SIGUSR2, &oldact_usr2, NULL);
 				break;
-			default :
+
+			default : /* parent */
 				fpm_cleanups_run(FPM_CLEANUP_PARENT_EXIT);
-				exit(0);
+
+				/*
+				 * wait for 10s before exiting with error
+				 * the child is supposed to send USR1 or USR2 to tell the parent
+				 * how it goes for it
+				 */
+				tv.tv_sec = 10;
+				tv.tv_usec = 0;
+				zlog(ZLOG_DEBUG, "The calling process is waiting for the master process to ping");
+				select(0, NULL, NULL, NULL, &tv);
+				exit(FPM_EXIT_SOFTWARE);
 		}
 	}
 
+	/* continue as a child */
 	setsid();
 	if (0 > fpm_clock_init()) {
 		return -1;


commit c2f33fb1293cbcdc94daefb8583ca13e98b5c826
Author: Jerome Loyet <fat at php.net>
Date:   Fri May 25 21:13:57 2012 +0200

    - Fixed bug #62033 (php-fpm exits with status 0 on some failures to start)

diff --git a/NEWS b/NEWS
index ac4eeb5..3da506f 100644
--- a/NEWS
+++ b/NEWS
@@ -61,6 +61,8 @@ PHP                                                                        NEWS
     for non-root start). (fat)
   . Fixed bug #61839 (Unable to cross-compile PHP with --enable-fpm). (fat)
   . Fixed bug #61026 (FPM pools can listen on the same address). (fat)
+  . Fixed bug #62033 (php-fpm exits with status 0 on some failures to start).
+    (fat)
 
 - Intl
   . ResourceBundle constructor now accepts NULL for the first two arguments.
diff --git a/sapi/fpm/config.m4 b/sapi/fpm/config.m4
index 6c860c9..ad46717 100644
--- a/sapi/fpm/config.m4
+++ b/sapi/fpm/config.m4
@@ -16,6 +16,7 @@ AC_DEFUN([AC_FPM_STDLIBS],
   AC_CHECK_HEADERS([errno.h fcntl.h stdio.h stdlib.h unistd.h sys/uio.h])
   AC_CHECK_HEADERS([sys/select.h sys/socket.h sys/time.h])
   AC_CHECK_HEADERS([arpa/inet.h netinet/in.h])
+  AC_CHECK_HEADERS([sysexits.h])
 ])
 
 AC_DEFUN([AC_FPM_PRCTL],
diff --git a/sapi/fpm/fpm/fpm.c b/sapi/fpm/fpm/fpm.c
index 909902b..176dbaf 100644
--- a/sapi/fpm/fpm/fpm.c
+++ b/sapi/fpm/fpm/fpm.c
@@ -66,7 +66,7 @@ int fpm_init(int argc, char **argv, char *config, char *prefix, char *pid, int t
 	    0 > fpm_event_init_main()) {
 
 		if (fpm_globals.test_successful) {
-			exit(0);
+			exit(FPM_EXIT_OK);
 		} else {
 			zlog(ZLOG_ERROR, "FPM initialization failed");
 			return -1;
diff --git a/sapi/fpm/fpm/fpm.h b/sapi/fpm/fpm/fpm.h
index 2a69cb2..b0bed0a 100644
--- a/sapi/fpm/fpm/fpm.h
+++ b/sapi/fpm/fpm/fpm.h
@@ -7,6 +7,35 @@
 
 #include <unistd.h>
 
+#ifdef HAVE_SYSEXITS_H
+#include <sysexits.h>
+#endif
+
+#ifdef EX_OK
+#define FPM_EXIT_OK EX_OK
+#else
+#define FPM_EXIT_OK 0
+#endif
+
+#ifdef EX_USAGE
+#define FPM_EXIT_USAGE EX_USAGE
+#else
+#define FPM_EXIT_USAGE 64
+#endif
+
+#ifdef EX_SOFTWARE
+#define FPM_EXIT_SOFTWARE EX_SOFTWARE
+#else
+#define FPM_EXIT_SOFTWARE 70
+#endif
+
+#ifdef EX_CONFIG
+#define FPM_EXIT_CONFIG EX_CONFIG
+#else
+#define FPM_EXIT_CONFIG 78
+#endif
+
+
 int fpm_run(int *max_requests);
 int fpm_init(int argc, char **argv, char *config, char *prefix, char *pid, int test_conf, int run_as_root);
 
diff --git a/sapi/fpm/fpm/fpm_children.c b/sapi/fpm/fpm/fpm_children.c
index 35058b0..84a9474 100644
--- a/sapi/fpm/fpm/fpm_children.c
+++ b/sapi/fpm/fpm/fpm_children.c
@@ -156,7 +156,7 @@ static void fpm_child_init(struct fpm_worker_pool_s *wp) /* {{{ */
 	    0 > fpm_php_init_child(wp)) {
 
 		zlog(ZLOG_ERROR, "[pool %s] child failed to initialize", wp->config->name);
-		exit(255);
+		exit(FPM_EXIT_SOFTWARE);
 	}
 }
 /* }}} */
@@ -198,7 +198,7 @@ void fpm_children_bury() /* {{{ */
 				restart_child = 0;
 			}
 
-			if (WEXITSTATUS(status) != 0) {
+			if (WEXITSTATUS(status) != FPM_EXIT_OK) {
 				severity = ZLOG_WARNING;
 			}
 
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index 130673f..c3fd2bc 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -1528,7 +1528,7 @@ static zend_module_entry cgi_module_entry = {
  */
 int main(int argc, char *argv[])
 {
-	int exit_status = SUCCESS;
+	int exit_status = FPM_EXIT_OK;
 	int cgi = 0, c, use_extended_info = 0;
 	zend_file_handle file_handle;
 
@@ -1659,7 +1659,7 @@ int main(int argc, char *argv[])
 				php_output_end_all(TSRMLS_C);
 				php_output_deactivate(TSRMLS_C);
 				fcgi_shutdown();
-				exit_status = 0;
+				exit_status = FPM_EXIT_OK;
 				goto out;
 
 			case 'i': /* php info & quit */
@@ -1680,7 +1680,7 @@ int main(int argc, char *argv[])
 				php_output_end_all(TSRMLS_C);
 				php_output_deactivate(TSRMLS_C);
 				fcgi_shutdown();
-				exit_status = 0;
+				exit_status = (c == 'h') ? FPM_EXIT_OK : FPM_EXIT_USAGE;
 				goto out;
 
 			case 'v': /* show php version & quit */
@@ -1688,7 +1688,7 @@ int main(int argc, char *argv[])
 				if (php_request_startup(TSRMLS_C) == FAILURE) {
 					SG(server_context) = NULL;
 					php_module_shutdown(TSRMLS_C);
-					return FAILURE;
+					return FPM_EXIT_SOFTWARE;
 				}
 				SG(headers_sent) = 1;
 				SG(request_info).no_headers = 1;
@@ -1700,7 +1700,7 @@ int main(int argc, char *argv[])
 #endif
 				php_request_shutdown((void *) 0);
 				fcgi_shutdown();
-				exit_status = 0;
+				exit_status = FPM_EXIT_OK;
 				goto out;
 		}
 	}
@@ -1711,14 +1711,14 @@ int main(int argc, char *argv[])
 		if (php_request_startup(TSRMLS_C) == FAILURE) {
 			SG(server_context) = NULL;
 			php_module_shutdown(TSRMLS_C);
-			return FAILURE;
+			return FPM_EXIT_SOFTWARE;
 		}
 		SG(headers_sent) = 1;
 		SG(request_info).no_headers = 1;
 		php_print_info(0xFFFFFFFF TSRMLS_CC);
 		php_request_shutdown((void *) 0);
 		fcgi_shutdown();
-		exit_status = 0;
+		exit_status = FPM_EXIT_OK;
 		goto out;
 	}
 
@@ -1731,7 +1731,7 @@ int main(int argc, char *argv[])
 		php_output_end_all(TSRMLS_C);
 		php_output_deactivate(TSRMLS_C);
 		fcgi_shutdown();
-		exit_status = 0;
+		exit_status = FPM_EXIT_USAGE;
 		goto out;
 	}
 
@@ -1750,7 +1750,7 @@ int main(int argc, char *argv[])
 #ifdef ZTS
 		tsrm_shutdown();
 #endif
-		return FAILURE;
+		return FPM_EXIT_SOFTWARE;
 	}
 	
 	if (use_extended_info) {
@@ -1793,14 +1793,23 @@ consult the installation file that came with this distribution, or visit \n\
 			 */
 			tsrm_shutdown();
 #endif
-			return FAILURE;
+			return FPM_EXIT_SOFTWARE;
 		}
 	}
 
 	if (0 > fpm_init(argc, argv, fpm_config ? fpm_config : CGIG(fpm_config), fpm_prefix, fpm_pid, test_conf, php_allow_to_run_as_root)) {
-		return FAILURE;
+
+		if (fpm_global_config.daemonize) {
+			zlog(ZLOG_DEBUG, "Sending SIGUSR2 (error) to parent %d", getppid());
+			kill(getppid(), SIGUSR2);
+		}
+		return FPM_EXIT_CONFIG;
 	}
 
+	if (fpm_global_config.daemonize) {
+		zlog(ZLOG_DEBUG, "Sending SIGUSR1 (OK) to parent %d", getppid());
+		kill(getppid(), SIGUSR1);
+	}
 	fpm_is_running = 1;
 
 	fcgi_fd = fpm_run(&max_requests);
@@ -1832,7 +1841,7 @@ consult the installation file that came with this distribution, or visit \n\
 				fcgi_finish_request(&request, 1);
 				SG(server_context) = NULL;
 				php_module_shutdown(TSRMLS_C);
-				return FAILURE;
+				return FPM_EXIT_SOFTWARE;
 			}
 
 			/* check if request_method has been sent.
@@ -1920,17 +1929,9 @@ fastcgi_request_done:
 
 			php_request_shutdown((void *) 0);
 
-			if (exit_status == 0) {
-				exit_status = EG(exit_status);
-			}
-
 			requests++;
 			if (max_requests && (requests == max_requests)) {
 				fcgi_finish_request(&request, 1);
-				if (max_requests != 1) {
-					/* no need to return exit_status of the last request */
-					exit_status = 0;
-				}
 				break;
 			}
 			/* end of fastcgi loop */
@@ -1944,7 +1945,7 @@ fastcgi_request_done:
 			free(cgi_sapi_module.ini_entries);
 		}
 	} zend_catch {
-		exit_status = 255;
+		exit_status = FPM_EXIT_SOFTWARE;
 	} zend_end_try();
 
 out:
diff --git a/sapi/fpm/fpm/fpm_process_ctl.c b/sapi/fpm/fpm/fpm_process_ctl.c
index e698eb0..7840d17 100644
--- a/sapi/fpm/fpm/fpm_process_ctl.c
+++ b/sapi/fpm/fpm/fpm_process_ctl.c
@@ -71,7 +71,7 @@ static void fpm_pctl_exit() /* {{{ */
 
 	fpm_conf_unlink_pid();
 	fpm_cleanups_run(FPM_CLEANUP_PARENT_EXIT_MAIN);
-	exit(0);
+	exit(FPM_EXIT_OK);
 }
 /* }}} */
 
@@ -100,7 +100,7 @@ static void fpm_pctl_exec() /* {{{ */
 	fpm_cleanups_run(FPM_CLEANUP_PARENT_EXEC);
 	execvp(saved_argv[0], saved_argv);
 	zlog(ZLOG_SYSERROR, "failed to reload: execvp() failed");
-	exit(1);
+	exit(FPM_EXIT_SOFTWARE);
 }
 /* }}} */
 
diff --git a/sapi/fpm/fpm/fpm_signals.c b/sapi/fpm/fpm/fpm_signals.c
index 8993a86..656269f 100644
--- a/sapi/fpm/fpm/fpm_signals.c
+++ b/sapi/fpm/fpm/fpm_signals.c
@@ -249,3 +249,15 @@ int fpm_signals_get_fd() /* {{{ */
 }
 /* }}} */
 
+void fpm_signals_sighandler_exit_ok(pid_t pid) /* {{{ */
+{
+	exit(FPM_EXIT_OK);
+}
+/* }}} */
+
+void fpm_signals_sighandler_exit_config(pid_t pid) /* {{{ */
+{
+	exit(FPM_EXIT_CONFIG);
+}
+/* }}} */
+
diff --git a/sapi/fpm/fpm/fpm_signals.h b/sapi/fpm/fpm/fpm_signals.h
index eb80fae..13484cb 100644
--- a/sapi/fpm/fpm/fpm_signals.h
+++ b/sapi/fpm/fpm/fpm_signals.h
@@ -11,6 +11,9 @@ int fpm_signals_init_main();
 int fpm_signals_init_child();
 int fpm_signals_get_fd();
 
+void fpm_signals_sighandler_exit_ok(pid_t pid);
+void fpm_signals_sighandler_exit_config(pid_t pid);
+
 extern const char *fpm_signal_names[NSIG + 1];
 
 #endif
diff --git a/sapi/fpm/fpm/fpm_unix.c b/sapi/fpm/fpm/fpm_unix.c
index fb61d63..1ab8189 100644
--- a/sapi/fpm/fpm/fpm_unix.c
+++ b/sapi/fpm/fpm/fpm_unix.c
@@ -23,6 +23,7 @@
 #include "fpm_clock.h"
 #include "fpm_stdio.h"
 #include "fpm_unix.h"
+#include "fpm_signals.h"
 #include "zlog.h"
 
 size_t fpm_pagesize;
@@ -242,18 +243,75 @@ int fpm_unix_init_main() /* {{{ */
 
 	fpm_pagesize = getpagesize();
 	if (fpm_global_config.daemonize) {
-		switch (fork()) {
-			case -1 :
+		/*
+		 * If daemonize, the calling process will die soon
+		 * and the master process continues to initialize itself.
+		 *
+		 * The parent process has then to wait for the master
+		 * process to initialize to return a consistent exit
+		 * value. For this pupose, the master process will
+		 * send USR1 if everything went well and USR2
+		 * otherwise.
+		 */
+
+		struct sigaction act;
+		struct sigaction oldact_usr1;
+		struct sigaction oldact_usr2;
+		struct timeval tv;
+
+		/*
+		 * set sigaction for USR1 before fork
+		 * save old sigaction to restore it after
+		 * fork in the child process (the master process)
+		 */
+		memset(&act, 0, sizeof(act));
+		memset(&act, 0, sizeof(oldact_usr1));
+		act.sa_handler = fpm_signals_sighandler_exit_ok;
+		sigfillset(&act.sa_mask);
+		sigaction(SIGUSR1, &act, &oldact_usr1);
+
+		/*
+		 * set sigaction for USR2 before fork
+		 * save old sigaction to restore it after
+		 * fork in the child process (the master process)
+		 */
+		memset(&act, 0, sizeof(act));
+		memset(&act, 0, sizeof(oldact_usr2));
+		act.sa_handler = fpm_signals_sighandler_exit_config;
+		sigfillset(&act.sa_mask);
+		sigaction(SIGUSR2, &act, &oldact_usr2);
+
+		/* then fork */
+		pid_t pid = fork();
+		switch (pid) {
+
+			case -1 : /* error */
 				zlog(ZLOG_SYSERROR, "failed to daemonize");
 				return -1;
-			case 0 :
+
+			case 0 : /* children */
+				/* restore USR1 and USR2 sigaction */
+				sigaction(SIGUSR1, &oldact_usr1, NULL);
+				sigaction(SIGUSR2, &oldact_usr2, NULL);
 				break;
-			default :
+
+			default : /* parent */
 				fpm_cleanups_run(FPM_CLEANUP_PARENT_EXIT);
-				exit(0);
+
+				/*
+				 * wait for 10s before exiting with error
+				 * the child is supposed to send USR1 or USR2 to tell the parent
+				 * how it goes for it
+				 */
+				tv.tv_sec = 10;
+				tv.tv_usec = 0;
+				zlog(ZLOG_DEBUG, "The calling process is waiting for the master process to ping");
+				select(0, NULL, NULL, NULL, &tv);
+				exit(FPM_EXIT_SOFTWARE);
 		}
 	}
 
+	/* continue as a child */
 	setsid();
 	if (0 > fpm_clock_init()) {
 		return -1;


commit bf9120ecae6e4653dbb5a1b0576f0b163afd6846
Author: Jerome Loyet <fat at php.net>
Date:   Fri May 25 21:10:17 2012 +0200

    - Fixed bug #62033 (php-fpm exits with status 0 on some failures to start)

diff --git a/NEWS b/NEWS
index 5a748d2..bb6a36e 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,8 @@ PHP                                                                        NEWS
   . Fixed bug #61295 (php-fpm should not fail with commented 'user'
     for non-root start). (fat)
   . Fixed bug #61026 (FPM pools can listen on the same address). (fat)
+  . Fixed bug #62033 (php-fpm exits with status 0 on some failures to start).
+    (fat)
 
 - Intl:
   . Fixed bug #62083 (grapheme_extract() memory leaks). (Gustavo)
diff --git a/sapi/fpm/config.m4 b/sapi/fpm/config.m4
index 953fa1f..c23485a 100644
--- a/sapi/fpm/config.m4
+++ b/sapi/fpm/config.m4
@@ -16,6 +16,7 @@ AC_DEFUN([AC_FPM_STDLIBS],
   AC_CHECK_HEADERS([errno.h fcntl.h stdio.h stdlib.h unistd.h sys/uio.h])
   AC_CHECK_HEADERS([sys/select.h sys/socket.h sys/time.h])
   AC_CHECK_HEADERS([arpa/inet.h netinet/in.h])
+  AC_CHECK_HEADERS([sysexits.h])
 ])
 
 AC_DEFUN([AC_FPM_PRCTL],
diff --git a/sapi/fpm/fpm/fpm.c b/sapi/fpm/fpm/fpm.c
index 909902b..176dbaf 100644
--- a/sapi/fpm/fpm/fpm.c
+++ b/sapi/fpm/fpm/fpm.c
@@ -66,7 +66,7 @@ int fpm_init(int argc, char **argv, char *config, char *prefix, char *pid, int t
 	    0 > fpm_event_init_main()) {
 
 		if (fpm_globals.test_successful) {
-			exit(0);
+			exit(FPM_EXIT_OK);
 		} else {
 			zlog(ZLOG_ERROR, "FPM initialization failed");
 			return -1;
diff --git a/sapi/fpm/fpm/fpm.h b/sapi/fpm/fpm/fpm.h
index 2a69cb2..b0bed0a 100644
--- a/sapi/fpm/fpm/fpm.h
+++ b/sapi/fpm/fpm/fpm.h
@@ -7,6 +7,35 @@
 
 #include <unistd.h>
 
+#ifdef HAVE_SYSEXITS_H
+#include <sysexits.h>
+#endif
+
+#ifdef EX_OK
+#define FPM_EXIT_OK EX_OK
+#else
+#define FPM_EXIT_OK 0
+#endif
+
+#ifdef EX_USAGE
+#define FPM_EXIT_USAGE EX_USAGE
+#else
+#define FPM_EXIT_USAGE 64
+#endif
+
+#ifdef EX_SOFTWARE
+#define FPM_EXIT_SOFTWARE EX_SOFTWARE
+#else
+#define FPM_EXIT_SOFTWARE 70
+#endif
+
+#ifdef EX_CONFIG
+#define FPM_EXIT_CONFIG EX_CONFIG
+#else
+#define FPM_EXIT_CONFIG 78
+#endif
+
+
 int fpm_run(int *max_requests);
 int fpm_init(int argc, char **argv, char *config, char *prefix, char *pid, int test_conf, int run_as_root);
 
diff --git a/sapi/fpm/fpm/fpm_children.c b/sapi/fpm/fpm/fpm_children.c
index 35058b0..84a9474 100644
--- a/sapi/fpm/fpm/fpm_children.c
+++ b/sapi/fpm/fpm/fpm_children.c
@@ -156,7 +156,7 @@ static void fpm_child_init(struct fpm_worker_pool_s *wp) /* {{{ */
 	    0 > fpm_php_init_child(wp)) {
 
 		zlog(ZLOG_ERROR, "[pool %s] child failed to initialize", wp->config->name);
-		exit(255);
+		exit(FPM_EXIT_SOFTWARE);
 	}
 }
 /* }}} */
@@ -198,7 +198,7 @@ void fpm_children_bury() /* {{{ */
 				restart_child = 0;
 			}
 
-			if (WEXITSTATUS(status) != 0) {
+			if (WEXITSTATUS(status) != FPM_EXIT_OK) {
 				severity = ZLOG_WARNING;
 			}
 
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index 95a7623..08477da 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -1538,7 +1538,7 @@ static zend_module_entry cgi_module_entry = {
  */
 int main(int argc, char *argv[])
 {
-	int exit_status = SUCCESS;
+	int exit_status = FPM_EXIT_OK;
 	int cgi = 0, c;
 	zend_file_handle file_handle;
 
@@ -1668,7 +1668,7 @@ int main(int argc, char *argv[])
 				php_printf("\n");
 				php_end_ob_buffers(1 TSRMLS_CC);
 				fcgi_shutdown();
-				exit_status = 0;
+				exit_status = FPM_EXIT_OK;
 				goto out;
 
 			case 'i': /* php info & quit */
@@ -1689,7 +1689,7 @@ int main(int argc, char *argv[])
 				php_cgi_usage(argv[0]);
 				php_end_ob_buffers(1 TSRMLS_CC);
 				fcgi_shutdown();
-				exit_status = 0;
+				exit_status = (c == 'h') ? FPM_EXIT_OK : FPM_EXIT_USAGE;
 				goto out;
 
 			case 'v': /* show php version & quit */
@@ -1697,7 +1697,7 @@ int main(int argc, char *argv[])
 				if (php_request_startup(TSRMLS_C) == FAILURE) {
 					SG(server_context) = NULL;
 					php_module_shutdown(TSRMLS_C);
-					return FAILURE;
+					return FPM_EXIT_SOFTWARE;
 				}
 				SG(headers_sent) = 1;
 				SG(request_info).no_headers = 1;
@@ -1709,7 +1709,7 @@ int main(int argc, char *argv[])
 #endif
 				php_request_shutdown((void *) 0);
 				fcgi_shutdown();
-				exit_status = 0;
+				exit_status = FPM_EXIT_OK;
 				goto out;
 		}
 	}
@@ -1720,14 +1720,14 @@ int main(int argc, char *argv[])
 		if (php_request_startup(TSRMLS_C) == FAILURE) {
 			SG(server_context) = NULL;
 			php_module_shutdown(TSRMLS_C);
-			return FAILURE;
+			return FPM_EXIT_SOFTWARE;
 		}
 		SG(headers_sent) = 1;
 		SG(request_info).no_headers = 1;
 		php_print_info(0xFFFFFFFF TSRMLS_CC);
 		php_request_shutdown((void *) 0);
 		fcgi_shutdown();
-		exit_status = 0;
+		exit_status = FPM_EXIT_OK;
 		goto out;
 	}
 
@@ -1739,7 +1739,7 @@ int main(int argc, char *argv[])
 		SG(headers_sent) = 1;
 		php_cgi_usage(argv[0]);
 		php_end_ob_buffers(1 TSRMLS_CC);
-		exit_status = 0;
+		exit_status = FPM_EXIT_USAGE;
 		fcgi_shutdown();
 		goto out;
 	}
@@ -1759,7 +1759,7 @@ int main(int argc, char *argv[])
 #ifdef ZTS
 		tsrm_shutdown();
 #endif
-		return FAILURE;
+		return FPM_EXIT_SOFTWARE;
 	}
 
 	/* check force_cgi after startup, so we have proper output */
@@ -1798,14 +1798,23 @@ consult the installation file that came with this distribution, or visit \n\
 			 */
 			tsrm_shutdown();
 #endif
-			return FAILURE;
+			return FPM_EXIT_SOFTWARE;
 		}
 	}
 
 	if (0 > fpm_init(argc, argv, fpm_config ? fpm_config : CGIG(fpm_config), fpm_prefix, fpm_pid, test_conf, php_allow_to_run_as_root)) {
-		return FAILURE;
+
+		if (fpm_global_config.daemonize) {
+			zlog(ZLOG_DEBUG, "Sending SIGUSR2 (error) to parent %d", getppid());
+			kill(getppid(), SIGUSR2);
+		}
+		return FPM_EXIT_CONFIG;
 	}
 
+	if (fpm_global_config.daemonize) {
+		zlog(ZLOG_DEBUG, "Sending SIGUSR1 (OK) to parent %d", getppid());
+		kill(getppid(), SIGUSR1);
+	}
 	fpm_is_running = 1;
 
 	fcgi_fd = fpm_run(&max_requests);
@@ -1837,7 +1846,7 @@ consult the installation file that came with this distribution, or visit \n\
 				fcgi_finish_request(&request, 1);
 				SG(server_context) = NULL;
 				php_module_shutdown(TSRMLS_C);
-				return FAILURE;
+				return FPM_EXIT_SOFTWARE;
 			}
 
 			/* check if request_method has been sent.
@@ -1925,17 +1934,9 @@ fastcgi_request_done:
 
 			php_request_shutdown((void *) 0);
 
-			if (exit_status == 0) {
-				exit_status = EG(exit_status);
-			}
-
 			requests++;
 			if (max_requests && (requests == max_requests)) {
 				fcgi_finish_request(&request, 1);
-				if (max_requests != 1) {
-					/* no need to return exit_status of the last request */
-					exit_status = 0;
-				}
 				break;
 			}
 			/* end of fastcgi loop */
@@ -1949,7 +1950,7 @@ fastcgi_request_done:
 			free(cgi_sapi_module.ini_entries);
 		}
 	} zend_catch {
-		exit_status = 255;
+		exit_status = FPM_EXIT_SOFTWARE;
 	} zend_end_try();
 
 out:
diff --git a/sapi/fpm/fpm/fpm_process_ctl.c b/sapi/fpm/fpm/fpm_process_ctl.c
index e698eb0..7840d17 100644
--- a/sapi/fpm/fpm/fpm_process_ctl.c
+++ b/sapi/fpm/fpm/fpm_process_ctl.c
@@ -71,7 +71,7 @@ static void fpm_pctl_exit() /* {{{ */
 
 	fpm_conf_unlink_pid();
 	fpm_cleanups_run(FPM_CLEANUP_PARENT_EXIT_MAIN);
-	exit(0);
+	exit(FPM_EXIT_OK);
 }
 /* }}} */
 
@@ -100,7 +100,7 @@ static void fpm_pctl_exec() /* {{{ */
 	fpm_cleanups_run(FPM_CLEANUP_PARENT_EXEC);
 	execvp(saved_argv[0], saved_argv);
 	zlog(ZLOG_SYSERROR, "failed to reload: execvp() failed");
-	exit(1);
+	exit(FPM_EXIT_SOFTWARE);
 }
 /* }}} */
 
diff --git a/sapi/fpm/fpm/fpm_signals.c b/sapi/fpm/fpm/fpm_signals.c
index 8993a86..656269f 100644
--- a/sapi/fpm/fpm/fpm_signals.c
+++ b/sapi/fpm/fpm/fpm_signals.c
@@ -249,3 +249,15 @@ int fpm_signals_get_fd() /* {{{ */
 }
 /* }}} */
 
+void fpm_signals_sighandler_exit_ok(pid_t pid) /* {{{ */
+{
+	exit(FPM_EXIT_OK);
+}
+/* }}} */
+
+void fpm_signals_sighandler_exit_config(pid_t pid) /* {{{ */
+{
+	exit(FPM_EXIT_CONFIG);
+}
+/* }}} */
+
diff --git a/sapi/fpm/fpm/fpm_signals.h b/sapi/fpm/fpm/fpm_signals.h
index eb80fae..13484cb 100644
--- a/sapi/fpm/fpm/fpm_signals.h
+++ b/sapi/fpm/fpm/fpm_signals.h
@@ -11,6 +11,9 @@ int fpm_signals_init_main();
 int fpm_signals_init_child();
 int fpm_signals_get_fd();
 
+void fpm_signals_sighandler_exit_ok(pid_t pid);
+void fpm_signals_sighandler_exit_config(pid_t pid);
+
 extern const char *fpm_signal_names[NSIG + 1];
 
 #endif
diff --git a/sapi/fpm/fpm/fpm_unix.c b/sapi/fpm/fpm/fpm_unix.c
index fb61d63..1ab8189 100644
--- a/sapi/fpm/fpm/fpm_unix.c
+++ b/sapi/fpm/fpm/fpm_unix.c
@@ -23,6 +23,7 @@
 #include "fpm_clock.h"
 #include "fpm_stdio.h"
 #include "fpm_unix.h"
+#include "fpm_signals.h"
 #include "zlog.h"
 
 size_t fpm_pagesize;
@@ -242,18 +243,75 @@ int fpm_unix_init_main() /* {{{ */
 
 	fpm_pagesize = getpagesize();
 	if (fpm_global_config.daemonize) {
-		switch (fork()) {
-			case -1 :
+		/*
+		 * If daemonize, the calling process will die soon
+		 * and the master process continues to initialize itself.
+		 *
+		 * The parent process has then to wait for the master
+		 * process to initialize to return a consistent exit
+		 * value. For this pupose, the master process will
+		 * send USR1 if everything went well and USR2
+		 * otherwise.
+		 */
+
+		struct sigaction act;
+		struct sigaction oldact_usr1;
+		struct sigaction oldact_usr2;
+		struct timeval tv;
+
+		/*
+		 * set sigaction for USR1 before fork
+		 * save old sigaction to restore it after
+		 * fork in the child process (the master process)
+		 */
+		memset(&act, 0, sizeof(act));
+		memset(&act, 0, sizeof(oldact_usr1));
+		act.sa_handler = fpm_signals_sighandler_exit_ok;
+		sigfillset(&act.sa_mask);
+		sigaction(SIGUSR1, &act, &oldact_usr1);
+
+		/*
+		 * set sigaction for USR2 before fork
+		 * save old sigaction to restore it after
+		 * fork in the child process (the master process)
+		 */
+		memset(&act, 0, sizeof(act));
+		memset(&act, 0, sizeof(oldact_usr2));
+		act.sa_handler = fpm_signals_sighandler_exit_config;
+		sigfillset(&act.sa_mask);
+		sigaction(SIGUSR2, &act, &oldact_usr2);
+
+		/* then fork */
+		pid_t pid = fork();
+		switch (pid) {
+
+			case -1 : /* error */
 				zlog(ZLOG_SYSERROR, "failed to daemonize");
 				return -1;
-			case 0 :
+
+			case 0 : /* children */
+				/* restore USR1 and USR2 sigaction */
+				sigaction(SIGUSR1, &oldact_usr1, NULL);
+				sigaction(SIGUSR2, &oldact_usr2, NULL);
 				break;
-			default :
+
+			default : /* parent */
 				fpm_cleanups_run(FPM_CLEANUP_PARENT_EXIT);
-				exit(0);
+
+				/*
+				 * wait for 10s before exiting with error
+				 * the child is supposed to send USR1 or USR2 to tell the parent
+				 * how it goes for it
+				 */
+				tv.tv_sec = 10;
+				tv.tv_usec = 0;
+				zlog(ZLOG_DEBUG, "The calling process is waiting for the master process to ping");
+				select(0, NULL, NULL, NULL, &tv);
+				exit(FPM_EXIT_SOFTWARE);
 		}
 	}
 
+	/* continue as a child */
 	setsid();
 	if (0 > fpm_clock_init()) {
 		return -1;


commit 61a13773bcbf761ecc03faa99877d3cac90529a0
Merge: a1e97ba 91ad40d
Author: Xinchen Hui <laruence at php.net>
Date:   Fri May 25 22:34:06 2012 +0800

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fixed bug #62128 superfluous ";"



commit 91ad40d9bbc772709fb9f88c55d7ce55f55df71b
Merge: 16a592b c3547f1
Author: Xinchen Hui <laruence at php.net>
Date:   Fri May 25 22:33:17 2012 +0800

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fixed bug #62128 superfluous ";"



commit c3547f19359c7150a9bbd35aa2a7adc9da900da5
Author: Xinchen Hui <laruence at php.net>
Date:   Fri May 25 22:31:26 2012 +0800

    Fixed bug #62128 superfluous ";"

diff --git a/php.ini-development b/php.ini-development
index c198ccc..1375516 100644
--- a/php.ini-development
+++ b/php.ini-development
@@ -842,7 +842,7 @@ enable_dl = Off
 ; will look for to know it is OK to continue execution.  Setting this variable MAY
 ; cause security issues, KNOW WHAT YOU ARE DOING FIRST.
 ; http://php.net/cgi.redirect-status-env
-;cgi.redirect_status_env = ;
+;cgi.redirect_status_env = 
 
 ; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI.  PHP's
 ; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok
@@ -859,7 +859,7 @@ enable_dl = Off
 ; does not currently support this feature (03/17/2002)
 ; Set to 1 if running under IIS.  Default is zero.
 ; http://php.net/fastcgi.impersonate
-;fastcgi.impersonate = 1;
+;fastcgi.impersonate = 1
 
 ; Disable logging through FastCGI connection. PHP's default behavior is to enable
 ; this feature.
diff --git a/php.ini-production b/php.ini-production
index 3c0ae21..495fb01 100644
--- a/php.ini-production
+++ b/php.ini-production
@@ -842,7 +842,7 @@ enable_dl = Off
 ; will look for to know it is OK to continue execution.  Setting this variable MAY
 ; cause security issues, KNOW WHAT YOU ARE DOING FIRST.
 ; http://php.net/cgi.redirect-status-env
-;cgi.redirect_status_env = ;
+;cgi.redirect_status_env =
 
 ; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI.  PHP's
 ; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok
@@ -859,7 +859,7 @@ enable_dl = Off
 ; does not currently support this feature (03/17/2002)
 ; Set to 1 if running under IIS.  Default is zero.
 ; http://php.net/fastcgi.impersonate
-;fastcgi.impersonate = 1;
+;fastcgi.impersonate = 1
 
 ; Disable logging through FastCGI connection. PHP's default behavior is to enable
 ; this feature.


commit a1e97bada8894549af030b645d10d39222dfb9c6
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Fri May 25 11:55:50 2012 +0200

    Fixed problem in IntlCalendar debug handler
    
    *is_temp was not being set.
    
    Also deleted a redundant assignment to *is_temp in IntlTimeZone.

diff --git a/ext/intl/calendar/calendar_class.cpp b/ext/intl/calendar/calendar_class.cpp
index 43cbc4a..130c6b5 100644
--- a/ext/intl/calendar/calendar_class.cpp
+++ b/ext/intl/calendar/calendar_class.cpp
@@ -143,6 +143,8 @@ static HashTable *Calendar_get_debug_info(zval *object, int *is_temp TSRMLS_DC)
 	Calendar_object	*co;
 	const Calendar	*cal;
 	
+	*is_temp = 1;
+
 	array_init_size(&zv, 8);
 
 	co  = (Calendar_object*)zend_object_store_get_object(object TSRMLS_CC);
@@ -204,8 +206,6 @@ static HashTable *Calendar_get_debug_info(zval *object, int *is_temp TSRMLS_DC)
 
 	add_assoc_zval_ex(&zv, "fields", sizeof("fields"), zfields);
 
-	*is_temp = 1;
-
 	return Z_ARRVAL(zv);
 }
 /* }}} */
diff --git a/ext/intl/timezone/timezone_class.cpp b/ext/intl/timezone/timezone_class.cpp
index a1a9866..4034838 100644
--- a/ext/intl/timezone/timezone_class.cpp
+++ b/ext/intl/timezone/timezone_class.cpp
@@ -395,8 +395,6 @@ static HashTable *TimeZone_get_debug_info(zval *object, int *is_temp TSRMLS_DC)
 	add_assoc_long_ex(&zv, "currentOffset", sizeof("currentOffset"),
 		(long)(rawOffset + dstOffset));
 
-	*is_temp = 1;
-
 	return Z_ARRVAL(zv);
 }
 /* }}} */


commit c8d8d2442e49750115cab10bd38988b7355baa54
Merge: e2daa69 16a592b
Author: Anatoliy Belsky <ab at php.net>
Date:   Fri May 25 10:53:09 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fixed bug #62149 Test Bug - ext/curl/tests/bug61948
      Fixed bug #62148 mail_skipif doesn't skip imap tests on Release Build



commit 16a592b13a7909aa9d370fd020a10e00772bc254
Merge: 6fb0e4a 86d2faf
Author: Anatoliy Belsky <ab at php.net>
Date:   Fri May 25 10:52:38 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fixed bug #62149 Test Bug - ext/curl/tests/bug61948
      Fixed bug #62148 mail_skipif doesn't skip imap tests on Release Build



commit 86d2fafded73511e762671a60d6935ac87d6e39d
Author: Matt Ficken <mattficken at php.net>
Date:   Fri May 25 10:44:59 2012 +0200

    Fixed bug #62149 Test Bug - ext/curl/tests/bug61948

diff --git a/ext/curl/tests/bug61948-win32.phpt b/ext/curl/tests/bug61948-win32.phpt
new file mode 100644
index 0000000..dc86526
--- /dev/null
+++ b/ext/curl/tests/bug61948-win32.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction)
+--SKIPIF--
+<?php if (!extension_loaded("curl")) print "skip"; 
+if(substr(PHP_OS, 0, 3) != 'WIN' )
+  die("skip Not Valid for Linux");
+?>
+--INI--
+open_basedir="c:/tmp"
+--FILE--
+<?php
+  $ch = curl_init();
+  var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, ""));
+  var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, "c:/tmp/foo"));
+  var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, "c:/xxx/bar"));
+  curl_close($ch);
+?>
+--EXPECTF--
+%a
+
+Warning: curl_setopt(): open_basedir restriction in effect. File(c:/tmp/foo) is not within the allowed path(s): (c:/tmp) in %sbug61948-win32.php on line %d
+bool(false)
+
+Warning: curl_setopt(): open_basedir restriction in effect. File(c:/xxx/bar) is not within the allowed path(s): (c:/tmp) in %sbug61948-win32.php on line %d
+bool(false)
diff --git a/ext/curl/tests/bug61948.phpt b/ext/curl/tests/bug61948.phpt
index a03fc3b..23bbda7 100644
--- a/ext/curl/tests/bug61948.phpt
+++ b/ext/curl/tests/bug61948.phpt
@@ -1,7 +1,10 @@
 --TEST--
 Bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction)
 --SKIPIF--
-<?php if (!extension_loaded("curl")) print "skip"; ?>
+<?php if (!extension_loaded("curl")) print "skip"; 
+if(substr(PHP_OS, 0, 3) == 'WIN' )
+  die("skip Not Valid for Windows");
+?>
 --INI--
 open_basedir="/tmp"
 --FILE--


commit 4aac4da6739a87bf481fdd653b420dc5ca56b3ed
Author: Matt Ficken <mattficken at php.net>
Date:   Fri May 25 10:34:33 2012 +0200

    Fixed bug #62148 mail_skipif doesn't skip imap tests on Release Build

diff --git a/ext/standard/tests/mail/mail_skipif.inc b/ext/standard/tests/mail/mail_skipif.inc
index 2f4fbf3..0065940 100644
--- a/ext/standard/tests/mail/mail_skipif.inc
+++ b/ext/standard/tests/mail/mail_skipif.inc
@@ -1,5 +1,15 @@
 <?php
 extension_loaded('imap') or die('skip imap extension not available in this build');
+
+if( substr(PHP_OS, 0, 3) == 'WIN' && extension_loaded('sockets')) {
+	// be sure mail server is accessible... on PHP 5.3.13 release build, using test-pack PHP-5.3-r1af8b3f,
+	// the code below didn't skip test even though there was no mail server
+	//     test then failed (no mail server to test against)
+	$socket  = socket_create(AF_INET, SOCK_RAW, 1);
+	socket_set_option($socket, SOL_SOCKET, SO_RCVTIMEO, array('sec' => 10, 'usec' => 10));
+	// imap uses tcp port 143
+	socket_connect($socket, "localhost", 143) or die ("skip can't socket to mail server");
+}
  
 // Change these to make tests run successfully
 $mailbox  = '{localhost}';


commit e2daa69b621b5b60a960617543a37543d7a4bf9f
Merge: cf73fb5 6fb0e4a
Author: Anatoliy Belsky <ab at php.net>
Date:   Fri May 25 10:05:23 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fixed bug #62147 test bug - popen_pclose_basic-win32



commit 6fb0e4a4019fe98200ca45b8b15b385a7b5d1316
Merge: 3cd50ca d4d36fb
Author: Anatoliy Belsky <ab at php.net>
Date:   Fri May 25 09:55:53 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fixed bug #62147 test bug - popen_pclose_basic-win32



commit d4d36fba28a215a1f49cecf354668c010bf7a24e
Author: Matt Ficken <mattficken at php.net>
Date:   Fri May 25 09:53:51 2012 +0200

    Fixed bug #62147 test bug - popen_pclose_basic-win32

diff --git a/ext/standard/tests/file/popen_pclose_basic-win32.phpt b/ext/standard/tests/file/popen_pclose_basic-win32.phpt
index b5c7256..6351d86 100644
--- a/ext/standard/tests/file/popen_pclose_basic-win32.phpt
+++ b/ext/standard/tests/file/popen_pclose_basic-win32.phpt
@@ -39,7 +39,10 @@ $arr = array("ggg", "ddd", "aaa", "sss");
 // 
 // since we can't depend on PHP.ini being set a certain way, 
 // have to put the absolute path here.
-$file_handle = popen("/windows/system32/sort", "w");
+
+$sysroot = exec('echo %SYSTEMROOT%');
+
+$file_handle = popen("$sysroot/system32/sort", "w");
 $newline = "\n";
 foreach($arr as $str) {
   fwrite($file_handle, (binary)$str);


commit cf73fb5f75bd9ddc9024b765c28936eed75cb784
Merge: b187c35 3cd50ca
Author: Johannes Schlüter <johannes at php.net>
Date:   Fri May 25 00:25:16 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug #62146 	com_dotnet cannot be built shared, tested by Anatoliy
      Those changes are in 5.3.15
      - BFN



commit 3cd50ca714fcf346aaa51a2c01c996c9434a2455
Merge: 84b2c39 8fc9df3
Author: Johannes Schlüter <johannes at php.net>
Date:   Fri May 25 00:23:51 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug #62146 	com_dotnet cannot be built shared, tested by Anatoliy
      Those changes are in 5.3.15
      - BFN



commit 8fc9df3f67dc35bff019f538934322583fd5fefd
Author: Johannes Schlüter <johannes at php.net>
Date:   Fri May 25 00:22:25 2012 +0200

    Fix bug #62146 	com_dotnet cannot be built shared, tested by Anatoliy

diff --git a/NEWS b/NEWS
index 8149e1a..5a748d2 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,9 @@
 PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 2012, PHP 5.3.15
+- COM:
+  . Fixed bug #62146 com_dotnet cannot be built shared. (Johannes)
+
 - Fileinfo:
   . Fixed magic file regex support. (Felipe)
 
diff --git a/ext/com_dotnet/com_misc.c b/ext/com_dotnet/com_misc.c
index f931e6b..86deca2 100644
--- a/ext/com_dotnet/com_misc.c
+++ b/ext/com_dotnet/com_misc.c
@@ -42,7 +42,7 @@ void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC)
 	}
 }
 
-PHPAPI void php_com_wrap_dispatch(zval *z, IDispatch *disp,
+PHP_COM_DOTNET_API void php_com_wrap_dispatch(zval *z, IDispatch *disp,
 		int codepage TSRMLS_DC)
 {
 	php_com_dotnet_object *obj;
@@ -65,7 +65,7 @@ PHPAPI void php_com_wrap_dispatch(zval *z, IDispatch *disp,
 	z->value.obj.handlers = &php_com_object_handlers;
 }
 
-PHPAPI void php_com_wrap_variant(zval *z, VARIANT *v,
+PHP_COM_DOTNET_API void php_com_wrap_variant(zval *z, VARIANT *v,
 		int codepage TSRMLS_DC)
 {
 	php_com_dotnet_object *obj;
@@ -92,7 +92,7 @@ PHPAPI void php_com_wrap_variant(zval *z, VARIANT *v,
 
 /* this is a convenience function for fetching a particular
  * element from a (possibly multi-dimensional) safe array */
-PHPAPI int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC)
+PHP_COM_DOTNET_API int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC)
 {
 	UINT dims;
 	LONG lbound, ubound;
diff --git a/ext/com_dotnet/com_olechar.c b/ext/com_dotnet/com_olechar.c
index 67158fd..2cb1f03 100644
--- a/ext/com_dotnet/com_olechar.c
+++ b/ext/com_dotnet/com_olechar.c
@@ -30,7 +30,7 @@
 #include "php_com_dotnet_internal.h"
 
 
-PHPAPI OLECHAR *php_com_string_to_olestring(char *string, uint string_len, int codepage TSRMLS_DC)
+PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string, uint string_len, int codepage TSRMLS_DC)
 {
 	OLECHAR *olestring = NULL;
 	DWORD flags = codepage == CP_UTF8 ? 0 : MB_PRECOMPOSED | MB_ERR_INVALID_CHARS;
@@ -65,7 +65,7 @@ PHPAPI OLECHAR *php_com_string_to_olestring(char *string, uint string_len, int c
 	return olestring;
 }
 
-PHPAPI char *php_com_olestring_to_string(OLECHAR *olestring, uint *string_len, int codepage TSRMLS_DC)
+PHP_COM_DOTNET_API char *php_com_olestring_to_string(OLECHAR *olestring, uint *string_len, int codepage TSRMLS_DC)
 {
 	char *string;
 	uint length = 0;
diff --git a/ext/com_dotnet/com_persist.c b/ext/com_dotnet/com_persist.c
index 96173af..fb94021 100755
--- a/ext/com_dotnet/com_persist.c
+++ b/ext/com_dotnet/com_persist.c
@@ -271,7 +271,7 @@ static void istream_destructor(php_istream *stm)
 }
 /* }}} */
 
-PHPAPI IStream *php_com_wrapper_export_stream(php_stream *stream TSRMLS_DC)
+PHP_COM_DOTNET_API IStream *php_com_wrapper_export_stream(php_stream *stream TSRMLS_DC)
 {
 	php_istream *stm = (php_istream*)CoTaskMemAlloc(sizeof(*stm));
 
diff --git a/ext/com_dotnet/com_typeinfo.c b/ext/com_dotnet/com_typeinfo.c
index 21f8532..e860872 100644
--- a/ext/com_dotnet/com_typeinfo.c
+++ b/ext/com_dotnet/com_typeinfo.c
@@ -35,7 +35,7 @@
  * b) a CLSID, major, minor e.g. "{00000200-0000-0010-8000-00AA006D2EA4},2,0"
  * c) a Type Library name e.g. "Microsoft OLE DB ActiveX Data Objects 1.0 Library"
  */
-PHPAPI ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC)
+PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC)
 {
 	ITypeLib *TL = NULL;
 	char *strtok_buf, *major, *minor;
@@ -153,7 +153,7 @@ PHPAPI ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_D
 }
 
 /* Given a type-library, merge it into the current engine state */
-PHPAPI int php_com_import_typelib(ITypeLib *TL, int mode, int codepage TSRMLS_DC)
+PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode, int codepage TSRMLS_DC)
 {
 	int i, j, interfaces;
 	TYPEKIND pTKind;
@@ -224,7 +224,7 @@ void php_com_typelibrary_dtor(void *pDest)
 	ITypeLib_Release(*Lib);
 }
 
-PHPAPI ITypeLib *php_com_load_typelib_via_cache(char *search_string,
+PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib_via_cache(char *search_string,
 	int codepage, int *cached TSRMLS_DC)
 {
 	ITypeLib **TLp;
diff --git a/ext/com_dotnet/com_variant.c b/ext/com_dotnet/com_variant.c
index 33c83fa..16050d5 100644
--- a/ext/com_dotnet/com_variant.c
+++ b/ext/com_dotnet/com_variant.c
@@ -98,7 +98,7 @@ bogus:
 	}
 }
 
-PHPAPI void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
+PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
 {
 	OLECHAR *olestring;
 	php_com_dotnet_object *obj;
@@ -166,7 +166,7 @@ PHPAPI void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_D
 	}
 }
 
-PHPAPI int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC)
+PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC)
 {
 	OLECHAR *olestring = NULL;
 	int ret = SUCCESS;
@@ -258,7 +258,7 @@ PHPAPI int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC
 }
 
 
-PHPAPI int php_com_copy_variant(VARIANT *dstvar, VARIANT *srcvar TSRMLS_DC)
+PHP_COM_DOTNET_API int php_com_copy_variant(VARIANT *dstvar, VARIANT *srcvar TSRMLS_DC)
 {
 	int ret = SUCCESS;
 	
diff --git a/ext/com_dotnet/com_wrapper.c b/ext/com_dotnet/com_wrapper.c
index fa5bbf7..27a5685 100644
--- a/ext/com_dotnet/com_wrapper.c
+++ b/ext/com_dotnet/com_wrapper.c
@@ -586,7 +586,7 @@ static void disp_destructor(php_dispatchex *disp)
 	CoTaskMemFree(disp);
 }
 
-PHPAPI IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid,
+PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid,
 	   HashTable *id_to_name TSRMLS_DC)
 {
 	php_dispatchex *disp = disp_constructor(val TSRMLS_CC);
@@ -625,7 +625,7 @@ PHPAPI IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid,
 	return (IDispatch*)disp;
 }
 
-PHPAPI IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC)
+PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC)
 {
 	php_dispatchex *disp = NULL;
 
diff --git a/ext/com_dotnet/php_com_dotnet.h b/ext/com_dotnet/php_com_dotnet.h
index ddcd381..96ea21a 100644
--- a/ext/com_dotnet/php_com_dotnet.h
+++ b/ext/com_dotnet/php_com_dotnet.h
@@ -28,6 +28,14 @@ extern zend_module_entry com_dotnet_module_entry;
 #include "TSRM.h"
 #endif
 
+#ifdef PHP_WIN32
+# define PHP_COM_DOTNET_API __declspec(dllexport)
+#elif defined(__GNUC__) && __GNUC__ >= 4
+# define PHP_COM_DOTNET_API __attribute__ ((visibility("default")))
+#else
+# define PHP_COM_DOTNET_API
+#endif
+
 PHP_MINIT_FUNCTION(com_dotnet);
 PHP_MSHUTDOWN_FUNCTION(com_dotnet);
 PHP_RINIT_FUNCTION(com_dotnet);
diff --git a/ext/com_dotnet/php_com_dotnet_internal.h b/ext/com_dotnet/php_com_dotnet_internal.h
index b429018..6f7f030 100644
--- a/ext/com_dotnet/php_com_dotnet_internal.h
+++ b/ext/com_dotnet/php_com_dotnet_internal.h
@@ -87,9 +87,9 @@ zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *objec
 int php_com_saproxy_create(zval *com_object, zval *proxy_out, zval *index TSRMLS_DC);
 
 /* com_olechar.c */
-PHPAPI char *php_com_olestring_to_string(OLECHAR *olestring,
+PHP_COM_DOTNET_API char *php_com_olestring_to_string(OLECHAR *olestring,
 		uint *string_len, int codepage TSRMLS_DC);
-PHPAPI OLECHAR *php_com_string_to_olestring(char *string,
+PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string,
 		uint string_len, int codepage TSRMLS_DC);
 
 
@@ -115,8 +115,8 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, char *name, int namelen,
 
 /* com_wrapper.c */
 int php_com_wrapper_minit(INIT_FUNC_ARGS);
-PHPAPI IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid, HashTable *id_to_name TSRMLS_DC);
-PHPAPI IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC);
+PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export_as_sink(zval *val, GUID *sinkid, HashTable *id_to_name TSRMLS_DC);
+PHP_COM_DOTNET_API IDispatch *php_com_wrapper_export(zval *val TSRMLS_DC);
 
 /* com_persist.c */
 int php_com_persist_minit(INIT_FUNC_ARGS);
@@ -150,10 +150,10 @@ PHP_FUNCTION(variant_get_type);
 PHP_FUNCTION(variant_set_type);
 PHP_FUNCTION(variant_cast);
 
-PHPAPI void php_com_variant_from_zval_with_type(VARIANT *v, zval *z, VARTYPE type, int codepage TSRMLS_DC);
-PHPAPI void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC);
-PHPAPI int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC);
-PHPAPI int php_com_copy_variant(VARIANT *dst, VARIANT *src TSRMLS_DC);
+PHP_COM_DOTNET_API void php_com_variant_from_zval_with_type(VARIANT *v, zval *z, VARTYPE type, int codepage TSRMLS_DC);
+PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC);
+PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepage TSRMLS_DC);
+PHP_COM_DOTNET_API int php_com_copy_variant(VARIANT *dst, VARIANT *src TSRMLS_DC);
 
 /* com_dotnet.c */
 PHP_FUNCTION(com_dotnet_create_instance);
@@ -162,17 +162,17 @@ void php_com_dotnet_mshutdown(TSRMLS_D);
 
 /* com_misc.c */
 void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC);
-PHPAPI void php_com_wrap_dispatch(zval *z, IDispatch *disp,
+PHP_COM_DOTNET_API void php_com_wrap_dispatch(zval *z, IDispatch *disp,
 		int codepage TSRMLS_DC);
-PHPAPI void php_com_wrap_variant(zval *z, VARIANT *v,
+PHP_COM_DOTNET_API void php_com_wrap_variant(zval *z, VARIANT *v,
 		int codepage TSRMLS_DC);
-PHPAPI int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC);
+PHP_COM_DOTNET_API int php_com_safearray_get_elem(VARIANT *array, VARIANT *dest, LONG dim1 TSRMLS_DC);
 
 /* com_typeinfo.c */
-PHPAPI ITypeLib *php_com_load_typelib_via_cache(char *search_string,
+PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib_via_cache(char *search_string,
 		int codepage, int *cached TSRMLS_DC);
-PHPAPI ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC);
-PHPAPI int php_com_import_typelib(ITypeLib *TL, int mode,
+PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codepage TSRMLS_DC);
+PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode,
 		int codepage TSRMLS_DC);
 void php_com_typelibrary_dtor(void *pDest);
 ITypeInfo *php_com_locate_typeinfo(char *typelibname, php_com_dotnet_object *obj, char *dispname, int sink TSRMLS_DC);


commit cfea8e5d04168d296d75dec21f8f0f920f563f00
Author: Johannes Schlüter <johannes at php.net>
Date:   Fri May 25 00:20:29 2012 +0200

    Those changes are in 5.3.15

diff --git a/NEWS b/NEWS
index 50959c6..8149e1a 100644
--- a/NEWS
+++ b/NEWS
@@ -1,9 +1,6 @@
 PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 2012, PHP 5.3.15
-
-?? ??? 2012, PHP 5.3.14
-
 - Fileinfo:
   . Fixed magic file regex support. (Felipe)
 
@@ -29,6 +26,8 @@ PHP                                                                        NEWS
   . Fixed bug #62064 (memory leak in the XML Writer module). 
     (jean-pierre dot lozi at lip6 dot fr)
 
+?? ??? 2012, PHP 5.3.14
+
 (merge after release)
 
 08 May 2012, PHP 5.3.13


commit b187c35f236edd7370d63f02c26d5272997830ee
Merge: 3bd0a52 ec061a9
Author: Stanislav Malyshev <stas at php.net>
Date:   Thu May 24 14:17:07 2012 -0500

    Merge branch 'pull-request/54'
    
    * pull-request/54:
      Allow arbitrary expressions for empty()
    
        This change is as per RFC https://wiki.php.net/rfc/empty_isset_exprs.
    
        The change allows passing the result of function calls and other
        expressions to the empty() language construct. This is accomplished by
        simply rewriting empty(expr) to !expr.
    
        The change does not affect the suppression of errors when using empty()
        on variables. empty($undefinedVar) will continue not to throw errors.
        When an expression is used inside empty() on the other hand, errors will
        not be suppressed. Thus empty($undefinedVar + $somethingElse) *will*
        throw a notice.
    
        The change also does not make empty() into a real function, so using
        'empty' as a callback is still not possible.
    
        In addition to the empty() changes the commit adds nicer error messages
        when isset() is used on function call results or other expressions.

diff --cc UPGRADING
index 44f7556,0fae614..73cf106
--- a/UPGRADING
+++ b/UPGRADING
@@@ -51,15 -54,7 +54,15 @@@ PHP X.Y UPGRADE NOTE
    - Implemented format character "Z": NUL-padded string
    - "a" now does not remove trailing NUL characters on unpack() anymore
    - "A" will now strip all trailing ASCII whitespace on unpack() (it used to
-     remove only trailing spaces.
 -    remove only trailing spaces)
++    remove only trailing spaces).
 +- MessageFormatter::format() and related functions now accepted named arguments
 +  and mixed numeric/named arguments in ICU 4.8+.
 +- MessageFormatter::format() and related functions now don't error out when
 +  an insufficient argument count is provided. Instead, the placeholders will
 +  remain unsubstituted.
 +- MessageFormatter::parse() and MessageFormat::format() (and their static
 +  equivalents) now don't throw away better than second precision in the
 +  arguments.
  
  ========================================
  5. New Functions


commit 6c9056ceb722e26ad26f443841f856ee56f8e0fc
Merge: abe0f17 bde86a6
Author: Felipe Pena <felipensp at gmail.com>
Date:   Thu May 24 13:45:36 2012 -0300

    Merge branch 'PHP-5.3' of git.php.net:php-src into PHP-5.3



commit abe0f17e8817eb3d81227ec9223f4674bab998c8
Author: Felipe Pena <felipensp at gmail.com>
Date:   Thu May 24 13:45:03 2012 -0300

    - BFN

diff --git a/NEWS b/NEWS
index 174b5e6..50959c6 100644
--- a/NEWS
+++ b/NEWS
@@ -4,14 +4,17 @@ PHP                                                                        NEWS
 
 ?? ??? 2012, PHP 5.3.14
 
-- FPM
+- Fileinfo:
+  . Fixed magic file regex support. (Felipe)
+
+- FPM:
   . Fixed bug #61045 (fpm don't send error log to fastcgi clients). (fat)
   . Fixed bug #61835 (php-fpm is not allowed to run as root). (fat)
   . Fixed bug #61295 (php-fpm should not fail with commented 'user'
     for non-root start). (fat)
   . Fixed bug #61026 (FPM pools can listen on the same address). (fat)
 
-- Intl
+- Intl:
   . Fixed bug #62083 (grapheme_extract() memory leaks). (Gustavo)
   . Fixed bug #62082 (memory corruption in internal get_icu_disp_value_src_php
     function). (Gustavo)


commit 3bd0a52468b6776d87ac8a41c6a9be5101db2752
Merge: 7c297ca 84b2c39
Author: Felipe Pena <felipensp at gmail.com>
Date:   Thu May 24 13:43:53 2012 -0300

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      - Fixed magic file regex support



commit 84b2c39920ff02c86a46eb9191c140a887938371
Merge: a10da87 11b4f3b
Author: Felipe Pena <felipensp at gmail.com>
Date:   Thu May 24 13:43:35 2012 -0300

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      - Fixed magic file regex support



commit 11b4f3becd371dae9f76ec18d2197edf53130db7
Author: Felipe Pena <felipensp at gmail.com>
Date:   Thu May 24 13:42:47 2012 -0300

    - Fixed magic file regex support

diff --git a/ext/fileinfo/libmagic/softmagic.c b/ext/fileinfo/libmagic/softmagic.c
index 648f641..f9c2836 100644
--- a/ext/fileinfo/libmagic/softmagic.c
+++ b/ext/fileinfo/libmagic/softmagic.c
@@ -1654,29 +1654,6 @@ convert_libmagic_pattern(zval *pattern, int options)
 		
 		for (i=0; i<Z_STRLEN_P(pattern); i++, j++) {
 			switch (Z_STRVAL_P(pattern)[i]) {
-				case '?':
-					t[j] = '.';
-					break;
-				case '*':
-					t[j++] = '.';
-					t[j] = '*';
-					break;
-				case '.':
-					t[j++] = '\\';
-					t[j] = '.';
-					break;
-				case '\\':
-					t[j++] = '\\';
-					t[j] = '\\';
-					break;
-				case '(':
-					t[j++] = '\\';
-					t[j] = '(';
-					break;
-				case ')':
-					t[j++] = '\\';
-					t[j] = ')';
-					break;
 				case '~':
 					t[j++] = '\\';
 					t[j] = '~';
@@ -1873,7 +1850,7 @@ magiccheck(struct magic_set *ms, struct magic *m)
 		
 		convert_libmagic_pattern(pattern, options);
 		
-		l = 0;
+		l = v = 0;
 #if (PHP_MAJOR_VERSION < 6)
 		if ((pce = pcre_get_compiled_regex_cache(Z_STRVAL_P(pattern), Z_STRLEN_P(pattern) TSRMLS_CC)) == NULL) {
 #else
diff --git a/ext/fileinfo/tests/finfo_file_002.phpt b/ext/fileinfo/tests/finfo_file_002.phpt
index 9ed19a9..3593233 100644
--- a/ext/fileinfo/tests/finfo_file_002.phpt
+++ b/ext/fileinfo/tests/finfo_file_002.phpt
@@ -18,9 +18,11 @@ ksort($results);
 var_dump($results);
 ?>
 --EXPECTF--
-array(6) {
+array(7) {
   ["%s/resources/dir.zip"]=>
   string(15) "application/zip"
+  ["%s/resources/test.awk"]=>
+  string(10) "text/plain"
   ["%s/resources/test.bmp"]=>
   string(14) "image/x-ms-bmp"
   ["%s/resources/test.gif"]=>
diff --git a/ext/fileinfo/tests/finfo_file_regex.phpt b/ext/fileinfo/tests/finfo_file_regex.phpt
new file mode 100644
index 0000000..c1cc36f
--- /dev/null
+++ b/ext/fileinfo/tests/finfo_file_regex.phpt
@@ -0,0 +1,28 @@
+--TEST--
+Test finfo_file() function : regex rules
+--SKIPIF--
+<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
+--FILE--
+<?php
+/**
+ * Works with the unix file command:
+ * $ file -m magic resources/test.awk
+ * resources/test.awk: awk script, ASCII text
+ */
+$magicFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic';
+$finfo = finfo_open( FILEINFO_MIME, $magicFile );
+
+echo "*** Testing finfo_file() : regex rules ***\n";
+
+// Calling finfo_file() with all possible arguments
+$file = __DIR__ . '/resources/test.awk';
+var_dump( finfo_file( $finfo, $file ) );
+var_dump( finfo_file( $finfo, $file, FILEINFO_CONTINUE ) );
+
+?>
+===DONE===
+--EXPECTF--
+*** Testing finfo_file() : regex rules ***
+string(28) "text/plain; charset=us-ascii"
+string(22) "awk script, ASCII text"
+===DONE===
diff --git a/ext/fileinfo/tests/resources/test.awk b/ext/fileinfo/tests/resources/test.awk
new file mode 100644
index 0000000..e000d50
--- /dev/null
+++ b/ext/fileinfo/tests/resources/test.awk
@@ -0,0 +1 @@
+BEGIN { print "START" }


commit 7c297ca31e1abf099aff86fe37b3a9923d926107
Merge: 457a57d a10da87
Author: Xinchen Hui <laruence at php.net>
Date:   Thu May 24 23:38:53 2012 +0800

    Merge remote-tracking branch 'origin/PHP-5.4'
    
    * origin/PHP-5.4:
      Fixed bug #62073 (Different ways of iterating over an SplMaxHeap result in different keys)



commit a10da87c6a2cadc5151d185573b0125d06daad6b
Merge: 04fd0b1 bde86a6
Author: Xinchen Hui <laruence at php.net>
Date:   Thu May 24 23:34:14 2012 +0800

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fixed bug #62073 (Different ways of iterating over an SplMaxHeap result in different keys)



commit bde86a6639a661dcadb0ae4c3ce4cc8aca2a42b9
Merge: 85c777d 9205c4f
Author: Xinchen Hui <laruence at php.net>
Date:   Thu May 24 23:20:21 2012 +0800

    Fixed bug #62073
    
    (Different ways of iterating over an SplMaxHeap result in in different keys)

diff --cc NEWS
index 5fa6ecb,5f1146a..078725f
--- a/NEWS
+++ b/NEWS
@@@ -4,25 -4,6 +4,29 @@@ PH
  
  ?? ??? 2012, PHP 5.3.14
  
- - FPM
++- FPM:
 +  . Fixed bug #61045 (fpm don't send error log to fastcgi clients). (fat)
 +  . Fixed bug #61835 (php-fpm is not allowed to run as root). (fat)
 +  . Fixed bug #61295 (php-fpm should not fail with commented 'user'
 +    for non-root start). (fat)
 +  . Fixed bug #61026 (FPM pools can listen on the same address). (fat)
 +
- - Intl
++- Intl:
 +  . Fixed bug #62083 (grapheme_extract() memory leaks). (Gustavo)
 +  . Fixed bug #62082 (memory corruption in internal get_icu_disp_value_src_php
 +    function). (Gustavo)
 +  . Fixed bug #62081 (IntlDateFormatter constructor leaks memory when called
 +    twice). (Gustavo)
 +  . Fixed bug #62070 (Collator::getSortKey() returns garbage). (Gustavo)
 +  . Fixed bug #62017 (datefmt_create with incorrectly encoded timezone leaks
 +    pattern). (Gustavo)
 +  . Fixed bug #60785 (memory leak in IntlDateFormatter constructor). (Gustavo)
 +  . Fixed bug #55610 (ResourceBundle should implement Traversable). (stealth35)
 +
++- SPL:
++  . Fixed bug #62073 (Different ways of iterating over an SplMaxHeap result in
++    in different keys). (reeze.xia at gmail.com)
++
  - XML Writer:
    . Fixed bug #62064 (memory leak in the XML Writer module). 
      (jean-pierre dot lozi at lip6 dot fr)
@@@ -145,7 -126,7 +149,7 @@@
    . Fixed bug #60968 (Late static binding doesn't work with 
      ReflectionMethod::invokeArgs()). (Laruence)
  
--- SOAP
++- SOAP:
    . Fixed basic HTTP authentication for WSDL sub requests. (Dmitry)
    . Fixed bug #60887 (SoapClient ignores user_agent option and sends no
      User-Agent header). (carloschilazo at gmail dot com)
@@@ -154,7 -135,7 +158,7 @@@
    . Fixed bug #49853 (Soap Client stream context header option ignored).
      (Dmitry)
  
--- SPL
++- SPL:
    . Fixed memory leak when calling SplFileInfo's constructor twice. (Felipe)
    . Fixed bug #61418 (Segmentation fault when DirectoryIterator's or
      FilesystemIterator's iterators are requested more than once without
diff --cc ext/spl/tests/bug62073.phpt
index 0000000,2472059..3bd3553
mode 000000,100644..100644
--- a/ext/spl/tests/bug62073.phpt
+++ b/ext/spl/tests/bug62073.phpt
@@@ -1,0 -1,24 +1,22 @@@
+ --TEST--
+ Bug #62073 (different ways of iterating over an SplMaxHeap result in different keys)
+ --FILE--
+ <?php
 -$heap = new SplMaxHeap;
++$heap = new SplMaxHeap();
+ $heap->insert(42);
+ foreach ($heap as $key => $value) {
 -  break;
++    var_dump($key);
++    var_dump($value);
++    break;
+ }
 -var_dump($key);
 -var_dump($value);
+ 
 -$heap = new SplMaxHeap;
++$heap = new SplMaxHeap();
+ $heap->insert(42);
+ var_dump($heap->key());
+ var_dump($heap->current());
+ ?>
 -==DONE==
+ --EXPECT--
+ int(0)
+ int(42)
+ int(0)
+ int(42)
 -==DONE==


commit 457a57d653400a70ff32de34c751026295b10b3d
Merge: eeea790 04fd0b1
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Thu May 24 14:33:42 2012 +0200

    Merge branch '5.4'



commit 04fd0b1098005a20d6acdbc7d7bf7ea4e1287242
Merge: 888e77f 85c777d
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Thu May 24 14:33:24 2012 +0200

    Merge branch '5.3' into 5.4



commit 85c777d2f1d5a12fac0100f4953d33a7380d0b03
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Thu May 24 14:31:07 2012 +0200

    Fixed bug #55610: ResourceBundle and Traversable

diff --git a/NEWS b/NEWS
index 174b5e6..5fa6ecb 100644
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,7 @@ PHP                                                                        NEWS
   . Fixed bug #62017 (datefmt_create with incorrectly encoded timezone leaks
     pattern). (Gustavo)
   . Fixed bug #60785 (memory leak in IntlDateFormatter constructor). (Gustavo)
+  . Fixed bug #55610 (ResourceBundle should implement Traversable). (stealth35)
 
 - XML Writer:
   . Fixed bug #62064 (memory leak in the XML Writer module). 
diff --git a/ext/intl/resourcebundle/resourcebundle_class.c b/ext/intl/resourcebundle/resourcebundle_class.c
index 3bf3468..d2a29d9 100644
--- a/ext/intl/resourcebundle/resourcebundle_class.c
+++ b/ext/intl/resourcebundle/resourcebundle_class.c
@@ -427,6 +427,8 @@ void resourcebundle_register_class( TSRMLS_D )
 	ResourceBundle_object_handlers.clone_obj	  = NULL; /* ICU ResourceBundle has no clone implementation */
 	ResourceBundle_object_handlers.read_dimension = resourcebundle_array_get;
 	ResourceBundle_object_handlers.count_elements = resourcebundle_array_count;
+
+	zend_class_implements(ResourceBundle_ce_ptr TSRMLS_CC, 1, zend_ce_traversable);
 }
 /* }}} */
 
diff --git a/ext/intl/tests/resourcebundle_traversable.phpt b/ext/intl/tests/resourcebundle_traversable.phpt
new file mode 100644
index 0000000..1e6af7b
--- /dev/null
+++ b/ext/intl/tests/resourcebundle_traversable.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Bug #55610: ResourceBundle does not implement Traversable
+--SKIPIF--
+<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+--FILE--
+<?php
+	include "resourcebundle.inc";
+
+	$r = new ResourceBundle( 'es', BUNDLE );
+
+	var_dump($r instanceof Traversable);
+	var_dump(iterator_to_array($r->get('testarray')));
+?>
+--EXPECTF--
+bool(true)
+array(3) {
+  [0]=>
+  string(8) "cadena 1"
+  [1]=>
+  string(8) "cadena 2"
+  [2]=>
+  string(8) "cadena 3"
+}


commit eeea790d30d096edfb0211d2f69e648013bd514e
Merge: 1d30fb4 888e77f
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Thu May 24 14:18:38 2012 +0200

    Merge branch '5.4' with no code changes.



commit 888e77ff733c5cb7c8f3d1fce6244463dd75a9b8
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Thu May 24 14:04:19 2012 +0200

    Fixed last commit on 5.4
    
    There's no change from the intended behavior. If INTL_G(default_locale)
    is NULL, the default ICU locale, as given by locale_get_default() in
    master, will still be used by ures_open().

diff --git a/ext/intl/resourcebundle/resourcebundle_class.c b/ext/intl/resourcebundle/resourcebundle_class.c
index e3f8252..6529824 100644
--- a/ext/intl/resourcebundle/resourcebundle_class.c
+++ b/ext/intl/resourcebundle/resourcebundle_class.c
@@ -103,7 +103,7 @@ static void resourcebundle_ctor(INTERNAL_FUNCTION_PARAMETERS)
 	INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value);
 	
 	if (locale == NULL) {
-		locale = intl_locale_get_default(TSRMLS_C);
+		locale = INTL_G(default_locale);
 	}
 
 	if (fallback) {


commit 1d30fb4c04ed6326415ca60dd6c1dfb9264425f2
Merge: a03f2e3 72c7cfe
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu May 24 13:59:57 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fixed bug #62140 ext\standard\tests\file\tempnam_variation7-win32.phpt fails



commit 72c7cfe6f2b151466c33e7003dbc64a4e4e88a0c
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu May 24 13:58:42 2012 +0200

    Fixed bug #62140 ext\standard\tests\file\tempnam_variation7-win32.phpt fails

diff --git a/ext/standard/tests/file/tempnam_variation7-win32.phpt b/ext/standard/tests/file/tempnam_variation7-win32.phpt
index 1f0d97a..0c8caca 100644
--- a/ext/standard/tests/file/tempnam_variation7-win32.phpt
+++ b/ext/standard/tests/file/tempnam_variation7-win32.phpt
@@ -93,13 +93,13 @@ File created in => temp dir
 Warning: tempnam() expects parameter 1 to be a valid path, string given in %stempnam_variation7-win32.php on line %d
 -- File is not created --
 
-Warning: unlink(): Invalid argument in %s on line %d
+Warning: unlink(): %r(Invalid argument|No such file or directory)%r in %s on line %d
 -- Iteration 7 --
 
 Warning: tempnam() expects parameter 1 to be a valid path, array given in %s on line %d
 -- File is not created --
 
-Warning: unlink(): Invalid argument in %s on line %d
+Warning: unlink(): %r(Invalid argument|No such file or directory)%r in %s on line %d
 -- Iteration 8 --
 File name is => %s%et%s
 File permissions are => 100666


commit a03f2e381421e74e34cb1f9e44e204589edec4de
Merge: 674a04d 92039fe
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Thu May 24 13:52:06 2012 +0200

    Merge branch '5.4'
    
    Conflicts:
    	UPGRADING



commit 92039fed22cd68405589cf6df3af58b9beaddb16
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Thu May 24 13:35:28 2012 +0200

    Changed ResourceBundle constructor behavior
    
    null is now accepted for two first (mandatory arguments).
    
    Passing null as the package name causes NULL to be passed to ICU  and
    the default ICU data to be loaded.
    
    Passing null as the locale name causes the default locale to be used.

diff --git a/NEWS b/NEWS
index 1db032a..ac4eeb5 100644
--- a/NEWS
+++ b/NEWS
@@ -62,6 +62,10 @@ PHP                                                                        NEWS
   . Fixed bug #61839 (Unable to cross-compile PHP with --enable-fpm). (fat)
   . Fixed bug #61026 (FPM pools can listen on the same address). (fat)
 
+- Intl
+  . ResourceBundle constructor now accepts NULL for the first two arguments.
+    (Gustavo)
+
 - Libxml:
   . Fixed bug #61617 (Libxml tests failed(ht is already destroyed)).
     (Laruence)
diff --git a/UPGRADING b/UPGRADING
index 3a97b10..15da46e 100755
--- a/UPGRADING
+++ b/UPGRADING
@@ -341,6 +341,8 @@ PHP 5.4 UPGRADE NOTES
 
 - Since 5.4.4, "php://fd" stream syntax is available only in CLI build.
 
+- Since 5.4.5, resourcebundle_create() accepts null for the first two arguments.
+
 ==============================
 5. Changes to existing classes
 ==============================
@@ -373,6 +375,9 @@ PHP 5.4 UPGRADE NOTES
 - FilesystemIterator, GlobIterator and (Recursive)DirectoryIterator now use
   the default stream context.
 
+- Since 5.4.5, the constructor of ResourceBundle accepts NULL for the first two
+  arguments.
+
 ===========================
 7. Deprecated Functionality
 ===========================
diff --git a/ext/intl/resourcebundle/resourcebundle_class.c b/ext/intl/resourcebundle/resourcebundle_class.c
index 5471e5b..e3f8252 100644
--- a/ext/intl/resourcebundle/resourcebundle_class.c
+++ b/ext/intl/resourcebundle/resourcebundle_class.c
@@ -91,7 +91,7 @@ static void resourcebundle_ctor(INTERNAL_FUNCTION_PARAMETERS)
 
 	intl_error_reset( NULL TSRMLS_CC );
 
-	if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "ss|b", 
+	if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s!s!|b", 
 		&locale, &locale_len, &bundlename, &bundlename_len, &fallback ) == FAILURE )
 	{
 		intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR,
@@ -101,6 +101,10 @@ static void resourcebundle_ctor(INTERNAL_FUNCTION_PARAMETERS)
 	}
 
 	INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value);
+	
+	if (locale == NULL) {
+		locale = intl_locale_get_default(TSRMLS_C);
+	}
 
 	if (fallback) {
 		rb->me = ures_open(bundlename, locale, &INTL_DATA_ERROR_CODE(rb));
@@ -110,13 +114,17 @@ static void resourcebundle_ctor(INTERNAL_FUNCTION_PARAMETERS)
 
 	INTL_CTOR_CHECK_STATUS(rb, "resourcebundle_ctor: Cannot load libICU resource bundle");
 
-	if (!fallback && (INTL_DATA_ERROR_CODE(rb) == U_USING_FALLBACK_WARNING || INTL_DATA_ERROR_CODE(rb) == U_USING_DEFAULT_WARNING)) {
-		intl_errors_set_code( NULL, INTL_DATA_ERROR_CODE(rb) TSRMLS_CC );
-		spprintf( &pbuf, 0, "resourcebundle_ctor: Cannot load libICU resource '%s' without fallback from %s to %s",
-				bundlename, locale, ures_getLocaleByType( rb->me, ULOC_ACTUAL_LOCALE, &INTL_DATA_ERROR_CODE(rb)) );
-		intl_errors_set_custom_msg( INTL_DATA_ERROR_P(rb), pbuf, 1 TSRMLS_CC );
+	if (!fallback && (INTL_DATA_ERROR_CODE(rb) == U_USING_FALLBACK_WARNING ||
+			INTL_DATA_ERROR_CODE(rb) == U_USING_DEFAULT_WARNING)) {
+		intl_errors_set_code(NULL, INTL_DATA_ERROR_CODE(rb) TSRMLS_CC);
+		spprintf(&pbuf, 0, "resourcebundle_ctor: Cannot load libICU resource "
+				"'%s' without fallback from %s to %s",
+				bundlename ? bundlename : "(default data)", locale,
+				ures_getLocaleByType(
+					rb->me, ULOC_ACTUAL_LOCALE, &INTL_DATA_ERROR_CODE(rb)));
+		intl_errors_set_custom_msg(INTL_DATA_ERROR_P(rb), pbuf, 1 TSRMLS_CC);
 		efree(pbuf);
-		zval_dtor( return_value );
+		zval_dtor(return_value);
 		RETURN_NULL();
 	}
 }
diff --git a/ext/intl/tests/resourcebundle_null_mandatory_args.phpt b/ext/intl/tests/resourcebundle_null_mandatory_args.phpt
new file mode 100644
index 0000000..8fde61b
--- /dev/null
+++ b/ext/intl/tests/resourcebundle_null_mandatory_args.phpt
@@ -0,0 +1,26 @@
+--TEST--
+IntlCalendar::setTime() basic test
+--INI--
+date.timezone=Atlantic/Azores
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+	die('skip intl extension not enabled');
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+
+$r = new ResourceBundle('en_US', NULL);
+$c = $r->get('calendar')->get('gregorian')->get('DateTimePatterns')->get(0);
+var_dump($c);
+
+ini_set('intl.default_locale', 'pt_PT');
+$r = new ResourceBundle(NULL, NULL);
+$c = $r->get('calendar')->get('gregorian')->get('DateTimePatterns')->get(0);
+var_dump($c);
+?>
+==DONE==
+--EXPECT--
+string(14) "h:mm:ss a zzzz"
+string(12) "H:mm:ss zzzz"
+==DONE==


commit 674a04dfc7e3d2d97f4d755f0ecab42f265ed6a0
Merge: 71b65a1 0e12a77
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu May 24 13:27:24 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug #62139 ext\standard\tests\file\rename_variation13-win32.phpt fails



commit 0e12a778df388c85bb8aeb41e8c33a983dd182f1
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu May 24 13:26:32 2012 +0200

    Fix bug #62139 ext\standard\tests\file\rename_variation13-win32.phpt fails

diff --git a/ext/standard/tests/file/rename_variation13-win32.phpt b/ext/standard/tests/file/rename_variation13-win32.phpt
index dc44b35..a503076 100644
Binary files a/ext/standard/tests/file/rename_variation13-win32.phpt and b/ext/standard/tests/file/rename_variation13-win32.phpt differ


commit 71b65a1bd235edec1ac83856a4d713d798c89197
Merge: 0b297a1 0dc9b0e
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu May 24 12:48:58 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fixed bug #62138 ext\standard\tests\dir\dir_variation8-win32.phpt fails



commit 0dc9b0e708b300f68ee62e7f25a166e0bd631258
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu May 24 12:39:00 2012 +0200

    Fixed bug #62138 ext\standard\tests\dir\dir_variation8-win32.phpt fails

diff --git a/ext/standard/tests/dir/dir_variation8-win32.phpt b/ext/standard/tests/dir/dir_variation8-win32.phpt
index 2202fb0..a56c98b 100644
--- a/ext/standard/tests/dir/dir_variation8-win32.phpt
+++ b/ext/standard/tests/dir/dir_variation8-win32.phpt
@@ -45,23 +45,23 @@ echo "Done";
 *** Testing dir() : checking with wildcard characters ***
 -- wildcard = '*' --
 
-Warning: dir(%s/dir_var*,%s/dir_var*): No such file or directory in %s on line %d
+Warning: dir(%s/dir_var*,%s/dir_var*): %r(No such file or directory|The system cannot find the path specified. \(code: 3\))%r in %s on line %d
 
 Warning: dir(%s/dir_var*): failed to open dir: %s in %s on line %d
 bool(false)
 
-Warning: dir(%s/*,%s/*): No such file or directory in %s on line %d
+Warning: dir(%s/*,%s/*): %r(No such file or directory|The system cannot find the path specified. \(code: 3\))%r in %s on line %d
 
 Warning: dir(%s/*): failed to open dir: %s in %s on line %d
 bool(false)
 -- wildcard = '?' --
 
-Warning: dir(%s/dir_variation81/sub_dir?,%s/dir_variation81/sub_dir?): No such file or directory in %s on line %d
+Warning: dir(%s/dir_variation81/sub_dir?,%s/dir_variation81/sub_dir?): %r(No such file or directory|The system cannot find the path specified. \(code: 3\))%r in %s on line %d
 
 Warning: dir(%s/dir_variation81/sub_dir?): failed to open dir: %s in %s on line %d
 bool(false)
 
-Warning: dir(%s/dir_variation81/sub?dir1,%s/dir_variation81/sub?dir1): No such file or directory in %s on line %d
+Warning: dir(%s/dir_variation81/sub?dir1,%s/dir_variation81/sub?dir1): %r(No such file or directory|The system cannot find the path specified. \(code: 3\))%r in %s on line %d
 
 Warning: dir(%s/dir_variation81/sub?dir1): failed to open dir: %s in %s on line %d
 bool(false)


commit 0b297a17e849f2068b4caa2a54dd8513a0b9b3ba
Merge: d4fd95e b5511dc
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu May 24 12:06:53 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug #62137 ext\phar\tests\fatal_error_webphar.phpt fails



commit b5511dcfd756628430dc447127d0d90a09e36dfc
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu May 24 12:04:38 2012 +0200

    Fix bug #62137 ext\phar\tests\fatal_error_webphar.phpt fails

diff --git a/ext/phar/tests/fatal_error_webphar.phpt b/ext/phar/tests/fatal_error_webphar.phpt
index 3153c34..dd6e096 100644
--- a/ext/phar/tests/fatal_error_webphar.phpt
+++ b/ext/phar/tests/fatal_error_webphar.phpt
@@ -15,4 +15,4 @@ Content-type: text/html; charset=UTF-8
 --EXPECTF--
 string(9) "\Web\View"
 
-Parse error: syntax error, unexpected %s, expecting %s in phar:///%sfatal_error_webphar.php/Web/View.php on line 380
+Parse error: syntax error, unexpected %s, expecting %s in phar://%r([A-Za-z]:)?%r/%sfatal_error_webphar.php/Web/View.php on line 380


commit f1969d4b4ce0ebd82b2582104bb99de4b5ac824e
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Thu May 24 11:14:36 2012 +0200

    Update NEWS

diff --git a/NEWS b/NEWS
index 35f0d6b..174b5e6 100644
--- a/NEWS
+++ b/NEWS
@@ -13,13 +13,14 @@ PHP                                                                        NEWS
 
 - Intl
   . Fixed bug #62083 (grapheme_extract() memory leaks). (Gustavo)
-  . Fixed bug #62082 (Memory corruption in internal get_icu_disp_value_src_php
+  . Fixed bug #62082 (memory corruption in internal get_icu_disp_value_src_php
     function). (Gustavo)
   . Fixed bug #62081 (IntlDateFormatter constructor leaks memory when called
     twice). (Gustavo)
   . Fixed bug #62070 (Collator::getSortKey() returns garbage). (Gustavo)
   . Fixed bug #62017 (datefmt_create with incorrectly encoded timezone leaks
     pattern). (Gustavo)
+  . Fixed bug #60785 (memory leak in IntlDateFormatter constructor). (Gustavo)
 
 - XML Writer:
   . Fixed bug #62064 (memory leak in the XML Writer module). 


commit d4fd95e292d20c0ff256269bfb96abdc56fd7a17
Merge: 58d2203 e8009e2
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Thu May 24 11:09:18 2012 +0200

    Merge branch '5.4'



commit e8009e2dcab8669689ba23315a9fdddbe04c36eb
Merge: 523fd2c 2da2de4
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Thu May 24 11:08:55 2012 +0200

    Merge branch '5.3' into 5.4



commit 2da2de46a8dc9d44b624c40adb0d6bf698567167
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Thu May 24 10:44:44 2012 +0200

    Fixed bug #60785
    
    Memory leak in IntlDateFormatter constructor.
    
    udat_setCalendar() clones the calendar before it adopts it,
    so we were leaking the original calendar.
    
    Also we now validate the calendar type.

diff --git a/ext/intl/dateformat/dateformat.c b/ext/intl/dateformat/dateformat.c
index 6c0c522..b399a39 100755
--- a/ext/intl/dateformat/dateformat.c
+++ b/ext/intl/dateformat/dateformat.c
@@ -99,6 +99,15 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
     }
 
 	INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value);
+	
+	if (calendar != UCAL_TRADITIONAL && calendar != UCAL_GREGORIAN) {
+		intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, "datefmt_create: "
+				"invalid value for calendar type; it must be one of "
+				"IntlDateFormatter::TRADITIONAL (locale's default calendar) "
+				"or IntlDateFormatter::GREGORIAN", 0 TSRMLS_CC);
+		goto error;
+	}
+	
 	DATE_FORMAT_METHOD_FETCH_OBJECT;
 	
 	if (DATE_FORMAT_OBJECT(dfo) != NULL) {
@@ -142,13 +151,13 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
 		DATE_FORMAT_OBJECT(dfo) = udat_open(time_type, date_type, locale, timezone_utf16, timezone_utf16_len, svalue, slength, &INTL_DATA_ERROR_CODE(dfo));
 	}
 
-    /* Set the calendar if passed */
-    if(!U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
-		if (calendar) {
+    if (!U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
+		if (calendar != UCAL_TRADITIONAL) {
 			ucal_obj = ucal_open(timezone_utf16, timezone_utf16_len, locale,
 					calendar, &INTL_DATA_ERROR_CODE(dfo));
 			if (!U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
-				udat_setCalendar( DATE_FORMAT_OBJECT(dfo), ucal_obj );
+				udat_setCalendar(DATE_FORMAT_OBJECT(dfo), ucal_obj);
+				ucal_close(ucal_obj);
 			} else {
 				intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create"
 						": error opening calendar", 0 TSRMLS_CC);
diff --git a/ext/intl/tests/dateformat_calendars.phpt b/ext/intl/tests/dateformat_calendars.phpt
new file mode 100644
index 0000000..27f380c
--- /dev/null
+++ b/ext/intl/tests/dateformat_calendars.phpt
@@ -0,0 +1,45 @@
+--TEST--
+IntlDateFormatter, calendars and time zone
+--INI--
+date.timezone=Atlantic/Azores
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+	die('skip intl extension not enabled');
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+
+$fmt1 = new IntlDateFormatter('en_US',
+	IntlDateFormatter::FULL,
+	IntlDateFormatter::FULL,
+	'GMT+05:12',
+	IntlDateFormatter::TRADITIONAL);
+$fmt2 = new IntlDateFormatter('en_US',
+	IntlDateFormatter::FULL,
+	IntlDateFormatter::FULL,
+	'GMT+05:12',
+	IntlDateFormatter::GREGORIAN);
+$fmt3 = new IntlDateFormatter('en_US at calendar=hebrew',
+	IntlDateFormatter::FULL,
+	IntlDateFormatter::FULL,
+	'GMT+05:12',
+	IntlDateFormatter::TRADITIONAL);
+var_dump($fmt1->format(strtotime('2012-01-01 00:00:00 +0000')));
+var_dump($fmt2->format(strtotime('2012-01-01 00:00:00 +0000')));
+var_dump($fmt3->format(strtotime('2012-01-01 00:00:00 +0000')));
+
+new IntlDateFormatter('en_US at calendar=hebrew',
+	IntlDateFormatter::FULL,
+	IntlDateFormatter::FULL,
+	'GMT+05:12',
+	-1);
+?>
+==DONE==
+--EXPECTF--
+string(44) "Sunday, January 1, 2012 5:12:00 AM GMT+05:12"
+string(44) "Sunday, January 1, 2012 5:12:00 AM GMT+05:12"
+string(42) "Sunday, Tevet 6, 5772 5:12:00 AM GMT+05:12"
+
+Warning: IntlDateFormatter::__construct(): datefmt_create: invalid value for calendar type; it must be one of IntlDateFormatter::TRADITIONAL (locale's default calendar) or IntlDateFormatter::GREGORIAN in %s on line %d
+==DONE==


commit 58d2203317865bfaebec801d41e57988a3e46683
Author: Nuno Lopes <nlopess at php.net>
Date:   Wed May 23 22:18:01 2012 -0400

    add support for the alloc_size __attribute__ (through ZEND_ATTRIBUTE_ALLOC_SIZE and ZEND_ATTRIBUTE_ALLOC_SIZE2
    
    requires GCC >= 4.3 or clang >= 3.2 to perform anything useful

diff --git a/Zend/zend.h b/Zend/zend.h
index 3226f8c..39bf5be 100644
--- a/Zend/zend.h
+++ b/Zend/zend.h
@@ -133,6 +133,11 @@ char *alloca ();
 # endif
 #endif
 
+/* Compatibility with non-clang compilers */
+#ifndef __has_attribute
+# define __has_attribute(x) 0
+#endif
+
 /* GCC x.y.z supplies __GNUC__ = x and __GNUC_MINOR__ = y */
 #ifdef __GNUC__
 # define ZEND_GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
@@ -146,6 +151,14 @@ char *alloca ();
 # define ZEND_ATTRIBUTE_MALLOC
 #endif
 
+#if ZEND_GCC_VERSION >= 4003 || __has_attribute(alloc_size)
+# define ZEND_ATTRIBUTE_ALLOC_SIZE(X) __attribute__ ((alloc_size(X)))
+# define ZEND_ATTRIBUTE_ALLOC_SIZE2(X,Y) __attribute__ ((alloc_size(X,Y)))
+#else
+# define ZEND_ATTRIBUTE_ALLOC_SIZE(X)
+# define ZEND_ATTRIBUTE_ALLOC_SIZE2(X,Y)
+#endif
+
 #if ZEND_GCC_VERSION >= 2007
 # define ZEND_ATTRIBUTE_FORMAT(type, idx, first) __attribute__ ((format(type, idx, first)))
 #else
diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c
index 66cd23c..a29350d 100644
--- a/Zend/zend_alloc.c
+++ b/Zend/zend_alloc.c
@@ -658,9 +658,9 @@ static unsigned int _mem_block_end_magic   = 0;
 
 #define ZEND_MM_LARGE_BUCKET_INDEX(S) zend_mm_high_bit(S)
 
-static void *_zend_mm_alloc_int(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;
+static void *_zend_mm_alloc_int(zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC ZEND_ATTRIBUTE_ALLOC_SIZE(2);
 static void _zend_mm_free_int(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
-static void *_zend_mm_realloc_int(zend_mm_heap *heap, void *p, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
+static void *_zend_mm_realloc_int(zend_mm_heap *heap, void *p, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_ALLOC_SIZE(3);
 
 static inline unsigned int zend_mm_high_bit(size_t _size)
 {
diff --git a/Zend/zend_alloc.h b/Zend/zend_alloc.h
index b8b800e..6b071c2 100644
--- a/Zend/zend_alloc.h
+++ b/Zend/zend_alloc.h
@@ -54,12 +54,12 @@ BEGIN_EXTERN_C()
 
 ZEND_API char *zend_strndup(const char *s, unsigned int length) ZEND_ATTRIBUTE_MALLOC;
 
-ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;
+ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC ZEND_ATTRIBUTE_ALLOC_SIZE(1);
 ZEND_API void *_safe_emalloc(size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;
 ZEND_API void *_safe_malloc(size_t nmemb, size_t size, size_t offset) ZEND_ATTRIBUTE_MALLOC;
 ZEND_API void _efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
-ZEND_API void *_ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;
-ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
+ZEND_API void *_ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC ZEND_ATTRIBUTE_ALLOC_SIZE2(1,2);
+ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_ALLOC_SIZE(2);
 ZEND_API void *_safe_erealloc(void *ptr, size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC);
 ZEND_API void *_safe_realloc(void *ptr, size_t nmemb, size_t size, size_t offset);
 ZEND_API char *_estrdup(const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) ZEND_ATTRIBUTE_MALLOC;


commit 8208462fc1ffcc575aa631ffb4cda22e2247521a
Author: Rasmus Lerdorf <rasmus at php.net>
Date:   Wed May 23 17:37:13 2012 -0700

    This test depends on the default_charset setting, so set it to
    UTF-8 for consistent output

diff --git a/sapi/cgi/tests/apache_request_headers.phpt b/sapi/cgi/tests/apache_request_headers.phpt
index 2c82d57..3dc3580 100644
--- a/sapi/cgi/tests/apache_request_headers.phpt
+++ b/sapi/cgi/tests/apache_request_headers.phpt
@@ -1,5 +1,7 @@
 --TEST--
 apache_request_headers() stack overflow.
+--INI--
+default_charset="UTF-8"
 --SKIPIF--
 <?php 
 include "skipif.inc"; 
@@ -29,7 +31,7 @@ echo "Done\n";
 ?>
 --EXPECTF--	
 X-Powered-By: PHP/%s
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 
 Array
 (


commit 523fd2c244ccc5c89d5bef2c3719f17782d8b6fa
Author: Rasmus Lerdorf <rasmus at php.net>
Date:   Wed May 23 17:37:13 2012 -0700

    Fix broken apache_request_headers test
    
    This test depends on the default_charset setting, so set it to
    UTF-8 for consistent output

diff --git a/sapi/cgi/tests/apache_request_headers.phpt b/sapi/cgi/tests/apache_request_headers.phpt
index 2c82d57..3dc3580 100644
--- a/sapi/cgi/tests/apache_request_headers.phpt
+++ b/sapi/cgi/tests/apache_request_headers.phpt
@@ -1,5 +1,7 @@
 --TEST--
 apache_request_headers() stack overflow.
+--INI--
+default_charset="UTF-8"
 --SKIPIF--
 <?php 
 include "skipif.inc"; 
@@ -29,7 +31,7 @@ echo "Done\n";
 ?>
 --EXPECTF--	
 X-Powered-By: PHP/%s
-Content-type: text/html
+Content-type: text/html; charset=UTF-8
 
 Array
 (


commit acd711685a592c52be200e248154283c6c49c9f8
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Tue May 22 12:36:28 2012 +0200

    Fixed bug #62097
    
    This fixes the fix for bug #54547 in 32-bit machines by accepting
    float comparisons in 32-bit machines as long as the integer is
    not larger than the mantissa.

diff --git a/Zend/tests/bug62097.phpt b/Zend/tests/bug62097.phpt
new file mode 100644
index 0000000..bee72e7
--- /dev/null
+++ b/Zend/tests/bug62097.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Bug #62097: fix for bug #54547 is wrong for 32-bit machines
+--SKIPIF--
+<php
+if (PHP_INT_MAX !== 2147483647)
+	die('skip for system with 32-bit wide longs only');
+--FILE--
+<?php
+var_dump("02147483647" == "2147483647",
+		 "02147483648" == "2147483648",
+		 "09007199254740991" == "9007199254740991",
+		 "09007199254740992" == "9007199254740992");
+--EXPECT--
+bool(true)
+bool(true)
+bool(true)
+bool(false)
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
index 8d4baa6..dd3ee2d 100644
--- a/Zend/zend_operators.c
+++ b/Zend/zend_operators.c
@@ -2041,7 +2041,13 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2) /* {{{ */
 
 	if ((ret1=is_numeric_string_ex(Z_STRVAL_P(s1), Z_STRLEN_P(s1), &lval1, &dval1, 0, &oflow1)) &&
 		(ret2=is_numeric_string_ex(Z_STRVAL_P(s2), Z_STRLEN_P(s2), &lval2, &dval2, 0, &oflow2))) {
+#if ULONG_MAX == 0xFFFFFFFF
+		if (oflow1 != 0 && oflow1 == oflow2 && dval1 - dval2 == 0. &&
+			((oflow1 == 1 && dval1 > 9007199254740991. /*0x1FFFFFFFFFFFFF*/)
+			|| (oflow1 == -1 && dval1 < -9007199254740991.))) {
+#else
 		if (oflow1 != 0 && oflow1 == oflow2 && dval1 - dval2 == 0.) {
+#endif
 			/* both values are integers overflown to the same side, and the
 			 * double comparison may have resulted in crucial accuracy lost */
 			goto string_cmp;


commit ca515e807319cafb5ad5c7384422583fb633aa57
Merge: 70e3e62 0838a2b
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Wed May 23 15:52:47 2012 +0200

    Merge branch '5.4'



commit 0838a2b7c559442aac4692a023d044f34c60d24f
Merge: 8ee8ccd e08566c
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Wed May 23 15:52:32 2012 +0200

    Merge branch '5.3' into 5.4



commit e08566c6139461db9dbf0f6c2e870d67923ee587
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Wed May 23 15:48:50 2012 +0200

    Fixed bug #62017
    
    IntlDateFormatter constructor would release some resources
    under certain error conditions.

diff --git a/NEWS b/NEWS
index 900dd5c..35f0d6b 100644
--- a/NEWS
+++ b/NEWS
@@ -18,6 +18,8 @@ PHP                                                                        NEWS
   . Fixed bug #62081 (IntlDateFormatter constructor leaks memory when called
     twice). (Gustavo)
   . Fixed bug #62070 (Collator::getSortKey() returns garbage). (Gustavo)
+  . Fixed bug #62017 (datefmt_create with incorrectly encoded timezone leaks
+    pattern). (Gustavo)
 
 - XML Writer:
   . Fixed bug #62064 (memory leak in the XML Writer module). 
diff --git a/ext/intl/dateformat/dateformat.c b/ext/intl/dateformat/dateformat.c
index 05ba19e..6c0c522 100755
--- a/ext/intl/dateformat/dateformat.c
+++ b/ext/intl/dateformat/dateformat.c
@@ -109,14 +109,27 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
 	
 	/* Convert pattern (if specified) to UTF-16. */
 	if( pattern_str && pattern_str_len>0 ){
-		intl_convert_utf8_to_utf16(&svalue, &slength, pattern_str, pattern_str_len, &INTL_DATA_ERROR_CODE(dfo));
-		INTL_CTOR_CHECK_STATUS(dfo, "datefmt_create: error converting pattern to UTF-16");
+		intl_convert_utf8_to_utf16(&svalue, &slength,
+				pattern_str, pattern_str_len, &INTL_DATA_ERROR_CODE(dfo));
+		if (U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
+			/* object construction -> only set global error */
+			intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create: "
+					"error converting pattern to UTF-16", 0 TSRMLS_CC);
+			goto error;
+		}
 	}
+	
+	/* resources allocated from now on */
 
 	/* Convert pattern (if specified) to UTF-16. */
 	if( timezone_str && timezone_str_len >0 ){
-		intl_convert_utf8_to_utf16(&timezone_utf16, &timezone_utf16_len, timezone_str, timezone_str_len, &INTL_DATA_ERROR_CODE(dfo));
-		INTL_CTOR_CHECK_STATUS(dfo, "datefmt_create: error converting timezone_str to UTF-16" );
+		intl_convert_utf8_to_utf16(&timezone_utf16, &timezone_utf16_len,
+				timezone_str, timezone_str_len, &INTL_DATA_ERROR_CODE(dfo));
+		if (U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
+			intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create: "
+					"error converting timezone_str to UTF-16", 0 TSRMLS_CC);
+			goto error;
+		}
 	}
 
 	if(locale_len == 0) {
@@ -130,24 +143,24 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
 	}
 
     /* Set the calendar if passed */
-    if(!U_FAILURE(INTL_DATA_ERROR_CODE(dfo)) && calendar) {
-		ucal_obj = ucal_open( timezone_utf16, timezone_utf16_len, locale, calendar, &INTL_DATA_ERROR_CODE(dfo) );
-		if(!U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
-			udat_setCalendar( DATE_FORMAT_OBJECT(dfo), ucal_obj );
+    if(!U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
+		if (calendar) {
+			ucal_obj = ucal_open(timezone_utf16, timezone_utf16_len, locale,
+					calendar, &INTL_DATA_ERROR_CODE(dfo));
+			if (!U_FAILURE(INTL_DATA_ERROR_CODE(dfo))) {
+				udat_setCalendar( DATE_FORMAT_OBJECT(dfo), ucal_obj );
+			} else {
+				intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo), "datefmt_create"
+						": error opening calendar", 0 TSRMLS_CC);
+				goto error;
+			}
 		}
-    }
-
-	if(svalue)
-	{
-		efree(svalue);
-	}
-	if(timezone_utf16)
-	{
-		efree(timezone_utf16);
+    } else {
+		intl_error_set(NULL, INTL_DATA_ERROR_CODE(dfo),	"datefmt_create: date "
+				"formatter creation failed", 0 TSRMLS_CC);
+		goto error;
 	}
 
-	INTL_CTOR_CHECK_STATUS(dfo, "datefmt_create: date formatter creation failed");
-
 	/* Set the class variables */
 	dfo->date_type = date_type;
 	dfo->time_type = time_type;
@@ -155,6 +168,19 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
 	if( timezone_str && timezone_str_len > 0){
 		dfo->timezone_id = estrndup( timezone_str, timezone_str_len);
 	}
+	
+error:
+	if (svalue) {
+		efree(svalue);
+	}
+	if (timezone_utf16) {
+		efree(timezone_utf16);
+	}
+	if (U_FAILURE(intl_error_get_code(NULL TSRMLS_CC))) {
+		/* free_object handles partially constructed instances fine */
+		zval_dtor(return_value);
+		RETVAL_NULL();
+	}
 }
 /* }}} */
 
diff --git a/ext/intl/tests/bug62017.phpt b/ext/intl/tests/bug62017.phpt
new file mode 100644
index 0000000..13c4fe5
--- /dev/null
+++ b/ext/intl/tests/bug62017.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Bug #62017: datefmt_create with incorrectly encoded timezone leaks pattern
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+	die('skip intl extension not enabled');
+--FILE--
+<?php
+ini_set('intl.error_level', E_WARNING);
+var_dump(
+	datefmt_create('', IntlDateFormatter::NONE, IntlDateFormatter::NONE, "\xFF",
+		IntlDateFormatter::GREGORIAN, 'a'));
+var_dump(
+	new IntlDateFormatter('', IntlDateFormatter::NONE, IntlDateFormatter::NONE, "Europe/Lisbon",
+		IntlDateFormatter::GREGORIAN, "\x80"));
+--EXPECTF--
+Warning: datefmt_create(): datefmt_create: error converting timezone_str to UTF-16 in %s on line %d
+NULL
+
+Warning: IntlDateFormatter::__construct(): datefmt_create: error converting pattern to UTF-16 in %s on line %d
+NULL
+


commit 70e3e627fe63e831135d5526372da446ef251525
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Wed May 23 14:49:01 2012 +0200

    Fixed several ext/intl tests

diff --git a/ext/intl/tests/msgfmt_format_datetime.phpt b/ext/intl/tests/msgfmt_format_datetime.phpt
index a79b822..07e7d68 100644
--- a/ext/intl/tests/msgfmt_format_datetime.phpt
+++ b/ext/intl/tests/msgfmt_format_datetime.phpt
@@ -1,5 +1,7 @@
 --TEST--
 MessageFormatter::format(): DateTime accepted to format dates and times
+--INI--
+date.timezone=Atlantic/Azores
 --SKIPIF--
 <?php
 if (!extension_loaded('intl'))
@@ -23,4 +25,4 @@ var_dump($mf->format(array($dt)));
 ==DONE==
 --EXPECTF--
 string(%s) "May %d, 2012 %d:%d:42 %s"
-==DONE==
\ No newline at end of file
+==DONE==
diff --git a/ext/intl/tests/msgfmt_format_error5.phpt b/ext/intl/tests/msgfmt_format_error5.phpt
index 0ea5169..052d0ef 100644
--- a/ext/intl/tests/msgfmt_format_error5.phpt
+++ b/ext/intl/tests/msgfmt_format_error5.phpt
@@ -1,5 +1,7 @@
 --TEST--
 MessageFormatter::format() invalid date/time argument
+--INI--
+date.timezone=Atlantic/Azores
 --SKIPIF--
 <?php
 if (!extension_loaded('intl'))
diff --git a/ext/intl/tests/msgfmt_format_simple_types_numeric_strings.phpt b/ext/intl/tests/msgfmt_format_simple_types_numeric_strings.phpt
index c52c359..299ae48 100644
--- a/ext/intl/tests/msgfmt_format_simple_types_numeric_strings.phpt
+++ b/ext/intl/tests/msgfmt_format_simple_types_numeric_strings.phpt
@@ -1,5 +1,7 @@
 --TEST--
 MessageFormatter::format(): simple types handling with numeric strings
+--INI--
+date.timezone=Atlantic/Azores
 --SKIPIF--
 <?php
 if (!extension_loaded('intl'))
@@ -53,4 +55,4 @@ string(%d) "
 	ordinal			1,336,317,966th
 	duration		371,199:26:06
 	"
-==DONE==
\ No newline at end of file
+==DONE==
diff --git a/ext/intl/tests/msgfmt_millisecond_dates.phpt b/ext/intl/tests/msgfmt_millisecond_dates.phpt
index 6d6cf20..7dd0514 100644
--- a/ext/intl/tests/msgfmt_millisecond_dates.phpt
+++ b/ext/intl/tests/msgfmt_millisecond_dates.phpt
@@ -6,9 +6,7 @@ if (!extension_loaded('intl'))
 	die('skip intl extension not enabled');
 --FILE--
 <?php
-exec('pause');
 ini_set("intl.error_level", E_WARNING);
-//ini_set("intl.default_locale", "nl");
 date_default_timezone_set('Europe/Lisbon'); //ignored for now, see bug #58756
 
 $d = 1336308097.123;
@@ -28,4 +26,4 @@ array(1) {
   [0]=>
   float(1336310569.123)
 }
-==DONE==
\ No newline at end of file
+==DONE==
diff --git a/ext/intl/tests/timezone_fromDateTimeZone_error.phpt b/ext/intl/tests/timezone_fromDateTimeZone_error.phpt
index 4d6c153..0318822 100644
--- a/ext/intl/tests/timezone_fromDateTimeZone_error.phpt
+++ b/ext/intl/tests/timezone_fromDateTimeZone_error.phpt
@@ -1,5 +1,7 @@
 --TEST--
 IntlTimeZone::fromDateTimeZone(): argument errors
+--INI--
+date.timezone=Atlantic/Azores
 --SKIPIF--
 <?php
 if (!extension_loaded('intl'))


commit 9205c4fd62a769b7db3d00eccdf2ea35b20dd87f
Author: Reeze Xia <reeze.xia at gmail.com>
Date:   Wed May 23 20:42:06 2012 +0800

    Fixed bug #62073 (Different ways of iterating over an SplMaxHeap result in different keys)

diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c
index e2b8f75..a0055f4 100644
--- a/ext/spl/spl_heap.c
+++ b/ext/spl/spl_heap.c
@@ -950,7 +950,7 @@ static int spl_heap_it_get_current_key(zend_object_iterator *iter, char **str_ke
 {
 	spl_heap_it *iterator = (spl_heap_it *)iter;
 
-	*int_key = (ulong) iterator->object->heap->count;
+	*int_key = (ulong) iterator->object->heap->count - 1;
 	return HASH_KEY_IS_LONG;
 }
 /* }}} */
diff --git a/ext/spl/tests/bug62073.phpt b/ext/spl/tests/bug62073.phpt
new file mode 100644
index 0000000..2472059
--- /dev/null
+++ b/ext/spl/tests/bug62073.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Bug #62073 (different ways of iterating over an SplMaxHeap result in different keys)
+--FILE--
+<?php
+$heap = new SplMaxHeap;
+$heap->insert(42);
+foreach ($heap as $key => $value) {
+  break;
+}
+var_dump($key);
+var_dump($value);
+
+$heap = new SplMaxHeap;
+$heap->insert(42);
+var_dump($heap->key());
+var_dump($heap->current());
+?>
+==DONE==
+--EXPECT--
+int(0)
+int(42)
+int(0)
+int(42)
+==DONE==
\ No newline at end of file
diff --git a/ext/spl/tests/heap_005.phpt b/ext/spl/tests/heap_005.phpt
index 73daaf4..1291cda 100644
--- a/ext/spl/tests/heap_005.phpt
+++ b/ext/spl/tests/heap_005.phpt
@@ -18,104 +18,104 @@ foreach ($h as $k => $o) {
 ===DONE===
 <?php exit(0); ?>
 --EXPECTF--
-100 => 1
-99 => 2
-98 => 3
-97 => 4
-96 => 5
-95 => 6
-94 => 7
-93 => 8
-92 => 9
-91 => 10
-90 => 11
-89 => 12
-88 => 13
-87 => 14
-86 => 15
-85 => 16
-84 => 17
-83 => 18
-82 => 19
-81 => 20
-80 => 21
-79 => 22
-78 => 23
-77 => 24
-76 => 25
-75 => 26
-74 => 27
-73 => 28
-72 => 29
-71 => 30
-70 => 31
-69 => 32
-68 => 33
-67 => 34
-66 => 35
-65 => 36
-64 => 37
-63 => 38
-62 => 39
-61 => 40
-60 => 41
-59 => 42
-58 => 43
-57 => 44
-56 => 45
-55 => 46
-54 => 47
-53 => 48
-52 => 49
-51 => 50
-50 => 51
-49 => 52
-48 => 53
-47 => 54
-46 => 55
-45 => 56
-44 => 57
-43 => 58
-42 => 59
-41 => 60
-40 => 61
-39 => 62
-38 => 63
-37 => 64
-36 => 65
-35 => 66
-34 => 67
-33 => 68
-32 => 69
-31 => 70
-30 => 71
-29 => 72
-28 => 73
-27 => 74
-26 => 75
-25 => 76
-24 => 77
-23 => 78
-22 => 79
-21 => 80
-20 => 81
-19 => 82
-18 => 83
-17 => 84
-16 => 85
-15 => 86
-14 => 87
-13 => 88
-12 => 89
-11 => 90
-10 => 91
-9 => 92
-8 => 93
-7 => 94
-6 => 95
-5 => 96
-4 => 97
-3 => 98
-2 => 99
-1 => 100
+99 => 1
+98 => 2
+97 => 3
+96 => 4
+95 => 5
+94 => 6
+93 => 7
+92 => 8
+91 => 9
+90 => 10
+89 => 11
+88 => 12
+87 => 13
+86 => 14
+85 => 15
+84 => 16
+83 => 17
+82 => 18
+81 => 19
+80 => 20
+79 => 21
+78 => 22
+77 => 23
+76 => 24
+75 => 25
+74 => 26
+73 => 27
+72 => 28
+71 => 29
+70 => 30
+69 => 31
+68 => 32
+67 => 33
+66 => 34
+65 => 35
+64 => 36
+63 => 37
+62 => 38
+61 => 39
+60 => 40
+59 => 41
+58 => 42
+57 => 43
+56 => 44
+55 => 45
+54 => 46
+53 => 47
+52 => 48
+51 => 49
+50 => 50
+49 => 51
+48 => 52
+47 => 53
+46 => 54
+45 => 55
+44 => 56
+43 => 57
+42 => 58
+41 => 59
+40 => 60
+39 => 61
+38 => 62
+37 => 63
+36 => 64
+35 => 65
+34 => 66
+33 => 67
+32 => 68
+31 => 69
+30 => 70
+29 => 71
+28 => 72
+27 => 73
+26 => 74
+25 => 75
+24 => 76
+23 => 77
+22 => 78
+21 => 79
+20 => 80
+19 => 81
+18 => 82
+17 => 83
+16 => 84
+15 => 85
+14 => 86
+13 => 87
+12 => 88
+11 => 89
+10 => 90
+9 => 91
+8 => 92
+7 => 93
+6 => 94
+5 => 95
+4 => 96
+3 => 97
+2 => 98
+1 => 99
+0 => 100
 ===DONE===
diff --git a/ext/spl/tests/heap_006.phpt b/ext/spl/tests/heap_006.phpt
index 4422727..3218bdf 100644
--- a/ext/spl/tests/heap_006.phpt
+++ b/ext/spl/tests/heap_006.phpt
@@ -18,104 +18,104 @@ foreach ($h as $k => $o) {
 ===DONE===
 <?php exit(0); ?>
 --EXPECTF--
-100 => 100
-99 => 99
-98 => 98
-97 => 97
-96 => 96
-95 => 95
-94 => 94
-93 => 93
-92 => 92
-91 => 91
-90 => 90
-89 => 89
-88 => 88
-87 => 87
-86 => 86
-85 => 85
-84 => 84
-83 => 83
-82 => 82
-81 => 81
-80 => 80
-79 => 79
-78 => 78
-77 => 77
-76 => 76
-75 => 75
-74 => 74
-73 => 73
-72 => 72
-71 => 71
-70 => 70
-69 => 69
-68 => 68
-67 => 67
-66 => 66
-65 => 65
-64 => 64
-63 => 63
-62 => 62
-61 => 61
-60 => 60
-59 => 59
-58 => 58
-57 => 57
-56 => 56
-55 => 55
-54 => 54
-53 => 53
-52 => 52
-51 => 51
-50 => 50
-49 => 49
-48 => 48
-47 => 47
-46 => 46
-45 => 45
-44 => 44
-43 => 43
-42 => 42
-41 => 41
-40 => 40
-39 => 39
-38 => 38
-37 => 37
-36 => 36
-35 => 35
-34 => 34
-33 => 33
-32 => 32
-31 => 31
-30 => 30
-29 => 29
-28 => 28
-27 => 27
-26 => 26
-25 => 25
-24 => 24
-23 => 23
-22 => 22
-21 => 21
-20 => 20
-19 => 19
-18 => 18
-17 => 17
-16 => 16
-15 => 15
-14 => 14
-13 => 13
-12 => 12
-11 => 11
-10 => 10
-9 => 9
-8 => 8
-7 => 7
-6 => 6
-5 => 5
-4 => 4
-3 => 3
-2 => 2
-1 => 1
+99 => 100
+98 => 99
+97 => 98
+96 => 97
+95 => 96
+94 => 95
+93 => 94
+92 => 93
+91 => 92
+90 => 91
+89 => 90
+88 => 89
+87 => 88
+86 => 87
+85 => 86
+84 => 85
+83 => 84
+82 => 83
+81 => 82
+80 => 81
+79 => 80
+78 => 79
+77 => 78
+76 => 77
+75 => 76
+74 => 75
+73 => 74
+72 => 73
+71 => 72
+70 => 71
+69 => 70
+68 => 69
+67 => 68
+66 => 67
+65 => 66
+64 => 65
+63 => 64
+62 => 63
+61 => 62
+60 => 61
+59 => 60
+58 => 59
+57 => 58
+56 => 57
+55 => 56
+54 => 55
+53 => 54
+52 => 53
+51 => 52
+50 => 51
+49 => 50
+48 => 49
+47 => 48
+46 => 47
+45 => 46
+44 => 45
+43 => 44
+42 => 43
+41 => 42
+40 => 41
+39 => 40
+38 => 39
+37 => 38
+36 => 37
+35 => 36
+34 => 35
+33 => 34
+32 => 33
+31 => 32
+30 => 31
+29 => 30
+28 => 29
+27 => 28
+26 => 27
+25 => 26
+24 => 25
+23 => 24
+22 => 23
+21 => 22
+20 => 21
+19 => 20
+18 => 19
+17 => 18
+16 => 17
+15 => 16
+14 => 15
+13 => 14
+12 => 13
+11 => 12
+10 => 11
+9 => 10
+8 => 9
+7 => 8
+6 => 7
+5 => 6
+4 => 5
+3 => 4
+2 => 3
+1 => 2
+0 => 1
 ===DONE===
diff --git a/ext/spl/tests/pqueue_001.phpt b/ext/spl/tests/pqueue_001.phpt
index 9c29980..de164e5 100644
--- a/ext/spl/tests/pqueue_001.phpt
+++ b/ext/spl/tests/pqueue_001.phpt
@@ -63,34 +63,34 @@ foreach ($pq3 as $k=>$v) {
 <?php exit(0); ?>
 --EXPECTF--
 Exception: Can't extract from an empty heap
-3=>b
-2=>a
-1=>c
+2=>b
+1=>a
+0=>c
 EXTR_BOTH
-3=>Array
+2=>Array
 (
     [data] => b
     [priority] => 2
 )
 
-2=>Array
+1=>Array
 (
     [data] => a
     [priority] => 1
 )
 
-1=>Array
+0=>Array
 (
     [data] => c
     [priority] => 0
 )
 
 EXTR_DATA
-3=>b
-2=>a
-1=>c
+2=>b
+1=>a
+0=>c
 EXTR_PRIORITY
-3=>2
-2=>1
-1=>0
+2=>2
+1=>1
+0=>0
 ===DONE===


commit c449bf144373bb8ba1453f8c44801d2738c09d15
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Wed May 23 13:42:24 2012 +0200

    Fixed bug number in NEWS

diff --git a/NEWS b/NEWS
index 169366d..900dd5c 100644
--- a/NEWS
+++ b/NEWS
@@ -12,7 +12,7 @@ PHP                                                                        NEWS
   . Fixed bug #61026 (FPM pools can listen on the same address). (fat)
 
 - Intl
-  . Fixed bug #62082 (grapheme_extract() memory leaks). (Gustavo)
+  . Fixed bug #62083 (grapheme_extract() memory leaks). (Gustavo)
   . Fixed bug #62082 (Memory corruption in internal get_icu_disp_value_src_php
     function). (Gustavo)
   . Fixed bug #62081 (IntlDateFormatter constructor leaks memory when called


commit 1c19146f464017a28779446ee0972d1956809d25
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Wed May 23 13:35:11 2012 +0200

    Updated NEWS w.r.t to ext/intl changes

diff --git a/NEWS b/NEWS
index 7542724..169366d 100644
--- a/NEWS
+++ b/NEWS
@@ -6,11 +6,19 @@ PHP                                                                        NEWS
 
 - FPM
   . Fixed bug #61045 (fpm don't send error log to fastcgi clients). (fat)
-	. Fixed bug #61835 (php-fpm is not allowed to run as root). (fat)
+  . Fixed bug #61835 (php-fpm is not allowed to run as root). (fat)
   . Fixed bug #61295 (php-fpm should not fail with commented 'user'
     for non-root start). (fat)
   . Fixed bug #61026 (FPM pools can listen on the same address). (fat)
 
+- Intl
+  . Fixed bug #62082 (grapheme_extract() memory leaks). (Gustavo)
+  . Fixed bug #62082 (Memory corruption in internal get_icu_disp_value_src_php
+    function). (Gustavo)
+  . Fixed bug #62081 (IntlDateFormatter constructor leaks memory when called
+    twice). (Gustavo)
+  . Fixed bug #62070 (Collator::getSortKey() returns garbage). (Gustavo)
+
 - XML Writer:
   . Fixed bug #62064 (memory leak in the XML Writer module). 
     (jean-pierre dot lozi at lip6 dot fr)


commit 2eb069aa48c63a59aa8ed579eebe0e6e30b2833a
Merge: e9a7039 8ee8ccd
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Wed May 23 13:27:54 2012 +0200

    Merge branch '5.4'



commit 8ee8ccda19cfe7c113b8cb9c488d53e50346840d
Merge: 1299503 1eff3b0
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Wed May 23 13:27:21 2012 +0200

    Merge branch '5.3' into 5.4
    
    Conflicts:
    	sapi/fpm/fpm/fpm_main.c



commit 1eff3b01b8e2fdeadc9640ae1a19b8330277ccc5
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Wed May 23 12:09:27 2012 +0200

    Fixed bug #6208: memory leak in grapheme_extract()

diff --git a/ext/intl/grapheme/grapheme_string.c b/ext/intl/grapheme/grapheme_string.c
index 719015f..0b7ecdb 100755
--- a/ext/intl/grapheme/grapheme_string.c
+++ b/ext/intl/grapheme/grapheme_string.c
@@ -818,6 +818,7 @@ PHP_FUNCTION(grapheme_extract)
 		}
 		else {
 			/* initialize next */
+			zval_dtor(next);
             ZVAL_LONG(next, lstart);
 		}
 	}
diff --git a/ext/intl/tests/bug62083.phpt b/ext/intl/tests/bug62083.phpt
new file mode 100644
index 0000000..4baa5c5
--- /dev/null
+++ b/ext/intl/tests/bug62083.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Bug #62083: grapheme_extract() leaks memory
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+	die('skip intl extension not enabled');
+--FILE--
+<?php
+$arr1 = array();
+var_dump(grapheme_extract(-1, -1, -1,-1, $arr1));
+--EXPECT--
+bool(false)


commit 86ea921291cd637fd0a7ffb0183625a5ac60e1ee
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Wed May 23 12:44:44 2012 +0200

    Fixed bug #62082
    
    This was a buffer overflow in internal function
    get_icu_disp_value_src_php().

diff --git a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c
index 39d162a..1707c69 100755
--- a/ext/intl/locale/locale_methods.c
+++ b/ext/intl/locale/locale_methods.c
@@ -527,7 +527,7 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME
 
     /* Get the disp_value for the given locale */
     do{
-        disp_name = erealloc( disp_name , buflen  );
+        disp_name = erealloc( disp_name , buflen * sizeof(UChar)  );
         disp_name_len = buflen;
 
 		if( strcmp(tag_name , LOC_LANG_TAG)==0 ){
@@ -542,6 +542,7 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME
 			buflen = uloc_getDisplayName ( mod_loc_name , disp_loc_name , disp_name , disp_name_len , &status);
 		}
 
+		/* U_STRING_NOT_TERMINATED_WARNING is admissible here; don't look for it */
 		if( U_FAILURE( status ) )
 		{
 			if( status == U_BUFFER_OVERFLOW_ERROR )
@@ -1562,11 +1563,11 @@ PHP_FUNCTION(locale_lookup)
 /* }}} */
 
 /* {{{ proto string Locale::acceptFromHttp(string $http_accept)
-* Tries to find out best available locale based on HTTP “Accept-Language” header
+* Tries to find out best available locale based on HTTP �Accept-Language� header
 */
 /* }}} */
 /* {{{ proto string locale_accept_from_http(string $http_accept)
-* Tries to find out best available locale based on HTTP “Accept-Language” header
+* Tries to find out best available locale based on HTTP �Accept-Language� header
 */
 PHP_FUNCTION(locale_accept_from_http)
 {
diff --git a/ext/intl/tests/bug62082.phpt b/ext/intl/tests/bug62082.phpt
new file mode 100644
index 0000000..e6ca73e
--- /dev/null
+++ b/ext/intl/tests/bug62082.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Bug #62082: Memory corruption in internal get_icu_disp_value_src_php()
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+	die('skip intl extension not enabled');
+--FILE--
+<?php
+var_dump(locale_get_display_name(str_repeat("a", 300), null));
+var_dump(locale_get_display_name(str_repeat("a", 512), null));
+var_dump(locale_get_display_name(str_repeat("a", 600), null));
+--EXPECT--
+string(300) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+string(512) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+string(600) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"


commit 07c0d714a59cb4d38664008a165bacafd754fac2
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Wed May 23 13:03:55 2012 +0200

    Fixed bug #62081
    
    Constructor of IntlDateFormatter would leak if called twice.
    
    Made calling it more than once error out before starting
    using resources.

diff --git a/ext/intl/dateformat/dateformat.c b/ext/intl/dateformat/dateformat.c
index 6f74322..05ba19e 100755
--- a/ext/intl/dateformat/dateformat.c
+++ b/ext/intl/dateformat/dateformat.c
@@ -100,6 +100,13 @@ static void datefmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
 
 	INTL_CHECK_LOCALE_LEN_OBJ(locale_len, return_value);
 	DATE_FORMAT_METHOD_FETCH_OBJECT;
+	
+	if (DATE_FORMAT_OBJECT(dfo) != NULL) {
+		intl_errors_set(INTL_DATA_ERROR_P(dfo), U_ILLEGAL_ARGUMENT_ERROR,
+				"datefmt_create: cannot call constructor twice", 0 TSRMLS_CC);
+		return;
+	}
+	
 	/* Convert pattern (if specified) to UTF-16. */
 	if( pattern_str && pattern_str_len>0 ){
 		intl_convert_utf8_to_utf16(&svalue, &slength, pattern_str, pattern_str_len, &INTL_DATA_ERROR_CODE(dfo));
@@ -169,6 +176,8 @@ PHP_FUNCTION( datefmt_create )
  */
 PHP_METHOD( IntlDateFormatter, __construct )
 {
+	/* return_value param is being changed, therefore we will always return
+	 * NULL here */
 	return_value = getThis();
 	datefmt_ctor(INTERNAL_FUNCTION_PARAM_PASSTHRU);
 }
diff --git a/ext/intl/tests/bug62081.phpt b/ext/intl/tests/bug62081.phpt
new file mode 100644
index 0000000..7d9e2ce
--- /dev/null
+++ b/ext/intl/tests/bug62081.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Bug #62081: IntlDateFormatter leaks memory if called twice
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+	die('skip intl extension not enabled');
+--FILE--
+<?php
+ini_set('intl.error_level', E_WARNING);
+$x = new IntlDateFormatter(1,1,1,1,1);
+var_dump($x->__construct(1,1,1,1,1));
+--EXPECTF--
+Warning: IntlDateFormatter::__construct(): datefmt_create: cannot call constructor twice in %s on line %d
+NULL


commit 51286bd8e5a7acd75326fae497313725e4acf234
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Wed May 23 13:22:06 2012 +0200

    Fixed bug #62070
    
    Collator::getSortKey() was returning an unterminated string
    due the length given to RETURN_STRINGL being off by one.

diff --git a/ext/intl/collator/collator_sort.c b/ext/intl/collator/collator_sort.c
index a871c90..0785111 100755
--- a/ext/intl/collator/collator_sort.c
+++ b/ext/intl/collator/collator_sort.c
@@ -594,6 +594,8 @@ PHP_FUNCTION( collator_get_sort_key )
 		RETURN_FALSE;
 	}
 
+	/* ucol_getSortKey is exception in that the key length includes the 
+	 * NUL terminator*/
 	key_len = ucol_getSortKey(co->ucoll, ustr, ustr_len, key, 0);
 	if(!key_len) {
 		efree( ustr );
@@ -605,7 +607,7 @@ PHP_FUNCTION( collator_get_sort_key )
 	if(!key_len) {
 		RETURN_FALSE;
 	}
-	RETURN_STRINGL((char *)key, key_len, 0);
+	RETURN_STRINGL((char *)key, key_len - 1, 0);
 }
 /* }}} */
 
diff --git a/ext/intl/tests/bug62070.phpt b/ext/intl/tests/bug62070.phpt
new file mode 100644
index 0000000..a466b05
--- /dev/null
+++ b/ext/intl/tests/bug62070.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #62070: Collator::getSortKey() returns garbage
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+	die('skip intl extension not enabled');
+--FILE--
+<?php
+$s1 = 'Hello';
+
+$coll = collator_create('en_US');
+$res = collator_get_sort_key($coll, $s1);
+
+echo urlencode($res);
+--EXPECT--
+5%2F%3D%3DC%01%09%01%8F%08


commit e9a7039e60ea0ab621e1cd1c34e90caf33f6ea22
Merge: 6e84267 1299503
Author: Jerome Loyet <fat at php.net>
Date:   Wed May 23 11:53:20 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      - Fixed bug #61026 (FPM pools can listen on the same address)



commit 1299503936597ea873a3eb8272aa4deec2f31e5b
Author: Jerome Loyet <fat at php.net>
Date:   Wed May 23 11:53:04 2012 +0200

    - Fixed bug #61026 (FPM pools can listen on the same address)

diff --git a/NEWS b/NEWS
index 9b0a3ac..1db032a 100644
--- a/NEWS
+++ b/NEWS
@@ -60,6 +60,7 @@ PHP                                                                        NEWS
   . Fixed bug #61295 (php-fpm should not fail with commented 'user'
     for non-root start). (fat)
   . Fixed bug #61839 (Unable to cross-compile PHP with --enable-fpm). (fat)
+  . Fixed bug #61026 (FPM pools can listen on the same address). (fat)
 
 - Libxml:
   . Fixed bug #61617 (Libxml tests failed(ht is already destroyed)).
diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c
index 0b2c5ae..a4283a2 100644
--- a/sapi/fpm/fpm/fpm_conf.c
+++ b/sapi/fpm/fpm/fpm_conf.c
@@ -704,7 +704,7 @@ static int fpm_evaluate_full_path(char **path, struct fpm_worker_pool_s *wp, cha
 
 static int fpm_conf_process_all_pools() /* {{{ */
 {
-	struct fpm_worker_pool_s *wp;
+	struct fpm_worker_pool_s *wp, *wp2;
 
 	if (!fpm_worker_all_pools) {
 		zlog(ZLOG_ERROR, "No pool defined. at least one pool section must be specified in config file");
@@ -1044,6 +1044,20 @@ static int fpm_conf_process_all_pools() /* {{{ */
 			}
 		}
 	}
+
+	/* ensure 2 pools do not use the same listening address */
+	for (wp = fpm_worker_all_pools; wp; wp = wp->next) {
+		for (wp2 = fpm_worker_all_pools; wp2; wp2 = wp2->next) {
+			if (wp == wp2) {
+				continue;
+			}
+
+			if (wp->config->listen_address && *wp->config->listen_address && wp2->config->listen_address && *wp2->config->listen_address && !strcmp(wp->config->listen_address, wp2->config->listen_address)) {
+				zlog(ZLOG_ERROR, "[pool %s] unable to set listen address as it's already used in another pool '%s'", wp2->config->name, wp->config->name);
+				return -1;
+			}
+		}
+	}
 	return 0;
 }
 /* }}} */


commit 5d61e56dd7e19b82abde23f83b203449a48cc91a
Author: Jerome Loyet <fat at php.net>
Date:   Wed May 23 11:52:04 2012 +0200

    - Fixed bug #61026 (FPM pools can listen on the same address)

diff --git a/NEWS b/NEWS
index 13ac964..7542724 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,7 @@ PHP                                                                        NEWS
 	. Fixed bug #61835 (php-fpm is not allowed to run as root). (fat)
   . Fixed bug #61295 (php-fpm should not fail with commented 'user'
     for non-root start). (fat)
+  . Fixed bug #61026 (FPM pools can listen on the same address). (fat)
 
 - XML Writer:
   . Fixed bug #62064 (memory leak in the XML Writer module). 
diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c
index 0b2c5ae..a4283a2 100644
--- a/sapi/fpm/fpm/fpm_conf.c
+++ b/sapi/fpm/fpm/fpm_conf.c
@@ -704,7 +704,7 @@ static int fpm_evaluate_full_path(char **path, struct fpm_worker_pool_s *wp, cha
 
 static int fpm_conf_process_all_pools() /* {{{ */
 {
-	struct fpm_worker_pool_s *wp;
+	struct fpm_worker_pool_s *wp, *wp2;
 
 	if (!fpm_worker_all_pools) {
 		zlog(ZLOG_ERROR, "No pool defined. at least one pool section must be specified in config file");
@@ -1044,6 +1044,20 @@ static int fpm_conf_process_all_pools() /* {{{ */
 			}
 		}
 	}
+
+	/* ensure 2 pools do not use the same listening address */
+	for (wp = fpm_worker_all_pools; wp; wp = wp->next) {
+		for (wp2 = fpm_worker_all_pools; wp2; wp2 = wp2->next) {
+			if (wp == wp2) {
+				continue;
+			}
+
+			if (wp->config->listen_address && *wp->config->listen_address && wp2->config->listen_address && *wp2->config->listen_address && !strcmp(wp->config->listen_address, wp2->config->listen_address)) {
+				zlog(ZLOG_ERROR, "[pool %s] unable to set listen address as it's already used in another pool '%s'", wp2->config->name, wp->config->name);
+				return -1;
+			}
+		}
+	}
 	return 0;
 }
 /* }}} */


commit d236c1af8a5e1813e2667de969fa2ad39da74887
Merge: 0b44f16 3e62aae
Author: Jerome Loyet <fat at php.net>
Date:   Wed May 23 11:41:29 2012 +0200

    Merge branch 'PHP-5.4' of git.php.net:php-src into PHP-5.4
    
    * 'PHP-5.4' of git.php.net:php-src:
      Fix bug #62112: number_format() is not binary safe



commit 6e84267cc9673049289821f10d738f7697e622a9
Merge: 2cd6855 adf2fba
Author: Jerome Loyet <fat at php.net>
Date:   Wed May 23 11:40:59 2012 +0200

    Merge branch 'master' of git.php.net:php-src
    
    * 'master' of git.php.net:php-src:
      Fix bug #62112: number_format() is not binary safe



commit 2cd6855d4f284a20974dbf2a6108e2e89d8731ab
Merge: 9438b2c 0b44f16
Author: Jerome Loyet <fat at php.net>
Date:   Wed May 23 11:40:36 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      - Fixed bug #61839 (Unable to cross-compile PHP with --enable-fpm)



commit 0b44f16ea2f18a08eb1249db6621840527eab5e0
Author: Jerome Loyet <fat at php.net>
Date:   Wed May 23 11:40:22 2012 +0200

    - Fixed bug #61839 (Unable to cross-compile PHP with --enable-fpm)

diff --git a/NEWS b/NEWS
index c8aa208..9b0a3ac 100644
--- a/NEWS
+++ b/NEWS
@@ -59,6 +59,7 @@ PHP                                                                        NEWS
   . Fixed bug #61835 (php-fpm is not allowed to run as root). (fat)
   . Fixed bug #61295 (php-fpm should not fail with commented 'user'
     for non-root start). (fat)
+  . Fixed bug #61839 (Unable to cross-compile PHP with --enable-fpm). (fat)
 
 - Libxml:
   . Fixed bug #61617 (Libxml tests failed(ht is already destroyed)).
diff --git a/sapi/fpm/config.m4 b/sapi/fpm/config.m4
index 8962810..6c860c9 100644
--- a/sapi/fpm/config.m4
+++ b/sapi/fpm/config.m4
@@ -192,6 +192,8 @@ AC_DEFUN([AC_FPM_TRACE],
       have_ptrace=no
       have_broken_ptrace=yes
       AC_MSG_RESULT([no])
+    ], [
+      AC_MSG_RESULT([skipped (cross compiling)])
     ])
   fi
 
@@ -264,6 +266,8 @@ AC_DEFUN([AC_FPM_TRACE],
     ], [
       proc_mem_file=""
       AC_MSG_RESULT([no])
+    ], [
+      AC_MSG_RESULT([skipped (cross compiling)])
     ])
   fi
   


commit adf2fba307f404910a47a94cf34f2ddd45c0cd56
Merge: 9438b2c 3e62aae
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Wed May 23 11:37:45 2012 +0200

    Merge branch '5.4'



commit 3e62aae1b456440328af4153524e22679b84f68a
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Wed May 23 10:56:57 2012 +0200

    Fix bug #62112: number_format() is not binary safe
    
    The bug report actually urges PHP 5.3's behavior to be
    reinstated -- that is, make "\0", when used as a separator,
    be the same as no separator at all. I believe that is not a
    proper course of action and that "\0" being interpreted as
    no seperator was a bug in PHP 5.3.
    
    Using "" for no separator, in both 5.3 and 5.4, before and
    after this change, causes no separator to be used, so
    there is no functionality loss.

diff --git a/NEWS b/NEWS
index c8aa208..326504f 100644
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,7 @@ PHP                                                                        NEWS
 
 - Core:
   . Fixed missing bound check in iptcparse(). (chris at chiappa.net)
+  . Fixed bug #62112 (number_format() is not binary safe). (Gustavo)
   . Fixed bug #62005 (unexpected behavior when incrementally assigning to a 
     member of a null object). (Laruence)
   . Fixed bug #61998 (Using traits with method aliases appears to result in
diff --git a/ext/standard/math.c b/ext/standard/math.c
index 65187f6..b3e8c6f 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -1097,7 +1097,9 @@ PHPAPI char *_php_math_number_format(double d, int dec, char dec_point, char tho
 	return _php_math_number_format_ex(d, dec, &dec_point, 1, &thousand_sep, 1);
 }
 
-PHPAPI char *_php_math_number_format_ex(double d, int dec, char *dec_point, size_t dec_point_len, char *thousand_sep, size_t thousand_sep_len)
+static char *_php_math_number_format_ex_len(double d, int dec, char *dec_point,
+		size_t dec_point_len, char *thousand_sep, size_t thousand_sep_len,
+		int *result_len)
 {
 	char *tmpbuf = NULL, *resbuf;
 	char *s, *t;  /* source, target */
@@ -1205,8 +1207,19 @@ PHPAPI char *_php_math_number_format_ex(double d, int dec, char *dec_point, size
 
 	efree(tmpbuf);
 	
+	if (result_len) {
+		*result_len = reslen;
+	}
+
 	return resbuf;
 }
+
+PHPAPI char *_php_math_number_format_ex(double d, int dec, char *dec_point,
+		size_t dec_point_len, char *thousand_sep, size_t thousand_sep_len)
+{
+	return _php_math_number_format_ex_len(d, dec, dec_point, dec_point_len,
+			thousand_sep, thousand_sep_len, NULL);
+}
 /* }}} */
 
 /* {{{ proto string number_format(float number [, int num_decimal_places [, string dec_seperator, string thousands_seperator]])
@@ -1241,7 +1254,10 @@ PHP_FUNCTION(number_format)
 			thousand_sep_len = 1;
 		}
 
-		RETURN_STRING(_php_math_number_format_ex(num, dec, dec_point, dec_point_len, thousand_sep, thousand_sep_len), 0);
+		Z_TYPE_P(return_value) = IS_STRING;
+		Z_STRVAL_P(return_value) = _php_math_number_format_ex_len(num, dec,
+				dec_point, dec_point_len, thousand_sep, thousand_sep_len,
+				&Z_STRLEN_P(return_value));
 		break;
 	default:
 		WRONG_PARAM_COUNT;
diff --git a/ext/standard/tests/math/bug62112.phpt b/ext/standard/tests/math/bug62112.phpt
new file mode 100644
index 0000000..01de35a
Binary files /dev/null and b/ext/standard/tests/math/bug62112.phpt differ


commit 9438b2c401e6c440a0b2de0bf379c34dd809289a
Merge: 3ec70a8 a07d76c
Author: Jerome Loyet <fat at php.net>
Date:   Wed May 23 11:32:02 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      - Fixed bug #61295 (php-fpm should not fail with commented 'user' for non-root start)



commit a07d76c0ba57e6471ac5869af0aaa26206baa284
Author: Jerome Loyet <fat at php.net>
Date:   Wed May 23 11:31:33 2012 +0200

    - Fixed bug #61295 (php-fpm should not fail with commented 'user' for non-root start)

diff --git a/NEWS b/NEWS
index ff80183..c8aa208 100644
--- a/NEWS
+++ b/NEWS
@@ -57,6 +57,8 @@ PHP                                                                        NEWS
 - FPM
   . Fixed bug #61045 (fpm don't send error log to fastcgi clients). (fat)
   . Fixed bug #61835 (php-fpm is not allowed to run as root). (fat)
+  . Fixed bug #61295 (php-fpm should not fail with commented 'user'
+    for non-root start). (fat)
 
 - Libxml:
   . Fixed bug #61617 (Libxml tests failed(ht is already destroyed)).
diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c
index 304076d..0b2c5ae 100644
--- a/sapi/fpm/fpm/fpm_conf.c
+++ b/sapi/fpm/fpm/fpm_conf.c
@@ -723,8 +723,8 @@ static int fpm_conf_process_all_pools() /* {{{ */
 			}
 		}
 
-		/* user */
-		if (!wp->config->user) {
+		/* alert if user is not set only if we are not root*/
+		if (!wp->config->user && !geteuid()) {
 			zlog(ZLOG_ALERT, "[pool %s] user has not been defined", wp->config->name);
 			return -1;
 		}


commit 812d2481935185eeeabb2c1fe2d7eafd76fc7359
Author: Jerome Loyet <fat at php.net>
Date:   Wed May 23 11:30:27 2012 +0200

    - Fixed bug #61295 (php-fpm should not fail with commented 'user' for non-root start)

diff --git a/NEWS b/NEWS
index c1d5f61..13ac964 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,8 @@ PHP                                                                        NEWS
 - FPM
   . Fixed bug #61045 (fpm don't send error log to fastcgi clients). (fat)
 	. Fixed bug #61835 (php-fpm is not allowed to run as root). (fat)
+  . Fixed bug #61295 (php-fpm should not fail with commented 'user'
+    for non-root start). (fat)
 
 - XML Writer:
   . Fixed bug #62064 (memory leak in the XML Writer module). 
diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c
index 304076d..0b2c5ae 100644
--- a/sapi/fpm/fpm/fpm_conf.c
+++ b/sapi/fpm/fpm/fpm_conf.c
@@ -723,8 +723,8 @@ static int fpm_conf_process_all_pools() /* {{{ */
 			}
 		}
 
-		/* user */
-		if (!wp->config->user) {
+		/* alert if user is not set only if we are not root*/
+		if (!wp->config->user && !geteuid()) {
 			zlog(ZLOG_ALERT, "[pool %s] user has not been defined", wp->config->name);
 			return -1;
 		}


commit 3ec70a895eb79be4696c34e8bb6ee0b1c4e2bce8
Merge: c0f6263 757e3fc
Author: Jerome Loyet <fat at php.net>
Date:   Wed May 23 10:37:36 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      - fix help message for '-R'
      - Fixed bug #61835 (php-fpm is not allowed to run as root)



commit f4c38016b634fbacd6daab6e43d0cd57d1ec5357
Author: Jerome Loyet <fat at php.net>
Date:   Wed May 23 10:36:45 2012 +0200

    - Fix help message for '-R'

diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index 4eed539..95a7623 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -937,7 +937,7 @@ static void php_cgi_usage(char *argv0)
 				"  -y, --fpm-config <file>\n"
 				"                   Specify alternative path to FastCGI process manager config file.\n"
 				"  -t, --test       Test FPM configuration and exit\n"
-				"  -R, allow-to-run-as-root\n"
+				"  -R, --allow-to-run-as-root\n"
 				"                   Allow pool to run as root (disabled by default)\n",
 
 				prog, PHP_PREFIX);


commit 757e3fc3d5ca6d175c829549f256adc98b7c1f46
Author: Jerome Loyet <fat at php.net>
Date:   Wed May 23 10:35:37 2012 +0200

    - fix help message for '-R'

diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index dd48ffd..130673f 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -927,8 +927,8 @@ static void php_cgi_usage(char *argv0)
 				"                   Specify the PID file location.\n"
 				"  -y, --fpm-config <file>\n"
 				"                   Specify alternative path to FastCGI process manager config file.\n"
-				"  -t, --test       Test FPM configuration and exit\n",
-				"  -R, allow-to-run-as-root\n"
+				"  -t, --test       Test FPM configuration and exit\n"
+				"  -R, --allow-to-run-as-root\n"
 				"                   Allow pool to run as root (disabled by default)\n",
 				prog, PHP_PREFIX);
 }


commit 629273d11b7b345fc3e175d479e3fc08d4087183
Author: Jerome Loyet <fat at php.net>
Date:   Wed May 23 10:34:16 2012 +0200

    - add missing help message for '-R'

diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index e74986f..4eed539 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -936,7 +936,10 @@ static void php_cgi_usage(char *argv0)
 				"                   Specify the PID file location.\n"
 				"  -y, --fpm-config <file>\n"
 				"                   Specify alternative path to FastCGI process manager config file.\n"
-				"  -t, --test       Test FPM configuration and exit\n",
+				"  -t, --test       Test FPM configuration and exit\n"
+				"  -R, allow-to-run-as-root\n"
+				"                   Allow pool to run as root (disabled by default)\n",
+
 				prog, PHP_PREFIX);
 }
 /* }}} */


commit 06c7c3674b5e205023de7a150d29d78c313143f8
Author: Jerome Loyet <fat at php.net>
Date:   Wed May 23 10:32:42 2012 +0200

    - Fixed bug #61835 (php-fpm is not allowed to run as root)

diff --git a/NEWS b/NEWS
index ad51a67..ff80183 100644
--- a/NEWS
+++ b/NEWS
@@ -56,6 +56,7 @@ PHP                                                                        NEWS
 
 - FPM
   . Fixed bug #61045 (fpm don't send error log to fastcgi clients). (fat)
+  . Fixed bug #61835 (php-fpm is not allowed to run as root). (fat)
 
 - Libxml:
   . Fixed bug #61617 (Libxml tests failed(ht is already destroyed)).
diff --git a/sapi/fpm/fpm/fpm.c b/sapi/fpm/fpm/fpm.c
index 96aabbf..909902b 100644
--- a/sapi/fpm/fpm/fpm.c
+++ b/sapi/fpm/fpm/fpm.c
@@ -37,10 +37,11 @@ struct fpm_globals_s fpm_globals = {
 	.max_requests = 0,
 	.is_child = 0,
 	.test_successful = 0,
-	.heartbeat = 0
+	.heartbeat = 0,
+	.run_as_root = 0,
 };
 
-int fpm_init(int argc, char **argv, char *config, char *prefix, char *pid, int test_conf) /* {{{ */
+int fpm_init(int argc, char **argv, char *config, char *prefix, char *pid, int test_conf, int run_as_root) /* {{{ */
 {
 	fpm_globals.argc = argc;
 	fpm_globals.argv = argv;
@@ -49,6 +50,7 @@ int fpm_init(int argc, char **argv, char *config, char *prefix, char *pid, int t
 	}
 	fpm_globals.prefix = prefix;
 	fpm_globals.pid = pid;
+	fpm_globals.run_as_root = run_as_root;
 
 	if (0 > fpm_php_init_main()           ||
 	    0 > fpm_stdio_init_main()         ||
diff --git a/sapi/fpm/fpm/fpm.h b/sapi/fpm/fpm/fpm.h
index bfeac4d..2a69cb2 100644
--- a/sapi/fpm/fpm/fpm.h
+++ b/sapi/fpm/fpm/fpm.h
@@ -8,7 +8,7 @@
 #include <unistd.h>
 
 int fpm_run(int *max_requests);
-int fpm_init(int argc, char **argv, char *config, char *prefix, char *pid, int test_conf);
+int fpm_init(int argc, char **argv, char *config, char *prefix, char *pid, int test_conf, int run_as_root);
 
 struct fpm_globals_s {
 	pid_t parent_pid;
@@ -25,6 +25,7 @@ struct fpm_globals_s {
 	int is_child;
 	int test_successful;
 	int heartbeat;
+	int run_as_root;
 };
 
 extern struct fpm_globals_s fpm_globals;
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index a28af53..dd48ffd 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -154,6 +154,7 @@ static const opt_struct OPTIONS[] = {
 	{'t', 0, "test"},
 	{'p', 1, "prefix"},
 	{'g', 1, "pid"},
+	{'R', 0, "allow-to-run-as-root"},
 	{'-', 0, NULL} /* end of args */
 };
 
@@ -927,6 +928,8 @@ static void php_cgi_usage(char *argv0)
 				"  -y, --fpm-config <file>\n"
 				"                   Specify alternative path to FastCGI process manager config file.\n"
 				"  -t, --test       Test FPM configuration and exit\n",
+				"  -R, allow-to-run-as-root\n"
+				"                   Allow pool to run as root (disabled by default)\n",
 				prog, PHP_PREFIX);
 }
 /* }}} */
@@ -1548,6 +1551,7 @@ int main(int argc, char *argv[])
 	char *fpm_pid = NULL;
 	int test_conf = 0;
 	int php_information = 0;
+	int php_allow_to_run_as_root = 0;
 
 #ifdef HAVE_SIGNAL_H
 #if defined(SIGPIPE) && defined(SIG_IGN)
@@ -1662,6 +1666,10 @@ int main(int argc, char *argv[])
 				php_information = 1;
 				break;
 
+			case 'R': /* allow to run as root */
+				php_allow_to_run_as_root = 1;
+				break;
+
 			default:
 			case 'h':
 			case '?':
@@ -1789,7 +1797,7 @@ consult the installation file that came with this distribution, or visit \n\
 		}
 	}
 
-	if (0 > fpm_init(argc, argv, fpm_config ? fpm_config : CGIG(fpm_config), fpm_prefix, fpm_pid, test_conf)) {
+	if (0 > fpm_init(argc, argv, fpm_config ? fpm_config : CGIG(fpm_config), fpm_prefix, fpm_pid, test_conf, php_allow_to_run_as_root)) {
 		return FAILURE;
 	}
 
diff --git a/sapi/fpm/fpm/fpm_unix.c b/sapi/fpm/fpm/fpm_unix.c
index 17d0b81..fb61d63 100644
--- a/sapi/fpm/fpm/fpm_unix.c
+++ b/sapi/fpm/fpm/fpm_unix.c
@@ -112,12 +112,12 @@ static int fpm_unix_conf_wp(struct fpm_worker_pool_s *wp) /* {{{ */
 			}
 		}
 
-#ifndef I_REALLY_WANT_ROOT_PHP
-		if (wp->set_uid == 0 || wp->set_gid == 0) {
-			zlog(ZLOG_ERROR, "[pool %s] please specify user and group other than root", wp->config->name);
-			return -1;
+		if (!fpm_globals.run_as_root) {
+			if (wp->set_uid == 0 || wp->set_gid == 0) {
+				zlog(ZLOG_ERROR, "[pool %s] please specify user and group other than root", wp->config->name);
+				return -1;
+			}
 		}
-#endif
 	} else { /* not root */
 		if (wp->config->user && *wp->config->user) {
 			zlog(ZLOG_WARNING, "[pool %s] 'user' directive is ignored when FPM is not running as root", wp->config->name);


commit 7b396c078cc8fef18f37cc9a22c437f13921e375
Author: Jerome Loyet <fat at php.net>
Date:   Wed May 23 09:49:13 2012 +0200

    - Fixed bug #61835 (php-fpm is not allowed to run as root)

diff --git a/NEWS b/NEWS
index d6ac422..c1d5f61 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ PHP                                                                        NEWS
 
 - FPM
   . Fixed bug #61045 (fpm don't send error log to fastcgi clients). (fat)
+	. Fixed bug #61835 (php-fpm is not allowed to run as root). (fat)
 
 - XML Writer:
   . Fixed bug #62064 (memory leak in the XML Writer module). 
diff --git a/sapi/fpm/fpm/fpm.c b/sapi/fpm/fpm/fpm.c
index 96aabbf..909902b 100644
--- a/sapi/fpm/fpm/fpm.c
+++ b/sapi/fpm/fpm/fpm.c
@@ -37,10 +37,11 @@ struct fpm_globals_s fpm_globals = {
 	.max_requests = 0,
 	.is_child = 0,
 	.test_successful = 0,
-	.heartbeat = 0
+	.heartbeat = 0,
+	.run_as_root = 0,
 };
 
-int fpm_init(int argc, char **argv, char *config, char *prefix, char *pid, int test_conf) /* {{{ */
+int fpm_init(int argc, char **argv, char *config, char *prefix, char *pid, int test_conf, int run_as_root) /* {{{ */
 {
 	fpm_globals.argc = argc;
 	fpm_globals.argv = argv;
@@ -49,6 +50,7 @@ int fpm_init(int argc, char **argv, char *config, char *prefix, char *pid, int t
 	}
 	fpm_globals.prefix = prefix;
 	fpm_globals.pid = pid;
+	fpm_globals.run_as_root = run_as_root;
 
 	if (0 > fpm_php_init_main()           ||
 	    0 > fpm_stdio_init_main()         ||
diff --git a/sapi/fpm/fpm/fpm.h b/sapi/fpm/fpm/fpm.h
index bfeac4d..2a69cb2 100644
--- a/sapi/fpm/fpm/fpm.h
+++ b/sapi/fpm/fpm/fpm.h
@@ -8,7 +8,7 @@
 #include <unistd.h>
 
 int fpm_run(int *max_requests);
-int fpm_init(int argc, char **argv, char *config, char *prefix, char *pid, int test_conf);
+int fpm_init(int argc, char **argv, char *config, char *prefix, char *pid, int test_conf, int run_as_root);
 
 struct fpm_globals_s {
 	pid_t parent_pid;
@@ -25,6 +25,7 @@ struct fpm_globals_s {
 	int is_child;
 	int test_successful;
 	int heartbeat;
+	int run_as_root;
 };
 
 extern struct fpm_globals_s fpm_globals;
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index 5767971..e74986f 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -154,6 +154,7 @@ static const opt_struct OPTIONS[] = {
 	{'t', 0, "test"},
 	{'p', 1, "prefix"},
 	{'g', 1, "pid"},
+	{'R', 0, "allow-to-run-as-root"},
 	{'-', 0, NULL} /* end of args */
 };
 
@@ -1557,6 +1558,7 @@ int main(int argc, char *argv[])
 	char *fpm_pid = NULL;
 	int test_conf = 0;
 	int php_information = 0;
+	int php_allow_to_run_as_root = 0;
 
 	fcgi_init();
 
@@ -1670,6 +1672,10 @@ int main(int argc, char *argv[])
 				php_information = 1;
 				break;
 
+			case 'R': /* allow to run as root */
+				php_allow_to_run_as_root = 1;
+				break;
+
 			default:
 			case 'h':
 			case '?':
@@ -1793,7 +1799,7 @@ consult the installation file that came with this distribution, or visit \n\
 		}
 	}
 
-	if (0 > fpm_init(argc, argv, fpm_config ? fpm_config : CGIG(fpm_config), fpm_prefix, fpm_pid, test_conf)) {
+	if (0 > fpm_init(argc, argv, fpm_config ? fpm_config : CGIG(fpm_config), fpm_prefix, fpm_pid, test_conf, php_allow_to_run_as_root)) {
 		return FAILURE;
 	}
 
diff --git a/sapi/fpm/fpm/fpm_unix.c b/sapi/fpm/fpm/fpm_unix.c
index 17d0b81..fb61d63 100644
--- a/sapi/fpm/fpm/fpm_unix.c
+++ b/sapi/fpm/fpm/fpm_unix.c
@@ -112,12 +112,12 @@ static int fpm_unix_conf_wp(struct fpm_worker_pool_s *wp) /* {{{ */
 			}
 		}
 
-#ifndef I_REALLY_WANT_ROOT_PHP
-		if (wp->set_uid == 0 || wp->set_gid == 0) {
-			zlog(ZLOG_ERROR, "[pool %s] please specify user and group other than root", wp->config->name);
-			return -1;
+		if (!fpm_globals.run_as_root) {
+			if (wp->set_uid == 0 || wp->set_gid == 0) {
+				zlog(ZLOG_ERROR, "[pool %s] please specify user and group other than root", wp->config->name);
+				return -1;
+			}
 		}
-#endif
 	} else { /* not root */
 		if (wp->config->user && *wp->config->user) {
 			zlog(ZLOG_WARNING, "[pool %s] 'user' directive is ignored when FPM is not running as root", wp->config->name);


commit c0f62636e8cbb4f0fde9a0d149e29b598f215aae
Merge: 163099a 8475c5b
Author: Xinchen Hui <laruence at php.net>
Date:   Wed May 23 13:53:25 2012 +0800

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Revert NEWS
      Revert "Implemented FR #61602 Allow access to name of constant used as default value"
      Fix typo while resolving conflicts
      Revert "Implemented FR #61602 Allow access to name of constant used as default value"



commit 8475c5b98d6a2edfd520261b72f636451cd3c95d
Merge: 5b83161 f733173
Author: Xinchen Hui <laruence at php.net>
Date:   Wed May 23 13:52:36 2012 +0800

    Merge remote-tracking branch 'origin/PHP-5.3' into PHP-5.4



commit 5b8316188c4fe209d191310a49aea9ac3fcd056a
Author: Xinchen Hui <laruence at php.net>
Date:   Wed May 23 13:52:18 2012 +0800

    Revert NEWS

diff --git a/NEWS b/NEWS
index ba0b220..ad51a67 100644
--- a/NEWS
+++ b/NEWS
@@ -50,10 +50,6 @@ PHP                                                                        NEWS
 - Pgsql:
   . Added pg_escape_identifier/pg_escape_literal. (Yasuo Ohgaki)
 
-- Reflection:
-  . Implemented FR #61602 (Allow access to the name of constant
-    used as function/method parameter's default value). (reeze.xia at gmail.com)
-
 - Fileinfo
   . Fixed bug #61812 (Uninitialised value used in libmagic). 
     (Laruence, Gustavo)


commit df481764f34b0268025d031a082297edee124c7c
Author: Xinchen Hui <laruence at php.net>
Date:   Wed May 23 13:50:12 2012 +0800

    Revert "Implemented FR #61602 Allow access to name of constant used as default value"
    
    This reverts commit 054f3e3ce5af13c2c3a6ccd54f7dc3e2f6cd4f74.
    
    See: http://news.php.net/php.cvs/69137 and the author confirmed.
    Will commit later after the author fixed this then make a new PR.
    
    Conflicts:
    
    	ext/reflection/php_reflection.c

diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 406da93..1cf65ce 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -1457,49 +1457,6 @@ static void _reflection_export(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *c
 }
 /* }}} */
 
-/* {{{ _reflection_param_get_default_param */
-static parameter_reference *_reflection_param_get_default_param(INTERNAL_FUNCTION_PARAMETERS)
-{
-	reflection_object *intern;
-	parameter_reference *param;
-
-	GET_REFLECTION_OBJECT_PTR(param);
-
-	if (param->fptr->type != ZEND_USER_FUNCTION)
-	{
-		zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Cannot determine default value for internal functions");
-		return NULL;
-	}
-
-	if (param->offset < param->required) {
-		zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Parameter is not optional");
-		return NULL;
-	}
-
-	return param;
-}
-/* }}} */
-
-/* {{{ _reflection_param_get_default_precv */
-static zend_op *_reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAMETERS, parameter_reference *param)
-{
-	zend_op *precv;
-
-	param = param ? param : _reflection_param_get_default_param(INTERNAL_FUNCTION_PARAM_PASSTHRU);
-	if (!param) {
-		return NULL;
-	}
-
-	precv = _get_recv_op((zend_op_array*)param->fptr, param->offset);
-	if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2_type == IS_UNUSED) {
-		zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Internal error");
-		return NULL;
-	}
-
-	return precv;
-}
-/* }}} */
-
 /* {{{ Preventing __clone from being called */
 ZEND_METHOD(reflection, __clone)
 {
@@ -2578,14 +2535,27 @@ ZEND_METHOD(reflection_parameter, isDefaultValueAvailable)
    Returns the default value of this parameter or throws an exception */
 ZEND_METHOD(reflection_parameter, getDefaultValue)
 {
-	parameter_reference *param =  _reflection_param_get_default_param(INTERNAL_FUNCTION_PARAM_PASSTHRU);
-	zend_op *precv = _reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAM_PASSTHRU, param);
+	reflection_object *intern;
+	parameter_reference *param;
+	zend_op *precv;
 
 	if (zend_parse_parameters_none() == FAILURE) {
 		return;
 	}
+	GET_REFLECTION_OBJECT_PTR(param);
 
-	if (!(param && precv)) {
+	if (param->fptr->type != ZEND_USER_FUNCTION)
+	{
+		zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Cannot determine default value for internal functions");
+		return;
+	}
+	if (param->offset < param->required) {
+		zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Parameter is not optional");
+		return;
+	}
+	precv = _get_recv_op((zend_op_array*)param->fptr, param->offset);
+	if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2_type == IS_UNUSED) {
+		zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Internal error");
 		return;
 	}
 
@@ -2598,42 +2568,6 @@ ZEND_METHOD(reflection_parameter, getDefaultValue)
 }
 /* }}} */
 
-/* {{{ proto public bool ReflectionParameter::isDefaultValueConstant()
-   Returns whether the default value of this parameter is constant */
-ZEND_METHOD(reflection_parameter, isDefaultValueConstant)
-{
-	zend_op *precv = _reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAM_PASSTHRU, NULL);
-
-	if (zend_parse_parameters_none() == FAILURE) {
-		return;
-	}
-
-	if (precv && (Z_TYPE_P(precv->op2.zv) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) {
-		RETURN_TRUE;
-	}
-
-	RETURN_FALSE;
-}
-/* }}} */
-
-/* {{{ proto public mixed ReflectionParameter::getDefaultValueConstantName()
-   Returns the default value's constant name if default value is constant or false */
-ZEND_METHOD(reflection_parameter, getDefaultValueConstantName)
-{
-	zend_op *precv = _reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAM_PASSTHRU, NULL);
-
-	if (zend_parse_parameters_none() == FAILURE) {
-		return;
-	}
-
-	if (precv && (Z_TYPE_P(precv->op2.zv) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) {
-		RETURN_STRING(Z_STRVAL_P(precv->op2.zv), 1);
-	}
-
-	RETURN_FALSE;
-}
-/* }}} */
-
 /* {{{ proto public static mixed ReflectionMethod::export(mixed class, string name [, bool return]) throws ReflectionException
    Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */
 ZEND_METHOD(reflection_method, export)
@@ -5969,8 +5903,6 @@ static const zend_function_entry reflection_parameter_functions[] = {
 	ZEND_ME(reflection_parameter, isOptional, arginfo_reflection__void, 0)
 	ZEND_ME(reflection_parameter, isDefaultValueAvailable, arginfo_reflection__void, 0)
 	ZEND_ME(reflection_parameter, getDefaultValue, arginfo_reflection__void, 0)
-	ZEND_ME(reflection_parameter, isDefaultValueConstant, arginfo_reflection__void, 0)
-	ZEND_ME(reflection_parameter, getDefaultValueConstantName, arginfo_reflection__void, 0)
 	PHP_FE_END
 };
 
diff --git a/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic1.phpt b/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic1.phpt
deleted file mode 100644
index cdd00d2..0000000
--- a/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic1.phpt
+++ /dev/null
@@ -1,52 +0,0 @@
---TEST--
-ReflectionParameter::isDefaultValueConstant() && getDefaultValueConstantName()
---FILE--
-<?php
-
-define("CONST_TEST_1", "const1");
-
-function ReflectionParameterTest($test1=array(), $test2 = CONST_TEST_1) {
-	echo $test;
-}
-$reflect = new ReflectionFunction('ReflectionParameterTest');
-foreach($reflect->getParameters() as $param) {
-	if($param->getName() == 'test1') {
-		var_dump($param->isDefaultValueConstant());
-	}
-	if($param->getName() == 'test2') {
-		var_dump($param->isDefaultValueConstant());
-	}
-	if($param->isDefaultValueAvailable() && $param->isDefaultValueConstant()) {
-		var_dump($param->getDefaultValueConstantName());
-	}
-}
-
-class Foo2 {
-	const bar = 'Foo2::bar';
-}
-
-class Foo {
-	const bar = 'Foo::bar';
-
-	public function baz($param1 = self::bar, $param2=Foo2::bar, $param3=CONST_TEST_1) {
-	}
-}
-
-$method = new ReflectionMethod('Foo', 'baz');
-$params = $method->getParameters();
-
-foreach ($params as $param) {
-    if ($param->isDefaultValueConstant()) {
-        var_dump($param->getDefaultValueConstantName());
-    }
-}
-?>
-==DONE==
---EXPECT--
-bool(false)
-bool(true)
-string(12) "CONST_TEST_1"
-string(9) "self::bar"
-string(9) "Foo2::bar"
-string(12) "CONST_TEST_1"
-==DONE==
diff --git a/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic2.phpt b/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic2.phpt
deleted file mode 100644
index 1ee9e93..0000000
--- a/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic2.phpt
+++ /dev/null
@@ -1,30 +0,0 @@
---TEST--
-ReflectionParameter::isDefaultValueConstant() && getDefaultValueConstantName() for namespace
---FILE--
-<?php
-
-namespace ReflectionTestNamespace {
-	CONST TEST_CONST_1 = "Test Const 1";
-
-	class TestClass {
-		const TEST_CONST_2 = "Test Const 2 in class";
-	}
-}
-
-namespace {
-	function ReflectionParameterTest($test=ReflectionTestNamespace\TestClass::TEST_CONST_2, $test2 = ReflectionTestNamespace\CONST_TEST_1) {
-		echo $test;
-	}
-	$reflect = new ReflectionFunction('ReflectionParameterTest');
-	foreach($reflect->getParameters() as $param) {
-		if($param->isDefaultValueAvailable() && $param->isDefaultValueConstant()) {
-			echo $param->getDefaultValueConstantName() . "\n";
-		}
-	}
-	echo "==DONE==";
-}
-?>
---EXPECT--
-ReflectionTestNamespace\TestClass::TEST_CONST_2
-ReflectionTestNamespace\CONST_TEST_1
-==DONE==
diff --git a/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_error.phpt b/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_error.phpt
deleted file mode 100644
index 984b06e..0000000
--- a/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_error.phpt
+++ /dev/null
@@ -1,25 +0,0 @@
---TEST--
-ReflectionParameter::getDefaultValueConstant() should raise exception on non optional parameter
---FILE--
-<?php
-
-define("CONST_TEST_1", "const1");
-
-function ReflectionParameterTest($test, $test2 = CONST_TEST_1) {
-	echo $test;
-}
-$reflect = new ReflectionFunction('ReflectionParameterTest');
-foreach($reflect->getParameters() as $param) {
-	try {
-		echo $param->getDefaultValueConstantName() . "\n";
-	}
-	catch(ReflectionException $e) {
-		echo $e->getMessage() . "\n";
-	}
-}
-?>
-==DONE==
---EXPECT--
-Parameter is not optional
-CONST_TEST_1
-==DONE==


commit f733173b1f70acec4f124f3c8e9dc1b3fb422413
Author: Xinchen Hui <laruence at php.net>
Date:   Wed May 23 13:43:49 2012 +0800

    Fix typo while resolving conflicts

diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index fe65731..8141275 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -2413,7 +2413,7 @@ ZEND_METHOD(reflection_parameter, getDefaultValue)
 		return;
 	}
 	precv = _get_recv_op((zend_op_array*)param->fptr, param->offset);
-	if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2_type == IS_UNUSED) {
+	if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2.op_type == IS_UNUSED) {
 		zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Internal error");
 		return;
 	}


commit a7df6ce664e6fe85555601531d90318082bb6597
Author: Xinchen Hui <laruence at php.net>
Date:   Wed May 23 13:39:00 2012 +0800

    Revert "Implemented FR #61602 Allow access to name of constant used as default value"
    
    This reverts commit 054f3e3ce5af13c2c3a6ccd54f7dc3e2f6cd4f74.
    
    See: http://news.php.net/php.cvs/69137 and the author confirmed.
    Will commit later after the author fixed this then make a new PR.
    
    Conflicts:
    
    	ext/reflection/php_reflection.c

diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 522fef1..fe65731 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -2409,12 +2409,12 @@ ZEND_METHOD(reflection_parameter, getDefaultValue)
 		return;
 	}
 	if (param->offset < param->required) {
-		zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Parameter is not optional"); 
+		zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Parameter is not optional");
 		return;
 	}
 	precv = _get_recv_op((zend_op_array*)param->fptr, param->offset);
-	if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2.op_type == IS_UNUSED) {
-		zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Internal error"); 
+	if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2_type == IS_UNUSED) {
+		zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Internal error");
 		return;
 	}
 


commit 163099ae0e6f01a1aac67ca84c3ce3b1f2409ae8
Merge: 085e6a9 29876c5
Author: Anatoliy Belsky <ab at php.net>
Date:   Tue May 22 18:52:37 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug #62109 tests\basic\bug46313-win.phpt fails
      - Fixed bug #61045 (fpm don't send error log to fastcgi clients)
      add news for new pg_ functions
    
    Conflicts:
    	UPGRADING



commit 29876c5c29e737158ecfeb32a59b5bfb0607723b
Merge: bdf0c9c 621fdda
Author: Anatoliy Belsky <ab at php.net>
Date:   Tue May 22 18:43:10 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug #62109 tests\basic\bug46313-win.phpt fails
      - Fixed bug #61045 (fpm don't send error log to fastcgi clients)



commit 621fddab93468219aafb0392c7056e551defa1fa
Author: Anatoliy Belsky <ab at php.net>
Date:   Tue May 22 18:41:03 2012 +0200

    Fix bug #62109 tests\basic\bug46313-win.phpt fails

diff --git a/tests/basic/bug46313-win.phpt b/tests/basic/bug46313-win.phpt
index 87786d4..350134e 100644
--- a/tests/basic/bug46313-win.phpt
+++ b/tests/basic/bug46313-win.phpt
@@ -6,6 +6,7 @@ Bug #46313 (Magic quotes broke $_FILES)
 magic_quotes_gpc=1
 file_uploads=1
 register_globals=1
+display_errors=0
 --POST_RAW--
 Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
 -----------------------------20896060251896012921717172737
@@ -26,19 +27,19 @@ var_dump($GLOBALS["o1\'file_name"]);
 var_dump($GLOBALS["o1\'file_name"] === $_FILES["o1\'file"]["name"]);
 var_dump($GLOBALS["o1\'file"]);
 var_dump($GLOBALS["o1\'file"] === $_FILES["o1\'file"]["tmp_name"]);
+/* The windows policy is walking to the last (single)quote in a file name and taking the remain.
+   This way some'file.gif becomes file.gif */
 ?>
 --EXPECTF--
-Deprecated: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
-Deprecated: Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater in Unknown on line 0
 array(2) {
   ["o1\'file"]=>
   array(5) {
     ["name"]=>
-    string(12) "o1"
+    string(8) "file.png"
     ["type"]=>
     string(16) "text/plain-file1"
     ["tmp_name"]=>
-    string(14) "%s"
+    string(%d) "%s.tmp"
     ["error"]=>
     int(0)
     ["size"]=>
@@ -47,18 +48,18 @@ array(2) {
   ["o2\'file"]=>
   array(5) {
     ["name"]=>
-    string(13) "o2"
+    string(9) "file2.txt"
     ["type"]=>
     string(16) "text/plain-file2"
     ["tmp_name"]=>
-    string(14) "%s"
+    string(%d) "%s.tmp"
     ["error"]=>
     int(0)
     ["size"]=>
     int(1)
   }
 }
-string(12) "o1"
+string(8) "file.png"
 bool(true)
 string(%d) "%s"
 bool(true)


commit bdf0c9ccbe2fc96fbd12467dc1666ca1ac7c2c6b
Merge: dce2590 a472649
Author: Jerome Loyet <fat at php.net>
Date:   Tue May 22 08:47:40 2012 +0200

    Merge branch 'PHP-5.4' of git.php.net:php-src into PHP-5.4
    
    * 'PHP-5.4' of git.php.net:php-src:
      add news for new pg_ functions



commit 085e6a9f3b6abc897577e7469ad92c15cd99fac1
Merge: 1d14860 dce2590
Author: Jerome Loyet <fat at php.net>
Date:   Tue May 22 08:42:17 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      - Fixed bug #61045 (fpm don't send error log to fastcgi clients)
      - fix NEWS for bug #61812



commit dce259099df6505bb82b63700e4d14832b74e8c1
Author: Jerome Loyet <fat at php.net>
Date:   Tue May 22 08:40:37 2012 +0200

    - Fixed bug #61045 (fpm don't send error log to fastcgi clients)

diff --git a/NEWS b/NEWS
index dd31dde..ba0b220 100644
--- a/NEWS
+++ b/NEWS
@@ -54,10 +54,13 @@ PHP                                                                        NEWS
   . Implemented FR #61602 (Allow access to the name of constant
     used as function/method parameter's default value). (reeze.xia at gmail.com)
 
-- FPM
+- Fileinfo
   . Fixed bug #61812 (Uninitialised value used in libmagic). 
     (Laruence, Gustavo)
 
+- FPM
+  . Fixed bug #61045 (fpm don't send error log to fastcgi clients). (fat)
+
 - Libxml:
   . Fixed bug #61617 (Libxml tests failed(ht is already destroyed)).
     (Laruence)
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index 14dccbd..a28af53 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -646,12 +646,38 @@ static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC)
 	}
 }
 
-static void sapi_cgi_log_message(char *message TSRMLS_DC)
+/* {{{ sapi_cgi_log_fastcgi
+ *
+ * Ignore level, we want to send all messages through fastcgi
+ */
+void sapi_cgi_log_fastcgi(int level, char *message, size_t len)
 {
-	if (CGIG(fcgi_logging)) {
-		zlog(ZLOG_NOTICE, "PHP message: %s", message);
+	TSRMLS_FETCH();
+
+	fcgi_request *request = (fcgi_request*) SG(server_context);
+
+	/* ensure we want:
+	 * - to log (fastcgi.logging in php.ini)
+	 * - we are currently dealing with a request
+	 * - the message is not empty
+	 */
+	if (CGIG(fcgi_logging) && request && message && len > 0) {
+		char *buf = malloc(len + 2);
+		memcpy(buf, message, len);
+		memcpy(buf + len, "\n", sizeof("\n"));
+		fcgi_write(request, FCGI_STDERR, buf, len+1);
+		free(buf);
 	}
 }
+/* }}} */
+
+/* {{{ sapi_cgi_log_message
+ */
+static void sapi_cgi_log_message(char *message)
+{
+	zlog(ZLOG_NOTICE, "PHP message: %s", message);
+}
+/* }}} */
 
 /* {{{ php_cgi_ini_activate_user_config
  */
@@ -1772,6 +1798,9 @@ consult the installation file that came with this distribution, or visit \n\
 	fcgi_fd = fpm_run(&max_requests);
 	parent = 0;
 
+	/* onced forked tell zlog to also send messages through sapi_cgi_log_fastcgi() */
+	zlog_set_external_logger(sapi_cgi_log_fastcgi);
+
 	/* make php call us to get _ENV vars */
 	php_php_import_environment_variables = php_import_environment_variables;
 	php_import_environment_variables = cgi_php_import_environment_variables;
diff --git a/sapi/fpm/fpm/zlog.c b/sapi/fpm/fpm/zlog.c
index b127ec1..80db9d8 100644
--- a/sapi/fpm/fpm/zlog.c
+++ b/sapi/fpm/fpm/zlog.c
@@ -22,6 +22,7 @@
 static int zlog_fd = -1;
 static int zlog_level = ZLOG_NOTICE;
 static int launched = 0;
+static void (*external_logger)(int, char *, size_t) = NULL;
 
 static const char *level_names[] = {
 	[ZLOG_DEBUG]   = "DEBUG",
@@ -41,6 +42,12 @@ const int syslog_priorities[] = {
 };
 #endif
 
+void zlog_set_external_logger(void (*logger)(int, char *, size_t)) /* {{{ */
+{
+	external_logger = logger;
+}
+/* }}} */
+
 const char *zlog_get_level_name(int log_level) /* {{{ */
 {
 	if (log_level < 0) {
@@ -101,6 +108,19 @@ void zlog_ex(const char *function, int line, int flags, const char *fmt, ...) /*
 	int truncated = 0;
 	int saved_errno;
 
+	if (external_logger) {
+		va_start(args, fmt);
+		len = vsnprintf(buf, buf_size, fmt, args);
+		va_end(args);
+		if (len >= buf_size) {
+			memcpy(buf + buf_size - sizeof("..."), "...", sizeof("...") - 1);
+			len = buf_size - 1;
+		}
+		external_logger(flags & ZLOG_LEVEL_MASK, buf, len);
+		len = 0;
+		memset(buf, '\0', buf_size);
+	}
+
 	if ((flags & ZLOG_LEVEL_MASK) < zlog_level) {
 		return;
 	}
diff --git a/sapi/fpm/fpm/zlog.h b/sapi/fpm/fpm/zlog.h
index e6a5c01..1945922 100644
--- a/sapi/fpm/fpm/zlog.h
+++ b/sapi/fpm/fpm/zlog.h
@@ -9,6 +9,7 @@
 
 struct timeval;
 
+void zlog_set_external_logger(void (*logger)(int, char *, size_t));
 int zlog_set_fd(int new_fd);
 int zlog_set_level(int new_value);
 const char *zlog_get_level_name(int log_level);


commit d1e529c1cba17bed376833ab0a4c785a251abf02
Author: Jerome Loyet <fat at php.net>
Date:   Tue May 22 08:38:09 2012 +0200

    - fix NEWS for bug #61812

diff --git a/NEWS b/NEWS
index 68f0a35..dd31dde 100644
--- a/NEWS
+++ b/NEWS
@@ -47,6 +47,9 @@ PHP                                                                        NEWS
 - Phar:
   . Fix bug #61065 (Secunia SA44335). (Rasmus)
 
+- Pgsql:
+  . Added pg_escape_identifier/pg_escape_literal. (Yasuo Ohgaki)
+
 - Reflection:
   . Implemented FR #61602 (Allow access to the name of constant
     used as function/method parameter's default value). (reeze.xia at gmail.com)


commit faca4e08b4dffbf00b1bc20fc5d4e310b3f99c13
Author: Jerome Loyet <fat at php.net>
Date:   Tue May 22 08:34:27 2012 +0200

    - Fixed bug #61045 (fpm don't send error log to fastcgi clients)

diff --git a/NEWS b/NEWS
index 5f1146a..d6ac422 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,9 @@ PHP                                                                        NEWS
 
 ?? ??? 2012, PHP 5.3.14
 
+- FPM
+  . Fixed bug #61045 (fpm don't send error log to fastcgi clients). (fat)
+
 - XML Writer:
   . Fixed bug #62064 (memory leak in the XML Writer module). 
     (jean-pierre dot lozi at lip6 dot fr)
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index 1ebeefa..5767971 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -655,14 +655,38 @@ static void sapi_cgi_register_variables(zval *track_vars_array TSRMLS_DC)
 	}
 }
 
-static void sapi_cgi_log_message(char *message)
+/* {{{ sapi_cgi_log_fastcgi
+ *
+ * Ignore level, we want to send all messages through fastcgi
+ */
+void sapi_cgi_log_fastcgi(int level, char *message, size_t len)
 {
 	TSRMLS_FETCH();
 
-	if (CGIG(fcgi_logging)) {
-		zlog(ZLOG_NOTICE, "PHP message: %s", message);
+	fcgi_request *request = (fcgi_request*) SG(server_context);
+
+	/* ensure we want:
+	 * - to log (fastcgi.logging in php.ini)
+	 * - we are currently dealing with a request
+	 * - the message is not empty
+	 */
+	if (CGIG(fcgi_logging) && request && message && len > 0) {
+		char *buf = malloc(len + 2);
+		memcpy(buf, message, len);
+		memcpy(buf + len, "\n", sizeof("\n"));
+		fcgi_write(request, FCGI_STDERR, buf, len+1);
+		free(buf);
 	}
 }
+/* }}} */
+
+/* {{{ sapi_cgi_log_message
+ */
+static void sapi_cgi_log_message(char *message)
+{
+	zlog(ZLOG_NOTICE, "PHP message: %s", message);
+}
+/* }}} */
 
 /* {{{ php_cgi_ini_activate_user_config
  */
@@ -1778,6 +1802,9 @@ consult the installation file that came with this distribution, or visit \n\
 	fcgi_fd = fpm_run(&max_requests);
 	parent = 0;
 
+	/* onced forked tell zlog to also send messages through sapi_cgi_log_fastcgi() */
+	zlog_set_external_logger(sapi_cgi_log_fastcgi);
+
 	/* make php call us to get _ENV vars */
 	php_php_import_environment_variables = php_import_environment_variables;
 	php_import_environment_variables = cgi_php_import_environment_variables;
diff --git a/sapi/fpm/fpm/zlog.c b/sapi/fpm/fpm/zlog.c
index b127ec1..80db9d8 100644
--- a/sapi/fpm/fpm/zlog.c
+++ b/sapi/fpm/fpm/zlog.c
@@ -22,6 +22,7 @@
 static int zlog_fd = -1;
 static int zlog_level = ZLOG_NOTICE;
 static int launched = 0;
+static void (*external_logger)(int, char *, size_t) = NULL;
 
 static const char *level_names[] = {
 	[ZLOG_DEBUG]   = "DEBUG",
@@ -41,6 +42,12 @@ const int syslog_priorities[] = {
 };
 #endif
 
+void zlog_set_external_logger(void (*logger)(int, char *, size_t)) /* {{{ */
+{
+	external_logger = logger;
+}
+/* }}} */
+
 const char *zlog_get_level_name(int log_level) /* {{{ */
 {
 	if (log_level < 0) {
@@ -101,6 +108,19 @@ void zlog_ex(const char *function, int line, int flags, const char *fmt, ...) /*
 	int truncated = 0;
 	int saved_errno;
 
+	if (external_logger) {
+		va_start(args, fmt);
+		len = vsnprintf(buf, buf_size, fmt, args);
+		va_end(args);
+		if (len >= buf_size) {
+			memcpy(buf + buf_size - sizeof("..."), "...", sizeof("...") - 1);
+			len = buf_size - 1;
+		}
+		external_logger(flags & ZLOG_LEVEL_MASK, buf, len);
+		len = 0;
+		memset(buf, '\0', buf_size);
+	}
+
 	if ((flags & ZLOG_LEVEL_MASK) < zlog_level) {
 		return;
 	}
diff --git a/sapi/fpm/fpm/zlog.h b/sapi/fpm/fpm/zlog.h
index e6a5c01..1945922 100644
--- a/sapi/fpm/fpm/zlog.h
+++ b/sapi/fpm/fpm/zlog.h
@@ -9,6 +9,7 @@
 
 struct timeval;
 
+void zlog_set_external_logger(void (*logger)(int, char *, size_t));
 int zlog_set_fd(int new_fd);
 int zlog_set_level(int new_value);
 const char *zlog_get_level_name(int log_level);


commit a472649016688551429df9ee9a2f7d3706dd7c3a
Author: Stanislav Malyshev <stas at php.net>
Date:   Mon May 21 16:12:38 2012 -0700

    add news for new pg_ functions

diff --git a/NEWS b/NEWS
index 68f0a35..dd31dde 100644
--- a/NEWS
+++ b/NEWS
@@ -47,6 +47,9 @@ PHP                                                                        NEWS
 - Phar:
   . Fix bug #61065 (Secunia SA44335). (Rasmus)
 
+- Pgsql:
+  . Added pg_escape_identifier/pg_escape_literal. (Yasuo Ohgaki)
+
 - Reflection:
   . Implemented FR #61602 (Allow access to the name of constant
     used as function/method parameter's default value). (reeze.xia at gmail.com)
diff --git a/UPGRADING b/UPGRADING
index 03222ae..3a97b10 100755
--- a/UPGRADING
+++ b/UPGRADING
@@ -610,6 +610,10 @@ c. New functions
     - mysqli_error_list()
     - mysqli_stmt_error_list()
 
+  - pgsql
+    - pg_escape_identifier() (5.4.4)
+    - pg_escape_literal() (5.4.4)
+
   - Session:
     - session_register_shutdown()
     - session_status()


commit 1d1486016a6b2be2e7765fed0a425c22370c72bf
Merge: 9126bc7 074d361
Author: Felipe Pena <felipensp at gmail.com>
Date:   Mon May 21 08:55:05 2012 -0300

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      - Fix the fix (typo s/AIX/_AIX/g)



commit 074d361d647b0fba334e5e14d3b6904ba1ea09d8
Author: Felipe Pena <felipensp at gmail.com>
Date:   Mon May 21 08:54:59 2012 -0300

    - Fix the fix (typo s/AIX/_AIX/g)

diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c
index 5863767..0d17142 100644
--- a/ext/sockets/sockets.c
+++ b/ext/sockets/sockets.c
@@ -77,7 +77,7 @@
 # define IS_INVALID_SOCKET(a)	(a->bsd_socket < 0)
 # define set_errno(a) (errno = a)
 # include "php_sockets.h"
-# if defined(AIX) && !defined(HAVE_SA_SS_FAMILY)
+# if defined(_AIX) && !defined(HAVE_SA_SS_FAMILY)
 # define ss_family __ss_family
 # endif
 # if HAVE_IF_NAMETOINDEX


commit 9126bc790a6d386390e4d6e93ae25dc71690de03
Merge: fba724d 4c9a11c
Author: Xinchen Hui <laruence at php.net>
Date:   Mon May 21 19:06:50 2012 +0800

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Use free instead of efree



commit 4c9a11c85722a888c2bbdf3bf200b90d5c70d13f
Author: Xinchen Hui <laruence at php.net>
Date:   Mon May 21 19:02:45 2012 +0800

    Use free instead of efree

diff --git a/Zend/zend_multibyte.c b/Zend/zend_multibyte.c
index 9149fdc..379f50b 100644
--- a/Zend/zend_multibyte.c
+++ b/Zend/zend_multibyte.c
@@ -168,7 +168,7 @@ ZEND_API const zend_encoding *zend_multibyte_get_script_encoding(TSRMLS_D)
 ZEND_API int zend_multibyte_set_script_encoding(const zend_encoding **encoding_list, size_t encoding_list_size TSRMLS_DC)
 {
 	if (CG(script_encoding_list)) {
-		efree(CG(script_encoding_list));
+		free(CG(script_encoding_list));
 	}
 	CG(script_encoding_list) = encoding_list;
 	CG(script_encoding_list_size) = encoding_list_size;


commit fba724d2f7678d1e59b2d1c095be69957abc5b61
Merge: 60aebdf bbcea23
Author: Xinchen Hui <laruence at php.net>
Date:   Mon May 21 18:59:16 2012 +0800

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Use emalloc instead of malloc



commit bbcea230e1b3c48cfe0097fca84f4bd9f0dfa31f
Author: Xinchen Hui <laruence at php.net>
Date:   Mon May 21 18:58:19 2012 +0800

    Use emalloc instead of malloc

diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index b7e7cd3..28f9824 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -4077,14 +4077,14 @@ static void zend_do_traits_method_binding(zend_class_entry *ce TSRMLS_DC) /* {{{
 	size_t i;
 
 	/* prepare copies of trait function tables for combination */
-	function_tables = malloc(sizeof(HashTable*) * ce->num_traits);
-	resulting_table = (HashTable *) malloc(sizeof(HashTable));
+	function_tables = emalloc(sizeof(HashTable*) * ce->num_traits);
+	resulting_table = (HashTable *)emalloc(sizeof(HashTable));
 	
 	/* TODO: revisit this start size, may be its not optimal */
-	zend_hash_init_ex(resulting_table, 10, NULL, NULL, 1, 0);
+	zend_hash_init_ex(resulting_table, 10, NULL, NULL, 0, 0);
   
 	for (i = 0; i < ce->num_traits; i++) {
-		function_tables[i] = (HashTable *) malloc(sizeof(HashTable));
+		function_tables[i] = (HashTable *)emalloc(sizeof(HashTable));
 		zend_hash_init_ex(function_tables[i], ce->traits[i]->function_table.nNumOfElements, NULL, NULL, 1, 0);
 
 		if (ce->trait_precedences) {
@@ -4117,14 +4117,14 @@ static void zend_do_traits_method_binding(zend_class_entry *ce TSRMLS_DC) /* {{{
 	for (i = 0; i < ce->num_traits; i++) {
 		/* zend_hash_destroy(function_tables[i]); */
 		zend_hash_graceful_destroy(function_tables[i]);
-		free(function_tables[i]);
+		efree(function_tables[i]);
 	}
-	free(function_tables);
+	efree(function_tables);
 
 	/* free temporary resulting table */
 	/* zend_hash_destroy(resulting_table); */
 	zend_hash_graceful_destroy(resulting_table);
-	free(resulting_table);
+	efree(resulting_table);
 }
 /* }}} */
 


commit 60aebdf6e81b8b24aa5c59ccb51a6fdd49222e13
Merge: 230f9e8 fbb86bd
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon May 21 12:52:33 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug #62066 Test Bug - ext/tidy/tests/004.phpt



commit fbb86bd7b3c7425a64bb2f76532f937b3a050ea1
Merge: 77e70b3 c973fef
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon May 21 12:52:10 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug #62066 Test Bug - ext/tidy/tests/004.phpt



commit c973fef48d6302b9bcec898de8e39d8d7e23adef
Author: Matt Ficken <mattficken at php.net>
Date:   Mon May 21 12:51:24 2012 +0200

    Fix bug #62066 Test Bug - ext/tidy/tests/004.phpt

diff --git a/ext/tidy/tests/004.phpt b/ext/tidy/tests/004.phpt
index 7ca17c6..d13c37d 100644
--- a/ext/tidy/tests/004.phpt
+++ b/ext/tidy/tests/004.phpt
@@ -6,7 +6,7 @@ tidy_diagnose()
 <?php 
 $a = tidy_parse_string('<HTML></HTML>');
 var_dump(tidy_diagnose($a));
-echo tidy_get_error_buffer($a);
+echo str_replace("\r", "", tidy_get_error_buffer($a));
 
 $html = <<< HTML
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">


commit 230f9e87339d9e29f70af9cde47794c5750493ab
Merge: 90e2310 77e70b3
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon May 21 12:38:43 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fixed bug #62068 Test bug - gmp_nextprime and 022
      Fix: 62067 Moved comments to FILE section
      - BFN



commit 77e70b391c9aada03c149fe04eb275ee54fb36dc
Merge: 2ae8d2f 645d65f
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon May 21 12:37:59 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fixed bug #62068 Test bug - gmp_nextprime and 022
      Fix: 62067 Moved comments to FILE section
      - BFN
    
    Conflicts:
    	NEWS



commit 645d65f3e30788c0f7d88e753d90234867622a01
Author: Matt Ficken <mattficken at php.net>
Date:   Mon May 21 12:31:16 2012 +0200

    Fixed bug #62068 Test bug - gmp_nextprime and 022

diff --git a/ext/gmp/tests/022-win32.phpt b/ext/gmp/tests/022-win32.phpt
new file mode 100644
index 0000000..7abb0e8
--- /dev/null
+++ b/ext/gmp/tests/022-win32.phpt
@@ -0,0 +1,90 @@
+--TEST--
+gmp_gcdext() basic tests
+--SKIPIF--
+<?php if (!extension_loaded("gmp")) print "skip"; 
+if(substr(PHP_OS, 0, 3) != 'WIN' ) {
+    die('skip windows only test');
+}
+?>
+--FILE--
+<?php
+
+$n = gmp_init("34293864345");
+$n1 = gmp_init("23434293864345");
+
+$a = array(
+	array(123,45),
+	array(4341,9734),
+	array(23487,333),
+	array(-234234,-123123),
+	array(-100,-2234),
+	array(345,"34587345"),
+	array(345,"0"),
+	array("345556456",345873),
+	array("34545345556456","323432445873"),
+	array($n, $n1),
+	);
+
+foreach ($a as $val) {
+	$r = gmp_gcdext($val[0],$val[1]);
+	var_dump(gmp_strval($r['g']));
+	var_dump(gmp_strval($r['s']));
+	var_dump(gmp_strval($r['t']));
+}
+
+var_dump(gmp_gcdext($val[0],array()));
+var_dump(gmp_gcdext(array(),array()));
+var_dump(gmp_gcdext(array(),array(),1));
+var_dump(gmp_gcdext(array()));
+var_dump(gmp_gcdext());
+
+echo "Done\n";
+?>
+--EXPECTF--	
+string(1) "3"
+string(2) "41"
+string(4) "-112"
+string(1) "1"
+string(4) "-805"
+string(3) "359"
+string(1) "3"
+string(2) "32"
+string(5) "-2257"
+string(4) "3003"
+string(3) "-10"
+string(2) "19"
+string(1) "2"
+string(2) "67"
+string(2) "-3"
+string(2) "15"
+string(7) "-601519"
+string(1) "6"
+string(3) "345"
+string(1) "1"
+string(1) "0"
+string(1) "1"
+string(5) "84319"
+string(9) "-84241831"
+string(1) "1"
+string(12) "167180205823"
+string(15) "-17856272782919"
+string(3) "195"
+string(15) "-23387298979862"
+string(11) "34225091793"
+
+Warning: gmp_gcdext(): Unable to convert variable to GMP - wrong type in %s on line %d
+bool(false)
+
+Warning: gmp_gcdext(): Unable to convert variable to GMP - wrong type in %s on line %d
+bool(false)
+
+Warning: gmp_gcdext() expects exactly 2 parameters, 3 given in %s on line %d
+NULL
+
+Warning: gmp_gcdext() expects exactly 2 parameters, 1 given in %s on line %d
+NULL
+
+Warning: gmp_gcdext() expects exactly 2 parameters, 0 given in %s on line %d
+NULL
+Done
+
diff --git a/ext/gmp/tests/022.phpt b/ext/gmp/tests/022.phpt
index 805c9b6..f699e82 100644
--- a/ext/gmp/tests/022.phpt
+++ b/ext/gmp/tests/022.phpt
@@ -1,7 +1,11 @@
 --TEST--
 gmp_gcdext() basic tests
 --SKIPIF--
-<?php if (!extension_loaded("gmp")) print "skip"; ?>
+<?php if (!extension_loaded("gmp")) print "skip";
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+    die('skip.. only for Non Windows Systems');
+}
+?>
 --FILE--
 <?php
 
diff --git a/ext/gmp/tests/gmp_nextprime-win32.phpt b/ext/gmp/tests/gmp_nextprime-win32.phpt
new file mode 100644
index 0000000..e725315
--- /dev/null
+++ b/ext/gmp/tests/gmp_nextprime-win32.phpt
@@ -0,0 +1,45 @@
+--TEST--
+gmp_nextprime()
+--SKIPIF--
+<?php if (!extension_loaded("gmp")) print "skip"; 
+if(substr(PHP_OS, 0, 3) != 'WIN' ) {
+    die('skip windows only test');
+}
+?>
+--FILE--
+<?php
+
+$n = gmp_nextprime(-1);
+var_dump(gmp_strval($n));
+$n = gmp_nextprime(0);
+var_dump(gmp_strval($n));
+$n = gmp_nextprime(-1000);
+var_dump(gmp_strval($n));
+$n = gmp_nextprime(1000);
+var_dump(gmp_strval($n));
+$n = gmp_nextprime(100000);
+var_dump(gmp_strval($n));
+$n = gmp_nextprime(array());
+var_dump(gmp_strval($n));
+$n = gmp_nextprime("");
+var_dump(gmp_strval($n));
+$n = gmp_nextprime(new stdclass());
+var_dump(gmp_strval($n));
+	
+echo "Done\n";
+?>
+--EXPECTF--	
+string(1) "2"
+string(1) "2"
+string(4) "-997"
+string(4) "1009"
+string(6) "100003"
+
+Warning: gmp_nextprime(): Unable to convert variable to GMP - wrong type in %s on line %d
+string(1) "0"
+string(1) "0"
+
+Warning: gmp_nextprime(): Unable to convert variable to GMP - wrong type in %s on line %d
+string(1) "0"
+Done
+
diff --git a/ext/gmp/tests/gmp_nextprime.phpt b/ext/gmp/tests/gmp_nextprime.phpt
index 65506ce..623ccbe 100644
--- a/ext/gmp/tests/gmp_nextprime.phpt
+++ b/ext/gmp/tests/gmp_nextprime.phpt
@@ -1,7 +1,11 @@
 --TEST--
 gmp_nextprime()
 --SKIPIF--
-<?php if (!extension_loaded("gmp")) print "skip"; ?>
+<?php if (!extension_loaded("gmp")) print "skip";
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+    die('skip.. only for Non Windows Systems');
+}
+?>
 --FILE--
 <?php
 


commit 90e23107a2acba1fd53b7e799372eb9f24194a56
Merge: 7632a32 2ae8d2f
Author: Dmitry Stogov <dmitry at zend.com>
Date:   Mon May 21 14:04:33 2012 +0400

    Fixed bug #61998 (Using traits with method aliases appears to result in crash during execution)



commit 2ae8d2fbfb8797b1038ad64c267ee0797f977671
Author: Dmitry Stogov <dmitry at zend.com>
Date:   Mon May 21 13:57:41 2012 +0400

    Fixed bug #61998 (Using traits with method aliases appears to result in crash during execution)

diff --git a/NEWS b/NEWS
index 1a87234..68f0a35 100644
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,8 @@ PHP                                                                        NEWS
   . Fixed missing bound check in iptcparse(). (chris at chiappa.net)
   . Fixed bug #62005 (unexpected behavior when incrementally assigning to a 
     member of a null object). (Laruence)
+  . Fixed bug #61998 (Using traits with method aliases appears to result in
+    crash during execution). (Dmitry)
   . Fixed bug #61978 (Object recursion not detected for classes that implement
     JsonSerializable). (Felipe)
   . Fixed bug #61991 (long overflow in realpath_cache_get()). (Anatoliy)
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 602b600..b7e7cd3 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -3619,6 +3619,7 @@ ZEND_API void zend_do_implement_trait(zend_class_entry *ce, zend_class_entry *tr
 			}
 		}
 		ce->traits[ce->num_traits++] = trait;
+		trait->refcount++;
 	}
 }
 /* }}} */
@@ -3870,8 +3871,8 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args,
 				fn_copy = *fn;
 				function_add_ref(&fn_copy);
 				/* this function_name is never destroyed, because its refcount
-				   greater than 1, classes are always destoyed in reverse order
-				   and trait is declared early than this class */
+				   greater than 1 and classes are always destoyed before the
+				   traits they use */
 				fn_copy.common.function_name = aliases[i]->alias;
 					
 				/* if it is 0, no modifieres has been changed */
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c
index 65fa851..19fd71e 100644
--- a/Zend/zend_opcode.c
+++ b/Zend/zend_opcode.c
@@ -215,6 +215,12 @@ ZEND_API int zend_cleanup_class_data(zend_class_entry **pce TSRMLS_DC)
 void _destroy_zend_class_traits_info(zend_class_entry *ce)
 {
 	if (ce->num_traits > 0 && ce->traits) {
+		size_t i;
+		for (i = 0; i < ce->num_traits; i++) {
+			if (ce->traits[i]) {
+				destroy_zend_class(&ce->traits[i]);
+			}
+		}
 		efree(ce->traits);
 	}
 	


commit c8f47a8e7c36bf57188b6172ffc0fbc6028f3050
Author: Dmitry Stogov <dmitry at zend.com>
Date:   Mon May 21 13:46:07 2012 +0400

    Fixed bug #61998 (Using traits with method aliases appears to result in crash during execution)

diff --git a/Zend/tests/traits/bug61998.phpt b/Zend/tests/traits/bug61998.phpt
new file mode 100644
index 0000000..612caa0
--- /dev/null
+++ b/Zend/tests/traits/bug61998.phpt
@@ -0,0 +1,68 @@
+--TEST--
+Bug #61998 (Using traits with method aliases appears to result in crash during execution)
+--FILE--
+<?php
+class Foo {
+    use T1 {
+       func as newFunc;
+    }
+
+    public function func() {
+        echo "From Foo\n";
+    }
+}
+
+trait T1 { 
+    public function func() {
+        echo "From T1\n";
+    }
+}
+
+class Bar {
+    public function func() {
+        echo "From Bar\n";
+    }
+    public function func2() {
+        echo "From Bar\n";
+    }
+    public function func3() {
+        echo "From Bar\n";
+    }
+    use T1 {
+        func as newFunc;
+        func as func2;
+    }
+    use T2 {
+        func2 as newFunc2;
+        func2 as newFunc3;
+        func2 as func3;
+    }
+}
+
+trait T2 { 
+    public function func2() {
+        echo "From T2\n";
+    }
+}
+
+$f = new Foo();
+
+$f->newFunc(); //from T1
+$f->func(); //from Foo
+
+$b = new Bar();
+$b->newFunc(); //from T1
+$b->func(); //from Bar
+$b->func2(); //from Bar
+$b->newFunc2(); //from T2
+$b->newFunc3(); //from T2
+$b->func3(); //from Bar
+--EXPECTF--
+From T1
+From Foo
+From T1
+From Bar
+From Bar
+From T2
+From T2
+From Bar


commit 7632a32ef94be48c8d4f37bbca7cde458fbf20b9
Author: Dmitry Stogov <dmitry at zend.com>
Date:   Mon May 21 12:53:21 2012 +0400

    Fixed bug #61998 (Using traits with method aliases appears to result in crash during execution)

diff --git a/Zend/tests/traits/bug61998.phpt b/Zend/tests/traits/bug61998.phpt
new file mode 100644
index 0000000..612caa0
--- /dev/null
+++ b/Zend/tests/traits/bug61998.phpt
@@ -0,0 +1,68 @@
+--TEST--
+Bug #61998 (Using traits with method aliases appears to result in crash during execution)
+--FILE--
+<?php
+class Foo {
+    use T1 {
+       func as newFunc;
+    }
+
+    public function func() {
+        echo "From Foo\n";
+    }
+}
+
+trait T1 { 
+    public function func() {
+        echo "From T1\n";
+    }
+}
+
+class Bar {
+    public function func() {
+        echo "From Bar\n";
+    }
+    public function func2() {
+        echo "From Bar\n";
+    }
+    public function func3() {
+        echo "From Bar\n";
+    }
+    use T1 {
+        func as newFunc;
+        func as func2;
+    }
+    use T2 {
+        func2 as newFunc2;
+        func2 as newFunc3;
+        func2 as func3;
+    }
+}
+
+trait T2 { 
+    public function func2() {
+        echo "From T2\n";
+    }
+}
+
+$f = new Foo();
+
+$f->newFunc(); //from T1
+$f->func(); //from Foo
+
+$b = new Bar();
+$b->newFunc(); //from T1
+$b->func(); //from Bar
+$b->func2(); //from Bar
+$b->newFunc2(); //from T2
+$b->newFunc3(); //from T2
+$b->func3(); //from Bar
+--EXPECTF--
+From T1
+From Foo
+From T1
+From Bar
+From Bar
+From T2
+From T2
+From Bar


commit c5fcd9f5af09b69df998a4226f66f2ea320f46db
Author: Felipe Pena <felipensp at gmail.com>
Date:   Sun May 20 19:41:15 2012 -0300

    - BFN

diff --git a/NEWS b/NEWS
index ce906b9..1a87234 100644
--- a/NEWS
+++ b/NEWS
@@ -57,6 +57,9 @@ PHP                                                                        NEWS
   . Fixed bug #61617 (Libxml tests failed(ht is already destroyed)).
     (Laruence)
     
+- Sockets:
+  . Fixed bug #62025 (__ss_family was changed on AIX 5.3). (Felipe)
+    
 - XML Writer:
   . Fixed bug #62064 (memory leak in the XML Writer module). 
     (jean-pierre dot lozi at lip6 dot fr)


commit f3615bc6f7079e8e9c8940a80b011de1e01951d3
Merge: 82740ef ffe8303
Author: Felipe Pena <felipensp at gmail.com>
Date:   Sun May 20 19:39:54 2012 -0300

    - Fixed bug #62025 (__ss_family was changed on AIX 5.3)



commit ffe8303f24bd1db8af1e64e99c9f7edca4940d95
Author: Felipe Pena <felipensp at gmail.com>
Date:   Sun May 20 19:37:20 2012 -0300

    - Fixed bug #62025 (__ss_family was changed on AIX 5.3)

diff --git a/ext/sockets/config.m4 b/ext/sockets/config.m4
index 3fb93ae..4032621 100644
--- a/ext/sockets/config.m4
+++ b/ext/sockets/config.m4
@@ -27,6 +27,21 @@ if test "$PHP_SOCKETS" != "no"; then
     [AC_DEFINE(MISSING_MSGHDR_MSGFLAGS, 1, [ ])]
   )
   AC_DEFINE([HAVE_SOCKETS], 1, [ ])
+  
+  dnl Check for fied ss_family in sockaddr_storage (missing in AIX until 5.3)
+  AC_CACHE_CHECK([for field ss_family in struct sockaddr_storage], ac_cv_ss_family,
+  [
+    AC_TRY_COMPILE([
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <netdb.h>
+  ], [struct sockaddr_storage sa_store; sa_store.ss_family = AF_INET6;],
+     ac_cv_ss_family=yes, ac_cv_ss_family=no)
+  ])
+  
+  if test "$ac_cv_ss_family" = yes; then
+    AC_DEFINE(HAVE_SA_SS_FAMILY,1,[Whether you have sockaddr_storage.ss_family])
+  fi
 
   PHP_NEW_EXTENSION([sockets], [sockets.c multicast.c], [$ext_shared])
   PHP_INSTALL_HEADERS([ext/sockets/], [php_sockets.h])
diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c
index 46d9f8e..5863767 100644
--- a/ext/sockets/sockets.c
+++ b/ext/sockets/sockets.c
@@ -77,6 +77,9 @@
 # define IS_INVALID_SOCKET(a)	(a->bsd_socket < 0)
 # define set_errno(a) (errno = a)
 # include "php_sockets.h"
+# if defined(AIX) && !defined(HAVE_SA_SS_FAMILY)
+# define ss_family __ss_family
+# endif
 # if HAVE_IF_NAMETOINDEX
 #  include <net/if.h>
 # endif


commit 82740ef31e5c8a6497fca6a37637a840ee80b030
Author: Felipe Pena <felipensp at gmail.com>
Date:   Sun May 20 16:17:17 2012 -0300

    - Fixed build using g++ (which complains about jump that crosses initialization)

diff --git a/ext/intl/calendar/calendar_methods.cpp b/ext/intl/calendar/calendar_methods.cpp
index fc0a306..1e8c9e7 100644
--- a/ext/intl/calendar/calendar_methods.cpp
+++ b/ext/intl/calendar/calendar_methods.cpp
@@ -1118,6 +1118,7 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time)
 	int				locale_str_len;
 	TimeZone		*timeZone;
 	UErrorCode		status				= U_ZERO_ERROR;
+	Calendar        *cal;
 	intl_error_reset(NULL TSRMLS_CC);
 
 	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|s!",
@@ -1172,7 +1173,7 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time)
 		locale_str = const_cast<char*>(intl_locale_get_default(TSRMLS_C));
 	}
 
-	Calendar *cal = Calendar::createInstance(timeZone,
+	cal = Calendar::createInstance(timeZone,
 		Locale::createFromName(locale_str), status);
 	if (cal == NULL) {
 		delete timeZone;


commit 6ea4d0d83990a405bf8a92233ddc05adba69b4e1
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Sun May 20 19:57:06 2012 +0100

    Note recent changes to ext/intl in UPGRADING

diff --git a/UPGRADING b/UPGRADING
index 1643bdd..44f7556 100755
--- a/UPGRADING
+++ b/UPGRADING
@@ -106,6 +106,8 @@ PHP X.Y UPGRADE NOTES
   - intlcal_get_skipped_wall_time_option()
   - intlcal_set_repeated_wall_time_option()
   - intlcal_set_skipped_wall_time_option()
+  - intlcal_from_date_time()
+  - intlcal_to_date_time()
   - intlcal_get_error_code()
   - intlcal_get_error_message()
   - intlgregcal_create_instance()
@@ -130,6 +132,8 @@ PHP X.Y UPGRADE NOTES
   - intltz_has_same_rules()
   - intltz_get_display_name()
   - intltz_get_dst_savings()
+  - intltz_from_date_time_zone()
+  - intltz_to_date_time_zone()
   - intltz_get_error_code()
   - intltz_get_error_message()
 
@@ -154,7 +158,10 @@ PHP X.Y UPGRADE NOTES
 8. Other Changes to Extensions
 ========================================
 
-- The intl extension now requires ICU 4.0+.
+- Intl:
+  - This extension now requires ICU 4.0+.
+  - Added intl.use_exceptions INI directive, which controls what happens when
+    global errors are set together with intl.error_level.
 
 ========================================
 9. New Global Constants


commit d9ca243212c73e212e579732876bfb4670e71941
Merge: cd8cf5f 3a81f90
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Sun May 20 19:50:17 2012 +0100

    Merge remote branch 'github/intl_calendar'



commit 867447f4202f845654eb43e39a825b0efb812d36
Author: zoe slattery <zoe at php.net>
Date:   Sat May 19 16:13:25 2012 +0100

    Fix: 62067 Moved comments to FILE section

diff --git a/ext/libxml/tests/bug61367-read.phpt b/ext/libxml/tests/bug61367-read.phpt
index 3deecfc..94da3d8 100644
--- a/ext/libxml/tests/bug61367-read.phpt
+++ b/ext/libxml/tests/bug61367-read.phpt
@@ -4,11 +4,12 @@ Bug #61367: open_basedir bypass in libxml RSHUTDOWN: read test
 <?php if(!extension_loaded('dom')) echo 'skip'; ?>
 --INI--
 open_basedir=.
-; Suppress spurious "Trying to get property of non-object" notices
 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.
+ */
 class StreamExploiter {
 	public function stream_close (  ) {
 		$doc = new DOMDocument;
diff --git a/ext/libxml/tests/bug61367-write.phpt b/ext/libxml/tests/bug61367-write.phpt
index aeed688..e18b071 100644
--- a/ext/libxml/tests/bug61367-write.phpt
+++ b/ext/libxml/tests/bug61367-write.phpt
@@ -4,8 +4,6 @@ Bug #61367: open_basedir bypass in libxml RSHUTDOWN: write test
 <?php if(!extension_loaded('dom')) echo 'skip'; ?>
 --INI--
 open_basedir=.
-; Suppress spurious "Trying to get property of non-object" notices
-error_reporting=E_ALL & ~E_NOTICE
 --FILE--
 <?php
 


commit 778d69ddfe25fae5476e66b6b2ce3b0b8ade68bb
Author: zoe slattery <zoe at php.net>
Date:   Sat May 19 16:13:25 2012 +0100

    Fix: 62067 Moved comments to FILE section

diff --git a/ext/libxml/tests/bug61367-read.phpt b/ext/libxml/tests/bug61367-read.phpt
index 3deecfc..94da3d8 100644
--- a/ext/libxml/tests/bug61367-read.phpt
+++ b/ext/libxml/tests/bug61367-read.phpt
@@ -4,11 +4,12 @@ Bug #61367: open_basedir bypass in libxml RSHUTDOWN: read test
 <?php if(!extension_loaded('dom')) echo 'skip'; ?>
 --INI--
 open_basedir=.
-; Suppress spurious "Trying to get property of non-object" notices
 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.
+ */
 class StreamExploiter {
 	public function stream_close (  ) {
 		$doc = new DOMDocument;
diff --git a/ext/libxml/tests/bug61367-write.phpt b/ext/libxml/tests/bug61367-write.phpt
index aeed688..e18b071 100644
--- a/ext/libxml/tests/bug61367-write.phpt
+++ b/ext/libxml/tests/bug61367-write.phpt
@@ -4,8 +4,6 @@ Bug #61367: open_basedir bypass in libxml RSHUTDOWN: write test
 <?php if(!extension_loaded('dom')) echo 'skip'; ?>
 --INI--
 open_basedir=.
-; Suppress spurious "Trying to get property of non-object" notices
-error_reporting=E_ALL & ~E_NOTICE
 --FILE--
 <?php
 


commit cd8cf5f49584c9716863c9546ae37ec75380cafd
Author: zoe slattery <zoe at php.net>
Date:   Sat May 19 16:13:25 2012 +0100

    Fix: 62067 Moved comments to FILE section

diff --git a/ext/libxml/tests/bug61367-read.phpt b/ext/libxml/tests/bug61367-read.phpt
index 3deecfc..94da3d8 100644
--- a/ext/libxml/tests/bug61367-read.phpt
+++ b/ext/libxml/tests/bug61367-read.phpt
@@ -4,11 +4,12 @@ Bug #61367: open_basedir bypass in libxml RSHUTDOWN: read test
 <?php if(!extension_loaded('dom')) echo 'skip'; ?>
 --INI--
 open_basedir=.
-; Suppress spurious "Trying to get property of non-object" notices
 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.
+ */
 class StreamExploiter {
 	public function stream_close (  ) {
 		$doc = new DOMDocument;
diff --git a/ext/libxml/tests/bug61367-write.phpt b/ext/libxml/tests/bug61367-write.phpt
index aeed688..e18b071 100644
--- a/ext/libxml/tests/bug61367-write.phpt
+++ b/ext/libxml/tests/bug61367-write.phpt
@@ -4,8 +4,6 @@ Bug #61367: open_basedir bypass in libxml RSHUTDOWN: write test
 <?php if(!extension_loaded('dom')) echo 'skip'; ?>
 --INI--
 open_basedir=.
-; Suppress spurious "Trying to get property of non-object" notices
-error_reporting=E_ALL & ~E_NOTICE
 --FILE--
 <?php
 


commit c9331a3ef27018a93ce17d0ed87bce3c689e8eec
Author: Felipe Pena <felipensp at gmail.com>
Date:   Fri May 18 21:26:24 2012 -0300

    - BFN

diff --git a/NEWS b/NEWS
index 6b63e90..ce906b9 100644
--- a/NEWS
+++ b/NEWS
@@ -56,6 +56,10 @@ PHP                                                                        NEWS
 - Libxml:
   . Fixed bug #61617 (Libxml tests failed(ht is already destroyed)).
     (Laruence)
+    
+- XML Writer:
+  . Fixed bug #62064 (memory leak in the XML Writer module). 
+    (jean-pierre dot lozi at lip6 dot fr)
 
 - Zlib:
   . Fixed bug #61820 (using ob_gzhandler will complain about headers already 


commit 3b3b3d92290f6cae2ef056fe727f2ffad168f203
Merge: f5e2315 51e3e51
Author: Felipe Pena <felipensp at gmail.com>
Date:   Fri May 18 19:38:52 2012 -0300

    Merge branch 'master' of git.php.net:php-src



commit 79d52503a40e2efba4f27514373eb6cc7273d4ae
Author: Felipe Pena <felipensp at gmail.com>
Date:   Fri May 18 19:38:02 2012 -0300

    - BFN

diff --git a/NEWS b/NEWS
index 7fe462b..5f1146a 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,10 @@ PHP                                                                        NEWS
 
 ?? ??? 2012, PHP 5.3.14
 
+- XML Writer:
+  . Fixed bug #62064 (memory leak in the XML Writer module). 
+    (jean-pierre dot lozi at lip6 dot fr)
+
 (merge after release)
 
 08 May 2012, PHP 5.3.13


commit f5e2315660cbaa0278bb90c2eb5a71a7bdc30405
Author: Felipe Pena <felipensp at gmail.com>
Date:   Fri May 18 19:34:39 2012 -0300

    - Fixed bug #62064 (memory leak in the XML Writer module)

diff --git a/ext/xmlwriter/php_xmlwriter.c b/ext/xmlwriter/php_xmlwriter.c
index 84be01d..0514b17 100644
--- a/ext/xmlwriter/php_xmlwriter.c
+++ b/ext/xmlwriter/php_xmlwriter.c
@@ -614,6 +614,7 @@ static char *_xmlwriter_get_valid_file_path(char *source, char *resolved_path, i
 		/* absolute file uris - libxml only supports localhost or empty host */
 		if (strncasecmp(source, "file:///", 8) == 0) {
 			if (source[sizeof("file:///") - 1] == '\0') {
+				xmlFreeURI(uri);
 				return NULL;
 			}
 			isFileUri = 1;
@@ -624,6 +625,7 @@ static char *_xmlwriter_get_valid_file_path(char *source, char *resolved_path, i
 #endif
 		} else if (strncasecmp(source, "file://localhost/",17) == 0) {
 			if (source[sizeof("file://localhost/") - 1] == '\0') {
+				xmlFreeURI(uri);
 				return NULL;
 			}
 


commit 88275e547fb8c94a9fc23e057dd96f9fc19b3ede
Merge: 29a85d4 6d928fd
Author: Felipe Pena <felipensp at gmail.com>
Date:   Fri May 18 19:23:42 2012 -0300

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      - Fixed bug #62064 (memory leak in the XML Writer module)



commit 6d928fd26d27e00da4a6b812b231ca526ddecaac
Author: Felipe Pena <felipensp at gmail.com>
Date:   Fri May 18 19:23:29 2012 -0300

    - Fixed bug #62064 (memory leak in the XML Writer module)

diff --git a/ext/xmlwriter/php_xmlwriter.c b/ext/xmlwriter/php_xmlwriter.c
index 4ea76da..588ca4b 100644
--- a/ext/xmlwriter/php_xmlwriter.c
+++ b/ext/xmlwriter/php_xmlwriter.c
@@ -616,6 +616,7 @@ static char *_xmlwriter_get_valid_file_path(char *source, char *resolved_path, i
 		/* absolute file uris - libxml only supports localhost or empty host */
 		if (strncasecmp(source, "file:///", 8) == 0) {
 			if (source[sizeof("file:///") - 1] == '\0') {
+				xmlFreeURI(uri);
 				return NULL;
 			}
 			isFileUri = 1;
@@ -626,6 +627,7 @@ static char *_xmlwriter_get_valid_file_path(char *source, char *resolved_path, i
 #endif
 		} else if (strncasecmp(source, "file://localhost/",17) == 0) {
 			if (source[sizeof("file://localhost/") - 1] == '\0') {
+				xmlFreeURI(uri);
 				return NULL;
 			}
 


commit 3a81f90ebc51140484c617539b1a5fb0e117f4e2
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Thu May 17 23:18:51 2012 +0200

    Added IntlCalendar::toDateTime()

diff --git a/ext/intl/calendar/calendar_class.cpp b/ext/intl/calendar/calendar_class.cpp
index 9f5db6f..43cbc4a 100644
--- a/ext/intl/calendar/calendar_class.cpp
+++ b/ext/intl/calendar/calendar_class.cpp
@@ -431,6 +431,7 @@ static const zend_function_entry Calendar_class_functions[] = {
 	PHP_ME_MAPPING(setSkippedWallTimeOption,intlcal_set_skipped_wall_time_option,ainfo_cal_wall_time_option,ZEND_ACC_PUBLIC)
 #endif
 	PHP_ME_MAPPING(fromDateTime,		intlcal_from_date_time,		ainfo_cal_from_date_time,			ZEND_ACC_STATIC | ZEND_ACC_PUBLIC)
+	PHP_ME_MAPPING(toDateTime,			intlcal_to_date_time,		ainfo_cal_void,						ZEND_ACC_PUBLIC)
 	PHP_ME_MAPPING(getErrorCode,		intlcal_get_error_code,		ainfo_cal_void,						ZEND_ACC_PUBLIC)
 	PHP_ME_MAPPING(getErrorMessage,		intlcal_get_error_message,	ainfo_cal_void,						ZEND_ACC_PUBLIC)
 	PHP_FE_END
diff --git a/ext/intl/calendar/calendar_methods.cpp b/ext/intl/calendar/calendar_methods.cpp
index 82ccd80..fc0a306 100644
--- a/ext/intl/calendar/calendar_methods.cpp
+++ b/ext/intl/calendar/calendar_methods.cpp
@@ -1200,6 +1200,86 @@ error:
 	}
 }
 
+U_CFUNC PHP_FUNCTION(intlcal_to_date_time)
+{
+	zval *retval = NULL;
+	CALENDAR_METHOD_INIT_VARS;
+
+	if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O",
+			&object, Calendar_ce_ptr) == FAILURE) {
+		intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
+			"intlcal_to_date_time: bad arguments", 0 TSRMLS_CC);
+		RETURN_FALSE;
+	}
+
+	CALENDAR_METHOD_FETCH_OBJECT;
+
+	/* There are no exported functions in ext/date to this
+	 * in a more native fashion */
+	double	date = co->ucal->getTime(CALENDAR_ERROR_CODE(co)) / 1000.;
+	int64_t	ts;
+	char	ts_str[sizeof("@-9223372036854775808")];
+	int		ts_str_len;
+	zval	ts_zval = zval_used_for_init;
+
+	INTL_METHOD_CHECK_STATUS(co, "Call to ICU method has failed");
+
+	if (date > (double)U_INT64_MAX || date < (double)U_INT64_MIN) {
+		intl_errors_set(CALENDAR_ERROR_P(co), U_ILLEGAL_ARGUMENT_ERROR,
+			"intlcal_to_date_time: The calendar date is out of the "
+			"range for a 64-bit integer", 0 TSRMLS_CC);
+		RETURN_FALSE;
+	}
+	
+	ts = (int64_t)date;
+
+	ts_str_len = slprintf(ts_str, sizeof(ts_str), "@%I64d", ts);
+	ZVAL_STRINGL(&ts_zval, ts_str, ts_str_len, 0);
+
+	/* Now get the time zone */
+	const TimeZone& tz = co->ucal->getTimeZone();
+	zval *timezone_zval = timezone_convert_to_datetimezone(
+		&tz, CALENDAR_ERROR_P(co), "intlcal_to_date_time" TSRMLS_CC);
+	if (timezone_zval == NULL) {
+		RETURN_FALSE;
+	}
+
+	/* resources allocated from now on */
+
+	/* Finally, instantiate object and call constructor */
+	object_init_ex(return_value, php_date_get_date_ce());
+	zend_call_method_with_2_params(&return_value, NULL, NULL, "__construct",
+			NULL, &ts_zval, timezone_zval);
+	if (EG(exception)) {
+		intl_errors_set(CALENDAR_ERROR_P(co), U_ILLEGAL_ARGUMENT_ERROR,
+			"intlcal_to_date_time: DateTime constructor has thrown exception",
+			1 TSRMLS_CC);
+		zend_object_store_ctor_failed(return_value TSRMLS_CC);
+		zval_ptr_dtor(&return_value);
+
+		RETVAL_FALSE;
+		goto error;
+	}
+
+	/* due to bug #40743, we have to set the time zone again */
+	zend_call_method_with_1_params(&return_value, NULL, NULL, "settimezone",
+			&retval, timezone_zval);
+	if (retval == NULL || Z_TYPE_P(retval) == IS_BOOL) {
+		intl_errors_set(CALENDAR_ERROR_P(co), U_ILLEGAL_ARGUMENT_ERROR,
+			"intlcal_to_date_time: call to DateTime::setTimeZone has failed",
+			1 TSRMLS_CC);
+		zval_ptr_dtor(&return_value);
+		RETVAL_FALSE;
+		goto error;
+	}
+
+error:
+	zval_ptr_dtor(&timezone_zval);
+	if (retval != NULL) {
+		zval_ptr_dtor(&retval);
+	}
+}
+
 U_CFUNC PHP_FUNCTION(intlcal_get_error_code)
 {
 	CALENDAR_METHOD_INIT_VARS;
diff --git a/ext/intl/calendar/calendar_methods.h b/ext/intl/calendar/calendar_methods.h
index e005571..2be13e4 100644
--- a/ext/intl/calendar/calendar_methods.h
+++ b/ext/intl/calendar/calendar_methods.h
@@ -103,6 +103,8 @@ PHP_FUNCTION(intlcal_set_skipped_wall_time_option);
 
 PHP_FUNCTION(intlcal_from_date_time);
 
+PHP_FUNCTION(intlcal_to_date_time);
+
 PHP_FUNCTION(intlcal_get_error_code);
 
 PHP_FUNCTION(intlcal_get_error_message);
diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c
index 4924fde..db8e003 100755
--- a/ext/intl/php_intl.c
+++ b/ext/intl/php_intl.c
@@ -796,6 +796,7 @@ zend_function_entry intl_functions[] = {
 	PHP_FE( intlcal_set_lenient, ainfo_cal_set_lenient )
 	PHP_FE( intlcal_equals, ainfo_cal_other_cal )
 	PHP_FE( intlcal_from_date_time, ainfo_cal_from_date_time )
+	PHP_FE( intlcal_to_date_time, ainfo_cal_only_cal )
 #if U_ICU_VERSION_MAJOR_NUM >= 49
 	PHP_FE( intlcal_get_repeated_wall_time_option, ainfo_cal_only_cal )
 	PHP_FE( intlcal_get_skipped_wall_time_option, ainfo_cal_only_cal )
diff --git a/ext/intl/tests/badargs.phpt b/ext/intl/tests/badargs.phpt
index 9232bbf..b8f48b3 100755
--- a/ext/intl/tests/badargs.phpt
+++ b/ext/intl/tests/badargs.phpt
@@ -13,7 +13,10 @@ foreach($funcs as $func) {
         if($rfunc->getNumberOfRequiredParameters() == 0) {
                 continue;
         }
-        $res = $func($arg);
+		
+		try {
+			$res = $func($arg);
+		} catch (Exception $e) { continue; }
         if($res != false) {
                 echo "$func: ";
                 var_dump($res);
diff --git a/ext/intl/tests/calendar_toDateTime_basic.phpt b/ext/intl/tests/calendar_toDateTime_basic.phpt
new file mode 100644
index 0000000..d38487d
--- /dev/null
+++ b/ext/intl/tests/calendar_toDateTime_basic.phpt
@@ -0,0 +1,23 @@
+--TEST--
+IntlCalendar::toDateTime(): basic test
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+	die('skip intl extension not enabled');
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+//ini_set("intl.default_locale", "nl");
+ini_set('date.timezone', 'Europe/Lisbon');
+
+$cal = new IntlGregorianCalendar(2012,04,17,17,35,36);
+
+$dt = $cal->toDateTime();
+
+var_dump($dt->format("c"), $dt->getTimeZone()->getName());
+?>
+==DONE==
+--EXPECT--
+string(25) "2012-05-17T17:35:36+01:00"
+string(13) "Europe/Lisbon"
+==DONE==
\ No newline at end of file
diff --git a/ext/intl/tests/calendar_toDateTime_error.phpt b/ext/intl/tests/calendar_toDateTime_error.phpt
new file mode 100644
index 0000000..961a9c8
--- /dev/null
+++ b/ext/intl/tests/calendar_toDateTime_error.phpt
@@ -0,0 +1,41 @@
+--TEST--
+IntlCalendar::toDateTime(): bad arguments
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+	die('skip intl extension not enabled');
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+ini_set('date.timezone', 'Europe/Lisbon');
+
+$cal = new IntlGregorianCalendar();
+var_dump($cal->toDateTime(3));
+
+var_dump(intlcal_to_date_time($cal, 3));
+
+$cal = new IntlGregorianCalendar("Etc/Unknown");
+try {
+var_dump($cal->toDateTime());
+} catch (Exception $e) {
+var_dump("exception: {$e->getMessage()}");
+}
+
+var_dump(intlcal_to_date_time(3));
+
+--EXPECTF--
+
+Warning: IntlCalendar::toDateTime() expects exactly 0 parameters, 1 given in %s on line %d
+
+Warning: IntlCalendar::toDateTime(): intlcal_to_date_time: bad arguments in %s on line %d
+bool(false)
+
+Warning: intlcal_to_date_time() expects exactly 1 parameter, 2 given in %s on line %d
+
+Warning: intlcal_to_date_time(): intlcal_to_date_time: bad arguments in %s on line %d
+bool(false)
+
+Warning: IntlCalendar::toDateTime(): intlcal_to_date_time: DateTimeZone constructor threw exception in %s on line %d
+string(77) "exception: DateTimeZone::__construct(): Unknown or bad timezone (Etc/Unknown)"
+
+Catchable fatal error: Argument 1 passed to intlcal_to_date_time() must be an instance of IntlCalendar, integer given in %s on line %d


commit 49b1f5819485b974b62357c02f2bb4b4d2324c09
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Thu May 17 23:17:00 2012 +0200

    Fixed a couple of memory leaks

diff --git a/ext/intl/timezone/timezone_class.cpp b/ext/intl/timezone/timezone_class.cpp
index 31893fe..a1a9866 100644
--- a/ext/intl/timezone/timezone_class.cpp
+++ b/ext/intl/timezone/timezone_class.cpp
@@ -93,7 +93,7 @@ U_CFUNC TimeZone *timezone_convert_datetimezone(int type,
 			}
 
 			id = offset_id;
-			id_len = spprintf((char**)&id, sizeof(offset_id), "GMT%+03d:%02d",
+			id_len = slprintf((char*)id, sizeof(offset_id), "GMT%+03d:%02d",
 				hours, minutes);
 			break;
 		}
@@ -137,6 +137,7 @@ U_CFUNC zval *timezone_convert_to_datetimezone(const TimeZone *timeZone,
 	UnicodeString		id;
 	char				*message = NULL;
 	php_timezone_obj	*tzobj;
+	zval				arg = zval_used_for_init;
 
 	timeZone->getID(id);
 	if (id.isBogus()) {
@@ -159,7 +160,6 @@ U_CFUNC zval *timezone_convert_to_datetimezone(const TimeZone *timeZone,
 		tzobj->tzi.utc_offset = -1 * timeZone->getRawOffset() / (60 * 1000);
 	} else {
 		/* Call the constructor! */
-		zval arg = zval_used_for_init;
 		Z_TYPE(arg) = IS_STRING;
 		if (intl_charFromString(id, &Z_STRVAL(arg), &Z_STRLEN(arg),
 				&INTL_ERROR_CODE(*outside_error)) == FAILURE) {
@@ -180,16 +180,21 @@ U_CFUNC zval *timezone_convert_to_datetimezone(const TimeZone *timeZone,
 		}
 	}
 
-	return ret;
-
+	if (0) {
 error:
+		if (ret) {
+			zval_ptr_dtor(&ret);
+		}
+		ret = NULL;
+	}
+
 	if (message) {
 		efree(message);
 	}
-	if (ret) {
-		zval_ptr_dtor(&ret);
+	if (Z_TYPE(arg) == IS_STRING) {
+		zval_dtor(&arg);
 	}
-	return NULL;
+	return ret;
 }
 /* }}} */
 


commit 887744f6b40946ad14b9c5f3f1b6b191a84dad6a
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Thu May 17 18:16:54 2012 +0200

    Fixed bad DateTime construction state check

diff --git a/ext/intl/calendar/calendar_methods.cpp b/ext/intl/calendar/calendar_methods.cpp
index e9565fc..82ccd80 100644
--- a/ext/intl/calendar/calendar_methods.cpp
+++ b/ext/intl/calendar/calendar_methods.cpp
@@ -1142,7 +1142,7 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time)
 	}
 
 	datetime = (php_date_obj*)zend_object_store_get_object(zv_datetime TSRMLS_CC);
-	if (!datetime) {
+	if (!datetime->time) {
 		intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
 			"intlcal_from_date_time: DateTime object is unconstructed",
 			0 TSRMLS_CC);
@@ -1182,6 +1182,7 @@ U_CFUNC PHP_FUNCTION(intlcal_from_date_time)
 	}
 	cal->setTime(((UDate)Z_LVAL_P(zv_timestamp)) * 1000., status);
     if (U_FAILURE(status)) {
+		/* time zone was adopted by cal; should not be deleted here */
 		delete cal;
 		intl_error_set(NULL, status, "intlcal_from_date_time: "
 				"error creating ICU Calendar::setTime()", 0 TSRMLS_CC);
diff --git a/ext/intl/tests/calendar_fromDateTime_error.phpt b/ext/intl/tests/calendar_fromDateTime_error.phpt
index b3cb22a..2fbf719 100644
--- a/ext/intl/tests/calendar_fromDateTime_error.phpt
+++ b/ext/intl/tests/calendar_fromDateTime_error.phpt
@@ -44,9 +44,7 @@ Warning: IntlCalendar::fromDateTime() expects at most 2 parameters, 3 given in %
 Warning: IntlCalendar::fromDateTime(): intlcal_from_date_time: bad arguments in %s on line %d
 NULL
 threw exception, OK
-Warning: DateTime::getTimestamp(): The DateTime object has not been correctly initialized by its constructor in %s on line %d
-
-Warning: IntlCalendar::fromDateTime(): intlcal_from_date_time: bad DateTime; call to DateTime::getTimestamp() failed in %s on line %d
+Warning: IntlCalendar::fromDateTime(): intlcal_from_date_time: DateTime object is unconstructed in %s on line %d
 NULL
 
 Warning: IntlCalendar::fromDateTime(): intlcal_from_date_time: object has an time zone offset that's too large in %s on line %d


commit ec23c3e5401f2bf4b752e8ae64383932135eef10
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Thu May 17 17:45:15 2012 +0200

    MessageFormatter accepts IntlCalendar arguments
    
    Now MessageFormatter::format() accepts IntlCalendar objects to be used in
    arguments of type Format::kDate.

diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp
index 84c6f40..6f4615e 100755
--- a/ext/intl/msgformat/msgformat_helpers.cpp
+++ b/ext/intl/msgformat/msgformat_helpers.cpp
@@ -28,6 +28,7 @@
 #include <unicode/ustdio.h>
 #include <unicode/timezone.h>
 #include <unicode/datefmt.h>
+#include <unicode/calendar.h>
 
 #include <vector>
 
@@ -39,6 +40,8 @@ extern "C" {
 #include "msgformat_format.h"
 #include "msgformat_helpers.h"
 #include "intl_convert.h"
+#define USE_CALENDAR_POINTER 1
+#include "../calendar/calendar_class.h"
 /* avoid redefinition of int8_t, already defined in unicode/pwin32.h */
 #define _MSC_STDINT_H_ 1
 #include "ext/date/php_date.h"
@@ -134,6 +137,14 @@ static double umsg_helper_zval_to_millis(zval *z, UErrorCode *status TSRMLS_DC)
 				rv = U_MILLIS_PER_SECOND * (double)Z_LVAL(retval);
 			}
 			zval_ptr_dtor(&zfuncname);
+		} else if (instanceof_function(Z_OBJCE_P(z), Calendar_ce_ptr TSRMLS_CC)) {
+			Calendar_object *co = (Calendar_object *)
+				zend_object_store_get_object(z TSRMLS_CC );
+			if (co->ucal == NULL) {
+				*status = U_ILLEGAL_ARGUMENT_ERROR;
+			} else {
+				rv = (double)co->ucal->getTime(*status);
+			}
 		} else {
 			/* TODO: try with cast(), get() to obtain a number */
 			*status = U_ILLEGAL_ARGUMENT_ERROR;
diff --git a/ext/intl/tests/msgfmt_format_intlcalendar.phpt b/ext/intl/tests/msgfmt_format_intlcalendar.phpt
new file mode 100644
index 0000000..6ae78a9
--- /dev/null
+++ b/ext/intl/tests/msgfmt_format_intlcalendar.phpt
@@ -0,0 +1,30 @@
+--TEST--
+MessageFormat accepts IntlCalendar args
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+	die('skip intl extension not enabled');
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+//ini_set("intl.default_locale", "nl");
+ini_set('date.timezone', 'Europe/Lisbon');
+
+$cal = new IntlGregorianCalendar(2012,04,17,17,35,36);
+
+$msgf = new MessageFormatter('pt_PT', '{0,date,full} {0,time,h:m:s a V}');
+echo $msgf->format(array($cal)), "\n";
+
+//NOT FIXED:
+/*$msgf = new MessageFormatter('en_US',
+'{1, select, date {{0,date,full}} other {{0,time,h:m:s a V}}}');
+
+echo "msgf2: ", $msgf->format(array($time, 'date')), " ",
+		$msgf->format(array($time, 'time')), "\n";
+*/
+
+?>
+==DONE==
+--EXPECT--
+Quinta-feira, 17 de Maio de 2012 5:35:36 p.m. WEST
+==DONE==
\ No newline at end of file


commit d754e9683aceb125dff62ea11fd0d6b1cdf7ca4e
Merge: 30bf2fb e9351b8
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Thu May 17 17:57:22 2012 +0200

    Merge branch 'intl_format_tz' into intl_calendar



commit e9351b89a994464f9c0f60e039ecfaa7f2297302
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Wed May 16 17:33:12 2012 +0200

    Bug #58756: w.r.t MessageFormatter (partial fix)
    
    I don't think the current ICU API allows this bug to be completely fixed.
    
    Right now, the code cannot control the time zone used in date/time formats
    that appear inside complex subformats. See the comment inside
    umsg_set_timezone().

diff --git a/ext/intl/msgformat/msgformat_data.c b/ext/intl/msgformat/msgformat_data.c
index 9ed129f..62e034b 100755
--- a/ext/intl/msgformat/msgformat_data.c
+++ b/ext/intl/msgformat/msgformat_data.c
@@ -29,9 +29,10 @@ void msgformat_data_init( msgformat_data* mf_data TSRMLS_DC )
 	if( !mf_data )
 		return;
 
-	mf_data->umsgf = NULL;
-	mf_data->orig_format = NULL;
-	mf_data->arg_types = NULL;
+	mf_data->umsgf			= NULL;
+	mf_data->orig_format	= NULL;
+	mf_data->arg_types		= NULL;
+	mf_data->tz_set			= 0;
 	intl_error_reset( &mf_data->error TSRMLS_CC );
 }
 /* }}} */
diff --git a/ext/intl/msgformat/msgformat_data.h b/ext/intl/msgformat/msgformat_data.h
index 5a82003..063efd4 100755
--- a/ext/intl/msgformat/msgformat_data.h
+++ b/ext/intl/msgformat/msgformat_data.h
@@ -32,6 +32,7 @@ typedef struct {
 	char*			orig_format;
 	ulong			orig_format_len;
 	HashTable*		arg_types;
+	int				tz_set; /* if we've already the time zone in sub-formats */
 } msgformat_data;
 
 msgformat_data* msgformat_data_create( TSRMLS_D );
diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp
index f8228df..84c6f40 100755
--- a/ext/intl/msgformat/msgformat_helpers.cpp
+++ b/ext/intl/msgformat/msgformat_helpers.cpp
@@ -26,6 +26,8 @@
 #include <unicode/msgfmt.h>
 #include <unicode/chariter.h>
 #include <unicode/ustdio.h>
+#include <unicode/timezone.h>
+#include <unicode/datefmt.h>
 
 #include <vector>
 
@@ -40,6 +42,8 @@ extern "C" {
 /* avoid redefinition of int8_t, already defined in unicode/pwin32.h */
 #define _MSC_STDINT_H_ 1
 #include "ext/date/php_date.h"
+#define USE_TIMEZONE_POINTER
+#include "../timezone/timezone_class.h"
 }
 
 #ifndef INFINITY
@@ -368,6 +372,55 @@ static HashTable *umsg_get_types(MessageFormatter_object *mfo,
 #endif
 }
 
+static void umsg_set_timezone(MessageFormatter_object *mfo,
+							  intl_error& err TSRMLS_DC)
+{
+	MessageFormat *mf = (MessageFormat *)mfo->mf_data.umsgf;
+	TimeZone	  *used_tz = NULL;
+	const Format  **formats;
+	int32_t		  count;
+
+	/* Unfortanely, this cannot change the time zone for arguments that
+	 * appear inside complex formats because ::getFormats() returns NULL
+	 * for all uncached formats, which is the case for complex formats
+	 * unless they were set via one of the ::setFormat() methods */
+	
+	if (mfo->mf_data.tz_set) {
+		return; /* already done */
+	}
+
+	formats = mf->getFormats(count);
+	
+	if (formats == NULL) {
+		intl_errors_set(&err, U_MEMORY_ALLOCATION_ERROR,
+			"Out of memory retrieving subformats", 0 TSRMLS_CC);
+	}
+
+	for (int i = 0; U_SUCCESS(err.code) && i < count; i++) {
+		DateFormat* df = dynamic_cast<DateFormat*>(
+			const_cast<Format *>(formats[i]));
+		if (df == NULL) {
+			continue;
+		}
+		
+		if (used_tz == NULL) {
+			zval nullzv = zval_used_for_init,
+				 *zvptr = &nullzv;
+			used_tz = timezone_process_timezone_argument(&zvptr, &err,
+				"msgfmt_format" TSRMLS_CC);
+			if (used_tz == NULL) {
+				continue;
+			}
+		}
+		
+		df->setTimeZone(*used_tz);
+	}
+
+	if (U_SUCCESS(err.code)) {
+		mfo->mf_data.tz_set = 1;
+	}
+}
+
 U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
 								HashTable *args,
 								UChar **formatted,
@@ -385,6 +438,8 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
 	}
 
 	types = umsg_get_types(mfo, err TSRMLS_CC);
+	
+	umsg_set_timezone(mfo, err TSRMLS_CC);
 
 	fargs.resize(arg_count);
 	farg_names.resize(arg_count);
diff --git a/ext/intl/tests/bug58756_MessageFormatter.phpt b/ext/intl/tests/bug58756_MessageFormatter.phpt
new file mode 100644
index 0000000..bbe96b7
--- /dev/null
+++ b/ext/intl/tests/bug58756_MessageFormatter.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Bug #58756: w.r.t MessageFormatter
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+	die('skip intl extension not enabled');
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+//ini_set("intl.default_locale", "nl");
+
+$time = 1247013673;
+
+ini_set('date.timezone', 'America/New_York');
+
+$msgf = new MessageFormatter('en_US', '{0,date,full} {0,time,h:m:s a V}');
+
+echo "date:  " . date('l, F j, Y g:i:s A T', $time) . "\n";
+echo "msgf:  " . $msgf->format(array($time)) . "\n";
+
+//NOT FIXED:
+/*$msgf = new MessageFormatter('en_US',
+'{1, select, date {{0,date,full}} other {{0,time,h:m:s a V}}}');
+
+echo "msgf2: ", $msgf->format(array($time, 'date')), " ",
+		$msgf->format(array($time, 'time')), "\n";
+*/
+
+?>
+==DONE==
+--EXPECT--
+date:  Tuesday, July 7, 2009 8:41:13 PM EDT
+msgf:  Tuesday, July 7, 2009 8:41:13 PM EDT
+==DONE==
\ No newline at end of file


commit 30bf2fbb9d92b66b2f40cb3383bbb00d5921269c
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Mon Apr 30 15:29:36 2012 +0200

    Handle bogus string in intl_charFromString().

diff --git a/ext/intl/intl_convertcpp.cpp b/ext/intl/intl_convertcpp.cpp
index 8dddc702..5034028 100644
--- a/ext/intl/intl_convertcpp.cpp
+++ b/ext/intl/intl_convertcpp.cpp
@@ -48,9 +48,16 @@ int intl_stringFromChar(UnicodeString &ret, char *str, int32_t str_len, UErrorCo
 }
 /* }}} */
 
-/* {{{ intl_charFromString */
+/* {{{ intl_charFromString
+ * faster than doing intl_convert_utf16_to_utf8(&res, &res_len,
+ *		from.getBuffer(), from.length(), &status),
+ * but consumes more memory */
 int intl_charFromString(const UnicodeString &from, char **res, int *res_len, UErrorCode *status)
 {
+	if (from.isBogus()) {
+		return FAILURE;
+	}
+
 	//the number of UTF-8 code units is not larger than that of UTF-16 code
 	//units * 3 + 1 for the terminator
 	int32_t capacity = from.length() * 3 + 1;


commit 81d8f4079cac4e215e5ed98b5a6fd1f3a89e375f
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Mon Apr 30 15:28:41 2012 +0200

    Whitespace.

diff --git a/ext/intl/calendar/calendar_class.h b/ext/intl/calendar/calendar_class.h
index c41c021..abf9555 100644
--- a/ext/intl/calendar/calendar_class.h
+++ b/ext/intl/calendar/calendar_class.h
@@ -62,6 +62,7 @@ void calendar_register_IntlCalendar_class(TSRMLS_D);
 
 extern zend_class_entry *Calendar_ce_ptr,
 						*GregorianCalendar_ce_ptr;
+
 extern zend_object_handlers Calendar_handlers;
 
 #endif /* #ifndef CALENDAR_CLASS_H */


commit 4cfd9995daf249c02f4d8a23f96288d1b2a2f4c0
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Mon Apr 30 15:15:09 2012 +0200

    Added IntlTimeZone::fromDateTimeZone() and ::toDateTimeZone.
    
    IntlTimeZone::fromDateTimeZone(DateTimeZone $dtz) converts from an
    ext/date TimeZone to an IntlTimeZone. The conversion is done by feeding
    the time zone name (essentially what would be given by
    DateTimeZone::getName()) to ICU's TimeZone::createTimeZone except if it's
    an offset time zone. In that case, the offset is read from the ext/date
    time zone object structure and an appopriate id (of the form
    GMT<+|-><HH:MM>) is given to ICU's TimeZone::createTimeZone. Not all
    ext/date time zones are recognized for ICU. For instance, WEST is not.
    Note that these kind of abbreviations, as far as I can tell, can only be
    created via ext/date DateTime, not directly through DateTimeZone's
    constructor.
    
    For IntlTimeZone::toDateTimeZone(), the behavior is symmetrical.
    We instantiate a DateTimeZone and then call its constructor if we don't
    have an offset time zone, otherwise we mess with its structure. If the
    timezone is not valid for ext/date, then we allow the exception of
    DateTimeZone constructor to propagate.

diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c
index 51aece6..4924fde 100755
--- a/ext/intl/php_intl.c
+++ b/ext/intl/php_intl.c
@@ -414,6 +414,10 @@ ZEND_BEGIN_ARG_INFO_EX( arginfo_tz_idarg_static, 0, 0, 1 )
 	ZEND_ARG_INFO( 0, zoneId )
 ZEND_END_ARG_INFO()
 
+ZEND_BEGIN_ARG_INFO_EX( arginfo_tz_from_date_time_zone, 0, 0, 1 )
+	ZEND_ARG_OBJ_INFO( 0, dateTimeZone, IntlDateTimeZone, 0 )
+ZEND_END_ARG_INFO()
+
 ZEND_BEGIN_ARG_INFO_EX( arginfo_tz_create_enumeration, 0, 0, 0 )
 	ZEND_ARG_INFO( 0, countryOrRawOffset )
 ZEND_END_ARG_INFO()
@@ -719,6 +723,7 @@ zend_function_entry intl_functions[] = {
 
 	/* TimeZone functions */
 	PHP_FE( intltz_create_time_zone, arginfo_tz_idarg_static )
+	PHP_FE( intltz_from_date_time_zone, arginfo_tz_from_date_time_zone )
 	PHP_FE( intltz_create_default, arginfo_tz_void )
 	PHP_FE( intltz_get_id, arginfo_tz_only_tz )
 	PHP_FE( intltz_get_gmt, arginfo_tz_void )
@@ -742,6 +747,7 @@ zend_function_entry intl_functions[] = {
 	PHP_FE( intltz_has_same_rules, arginfo_tz_has_same_rules )
 	PHP_FE( intltz_get_display_name, arginfo_tz_get_display_name )
 	PHP_FE( intltz_get_dst_savings, arginfo_tz_only_tz )
+	PHP_FE( intltz_to_date_time_zone, arginfo_tz_only_tz )
 	PHP_FE( intltz_get_error_code, arginfo_tz_only_tz )
 	PHP_FE( intltz_get_error_message, arginfo_tz_only_tz )
 
diff --git a/ext/intl/tests/timezone_fromDateTimeZone_basic.phpt b/ext/intl/tests/timezone_fromDateTimeZone_basic.phpt
new file mode 100644
index 0000000..10e2621
--- /dev/null
+++ b/ext/intl/tests/timezone_fromDateTimeZone_basic.phpt
@@ -0,0 +1,41 @@
+--TEST--
+IntlTimeZone::fromDateTimeZone(): basic test
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+	die('skip intl extension not enabled');
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+ini_set("intl.default_locale", "nl");
+date_default_timezone_set('Europe/Lisbon');
+
+$tz = IntlTimeZone::fromDateTimeZone(new DateTimeZone('Europe/Amsterdam'));
+var_dump($tz->getID(), $tz->getRawOffset());
+
+
+$dt = new DateTime('2012-01-01 00:00:00 CET');
+$dtz = $dt->getTimeZone();
+/* this is different from new DateTimeZone('CET'),
+ * which gives a Europe/Berlin timezone */
+var_dump($dtz->getName());
+$tz = IntlTimeZone::fromDateTimeZone($dtz);
+var_dump($tz->getID(), $tz->getRawOffset());
+
+
+$dt = new DateTime('2012-01-01 00:00:00 +0340');
+$dtz = $dt->getTimeZone();
+/* I don't think this timezone can be generated without a DateTime object */
+var_dump($dtz->getName());
+$tz = IntlTimeZone::fromDateTimeZone($dtz);
+var_dump($tz->getID(), $tz->getRawOffset() /* (3*60+40)*60000 */);
+
+--EXPECTF--
+string(16) "Europe/Amsterdam"
+int(3600000)
+string(3) "CET"
+string(3) "CET"
+int(3600000)
+string(6) "+03:40"
+string(%d) "GMT+03%s0"
+int(13200000)
diff --git a/ext/intl/tests/timezone_fromDateTimeZone_error.phpt b/ext/intl/tests/timezone_fromDateTimeZone_error.phpt
new file mode 100644
index 0000000..4d6c153
--- /dev/null
+++ b/ext/intl/tests/timezone_fromDateTimeZone_error.phpt
@@ -0,0 +1,48 @@
+--TEST--
+IntlTimeZone::fromDateTimeZone(): argument errors
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+	die('skip intl extension not enabled');
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+
+var_dump(IntlTimeZone::fromDateTimeZone());
+var_dump(IntlTimeZone::fromDateTimeZone(1,2));
+var_dump(IntlTimeZone::fromDateTimeZone('sdfds'));
+var_dump(IntlTimeZone::fromDateTimeZone(new stdclass));
+$dt = new DateTime('2012-08-01 00:00:00 WEST');
+var_dump(IntlTimeZone::fromDateTimeZone($dt->getTimeZone()));
+
+var_dump(intltz_from_date_time_zone());
+
+--EXPECTF--
+
+Warning: IntlTimeZone::fromDateTimeZone() expects exactly 1 parameter, 0 given in %s on line %d
+
+Warning: IntlTimeZone::fromDateTimeZone(): intltz_from_date_time_zone: bad arguments in %s on line %d
+NULL
+
+Warning: IntlTimeZone::fromDateTimeZone() expects exactly 1 parameter, 2 given in %s on line %d
+
+Warning: IntlTimeZone::fromDateTimeZone(): intltz_from_date_time_zone: bad arguments in %s on line %d
+NULL
+
+Warning: IntlTimeZone::fromDateTimeZone() expects parameter 1 to be DateTimeZone, string given in %s on line %d
+
+Warning: IntlTimeZone::fromDateTimeZone(): intltz_from_date_time_zone: bad arguments in %s on line %d
+NULL
+
+Warning: IntlTimeZone::fromDateTimeZone() expects parameter 1 to be DateTimeZone, object given in %s on line %d
+
+Warning: IntlTimeZone::fromDateTimeZone(): intltz_from_date_time_zone: bad arguments in %s on line %d
+NULL
+
+Warning: IntlTimeZone::fromDateTimeZone(): intltz_from_date_time_zone: time zone id 'WEST' extracted from ext/date DateTimeZone not recognized in %s on line %d
+NULL
+
+Warning: intltz_from_date_time_zone() expects exactly 1 parameter, 0 given in %s on line %d
+
+Warning: intltz_from_date_time_zone(): intltz_from_date_time_zone: bad arguments in %s on line %d
+NULL
diff --git a/ext/intl/tests/timezone_toDateTimeZone_basic.phpt b/ext/intl/tests/timezone_toDateTimeZone_basic.phpt
new file mode 100644
index 0000000..d22aa68
--- /dev/null
+++ b/ext/intl/tests/timezone_toDateTimeZone_basic.phpt
@@ -0,0 +1,38 @@
+--TEST--
+IntlTimeZone::toDateTimeZone(): basic test
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+	die('skip intl extension not enabled');
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+ini_set("intl.default_locale", "nl");
+date_default_timezone_set('Europe/Lisbon');
+
+function do_test(IntlTimeZone $tz, $proc = false) {
+	var_dump($tz->getID(), $tz->getRawOffset());
+	if (!$proc)
+		$dtz = $tz->toDateTimeZone();
+	else
+		$dtz = intltz_to_date_time_zone($tz);
+	var_dump($dtz->getName(), $dtz->getOffset(new DateTime('2012-01-01 00:00:00')));
+}
+
+do_test(IntlTimeZone::createTimeZone('CET'));
+do_test(IntlTimeZone::createTimeZone('Europe/Amsterdam'));
+do_test(IntlTimeZone::createTimeZone('GMT+0405'), true);
+
+--EXPECTF--
+string(3) "CET"
+int(3600000)
+string(13) "Europe/Berlin"
+int(3600)
+string(16) "Europe/Amsterdam"
+int(3600000)
+string(16) "Europe/Amsterdam"
+int(3600)
+string(%s) "GMT+04%s5"
+int(14700000)
+string(6) "+04:05"
+int(14700)
diff --git a/ext/intl/tests/timezone_toDateTimeZone_error.phpt b/ext/intl/tests/timezone_toDateTimeZone_error.phpt
new file mode 100644
index 0000000..e48d7ac
--- /dev/null
+++ b/ext/intl/tests/timezone_toDateTimeZone_error.phpt
@@ -0,0 +1,38 @@
+--TEST--
+IntlTimeZone::toDateTimeZone(): errors
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+	die('skip intl extension not enabled');
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+
+$tz = IntlTimeZone::createTimeZone('Etc/Unknown');
+
+var_dump($tz->toDateTimeZone(''));
+try {
+	var_dump($tz->toDateTimeZone());
+} catch (Exception $e) {
+	var_dump($e->getMessage());
+}
+
+var_dump(intltz_to_date_time_zone());
+var_dump(intltz_to_date_time_zone(1));
+
+--EXPECTF--
+
+Warning: IntlTimeZone::toDateTimeZone() expects exactly 0 parameters, 1 given in %s on line %d
+
+Warning: IntlTimeZone::toDateTimeZone(): intltz_to_date_time_zone: bad arguments in %s on line %d
+bool(false)
+
+Warning: IntlTimeZone::toDateTimeZone(): intltz_to_date_time_zone: DateTimeZone constructor threw exception in %s on line %d
+string(66) "DateTimeZone::__construct(): Unknown or bad timezone (Etc/Unknown)"
+
+Warning: intltz_to_date_time_zone() expects exactly 1 parameter, 0 given in %s on line %d
+
+Warning: intltz_to_date_time_zone(): intltz_to_date_time_zone: bad arguments in %s on line %d
+bool(false)
+
+Catchable fatal error: Argument 1 passed to intltz_to_date_time_zone() must be an instance of IntlTimeZone, integer given in %s on line %d
diff --git a/ext/intl/timezone/timezone_class.cpp b/ext/intl/timezone/timezone_class.cpp
index 7032368..31893fe 100644
--- a/ext/intl/timezone/timezone_class.cpp
+++ b/ext/intl/timezone/timezone_class.cpp
@@ -29,6 +29,7 @@ extern "C" {
 #include "timezone_class.h"
 #include "timezone_methods.h"
 #include <zend_exceptions.h>
+#include <zend_interfaces.h>
 /* avoid redefinition of int8_t, already defined in unicode/pwin32.h */
 #define _MSC_STDINT_H_ 1
 #include <ext/date/php_date.h>
@@ -107,7 +108,7 @@ U_CFUNC TimeZone *timezone_convert_datetimezone(int type,
 	UnicodeString s = UnicodeString(id, id_len, US_INV);
 	timeZone = TimeZone::createTimeZone(s);
 #if U_ICU_VERSION_MAJOR_NUM >= 49
-	if (timeZone == TimeZone::getUnknown()) {
+	if (*timeZone == TimeZone::getUnknown()) {
 #else
 	UnicodeString resultingId;
 	timeZone->getID(resultingId);
@@ -115,7 +116,7 @@ U_CFUNC TimeZone *timezone_convert_datetimezone(int type,
 			|| resultingId == UnicodeString("GMT", -1, US_INV)) {
 #endif
 		spprintf(&message, 0, "%s: time zone id '%s' "
-			"extracted from ext/date TimeZone not recognized", func, id);
+			"extracted from ext/date DateTimeZone not recognized", func, id);
 		intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR,
 			message, 1 TSRMLS_CC);
 		efree(message);
@@ -126,6 +127,72 @@ U_CFUNC TimeZone *timezone_convert_datetimezone(int type,
 }
 /* }}} */
 
+/* {{{ timezone_convert_to_datetimezone
+ *	   Convert from TimeZone to DateTimeZone object */
+U_CFUNC zval *timezone_convert_to_datetimezone(const TimeZone *timeZone,
+											   intl_error *outside_error,
+											   const char *func TSRMLS_DC)
+{
+	zval				*ret = NULL;
+	UnicodeString		id;
+	char				*message = NULL;
+	php_timezone_obj	*tzobj;
+
+	timeZone->getID(id);
+	if (id.isBogus()) {
+		spprintf(&message, 0, "%s: could not obtain TimeZone id", func);
+		intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR,
+			message, 1 TSRMLS_CC);
+		goto error;
+	}
+
+	MAKE_STD_ZVAL(ret);
+	object_init_ex(ret, php_date_get_timezone_ce());
+	tzobj = (php_timezone_obj *)zend_objects_get_address(ret TSRMLS_CC);
+
+	if (id.compare(0, 3, UnicodeString("GMT", sizeof("GMT")-1, US_INV)) == 0) {
+		/* The DateTimeZone constructor doesn't support offset time zones,
+		 * so we must mess with DateTimeZone structure ourselves */
+		tzobj->initialized	  = 1;
+		tzobj->type			  = TIMELIB_ZONETYPE_OFFSET;
+		//convert offset from milliseconds to minutes
+		tzobj->tzi.utc_offset = -1 * timeZone->getRawOffset() / (60 * 1000);
+	} else {
+		/* Call the constructor! */
+		zval arg = zval_used_for_init;
+		Z_TYPE(arg) = IS_STRING;
+		if (intl_charFromString(id, &Z_STRVAL(arg), &Z_STRLEN(arg),
+				&INTL_ERROR_CODE(*outside_error)) == FAILURE) {
+			spprintf(&message, 0, "%s: could not convert id to UTF-8", func);
+			intl_errors_set(outside_error, INTL_ERROR_CODE(*outside_error),
+				message, 1 TSRMLS_CC);
+			goto error;
+		}
+		zend_call_method_with_1_params(&ret, NULL, NULL, "__construct",
+			NULL, &arg);
+		if (EG(exception)) {
+			spprintf(&message, 0,
+				"%s: DateTimeZone constructor threw exception", func);
+			intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR,
+				message, 1 TSRMLS_CC);
+			zend_object_store_ctor_failed(ret TSRMLS_CC);
+			goto error;
+		}
+	}
+
+	return ret;
+
+error:
+	if (message) {
+		efree(message);
+	}
+	if (ret) {
+		zval_ptr_dtor(&ret);
+	}
+	return NULL;
+}
+/* }}} */
+
 /* {{{ timezone_process_timezone_argument
  * TimeZone argument processor. outside_error may be NULL (for static functions/constructors) */
 U_CFUNC TimeZone *timezone_process_timezone_argument(zval **zv_timezone,
@@ -400,6 +467,10 @@ ZEND_BEGIN_ARG_INFO_EX(ainfo_tz_idarg, 0, 0, 1)
 	ZEND_ARG_INFO(0, zoneId)
 ZEND_END_ARG_INFO()
 
+ZEND_BEGIN_ARG_INFO_EX(ainfo_tz_fromDateTimeZone, 0, 0, 1)
+	ZEND_ARG_OBJ_INFO(0, otherTimeZone, IntlTimeZone, 0)
+ZEND_END_ARG_INFO()
+
 ZEND_BEGIN_ARG_INFO_EX(ainfo_tz_createEnumeration, 0, 0, 0)
 	ZEND_ARG_INFO(0, countryOrRawOffset)
 ZEND_END_ARG_INFO()
@@ -451,6 +522,7 @@ ZEND_END_ARG_INFO()
  */
 static zend_function_entry TimeZone_class_functions[] = {
 	PHP_ME_MAPPING(createTimeZone,		intltz_create_time_zone,		ainfo_tz_idarg,				ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
+	PHP_ME_MAPPING(fromDateTimeZone,	intltz_from_date_time_zone,		ainfo_tz_idarg,				ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
 	PHP_ME_MAPPING(createDefault,		intltz_create_default,			ainfo_tz_void,				ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
 	PHP_ME_MAPPING(getGMT,				intltz_get_gmt,					ainfo_tz_void,				ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
 #if U_ICU_VERSION_MAJOR_NUM >= 49
@@ -475,6 +547,7 @@ static zend_function_entry TimeZone_class_functions[] = {
 	PHP_ME_MAPPING(hasSameRules,		intltz_has_same_rules,			ainfo_tz_hasSameRules,		ZEND_ACC_PUBLIC)
 	PHP_ME_MAPPING(getDisplayName,		intltz_get_display_name,		ainfo_tz_getDisplayName,	ZEND_ACC_PUBLIC)
 	PHP_ME_MAPPING(getDSTSavings,		intltz_get_dst_savings,			ainfo_tz_void,				ZEND_ACC_PUBLIC)
+	PHP_ME_MAPPING(toDateTimeZone,		intltz_to_date_time_zone,		ainfo_tz_void,				ZEND_ACC_PUBLIC)
 	PHP_ME_MAPPING(getErrorCode,		intltz_get_error_code,			ainfo_tz_void,				ZEND_ACC_PUBLIC)
 	PHP_ME_MAPPING(getErrorMessage,		intltz_get_error_message,		ainfo_tz_void,				ZEND_ACC_PUBLIC)
 	PHP_FE_END
diff --git a/ext/intl/timezone/timezone_class.h b/ext/intl/timezone/timezone_class.h
index d5fabb9..0d3c0ed 100644
--- a/ext/intl/timezone/timezone_class.h
+++ b/ext/intl/timezone/timezone_class.h
@@ -60,6 +60,7 @@ typedef struct {
 	}
 
 TimeZone *timezone_convert_datetimezone(int type, void *object, int is_datetime, intl_error *outside_error, const char *func TSRMLS_DC);
+zval *timezone_convert_to_datetimezone(const TimeZone *timeZone, intl_error *outside_error, const char *func TSRMLS_DC);
 TimeZone *timezone_process_timezone_argument(zval **zv_timezone, intl_error *error, const char *func TSRMLS_DC);
 
 void timezone_object_construct(const TimeZone *zone, zval *object, int owned TSRMLS_DC);
diff --git a/ext/intl/timezone/timezone_methods.cpp b/ext/intl/timezone/timezone_methods.cpp
index eaa6b46..e596cc5 100644
--- a/ext/intl/timezone/timezone_methods.cpp
+++ b/ext/intl/timezone/timezone_methods.cpp
@@ -28,6 +28,9 @@ extern "C" {
 #include "intl_convert.h"
 #include "../locale/locale.h"
 #include <zend_exceptions.h>
+/* avoid redefinition of int8_t, already defined in unicode/pwin32.h */
+#define _MSC_STDINT_H_ 1
+#include <ext/date/php_date.h>
 }
 #include "common/common_enum.h"
 
@@ -57,6 +60,37 @@ U_CFUNC PHP_FUNCTION(intltz_create_time_zone)
 	timezone_object_construct(tz, return_value, 1 TSRMLS_CC);
 }
 
+U_CFUNC PHP_FUNCTION(intltz_from_date_time_zone)
+{
+	zval				*zv_timezone;
+	TimeZone			*tz;
+	php_timezone_obj	*tzobj;
+	intl_error_reset(NULL TSRMLS_CC);
+
+	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O",
+			&zv_timezone, php_date_get_timezone_ce()) == FAILURE) {
+		intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
+			"intltz_from_date_time_zone: bad arguments", 0 TSRMLS_CC);
+		RETURN_NULL();
+	}
+
+	tzobj = (php_timezone_obj *)zend_objects_get_address(zv_timezone TSRMLS_CC);
+	if (!tzobj->initialized) {
+		intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
+			"intltz_from_date_time_zone: DateTimeZone object is unconstructed",
+			0 TSRMLS_CC);
+		RETURN_NULL();
+	}
+
+	tz = timezone_convert_datetimezone(tzobj->type, tzobj, FALSE, NULL,
+		"intltz_from_date_time_zone" TSRMLS_CC);
+	if (tz == NULL) {
+		RETURN_NULL();
+	}
+
+	timezone_object_construct(tz, return_value, 1 TSRMLS_CC);
+}
+
 U_CFUNC PHP_FUNCTION(intltz_create_default)
 {
 	intl_error_reset(NULL TSRMLS_CC);
@@ -549,6 +583,29 @@ U_CFUNC PHP_FUNCTION(intltz_get_dst_savings)
 	RETURN_LONG((long)to->utimezone->getDSTSavings());
 }
 
+U_CFUNC PHP_FUNCTION(intltz_to_date_time_zone)
+{
+	TIMEZONE_METHOD_INIT_VARS;
+
+	if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
+			"O", &object, TimeZone_ce_ptr) == FAILURE) {
+		intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
+			"intltz_to_date_time_zone: bad arguments", 0 TSRMLS_CC);
+		RETURN_FALSE;
+	}
+
+	TIMEZONE_METHOD_FETCH_OBJECT;
+
+	zval *ret = timezone_convert_to_datetimezone(to->utimezone,
+		&TIMEZONE_ERROR(to), "intltz_to_date_time_zone" TSRMLS_CC);
+
+	if (ret) {
+		RETURN_ZVAL(ret, 1, 1);
+	} else {
+		RETURN_FALSE;
+	}
+}
+
 U_CFUNC PHP_FUNCTION(intltz_get_error_code)
 {
 	TIMEZONE_METHOD_INIT_VARS
diff --git a/ext/intl/timezone/timezone_methods.h b/ext/intl/timezone/timezone_methods.h
index 207caa3..824f72a 100644
--- a/ext/intl/timezone/timezone_methods.h
+++ b/ext/intl/timezone/timezone_methods.h
@@ -21,6 +21,8 @@
 
 PHP_FUNCTION(intltz_create_time_zone);
 
+PHP_FUNCTION(intltz_from_date_time_zone);
+
 PHP_FUNCTION(intltz_create_default);
 
 PHP_FUNCTION(intltz_get_id);
@@ -55,6 +57,8 @@ PHP_FUNCTION(intltz_get_display_name);
 
 PHP_FUNCTION(intltz_get_dst_savings);
 
+PHP_FUNCTION(intltz_to_date_time_zone);
+
 PHP_FUNCTION(intltz_get_error_code);
 
 PHP_FUNCTION(intltz_get_error_message);


commit 22f4a307481f1667bdc95f7ec7c43538427b73ab
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Fri Apr 6 22:04:14 2012 +0200

    Fixed two IntlCalendar::setTimeZone() tests.

diff --git a/ext/intl/tests/calendar_setTimeZone_error.phpt b/ext/intl/tests/calendar_setTimeZone_error.phpt
index 5f83446..ebe4d11 100644
--- a/ext/intl/tests/calendar_setTimeZone_error.phpt
+++ b/ext/intl/tests/calendar_setTimeZone_error.phpt
@@ -20,24 +20,19 @@ echo "error: $errno, $errstr\n";
 set_error_handler('eh');
 
 var_dump($c->setTimeZone($gmt, 2));
-var_dump($c->setTimeZone(1));
 var_dump($c->setTimeZone());
 
-var_dump(intlcal_set_time_zone($c, 1));
+var_dump(intlcal_set_time_zone($c, 1, 2));
 var_dump(intlcal_set_time_zone(1, $gmt));
+
 --EXPECT--
 error: 2, IntlCalendar::setTimeZone() expects exactly 1 parameter, 2 given
 error: 2, IntlCalendar::setTimeZone(): intlcal_set_time_zone: bad arguments
 bool(false)
-error: 4096, Argument 1 passed to IntlCalendar::setTimeZone() must be an instance of IntlTimeZone, integer given
-error: 2, IntlCalendar::setTimeZone() expects parameter 1 to be IntlTimeZone, integer given
-error: 2, IntlCalendar::setTimeZone(): intlcal_set_time_zone: bad arguments
-bool(false)
 error: 2, IntlCalendar::setTimeZone() expects exactly 1 parameter, 0 given
 error: 2, IntlCalendar::setTimeZone(): intlcal_set_time_zone: bad arguments
 bool(false)
-error: 4096, Argument 2 passed to intlcal_set_time_zone() must be an instance of IntlTimeZone, integer given
-error: 2, intlcal_set_time_zone() expects parameter 2 to be IntlTimeZone, integer given
+error: 2, intlcal_set_time_zone() expects exactly 2 parameters, 3 given
 error: 2, intlcal_set_time_zone(): intlcal_set_time_zone: bad arguments
 bool(false)
 error: 4096, Argument 1 passed to intlcal_set_time_zone() must be an instance of IntlCalendar, integer given
diff --git a/ext/intl/tests/calendar_setTimeZone_variation2.phpt b/ext/intl/tests/calendar_setTimeZone_variation2.phpt
index 26aaf72..7f4a7ff 100644
--- a/ext/intl/tests/calendar_setTimeZone_variation2.phpt
+++ b/ext/intl/tests/calendar_setTimeZone_variation2.phpt
@@ -23,8 +23,8 @@ var_dump($intlcal->getTimeZone()->getID());
 $offsetdate = new DateTime('2012-01-01 00:00:00 -02:30');
 $intlcal->setTimeZone($offsetdate->getTimeZone());
 var_dump($intlcal->getTimeZone()->getID());
---EXPECT--
+--EXPECTF--
 string(12) "Europe/Paris"
 string(13) "Europe/Madrid"
 string(3) "PST"
-string(8) "GMT-0230"
+string(%d) "GMT-02%S30"


commit 81278e1bbbc855f82a8f9a6da7c013a1cc952c09
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Fri Apr 6 21:52:43 2012 +0200

    Added IntlCalendar::fromDateTime()
    
    IntlCalendar::fromDateTime(DateTime|string $dateTime[, string $locale)
    intlcal_from_date_time(...)
    
    If a string is given as the first argument, the method will try to
    instantiate a new DateTime object and use that instead.

diff --git a/ext/intl/calendar/calendar_class.cpp b/ext/intl/calendar/calendar_class.cpp
index ea5339d..9f5db6f 100644
--- a/ext/intl/calendar/calendar_class.cpp
+++ b/ext/intl/calendar/calendar_class.cpp
@@ -351,6 +351,10 @@ ZEND_BEGIN_ARG_INFO_EX(ainfo_cal_setLenient, 0, 0, 1)
 	ZEND_ARG_INFO(0, isLenient)
 ZEND_END_ARG_INFO()
 
+ZEND_BEGIN_ARG_INFO_EX(ainfo_cal_from_date_time, 0, 0, 1)
+	ZEND_ARG_INFO(0, dateTime)
+ZEND_END_ARG_INFO()
+
 ZEND_BEGIN_ARG_INFO_EX(ainfo_cal_wall_time_option, 0, 0, 1)
 	ZEND_ARG_INFO(0, wallTimeOption)
 ZEND_END_ARG_INFO()
@@ -426,6 +430,7 @@ static const zend_function_entry Calendar_class_functions[] = {
 	PHP_ME_MAPPING(setRepeatedWallTimeOption,intlcal_set_repeated_wall_time_option,ainfo_cal_wall_time_option,ZEND_ACC_PUBLIC)
 	PHP_ME_MAPPING(setSkippedWallTimeOption,intlcal_set_skipped_wall_time_option,ainfo_cal_wall_time_option,ZEND_ACC_PUBLIC)
 #endif
+	PHP_ME_MAPPING(fromDateTime,		intlcal_from_date_time,		ainfo_cal_from_date_time,			ZEND_ACC_STATIC | ZEND_ACC_PUBLIC)
 	PHP_ME_MAPPING(getErrorCode,		intlcal_get_error_code,		ainfo_cal_void,						ZEND_ACC_PUBLIC)
 	PHP_ME_MAPPING(getErrorMessage,		intlcal_get_error_message,	ainfo_cal_void,						ZEND_ACC_PUBLIC)
 	PHP_FE_END
diff --git a/ext/intl/calendar/calendar_methods.cpp b/ext/intl/calendar/calendar_methods.cpp
index 0c6450f..e9565fc 100644
--- a/ext/intl/calendar/calendar_methods.cpp
+++ b/ext/intl/calendar/calendar_methods.cpp
@@ -1108,6 +1108,97 @@ U_CFUNC PHP_FUNCTION(intlcal_set_skipped_wall_time_option)
 
 #endif
 
+U_CFUNC PHP_FUNCTION(intlcal_from_date_time)
+{
+	zval			**zv_arg,
+					*zv_datetime		= NULL,
+					*zv_timestamp		= NULL;
+	php_date_obj	*datetime;
+	char			*locale_str			= NULL;
+	int				locale_str_len;
+	TimeZone		*timeZone;
+	UErrorCode		status				= U_ZERO_ERROR;
+	intl_error_reset(NULL TSRMLS_CC);
+
+	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|s!",
+			&zv_arg, &locale_str, &locale_str_len) == FAILURE) {
+		intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
+			"intlcal_from_date_time: bad arguments", 0 TSRMLS_CC);
+		RETURN_NULL();
+	}
+
+	if (!(Z_TYPE_PP(zv_arg) == IS_OBJECT && instanceof_function(
+			Z_OBJCE_PP(zv_arg), php_date_get_date_ce() TSRMLS_CC))) {
+		ALLOC_INIT_ZVAL(zv_datetime);
+		object_init_ex(zv_datetime, php_date_get_date_ce());
+		zend_call_method_with_1_params(&zv_datetime, NULL, NULL, "__construct",
+			NULL, *zv_arg);
+		if (EG(exception)) {
+			zend_object_store_ctor_failed(zv_datetime TSRMLS_CC);
+			goto error;
+		}
+	} else {
+		zv_datetime = *zv_arg;
+	}
+
+	datetime = (php_date_obj*)zend_object_store_get_object(zv_datetime TSRMLS_CC);
+	if (!datetime) {
+		intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
+			"intlcal_from_date_time: DateTime object is unconstructed",
+			0 TSRMLS_CC);
+		goto error;
+	}
+
+	zend_call_method_with_0_params(&zv_datetime, php_date_get_date_ce(),
+		NULL, "gettimestamp", &zv_timestamp);
+	if (!zv_timestamp || Z_TYPE_P(zv_timestamp) != IS_LONG) {
+		intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
+			"intlcal_from_date_time: bad DateTime; call to "
+			"DateTime::getTimestamp() failed", 0 TSRMLS_CC);
+		goto error;
+	}
+
+	if (!datetime->time->is_localtime) {
+		timeZone = TimeZone::getGMT()->clone();
+	} else {
+		timeZone = timezone_convert_datetimezone(datetime->time->zone_type,
+			datetime, 1, NULL, "intlcal_from_date_time" TSRMLS_CC);
+		if (timeZone == NULL) {
+			goto error;
+		}
+	}
+
+	if (!locale_str) {
+		locale_str = const_cast<char*>(intl_locale_get_default(TSRMLS_C));
+	}
+
+	Calendar *cal = Calendar::createInstance(timeZone,
+		Locale::createFromName(locale_str), status);
+	if (cal == NULL) {
+		delete timeZone;
+		intl_error_set(NULL, status, "intlcal_from_date_time: "
+				"error creating ICU Calendar object", 0 TSRMLS_CC);
+		goto error;
+	}
+	cal->setTime(((UDate)Z_LVAL_P(zv_timestamp)) * 1000., status);
+    if (U_FAILURE(status)) {
+		delete cal;
+		intl_error_set(NULL, status, "intlcal_from_date_time: "
+				"error creating ICU Calendar::setTime()", 0 TSRMLS_CC);
+        goto error;
+    }
+
+	calendar_object_create(return_value, cal TSRMLS_CC);
+
+error:
+	if (zv_datetime != *zv_arg) {
+		zval_ptr_dtor(&zv_datetime);
+	}
+	if (zv_timestamp) {
+		zval_ptr_dtor(&zv_timestamp);
+	}
+}
+
 U_CFUNC PHP_FUNCTION(intlcal_get_error_code)
 {
 	CALENDAR_METHOD_INIT_VARS;
diff --git a/ext/intl/calendar/calendar_methods.h b/ext/intl/calendar/calendar_methods.h
index 95ff537..e005571 100644
--- a/ext/intl/calendar/calendar_methods.h
+++ b/ext/intl/calendar/calendar_methods.h
@@ -101,6 +101,8 @@ PHP_FUNCTION(intlcal_set_repeated_wall_time_option);
 
 PHP_FUNCTION(intlcal_set_skipped_wall_time_option);
 
+PHP_FUNCTION(intlcal_from_date_time);
+
 PHP_FUNCTION(intlcal_get_error_code);
 
 PHP_FUNCTION(intlcal_get_error_message);
diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c
index aca3590..51aece6 100755
--- a/ext/intl/php_intl.c
+++ b/ext/intl/php_intl.c
@@ -556,6 +556,10 @@ ZEND_BEGIN_ARG_INFO_EX( ainfo_cal_set_lenient, 0, 0, 2 )
 	ZEND_ARG_INFO( 0, isLenient )
 ZEND_END_ARG_INFO()
 
+ZEND_BEGIN_ARG_INFO_EX(ainfo_cal_from_date_time, 0, 0, 1)
+	ZEND_ARG_INFO(0, dateTime)
+ZEND_END_ARG_INFO()
+
 ZEND_BEGIN_ARG_INFO_EX( ainfo_cal_wall_time_option, 0, 0, 2 )
 	ZEND_ARG_OBJ_INFO( 0, calendar, IntlCalendar, 0 )
 	ZEND_ARG_INFO( 0, wallTimeOption )
@@ -785,6 +789,7 @@ zend_function_entry intl_functions[] = {
 	PHP_FE( intlcal_set_first_day_of_week, ainfo_cal_dow )
 	PHP_FE( intlcal_set_lenient, ainfo_cal_set_lenient )
 	PHP_FE( intlcal_equals, ainfo_cal_other_cal )
+	PHP_FE( intlcal_from_date_time, ainfo_cal_from_date_time )
 #if U_ICU_VERSION_MAJOR_NUM >= 49
 	PHP_FE( intlcal_get_repeated_wall_time_option, ainfo_cal_only_cal )
 	PHP_FE( intlcal_get_skipped_wall_time_option, ainfo_cal_only_cal )
diff --git a/ext/intl/tests/calendar_fromDateTime_basic.phpt b/ext/intl/tests/calendar_fromDateTime_basic.phpt
new file mode 100644
index 0000000..1863b78
--- /dev/null
+++ b/ext/intl/tests/calendar_fromDateTime_basic.phpt
@@ -0,0 +1,52 @@
+--TEST--
+IntlCalendar::fromDateTime(): basic test
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+	die('skip intl extension not enabled');
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+ini_set("intl.default_locale", "nl_NL");
+date_default_timezone_set('Europe/Lisbon');
+
+$cal = IntlCalendar::fromDateTime('2012-01-01 00:00:00 Europe/Rome');
+var_dump(
+	$cal->getTime(),
+	strtotime('2012-01-01 00:00:00 Europe/Rome') * 1000.,
+	$cal->getTimeZone()->getID(),
+	$cal->getLocale(1)
+);
+echo "\n";
+
+$cal = IntlCalendar::fromDateTime(new DateTime('2012-01-01 00:00:00 PST'), "pt_PT");
+var_dump(
+	$cal->getTime(),
+	strtotime('2012-01-01 00:00:00 PST') * 1000.,
+	$cal->getTimeZone()->getID(),
+	$cal->getLocale(1)
+);
+
+echo "\n";
+
+$cal = intlcal_from_date_time(new DateTime('2012-01-01 00:00:00 +03:40'));
+var_dump(
+	$cal->getTime(),
+	strtotime('2012-01-01 00:00:00 +03:40') * 1000.,
+	$cal->getTimeZone()->getID()
+);
+
+--EXPECTF--
+float(1325372400000)
+float(1325372400000)
+string(11) "Europe/Rome"
+string(5) "nl_NL"
+
+float(1325404800000)
+float(1325404800000)
+string(3) "PST"
+string(5) "pt_PT"
+
+float(1325362800000)
+float(1325362800000)
+string(%d) "GMT+03%S40"
diff --git a/ext/intl/tests/calendar_fromDateTime_error.phpt b/ext/intl/tests/calendar_fromDateTime_error.phpt
new file mode 100644
index 0000000..b3cb22a
--- /dev/null
+++ b/ext/intl/tests/calendar_fromDateTime_error.phpt
@@ -0,0 +1,61 @@
+--TEST--
+IntlCalendar::fromDateTime(): errors
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+	die('skip intl extension not enabled');
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+ini_set("intl.default_locale", "nl");
+date_default_timezone_set('Europe/Lisbon');
+
+var_dump(IntlCalendar::fromDateTime());
+var_dump(IntlCalendar::fromDateTime(0,1,2));
+
+try {
+IntlCalendar::fromDateTime("foobar");
+} catch (Exception $e) {
+	echo "threw exception, OK";
+}
+class A extends DateTime {
+function __construct() {}
+}
+
+var_dump(IntlCalendar::fromDateTime(new A));
+
+$date = new DateTime('2012-01-01 00:00:00 +24:00');
+var_dump(IntlCalendar::fromDateTime($date));
+
+$date = new DateTime('2012-01-01 00:00:00 WEST');
+var_dump(IntlCalendar::fromDateTime($date));
+
+var_dump(intlcal_from_date_time());
+
+--EXPECTF--
+
+Warning: IntlCalendar::fromDateTime() expects at least 1 parameter, 0 given in %s on line %d
+
+Warning: IntlCalendar::fromDateTime(): intlcal_from_date_time: bad arguments in %s on line %d
+NULL
+
+Warning: IntlCalendar::fromDateTime() expects at most 2 parameters, 3 given in %s on line %d
+
+Warning: IntlCalendar::fromDateTime(): intlcal_from_date_time: bad arguments in %s on line %d
+NULL
+threw exception, OK
+Warning: DateTime::getTimestamp(): The DateTime object has not been correctly initialized by its constructor in %s on line %d
+
+Warning: IntlCalendar::fromDateTime(): intlcal_from_date_time: bad DateTime; call to DateTime::getTimestamp() failed in %s on line %d
+NULL
+
+Warning: IntlCalendar::fromDateTime(): intlcal_from_date_time: object has an time zone offset that's too large in %s on line %d
+NULL
+
+Warning: IntlCalendar::fromDateTime(): intlcal_from_date_time: time zone id 'WEST' extracted from ext/date DateTimeZone not recognized in %s on line %d
+NULL
+
+Warning: intlcal_from_date_time() expects at least 1 parameter, 0 given in %s on line %d
+
+Warning: intlcal_from_date_time(): intlcal_from_date_time: bad arguments in %s on line %d
+NULL


commit 9a35d45a5b2226750e198042201e63a37c127f31
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Fri Apr 6 21:50:08 2012 +0200

    Accept DateTimeZone where time zones are expected.
    
    Also unified timezone handling in IntlCalendar::setTimeZone()
    to that in the IntlCalendar and IntlGregorianCalendar constructors.

diff --git a/ext/intl/calendar/calendar_class.cpp b/ext/intl/calendar/calendar_class.cpp
index 1a47739..ea5339d 100644
--- a/ext/intl/calendar/calendar_class.cpp
+++ b/ext/intl/calendar/calendar_class.cpp
@@ -316,8 +316,8 @@ ZEND_BEGIN_ARG_INFO_EX(ainfo_cal_add, 0, 0, 2)
 	ZEND_ARG_INFO(0, amount)
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO_EX(ainfo_cal_setTimeZone, 0, 0, 2)
-	ZEND_ARG_OBJ_INFO(0, timeZone, IntlTimeZone, 1)
+ZEND_BEGIN_ARG_INFO_EX(ainfo_cal_setTimeZone, 0, 0, 1)
+	ZEND_ARG_INFO(0, timeZone)
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(ainfo_cal_set, 0, 0, 2)
diff --git a/ext/intl/calendar/calendar_methods.cpp b/ext/intl/calendar/calendar_methods.cpp
index f8d977c..0c6450f 100644
--- a/ext/intl/calendar/calendar_methods.cpp
+++ b/ext/intl/calendar/calendar_methods.cpp
@@ -30,6 +30,9 @@ extern "C" {
 #include "../intl_convert.h"
 #include "../locale/locale.h"
 #include <zend_exceptions.h>
+#include <zend_interfaces.h>
+#define _MSC_STDINT_H_ /* avoid redefinitions */
+#include <ext/date/php_date.h>
 }
 #include "../common/common_enum.h"
 
@@ -56,7 +59,7 @@ U_CFUNC PHP_FUNCTION(intlcal_create_instance)
 		RETURN_NULL();
 	}
 
-	timeZone = timezone_process_timezone_argument(zv_timezone,
+	timeZone = timezone_process_timezone_argument(zv_timezone, NULL,
 		"intlcal_create_instance" TSRMLS_CC);
 	if (timeZone == NULL) {
 		RETURN_NULL();
@@ -323,11 +326,10 @@ U_CFUNC PHP_FUNCTION(intlcal_set_time_zone)
 {
 	zval			*zv_timezone;
 	TimeZone		*timeZone;
-	TimeZone_object	*tzo;
 	CALENDAR_METHOD_INIT_VARS;
 
 	if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
-			"OO!", &object, Calendar_ce_ptr, &zv_timezone, TimeZone_ce_ptr) == FAILURE) {
+			"Oz!", &object, Calendar_ce_ptr, &zv_timezone) == FAILURE) {
 		intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
 			"intlcal_set_time_zone: bad arguments", 0 TSRMLS_CC);
 		RETURN_FALSE;
@@ -338,18 +340,10 @@ U_CFUNC PHP_FUNCTION(intlcal_set_time_zone)
 	if (zv_timezone == NULL) {
 		RETURN_TRUE; /* the method does nothing if passed null */
 	}
-
-	tzo = static_cast<TimeZone_object*>(
-		zend_object_store_get_object(zv_timezone TSRMLS_CC));
-	if (tzo->utimezone == NULL) {
-		intl_errors_set(&co->err, U_ILLEGAL_ARGUMENT_ERROR,
-			"intlcal_set_time_zone: found unsconstructed IntlTimeZone", 0 TSRMLS_CC);
-		RETURN_FALSE;
-	}
-	timeZone = tzo->utimezone->clone();
+	
+	timeZone = timezone_process_timezone_argument(&zv_timezone,
+		CALENDAR_ERROR_P(co), "intlcal_set_time_zone" TSRMLS_CC);
 	if (timeZone == NULL) {
-		intl_errors_set(&co->err, U_MEMORY_ALLOCATION_ERROR,
-			"intlcal_set_time_zone: error cloning ICU TimeZone", 0 TSRMLS_CC);
 		RETURN_FALSE;
 	}
 
diff --git a/ext/intl/calendar/gregoriancalendar_methods.cpp b/ext/intl/calendar/gregoriancalendar_methods.cpp
index 31fb8a8..4f26cc5 100644
--- a/ext/intl/calendar/gregoriancalendar_methods.cpp
+++ b/ext/intl/calendar/gregoriancalendar_methods.cpp
@@ -88,7 +88,7 @@ static void _php_intlgregcal_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
 
 	if (variant <= 2) {
 		// From timezone and locale (0 to 2 arguments)
-		TimeZone *tz = timezone_process_timezone_argument(tz_object,
+		TimeZone *tz = timezone_process_timezone_argument(tz_object, NULL,
 			"intlgregcal_create_instance" TSRMLS_CC);
 		if (tz == NULL) {
 			RETURN_NULL();
diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c
index f160f9d..aca3590 100755
--- a/ext/intl/php_intl.c
+++ b/ext/intl/php_intl.c
@@ -516,7 +516,7 @@ ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX( ainfo_cal_set_time_zone, 0, 0, 2 )
 	ZEND_ARG_OBJ_INFO( 0, calendar, IntlCalendar, 0 )
-	ZEND_ARG_OBJ_INFO( 0, timeZone, IntlTimeZone, 1 )
+	ZEND_ARG_INFO( 0, timeZone )
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX( ainfo_cal_set, 0, 0, 3 )
diff --git a/ext/intl/tests/calendar_setTimeZone_error2.phpt b/ext/intl/tests/calendar_setTimeZone_error2.phpt
new file mode 100644
index 0000000..aa1eaba
--- /dev/null
+++ b/ext/intl/tests/calendar_setTimeZone_error2.phpt
@@ -0,0 +1,29 @@
+--TEST--
+IntlCalendar::setTimeZone(): valid time zones for DateTime but not ICU
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+	die('skip intl extension not enabled');
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+ini_set("intl.default_locale", "nl");
+date_default_timezone_set('Europe/Amsterdam');
+
+$intlcal = new IntlGregorianCalendar();
+
+$pstdate = new DateTime('2012-01-01 00:00:00 WEST');
+$intlcal->setTimeZone($pstdate->getTimeZone());
+var_dump($intlcal->getTimeZone()->getID());
+
+$pstdate = new DateTime('2012-01-01 00:00:00 +24:00');
+$intlcal->setTimeZone($pstdate->getTimeZone());
+var_dump($intlcal->getTimeZone()->getID());
+
+--EXPECTF--
+
+Warning: IntlCalendar::setTimeZone(): intlcal_set_time_zone: time zone id 'WEST' extracted from ext/date DateTimeZone not recognized in %s on line %d
+string(16) "Europe/Amsterdam"
+
+Warning: IntlCalendar::setTimeZone(): intlcal_set_time_zone: object has an time zone offset that's too large in %s on line %d
+string(16) "Europe/Amsterdam"
diff --git a/ext/intl/tests/calendar_setTimeZone_variation2.phpt b/ext/intl/tests/calendar_setTimeZone_variation2.phpt
new file mode 100644
index 0000000..26aaf72
--- /dev/null
+++ b/ext/intl/tests/calendar_setTimeZone_variation2.phpt
@@ -0,0 +1,30 @@
+--TEST--
+IntlCalendar::setTimeZone(): different ways to specify time zone
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+	die('skip intl extension not enabled');
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+ini_set("intl.default_locale", "nl");
+date_default_timezone_set('Europe/Amsterdam');
+
+$intlcal = new IntlGregorianCalendar();
+$intlcal->setTimeZone('Europe/Paris');
+var_dump($intlcal->getTimeZone()->getID());
+$intlcal->setTimeZone(new DateTimeZone('Europe/Madrid'));
+var_dump($intlcal->getTimeZone()->getID());
+
+$pstdate = new DateTime('2012-01-01 00:00:00 PST');
+$intlcal->setTimeZone($pstdate->getTimeZone());
+var_dump($intlcal->getTimeZone()->getID());
+
+$offsetdate = new DateTime('2012-01-01 00:00:00 -02:30');
+$intlcal->setTimeZone($offsetdate->getTimeZone());
+var_dump($intlcal->getTimeZone()->getID());
+--EXPECT--
+string(12) "Europe/Paris"
+string(13) "Europe/Madrid"
+string(3) "PST"
+string(8) "GMT-0230"
diff --git a/ext/intl/timezone/timezone_class.cpp b/ext/intl/timezone/timezone_class.cpp
index ad9e6fd..7032368 100644
--- a/ext/intl/timezone/timezone_class.cpp
+++ b/ext/intl/timezone/timezone_class.cpp
@@ -53,10 +53,84 @@ U_CFUNC void timezone_object_construct(const TimeZone *zone, zval *object, int o
 }
 /* }}} */
 
+/* {{{ timezone_convert_datetimezone
+ *      The timezone in DateTime and DateTimeZone is not unified. */
+U_CFUNC TimeZone *timezone_convert_datetimezone(int type,
+												void *object,
+												int is_datetime,
+												intl_error *outside_error,
+												const char *func TSRMLS_DC)
+{
+	const char	*id = NULL,
+				offset_id[] = "GMT+00:00";
+	int			id_len = 0;
+	char		*message;
+	TimeZone	*timeZone;
+
+	switch (type) {
+		case TIMELIB_ZONETYPE_ID:
+			id = is_datetime
+				? ((php_date_obj*)object)->time->tz_info->name
+				: ((php_timezone_obj*)object)->tzi.tz->name;
+			id_len = strlen(id);
+			break;
+		case TIMELIB_ZONETYPE_OFFSET: {
+			int offset_mins = is_datetime
+				? -((php_date_obj*)object)->time->z
+				: -(int)((php_timezone_obj*)object)->tzi.utc_offset,
+				hours = offset_mins / 60,
+				minutes = offset_mins - hours * 60;
+			minutes *= minutes > 0 ? 1 : -1;
+
+			if (offset_mins <= -24 * 60 || offset_mins >= 24 * 60) {
+				spprintf(&message, 0, "%s: object has an time zone offset "
+					"that's too large", func);
+				intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR,
+					message, 1 TSRMLS_CC);
+				efree(message);
+				return NULL;
+			}
+
+			id = offset_id;
+			id_len = spprintf((char**)&id, sizeof(offset_id), "GMT%+03d:%02d",
+				hours, minutes);
+			break;
+		}
+		case TIMELIB_ZONETYPE_ABBR:
+			id = is_datetime
+				? ((php_date_obj*)object)->time->tz_abbr
+				: ((php_timezone_obj*)object)->tzi.z.abbr;
+			id_len = strlen(id);
+			break;
+	}
+
+	UnicodeString s = UnicodeString(id, id_len, US_INV);
+	timeZone = TimeZone::createTimeZone(s);
+#if U_ICU_VERSION_MAJOR_NUM >= 49
+	if (timeZone == TimeZone::getUnknown()) {
+#else
+	UnicodeString resultingId;
+	timeZone->getID(resultingId);
+	if (resultingId == UnicodeString("Etc/Unknown", -1, US_INV)
+			|| resultingId == UnicodeString("GMT", -1, US_INV)) {
+#endif
+		spprintf(&message, 0, "%s: time zone id '%s' "
+			"extracted from ext/date TimeZone not recognized", func, id);
+		intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR,
+			message, 1 TSRMLS_CC);
+		efree(message);
+		delete timeZone;
+		return NULL;
+	}
+	return timeZone;
+}
+/* }}} */
+
 /* {{{ timezone_process_timezone_argument
- * TimeZone argument processor for constructor like functions (sets the global
- * error). */
-TimeZone *timezone_process_timezone_argument(zval **zv_timezone, const char *func TSRMLS_DC)
+ * TimeZone argument processor. outside_error may be NULL (for static functions/constructors) */
+U_CFUNC TimeZone *timezone_process_timezone_argument(zval **zv_timezone,
+													 intl_error *outside_error,
+													 const char *func TSRMLS_DC)
 {
 	zval		local_zv_tz		= zval_used_for_init,
 				*local_zv_tz_p	= &local_zv_tz;
@@ -77,7 +151,7 @@ TimeZone *timezone_process_timezone_argument(zval **zv_timezone, const char *fun
 			spprintf(&message, 0, "%s: passed IntlTimeZone is not "
 				"properly constructed", func);
 			if (message) {
-				intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC);
+				intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC);
 				efree(message);
 			}
 			return NULL;
@@ -86,22 +160,30 @@ TimeZone *timezone_process_timezone_argument(zval **zv_timezone, const char *fun
 		if (timeZone == NULL) {
 			spprintf(&message, 0, "%s: could not clone TimeZone", func);
 			if (message) {
-				intl_error_set(NULL, U_MEMORY_ALLOCATION_ERROR, message, 1 TSRMLS_CC);
+				intl_errors_set(outside_error, U_MEMORY_ALLOCATION_ERROR, message, 1 TSRMLS_CC);
 				efree(message);
 			}
 			return NULL;
 		}
+	} else if (Z_TYPE_PP(zv_timezone) == IS_OBJECT &&
+			instanceof_function(Z_OBJCE_PP(zv_timezone), php_date_get_timezone_ce() TSRMLS_CC)) {
+
+		php_timezone_obj *tzobj = (php_timezone_obj *)zend_objects_get_address(
+				*zv_timezone TSRMLS_CC);
+
+		return timezone_convert_datetimezone(tzobj->type, tzobj, 0,
+			outside_error, func TSRMLS_CC);
 	} else {
 		UnicodeString	id,
 						gottenId;
-		UErrorCode		status = U_ZERO_ERROR;
+		UErrorCode		status = U_ZERO_ERROR; /* outside_error may be NULL */
 		convert_to_string_ex(zv_timezone);
 		if (intl_stringFromChar(id, Z_STRVAL_PP(zv_timezone), Z_STRLEN_PP(zv_timezone),
 				&status) == FAILURE) {
 			spprintf(&message, 0, "%s: Time zone identifier given is not a "
 				"valid UTF-8 string", func);
 			if (message) {
-				intl_error_set(NULL, status, message, 1 TSRMLS_CC);
+				intl_errors_set(outside_error, status, message, 1 TSRMLS_CC);
 				efree(message);
 			}
 			return NULL;
@@ -110,7 +192,7 @@ TimeZone *timezone_process_timezone_argument(zval **zv_timezone, const char *fun
 		if (timeZone == NULL) {
 			spprintf(&message, 0, "%s: could not create time zone", func);
 			if (message) {
-				intl_error_set(NULL, U_MEMORY_ALLOCATION_ERROR, message, 1 TSRMLS_CC);
+				intl_errors_set(outside_error, U_MEMORY_ALLOCATION_ERROR, message, 1 TSRMLS_CC);
 				efree(message);
 			}
 			return NULL;
@@ -119,7 +201,7 @@ TimeZone *timezone_process_timezone_argument(zval **zv_timezone, const char *fun
 			spprintf(&message, 0, "%s: no such time zone: '%s'",
 				func, Z_STRVAL_PP(zv_timezone));
 			if (message) {
-				intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC);
+				intl_errors_set(outside_error, U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC);
 				efree(message);
 			}
 			delete timeZone;
diff --git a/ext/intl/timezone/timezone_class.h b/ext/intl/timezone/timezone_class.h
index 89d6946..d5fabb9 100644
--- a/ext/intl/timezone/timezone_class.h
+++ b/ext/intl/timezone/timezone_class.h
@@ -59,7 +59,8 @@ typedef struct {
 		RETURN_FALSE; \
 	}
 
-TimeZone *timezone_process_timezone_argument(zval **zv_timezone, const char *func TSRMLS_DC);
+TimeZone *timezone_convert_datetimezone(int type, void *object, int is_datetime, intl_error *outside_error, const char *func TSRMLS_DC);
+TimeZone *timezone_process_timezone_argument(zval **zv_timezone, intl_error *error, const char *func TSRMLS_DC);
 
 void timezone_object_construct(const TimeZone *zone, zval *object, int owned TSRMLS_DC);
 


commit 29a85d49ae02d192f03243636b14845209c0ca0d
Author: Christopher Jones <sixd at php.net>
Date:   Wed May 16 10:13:34 2012 -0700

    Dummy (whitespace) change so Dan Brown can verify snap generation from git
    
    PHP snapshots were still pulling from SVN and were out of date. This
    is a dummy PHP 5.4-only commit so Dan can verify what he's updated for
    git in the backend.

diff --git a/UPGRADING b/UPGRADING
index 7177a6d..03222ae 100755
--- a/UPGRADING
+++ b/UPGRADING
@@ -37,9 +37,9 @@ PHP 5.4 UPGRADE NOTES
 =============================
 
 - PHP 5.4 now checks at compile time if /dev/urandom or /dev/arandom
-  are present.  If either is available, session.entropy_file now
+  are present. If either is available, session.entropy_file now
   defaults to that file and session.entropy_length defaults to 32.
-  This provides non-blocking entropy to session id generation.  If you
+  This provides non-blocking entropy to session id generation. If you
   do not want extra entropy for your session ids, add:
 
     session.entropy_file=
@@ -89,9 +89,9 @@ PHP 5.4 UPGRADE NOTES
     session.upload_progress.min_freq
 
 - Added a zend.multibyte directive as a replacement of the PHP compile time
-  configuration option --enable-zend-multibyte.  Now the Zend Engine always
+  configuration option --enable-zend-multibyte. Now the Zend Engine always
   contains code for multibyte support, which can be enabled or disabled at
-  runtime.  Note: It doesn't make a lot of sense to enable this option if
+  runtime. Note: It doesn't make a lot of sense to enable this option if
   ext/mbstring is not enabled, because most functionality is implemented by
   mbstrings callbacks.
 
@@ -107,7 +107,7 @@ PHP 5.4 UPGRADE NOTES
   in a stream fashion (through php://input) without having it copied in memory
   multiple times.
 
-- Added windows_show_crt_warning.  This directive shows the CRT warnings when
+- Added windows_show_crt_warning. This directive shows the CRT warnings when
   enabled. These warnings were displayed by default until now. It is disabled
   by default.
 
@@ -162,7 +162,7 @@ PHP 5.4 UPGRADE NOTES
 
 - Non-numeric string offsets, e.g. $a['foo'] where $a is a string, now
   return false on isset() and true on empty(), and produce warning if
-  trying to use them.  Offsets of types double, bool and null produce
+  trying to use them. Offsets of types double, bool and null produce
   notice. Numeric strings ($a['2']) still work as before.
 
   Note that offsets like '12.3' and '5 and a half' are considered
@@ -207,7 +207,7 @@ PHP 5.4 UPGRADE NOTES
 
 - htmlentities() and htmlspecialchars() are stricter in the code units they
   accept for the asian encodings. For Big5-HKSCS, the octets 0x80 and 0xFF are
-  rejected.  For GB2312/EUC-CN, the octets 0x8E, 0x8F, 0xA0 and 0xFF are
+  rejected. For GB2312/EUC-CN, the octets 0x8E, 0x8F, 0xA0 and 0xFF are
   rejected. For SJIS, the octets 0x80, 0xA0, 0xFD, 0xFE and 0xFF are rejected,
   except maybe after a valid starting byte. For EUC-JP, the octets 0xA0 and
   0xFF are rejected.
@@ -233,7 +233,7 @@ PHP 5.4 UPGRADE NOTES
   checks on the validity of the entities. Numerical entities are checked for a
   valid range (0 to 0x10FFFF); if the flag ENT_DISALLOWED is given, the
   validity of such numerical entity in the target document type is also
-  checked.  Named entities are checked for necessary existence in the target
+  checked. Named entities are checked for necessary existence in the target
   document type instead of only checking whether they were constituted by
   alphanumeric characters.
 
@@ -431,7 +431,7 @@ d. Removed hash algorithms
 a. Extensions no longer maintained
 
    - ext/sqlite is no longer part of the base distribution and has been moved
-     to PECL.  Use sqlite3 or PDO_SQLITE instead.
+     to PECL. Use sqlite3 or PDO_SQLITE instead.
 
 b. Extensions with changed behavior
 
@@ -485,7 +485,7 @@ b. Extensions with changed behavior
 ===========================
 
 - A REQUEST_TIME_FLOAT value returns a floating point number indicating the
-  time with microsecond precision.  All SAPIs providing this value should be
+  time with microsecond precision. All SAPIs providing this value should be
   returning float and not time_t.
 
 - apache_child_terminate(), getallheaders(), apache_request_headers()


commit 51e3e51d3b574519869bf21d0136b25f48ca7a99
Merge: ebe1634 89e7a19
Author: Johannes Schlüter <johannes at php.net>
Date:   Wed May 16 16:50:57 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      PHP 5.3.15-dev



commit 89e7a195bc44b60db08646b724da24fe7b90a610
Merge: 1f6f619 72a9b59
Author: Johannes Schlüter <johannes at php.net>
Date:   Wed May 16 16:50:33 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      PHP 5.3.15-dev
    
    Conflicts:
    	configure.in
    	main/php_version.h



commit 72a9b595ca3e1bc07cf1aa51c91dcbc973f89d10
Author: Johannes Schlüter <johannes at php.net>
Date:   Wed May 16 16:49:35 2012 +0200

    PHP 5.3.15-dev

diff --git a/NEWS b/NEWS
index 990cc65..7fe462b 100644
--- a/NEWS
+++ b/NEWS
@@ -1,53 +1,10 @@
 PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-?? ??? 2012, PHP 5.3.12
+?? ??? 2012, PHP 5.3.15
 
-- CLI SAPI:
-  . Fixed bug #61546 (functions related to current script failed when chdir() 
-    in cli sapi). (Laruence, reeze.xia at gmail.com)
-
-- CURL:
-  . Fixed bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction).
-    (Laruence)
-
-- Core:
-  . Fixed bug #62005 (unexpected behavior when incrementally assigning to a 
-    member of a null object). (Laruence)
-  . Fixed bug #61730 (Segfault from array_walk modifying an array passed by
-    reference). (Laruence)
-  . Fixed missing bound check in iptcparse(). (chris at chiappa.net)
-  . Fixed bug #61764 ('I' unpacks n as signed if n > 2^31-1 on LP64). (Gustavo)
-  . Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename
-    set to null). (Anatoliy)
-  . Fixed bug #61713 (Logic error in charset detection for htmlentities).
-    (Anatoliy)
-  . Fixed bug #61991 (long overflow in realpath_cache_get()). (Anatoliy)
-  . Changed php://fd to be available only for CLI.
-
-- Fileinfo:
-  . Fixed bug #61812 (Uninitialised value used in libmagic). 
-    (Laruence, Gustavo)
-
-- JSON
-  . Fixed bug #61537 (json_encode() incorrectly truncates/discards
-    information). (Adam)
+?? ??? 2012, PHP 5.3.14
 
-- PDO:
-  . Fixed bug #61755 (A parsing bug in the prepared statements can lead to
-    access violations). (Johannes)
-
-- Phar:
-  . Fix bug #61065 (Secunia SA44335). (Rasmus)
-
-- Iconv extension:
-  . Fixed a bug that iconv extension fails to link to the correct library
-    when another extension makes use of a library that links to the iconv
-    library. See https://bugs.gentoo.org/show_bug.cgi?id=364139 for detail.
-    (Moriyoshi)
-
-- Streams:
-  . Fixed bug #61961 (file_get_contents leaks when access empty file with
-    maxlen set). (Reeze)
+(merge after release)
 
 08 May 2012, PHP 5.3.13
 - CGI
diff --git a/configure.in b/configure.in
index 35356d0..6d24249 100644
--- a/configure.in
+++ b/configure.in
@@ -41,7 +41,7 @@ AC_CONFIG_HEADER(main/php_config.h)
 
 PHP_MAJOR_VERSION=5
 PHP_MINOR_VERSION=3
-PHP_RELEASE_VERSION=14
+PHP_RELEASE_VERSION=15
 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/main/php_version.h b/main/php_version.h
index 0b523d7..2f65dbd 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 3
-#define PHP_RELEASE_VERSION 14
+#define PHP_RELEASE_VERSION 15
 #define PHP_EXTRA_VERSION "-dev"
-#define PHP_VERSION "5.3.14-dev"
-#define PHP_VERSION_ID 50314
+#define PHP_VERSION "5.3.15-dev"
+#define PHP_VERSION_ID 50315


commit 67039363cd5f317d77fffb88efcda3ffc6cd5d3f
Merge: 6e51989 d4afbd4
Author: Johannes Schlüter <johannes at php.net>
Date:   Wed May 16 16:46:08 2012 +0200

    Merge branch 'PHP-5.3' of git.php.net:/php-src into PHP-5.3
    
    * 'PHP-5.3' of git.php.net:/php-src:
      Fix for bug#62046



commit ebe16343a28d5a4cda89907611eda5870bd60456
Merge: dec56ca 1f6f619
Author: Johannes Schlüter <johannes at php.net>
Date:   Wed May 16 16:41:23 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      fd fix
      fix bug #61065 (cherry picked from commit a10e778bfb7ce9caa1f91666ddf2705db7982d68)



commit 1f6f6194517b25fea8ed2e0c5c8b0d2e5ae07c1d
Merge: 4d2d8e8 6e51989
Author: Johannes Schlüter <johannes at php.net>
Date:   Wed May 16 16:40:29 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      fd fix
      fix bug #61065 (cherry picked from commit a10e778bfb7ce9caa1f91666ddf2705db7982d68)



commit 6e519895011ea3ef43ce62c1050e72337af94b79
Author: Stanislav Malyshev <stas at php.net>
Date:   Tue May 15 22:35:43 2012 -0700

    fd fix

diff --git a/NEWS b/NEWS
index 1057db7..990cc65 100644
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,7 @@ PHP                                                                        NEWS
   . Fixed bug #61713 (Logic error in charset detection for htmlentities).
     (Anatoliy)
   . Fixed bug #61991 (long overflow in realpath_cache_get()). (Anatoliy)
+  . Changed php://fd to be available only for CLI.
 
 - Fileinfo:
   . Fixed bug #61812 (Uninitialised value used in libmagic). 
@@ -35,6 +36,9 @@ PHP                                                                        NEWS
   . Fixed bug #61755 (A parsing bug in the prepared statements can lead to
     access violations). (Johannes)
 
+- Phar:
+  . Fix bug #61065 (Secunia SA44335). (Rasmus)
+
 - Iconv extension:
   . Fixed a bug that iconv extension fails to link to the correct library
     when another extension makes use of a library that links to the iconv
diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c
index a831dd1..b51aaa2 100644
--- a/ext/standard/php_fopen_wrapper.c
+++ b/ext/standard/php_fopen_wrapper.c
@@ -263,6 +263,20 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, char *path, ch
 		long	   fildes_ori;
 		int		   dtablesize;
 
+		if (strcmp(sapi_module.name, "cli")) {
+			if (options & REPORT_ERRORS) {
+				php_error_docref(NULL TSRMLS_CC, E_WARNING, "Direct access to file descriptors is only available from command-line PHP");
+			}
+			return NULL;
+		}
+
+		if ((options & STREAM_OPEN_FOR_INCLUDE) && !PG(allow_url_include) ) {
+			if (options & REPORT_ERRORS) {
+				php_error_docref(NULL TSRMLS_CC, E_WARNING, "URL file-access is disabled in the server configuration");
+			}
+			return NULL;
+		}
+
 		start = &path[3];
 		fildes_ori = strtol(start, &end, 10);
 		if (end == start || *end != '\0') {


commit 4eb802bb14b05b82573457bc0f528e61ca7ddc45
Author: Stanislav Malyshev <stas at php.net>
Date:   Tue May 15 22:34:34 2012 -0700

    fix bug #61065
    (cherry picked from commit a10e778bfb7ce9caa1f91666ddf2705db7982d68)

diff --git a/ext/phar/tar.c b/ext/phar/tar.c
index 9d1e5bc..b914db1 100644
--- a/ext/phar/tar.c
+++ b/ext/phar/tar.c
@@ -337,6 +337,16 @@ bail:
 			last_was_longlink = 1;
 			/* support the ././@LongLink system for storing long filenames */
 			entry.filename_len = entry.uncompressed_filesize;
+
+			/* Check for overflow - bug 61065 */
+			if (entry.filename_len == UINT_MAX) {
+				if (error) {
+					spprintf(error, 4096, "phar error: \"%s\" is a corrupted tar file (invalid entry size)", fname);
+				}
+				php_stream_close(fp);
+				phar_destroy_phar_data(myphar TSRMLS_CC);
+				return FAILURE;
+			}
 			entry.filename = pemalloc(entry.filename_len+1, myphar->is_persistent);
 
 			read = php_stream_read(fp, entry.filename, entry.filename_len);


commit dec56ca1e3df44f48feca3ec6d11d6ad97f83576
Merge: 42faa07 4d2d8e8
Author: andrey <andrey at php.net>
Date:   Wed May 16 16:00:17 2012 +0200

    Merge branch 'PHP-5.4'



commit 4d2d8e871771be0342869e6710ef4e74346db1e7
Merge: 1abcd81 d4afbd4
Author: andrey <andrey at php.net>
Date:   Wed May 16 15:59:39 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    Conflicts:
    	ext/mysqlnd/mysqlnd_ps.c
    
    merge fix for bug#62046

diff --cc ext/mysqlnd/mysqlnd_ps.c
index 90e6856,d762689..1b48ba1
--- a/ext/mysqlnd/mysqlnd_ps.c
+++ b/ext/mysqlnd/mysqlnd_ps.c
@@@ -636,9 -657,9 +636,11 @@@ MYSQLND_METHOD(mysqlnd_stmt, execute)(M
  		  have it again.
  		*/
  		stmt->result->m.free_result_buffers(stmt->result TSRMLS_CC);
++
++		stmt->state = MYSQLND_STMT_PREPARED;
  	} else if (stmt->state < MYSQLND_STMT_PREPARED) {
  		/* Only initted - error */
 -		SET_CLIENT_ERROR(conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE,
 +		SET_CLIENT_ERROR(*conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE,
  						 mysqlnd_out_of_sync);
  		SET_STMT_ERROR(stmt, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, mysqlnd_out_of_sync);
  		DBG_INF("FAIL");
@@@ -1205,45 -1233,6 +1207,43 @@@ MYSQLND_METHOD(mysqlnd_stmt, reset)(MYS
  			}
  		}
  
 +		s->m->flush(s TSRMLS_CC);
 +
 +		/*
 +		  Don't free now, let the result be usable. When the stmt will again be
 +		  executed then the result set will be cleaned, the bound variables will
 +		  be separated before that.
 +		*/
 +
 +		int4store(cmd_buf, stmt->stmt_id);
 +		if (CONN_GET_STATE(conn) == CONN_READY &&
 +			FAIL == (ret = conn->m->simple_command(conn, COM_STMT_RESET, cmd_buf,
 +												  sizeof(cmd_buf), PROT_OK_PACKET,
 +												  FALSE, TRUE TSRMLS_CC))) {
 +			COPY_CLIENT_ERROR(*stmt->error_info, *conn->error_info);
 +		}
 +		*stmt->upsert_status = *conn->upsert_status;
- 
- 		stmt->state = MYSQLND_STMT_PREPARED;
 +	}
 +	DBG_INF(ret == PASS? "PASS":"FAIL");
 +	DBG_RETURN(ret);
 +}
 +/* }}} */
 +
 +
 +/* {{{ mysqlnd_stmt::flush */
 +static enum_func_status
 +MYSQLND_METHOD(mysqlnd_stmt, flush)(MYSQLND_STMT * const s TSRMLS_DC)
 +{
 +	MYSQLND_STMT_DATA * stmt = s? s->data:NULL;
 +	enum_func_status ret = PASS;
 +
 +	DBG_ENTER("mysqlnd_stmt::flush");
 +	if (!stmt || !stmt->conn) {
 +		DBG_RETURN(FAIL);
 +	}
 +	DBG_INF_FMT("stmt=%lu", stmt->stmt_id);
 +
 +	if (stmt->stmt_id) {
  		/*
  		  If the user decided to close the statement right after execute()
  		  We have to call the appropriate use_result() or store_result() and
@@@ -1261,8 -1250,21 +1261,6 @@@
  				stmt->result->m.skip_result(stmt->result TSRMLS_CC);
  			}
  		} while (mysqlnd_stmt_more_results(s) && mysqlnd_stmt_next_result(s) == PASS);
--
- 		stmt->state = MYSQLND_STMT_PREPARED;
 -		/*
 -		  Don't free now, let the result be usable. When the stmt will again be
 -		  executed then the result set will be cleaned, the bound variables will
 -		  be separated before that.
 -		*/
 -
 -		int4store(cmd_buf, stmt->stmt_id);
 -		if (CONN_GET_STATE(conn) == CONN_READY &&
 -			FAIL == (ret = conn->m->simple_command(conn, COM_STMT_RESET, (char *)cmd_buf,
 -												  sizeof(cmd_buf), PROT_OK_PACKET,
 -												  FALSE, TRUE TSRMLS_CC))) {
 -			stmt->error_info = conn->error_info;
 -		}
 -		stmt->upsert_status = conn->upsert_status;
  	}
  	DBG_INF(ret == PASS? "PASS":"FAIL");
  	DBG_RETURN(ret);


commit d4afbd487abbe9e5f3e4fc6c44974639e123406a
Author: andrey <andrey at php.net>
Date:   Wed May 16 14:28:55 2012 +0200

    Fix for bug#62046
    
    Bug#62046 mysqli at mysqlnd can't iterate over stored sets after call to
    mysqli_stmt_reset().
    
    Stmt's state was changed to STMT_PREPARED and leads the driver to think
    that the stmt was just prepared. Because result set exist also for only
    prepared but not executed sets, the check for stmt->result isn't any good.
    There is a result set, because as response for COM_PREPARE the server sends
    metadata and metadata is part of a result set. After COM_EXECUTE the server
    sends metadata again, which could be different and in this case more correct.

diff --git a/ext/mysqli/tests/bug62046.phpt b/ext/mysqli/tests/bug62046.phpt
new file mode 100644
index 0000000..31a7328
--- /dev/null
+++ b/ext/mysqli/tests/bug62046.phpt
@@ -0,0 +1,40 @@
+--TEST--
+Bug #62046 	mysqli at mysqlnd can't iterate over stored sets after call to mysqli_stmt_reset()
+--SKIPIF--
+<?php
+require_once('skipif.inc');
+require_once('skipifconnectfailure.inc');
+?>
+--FILE--
+<?php
+	require_once("connect.inc");
+
+	if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
+		printf("[001] Connect failed, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
+	}
+	if (FALSE === ($stmt = $link->prepare('SELECT 42'))) {
+		printf("[002] Prepare failed, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
+	}
+	if (FALSE === $stmt->execute()) {
+		printf("[003] Execute failed, [%d] %s\n", $stmt->errorno, $stmt->error);	
+	}
+	if (FALSE === $stmt->store_result()) {
+		printf("[004] store_result failed, [%d] %s\n", $stmt->errorno, $stmt->error);	
+	}
+	$one = NULL;
+	if (FALSE === $stmt->bind_result($one)) {
+		printf("[005] bind_result failed, [%d] %s\n", $stmt->errorno, $stmt->error);	
+	}
+	if (FALSE === $stmt->reset()) {
+		printf("[006] bind_result failed, [%d] %s\n", $stmt->errorno, $stmt->error);
+	}
+	while ($stmt->fetch()) {
+		var_dump($one);
+	}
+	$stmt->close();
+	$link->close();
+	echo "done!";
+?>
+--EXPECT--
+int(42)
+done!
\ No newline at end of file
diff --git a/ext/mysqlnd/mysqlnd_ps.c b/ext/mysqlnd/mysqlnd_ps.c
index 2044390..d762689 100644
--- a/ext/mysqlnd/mysqlnd_ps.c
+++ b/ext/mysqlnd/mysqlnd_ps.c
@@ -1265,8 +1265,6 @@ MYSQLND_METHOD(mysqlnd_stmt, reset)(MYSQLND_STMT * const s TSRMLS_DC)
 			stmt->error_info = conn->error_info;
 		}
 		stmt->upsert_status = conn->upsert_status;
-
-		stmt->state = MYSQLND_STMT_PREPARED;
 	}
 	DBG_INF(ret == PASS? "PASS":"FAIL");
 	DBG_RETURN(ret);


commit 42faa077f9e763d29ee157a59e21007d7fd937aa
Merge: 910a469 1abcd81
Author: Felipe Pena <felipensp at gmail.com>
Date:   Wed May 16 08:40:53 2012 -0300

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      - Fixed bug #55299 (multiple null pointer in win32/registry.c)



commit 1abcd81872978026d269532c2f5f1e0f35dcb729
Merge: d84fa39 93c91c7
Author: Felipe Pena <felipensp at gmail.com>
Date:   Wed May 16 08:40:45 2012 -0300

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      - Fixed bug #55299 (multiple null pointer in win32/registry.c)



commit 93c91c733cf2259263e4d8c0f3ccc254246d404d
Author: Felipe Pena <felipensp at gmail.com>
Date:   Wed May 16 08:40:12 2012 -0300

    - Fixed bug #55299 (multiple null pointer in win32/registry.c)

diff --git a/win32/registry.c b/win32/registry.c
index 35b411f..45e842b 100644
--- a/win32/registry.c
+++ b/win32/registry.c
@@ -77,11 +77,16 @@ static int LoadDirectory(HashTable *directories, HKEY key, char *path, int path_
 				value_len = max_value+1;
 				if (RegEnumValue(key, i, name, &name_len, NULL, &type, value, &value_len) == ERROR_SUCCESS) {
 					if ((type == REG_SZ) || (type == REG_EXPAND_SZ)) {
+						ht = (HashTable*)malloc(sizeof(HashTable));
 						if (!ht) {
-							ht = (HashTable*)malloc(sizeof(HashTable));
-							zend_hash_init(ht, 0, NULL, ZVAL_INTERNAL_PTR_DTOR, 1);
+							return ret;
 						}
+						zend_hash_init(ht, 0, NULL, ZVAL_INTERNAL_PTR_DTOR, 1);
+
 						data = (zval*)malloc(sizeof(zval));
+						if (!data) {
+							return ret;
+						}
 						INIT_PZVAL(data);
 						Z_STRVAL_P(data) = zend_strndup(value, value_len-1);
 						Z_STRLEN_P(data) = value_len-1;
@@ -174,6 +179,9 @@ void UpdateIniFromRegistry(char *path TSRMLS_DC)
 
 	if (!PW32G(registry_directories)) {
 		PW32G(registry_directories) = (HashTable*)malloc(sizeof(HashTable));
+		if (!PW32G(registry_directories)) {
+			return;
+		}
 		zend_hash_init(PW32G(registry_directories), 0, NULL, delete_internal_hashtable, 1);
 		if (!OpenPhpRegistryKey("\\Per Directory Values", &PW32G(registry_key))) {
 			PW32G(registry_key) = NULL;


commit 910a4696e19eba9801473d5a275330495ea14215
Merge: 6a0212e d84fa39
Author: Stanislav Malyshev <stas at php.net>
Date:   Tue May 15 23:30:34 2012 -0700

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Revert "Update test to fix breakage caused by the previous commit."
      fix test
      to 5.4.5-dev



commit d84fa39667111a4efb5a17e29d3d0f795505047a
Author: Stanislav Malyshev <stas at php.net>
Date:   Tue May 15 23:25:06 2012 -0700

    Revert "Update test to fix breakage caused by the previous commit."
    
    This reverts commit 05c8d4766c272e101b5279f0ec432e1b16e74637.
    Connected to revert 7bbd5521d28ee77c5a8df80174f52dad0112e872.

diff --git a/ext/json/tests/bug53946.phpt b/ext/json/tests/bug53946.phpt
index 079906f..abbb812 100644
--- a/ext/json/tests/bug53946.phpt
+++ b/ext/json/tests/bug53946.phpt
@@ -9,12 +9,8 @@ var_dump(json_encode("latin 1234 -/    russian мама мыла раму  speci
 var_dump(json_encode("ab\xE0"));
 var_dump(json_encode("ab\xE0", JSON_UNESCAPED_UNICODE));
 ?>
---EXPECTF--
+--EXPECT--
 string(156) ""latin 1234 -\/    russian \u043c\u0430\u043c\u0430 \u043c\u044b\u043b\u0430 \u0440\u0430\u043c\u0443  specialchars \u0002   \b \n   U+1D11E >\ud834\udd1e<""
 string(100) ""latin 1234 -\/    russian мама мыла раму  specialchars \u0002   \b \n   U+1D11E >𝄞<""
-
-Warning: json_encode(): Invalid UTF-8 sequence in argument in %s on line %d
-bool(false)
-
-Warning: json_encode(): Invalid UTF-8 sequence in argument in %s on line %d
-bool(false)
+string(4) "null"
+string(4) "null"


commit e36a5a1197a26f9641aec36810ec3afe62317c94
Author: Stanislav Malyshev <stas at php.net>
Date:   Tue May 15 23:09:46 2012 -0700

    fix test

diff --git a/tests/output/ob_013.phpt b/tests/output/ob_013.phpt
index e96de46..ad2e36d 100644
--- a/tests/output/ob_013.phpt
+++ b/tests/output/ob_013.phpt
@@ -39,7 +39,7 @@ Array
 (
     [name] => d
     [type] => 1
-    [flags] => 4209
+    [flags] => 20593
     [level] => 4
     [chunk_size] => %d
     [buffer_size] => 16384
@@ -95,7 +95,7 @@ Array
         (
             [name] => d
             [type] => 1
-            [flags] => 4209
+            [flags] => 20593
             [level] => 4
             [chunk_size] => %d
             [buffer_size] => 16384


commit be8b1c74cfde32422482403385ded3e8240a2c4b
Author: Stanislav Malyshev <stas at php.net>
Date:   Tue May 15 22:46:49 2012 -0700

    to 5.4.5-dev

diff --git a/configure.in b/configure.in
index ba8b465..1e80689 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=4
+PHP_RELEASE_VERSION=5
 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/main/php_version.h b/main/php_version.h
index fce469d..6b49f40 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 4
+#define PHP_RELEASE_VERSION 5
 #define PHP_EXTRA_VERSION "-dev"
-#define PHP_VERSION "5.4.4-dev"
+#define PHP_VERSION "5.4.5-dev"
 #define PHP_VERSION_ID 50404


commit 6a0212ea8859588988454abe2b23ee7b6e536da6
Merge: 129c830 df2a38e
Author: Stanislav Malyshev <stas at php.net>
Date:   Tue May 15 22:39:17 2012 -0700

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      fd fix
      fix bug #61065
    
    Conflicts:
    	UPGRADING



commit df2a38e7f8603f51afa4c2257b3369067817d818
Author: Stanislav Malyshev <stas at php.net>
Date:   Tue May 15 22:35:43 2012 -0700

    fd fix

diff --git a/NEWS b/NEWS
index 01481a3..6b63e90 100644
--- a/NEWS
+++ b/NEWS
@@ -40,6 +40,10 @@ PHP                                                                        NEWS
   . Fixed bug #54547 (wrong equality of string numbers). (Gustavo)
   . Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename
     set to null). (Anatoliy)
+  . Changed php://fd to be available only for CLI.
+
+- Phar:
+  . Fix bug #61065 (Secunia SA44335). (Rasmus)
 
 - Reflection:
   . Implemented FR #61602 (Allow access to the name of constant
diff --git a/UPGRADING b/UPGRADING
index 391c365..7177a6d 100755
--- a/UPGRADING
+++ b/UPGRADING
@@ -339,6 +339,8 @@ PHP 5.4 UPGRADE NOTES
 - ob_start() no longer starts multiple output buffers when passed
   array("callback1", "callback2", "callback3", ...).
 
+- Since 5.4.4, "php://fd" stream syntax is available only in CLI build.
+
 ==============================
 5. Changes to existing classes
 ==============================
diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c
index a831dd1..b51aaa2 100644
--- a/ext/standard/php_fopen_wrapper.c
+++ b/ext/standard/php_fopen_wrapper.c
@@ -263,6 +263,20 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, char *path, ch
 		long	   fildes_ori;
 		int		   dtablesize;
 
+		if (strcmp(sapi_module.name, "cli")) {
+			if (options & REPORT_ERRORS) {
+				php_error_docref(NULL TSRMLS_CC, E_WARNING, "Direct access to file descriptors is only available from command-line PHP");
+			}
+			return NULL;
+		}
+
+		if ((options & STREAM_OPEN_FOR_INCLUDE) && !PG(allow_url_include) ) {
+			if (options & REPORT_ERRORS) {
+				php_error_docref(NULL TSRMLS_CC, E_WARNING, "URL file-access is disabled in the server configuration");
+			}
+			return NULL;
+		}
+
 		start = &path[3];
 		fildes_ori = strtol(start, &end, 10);
 		if (end == start || *end != '\0') {


commit a10e778bfb7ce9caa1f91666ddf2705db7982d68
Author: Stanislav Malyshev <stas at php.net>
Date:   Tue May 15 22:34:34 2012 -0700

    fix bug #61065

diff --git a/ext/phar/tar.c b/ext/phar/tar.c
index 9d1e5bc..b914db1 100644
--- a/ext/phar/tar.c
+++ b/ext/phar/tar.c
@@ -337,6 +337,16 @@ bail:
 			last_was_longlink = 1;
 			/* support the ././@LongLink system for storing long filenames */
 			entry.filename_len = entry.uncompressed_filesize;
+
+			/* Check for overflow - bug 61065 */
+			if (entry.filename_len == UINT_MAX) {
+				if (error) {
+					spprintf(error, 4096, "phar error: \"%s\" is a corrupted tar file (invalid entry size)", fname);
+				}
+				php_stream_close(fp);
+				phar_destroy_phar_data(myphar TSRMLS_CC);
+				return FAILURE;
+			}
 			entry.filename = pemalloc(entry.filename_len+1, myphar->is_persistent);
 
 			read = php_stream_read(fp, entry.filename, entry.filename_len);


commit 129c83056263da0adb11734ad1bea57e3abe62f5
Merge: 3556efc 6340126
Author: zoe slattery <zoe at php.net>
Date:   Tue May 15 14:40:49 2012 +0100

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Changes to remaining two tests, #62022



commit 63401268db9cf9b0e07b7a5819644d61f572746a
Author: zoe slattery <zoe at php.net>
Date:   Tue May 15 14:39:51 2012 +0100

    Changes to remaining two tests, #62022

diff --git a/ext/mysqli/tests/mysqli_options_openbasedir.phpt b/ext/mysqli/tests/mysqli_options_openbasedir.phpt
index 500baf3..4c13ec1 100644
--- a/ext/mysqli/tests/mysqli_options_openbasedir.phpt
+++ b/ext/mysqli/tests/mysqli_options_openbasedir.phpt
@@ -6,7 +6,6 @@ require_once('skipif.inc');
 require_once('skipifemb.inc');
 require_once('skipifconnectfailure.inc');
 ?>
---INI--
 --FILE--
 <?php
 	require_once('connect.inc');
diff --git a/ext/standard/tests/strings/htmlentities15.phpt b/ext/standard/tests/strings/htmlentities15.phpt
index 54c1b06..e5729f9 100644
--- a/ext/standard/tests/strings/htmlentities15.phpt
+++ b/ext/standard/tests/strings/htmlentities15.phpt
@@ -11,7 +11,7 @@ if (!$result || preg_match('/koi8/i', setlocale(LC_CTYPE, 0)) == 0) {
 	die("skip setlocale() failed\n");
 }
 ?>
---COMMENT--
+--DESCRIPTION--
 As of PHP 5.4, htmlentities() no longer makes replacements with numerical
 entities. Hence, for this input there's no substitution.
 --FILE--


commit 3556efc8e21161fe33f53149e8d4daa3831f2763
Merge: ec3a96a d99203d
Author: zoe slattery <zoe at php.net>
Date:   Tue May 15 11:48:21 2012 +0100

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Small fixes to tests, see #62022



commit d99203d44bac39a7cc8ee031534ee638545a6753
Merge: 968dfae e35f09d
Author: zoe slattery <zoe at php.net>
Date:   Tue May 15 11:43:28 2012 +0100

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Small fixes to tests, see #62022



commit e35f09d7743defe37f99305a9b1e96b48cdec4b4
Author: zoe slattery <zoe at php.net>
Date:   Tue May 15 11:42:14 2012 +0100

    Small fixes to tests, see #62022

diff --git a/ext/dom/tests/DOMAttr_value_basic_001.phpt b/ext/dom/tests/DOMAttr_value_basic_001.phpt
index 40e00bc..51c4ac9 100755
--- a/ext/dom/tests/DOMAttr_value_basic_001.phpt
+++ b/ext/dom/tests/DOMAttr_value_basic_001.phpt
@@ -1,6 +1,6 @@
 --TEST--
 Read empty $value. 
---CREDIT--
+--CREDITS--
 Jason Bouffard <jbouffard1 at yahoo.com>
 # TestFest Atlanta 2009-05-14
 --SKIPIF--
@@ -13,4 +13,4 @@ print $attr->value."\n";
 ===DONE===
 --EXPECTF--
 ===DONE===
-	
\ No newline at end of file
+	
diff --git a/ext/dom/tests/DOMAttr_value_basic_002.phpt b/ext/dom/tests/DOMAttr_value_basic_002.phpt
index cf71eeb..384a9ca 100644
--- a/ext/dom/tests/DOMAttr_value_basic_002.phpt
+++ b/ext/dom/tests/DOMAttr_value_basic_002.phpt
@@ -1,6 +1,6 @@
 --TEST--
 Write non-string $value property
---CREDIT--
+--CREDITS--
 Eric Berg <ehberg at gmail.com>
 # TestFest Atlanta 2009-05-14
 --SKIPIF--
@@ -12,4 +12,4 @@ $attr->value = 1;
 print $attr->value;
 ?>
 --EXPECTF--
-1
\ No newline at end of file
+1
diff --git a/ext/dom/tests/DOMCharacterData_data_error_002.phpt b/ext/dom/tests/DOMCharacterData_data_error_002.phpt
index 9dae096..401e0f2 100755
--- a/ext/dom/tests/DOMCharacterData_data_error_002.phpt
+++ b/ext/dom/tests/DOMCharacterData_data_error_002.phpt
@@ -1,6 +1,6 @@
 --TEST--
 Invalid State Error when getting data on DOMCharacterData out of content.
---CREDIT--
+--CREDITS--
 Eric Berg <ehberg at gmail.com>
 # TestFest Atlanta 2009-05-14
 --SKIPIF--
@@ -11,4 +11,4 @@ $character_data = new DOMCharacterData();
 print $character_data->data;
 ?>
 --EXPECTF--
-Warning: main(): Invalid State Error in %s on line %d
\ No newline at end of file
+Warning: main(): Invalid State Error in %s on line %d
diff --git a/ext/dom/tests/DOMCharacterData_length_error_001.phpt b/ext/dom/tests/DOMCharacterData_length_error_001.phpt
index 0dda492..e8bf16a 100755
--- a/ext/dom/tests/DOMCharacterData_length_error_001.phpt
+++ b/ext/dom/tests/DOMCharacterData_length_error_001.phpt
@@ -1,6 +1,6 @@
 --TEST--
 Invalid State Error when getting length on DOMCharacterData out of content.
---CREDIT--
+--CREDITS--
 Jason Bouffard <jbouffard1 at yahoo.com>
 # TestFest Atlanta 2009-05-14
 --SKIPIF--
@@ -14,4 +14,4 @@ print $character_data->length;
 --EXPECTF--
 Warning: main(): Invalid State Error in %s
 ===DONE===
-	
\ No newline at end of file
+	
diff --git a/ext/posix/tests/posix_setgid_error.phpt b/ext/posix/tests/posix_setgid_error.phpt
index 247435d..83d727c 100644
--- a/ext/posix/tests/posix_setgid_error.phpt
+++ b/ext/posix/tests/posix_setgid_error.phpt
@@ -1,6 +1,5 @@
 --TEST--
 Test function posix_setgid() by calling it more than or less than its expected arguments.
---CREDITS--
 --SKIPIF--
 <?php 
         if(!extension_loaded("posix")) print "skip - POSIX extension not loaded"; 
diff --git a/ext/reflection/tests/bug47254.phpt b/ext/reflection/tests/bug47254.phpt
index 4bcce1b..83593a4 100644
--- a/ext/reflection/tests/bug47254.phpt
+++ b/ext/reflection/tests/bug47254.phpt
@@ -23,7 +23,6 @@ $m = $R->getMethods();
 print_r($m);
 
 ?>
---CLEAN--
 --EXPECT--
 Array
 (
diff --git a/ext/standard/tests/file/windows_links/bug48746.phpt b/ext/standard/tests/file/windows_links/bug48746.phpt
index 55465ae..5978e7f 100644
--- a/ext/standard/tests/file/windows_links/bug48746.phpt
+++ b/ext/standard/tests/file/windows_links/bug48746.phpt
@@ -1,7 +1,7 @@
 --TEST--
 Bug#48746 - Junction not working properly
 
---CREDIT--
+--CREDITS--
 Venkat Raman Don (don.raman at microsoft.com)
 
 --SKIPIF--
diff --git a/ext/standard/tests/file/windows_links/bug48746_1.phpt b/ext/standard/tests/file/windows_links/bug48746_1.phpt
index 5d8e685..a4277a4 100644
--- a/ext/standard/tests/file/windows_links/bug48746_1.phpt
+++ b/ext/standard/tests/file/windows_links/bug48746_1.phpt
@@ -1,7 +1,7 @@
 --TEST--
 Bug#48746 - Junction not working properly
 
---CREDIT--
+--CREDITS--
 Venkat Raman Don (don.raman at microsoft.com)
 
 --SKIPIF--
diff --git a/ext/standard/tests/file/windows_links/bug48746_2.phpt b/ext/standard/tests/file/windows_links/bug48746_2.phpt
index 56924a5..509610f 100644
--- a/ext/standard/tests/file/windows_links/bug48746_2.phpt
+++ b/ext/standard/tests/file/windows_links/bug48746_2.phpt
@@ -1,7 +1,7 @@
 --TEST--
 Bug#48746 - Junction not working properly
 
---CREDIT--
+--CREDITS--
 Venkat Raman Don (don.raman at microsoft.com)
 
 --SKIPIF--
diff --git a/ext/standard/tests/file/windows_links/bug48746_3.phpt b/ext/standard/tests/file/windows_links/bug48746_3.phpt
index b88ab76..98e8178 100644
--- a/ext/standard/tests/file/windows_links/bug48746_3.phpt
+++ b/ext/standard/tests/file/windows_links/bug48746_3.phpt
@@ -1,7 +1,7 @@
 --TEST--
 Bug#48746 - Junction not working properly
 
---CREDIT--
+--CREDITS--
 Venkat Raman Don (don.raman at microsoft.com)
 
 --SKIPIF--


commit ec3a96a2e674f6a45122b89c908030f263863bc3
Merge: c10c70f 968dfae
Author: zoe slattery <zoe at php.net>
Date:   Tue May 15 11:06:48 2012 +0100

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Change impl of GZIP_POST, DEFLATE_POST. See #62021



commit 968dfae6d1555ec8e9e9029ee9963579d0993130
Merge: 956d745 1af8b3f
Author: zoe slattery <zoe at php.net>
Date:   Tue May 15 11:06:14 2012 +0100

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Change impl of GZIP_POST, DEFLATE_POST. See #62021



commit 1af8b3f8836bd8fb997ebfead82cbf21d33ed916
Author: zoe slattery <zoe at php.net>
Date:   Tue May 15 11:05:20 2012 +0100

    Change impl of GZIP_POST, DEFLATE_POST. See #62021

diff --git a/ext/soap/tests/server019.phpt b/ext/soap/tests/server019.phpt
index defdac5..d36cff0 100644
--- a/ext/soap/tests/server019.phpt
+++ b/ext/soap/tests/server019.phpt
@@ -8,7 +8,7 @@ SOAP Server 19: compressed request (gzip)
 ?>
 --INI--
 precision=14
---POST--
+--GZIP_POST--
 <SOAP-ENV:Envelope
   SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
   xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
@@ -19,8 +19,6 @@ precision=14
     <ns1:test xmlns:ns1="http://testuri.org" />
   </SOAP-ENV:Body>
 </SOAP-ENV:Envelope>
---GZIP_POST--
-1
 --FILE--
 <?php
 function test() {
diff --git a/ext/soap/tests/server020.phpt b/ext/soap/tests/server020.phpt
index 1bd5893..b14978f 100644
--- a/ext/soap/tests/server020.phpt
+++ b/ext/soap/tests/server020.phpt
@@ -8,7 +8,7 @@ SOAP Server 20: compressed request (deflate)
 ?>
 --INI--
 precision=14
---POST--
+--DEFLATE_POST--
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <SOAP-ENV:Envelope
   SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
@@ -20,8 +20,6 @@ precision=14
     <ns1:test xmlns:ns1="http://testuri.org" />
   </SOAP-ENV:Body>
 </SOAP-ENV:Envelope>
---DEFLATE_POST--
-1
 --FILE--
 <?php
 function test() {
diff --git a/run-tests.php b/run-tests.php
index cc193e5..1fe0deb 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -1315,7 +1315,7 @@ TEST $file
 	$tested = trim($section_text['TEST']);
 
 	/* For GET/POST/PUT tests, check if cgi sapi is available and if it is, use it. */
-	if (!empty($section_text['GET']) || !empty($section_text['POST']) || !empty($section_text['POST_RAW']) || !empty($section_text['PUT']) || !empty($section_text['COOKIE']) || !empty($section_text['EXPECTHEADERS'])) {
+	if (!empty($section_text['GET']) || !empty($section_text['POST']) || !empty($section_text['GZIP_POST']) || !empty($section_text['DEFLATE_POST']) || !empty($section_text['POST_RAW']) || !empty($section_text['PUT']) || !empty($section_text['COOKIE']) || !empty($section_text['EXPECTHEADERS'])) {
 		if (isset($php_cgi)) {
 			$old_php = $php;
 			$php = $php_cgi . ' -C ';
@@ -1700,15 +1700,6 @@ TEST $file
 	} else if (array_key_exists('POST', $section_text) && !empty($section_text['POST'])) {
 
 		$post = trim($section_text['POST']);
-
-		if (array_key_exists('GZIP_POST', $section_text) && function_exists('gzencode')) {
-			$post = gzencode($post, 9, FORCE_GZIP);
-			$env['HTTP_CONTENT_ENCODING'] = 'gzip';
-		} else if (array_key_exists('DEFLATE_POST', $section_text) && function_exists('gzcompress')) {
-			$post = gzcompress($post, 9);
-			$env['HTTP_CONTENT_ENCODING'] = 'deflate';
-		}
-
 		save_text($tmp_post, $post);
 		$content_length = strlen($post);
 
@@ -1718,6 +1709,35 @@ TEST $file
 
 		$cmd = "$php $pass_options $ini_settings -f \"$test_file\" 2>&1 < \"$tmp_post\"";
 
+    } else if (array_key_exists('GZIP_POST', $section_text) && !empty($section_text['GZIP_POST'])) {
+
+        $post = trim($section_text['GZIP_POST']);
+        $post = gzencode($post, 9, FORCE_GZIP);
+        $env['HTTP_CONTENT_ENCODING'] = 'gzip';
+
+        save_text($tmp_post, $post);
+        $content_length = strlen($post);
+
+        $env['REQUEST_METHOD'] = 'POST';
+        $env['CONTENT_TYPE']   = 'application/x-www-form-urlencoded';
+        $env['CONTENT_LENGTH'] = $content_length;
+
+        $cmd = "$php $pass_options $ini_settings -f \"$test_file\" 2>&1 < \"$tmp_post\"";
+
+    } else if (array_key_exists('DEFLATE_POST', $section_text) && !empty($section_text['DEFLATE_POST'])) {
+        $post = trim($section_text['DEFLATE_POST']);
+        $post = gzcompress($post, 9);
+        $env['HTTP_CONTENT_ENCODING'] = 'deflate';
+        save_text($tmp_post, $post);
+        $content_length = strlen($post);
+
+        $env['REQUEST_METHOD'] = 'POST';
+        $env['CONTENT_TYPE']   = 'application/x-www-form-urlencoded';
+        $env['CONTENT_LENGTH'] = $content_length;
+
+        $cmd = "$php $pass_options $ini_settings -f \"$test_file\" 2>&1 < \"$tmp_post\"";
+
+
 	} else {
 
 		$env['REQUEST_METHOD'] = 'GET';


commit c10c70f6ec8c9892a06e959e86848557ba3d5576
Merge: cc7c403 956d745
Author: Michael Wallner <mike at php.net>
Date:   Tue May 15 11:26:41 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      BFN
      Fix NEWS entry for #61602.



commit 956d74572aee5a9d561b3178a0ff79de3cc90c02
Author: Michael Wallner <mike at php.net>
Date:   Tue May 15 11:26:13 2012 +0200

    BFN

diff --git a/NEWS b/NEWS
index 728c2f3..01481a3 100644
--- a/NEWS
+++ b/NEWS
@@ -57,6 +57,7 @@ PHP                                                                        NEWS
   . Fixed bug #61820 (using ob_gzhandler will complain about headers already 
     sent when no compression). (Mike)
   . Fixed bug #61443 (can't change zlib.output_compression on the fly). (Mike)
+  . Fixed bug #60761 (zlib.output_compression fails on refresh). (Mike)
 
 08 May 2012, PHP 5.4.3
 


commit 38398529b814fa75cc79ee3e3de6b05171779775
Author: Sebastian Bergmann <sebastian at php.net>
Date:   Tue May 15 11:14:36 2012 +0200

    Fix NEWS entry for #61602.

diff --git a/NEWS b/NEWS
index 2b74354..728c2f3 100644
--- a/NEWS
+++ b/NEWS
@@ -41,6 +41,10 @@ PHP                                                                        NEWS
   . Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename
     set to null). (Anatoliy)
 
+- Reflection:
+  . Implemented FR #61602 (Allow access to the name of constant
+    used as function/method parameter's default value). (reeze.xia at gmail.com)
+
 - FPM
   . Fixed bug #61812 (Uninitialised value used in libmagic). 
     (Laruence, Gustavo)


commit cc7c403a407d4f086fb3857cc97497b88f48f642
Merge: 2d11e55 83449b4
Author: Sebastian Bergmann <sebastian at php.net>
Date:   Tue May 15 11:12:03 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fixed CODING_STANDARD and move parameter parse code
      Implemented FR #61602 Allow access to name of constant used as default value



commit 83449b48d42ab004dc1b11d83848a140c4813891
Merge: 0ad53bf 6712d0d
Author: Sebastian Bergmann <sebastian at php.net>
Date:   Tue May 15 11:08:08 2012 +0200

    Merge branch 'add-const-name' of git://github.com/reeze/php-src into PHP-5.4



commit 2d11e55b948d99be8743c5ce61a3fdc6c3b6f2a0
Merge: d03900d 0ad53bf
Author: Michael Wallner <mike at php.net>
Date:   Tue May 15 09:44:01 2012 +0200

    cleanup merge



commit 0ad53bfd7da12a92a46c08e3fff579a15026b88b
Author: Michael Wallner <mike at php.net>
Date:   Tue May 15 09:33:07 2012 +0200

    fix bug #60761 zlib.output_compression fails on refresh

diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index f157821..c6e2e0c 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -284,7 +284,8 @@ static void php_zlib_output_compression_start(TSRMLS_D)
 			ZLIBG(output_compression) = PHP_OUTPUT_HANDLER_DEFAULT_SIZE;
 			/* break omitted intentionally */
 		default:
-			if (	(h = php_zlib_output_handler_init(ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME), ZLIBG(output_compression), PHP_OUTPUT_HANDLER_STDFLAGS TSRMLS_CC)) &&
+			if (	php_zlib_output_encoding(TSRMLS_C) &&
+					(h = php_zlib_output_handler_init(ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME), ZLIBG(output_compression), PHP_OUTPUT_HANDLER_STDFLAGS TSRMLS_CC)) &&
 					(SUCCESS == php_output_handler_start(h TSRMLS_CC))) {
 				if (ZLIBG(output_handler) && *ZLIBG(output_handler)) {
 					MAKE_STD_ZVAL(zoh);
@@ -966,7 +967,6 @@ static PHP_RINIT_FUNCTION(zlib)
 
 static PHP_RSHUTDOWN_FUNCTION(zlib)
 {
-	ZLIBG(output_compression) = 0;
 	php_zlib_cleanup_ob_gzhandler_mess(TSRMLS_C);
 
     return SUCCESS;
diff --git a/main/output.c b/main/output.c
index 138339e..d4eaa67 100644
--- a/main/output.c
+++ b/main/output.c
@@ -1025,6 +1025,7 @@ static inline php_output_handler_status_t php_output_handler_op(php_output_handl
 		case PHP_OUTPUT_HANDLER_SUCCESS:
 			/* no more buffered data */
 			handler->buffer.used = 0;
+			handler->flags |= PHP_OUTPUT_HANDLER_PROCESSED;
 			break;
 	}
 
diff --git a/main/php_output.h b/main/php_output.h
index e4ab0f9..d050a14 100644
--- a/main/php_output.h
+++ b/main/php_output.h
@@ -45,6 +45,7 @@
 /* handler status flags */
 #define PHP_OUTPUT_HANDLER_STARTED		0x1000
 #define PHP_OUTPUT_HANDLER_DISABLED		0x2000
+#define PHP_OUTPUT_HANDLER_PROCESSED	0x4000
 
 /* handler op return values */
 typedef enum _php_output_handler_status_t {
@@ -82,7 +83,7 @@ typedef enum _php_output_handler_hook_t {
 } php_output_handler_hook_t;
 
 #define PHP_OUTPUT_HANDLER_INITBUF_SIZE(s) \
-( (s) ? \
+( ((s) > 1) ? \
 	(s) + PHP_OUTPUT_HANDLER_ALIGNTO_SIZE - ((s) % (PHP_OUTPUT_HANDLER_ALIGNTO_SIZE)) : \
 	PHP_OUTPUT_HANDLER_DEFAULT_SIZE \
 )


commit d9788dd73f93bc492d8fd6e93051e2a5bc8bec9f
Author: Christopher Jones <sixd at php.net>
Date:   Mon May 14 12:43:36 2012 -0700

    Bump to 5.4.4-dev

diff --git a/configure.in b/configure.in
index 3d529c6..ba8b465 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=3
+PHP_RELEASE_VERSION=4
 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/main/php_version.h b/main/php_version.h
index 3e80008..fce469d 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 3
+#define PHP_RELEASE_VERSION 4
 #define PHP_EXTRA_VERSION "-dev"
-#define PHP_VERSION "5.4.3-dev"
-#define PHP_VERSION_ID 50403
+#define PHP_VERSION "5.4.4-dev"
+#define PHP_VERSION_ID 50404


commit d03900dc92af6d47921143f226217eae3ca564b7
Author: Stanislav Malyshev <stas at php.net>
Date:   Sat May 12 22:12:48 2012 -0700

    fix bug #61782 - __clone/__destruct do not match other methods when checking access controls

diff --git a/Zend/tests/bug61782.phpt b/Zend/tests/bug61782.phpt
new file mode 100644
index 0000000..95bf4e6
--- /dev/null
+++ b/Zend/tests/bug61782.phpt
@@ -0,0 +1,29 @@
+--TEST--
+Bug #61782 (__clone/__destruct do not match other methods when checking access controls)
+--FILE--
+<?php
+ abstract class BaseClass {
+        abstract protected function __clone();
+    }
+
+    class MommasBoy extends BaseClass {
+        protected function __clone() {
+            echo __METHOD__, "\n";
+        }
+    }
+
+    class LatchkeyKid extends BaseClass {
+        public function __construct() {
+            echo 'In ', __CLASS__, ":\n";
+            $kid = new MommasBoy();
+            $kid = clone $kid;
+        }
+        public function __clone() {}
+    }
+
+    $obj = new LatchkeyKid();
+echo "DONE\n";
+--EXPECT--
+In LatchkeyKid:
+MommasBoy::__clone
+DONE
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index ba6221e..60095f7 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -66,11 +66,11 @@ ZEND_API void rebuild_object_properties(zend_object *zobj) /* {{{ */
 			     zend_hash_get_current_data_ex(&ce->properties_info, (void**)&prop_info, &pos) == SUCCESS;
 			     zend_hash_move_forward_ex(&ce->properties_info, &pos)) {
 				if (/*prop_info->ce == ce &&*/
-				    (prop_info->flags & ZEND_ACC_STATIC) == 0 && 
+				    (prop_info->flags & ZEND_ACC_STATIC) == 0 &&
 				    prop_info->offset >= 0 &&
 				    zobj->properties_table[prop_info->offset]) {
 					zend_hash_quick_add(zobj->properties, prop_info->name, prop_info->name_length+1, prop_info->h, (void**)&zobj->properties_table[prop_info->offset], sizeof(zval*), (void**)&zobj->properties_table[prop_info->offset]);
-				}				
+				}
 			}
 			while (ce->parent && ce->parent->default_properties_count) {
 				ce = ce->parent;
@@ -78,12 +78,12 @@ ZEND_API void rebuild_object_properties(zend_object *zobj) /* {{{ */
 				     zend_hash_get_current_data_ex(&ce->properties_info, (void**)&prop_info, &pos) == SUCCESS;
 				     zend_hash_move_forward_ex(&ce->properties_info, &pos)) {
 					if (prop_info->ce == ce &&
-					    (prop_info->flags & ZEND_ACC_STATIC) == 0 && 
-					    (prop_info->flags & ZEND_ACC_PRIVATE) != 0 && 
+					    (prop_info->flags & ZEND_ACC_STATIC) == 0 &&
+					    (prop_info->flags & ZEND_ACC_PRIVATE) != 0 &&
 					    prop_info->offset >= 0 &&
 						zobj->properties_table[prop_info->offset]) {
 						zend_hash_quick_add(zobj->properties, prop_info->name, prop_info->name_length+1, prop_info->h, (void**)&zobj->properties_table[prop_info->offset], sizeof(zval*), (void**)&zobj->properties_table[prop_info->offset]);
-					}				
+					}
 				}
 			}
 		}
@@ -783,7 +783,7 @@ static void zend_std_unset_property(zval *object, zval *member, const zend_liter
 	property_info = zend_get_property_info_quick(zobj->ce, member, (zobj->ce->__unset != NULL), key TSRMLS_CC);
 
 	if (EXPECTED(property_info != NULL) &&
-	    EXPECTED((property_info->flags & ZEND_ACC_STATIC) == 0) && 
+	    EXPECTED((property_info->flags & ZEND_ACC_STATIC) == 0) &&
 	    !zobj->properties &&
 	    property_info->offset >= 0 &&
 	    EXPECTED(zobj->properties_table[property_info->offset] != NULL)) {
@@ -815,8 +815,8 @@ static void zend_std_unset_property(zval *object, zval *member, const zend_liter
 				}
 			}
 		}
-	} else if (EXPECTED(property_info != NULL) && 
-	           EXPECTED((property_info->flags & ZEND_ACC_STATIC) == 0) && 
+	} else if (EXPECTED(property_info != NULL) &&
+	           EXPECTED((property_info->flags & ZEND_ACC_STATIC) == 0) &&
 	           property_info->offset >= 0) {
 		zobj->properties_table[property_info->offset] = NULL;
 	}
@@ -960,12 +960,6 @@ ZEND_API int zend_check_protected(zend_class_entry *ce, zend_class_entry *scope)
 }
 /* }}} */
 
-static inline zend_class_entry * zend_get_function_root_class(zend_function *fbc) /* {{{ */
-{
-	return fbc->common.prototype ? fbc->common.prototype->common.scope : fbc->common.scope;
-}
-/* }}} */
-
 static inline union _zend_function *zend_get_user_call_function(zend_class_entry *ce, const char *method_name, int method_len) /* {{{ */
 {
 	zend_internal_function *call_user_call = emalloc(sizeof(zend_internal_function));
@@ -1143,7 +1137,7 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, const c
 		zend_str_tolower_copy(lc_function_name, function_name_strval, function_name_strlen);
 		hash_value = zend_hash_func(lc_function_name, function_name_strlen+1);
 	}
-	
+
 	if (function_name_strlen == ce->name_length && ce->constructor) {
 		lc_class_name = zend_str_tolower_dup(ce->name, ce->name_length);
 		/* Only change the method to the constructor if the constructor isn't called __construct
@@ -1178,7 +1172,7 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, const c
 	if (UNEXPECTED(!(fbc->common.fn_flags & ZEND_ACC_STATIC))) {
 		zend_error_noreturn(E_ERROR, "Cannot call non static method %s::%s() without object", ZEND_FN_SCOPE_NAME(fbc), fbc->common.function_name);
 	}
-#endif 
+#endif
 	if (fbc->op_array.fn_flags & ZEND_ACC_PUBLIC) {
 		/* No further checks necessary, most common case */
 	} else if (fbc->op_array.fn_flags & ZEND_ACC_PRIVATE) {
@@ -1220,7 +1214,7 @@ ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, const char *p
 {
 	zend_property_info *property_info;
 	ulong hash_value;
-	
+
 	if (UNEXPECTED(!key) ||
 	    (property_info = CACHED_POLYMORPHIC_PTR(key->cache_slot, ce)) == NULL) {
 		if (EXPECTED(key != NULL)) {
diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h
index 32c0a67..d0d7a7b 100644
--- a/Zend/zend_object_handlers.h
+++ b/Zend/zend_object_handlers.h
@@ -146,6 +146,9 @@ struct _zend_object_handlers {
 
 extern ZEND_API zend_object_handlers std_object_handlers;
 
+#define zend_get_function_root_class(fbc) \
+	((fbc)->common.prototype ? (fbc)->common.prototype->common.scope : (fbc)->common.scope)
+
 BEGIN_EXTERN_C()
 ZEND_API union _zend_function *zend_std_get_static_method(zend_class_entry *ce, const char *function_name_strval, int function_name_strlen, const struct _zend_literal *key TSRMLS_DC);
 ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, const char *property_name, int property_name_len, zend_bool silent, const struct _zend_literal *key TSRMLS_DC);
diff --git a/Zend/zend_objects.c b/Zend/zend_objects.c
index 7fadcf7..f7470fa 100644
--- a/Zend/zend_objects.c
+++ b/Zend/zend_objects.c
@@ -28,7 +28,7 @@
 
 ZEND_API void zend_object_std_init(zend_object *object, zend_class_entry *ce TSRMLS_DC)
 {
-	object->ce = ce;	
+	object->ce = ce;
 	object->properties = NULL;
 	object->properties_table = NULL;
 	object->guards = NULL;
@@ -38,7 +38,7 @@ ZEND_API void zend_object_std_dtor(zend_object *object TSRMLS_DC)
 {
 	if (object->guards) {
 		zend_hash_destroy(object->guards);
-		FREE_HASHTABLE(object->guards);		
+		FREE_HASHTABLE(object->guards);
 	}
 	if (object->properties) {
 		zend_hash_destroy(object->properties);
@@ -74,23 +74,23 @@ ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handl
 				if (object->ce != EG(scope)) {
 					zend_class_entry *ce = object->ce;
 
-					zend_error(EG(in_execution) ? E_ERROR : E_WARNING, 
-						"Call to private %s::__destruct() from context '%s'%s", 
-						ce->name, 
-						EG(scope) ? EG(scope)->name : "", 
+					zend_error(EG(in_execution) ? E_ERROR : E_WARNING,
+						"Call to private %s::__destruct() from context '%s'%s",
+						ce->name,
+						EG(scope) ? EG(scope)->name : "",
 						EG(in_execution) ? "" : " during shutdown ignored");
 					return;
 				}
 			} else {
 				/* Ensure that if we're calling a protected function, we're allowed to do so.
 				 */
-				if (!zend_check_protected(destructor->common.scope, EG(scope))) {
+				if (!zend_check_protected(zend_get_function_root_class(destructor), EG(scope))) {
 					zend_class_entry *ce = object->ce;
 
-					zend_error(EG(in_execution) ? E_ERROR : E_WARNING, 
-						"Call to protected %s::__destruct() from context '%s'%s", 
-						ce->name, 
-						EG(scope) ? EG(scope)->name : "", 
+					zend_error(EG(in_execution) ? E_ERROR : E_WARNING,
+						"Call to protected %s::__destruct() from context '%s'%s",
+						ce->name,
+						EG(scope) ? EG(scope)->name : "",
 						EG(in_execution) ? "" : " during shutdown ignored");
 					return;
 				}
@@ -139,7 +139,7 @@ ZEND_API void zend_objects_free_object_storage(zend_object *object TSRMLS_DC)
 }
 
 ZEND_API zend_object_value zend_objects_new(zend_object **object, zend_class_entry *class_type TSRMLS_DC)
-{	
+{
 	zend_object_value retval;
 
 	*object = emalloc(sizeof(zend_object));
@@ -222,7 +222,7 @@ ZEND_API zend_object_value zend_objects_clone_obj(zval *zobject TSRMLS_DC)
 	zend_object *new_object;
 	zend_object_handle handle = Z_OBJ_HANDLE_P(zobject);
 
-	/* assume that create isn't overwritten, so when clone depends on the 
+	/* assume that create isn't overwritten, so when clone depends on the
 	 * overwritten one then it must itself be overwritten */
 	old_object = zend_objects_get_address(zobject TSRMLS_CC);
 	new_obj_val = zend_objects_new(&new_object, old_object->ce TSRMLS_CC);
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 7b13b44..bc1591f 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -2451,7 +2451,7 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV)
 				if (UNEXPECTED(EX(fbc) == NULL)) {
 					zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), Z_STRVAL_PP(method));
 				}
-				
+
 				if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) {
 					EX(object) = NULL;
 				} else {
@@ -2983,7 +2983,7 @@ ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, CV)
 		catch_ce = CACHED_PTR(opline->op1.literal->cache_slot);
 	} else {
 		catch_ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC);
-		
+
 		CACHE_PTR(opline->op1.literal->cache_slot, catch_ce);
 	}
 	ce = Z_OBJCE_P(EG(exception));
@@ -3435,7 +3435,7 @@ ZEND_VM_HANDLER(110, ZEND_CLONE, CONST|TMP|VAR|UNUSED|CV, ANY)
 		} else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) {
 			/* Ensure that if we're calling a protected function, we're allowed to do so.
 			 */
-			if (UNEXPECTED(!zend_check_protected(clone->common.scope, EG(scope)))) {
+			if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), EG(scope)))) {
 				zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : "");
 			}
 		}
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 2096c44..e575f96 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -2436,7 +2436,7 @@ static int ZEND_FASTCALL  ZEND_CLONE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS
 		} else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) {
 			/* Ensure that if we're calling a protected function, we're allowed to do so.
 			 */
-			if (UNEXPECTED(!zend_check_protected(clone->common.scope, EG(scope)))) {
+			if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), EG(scope)))) {
 				zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : "");
 			}
 		}
@@ -6970,7 +6970,7 @@ static int ZEND_FASTCALL  ZEND_CLONE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
 		} else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) {
 			/* Ensure that if we're calling a protected function, we're allowed to do so.
 			 */
-			if (UNEXPECTED(!zend_check_protected(clone->common.scope, EG(scope)))) {
+			if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), EG(scope)))) {
 				zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : "");
 			}
 		}
@@ -11518,7 +11518,7 @@ static int ZEND_FASTCALL  ZEND_CLONE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
 		} else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) {
 			/* Ensure that if we're calling a protected function, we're allowed to do so.
 			 */
-			if (UNEXPECTED(!zend_check_protected(clone->common.scope, EG(scope)))) {
+			if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), EG(scope)))) {
 				zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : "");
 			}
 		}
@@ -21751,7 +21751,7 @@ static int ZEND_FASTCALL  ZEND_CLONE_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARG
 		} else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) {
 			/* Ensure that if we're calling a protected function, we're allowed to do so.
 			 */
-			if (UNEXPECTED(!zend_check_protected(clone->common.scope, EG(scope)))) {
+			if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), EG(scope)))) {
 				zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : "");
 			}
 		}
@@ -27498,7 +27498,7 @@ static int ZEND_FASTCALL  ZEND_CLONE_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
 		} else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) {
 			/* Ensure that if we're calling a protected function, we're allowed to do so.
 			 */
-			if (UNEXPECTED(!zend_check_protected(clone->common.scope, EG(scope)))) {
+			if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), EG(scope)))) {
 				zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : "");
 			}
 		}


commit 47db8a9aa19f6e17a1018becf9978315c79a1cb0
Author: Stanislav Malyshev <stas at php.net>
Date:   Thu May 10 23:58:10 2012 -0700

    fix bug #54547

diff --git a/Zend/tests/bug54547.phpt b/Zend/tests/bug54547.phpt
new file mode 100644
index 0000000..452cbb8
--- /dev/null
+++ b/Zend/tests/bug54547.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Bug #54547: wrong equality of string numbers near LONG_MAX with 64-bit longs
+--SKIPIF--
+<?php
+if (PHP_INT_MAX !== 9223372036854775807)
+	die("skip for 64-bit long systems only");
+--FILE--
+<?php
+var_dump("9223372036854775807" == "9223372036854775808");
+var_dump("-9223372036854775808" == "-9223372036854775809");
+var_dump("0x7fffffffffffffff" == "9223372036854775808");
+
+/* not exactly what the bug is about, but closely related problem: */
+var_dump("999223372036854775807"=="999223372036854775808");
+var_dump("899223372036854775807">"00999223372036854775807");
+--EXPECT--
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
index a849ccc..8d4baa6 100644
--- a/Zend/zend_operators.c
+++ b/Zend/zend_operators.c
@@ -2035,15 +2035,30 @@ ZEND_API int zend_binary_zval_strncasecmp(zval *s1, zval *s2, zval *s3) /* {{{ *
 ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2) /* {{{ */
 {
 	int ret1, ret2;
+	int oflow1, oflow2;
 	long lval1, lval2;
 	double dval1, dval2;
 
-	if ((ret1=is_numeric_string(Z_STRVAL_P(s1), Z_STRLEN_P(s1), &lval1, &dval1, 0)) &&
-		(ret2=is_numeric_string(Z_STRVAL_P(s2), Z_STRLEN_P(s2), &lval2, &dval2, 0))) {
+	if ((ret1=is_numeric_string_ex(Z_STRVAL_P(s1), Z_STRLEN_P(s1), &lval1, &dval1, 0, &oflow1)) &&
+		(ret2=is_numeric_string_ex(Z_STRVAL_P(s2), Z_STRLEN_P(s2), &lval2, &dval2, 0, &oflow2))) {
+		if (oflow1 != 0 && oflow1 == oflow2 && dval1 - dval2 == 0.) {
+			/* both values are integers overflown to the same side, and the
+			 * double comparison may have resulted in crucial accuracy lost */
+			goto string_cmp;
+		}
 		if ((ret1==IS_DOUBLE) || (ret2==IS_DOUBLE)) {
 			if (ret1!=IS_DOUBLE) {
+				if (oflow2) {
+					/* 2nd operand is integer > LONG_MAX (oflow2==1) or < LONG_MIN (-1) */
+					ZVAL_LONG(result, -1 * oflow2);
+					return;
+				}
 				dval1 = (double) lval1;
 			} else if (ret2!=IS_DOUBLE) {
+				if (oflow1) {
+					ZVAL_LONG(result, oflow1);
+					return; 
+				}
 				dval2 = (double) lval2;
 			} else if (dval1 == dval2 && !zend_finite(dval1)) {
 				/* Both values overflowed and have the same sign,
diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h
index ebf959b..d28140e 100644
--- a/Zend/zend_operators.h
+++ b/Zend/zend_operators.h
@@ -100,9 +100,12 @@ static zend_always_inline long zend_dval_to_lval(double d)
  * if the number was out of long range or contained a decimal point/exponent.
  * The number's value is returned into the respective pointer, *lval or *dval,
  * if that pointer is not NULL.
+ *
+ * This variant also gives information if a string that represents an integer
+ * could not be represented as such due to overflow. It writes 1 to oflow_info
+ * if the integer is larger than LONG_MAX and -1 if it's smaller than LONG_MIN.
  */
-
-static inline zend_uchar is_numeric_string(const char *str, int length, long *lval, double *dval, int allow_errors)
+static inline zend_uchar is_numeric_string_ex(const char *str, int length, long *lval, double *dval, int allow_errors, int *oflow_info)
 {
 	const char *ptr;
 	int base = 10, digits = 0, dp_or_e = 0;
@@ -113,6 +116,10 @@ static inline zend_uchar is_numeric_string(const char *str, int length, long *lv
 		return 0;
 	}
 
+	if (oflow_info != NULL) {
+		*oflow_info = 0;
+	}
+
 	/* Skip any whitespace
 	 * This is much faster than the isspace() function */
 	while (*str == ' ' || *str == '\t' || *str == '\n' || *str == '\r' || *str == '\v' || *str == '\f') {
@@ -165,6 +172,9 @@ check_digits:
 
 		if (base == 10) {
 			if (digits >= MAX_LENGTH_OF_LONG) {
+				if (oflow_info != NULL) {
+					*oflow_info = *str == '-' ? -1 : 1;
+				}
 				dp_or_e = -1;
 				goto process_double;
 			}
@@ -172,6 +182,9 @@ check_digits:
 			if (dval) {
 				local_dval = zend_hex_strtod(str, &ptr);
 			}
+			if (oflow_info != NULL) {
+				*oflow_info = 1;
+			}
 			type = IS_DOUBLE;
 		}
 	} else if (*ptr == '.' && ZEND_IS_DIGIT(ptr[1])) {
@@ -207,6 +220,9 @@ process_double:
 				if (dval) {
 					*dval = zend_strtod(str, NULL);
 				}
+				if (oflow_info != NULL) {
+					*oflow_info = *str == '-' ? -1 : 1;
+				}
 
 				return IS_DOUBLE;
 			}
@@ -226,6 +242,10 @@ process_double:
 	}
 }
 
+static inline zend_uchar is_numeric_string(const char *str, int length, long *lval, double *dval, int allow_errors) {
+    return is_numeric_string_ex(str, length, lval, dval, allow_errors, NULL);
+}
+
 static inline char *
 zend_memnstr(char *haystack, char *needle, int needle_len, char *end)
 {


commit a72b21438d053a04c94c6da866692d8db6252616
Author: Stanislav Malyshev <stas at php.net>
Date:   Sun May 13 14:48:22 2012 -0700

    update NEWS/UPGRADING

diff --git a/NEWS b/NEWS
index 01beab5..217b700 100644
--- a/NEWS
+++ b/NEWS
@@ -5,40 +5,41 @@ PHP                                                                        NEWS
 - CLI Server:
   . Implemented FR #61977 (Need CLI web-server support for files with .htm & 
     svg extensions). (Sixd, Laruence)
-  . Fixed bug #61546 (functions related to current script failed when chdir() 
-    in cli sapi). (Laruence, reeze.xia at gmail.com)
   . Improved performance while sending error page, this also fixed
     bug #61785 (Memory leak when access a non-exists file without router).
     (Laruence)
+  . Fixed bug #61546 (functions related to current script failed when chdir() 
+    in cli sapi). (Laruence, reeze.xia at gmail.com)
 
 - CURL:
   . Fixed bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction).
     (Laruence)
 
 - Core:
+  . Fixed missing bound check in iptcparse(). (chris at chiappa.net)
   . Fixed bug #62005 (unexpected behavior when incrementally assigning to a 
     member of a null object). (Laruence)
   . Fixed bug #61978 (Object recursion not detected for classes that implement
     JsonSerializable). (Felipe)
-  . Fixed bug #61782 (__clone/__destruct do not match other methods when checking
-    access controls). (Stas)
-  . Fixed bug #61730 (Segfault from array_walk modifying an array passed by
-    reference). (Laruence)
+  . Fixed bug #61991 (long overflow in realpath_cache_get()). (Anatoliy)
   . Fixed bug #61922 (ZTS build doesn't accept zend.script_encoding config).
     (Laruence)
-  . Fixed missing bound check in iptcparse(). (chris at chiappa.net)
   . Fixed bug #61827 (incorrect \e processing on Windows) (Anatoliy)
+  . Fixed bug #61782 (__clone/__destruct do not match other methods when checking
+    access controls). (Stas)
   . Fixed bug #61761 ('Overriding' a private static method with a different 
     signature causes crash). (Laruence)
+  . Fixed bug #61730 (Segfault from array_walk modifying an array passed by
+    reference). (Laruence)
   . Fixed bug #61728 (PHP crash when calling ob_start in request_shutdown 
     phase). (Laruence)
   . Fixed bug #61660 (bin2hex(hex2bin($data)) != $data). (Nikita Popov)
   . Fixed bug #61650 (ini parser crashes when using ${xxxx} ini variables
     (without apache2)). (Laruence)
   . Fixed bug #61605 (header_remove() does not remove all headers). (Laruence)
+  . Fixed bug #54547 (wrong equality of string numbers). (Gustavo)
   . Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename
     set to null). (Anatoliy)
-  . Fixed bug #61991 (long overflow in realpath_cache_get()). (Anatoliy)
 
 - FPM
   . Fixed bug #61812 (Uninitialised value used in libmagic). 
diff --git a/UPGRADING b/UPGRADING
index d92e057..391c365 100755
--- a/UPGRADING
+++ b/UPGRADING
@@ -169,6 +169,10 @@ PHP 5.4 UPGRADE NOTES
   non-numeric and produce warning, but are converted to 12 and 5
   respectively for backwards compatibility reasons.
 
+- Long numeric strings that do not fit in integer or double (such as
+  "92233720368547758070") are compared using string comparison if 
+  they could otherwise result in precision loss - since 5.4.4.
+
 - Closures now support scopes and $this and can be rebound to
   objects using Closure::bind() and Closure::bindTo().
 
@@ -178,6 +182,9 @@ PHP 5.4 UPGRADE NOTES
 - Parse error messages are changed to contain more information about
   the error.
 
+- __clone and __destruct since 5.4.4 follow the same scoping rules as 
+  the rest of the methods (see bug #61782 for details).
+
 ================================
 4. Changes to existing functions
 ================================


commit a0dff6fdcae1f4eaa96e68d1429fd38876c2796e
Author: Stanislav Malyshev <stas at php.net>
Date:   Sat May 12 22:12:48 2012 -0700

    fix bug #61782 - __clone/__destruct do not match other methods when checking access controls

diff --git a/NEWS b/NEWS
index a4486c8..01beab5 100644
--- a/NEWS
+++ b/NEWS
@@ -20,6 +20,8 @@ PHP                                                                        NEWS
     member of a null object). (Laruence)
   . Fixed bug #61978 (Object recursion not detected for classes that implement
     JsonSerializable). (Felipe)
+  . Fixed bug #61782 (__clone/__destruct do not match other methods when checking
+    access controls). (Stas)
   . Fixed bug #61730 (Segfault from array_walk modifying an array passed by
     reference). (Laruence)
   . Fixed bug #61922 (ZTS build doesn't accept zend.script_encoding config).
diff --git a/Zend/tests/bug61782.phpt b/Zend/tests/bug61782.phpt
new file mode 100644
index 0000000..95bf4e6
--- /dev/null
+++ b/Zend/tests/bug61782.phpt
@@ -0,0 +1,29 @@
+--TEST--
+Bug #61782 (__clone/__destruct do not match other methods when checking access controls)
+--FILE--
+<?php
+ abstract class BaseClass {
+        abstract protected function __clone();
+    }
+
+    class MommasBoy extends BaseClass {
+        protected function __clone() {
+            echo __METHOD__, "\n";
+        }
+    }
+
+    class LatchkeyKid extends BaseClass {
+        public function __construct() {
+            echo 'In ', __CLASS__, ":\n";
+            $kid = new MommasBoy();
+            $kid = clone $kid;
+        }
+        public function __clone() {}
+    }
+
+    $obj = new LatchkeyKid();
+echo "DONE\n";
+--EXPECT--
+In LatchkeyKid:
+MommasBoy::__clone
+DONE
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index ba6221e..60095f7 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -66,11 +66,11 @@ ZEND_API void rebuild_object_properties(zend_object *zobj) /* {{{ */
 			     zend_hash_get_current_data_ex(&ce->properties_info, (void**)&prop_info, &pos) == SUCCESS;
 			     zend_hash_move_forward_ex(&ce->properties_info, &pos)) {
 				if (/*prop_info->ce == ce &&*/
-				    (prop_info->flags & ZEND_ACC_STATIC) == 0 && 
+				    (prop_info->flags & ZEND_ACC_STATIC) == 0 &&
 				    prop_info->offset >= 0 &&
 				    zobj->properties_table[prop_info->offset]) {
 					zend_hash_quick_add(zobj->properties, prop_info->name, prop_info->name_length+1, prop_info->h, (void**)&zobj->properties_table[prop_info->offset], sizeof(zval*), (void**)&zobj->properties_table[prop_info->offset]);
-				}				
+				}
 			}
 			while (ce->parent && ce->parent->default_properties_count) {
 				ce = ce->parent;
@@ -78,12 +78,12 @@ ZEND_API void rebuild_object_properties(zend_object *zobj) /* {{{ */
 				     zend_hash_get_current_data_ex(&ce->properties_info, (void**)&prop_info, &pos) == SUCCESS;
 				     zend_hash_move_forward_ex(&ce->properties_info, &pos)) {
 					if (prop_info->ce == ce &&
-					    (prop_info->flags & ZEND_ACC_STATIC) == 0 && 
-					    (prop_info->flags & ZEND_ACC_PRIVATE) != 0 && 
+					    (prop_info->flags & ZEND_ACC_STATIC) == 0 &&
+					    (prop_info->flags & ZEND_ACC_PRIVATE) != 0 &&
 					    prop_info->offset >= 0 &&
 						zobj->properties_table[prop_info->offset]) {
 						zend_hash_quick_add(zobj->properties, prop_info->name, prop_info->name_length+1, prop_info->h, (void**)&zobj->properties_table[prop_info->offset], sizeof(zval*), (void**)&zobj->properties_table[prop_info->offset]);
-					}				
+					}
 				}
 			}
 		}
@@ -783,7 +783,7 @@ static void zend_std_unset_property(zval *object, zval *member, const zend_liter
 	property_info = zend_get_property_info_quick(zobj->ce, member, (zobj->ce->__unset != NULL), key TSRMLS_CC);
 
 	if (EXPECTED(property_info != NULL) &&
-	    EXPECTED((property_info->flags & ZEND_ACC_STATIC) == 0) && 
+	    EXPECTED((property_info->flags & ZEND_ACC_STATIC) == 0) &&
 	    !zobj->properties &&
 	    property_info->offset >= 0 &&
 	    EXPECTED(zobj->properties_table[property_info->offset] != NULL)) {
@@ -815,8 +815,8 @@ static void zend_std_unset_property(zval *object, zval *member, const zend_liter
 				}
 			}
 		}
-	} else if (EXPECTED(property_info != NULL) && 
-	           EXPECTED((property_info->flags & ZEND_ACC_STATIC) == 0) && 
+	} else if (EXPECTED(property_info != NULL) &&
+	           EXPECTED((property_info->flags & ZEND_ACC_STATIC) == 0) &&
 	           property_info->offset >= 0) {
 		zobj->properties_table[property_info->offset] = NULL;
 	}
@@ -960,12 +960,6 @@ ZEND_API int zend_check_protected(zend_class_entry *ce, zend_class_entry *scope)
 }
 /* }}} */
 
-static inline zend_class_entry * zend_get_function_root_class(zend_function *fbc) /* {{{ */
-{
-	return fbc->common.prototype ? fbc->common.prototype->common.scope : fbc->common.scope;
-}
-/* }}} */
-
 static inline union _zend_function *zend_get_user_call_function(zend_class_entry *ce, const char *method_name, int method_len) /* {{{ */
 {
 	zend_internal_function *call_user_call = emalloc(sizeof(zend_internal_function));
@@ -1143,7 +1137,7 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, const c
 		zend_str_tolower_copy(lc_function_name, function_name_strval, function_name_strlen);
 		hash_value = zend_hash_func(lc_function_name, function_name_strlen+1);
 	}
-	
+
 	if (function_name_strlen == ce->name_length && ce->constructor) {
 		lc_class_name = zend_str_tolower_dup(ce->name, ce->name_length);
 		/* Only change the method to the constructor if the constructor isn't called __construct
@@ -1178,7 +1172,7 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, const c
 	if (UNEXPECTED(!(fbc->common.fn_flags & ZEND_ACC_STATIC))) {
 		zend_error_noreturn(E_ERROR, "Cannot call non static method %s::%s() without object", ZEND_FN_SCOPE_NAME(fbc), fbc->common.function_name);
 	}
-#endif 
+#endif
 	if (fbc->op_array.fn_flags & ZEND_ACC_PUBLIC) {
 		/* No further checks necessary, most common case */
 	} else if (fbc->op_array.fn_flags & ZEND_ACC_PRIVATE) {
@@ -1220,7 +1214,7 @@ ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, const char *p
 {
 	zend_property_info *property_info;
 	ulong hash_value;
-	
+
 	if (UNEXPECTED(!key) ||
 	    (property_info = CACHED_POLYMORPHIC_PTR(key->cache_slot, ce)) == NULL) {
 		if (EXPECTED(key != NULL)) {
diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h
index 32c0a67..d0d7a7b 100644
--- a/Zend/zend_object_handlers.h
+++ b/Zend/zend_object_handlers.h
@@ -146,6 +146,9 @@ struct _zend_object_handlers {
 
 extern ZEND_API zend_object_handlers std_object_handlers;
 
+#define zend_get_function_root_class(fbc) \
+	((fbc)->common.prototype ? (fbc)->common.prototype->common.scope : (fbc)->common.scope)
+
 BEGIN_EXTERN_C()
 ZEND_API union _zend_function *zend_std_get_static_method(zend_class_entry *ce, const char *function_name_strval, int function_name_strlen, const struct _zend_literal *key TSRMLS_DC);
 ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, const char *property_name, int property_name_len, zend_bool silent, const struct _zend_literal *key TSRMLS_DC);
diff --git a/Zend/zend_objects.c b/Zend/zend_objects.c
index 7fadcf7..f7470fa 100644
--- a/Zend/zend_objects.c
+++ b/Zend/zend_objects.c
@@ -28,7 +28,7 @@
 
 ZEND_API void zend_object_std_init(zend_object *object, zend_class_entry *ce TSRMLS_DC)
 {
-	object->ce = ce;	
+	object->ce = ce;
 	object->properties = NULL;
 	object->properties_table = NULL;
 	object->guards = NULL;
@@ -38,7 +38,7 @@ ZEND_API void zend_object_std_dtor(zend_object *object TSRMLS_DC)
 {
 	if (object->guards) {
 		zend_hash_destroy(object->guards);
-		FREE_HASHTABLE(object->guards);		
+		FREE_HASHTABLE(object->guards);
 	}
 	if (object->properties) {
 		zend_hash_destroy(object->properties);
@@ -74,23 +74,23 @@ ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handl
 				if (object->ce != EG(scope)) {
 					zend_class_entry *ce = object->ce;
 
-					zend_error(EG(in_execution) ? E_ERROR : E_WARNING, 
-						"Call to private %s::__destruct() from context '%s'%s", 
-						ce->name, 
-						EG(scope) ? EG(scope)->name : "", 
+					zend_error(EG(in_execution) ? E_ERROR : E_WARNING,
+						"Call to private %s::__destruct() from context '%s'%s",
+						ce->name,
+						EG(scope) ? EG(scope)->name : "",
 						EG(in_execution) ? "" : " during shutdown ignored");
 					return;
 				}
 			} else {
 				/* Ensure that if we're calling a protected function, we're allowed to do so.
 				 */
-				if (!zend_check_protected(destructor->common.scope, EG(scope))) {
+				if (!zend_check_protected(zend_get_function_root_class(destructor), EG(scope))) {
 					zend_class_entry *ce = object->ce;
 
-					zend_error(EG(in_execution) ? E_ERROR : E_WARNING, 
-						"Call to protected %s::__destruct() from context '%s'%s", 
-						ce->name, 
-						EG(scope) ? EG(scope)->name : "", 
+					zend_error(EG(in_execution) ? E_ERROR : E_WARNING,
+						"Call to protected %s::__destruct() from context '%s'%s",
+						ce->name,
+						EG(scope) ? EG(scope)->name : "",
 						EG(in_execution) ? "" : " during shutdown ignored");
 					return;
 				}
@@ -139,7 +139,7 @@ ZEND_API void zend_objects_free_object_storage(zend_object *object TSRMLS_DC)
 }
 
 ZEND_API zend_object_value zend_objects_new(zend_object **object, zend_class_entry *class_type TSRMLS_DC)
-{	
+{
 	zend_object_value retval;
 
 	*object = emalloc(sizeof(zend_object));
@@ -222,7 +222,7 @@ ZEND_API zend_object_value zend_objects_clone_obj(zval *zobject TSRMLS_DC)
 	zend_object *new_object;
 	zend_object_handle handle = Z_OBJ_HANDLE_P(zobject);
 
-	/* assume that create isn't overwritten, so when clone depends on the 
+	/* assume that create isn't overwritten, so when clone depends on the
 	 * overwritten one then it must itself be overwritten */
 	old_object = zend_objects_get_address(zobject TSRMLS_CC);
 	new_obj_val = zend_objects_new(&new_object, old_object->ce TSRMLS_CC);
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 8cceb19..5a3ae49 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -2442,7 +2442,7 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV)
 				if (UNEXPECTED(EX(fbc) == NULL)) {
 					zend_error_noreturn(E_ERROR, "Call to undefined method %s::%s()", Z_OBJ_CLASS_NAME_P(EX(object)), Z_STRVAL_PP(method));
 				}
-				
+
 				if ((EX(fbc)->common.fn_flags & ZEND_ACC_STATIC) != 0) {
 					EX(object) = NULL;
 				} else {
@@ -2974,7 +2974,7 @@ ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, CV)
 		catch_ce = CACHED_PTR(opline->op1.literal->cache_slot);
 	} else {
 		catch_ce = zend_fetch_class_by_name(Z_STRVAL_P(opline->op1.zv), Z_STRLEN_P(opline->op1.zv), opline->op1.literal + 1, ZEND_FETCH_CLASS_NO_AUTOLOAD TSRMLS_CC);
-		
+
 		CACHE_PTR(opline->op1.literal->cache_slot, catch_ce);
 	}
 	ce = Z_OBJCE_P(EG(exception));
@@ -3426,7 +3426,7 @@ ZEND_VM_HANDLER(110, ZEND_CLONE, CONST|TMP|VAR|UNUSED|CV, ANY)
 		} else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) {
 			/* Ensure that if we're calling a protected function, we're allowed to do so.
 			 */
-			if (UNEXPECTED(!zend_check_protected(clone->common.scope, EG(scope)))) {
+			if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), EG(scope)))) {
 				zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : "");
 			}
 		}
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 68ba74b..1fb6e76 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -2436,7 +2436,7 @@ static int ZEND_FASTCALL  ZEND_CLONE_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS
 		} else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) {
 			/* Ensure that if we're calling a protected function, we're allowed to do so.
 			 */
-			if (UNEXPECTED(!zend_check_protected(clone->common.scope, EG(scope)))) {
+			if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), EG(scope)))) {
 				zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : "");
 			}
 		}
@@ -6850,7 +6850,7 @@ static int ZEND_FASTCALL  ZEND_CLONE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
 		} else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) {
 			/* Ensure that if we're calling a protected function, we're allowed to do so.
 			 */
-			if (UNEXPECTED(!zend_check_protected(clone->common.scope, EG(scope)))) {
+			if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), EG(scope)))) {
 				zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : "");
 			}
 		}
@@ -11278,7 +11278,7 @@ static int ZEND_FASTCALL  ZEND_CLONE_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
 		} else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) {
 			/* Ensure that if we're calling a protected function, we're allowed to do so.
 			 */
-			if (UNEXPECTED(!zend_check_protected(clone->common.scope, EG(scope)))) {
+			if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), EG(scope)))) {
 				zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : "");
 			}
 		}
@@ -21475,7 +21475,7 @@ static int ZEND_FASTCALL  ZEND_CLONE_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARG
 		} else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) {
 			/* Ensure that if we're calling a protected function, we're allowed to do so.
 			 */
-			if (UNEXPECTED(!zend_check_protected(clone->common.scope, EG(scope)))) {
+			if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), EG(scope)))) {
 				zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : "");
 			}
 		}
@@ -27222,7 +27222,7 @@ static int ZEND_FASTCALL  ZEND_CLONE_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
 		} else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) {
 			/* Ensure that if we're calling a protected function, we're allowed to do so.
 			 */
-			if (UNEXPECTED(!zend_check_protected(clone->common.scope, EG(scope)))) {
+			if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(clone), EG(scope)))) {
 				zend_error_noreturn(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : "");
 			}
 		}


commit 9344bf193c6e35c8706923953f3e63bb01cc05ed
Author: Stanislav Malyshev <stas at php.net>
Date:   Thu May 10 23:58:10 2012 -0700

    fix bug #54547

diff --git a/Zend/tests/bug54547.phpt b/Zend/tests/bug54547.phpt
new file mode 100644
index 0000000..452cbb8
--- /dev/null
+++ b/Zend/tests/bug54547.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Bug #54547: wrong equality of string numbers near LONG_MAX with 64-bit longs
+--SKIPIF--
+<?php
+if (PHP_INT_MAX !== 9223372036854775807)
+	die("skip for 64-bit long systems only");
+--FILE--
+<?php
+var_dump("9223372036854775807" == "9223372036854775808");
+var_dump("-9223372036854775808" == "-9223372036854775809");
+var_dump("0x7fffffffffffffff" == "9223372036854775808");
+
+/* not exactly what the bug is about, but closely related problem: */
+var_dump("999223372036854775807"=="999223372036854775808");
+var_dump("899223372036854775807">"00999223372036854775807");
+--EXPECT--
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
index a849ccc..8d4baa6 100644
--- a/Zend/zend_operators.c
+++ b/Zend/zend_operators.c
@@ -2035,15 +2035,30 @@ ZEND_API int zend_binary_zval_strncasecmp(zval *s1, zval *s2, zval *s3) /* {{{ *
 ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2) /* {{{ */
 {
 	int ret1, ret2;
+	int oflow1, oflow2;
 	long lval1, lval2;
 	double dval1, dval2;
 
-	if ((ret1=is_numeric_string(Z_STRVAL_P(s1), Z_STRLEN_P(s1), &lval1, &dval1, 0)) &&
-		(ret2=is_numeric_string(Z_STRVAL_P(s2), Z_STRLEN_P(s2), &lval2, &dval2, 0))) {
+	if ((ret1=is_numeric_string_ex(Z_STRVAL_P(s1), Z_STRLEN_P(s1), &lval1, &dval1, 0, &oflow1)) &&
+		(ret2=is_numeric_string_ex(Z_STRVAL_P(s2), Z_STRLEN_P(s2), &lval2, &dval2, 0, &oflow2))) {
+		if (oflow1 != 0 && oflow1 == oflow2 && dval1 - dval2 == 0.) {
+			/* both values are integers overflown to the same side, and the
+			 * double comparison may have resulted in crucial accuracy lost */
+			goto string_cmp;
+		}
 		if ((ret1==IS_DOUBLE) || (ret2==IS_DOUBLE)) {
 			if (ret1!=IS_DOUBLE) {
+				if (oflow2) {
+					/* 2nd operand is integer > LONG_MAX (oflow2==1) or < LONG_MIN (-1) */
+					ZVAL_LONG(result, -1 * oflow2);
+					return;
+				}
 				dval1 = (double) lval1;
 			} else if (ret2!=IS_DOUBLE) {
+				if (oflow1) {
+					ZVAL_LONG(result, oflow1);
+					return; 
+				}
 				dval2 = (double) lval2;
 			} else if (dval1 == dval2 && !zend_finite(dval1)) {
 				/* Both values overflowed and have the same sign,
diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h
index ebf959b..d28140e 100644
--- a/Zend/zend_operators.h
+++ b/Zend/zend_operators.h
@@ -100,9 +100,12 @@ static zend_always_inline long zend_dval_to_lval(double d)
  * if the number was out of long range or contained a decimal point/exponent.
  * The number's value is returned into the respective pointer, *lval or *dval,
  * if that pointer is not NULL.
+ *
+ * This variant also gives information if a string that represents an integer
+ * could not be represented as such due to overflow. It writes 1 to oflow_info
+ * if the integer is larger than LONG_MAX and -1 if it's smaller than LONG_MIN.
  */
-
-static inline zend_uchar is_numeric_string(const char *str, int length, long *lval, double *dval, int allow_errors)
+static inline zend_uchar is_numeric_string_ex(const char *str, int length, long *lval, double *dval, int allow_errors, int *oflow_info)
 {
 	const char *ptr;
 	int base = 10, digits = 0, dp_or_e = 0;
@@ -113,6 +116,10 @@ static inline zend_uchar is_numeric_string(const char *str, int length, long *lv
 		return 0;
 	}
 
+	if (oflow_info != NULL) {
+		*oflow_info = 0;
+	}
+
 	/* Skip any whitespace
 	 * This is much faster than the isspace() function */
 	while (*str == ' ' || *str == '\t' || *str == '\n' || *str == '\r' || *str == '\v' || *str == '\f') {
@@ -165,6 +172,9 @@ check_digits:
 
 		if (base == 10) {
 			if (digits >= MAX_LENGTH_OF_LONG) {
+				if (oflow_info != NULL) {
+					*oflow_info = *str == '-' ? -1 : 1;
+				}
 				dp_or_e = -1;
 				goto process_double;
 			}
@@ -172,6 +182,9 @@ check_digits:
 			if (dval) {
 				local_dval = zend_hex_strtod(str, &ptr);
 			}
+			if (oflow_info != NULL) {
+				*oflow_info = 1;
+			}
 			type = IS_DOUBLE;
 		}
 	} else if (*ptr == '.' && ZEND_IS_DIGIT(ptr[1])) {
@@ -207,6 +220,9 @@ process_double:
 				if (dval) {
 					*dval = zend_strtod(str, NULL);
 				}
+				if (oflow_info != NULL) {
+					*oflow_info = *str == '-' ? -1 : 1;
+				}
 
 				return IS_DOUBLE;
 			}
@@ -226,6 +242,10 @@ process_double:
 	}
 }
 
+static inline zend_uchar is_numeric_string(const char *str, int length, long *lval, double *dval, int allow_errors) {
+    return is_numeric_string_ex(str, length, lval, dval, allow_errors, NULL);
+}
+
 static inline char *
 zend_memnstr(char *haystack, char *needle, int needle_len, char *end)
 {


commit d27e71e598480969413166ab7a95354c5f6d2e85
Merge: f09961c ac33e40
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Sun May 13 23:03:51 2012 +0200

    Merge branch 'extra_precision'



commit ac33e40d2ae7288f66f5e3d56e7ae8e3f0266144
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Sun May 6 13:06:44 2012 +0200

    Keep date precision in MessageFormatter.
    
    MessageFormatter::parse and MessageFormat::format (and their static
    equivalents) now don't throw away better than second precision in the
    arguments.
    
    It's already bad enough that in MessageFormatter and IntlDateFormatter we
    use seconds since epoch instead of milliseconds since epoch, deviating
    from the ICU date representations. But we don't need to throw away extra
    precision when parsing dates; we can keep the seconds since epoch
    convention and return non integer doubles with only a small BC impact.
    Note that we already could return doubles from MessageFormatter::parse if
    the date was sufficiently in the past or in the future.

diff --git a/UPGRADING b/UPGRADING
index 9f76366..1643bdd 100755
--- a/UPGRADING
+++ b/UPGRADING
@@ -57,6 +57,9 @@ PHP X.Y UPGRADE NOTES
 - MessageFormatter::format() and related functions now don't error out when
   an insufficient argument count is provided. Instead, the placeholders will
   remain unsubstituted.
+- MessageFormatter::parse() and MessageFormat::format() (and their static
+  equivalents) now don't throw away better than second precision in the
+  arguments.
 
 ========================================
 5. New Functions
diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp
index 42c5466..f8228df 100755
--- a/ext/intl/msgformat/msgformat_helpers.cpp
+++ b/ext/intl/msgformat/msgformat_helpers.cpp
@@ -665,11 +665,7 @@ U_CFUNC void umsg_parse_helper(UMessageFormat *fmt, int *count, zval ***args, UC
 		switch(fargs[i].getType()) {
         case Formattable::kDate:
 			aDate = ((double)fargs[i].getDate())/U_MILLIS_PER_SECOND;
-			if(aDate > LONG_MAX || aDate < -LONG_MAX) {
-				ZVAL_DOUBLE((*args)[i], aDate<0?ceil(aDate):floor(aDate));
-			} else {
-				ZVAL_LONG((*args)[i], (long)aDate);
-			}
+			ZVAL_DOUBLE((*args)[i], aDate);
             break;
 
         case Formattable::kDouble:
diff --git a/ext/intl/tests/msgfmt_millisecond_dates.phpt b/ext/intl/tests/msgfmt_millisecond_dates.phpt
new file mode 100644
index 0000000..6d6cf20
--- /dev/null
+++ b/ext/intl/tests/msgfmt_millisecond_dates.phpt
@@ -0,0 +1,31 @@
+--TEST--
+MessageFrormatter parses and formats dates with millisecond precision
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+	die('skip intl extension not enabled');
+--FILE--
+<?php
+exec('pause');
+ini_set("intl.error_level", E_WARNING);
+//ini_set("intl.default_locale", "nl");
+date_default_timezone_set('Europe/Lisbon'); //ignored for now, see bug #58756
+
+$d = 1336308097.123;
+$mf = new MessageFormatter('en_US',
+	"On {0,time,yyyy-MM-dd G 'at' HH:mm:ss.SSS zzz} something odd happened");
+
+var_dump($mf->format(array(1336310569.123)));
+
+$p = 'On 2012-05-06 AD at 15:22:49.123 GMT+02:00 something odd happened';
+var_dump($mf->parse($p));
+
+?>
+==DONE==
+--EXPECTF--
+string(%d) "On 2012-05-0%d AD at %d:%d:49.123 %s something odd happened"
+array(1) {
+  [0]=>
+  float(1336310569.123)
+}
+==DONE==
\ No newline at end of file


commit f09961cbe5879df40e5fc9d6d424896caf2a6f64
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Sun May 13 21:56:11 2012 +0100

    Updated UPGRADING with changes to ext/intl.

diff --git a/UPGRADING b/UPGRADING
index 27d01cb..9f76366 100755
--- a/UPGRADING
+++ b/UPGRADING
@@ -52,6 +52,11 @@ PHP X.Y UPGRADE NOTES
   - "a" now does not remove trailing NUL characters on unpack() anymore
   - "A" will now strip all trailing ASCII whitespace on unpack() (it used to
     remove only trailing spaces.
+- MessageFormatter::format() and related functions now accepted named arguments
+  and mixed numeric/named arguments in ICU 4.8+.
+- MessageFormatter::format() and related functions now don't error out when
+  an insufficient argument count is provided. Instead, the placeholders will
+  remain unsubstituted.
 
 ========================================
 5. New Functions
@@ -146,6 +151,7 @@ PHP X.Y UPGRADE NOTES
 8. Other Changes to Extensions
 ========================================
 
+- The intl extension now requires ICU 4.0+.
 
 ========================================
 9. New Global Constants


commit 4015f5538914d1f7c66d992fd6ba6e713f635619
Merge: 8da61c6 5386067
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Sun May 13 21:36:21 2012 +0100

    Merge branch 'fr61871'



commit 53860672f3636049e5fbc29d49eb017893fa6808
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Sun May 13 20:14:14 2012 +0200

    ICU < 4.8 compat in MessageFormatter
    
    Restricted support for named arguments to ICU 4.8+.
    
    Also added bound checks when converting arguments to Formattables.

diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp
index b13c4c4..42c5466 100755
--- a/ext/intl/msgformat/msgformat_helpers.cpp
+++ b/ext/intl/msgformat/msgformat_helpers.cpp
@@ -25,7 +25,6 @@
 #include <limits.h>
 #include <unicode/msgfmt.h>
 #include <unicode/chariter.h>
-#include <unicode/messagepattern.h>
 #include <unicode/ustdio.h>
 
 #include <vector>
@@ -51,6 +50,10 @@ extern "C" {
 #define NAN (INFINITY-INFINITY)
 #endif
 
+#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM >= 48
+#define HAS_MESSAGE_PATTERN 1
+#endif
+
 U_NAMESPACE_BEGIN
 /**
  * This class isolates our access to private internal methods of
@@ -61,17 +64,23 @@ class MessageFormatAdapter {
 public:
     static const Formattable::Type* getArgTypeList(const MessageFormat& m,
                                                    int32_t& count);
+#ifdef HAS_MESSAGE_PATTERN
     static const MessagePattern getMessagePattern(MessageFormat* m);
+#endif
 };
+
 const Formattable::Type*
 MessageFormatAdapter::getArgTypeList(const MessageFormat& m,
                                      int32_t& count) {
     return m.getArgTypeList(count);
 }
+
+#ifdef HAS_MESSAGE_PATTERN
 const MessagePattern
 MessageFormatAdapter::getMessagePattern(MessageFormat* m) {
     return m->msgPattern;
 }
+#endif
 U_NAMESPACE_END
 
 U_CFUNC int32_t umsg_format_arg_count(UMessageFormat *fmt)
@@ -133,6 +142,52 @@ static double umsg_helper_zval_to_millis(zval *z, UErrorCode *status TSRMLS_DC)
 	return rv;
 }
 
+static HashTable *umsg_get_numeric_types(MessageFormatter_object *mfo,
+										 intl_error& err TSRMLS_DC)
+{
+	HashTable *ret;
+	int32_t parts_count;
+
+	if (U_FAILURE(err.code)) {
+		return NULL;
+	}
+
+	if (mfo->mf_data.arg_types) {
+		/* already cached */
+		return mfo->mf_data.arg_types;
+	}
+
+	const Formattable::Type *types = MessageFormatAdapter::getArgTypeList(
+		*(MessageFormat*)mfo->mf_data.umsgf, parts_count);
+
+	/* Hash table will store Formattable::Type objects directly,
+	 * so no need for destructor */
+	ALLOC_HASHTABLE(ret);
+	zend_hash_init(ret, parts_count, NULL, NULL, 0);
+
+	for (int i = 0; i < parts_count; i++) {
+		const Formattable::Type t = types[i];
+		if (zend_hash_index_update(ret, (ulong)i, (void*)&t, sizeof(t), NULL)
+				== FAILURE) {
+			intl_errors_set(&err, U_MEMORY_ALLOCATION_ERROR,
+				"Write to argument types hash table failed", 0 TSRMLS_CC);
+			break;
+		}
+	}
+
+	if (U_FAILURE(err.code)) {
+		zend_hash_destroy(ret);
+		efree(ret);
+
+		return NULL;
+	}
+
+	mfo->mf_data.arg_types = ret;
+
+	return ret;
+}
+
+#ifdef HAS_MESSAGE_PATTERN
 static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
 									const MessagePattern& mp,
 									intl_error& err TSRMLS_DC)
@@ -144,6 +199,10 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
 		return NULL;
 	}
 
+	if (!((MessageFormat *)mfo->mf_data.umsgf)->usesNamedArguments()) {
+		return umsg_get_numeric_types(mfo, err TSRMLS_CC);
+	}
+
 	if (mfo->mf_data.arg_types) {
 		/* already cached */
 		return mfo->mf_data.arg_types;
@@ -287,6 +346,27 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
 
 	return ret;
 }
+#endif
+
+static HashTable *umsg_get_types(MessageFormatter_object *mfo,
+								 intl_error& err TSRMLS_DC)
+{
+	MessageFormat *mf = (MessageFormat *)mfo->mf_data.umsgf;
+
+#ifdef HAS_MESSAGE_PATTERN
+	const MessagePattern mp = MessageFormatAdapter::getMessagePattern(mf);
+
+	return umsg_parse_format(mfo, mp, err TSRMLS_CC);
+#else
+	if (mf->usesNamedArguments()) {
+			intl_errors_set(&err, U_UNSUPPORTED_ERROR,
+				"This extension supports named arguments only on ICU 4.8+",
+				0 TSRMLS_CC);
+		return NULL;
+	}
+	return umsg_get_numeric_types(mfo, err TSRMLS_CC);
+#endif
+}
 
 U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
 								HashTable *args,
@@ -297,7 +377,6 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
 	std::vector<Formattable> fargs;
 	std::vector<UnicodeString> farg_names;
 	MessageFormat *mf = (MessageFormat *)mfo->mf_data.umsgf;
-	const MessagePattern mp = MessageFormatAdapter::getMessagePattern(mf);
 	HashTable *types;
 	intl_error& err = INTL_DATA_ERROR(mfo);
 
@@ -305,11 +384,11 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
 		return;
 	}
 
+	types = umsg_get_types(mfo, err TSRMLS_CC);
+
 	fargs.resize(arg_count);
 	farg_names.resize(arg_count);
 
-	types = umsg_parse_format(mfo, mp, err TSRMLS_CC);
-
 	int				argNum = 0;
 	HashPosition	pos;
 	zval			**elem;
@@ -414,19 +493,56 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
 					formattable.setDouble(d);
 					break;
 				}
+			case Formattable::kLong:
+				{
+					int32_t tInt32;
+retry_klong:
+					if (Z_TYPE_PP(elem) == IS_DOUBLE) {
+						if (Z_DVAL_PP(elem) > (double)INT32_MAX ||
+								Z_DVAL_PP(elem) < (double)INT32_MIN) {
+							intl_errors_set(&err, U_ILLEGAL_ARGUMENT_ERROR,
+								"Found PHP float with absolute value too large for "
+								"32 bit integer argument", 0 TSRMLS_CC);
+						} else {
+							tInt32 = (int32_t)Z_DVAL_PP(elem);
+						}
+					} else if (Z_TYPE_PP(elem) == IS_LONG) {
+						if (Z_LVAL_PP(elem) > INT32_MAX ||
+								Z_LVAL_PP(elem) < INT32_MIN) {
+							intl_errors_set(&err, U_ILLEGAL_ARGUMENT_ERROR,
+								"Found PHP integer with absolute value too large "
+								"for 32 bit integer argument", 0 TSRMLS_CC);
+						} else {
+							tInt32 = (int32_t)Z_LVAL_PP(elem);
+						}
+					} else {
+						SEPARATE_ZVAL_IF_NOT_REF(elem);
+						convert_scalar_to_number(*elem TSRMLS_CC);
+						goto retry_klong;
+					}
+					formattable.setLong(tInt32);
+					break;
+				}
 			case Formattable::kInt64:
 				{
 					int64_t tInt64;
+retry_kint64:
 					if (Z_TYPE_PP(elem) == IS_DOUBLE) {
-						tInt64 = (int64_t)Z_DVAL_PP(elem);
+						if (Z_DVAL_PP(elem) > (double)U_INT64_MAX ||
+								Z_DVAL_PP(elem) < (double)U_INT64_MIN) {
+							intl_errors_set(&err, U_ILLEGAL_ARGUMENT_ERROR,
+								"Found PHP float with absolute value too large for "
+								"64 bit integer argument", 0 TSRMLS_CC);
+						} else {
+							tInt64 = (int64_t)Z_DVAL_PP(elem);
+						}
 					} else if (Z_TYPE_PP(elem) == IS_LONG) {
+						/* assume long is not wider than 64 bits */
 						tInt64 = (int64_t)Z_LVAL_PP(elem);
 					} else {
 						SEPARATE_ZVAL_IF_NOT_REF(elem);
 						convert_scalar_to_number(*elem TSRMLS_CC);
-						tInt64 = (Z_TYPE_PP(elem) == IS_DOUBLE)
-							? (int64_t)Z_DVAL_PP(elem)
-							: Z_LVAL_PP(elem);
+						goto retry_kint64;
 					}
 					formattable.setInt64(tInt64);
 					break;
@@ -451,6 +567,10 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
 					formattable.setDate(dd);
 					break;
 				}
+			default:
+				intl_errors_set(&err, U_ILLEGAL_ARGUMENT_ERROR,
+					"Found unsupported argument type", 0 TSRMLS_CC);
+				break;
 			}
 		} else {
 			/* We couldn't find any information about the argument in the pattern, this
diff --git a/ext/intl/tests/msgfmt_format_error1.phpt b/ext/intl/tests/msgfmt_format_error1.phpt
index 09d022b..684b059 100644
--- a/ext/intl/tests/msgfmt_format_error1.phpt
+++ b/ext/intl/tests/msgfmt_format_error1.phpt
@@ -16,6 +16,4 @@ $mf = new MessageFormatter('en_US', $fmt);
 var_dump($mf->format(array(7)));
 
 --EXPECTF--
-
-Warning: MessageFormatter::format(): msgfmt_format: not enough parameters in %s on line %d
-bool(false)
+string(5) "7 {1}"
diff --git a/ext/intl/tests/msgfmt_format_error2.phpt b/ext/intl/tests/msgfmt_format_error2.phpt
index 00b8542..85d1b1c 100644
--- a/ext/intl/tests/msgfmt_format_error2.phpt
+++ b/ext/intl/tests/msgfmt_format_error2.phpt
@@ -4,6 +4,8 @@ MessageFormatter::format() inconsistent types in named argument
 <?php
 if (!extension_loaded('intl'))
 	die('skip intl extension not enabled');
+if (version_compare(INTL_ICU_VERSION, '4.8') < 0)
+	die('skip for ICU 4.8+');
 --FILE--
 <?php
 ini_set("intl.error_level", E_WARNING);
diff --git a/ext/intl/tests/msgfmt_format_error3.phpt b/ext/intl/tests/msgfmt_format_error3.phpt
index 98eebd7..6dfbee3 100644
--- a/ext/intl/tests/msgfmt_format_error3.phpt
+++ b/ext/intl/tests/msgfmt_format_error3.phpt
@@ -4,6 +4,8 @@ MessageFormatter::format() given negative arg key
 <?php
 if (!extension_loaded('intl'))
 	die('skip intl extension not enabled');
+if (version_compare(INTL_ICU_VERSION, '4.8') < 0)
+	die('skip for ICU 4.8+');
 --FILE--
 <?php
 ini_set("intl.error_level", E_WARNING);
diff --git a/ext/intl/tests/msgfmt_format_error4.phpt b/ext/intl/tests/msgfmt_format_error4.phpt
index 5f4d006..3b92b48 100644
--- a/ext/intl/tests/msgfmt_format_error4.phpt
+++ b/ext/intl/tests/msgfmt_format_error4.phpt
@@ -4,6 +4,8 @@ MessageFormatter::format() invalid UTF-8 for arg key or value
 <?php
 if (!extension_loaded('intl'))
 	die('skip intl extension not enabled');
+if (version_compare(INTL_ICU_VERSION, '4.8') < 0)
+	die('skip for ICU 4.8+');
 --FILE--
 <?php
 ini_set("intl.error_level", E_WARNING);
diff --git a/ext/intl/tests/msgfmt_format_error5.phpt b/ext/intl/tests/msgfmt_format_error5.phpt
index 951cd3f..0ea5169 100644
--- a/ext/intl/tests/msgfmt_format_error5.phpt
+++ b/ext/intl/tests/msgfmt_format_error5.phpt
@@ -4,6 +4,8 @@ MessageFormatter::format() invalid date/time argument
 <?php
 if (!extension_loaded('intl'))
 	die('skip intl extension not enabled');
+if (version_compare(INTL_ICU_VERSION, '4.8') < 0)
+	die('skip for ICU 4.8+');
 --FILE--
 <?php
 ini_set("intl.error_level", E_WARNING);
diff --git a/ext/intl/tests/msgfmt_format_error6.phpt b/ext/intl/tests/msgfmt_format_error6.phpt
index aefed90..b07d2ab 100644
--- a/ext/intl/tests/msgfmt_format_error6.phpt
+++ b/ext/intl/tests/msgfmt_format_error6.phpt
@@ -4,6 +4,8 @@ MessageFormatter::format() invalid type for key not in pattern
 <?php
 if (!extension_loaded('intl'))
 	die('skip intl extension not enabled');
+if (version_compare(INTL_ICU_VERSION, '4.8') < 0)
+	die('skip for ICU 4.8+');
 --FILE--
 <?php
 ini_set("intl.error_level", E_WARNING);
diff --git a/ext/intl/tests/msgfmt_format_mixed_params.phpt b/ext/intl/tests/msgfmt_format_mixed_params.phpt
index 3ab7688..93412f4 100644
--- a/ext/intl/tests/msgfmt_format_mixed_params.phpt
+++ b/ext/intl/tests/msgfmt_format_mixed_params.phpt
@@ -4,6 +4,8 @@ MessageFormatter::format(): mixed named and numeric parameters
 <?php
 if (!extension_loaded('intl'))
 	die('skip intl extension not enabled');
+if (version_compare(INTL_ICU_VERSION, '4.8') < 0)
+	die('skip for ICU 4.8+');
 --FILE--
 <?php
 ini_set("intl.error_level", E_WARNING);
diff --git a/ext/intl/tests/msgfmt_format_simple_types_numeric_strings.phpt b/ext/intl/tests/msgfmt_format_simple_types_numeric_strings.phpt
index 39cf815..c52c359 100644
--- a/ext/intl/tests/msgfmt_format_simple_types_numeric_strings.phpt
+++ b/ext/intl/tests/msgfmt_format_simple_types_numeric_strings.phpt
@@ -4,6 +4,8 @@ MessageFormatter::format(): simple types handling with numeric strings
 <?php
 if (!extension_loaded('intl'))
 	die('skip intl extension not enabled');
+if (version_compare(INTL_ICU_VERSION, '4.8') < 0)
+	die('skip for ICU 4.8+');
 --FILE--
 <?php
 ini_set("intl.error_level", E_WARNING);
diff --git a/ext/intl/tests/msgfmt_format_subpatterns.phpt b/ext/intl/tests/msgfmt_format_subpatterns.phpt
index ec7443f..9f11e3e 100644
--- a/ext/intl/tests/msgfmt_format_subpatterns.phpt
+++ b/ext/intl/tests/msgfmt_format_subpatterns.phpt
@@ -1,7 +1,11 @@
 --TEST--
 msgfmt_format() with subpatterns
 --SKIPIF--
-<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+<?php
+if (!extension_loaded('intl'))
+	die('skip intl extension not enabled');
+if (version_compare(INTL_ICU_VERSION, '4.8') < 0)
+	die('skip for ICU 4.8+');
 --FILE--
 <?php
 
@@ -45,7 +49,7 @@ $str_res = '';
         $fmt = ut_msgfmt_create( 'en_US', $pattern );
 		if(!$fmt) {
 			$str_res .= dump(intl_get_error_message())."\n";
-			continue;
+			return $str_res;
 		}
         foreach ($args as $arg) {
             $str_res .= dump( ut_msgfmt_format($fmt, $arg) ). "\n";
diff --git a/ext/intl/tests/msgfmt_format_subpatterns_named.phpt b/ext/intl/tests/msgfmt_format_subpatterns_named.phpt
index 98a6e01..f6af025 100644
--- a/ext/intl/tests/msgfmt_format_subpatterns_named.phpt
+++ b/ext/intl/tests/msgfmt_format_subpatterns_named.phpt
@@ -1,7 +1,11 @@
 --TEST--
 msgfmt_format() with named subpatterns
 --SKIPIF--
-<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+<?php
+if (!extension_loaded('intl'))
+	die('skip intl extension not enabled');
+if (version_compare(INTL_ICU_VERSION, '4.8') < 0)
+	die('skip for ICU 4.8+');
 --FILE--
 <?php
 
@@ -45,7 +49,7 @@ $str_res = '';
         $fmt = ut_msgfmt_create( 'en_US', $pattern );
 		if(!$fmt) {
 			$str_res .= dump(intl_get_error_message())."\n";
-			continue;
+			return $str_res;
 		}
         foreach ($args as $arg) {
             $str_res .= dump( ut_msgfmt_format($fmt, $arg) ). "\n";
diff --git a/ext/intl/tests/msgfmt_get_error.phpt b/ext/intl/tests/msgfmt_get_error.phpt
deleted file mode 100755
index 015c50d..0000000
--- a/ext/intl/tests/msgfmt_get_error.phpt
+++ /dev/null
@@ -1,29 +0,0 @@
---TEST--
-msgmfmt_get_error_message/code()
---SKIPIF--
-<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
---FILE--
-<?php
-
-/*
- * Error handling.
- */
-
-
-function ut_main()
-{
-    $fmt = ut_msgfmt_create( "en_US", "{0, number} monkeys on {1, number} trees" );
-    $num = ut_msgfmt_format( $fmt, array());
-    if( $num === false )
-        return $fmt->getErrorMessage() . " (" . $fmt->getErrorCode() . ")\n";
-    else
-        return "Ooops, an error should have occured.";
-}
-
-include_once( 'ut_common.inc' );
-
-// Run the test
-ut_run();
-?>
---EXPECT--
-msgfmt_format: not enough parameters: U_ILLEGAL_ARGUMENT_ERROR (1)


commit 43ff66e0953e3664de11ffa7af27c695057cc4d6
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Sun May 13 18:27:14 2012 +0200

    Don't check number of args in msgfmt_do_format
    
    The check does not work reliably across ICU versions when named arguments
    are added to the mix. For instance, for recent versions of ICU like 49,
    a pattern like "{foo,number} {foo}", has 0 returned from
    umsg_format_arg_count(), but for ICU 4.0, this returns 2.

diff --git a/ext/intl/msgformat/msgformat_format.c b/ext/intl/msgformat/msgformat_format.c
index 25bdf36..821adad 100755
--- a/ext/intl/msgformat/msgformat_format.c
+++ b/ext/intl/msgformat/msgformat_format.c
@@ -41,17 +41,6 @@ static void msgfmt_do_format(MessageFormatter_object *mfo, zval *args, zval *ret
 
 	count = zend_hash_num_elements(Z_ARRVAL_P(args));
 
-    /* umsg_format_arg_count() always returns 0 for named argument patterns,
-     * so this check is ignored and un-substituted {name} strings
-     * in a pattern are returned unmodified. */
-	if (count < umsg_format_arg_count(MSG_FORMAT_OBJECT(mfo))) {
-		/* Not enough aguments for format! */
-		intl_errors_set(INTL_DATA_ERROR_P(mfo), U_ILLEGAL_ARGUMENT_ERROR,
-			"msgfmt_format: not enough parameters", 0 TSRMLS_CC);
-		RETVAL_FALSE;
-		return;
-	}
-
 	ALLOC_HASHTABLE(args_copy);
 	zend_hash_init(args_copy, count, NULL, ZVAL_PTR_DTOR, 0);
 	zend_hash_copy(args_copy, Z_ARRVAL_P(args), (copy_ctor_func_t)zval_add_ref,


commit 0295ed7d225dcd9f5cbd21cfb335912a87af894d
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Mon May 7 01:18:30 2012 +0200

    Added new MessageFormatter tests.

diff --git a/ext/intl/tests/msgfmt_format_datetime.phpt b/ext/intl/tests/msgfmt_format_datetime.phpt
new file mode 100644
index 0000000..a79b822
--- /dev/null
+++ b/ext/intl/tests/msgfmt_format_datetime.phpt
@@ -0,0 +1,26 @@
+--TEST--
+MessageFormatter::format(): DateTime accepted to format dates and times
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+	die('skip intl extension not enabled');
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+//ini_set("intl.default_locale", "nl");
+
+$fmt = <<<EOD
+{0,date} {0,time}
+EOD;
+
+$dt = new DateTime("2012-05-06 18:00:42", new DateTimeZone("Europe/Lisbon"));
+
+$mf = new MessageFormatter('en_US', $fmt);
+
+var_dump($mf->format(array($dt)));
+
+?>
+==DONE==
+--EXPECTF--
+string(%s) "May %d, 2012 %d:%d:42 %s"
+==DONE==
\ No newline at end of file
diff --git a/ext/intl/tests/msgfmt_format_error1.phpt b/ext/intl/tests/msgfmt_format_error1.phpt
new file mode 100644
index 0000000..09d022b
--- /dev/null
+++ b/ext/intl/tests/msgfmt_format_error1.phpt
@@ -0,0 +1,21 @@
+--TEST--
+MessageFormatter::format() insufficient numeric arguments
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+	die('skip intl extension not enabled');
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+
+$fmt = <<<EOD
+{0} {1}
+EOD;
+
+$mf = new MessageFormatter('en_US', $fmt);
+var_dump($mf->format(array(7)));
+
+--EXPECTF--
+
+Warning: MessageFormatter::format(): msgfmt_format: not enough parameters in %s on line %d
+bool(false)
diff --git a/ext/intl/tests/msgfmt_format_error2.phpt b/ext/intl/tests/msgfmt_format_error2.phpt
new file mode 100644
index 0000000..00b8542
--- /dev/null
+++ b/ext/intl/tests/msgfmt_format_error2.phpt
@@ -0,0 +1,21 @@
+--TEST--
+MessageFormatter::format() inconsistent types in named argument
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+	die('skip intl extension not enabled');
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+
+$fmt = <<<EOD
+{foo,number} {foo}
+EOD;
+
+$mf = new MessageFormatter('en_US', $fmt);
+var_dump($mf->format(array(7)));
+
+--EXPECTF--
+
+Warning: MessageFormatter::format(): Inconsistent types declared for an argument in %s on line %d
+bool(false)
diff --git a/ext/intl/tests/msgfmt_format_error3.phpt b/ext/intl/tests/msgfmt_format_error3.phpt
new file mode 100644
index 0000000..98eebd7
--- /dev/null
+++ b/ext/intl/tests/msgfmt_format_error3.phpt
@@ -0,0 +1,21 @@
+--TEST--
+MessageFormatter::format() given negative arg key
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+	die('skip intl extension not enabled');
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+
+$fmt = <<<EOD
+{foo,number,percent}
+EOD;
+
+$mf = new MessageFormatter('en_US', $fmt);
+var_dump($mf->format(array("foo" => 7, -1 => "bar")));
+
+--EXPECTF--
+
+Warning: MessageFormatter::format(): Found negative or too large array key in %s on line %d
+bool(false)
diff --git a/ext/intl/tests/msgfmt_format_error4.phpt b/ext/intl/tests/msgfmt_format_error4.phpt
new file mode 100644
index 0000000..5f4d006
--- /dev/null
+++ b/ext/intl/tests/msgfmt_format_error4.phpt
@@ -0,0 +1,26 @@
+--TEST--
+MessageFormatter::format() invalid UTF-8 for arg key or value
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+	die('skip intl extension not enabled');
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+
+$fmt = <<<EOD
+{foo}
+EOD;
+
+$mf = new MessageFormatter('en_US', $fmt);
+var_dump($mf->format(array("foo" => 7, "\x80" => "bar")));
+
+var_dump($mf->format(array("foo" => "\x80")));
+
+--EXPECTF--
+
+Warning: MessageFormatter::format(): Invalid UTF-8 data in argument key: '€' in %s on line %d
+bool(false)
+
+Warning: MessageFormatter::format(): Invalid UTF-8 data in string argument: '€' in %s on line %d
+bool(false)
diff --git a/ext/intl/tests/msgfmt_format_error5.phpt b/ext/intl/tests/msgfmt_format_error5.phpt
new file mode 100644
index 0000000..951cd3f
--- /dev/null
+++ b/ext/intl/tests/msgfmt_format_error5.phpt
@@ -0,0 +1,21 @@
+--TEST--
+MessageFormatter::format() invalid date/time argument
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+	die('skip intl extension not enabled');
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+
+$fmt = <<<EOD
+{foo,date}
+EOD;
+
+$mf = new MessageFormatter('en_US', $fmt);
+var_dump($mf->format(array("foo" => new stdclass())));
+
+--EXPECTF--
+
+Warning: MessageFormatter::format(): The argument for key 'foo' cannot be used as a date or time in %s on line %d
+bool(false)
diff --git a/ext/intl/tests/msgfmt_format_error6.phpt b/ext/intl/tests/msgfmt_format_error6.phpt
new file mode 100644
index 0000000..aefed90
--- /dev/null
+++ b/ext/intl/tests/msgfmt_format_error6.phpt
@@ -0,0 +1,21 @@
+--TEST--
+MessageFormatter::format() invalid type for key not in pattern
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+	die('skip intl extension not enabled');
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+
+$fmt = <<<EOD
+{foo}
+EOD;
+
+$mf = new MessageFormatter('en_US', $fmt);
+var_dump($mf->format(array("foo" => 'bar', 7 => fopen('php://memory', 'r+'))));
+
+--EXPECTF--
+
+Warning: MessageFormatter::format(): No strategy to convert the value given for the argument with key '7' is available in %s on line %d
+bool(false)
diff --git a/ext/intl/tests/msgfmt_format_mixed_params.phpt b/ext/intl/tests/msgfmt_format_mixed_params.phpt
new file mode 100644
index 0000000..3ab7688
--- /dev/null
+++ b/ext/intl/tests/msgfmt_format_mixed_params.phpt
@@ -0,0 +1,23 @@
+--TEST--
+MessageFormatter::format(): mixed named and numeric parameters
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+	die('skip intl extension not enabled');
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+//ini_set("intl.default_locale", "nl");
+
+$mf = new MessageFormatter('en_US',
+	"{0,number} -- {foo,ordinal}");
+	
+var_dump($mf->format(array(2.3, "foo" => 1.3)));
+var_dump($mf->format(array("foo" => 1.3, 0 => 2.3)));
+
+?>
+==DONE==
+--EXPECT--
+string(10) "2.3 -- 1st"
+string(10) "2.3 -- 1st"
+==DONE==
\ No newline at end of file
diff --git a/ext/intl/tests/msgfmt_format_simple_types_numeric_strings.phpt b/ext/intl/tests/msgfmt_format_simple_types_numeric_strings.phpt
new file mode 100644
index 0000000..39cf815
--- /dev/null
+++ b/ext/intl/tests/msgfmt_format_simple_types_numeric_strings.phpt
@@ -0,0 +1,54 @@
+--TEST--
+MessageFormatter::format(): simple types handling with numeric strings
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+	die('skip intl extension not enabled');
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+//ini_set("intl.default_locale", "nl");
+
+$mf = new MessageFormatter('en_US',"
+	none			{a}
+	number			{b,number}
+	number integer	{c,number,integer}
+	number currency	{d,number,currency}
+	number percent	{e,number,percent}
+	date			{f,date}
+	time			{g,time}
+	spellout		{h,spellout}
+	ordinal			{i,ordinal}
+	duration		{j,duration}
+	");
+	
+$ex = "1336317965.5 str";
+var_dump($mf->format(array(
+'a' => $ex,
+'b' => $ex,
+'c' => $ex,
+'d' => $ex,
+'e' => $ex,
+'f' => "  1336317965.5",
+'g' => "  1336317965.5",
+'h' => $ex,
+'i' => $ex,
+'j' => $ex,
+)));
+
+?>
+==DONE==
+--EXPECTF--
+string(%d) "
+	none			1336317965.5 str
+	number			1,336,317,965.5
+	number integer	1,336,317,965
+	number currency	$1,336,317,965.50
+	number percent	133,631,796,550%
+	date			May %d, 2012
+	time			%d:%d:05 PM
+	spellout		one billion three hundred thirty-six million three hundred seventeen thousand nine hundred sixty-five point five
+	ordinal			1,336,317,966th
+	duration		371,199:26:06
+	"
+==DONE==
\ No newline at end of file


commit 1c4f99b98828bb752794e0fc45bd3884848b001d
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Sun May 6 23:45:08 2012 +0200

    Better error messages in MessageFormatter::format.

diff --git a/ext/intl/msgformat/msgformat_format.c b/ext/intl/msgformat/msgformat_format.c
index 412a5f7..25bdf36 100755
--- a/ext/intl/msgformat/msgformat_format.c
+++ b/ext/intl/msgformat/msgformat_format.c
@@ -57,18 +57,20 @@ static void msgfmt_do_format(MessageFormatter_object *mfo, zval *args, zval *ret
 	zend_hash_copy(args_copy, Z_ARRVAL_P(args), (copy_ctor_func_t)zval_add_ref,
 		NULL, sizeof(zval*));
 
-	umsg_format_helper(mfo, args_copy,
-		&formatted, &formatted_len, &INTL_DATA_ERROR_CODE(mfo) TSRMLS_CC);
+	umsg_format_helper(mfo, args_copy, &formatted, &formatted_len TSRMLS_CC);
 
 	zend_hash_destroy(args_copy);
 	efree(args_copy);
 
-	if (formatted && U_FAILURE( INTL_DATA_ERROR_CODE(mfo) ) ) {
+	if (formatted && U_FAILURE(INTL_DATA_ERROR_CODE(mfo))) {
 			efree(formatted);
 	}
 
-	INTL_METHOD_CHECK_STATUS( mfo, "Number formatting failed" );
-	INTL_METHOD_RETVAL_UTF8( mfo, formatted, formatted_len, 1 );
+	if (U_FAILURE(INTL_DATA_ERROR_CODE(mfo))) {
+		RETURN_FALSE;
+	} else {
+		INTL_METHOD_RETVAL_UTF8(mfo, formatted, formatted_len, 1);
+	}
 }
 /* }}} */
 
diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp
index 7a27701..b13c4c4 100755
--- a/ext/intl/msgformat/msgformat_helpers.cpp
+++ b/ext/intl/msgformat/msgformat_helpers.cpp
@@ -135,12 +135,12 @@ static double umsg_helper_zval_to_millis(zval *z, UErrorCode *status TSRMLS_DC)
 
 static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
 									const MessagePattern& mp,
-									UErrorCode& uec)
+									intl_error& err TSRMLS_DC)
 {
 	HashTable *ret;
 	int32_t parts_count;
 
-	if (U_FAILURE(uec)) {
+	if (U_FAILURE(err.code)) {
 		return NULL;
 	}
 
@@ -167,33 +167,35 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
 	*/
 	/* The last two "parts" can at most be ARG_LIMIT and MSG_LIMIT
 	 * which we need not examine. */
-	for (int32_t i = 0; i < parts_count - 2 && U_SUCCESS(uec); i++) {
-        MessagePattern::Part p = mp.getPart(i);
+	for (int32_t i = 0; i < parts_count - 2 && U_SUCCESS(err.code); i++) {
+		MessagePattern::Part p = mp.getPart(i);
 
-        if (p.getType() != UMSGPAT_PART_TYPE_ARG_START) {
+		if (p.getType() != UMSGPAT_PART_TYPE_ARG_START) {
 			continue;
 		}
 
-        MessagePattern::Part name_part = mp.getPart(++i); /* Getting name, advancing i */
+		MessagePattern::Part name_part = mp.getPart(++i); /* Getting name, advancing i */
 		Formattable::Type type,
 						  *storedType;
 
-        if (name_part.getType() == UMSGPAT_PART_TYPE_ARG_NAME) {
-            UnicodeString argName = mp.getSubstring(name_part);
+		if (name_part.getType() == UMSGPAT_PART_TYPE_ARG_NAME) {
+			UnicodeString argName = mp.getSubstring(name_part);
 			if (zend_hash_find(ret, (char*)argName.getBuffer(), argName.length(),
 					(void**)&storedType) == FAILURE) {
 				/* not found already; create new entry in HT */
 				Formattable::Type bogusType = Formattable::kObject;
 				if (zend_hash_update(ret, (char*)argName.getBuffer(), argName.length(),
 						(void*)&bogusType, sizeof(bogusType), (void**)&storedType) == FAILURE) {
-					uec = U_MEMORY_ALLOCATION_ERROR;
+					intl_errors_set(&err, U_MEMORY_ALLOCATION_ERROR,
+						"Write to argument types hash table failed", 0 TSRMLS_CC);
 					continue;
 				}
 			}
-        } else if (name_part.getType() == UMSGPAT_PART_TYPE_ARG_NUMBER) {
-            int32_t argNumber = name_part.getValue();
+		} else if (name_part.getType() == UMSGPAT_PART_TYPE_ARG_NUMBER) {
+			int32_t argNumber = name_part.getValue();
 			if (argNumber < 0) {
-				uec = U_INVALID_FORMAT_ERROR;
+				intl_errors_set(&err, U_INVALID_FORMAT_ERROR,
+					"Found part with negative number", 0 TSRMLS_CC);
 				continue;
 			}
 			if (zend_hash_index_find(ret, (ulong)argNumber, (void**)&storedType)
@@ -202,73 +204,79 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
 				Formattable::Type bogusType = Formattable::kObject;
 				if (zend_hash_index_update(ret, (ulong)argNumber, (void*)&bogusType,
 						sizeof(bogusType), (void**)&storedType) == FAILURE) {
-					uec = U_MEMORY_ALLOCATION_ERROR;
+					intl_errors_set(&err, U_MEMORY_ALLOCATION_ERROR,
+						"Write to argument types hash table failed", 0 TSRMLS_CC);
 					continue;
 				}
 			}
-        }
+		}
 
-        UMessagePatternArgType argType = p.getArgType();
-        /* No type specified, treat it as a string */
-        if (argType == UMSGPAT_ARG_TYPE_NONE) {
-            type = Formattable::kString;
+		UMessagePatternArgType argType = p.getArgType();
+		/* No type specified, treat it as a string */
+		if (argType == UMSGPAT_ARG_TYPE_NONE) {
+			type = Formattable::kString;
 		} else { /* Some type was specified, might be simple or complicated */
-            if (argType == UMSGPAT_ARG_TYPE_SIMPLE) {
-                /* For a SIMPLE arg, after the name part, there should be
-                 * an ARG_TYPE part whose string value tells us what to do */
-                MessagePattern::Part type_part = mp.getPart(++i); /* Getting type, advancing i */
-                if (type_part.getType() == UMSGPAT_PART_TYPE_ARG_TYPE) {
-                    UnicodeString typeString = mp.getSubstring(type_part);
-                    /* This is all based on the rules in the docs for MessageFormat
-                     * @see http://icu-project.org/apiref/icu4c/classMessageFormat.html */
-                    if (typeString == "number") {
-                        MessagePattern::Part style_part = mp.getPart(i + 1); /* Not advancing i */
-                        if (style_part.getType() == UMSGPAT_PART_TYPE_ARG_STYLE) {
-                            UnicodeString styleString = mp.getSubstring(style_part);
-                            if (styleString == "integer") {
-                                type = Formattable::kInt64;
-                            } else if (styleString == "currency") {
-                                type = Formattable::kDouble;
-                            } else if (styleString == "percent") {
-                                type = Formattable::kDouble;
-                            }
-                        } else { // if missing style, part, make it a double
-                            type = Formattable::kDouble;
-                        }
-                    } else if ((typeString == "date") || (typeString == "time")) {
-                        type = Formattable::kDate;
-                    } else if ((typeString == "spellout") || (typeString == "ordinal")
+			if (argType == UMSGPAT_ARG_TYPE_SIMPLE) {
+				/* For a SIMPLE arg, after the name part, there should be
+				 * an ARG_TYPE part whose string value tells us what to do */
+				MessagePattern::Part type_part = mp.getPart(++i); /* Getting type, advancing i */
+				if (type_part.getType() == UMSGPAT_PART_TYPE_ARG_TYPE) {
+					UnicodeString typeString = mp.getSubstring(type_part);
+					/* This is all based on the rules in the docs for MessageFormat
+					 * @see http://icu-project.org/apiref/icu4c/classMessageFormat.html */
+					if (typeString == "number") {
+						MessagePattern::Part style_part = mp.getPart(i + 1); /* Not advancing i */
+						if (style_part.getType() == UMSGPAT_PART_TYPE_ARG_STYLE) {
+							UnicodeString styleString = mp.getSubstring(style_part);
+							if (styleString == "integer") {
+								type = Formattable::kInt64;
+							} else if (styleString == "currency") {
+								type = Formattable::kDouble;
+							} else if (styleString == "percent") {
+								type = Formattable::kDouble;
+							} else { /* some style invalid/unknown to us */
+								type = Formattable::kDouble;
+							}
+						} else { // if missing style, part, make it a double
+							type = Formattable::kDouble;
+						}
+					} else if ((typeString == "date") || (typeString == "time")) {
+						type = Formattable::kDate;
+					} else if ((typeString == "spellout") || (typeString == "ordinal")
 							|| (typeString == "duration")) {
-                        type = Formattable::kDouble;
-                    }
-                } else {
-                    /* If there's no UMSGPAT_PART_TYPE_ARG_TYPE right after a
-                     * UMSGPAT_ARG_TYPE_SIMPLE argument, then the pattern
-                     * is broken. */
-                    uec = U_PARSE_ERROR;
-                    continue;
-                }
-            } else if (argType == UMSGPAT_ARG_TYPE_PLURAL) {
-                type = Formattable::kDouble;
-            } else if (argType == UMSGPAT_ARG_TYPE_CHOICE) {
-                type = Formattable::kDouble;
-            } else if (argType == UMSGPAT_ARG_TYPE_SELECT) {
-                type = Formattable::kString;
-            } else {
-                type = Formattable::kString;
-            }
-        } /* was type specified? */
+						type = Formattable::kDouble;
+					}
+				} else {
+					/* If there's no UMSGPAT_PART_TYPE_ARG_TYPE right after a
+					 * UMSGPAT_ARG_TYPE_SIMPLE argument, then the pattern
+					 * is broken. */
+					intl_errors_set(&err, U_PARSE_ERROR,
+						"Expected UMSGPAT_PART_TYPE_ARG_TYPE part following "
+						"UMSGPAT_ARG_TYPE_SIMPLE part", 0 TSRMLS_CC);
+					continue;
+				}
+			} else if (argType == UMSGPAT_ARG_TYPE_PLURAL) {
+				type = Formattable::kDouble;
+			} else if (argType == UMSGPAT_ARG_TYPE_CHOICE) {
+				type = Formattable::kDouble;
+			} else if (argType == UMSGPAT_ARG_TYPE_SELECT) {
+				type = Formattable::kString;
+			} else {
+				type = Formattable::kString;
+			}
+		} /* was type specified? */
 
 		/* We found a different type for the same arg! */
 		if (*storedType != Formattable::kObject && *storedType != type) {
-			uec = U_ARGUMENT_TYPE_MISMATCH;
+			intl_errors_set(&err, U_ARGUMENT_TYPE_MISMATCH,
+				"Inconsistent types declared for an argument", 0 TSRMLS_CC);
 			continue;
 		}
 
 		*storedType = type;
 	} /* visiting each part */
 
-	if (U_FAILURE(uec)) {
+	if (U_FAILURE(err.code)) {
 		zend_hash_destroy(ret);
 		efree(ret);
 
@@ -280,22 +288,27 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
 	return ret;
 }
 
-U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo, HashTable *args, UChar **formatted, int *formatted_len, UErrorCode *status TSRMLS_DC)
+U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
+								HashTable *args,
+								UChar **formatted,
+								int *formatted_len TSRMLS_DC)
 {
 	int arg_count = zend_hash_num_elements(args);
 	std::vector<Formattable> fargs;
 	std::vector<UnicodeString> farg_names;
 	MessageFormat *mf = (MessageFormat *)mfo->mf_data.umsgf;
-    const MessagePattern mp = MessageFormatAdapter::getMessagePattern(mf);
+	const MessagePattern mp = MessageFormatAdapter::getMessagePattern(mf);
 	HashTable *types;
+	intl_error& err = INTL_DATA_ERROR(mfo);
+
+	if (U_FAILURE(err.code)) {
+		return;
+	}
 
 	fargs.resize(arg_count);
 	farg_names.resize(arg_count);
 
-	types = umsg_parse_format(mfo, mp, *status);
-	if (U_FAILURE(*status)) {
-		return;
-	}
+	types = umsg_parse_format(mfo, mp, err TSRMLS_CC);
 
 	int				argNum = 0;
 	HashPosition	pos;
@@ -308,7 +321,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo, HashTable *args, U
 	ulong			num_index;
 
 	for (zend_hash_internal_pointer_reset_ex(args, &pos);
-		U_SUCCESS(*status) &&
+		U_SUCCESS(err.code) &&
 			(key_type = zend_hash_get_current_key_ex(
 					args, &str_index, &str_len, &num_index, 0, &pos),
 				zend_hash_get_current_data_ex(args, (void **)&elem, &pos)
@@ -323,20 +336,27 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo, HashTable *args, U
 		/* Process key and retrieve type */
 		if (key_type == HASH_KEY_IS_LONG) {
 			/* includes case where index < 0 because it's exposed as unsigned */
-			if (num_index > INT32_MAX) {
-				*status = U_ILLEGAL_ARGUMENT_ERROR;
+			if (num_index > (ulong)INT32_MAX) {
+				intl_errors_set(&err, U_ILLEGAL_ARGUMENT_ERROR,
+					"Found negative or too large array key", 0 TSRMLS_CC);
 				continue;
 			}
 
-           UChar temp[16];
+		   UChar temp[16];
 		   int32_t len = u_sprintf(temp, "%u", (uint32_t)num_index);
-           key.append(temp, len);
+		   key.append(temp, len);
 
 		   zend_hash_index_find(types, (ulong)num_index, (void**)&storedArgType);
 		} else { //string; assumed to be in UTF-8
-			intl_stringFromChar(key, str_index, str_len-1, status);
-			if (U_FAILURE(*status)) {
-				   continue;
+			intl_stringFromChar(key, str_index, str_len-1, &err.code);
+
+			if (U_FAILURE(err.code)) {
+				char *message;
+				spprintf(&message, 0,
+					"Invalid UTF-8 data in argument key: '%s'", str_index);
+				intl_errors_set(&err, err.code,	message, 1 TSRMLS_CC);
+				efree(message);
+				continue;
 			}
 
 			zend_hash_find(types, (char*)key.getBuffer(), key.length(),
@@ -350,107 +370,153 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo, HashTable *args, U
 		/* Convert zval to formattable according to message format type
 		 * or (as a fallback) the zval type */
 		if (argType != Formattable::kObject) {
-            switch (argType) {
+			switch (argType) {
 			case Formattable::kString:
 				{
-string_arg: //XXX: make function
-					/* This implicitly converts objects */
+	string_arg:
+					/* This implicitly converts objects
+					 * Note that our vectors will leak if object conversion fails
+					 * and PHP ends up with a fatal error and calls longjmp
+					 * as a result of that.
+					 */
 					convert_to_string_ex(elem);
 
 					UnicodeString *text = new UnicodeString();
-					intl_stringFromChar(*text, Z_STRVAL_PP(elem), Z_STRLEN_PP(elem), status);
-					if (U_FAILURE(*status)) {
+					intl_stringFromChar(*text,
+						Z_STRVAL_PP(elem), Z_STRLEN_PP(elem), &err.code);
+
+					if (U_FAILURE(err.code)) {
+						char *message;
+						spprintf(&message, 0, "Invalid UTF-8 data in string argument: "
+							"'%s'", Z_STRVAL_PP(elem));
+						intl_errors_set(&err, err.code, message, 1 TSRMLS_CC);
+						efree(message);
 						delete text;
 						continue;
 					}
 					formattable.adoptString(text);
 					break;
 				}
-            case Formattable::kDouble:
-                {
-                    double d;
-                    if (Z_TYPE_PP(elem) == IS_DOUBLE) {
-                        d = Z_DVAL_PP(elem);
-                    } else if (Z_TYPE_PP(elem) == IS_LONG) {
-                        d = (double)Z_LVAL_PP(elem);
-                    } else {
-                        SEPARATE_ZVAL_IF_NOT_REF(elem);
-                        convert_scalar_to_number(*elem TSRMLS_CC);
-                        d = (Z_TYPE_PP(elem) == IS_DOUBLE)
+			case Formattable::kDouble:
+				{
+					double d;
+					if (Z_TYPE_PP(elem) == IS_DOUBLE) {
+						d = Z_DVAL_PP(elem);
+					} else if (Z_TYPE_PP(elem) == IS_LONG) {
+						d = (double)Z_LVAL_PP(elem);
+					} else {
+						SEPARATE_ZVAL_IF_NOT_REF(elem);
+						convert_scalar_to_number(*elem TSRMLS_CC);
+						d = (Z_TYPE_PP(elem) == IS_DOUBLE)
 							? Z_DVAL_PP(elem)
 							: (double)Z_LVAL_PP(elem);
-                    }
+					}
 					formattable.setDouble(d);
-                    break;
-                }
-            case Formattable::kInt64:
-                {
-                    int64_t tInt64;
-                    if (Z_TYPE_PP(elem) == IS_DOUBLE) {
-                        tInt64 = (int64_t)Z_DVAL_PP(elem);
-                    } else if (Z_TYPE_PP(elem) == IS_LONG) {
-                        tInt64 = (int64_t)Z_LVAL_PP(elem);
-                    } else {
-                        SEPARATE_ZVAL_IF_NOT_REF(elem);
-                        convert_scalar_to_number(*elem TSRMLS_CC);
-                        tInt64 = (Z_TYPE_PP(elem) == IS_DOUBLE)
+					break;
+				}
+			case Formattable::kInt64:
+				{
+					int64_t tInt64;
+					if (Z_TYPE_PP(elem) == IS_DOUBLE) {
+						tInt64 = (int64_t)Z_DVAL_PP(elem);
+					} else if (Z_TYPE_PP(elem) == IS_LONG) {
+						tInt64 = (int64_t)Z_LVAL_PP(elem);
+					} else {
+						SEPARATE_ZVAL_IF_NOT_REF(elem);
+						convert_scalar_to_number(*elem TSRMLS_CC);
+						tInt64 = (Z_TYPE_PP(elem) == IS_DOUBLE)
 							? (int64_t)Z_DVAL_PP(elem)
 							: Z_LVAL_PP(elem);
-                    }
-                    formattable.setInt64(tInt64);
-                    break;
-                }
-            case Formattable::kDate:
-                {
-                    double dd = umsg_helper_zval_to_millis(*elem, status TSRMLS_CC);
-					if (U_FAILURE(*status)) {
+					}
+					formattable.setInt64(tInt64);
+					break;
+				}
+			case Formattable::kDate:
+				{
+					double dd = umsg_helper_zval_to_millis(*elem, &err.code TSRMLS_CC);
+					if (U_FAILURE(err.code)) {
+						char *message, *key_char;
+						int key_len;
+						UErrorCode status = UErrorCode();
+						if (intl_charFromString(key, &key_char, &key_len,
+								&status) == SUCCESS) {
+							spprintf(&message, 0, "The argument for key '%s' "
+								"cannot be used as a date or time", key_char);
+							intl_errors_set(&err, err.code, message, 1 TSRMLS_CC);
+							efree(key_char);
+							efree(message);
+						}
 						continue;
 					}
-                    formattable.setDate(dd);
-                    break;
-                }
-            }
-        } else {
-            /* We couldn't find any information about the argument in the pattern, this
-             * means it's an extra argument. So convert it to a number if it's a number or
-             * bool or null and to a string if it's anything else. */
-            switch (Z_TYPE_PP(elem)) {
-            case IS_DOUBLE:
-                formattable.setDouble(Z_DVAL_PP(elem));
-                break;
-            case IS_BOOL:
-                convert_to_long_ex(elem);
-                /* Intentional fallthrough */
-            case IS_LONG:
-                formattable.setInt64((int64_t)Z_LVAL_PP(elem));
-                break;
-            case IS_NULL:
-                formattable.setInt64((int64_t)0);
-                break;
-            default:
-                goto string_arg;
-            }
+					formattable.setDate(dd);
+					break;
+				}
+			}
+		} else {
+			/* We couldn't find any information about the argument in the pattern, this
+			 * means it's an extra argument. So convert it to a number if it's a number or
+			 * bool or null and to a string if it's anything else except arrays . */
+			switch (Z_TYPE_PP(elem)) {
+			case IS_DOUBLE:
+				formattable.setDouble(Z_DVAL_PP(elem));
+				break;
+			case IS_BOOL:
+				convert_to_long_ex(elem);
+				/* Intentional fallthrough */
+			case IS_LONG:
+				formattable.setInt64((int64_t)Z_LVAL_PP(elem));
+				break;
+			case IS_NULL:
+				formattable.setInt64((int64_t)0);
+				break;
+			case IS_STRING:
+			case IS_OBJECT:
+				goto string_arg;
+			default:
+				{
+					char *message, *key_char;
+					int key_len;
+					UErrorCode status = UErrorCode();
+					if (intl_charFromString(key, &key_char, &key_len,
+							&status) == SUCCESS) {
+						spprintf(&message, 0, "No strategy to convert the "
+							"value given for the argument with key '%s' "
+							"is available", key_char);
+						intl_errors_set(&err,
+							U_ILLEGAL_ARGUMENT_ERROR, message, 1 TSRMLS_CC);
+						efree(key_char);
+						efree(message);
+					}
+				}
+			}
 		}
-    } // visiting each argument
+	} // visiting each argument
 
-    if (U_FAILURE(*status)){
-        return;
-    }
+	if (U_FAILURE(err.code)) {
+		return;
+	}
 
 	UnicodeString resultStr;
 	FieldPosition fieldPosition(0);
 
-    /* format the message */
+	/* format the message */
 	mf->format(farg_names.empty() ? NULL : &farg_names[0],
-		fargs.empty() ? NULL : &fargs[0], arg_count, resultStr, *status);
+		fargs.empty() ? NULL : &fargs[0], arg_count, resultStr, err.code);
 
-    if (U_FAILURE(*status)) {
-        return;
-    }
+	if (U_FAILURE(err.code)) {
+		intl_errors_set(&err, err.code,
+			"Call to ICU MessageFormat::format() has failed", 0 TSRMLS_CC);
+		return;
+	}
 
 	*formatted_len = resultStr.length();
 	*formatted = eumalloc(*formatted_len+1);
-	resultStr.extract(*formatted, *formatted_len+1, *status);
+	resultStr.extract(*formatted, *formatted_len+1, err.code);
+	if (U_FAILURE(err.code)) {
+		intl_errors_set(&err, err.code,
+			"Error copying format() result", 0 TSRMLS_CC);
+		return;
+	}
 }
 
 #define cleanup_zvals() for(int j=i;j>=0;j--) { zval_ptr_dtor((*args)+i); }
diff --git a/ext/intl/msgformat/msgformat_helpers.h b/ext/intl/msgformat/msgformat_helpers.h
index 7a04248..e6eda08 100755
--- a/ext/intl/msgformat/msgformat_helpers.h
+++ b/ext/intl/msgformat/msgformat_helpers.h
@@ -19,7 +19,7 @@
 
 int32_t umsg_format_arg_count(UMessageFormat *fmt);
 void umsg_format_helper(MessageFormatter_object *mfo, HashTable *args,
-						UChar **formatted, int *formatted_len, UErrorCode *status TSRMLS_DC);
+						UChar **formatted, int *formatted_len TSRMLS_DC);
 void umsg_parse_helper(UMessageFormat *fmt, int *count, zval ***args,
 					   UChar *source, int source_len, UErrorCode *status);
 #endif // MSG_FORMAT_HELPERS_H


commit 0ad1b14f16262f77372620992a72dd3f12c5e24b
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Sun May 6 18:12:53 2012 +0200

    Accept numeric strings for dates.
    
    Refactored umsg_helper_zval_to_millis in the process.

diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp
index 1a7dc89..7a27701 100755
--- a/ext/intl/msgformat/msgformat_helpers.cpp
+++ b/ext/intl/msgformat/msgformat_helpers.cpp
@@ -22,6 +22,7 @@
 #include <stdio.h>
 
 #include <math.h>
+#include <limits.h>
 #include <unicode/msgfmt.h>
 #include <unicode/chariter.h>
 #include <unicode/messagepattern.h>
@@ -42,6 +43,14 @@ extern "C" {
 #include "ext/date/php_date.h"
 }
 
+#ifndef INFINITY
+#define INFINITY (DBL_MAX+DBL_MAX)
+#endif
+
+#ifndef NAN
+#define NAN (INFINITY-INFINITY)
+#endif
+
 U_NAMESPACE_BEGIN
 /**
  * This class isolates our access to private internal methods of
@@ -72,14 +81,33 @@ U_CFUNC int32_t umsg_format_arg_count(UMessageFormat *fmt)
 	return fmt_count;
 }
 
-double umsg_helper_zval_to_millis(zval *z, UErrorCode *status TSRMLS_DC) {
-	double rv = 0.0;
-	if (Z_TYPE_P(z) == IS_DOUBLE) {
-		rv = U_MILLIS_PER_SECOND * Z_DVAL_P(z);
-	} else if (Z_TYPE_P(z) == IS_LONG) {
+static double umsg_helper_zval_to_millis(zval *z, UErrorCode *status TSRMLS_DC) {
+	double rv = NAN;
+	long lv;
+	int type;
+
+	if (U_FAILURE(*status)) {
+		return NAN;
+	}
+
+	switch (Z_TYPE_P(z)) {
+	case IS_STRING:
+		type = is_numeric_string(Z_STRVAL_P(z), Z_STRLEN_P(z), &lv, &rv, 0);
+		if (type == IS_DOUBLE) {
+			rv *= U_MILLIS_PER_SECOND;
+		} else if (type == IS_LONG) {
+			rv = U_MILLIS_PER_SECOND * (double)lv;
+		} else {
+			*status = U_ILLEGAL_ARGUMENT_ERROR;
+		}
+		break;
+	case IS_LONG:
 		rv = U_MILLIS_PER_SECOND * (double)Z_LVAL_P(z);
-	} else if (Z_TYPE_P(z) == IS_OBJECT) {
-		/* Borrowed from datefmt_format() in intl/dateformat/dateformat_format.c */
+		break;
+	case IS_DOUBLE:
+		rv = U_MILLIS_PER_SECOND * Z_DVAL_P(z);
+		break;
+	case IS_OBJECT:
 		if (instanceof_function(Z_OBJCE_P(z), php_date_get_date_ce() TSRMLS_CC)) {
 			zval retval;
 			zval *zfuncname;
@@ -88,15 +116,20 @@ double umsg_helper_zval_to_millis(zval *z, UErrorCode *status TSRMLS_DC) {
 			ZVAL_STRING(zfuncname, "getTimestamp", 1);
 			if (call_user_function(NULL, &(z), zfuncname, &retval, 0, NULL TSRMLS_CC)
 					!= SUCCESS || Z_TYPE(retval) != IS_LONG) {
-				*status = U_RESOURCE_TYPE_MISMATCH;
+				*status = U_INTERNAL_PROGRAM_ERROR;
 			} else {
 				rv = U_MILLIS_PER_SECOND * (double)Z_LVAL(retval);
 			}
 			zval_ptr_dtor(&zfuncname);
 		} else {
+			/* TODO: try with cast(), get() to obtain a number */
 			*status = U_ILLEGAL_ARGUMENT_ERROR;
 		}
+		break;
+	default:
+		*status = U_ILLEGAL_ARGUMENT_ERROR;
 	}
+
 	return rv;
 }
 


commit 20dd5ccf19916a290973a2e25de4eed59b169093
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Sun May 6 16:31:52 2012 +0200

    Cache arguments type info in MessageFormatter.

diff --git a/ext/intl/msgformat/msgformat_attr.c b/ext/intl/msgformat/msgformat_attr.c
index cf34665..c7a4d1c 100755
--- a/ext/intl/msgformat/msgformat_attr.c
+++ b/ext/intl/msgformat/msgformat_attr.c
@@ -100,6 +100,12 @@ PHP_FUNCTION( msgfmt_set_pattern )
 	}
 	mfo->mf_data.orig_format = estrndup(value, value_len);
 	mfo->mf_data.orig_format_len = value_len;
+	/* invalidate cached format types */
+	if (mfo->mf_data.arg_types) {
+		zend_hash_destroy(mfo->mf_data.arg_types);
+		efree(mfo->mf_data.arg_types);
+		mfo->mf_data.arg_types = NULL;
+	}
 
 	RETURN_TRUE;
 }
diff --git a/ext/intl/msgformat/msgformat_data.c b/ext/intl/msgformat/msgformat_data.c
index 95e81d3..9ed129f 100755
--- a/ext/intl/msgformat/msgformat_data.c
+++ b/ext/intl/msgformat/msgformat_data.c
@@ -31,6 +31,7 @@ void msgformat_data_init( msgformat_data* mf_data TSRMLS_DC )
 
 	mf_data->umsgf = NULL;
 	mf_data->orig_format = NULL;
+	mf_data->arg_types = NULL;
 	intl_error_reset( &mf_data->error TSRMLS_CC );
 }
 /* }}} */
@@ -38,21 +39,27 @@ void msgformat_data_init( msgformat_data* mf_data TSRMLS_DC )
 /* {{{ void msgformat_data_free( msgformat_data* mf_data )
  * Clean up memory allocated for msgformat_data
  */
-void msgformat_data_free( msgformat_data* mf_data TSRMLS_DC )
+void msgformat_data_free(msgformat_data* mf_data TSRMLS_DC)
 {
-	if( !mf_data )
+	if (!mf_data)
 		return;
 
-	if( mf_data->umsgf )
-		umsg_close( mf_data->umsgf );
+	if (mf_data->umsgf)
+		umsg_close(mf_data->umsgf);
 
-	if(mf_data->orig_format) {
+	if (mf_data->orig_format) {
 		efree(mf_data->orig_format);
 		mf_data->orig_format = NULL;
 	}
 
+	if (mf_data->arg_types) {
+		zend_hash_destroy(mf_data->arg_types);
+		efree(mf_data->arg_types);
+		mf_data->arg_types = NULL;
+	}
+
 	mf_data->umsgf = NULL;
-	intl_error_reset( &mf_data->error TSRMLS_CC );
+	intl_error_reset(&mf_data->error TSRMLS_CC);
 }
 /* }}} */
 
diff --git a/ext/intl/msgformat/msgformat_data.h b/ext/intl/msgformat/msgformat_data.h
index 4400175..5a82003 100755
--- a/ext/intl/msgformat/msgformat_data.h
+++ b/ext/intl/msgformat/msgformat_data.h
@@ -31,6 +31,7 @@ typedef struct {
 	UMessageFormat* umsgf;
 	char*			orig_format;
 	ulong			orig_format_len;
+	HashTable*		arg_types;
 } msgformat_data;
 
 msgformat_data* msgformat_data_create( TSRMLS_D );
diff --git a/ext/intl/msgformat/msgformat_format.c b/ext/intl/msgformat/msgformat_format.c
index 099dbcb..412a5f7 100755
--- a/ext/intl/msgformat/msgformat_format.c
+++ b/ext/intl/msgformat/msgformat_format.c
@@ -57,7 +57,7 @@ static void msgfmt_do_format(MessageFormatter_object *mfo, zval *args, zval *ret
 	zend_hash_copy(args_copy, Z_ARRVAL_P(args), (copy_ctor_func_t)zval_add_ref,
 		NULL, sizeof(zval*));
 
-	umsg_format_helper(MSG_FORMAT_OBJECT(mfo), args_copy,
+	umsg_format_helper(mfo, args_copy,
 		&formatted, &formatted_len, &INTL_DATA_ERROR_CODE(mfo) TSRMLS_CC);
 
 	zend_hash_destroy(args_copy);
diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp
index 503dca9..1a7dc89 100755
--- a/ext/intl/msgformat/msgformat_helpers.cpp
+++ b/ext/intl/msgformat/msgformat_helpers.cpp
@@ -100,7 +100,9 @@ double umsg_helper_zval_to_millis(zval *z, UErrorCode *status TSRMLS_DC) {
 	return rv;
 }
 
-static HashTable *umsg_parse_format(const MessagePattern& mp, UErrorCode& uec)
+static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
+									const MessagePattern& mp,
+									UErrorCode& uec)
 {
 	HashTable *ret;
 	int32_t parts_count;
@@ -109,6 +111,11 @@ static HashTable *umsg_parse_format(const MessagePattern& mp, UErrorCode& uec)
 		return NULL;
 	}
 
+	if (mfo->mf_data.arg_types) {
+		/* already cached */
+		return mfo->mf_data.arg_types;
+	}
+
 	/* Hash table will store Formattable::Type objects directly,
 	 * so no need for destructor */
 	ALLOC_HASHTABLE(ret);
@@ -235,22 +242,24 @@ static HashTable *umsg_parse_format(const MessagePattern& mp, UErrorCode& uec)
 		return NULL;
 	}
 
+	mfo->mf_data.arg_types = ret;
+
 	return ret;
 }
 
-U_CFUNC void umsg_format_helper(UMessageFormat *fmt, HashTable *args, UChar **formatted, int *formatted_len, UErrorCode *status TSRMLS_DC)
+U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo, HashTable *args, UChar **formatted, int *formatted_len, UErrorCode *status TSRMLS_DC)
 {
 	int arg_count = zend_hash_num_elements(args);
 	std::vector<Formattable> fargs;
 	std::vector<UnicodeString> farg_names;
-    MessageFormat *mf = (MessageFormat *) fmt;
+	MessageFormat *mf = (MessageFormat *)mfo->mf_data.umsgf;
     const MessagePattern mp = MessageFormatAdapter::getMessagePattern(mf);
 	HashTable *types;
 
 	fargs.resize(arg_count);
 	farg_names.resize(arg_count);
 
-	types = umsg_parse_format(mp, *status);
+	types = umsg_parse_format(mfo, mp, *status);
 	if (U_FAILURE(*status)) {
 		return;
 	}
@@ -391,9 +400,6 @@ string_arg: //XXX: make function
 		}
     } // visiting each argument
 
-	zend_hash_destroy(types);
-	efree(types);
-
     if (U_FAILURE(*status)){
         return;
     }
diff --git a/ext/intl/msgformat/msgformat_helpers.h b/ext/intl/msgformat/msgformat_helpers.h
index 4e10471..7a04248 100755
--- a/ext/intl/msgformat/msgformat_helpers.h
+++ b/ext/intl/msgformat/msgformat_helpers.h
@@ -18,7 +18,7 @@
 #define MSG_FORMAT_HELPERS_H
 
 int32_t umsg_format_arg_count(UMessageFormat *fmt);
-void umsg_format_helper(UMessageFormat *fmt, HashTable *args,
+void umsg_format_helper(MessageFormatter_object *mfo, HashTable *args,
 						UChar **formatted, int *formatted_len, UErrorCode *status TSRMLS_DC);
 void umsg_parse_helper(UMessageFormat *fmt, int *count, zval ***args,
 					   UChar *source, int source_len, UErrorCode *status);
diff --git a/ext/intl/tests/msgfmt_setPattern_cache.phpt b/ext/intl/tests/msgfmt_setPattern_cache.phpt
new file mode 100644
index 0000000..35ec463
--- /dev/null
+++ b/ext/intl/tests/msgfmt_setPattern_cache.phpt
@@ -0,0 +1,26 @@
+--TEST--
+MessageFormatter::setPattern() invalidates arg types cache
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+	die('skip intl extension not enabled');
+--FILE--
+<?php
+ini_set("intl.error_level", E_WARNING);
+//ini_set("intl.default_locale", "nl");
+
+$mf = new MessageFormatter('en_US',
+	"{0,number} -- {1,ordinal}");
+	
+var_dump($mf->format(array(1.3, 1.3)));
+var_dump($mf->format(array(1.3, 1.3)));
+$mf->setPattern("{0,ordinal} -- {1,number}");
+var_dump($mf->format(array(1.3, 1.3)));
+
+?>
+==DONE==
+--EXPECT--
+string(10) "1.3 -- 1st"
+string(10) "1.3 -- 1st"
+string(10) "1st -- 1.3"
+==DONE==
\ No newline at end of file


commit 407455876e486df45a6b6c91b483060b0479a0b3
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Sun May 6 00:48:17 2012 +0200

    Set global error if insufficient numeric args. WS.

diff --git a/ext/intl/msgformat/msgformat_format.c b/ext/intl/msgformat/msgformat_format.c
index d88bc00..099dbcb 100755
--- a/ext/intl/msgformat/msgformat_format.c
+++ b/ext/intl/msgformat/msgformat_format.c
@@ -44,10 +44,10 @@ static void msgfmt_do_format(MessageFormatter_object *mfo, zval *args, zval *ret
     /* umsg_format_arg_count() always returns 0 for named argument patterns,
      * so this check is ignored and un-substituted {name} strings
      * in a pattern are returned unmodified. */
-	if(count < umsg_format_arg_count(MSG_FORMAT_OBJECT(mfo))) {
+	if (count < umsg_format_arg_count(MSG_FORMAT_OBJECT(mfo))) {
 		/* Not enough aguments for format! */
-		intl_error_set( INTL_DATA_ERROR_P(mfo), U_ILLEGAL_ARGUMENT_ERROR,
-			"msgfmt_format: not enough parameters", 0 TSRMLS_CC );
+		intl_errors_set(INTL_DATA_ERROR_P(mfo), U_ILLEGAL_ARGUMENT_ERROR,
+			"msgfmt_format: not enough parameters", 0 TSRMLS_CC);
 		RETVAL_FALSE;
 		return;
 	}
diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp
index 5c114e8..503dca9 100755
--- a/ext/intl/msgformat/msgformat_helpers.cpp
+++ b/ext/intl/msgformat/msgformat_helpers.cpp
@@ -117,14 +117,14 @@ static HashTable *umsg_parse_format(const MessagePattern& mp, UErrorCode& uec)
 	parts_count = mp.countParts();
 
 	// See MessageFormat::cacheExplicitFormats()
-    /*
-     * Looking through the pattern, go to each arg_start part type.
-     * The arg-typeof that tells us the argument type (simple, complicated)
-     * then the next part is either the arg_name or arg number
-     * and then if it's simple after that there could be a part-type=arg-type
+	/*
+	 * Looking through the pattern, go to each arg_start part type.
+	 * The arg-typeof that tells us the argument type (simple, complicated)
+	 * then the next part is either the arg_name or arg number
+	 * and then if it's simple after that there could be a part-type=arg-type
 	 * while substring will tell us number, spellout, etc.
-     * If the next thing isn't an arg-type then assume string.
-    */
+	 * If the next thing isn't an arg-type then assume string.
+	*/
 	/* The last two "parts" can at most be ARG_LIMIT and MSG_LIMIT
 	 * which we need not examine. */
 	for (int32_t i = 0; i < parts_count - 2 && U_SUCCESS(uec); i++) {
@@ -226,7 +226,7 @@ static HashTable *umsg_parse_format(const MessagePattern& mp, UErrorCode& uec)
 		}
 
 		*storedType = type;
-    } /* visiting each part */
+	} /* visiting each part */
 
 	if (U_FAILURE(uec)) {
 		zend_hash_destroy(ret);
diff --git a/ext/intl/tests/calendar_getErrorCode_getErrorMessage_basic.phpt b/ext/intl/tests/calendar_getErrorCode_getErrorMessage_basic.phpt
index 7b4104b..71c0534 100644
--- a/ext/intl/tests/calendar_getErrorCode_getErrorMessage_basic.phpt
+++ b/ext/intl/tests/calendar_getErrorCode_getErrorMessage_basic.phpt
@@ -40,4 +40,4 @@ int(1)
 int(1)
 string(81) "intlcal_field_difference: Call to ICU method has failed: U_ILLEGAL_ARGUMENT_ERROR"
 string(81) "intlcal_field_difference: Call to ICU method has failed: U_ILLEGAL_ARGUMENT_ERROR"
-==DONE==
+==DONE==


commit f1621485ad7c9b02b4df42c21a472223fe106f51
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Sat May 5 23:15:47 2012 +0100

    Fixed MessageFormatter subformat tests.

diff --git a/ext/intl/tests/msgfmt_format_subpatterns.phpt b/ext/intl/tests/msgfmt_format_subpatterns.phpt
index 5a57df6..ec7443f 100644
--- a/ext/intl/tests/msgfmt_format_subpatterns.phpt
+++ b/ext/intl/tests/msgfmt_format_subpatterns.phpt
@@ -67,5 +67,5 @@ ut_run();
 'Alice invites Bob to his party.'
 'Alice invites Bob and one other person to their party.'
 'Alice invites Bob and one other person to their party.'
-'Alice invites Bob as one of the 27 people invited to her party.'
-'Alice invites Bob as one of the 27 people invited to her party.'
+'Alice invites Bob as one of the 26 people invited to her party.'
+'Alice invites Bob as one of the 26 people invited to her party.'
diff --git a/ext/intl/tests/msgfmt_format_subpatterns_named.phpt b/ext/intl/tests/msgfmt_format_subpatterns_named.phpt
index 94329ed..98a6e01 100644
--- a/ext/intl/tests/msgfmt_format_subpatterns_named.phpt
+++ b/ext/intl/tests/msgfmt_format_subpatterns_named.phpt
@@ -67,5 +67,5 @@ ut_run();
 'Alice invites Bob to his party.'
 'Alice invites Bob and one other person to their party.'
 'Alice invites Bob and one other person to their party.'
-'Alice invites Bob as one of the 27 people invited to her party.'
-'Alice invites Bob as one of the 27 people invited to her party.'
\ No newline at end of file
+'Alice invites Bob as one of the 26 people invited to her party.'
+'Alice invites Bob as one of the 26 people invited to her party.'


commit edca0e2adb1eb2fcf14b8d0101769b39eecff29e
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Sat May 5 22:52:21 2012 +0200

    Refactoring of patch for FR #61871.

diff --git a/ext/intl/msgformat/msgformat_format.c b/ext/intl/msgformat/msgformat_format.c
index 9d51c36..d88bc00 100755
--- a/ext/intl/msgformat/msgformat_format.c
+++ b/ext/intl/msgformat/msgformat_format.c
@@ -34,13 +34,10 @@
 /* {{{ */
 static void msgfmt_do_format(MessageFormatter_object *mfo, zval *args, zval *return_value TSRMLS_DC)
 {
-	zval **fargs;
 	int count;
 	UChar* formatted = NULL;
-    char **farg_names = NULL;
 	int formatted_len = 0;
-	HashPosition pos;
-	int i;
+	HashTable *args_copy;
 
 	count = zend_hash_num_elements(Z_ARRVAL_P(args));
 
@@ -55,51 +52,17 @@ static void msgfmt_do_format(MessageFormatter_object *mfo, zval *args, zval *ret
 		return;
 	}
 
-	zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(args), &pos);
-	fargs = safe_emalloc(count, sizeof(zval *), 0);
-    /* If the first key is a string, then treat everything as a named argument */
-    if (HASH_KEY_IS_STRING == zend_hash_get_current_key_type_ex(Z_ARRVAL_P(args), &pos)) {
-        farg_names = safe_emalloc(count, sizeof(char *), 0);
-    }
-
-	for(i=0;i<count;i++) {
-		zval **val;
-		zend_hash_get_current_data_ex(Z_ARRVAL_P(args), (void **)&val, &pos);
-		fargs[i] = *val;
-		Z_ADDREF_P(fargs[i]);
-		/* TODO: needs refcount increase here? */
-        if (NULL != farg_names) {
-            char *key;
-            uint key_len;
-            ulong index;
-            int key_type = zend_hash_get_current_key_ex(Z_ARRVAL_P(args), &key, &key_len, &index, 0, &pos);
-            if (HASH_KEY_IS_STRING == key_type) {
-                farg_names[i] = estrndup(key, key_len);
-            }
-            else if (HASH_KEY_IS_LONG == key_type) {
-                farg_names[i] = emalloc(sizeof("18446744073709551616")); // 2^64
-                snprintf(farg_names[i], sizeof("18446744073709551616"), "%lu", (unsigned long) index);
-            }
-            else {
-                farg_names[i] = estrndup("", 0);
-            }
-        }
-		zend_hash_move_forward_ex(Z_ARRVAL_P(args), &pos);
-	}
+	ALLOC_HASHTABLE(args_copy);
+	zend_hash_init(args_copy, count, NULL, ZVAL_PTR_DTOR, 0);
+	zend_hash_copy(args_copy, Z_ARRVAL_P(args), (copy_ctor_func_t)zval_add_ref,
+		NULL, sizeof(zval*));
 
-	umsg_format_helper(MSG_FORMAT_OBJECT(mfo), count, fargs, farg_names, &formatted, &formatted_len, &INTL_DATA_ERROR_CODE(mfo) TSRMLS_CC);
+	umsg_format_helper(MSG_FORMAT_OBJECT(mfo), args_copy,
+		&formatted, &formatted_len, &INTL_DATA_ERROR_CODE(mfo) TSRMLS_CC);
 
-	for(i=0;i<count;i++) {
-		zval_ptr_dtor(&fargs[i]);
-	}
+	zend_hash_destroy(args_copy);
+	efree(args_copy);
 
-	efree(fargs);
-    if (farg_names) {
-        for (i = 0; i < count; i++) {
-            efree(farg_names[i]);
-        }
-        efree(farg_names);
-    }
 	if (formatted && U_FAILURE( INTL_DATA_ERROR_CODE(mfo) ) ) {
 			efree(formatted);
 	}
diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp
index 67d3558..5c114e8 100755
--- a/ext/intl/msgformat/msgformat_helpers.cpp
+++ b/ext/intl/msgformat/msgformat_helpers.cpp
@@ -25,8 +25,11 @@
 #include <unicode/msgfmt.h>
 #include <unicode/chariter.h>
 #include <unicode/messagepattern.h>
+#include <unicode/ustdio.h>
 
-#include <map>
+#include <vector>
+
+#include "../intl_convertcpp.h"
 
 extern "C" {
 #include "php_intl.h"
@@ -70,283 +73,339 @@ U_CFUNC int32_t umsg_format_arg_count(UMessageFormat *fmt)
 }
 
 double umsg_helper_zval_to_millis(zval *z, UErrorCode *status TSRMLS_DC) {
-    double rv = 0.0;
-    if (Z_TYPE_P(z) == IS_DOUBLE) {
-        rv = U_MILLIS_PER_SECOND * Z_DVAL_P(z);
-    }
-    else if (Z_TYPE_P(z) == IS_LONG) {
-        rv = U_MILLIS_PER_SECOND * (double) Z_LVAL_P(z);
-    }
-    else if (Z_TYPE_P(z) == IS_OBJECT) {
-        /* Borrowed from datefmt_format() in intl/dateformat/dateformat_format.c */
-        if (instanceof_function(Z_OBJCE_P(z), php_date_get_date_ce() TSRMLS_CC)) {
-            zval retval;
-            zval *zfuncname;
-            INIT_ZVAL(retval);
-            MAKE_STD_ZVAL(zfuncname);
-            ZVAL_STRING(zfuncname, "getTimestamp", 1);
-            if (call_user_function(NULL, &(z), zfuncname, &retval, 0, NULL TSRMLS_CC) != SUCCESS || Z_TYPE(retval) != IS_LONG) {
-                *status = U_RESOURCE_TYPE_MISMATCH;
-            } else {
-                rv = U_MILLIS_PER_SECOND * (double) Z_LVAL(retval);
-            }
-            zval_ptr_dtor(&zfuncname);
-        } else {
-            *status = U_ILLEGAL_ARGUMENT_ERROR;
-        }
-    }
-    return rv;
+	double rv = 0.0;
+	if (Z_TYPE_P(z) == IS_DOUBLE) {
+		rv = U_MILLIS_PER_SECOND * Z_DVAL_P(z);
+	} else if (Z_TYPE_P(z) == IS_LONG) {
+		rv = U_MILLIS_PER_SECOND * (double)Z_LVAL_P(z);
+	} else if (Z_TYPE_P(z) == IS_OBJECT) {
+		/* Borrowed from datefmt_format() in intl/dateformat/dateformat_format.c */
+		if (instanceof_function(Z_OBJCE_P(z), php_date_get_date_ce() TSRMLS_CC)) {
+			zval retval;
+			zval *zfuncname;
+			INIT_ZVAL(retval);
+			MAKE_STD_ZVAL(zfuncname);
+			ZVAL_STRING(zfuncname, "getTimestamp", 1);
+			if (call_user_function(NULL, &(z), zfuncname, &retval, 0, NULL TSRMLS_CC)
+					!= SUCCESS || Z_TYPE(retval) != IS_LONG) {
+				*status = U_RESOURCE_TYPE_MISMATCH;
+			} else {
+				rv = U_MILLIS_PER_SECOND * (double)Z_LVAL(retval);
+			}
+			zval_ptr_dtor(&zfuncname);
+		} else {
+			*status = U_ILLEGAL_ARGUMENT_ERROR;
+		}
+	}
+	return rv;
 }
 
-U_CFUNC void umsg_format_helper(UMessageFormat *fmt, int arg_count, zval **args, char **arg_names, UChar **formatted, int *formatted_len, UErrorCode *status TSRMLS_DC)
+static HashTable *umsg_parse_format(const MessagePattern& mp, UErrorCode& uec)
 {
-	int fmt_count;
-    int32_t i;
-	Formattable* fargs;
-    UnicodeString *farg_names;
-    MessageFormat *mf = (MessageFormat *) fmt;
-    MessagePattern mp = MessageFormatAdapter::getMessagePattern(mf);
-    std::map<UnicodeString, Formattable::Type> argTypesNamed;
-    std::map<int32_t, Formattable::Type> argTypesNumbered;
+	HashTable *ret;
+	int32_t parts_count;
+
+	if (U_FAILURE(uec)) {
+		return NULL;
+	}
 
-    int32_t usingNamedArguments = mf->usesNamedArguments();
+	/* Hash table will store Formattable::Type objects directly,
+	 * so no need for destructor */
+	ALLOC_HASHTABLE(ret);
+	zend_hash_init(ret, 32, NULL, NULL, 0);
 
+	parts_count = mp.countParts();
+
+	// See MessageFormat::cacheExplicitFormats()
     /*
-      looking through the pattern, go to each arg_start part type.
-      the arg-typeof that tells us the argument type (simple, complicated)
-      then the next part is either the arg_name or arg number
-      and then if it's simple after that there could be a part-type=arg-type whise substring will tell us number, spellout, etc
-      if the next thing isn't an arg-type then assume string
-      same name that appears more than once in a complicated pattern will appear more than once, we could
-      -- ignore subsequent occurances
-      -- complain if types differ?
+     * Looking through the pattern, go to each arg_start part type.
+     * The arg-typeof that tells us the argument type (simple, complicated)
+     * then the next part is either the arg_name or arg number
+     * and then if it's simple after that there could be a part-type=arg-type
+	 * while substring will tell us number, spellout, etc.
+     * If the next thing isn't an arg-type then assume string.
     */
+	/* The last two "parts" can at most be ARG_LIMIT and MSG_LIMIT
+	 * which we need not examine. */
+	for (int32_t i = 0; i < parts_count - 2 && U_SUCCESS(uec); i++) {
+        MessagePattern::Part p = mp.getPart(i);
 
-    int32_t parts_count = mp.countParts();
+        if (p.getType() != UMSGPAT_PART_TYPE_ARG_START) {
+			continue;
+		}
+
+        MessagePattern::Part name_part = mp.getPart(++i); /* Getting name, advancing i */
+		Formattable::Type type,
+						  *storedType;
+
+        if (name_part.getType() == UMSGPAT_PART_TYPE_ARG_NAME) {
+            UnicodeString argName = mp.getSubstring(name_part);
+			if (zend_hash_find(ret, (char*)argName.getBuffer(), argName.length(),
+					(void**)&storedType) == FAILURE) {
+				/* not found already; create new entry in HT */
+				Formattable::Type bogusType = Formattable::kObject;
+				if (zend_hash_update(ret, (char*)argName.getBuffer(), argName.length(),
+						(void*)&bogusType, sizeof(bogusType), (void**)&storedType) == FAILURE) {
+					uec = U_MEMORY_ALLOCATION_ERROR;
+					continue;
+				}
+			}
+        } else if (name_part.getType() == UMSGPAT_PART_TYPE_ARG_NUMBER) {
+            int32_t argNumber = name_part.getValue();
+			if (argNumber < 0) {
+				uec = U_INVALID_FORMAT_ERROR;
+				continue;
+			}
+			if (zend_hash_index_find(ret, (ulong)argNumber, (void**)&storedType)
+					== FAILURE) {
+				/* not found already; create new entry in HT */
+				Formattable::Type bogusType = Formattable::kObject;
+				if (zend_hash_index_update(ret, (ulong)argNumber, (void*)&bogusType,
+						sizeof(bogusType), (void**)&storedType) == FAILURE) {
+					uec = U_MEMORY_ALLOCATION_ERROR;
+					continue;
+				}
+			}
+        }
 
-    for (i = 0; i < parts_count; i++) {
-        MessagePattern::Part p = mp.getPart(i);
-        if (p.getType() == UMSGPAT_PART_TYPE_ARG_START) {
-            MessagePattern::Part name_part = mp.getPart(++i); /* Getting name, advancing i */
-            UnicodeString argName;
-            int32_t argNumber;
-            if (name_part.getType() == UMSGPAT_PART_TYPE_ARG_NAME) {
-                argName = mp.getSubstring(name_part);
-            }
-            else if (name_part.getType() == UMSGPAT_PART_TYPE_ARG_NUMBER) {
-                argNumber = name_part.getValue();
-            }
-            /* If we haven't seen this arg name before */
-            int seenBefore = usingNamedArguments ? argTypesNamed.count(argName) : argTypesNumbered.count(argNumber);
-            if (0 == seenBefore) {
-                Formattable::Type fargType;
-                UMessagePatternArgType argType = p.getArgType();
-                /* No type specified, treat it as a string */
-                if (argType == UMSGPAT_ARG_TYPE_NONE) {
-                    fargType = Formattable::kString;
-                }
-                /* Some type was specified, might be simple or complicated */
-                else {
-                    if (argType == UMSGPAT_ARG_TYPE_SIMPLE) {
-                        /* For a SIMPLE arg, after the name part, there should be
-                         * an ARG_TYPE part whose string value tells us what to do */
-                        MessagePattern::Part type_part = mp.getPart(++i); /* Getting type, advancing i */
-                        if (type_part.getType() == UMSGPAT_PART_TYPE_ARG_TYPE) {
-                            UnicodeString typeString = mp.getSubstring(type_part);
-                            /* This is all based on the rules in the docs for MessageFormat
-                             * @see http://icu-project.org/apiref/icu4c/classMessageFormat.html */
-                            if (typeString == "number") {
-                                MessagePattern::Part style_part = mp.getPart(i + 1); /* Not advancing i */
-                                if (style_part.getType() == UMSGPAT_PART_TYPE_ARG_STYLE) {
-                                    UnicodeString styleString = mp.getSubstring(style_part);
-                                    if (styleString == "integer") {
-                                        fargType = Formattable::kInt64;
-                                    }
-                                    else if (styleString == "currency") {
-                                        fargType = Formattable::kDouble;
-                                    }
-                                    else if (styleString == "percent") {
-                                        fargType = Formattable::kDouble;
-                                    }
-                                }
-                                // if missing style, part, make it a double
-                                else {
-                                    fargType = Formattable::kDouble;
-                                }
+        UMessagePatternArgType argType = p.getArgType();
+        /* No type specified, treat it as a string */
+        if (argType == UMSGPAT_ARG_TYPE_NONE) {
+            type = Formattable::kString;
+		} else { /* Some type was specified, might be simple or complicated */
+            if (argType == UMSGPAT_ARG_TYPE_SIMPLE) {
+                /* For a SIMPLE arg, after the name part, there should be
+                 * an ARG_TYPE part whose string value tells us what to do */
+                MessagePattern::Part type_part = mp.getPart(++i); /* Getting type, advancing i */
+                if (type_part.getType() == UMSGPAT_PART_TYPE_ARG_TYPE) {
+                    UnicodeString typeString = mp.getSubstring(type_part);
+                    /* This is all based on the rules in the docs for MessageFormat
+                     * @see http://icu-project.org/apiref/icu4c/classMessageFormat.html */
+                    if (typeString == "number") {
+                        MessagePattern::Part style_part = mp.getPart(i + 1); /* Not advancing i */
+                        if (style_part.getType() == UMSGPAT_PART_TYPE_ARG_STYLE) {
+                            UnicodeString styleString = mp.getSubstring(style_part);
+                            if (styleString == "integer") {
+                                type = Formattable::kInt64;
+                            } else if (styleString == "currency") {
+                                type = Formattable::kDouble;
+                            } else if (styleString == "percent") {
+                                type = Formattable::kDouble;
                             }
-                            else if ((typeString == "date") || (typeString == "time")) {
-                                fargType = Formattable::kDate;
-                            }
-                            else if ((typeString == "spellout") || (typeString == "ordinal") || (typeString == "duration")) {
-                                fargType = Formattable::kDouble;
-                            }
-
+                        } else { // if missing style, part, make it a double
+                            type = Formattable::kDouble;
                         }
-                        else {
-                            /* If there's no UMSGPAT_PART_TYPE_ARG_TYPE right after a
-                             * UMSGPAT_ARG_TYPE_SIMPLE argument, then the pattern
-                             * is broken. */
-                            *status = U_PARSE_ERROR;
-                            return;
-                        }
-                    }
-                    else if (argType == UMSGPAT_ARG_TYPE_PLURAL) {
-                        fargType = Formattable::kDouble;
+                    } else if ((typeString == "date") || (typeString == "time")) {
+                        type = Formattable::kDate;
+                    } else if ((typeString == "spellout") || (typeString == "ordinal")
+							|| (typeString == "duration")) {
+                        type = Formattable::kDouble;
                     }
-                    else if (argType == UMSGPAT_ARG_TYPE_CHOICE) {
-                        fargType = Formattable::kDouble;
-                    }
-                    else if (argType == UMSGPAT_ARG_TYPE_SELECT) {
-                        fargType = Formattable::kString;
-                    }
-                    else {
-                        fargType = Formattable::kString;
-                    }
-                } /* was type specified? */
-                if (usingNamedArguments) {
-                    argTypesNamed.insert(std::pair<UnicodeString, Formattable::Type>(argName, fargType));
                 } else {
-                    argTypesNumbered.insert(std::pair<int32_t, Formattable::Type>(argNumber, fargType));
+                    /* If there's no UMSGPAT_PART_TYPE_ARG_TYPE right after a
+                     * UMSGPAT_ARG_TYPE_SIMPLE argument, then the pattern
+                     * is broken. */
+                    uec = U_PARSE_ERROR;
+                    continue;
                 }
-            } /* Haven't seen arg before? */
-        } /* checking for ARG_START */
+            } else if (argType == UMSGPAT_ARG_TYPE_PLURAL) {
+                type = Formattable::kDouble;
+            } else if (argType == UMSGPAT_ARG_TYPE_CHOICE) {
+                type = Formattable::kDouble;
+            } else if (argType == UMSGPAT_ARG_TYPE_SELECT) {
+                type = Formattable::kString;
+            } else {
+                type = Formattable::kString;
+            }
+        } /* was type specified? */
+
+		/* We found a different type for the same arg! */
+		if (*storedType != Formattable::kObject && *storedType != type) {
+			uec = U_ARGUMENT_TYPE_MISMATCH;
+			continue;
+		}
+
+		*storedType = type;
     } /* visiting each part */
 
-#define CLEANUP_AND_RETURN_ON_ERROR(status) do { \
-        if (U_FAILURE(*status)) {                \
-            delete[] fargs;                      \
-            if (usingNamedArguments) {           \
-                delete[] farg_names;             \
-            }                                    \
-            return;                              \
-        }                                        \
-    } while (0)
-
-
-    fmt_count = arg_count;
-    fargs = new Formattable[fmt_count];
-    if (usingNamedArguments) {
-        farg_names = new UnicodeString[fmt_count];
-    }
-    for (int32_t i = 0; i < fmt_count; ++i) {
-            UChar* text = NULL;
-            int textLen = 0;
-            int found = 0;
-            Formattable::Type argType;
-
-            if (usingNamedArguments) {
-                intl_convert_utf8_to_utf16(&text, &textLen, arg_names[i], strlen(arg_names[i]), status);
-                CLEANUP_AND_RETURN_ON_ERROR(status);
-                farg_names[i].setTo(text, textLen);
-                efree(text);
-                text = NULL; textLen = 0;
-                std::map<UnicodeString, Formattable::Type>::iterator it;
-                it = argTypesNamed.find(farg_names[i]);
-                if (it != argTypesNamed.end()) {
-                    argType = it->second;
-                    found = 1;
-                }
-            }
-            else {
-                std::map<int32_t, Formattable::Type>::iterator it;
-                it = argTypesNumbered.find(i);
-                if (it != argTypesNumbered.end()) {
-                    argType = it->second;
-                    found = 1;
-                }
-            }
-            if (found) {
-                switch (argType) {
-                case Formattable::kString:
-                    /* This implicitly converts objects by attempting to call __toString() */
-                    convert_to_string_ex(&args[i]);
-                    intl_convert_utf8_to_utf16(&text, &textLen, Z_STRVAL_P(args[i]), Z_STRLEN_P(args[i]), status);
-                    CLEANUP_AND_RETURN_ON_ERROR(status);
-                    fargs[i].setString(text);
-                    efree(text);
-                    text = NULL; textLen = 0;
-                    break;
-                case Formattable::kDouble:
-                    {
-                        double d;
-                        if(Z_TYPE_P(args[i]) == IS_DOUBLE) {
-                            d = Z_DVAL_P(args[i]);
-                        } else if(Z_TYPE_P(args[i]) == IS_LONG) {
-                            d = (double)Z_LVAL_P(args[i]);
-                        } else {
-                            SEPARATE_ZVAL_IF_NOT_REF(&args[i]);
-                            convert_scalar_to_number( args[i] TSRMLS_CC );
-                            d = (Z_TYPE_P(args[i]) == IS_DOUBLE)?Z_DVAL_P(args[i]):(double)Z_LVAL_P(args[i]);
-                        }
-                        fargs[i].setDouble(d);
-                        break;
-                    }
-                case Formattable::kInt64:
-                    {
-                        int64_t tInt64;
-                        if(Z_TYPE_P(args[i]) == IS_DOUBLE) {
-                            tInt64 = (int64_t)Z_DVAL_P(args[i]);
-                        } else if(Z_TYPE_P(args[i]) == IS_LONG) {
-                            tInt64 = (int64_t)Z_LVAL_P(args[i]);
-                        } else {
-                            SEPARATE_ZVAL_IF_NOT_REF(&args[i]);
-                            convert_scalar_to_number( args[i] TSRMLS_CC );
-                            tInt64 = (Z_TYPE_P(args[i]) == IS_DOUBLE)?(int64_t)Z_DVAL_P(args[i]):Z_LVAL_P(args[i]);
-                        }
-                        fargs[i].setInt64(tInt64);
-                        break;
-                    }
-                case Formattable::kDate:
-                    {
-                        double dd = umsg_helper_zval_to_millis(args[i], status TSRMLS_CC);
-                        CLEANUP_AND_RETURN_ON_ERROR(status);
-                        fargs[i].setDate(dd);
-                        break;
+	if (U_FAILURE(uec)) {
+		zend_hash_destroy(ret);
+		efree(ret);
+
+		return NULL;
+	}
+
+	return ret;
+}
+
+U_CFUNC void umsg_format_helper(UMessageFormat *fmt, HashTable *args, UChar **formatted, int *formatted_len, UErrorCode *status TSRMLS_DC)
+{
+	int arg_count = zend_hash_num_elements(args);
+	std::vector<Formattable> fargs;
+	std::vector<UnicodeString> farg_names;
+    MessageFormat *mf = (MessageFormat *) fmt;
+    const MessagePattern mp = MessageFormatAdapter::getMessagePattern(mf);
+	HashTable *types;
+
+	fargs.resize(arg_count);
+	farg_names.resize(arg_count);
+
+	types = umsg_parse_format(mp, *status);
+	if (U_FAILURE(*status)) {
+		return;
+	}
+
+	int				argNum = 0;
+	HashPosition	pos;
+	zval			**elem;
+
+	// Key related variables
+	int				key_type;
+	char			*str_index;
+	uint			str_len;
+	ulong			num_index;
+
+	for (zend_hash_internal_pointer_reset_ex(args, &pos);
+		U_SUCCESS(*status) &&
+			(key_type = zend_hash_get_current_key_ex(
+					args, &str_index, &str_len, &num_index, 0, &pos),
+				zend_hash_get_current_data_ex(args, (void **)&elem, &pos)
+			) == SUCCESS;
+		zend_hash_move_forward_ex(args, &pos), argNum++)
+	{
+		Formattable& formattable = fargs[argNum];
+		UnicodeString& key = farg_names[argNum];
+		Formattable::Type argType = Formattable::kObject, //unknown
+						  *storedArgType = NULL;
+
+		/* Process key and retrieve type */
+		if (key_type == HASH_KEY_IS_LONG) {
+			/* includes case where index < 0 because it's exposed as unsigned */
+			if (num_index > INT32_MAX) {
+				*status = U_ILLEGAL_ARGUMENT_ERROR;
+				continue;
+			}
+
+           UChar temp[16];
+		   int32_t len = u_sprintf(temp, "%u", (uint32_t)num_index);
+           key.append(temp, len);
+
+		   zend_hash_index_find(types, (ulong)num_index, (void**)&storedArgType);
+		} else { //string; assumed to be in UTF-8
+			intl_stringFromChar(key, str_index, str_len-1, status);
+			if (U_FAILURE(*status)) {
+				   continue;
+			}
+
+			zend_hash_find(types, (char*)key.getBuffer(), key.length(),
+				(void**)&storedArgType);
+		}
+
+		if (storedArgType != NULL) {
+			argType = *storedArgType;
+		}
+
+		/* Convert zval to formattable according to message format type
+		 * or (as a fallback) the zval type */
+		if (argType != Formattable::kObject) {
+            switch (argType) {
+			case Formattable::kString:
+				{
+string_arg: //XXX: make function
+					/* This implicitly converts objects */
+					convert_to_string_ex(elem);
+
+					UnicodeString *text = new UnicodeString();
+					intl_stringFromChar(*text, Z_STRVAL_PP(elem), Z_STRLEN_PP(elem), status);
+					if (U_FAILURE(*status)) {
+						delete text;
+						continue;
+					}
+					formattable.adoptString(text);
+					break;
+				}
+            case Formattable::kDouble:
+                {
+                    double d;
+                    if (Z_TYPE_PP(elem) == IS_DOUBLE) {
+                        d = Z_DVAL_PP(elem);
+                    } else if (Z_TYPE_PP(elem) == IS_LONG) {
+                        d = (double)Z_LVAL_PP(elem);
+                    } else {
+                        SEPARATE_ZVAL_IF_NOT_REF(elem);
+                        convert_scalar_to_number(*elem TSRMLS_CC);
+                        d = (Z_TYPE_PP(elem) == IS_DOUBLE)
+							? Z_DVAL_PP(elem)
+							: (double)Z_LVAL_PP(elem);
                     }
-                }
-            }
-            else {
-                /* We couldn't find any information about the argument in the pattern, this
-                 * means it's an extra argument. So convert it to a number if it's a number or
-                 * bool or null and to a string if it's anything else. */
-                switch (Z_TYPE_P(args[i])) {
-                case IS_DOUBLE:
-                    fargs[i].setDouble(Z_DVAL_P(args[i]));
+					formattable.setDouble(d);
                     break;
-                case IS_BOOL:
-                    convert_to_long_ex(&args[i]);
-                    /* Intentional fallthrough */
-                case IS_LONG:
-                    fargs[i].setInt64((int64_t) Z_LVAL_P(args[i]));
-                    break;
-                case IS_NULL:
-                    fargs[i].setInt64((int64_t) 0);
+                }
+            case Formattable::kInt64:
+                {
+                    int64_t tInt64;
+                    if (Z_TYPE_PP(elem) == IS_DOUBLE) {
+                        tInt64 = (int64_t)Z_DVAL_PP(elem);
+                    } else if (Z_TYPE_PP(elem) == IS_LONG) {
+                        tInt64 = (int64_t)Z_LVAL_PP(elem);
+                    } else {
+                        SEPARATE_ZVAL_IF_NOT_REF(elem);
+                        convert_scalar_to_number(*elem TSRMLS_CC);
+                        tInt64 = (Z_TYPE_PP(elem) == IS_DOUBLE)
+							? (int64_t)Z_DVAL_PP(elem)
+							: Z_LVAL_PP(elem);
+                    }
+                    formattable.setInt64(tInt64);
                     break;
-                default:
-                    convert_to_string_ex(&args[i]);
-                    intl_convert_utf8_to_utf16(&text, &textLen, Z_STRVAL_P(args[i]), Z_STRLEN_P(args[i]), status);
-                    CLEANUP_AND_RETURN_ON_ERROR(status);
-                    fargs[i].setString(text);
-                    efree(text);
-                    text = NULL; textLen = 0;
+                }
+            case Formattable::kDate:
+                {
+                    double dd = umsg_helper_zval_to_millis(*elem, status TSRMLS_CC);
+					if (U_FAILURE(*status)) {
+						continue;
+					}
+                    formattable.setDate(dd);
                     break;
                 }
             }
-    } // visiting each argument argument
+        } else {
+            /* We couldn't find any information about the argument in the pattern, this
+             * means it's an extra argument. So convert it to a number if it's a number or
+             * bool or null and to a string if it's anything else. */
+            switch (Z_TYPE_PP(elem)) {
+            case IS_DOUBLE:
+                formattable.setDouble(Z_DVAL_PP(elem));
+                break;
+            case IS_BOOL:
+                convert_to_long_ex(elem);
+                /* Intentional fallthrough */
+            case IS_LONG:
+                formattable.setInt64((int64_t)Z_LVAL_PP(elem));
+                break;
+            case IS_NULL:
+                formattable.setInt64((int64_t)0);
+                break;
+            default:
+                goto string_arg;
+            }
+		}
+    } // visiting each argument
 
-    UnicodeString resultStr;
-    FieldPosition fieldPosition(0);
+	zend_hash_destroy(types);
+	efree(types);
 
-    /* format the message */
-    if (usingNamedArguments) {
-        mf->format(farg_names, fargs, fmt_count, resultStr, *status);
-        delete[] farg_names;
-    } else {
-        mf->format(fargs, fmt_count, resultStr, fieldPosition, *status);
+    if (U_FAILURE(*status)){
+        return;
     }
-    delete[] fargs;
 
-    if(U_FAILURE(*status)){
+	UnicodeString resultStr;
+	FieldPosition fieldPosition(0);
+
+    /* format the message */
+	mf->format(farg_names.empty() ? NULL : &farg_names[0],
+		fargs.empty() ? NULL : &fargs[0], arg_count, resultStr, *status);
+
+    if (U_FAILURE(*status)) {
         return;
     }
 
diff --git a/ext/intl/msgformat/msgformat_helpers.h b/ext/intl/msgformat/msgformat_helpers.h
index f5b01d7..4e10471 100755
--- a/ext/intl/msgformat/msgformat_helpers.h
+++ b/ext/intl/msgformat/msgformat_helpers.h
@@ -18,7 +18,7 @@
 #define MSG_FORMAT_HELPERS_H
 
 int32_t umsg_format_arg_count(UMessageFormat *fmt);
-void umsg_format_helper(UMessageFormat *fmt, int arg_count, zval **args, char **arg_names,
+void umsg_format_helper(UMessageFormat *fmt, HashTable *args,
 						UChar **formatted, int *formatted_len, UErrorCode *status TSRMLS_DC);
 void umsg_parse_helper(UMessageFormat *fmt, int *count, zval ***args,
 					   UChar *source, int source_len, UErrorCode *status);


commit c9b913b56bda2740de346ce508383d9e8a99883f
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Sat May 5 12:07:19 2012 +0200

    Orig patch for FR #61871 by David Sklar

diff --git a/ext/intl/msgformat/msgformat_format.c b/ext/intl/msgformat/msgformat_format.c
index b664c83..9d51c36 100755
--- a/ext/intl/msgformat/msgformat_format.c
+++ b/ext/intl/msgformat/msgformat_format.c
@@ -32,17 +32,21 @@
 #endif
 
 /* {{{ */
-static void msgfmt_do_format(MessageFormatter_object *mfo, zval *args, zval *return_value TSRMLS_DC) 
+static void msgfmt_do_format(MessageFormatter_object *mfo, zval *args, zval *return_value TSRMLS_DC)
 {
 	zval **fargs;
 	int count;
 	UChar* formatted = NULL;
+    char **farg_names = NULL;
 	int formatted_len = 0;
 	HashPosition pos;
 	int i;
 
 	count = zend_hash_num_elements(Z_ARRVAL_P(args));
 
+    /* umsg_format_arg_count() always returns 0 for named argument patterns,
+     * so this check is ignored and un-substituted {name} strings
+     * in a pattern are returned unmodified. */
 	if(count < umsg_format_arg_count(MSG_FORMAT_OBJECT(mfo))) {
 		/* Not enough aguments for format! */
 		intl_error_set( INTL_DATA_ERROR_P(mfo), U_ILLEGAL_ARGUMENT_ERROR,
@@ -51,26 +55,51 @@ static void msgfmt_do_format(MessageFormatter_object *mfo, zval *args, zval *ret
 		return;
 	}
 
+	zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(args), &pos);
 	fargs = safe_emalloc(count, sizeof(zval *), 0);
+    /* If the first key is a string, then treat everything as a named argument */
+    if (HASH_KEY_IS_STRING == zend_hash_get_current_key_type_ex(Z_ARRVAL_P(args), &pos)) {
+        farg_names = safe_emalloc(count, sizeof(char *), 0);
+    }
 
-	zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(args), &pos);
 	for(i=0;i<count;i++) {
 		zval **val;
 		zend_hash_get_current_data_ex(Z_ARRVAL_P(args), (void **)&val, &pos);
 		fargs[i] = *val;
 		Z_ADDREF_P(fargs[i]);
 		/* TODO: needs refcount increase here? */
+        if (NULL != farg_names) {
+            char *key;
+            uint key_len;
+            ulong index;
+            int key_type = zend_hash_get_current_key_ex(Z_ARRVAL_P(args), &key, &key_len, &index, 0, &pos);
+            if (HASH_KEY_IS_STRING == key_type) {
+                farg_names[i] = estrndup(key, key_len);
+            }
+            else if (HASH_KEY_IS_LONG == key_type) {
+                farg_names[i] = emalloc(sizeof("18446744073709551616")); // 2^64
+                snprintf(farg_names[i], sizeof("18446744073709551616"), "%lu", (unsigned long) index);
+            }
+            else {
+                farg_names[i] = estrndup("", 0);
+            }
+        }
 		zend_hash_move_forward_ex(Z_ARRVAL_P(args), &pos);
 	}
 
-	umsg_format_helper(MSG_FORMAT_OBJECT(mfo), count, fargs, &formatted, &formatted_len, &INTL_DATA_ERROR_CODE(mfo) TSRMLS_CC);
+	umsg_format_helper(MSG_FORMAT_OBJECT(mfo), count, fargs, farg_names, &formatted, &formatted_len, &INTL_DATA_ERROR_CODE(mfo) TSRMLS_CC);
 
 	for(i=0;i<count;i++) {
 		zval_ptr_dtor(&fargs[i]);
 	}
 
 	efree(fargs);
-
+    if (farg_names) {
+        for (i = 0; i < count; i++) {
+            efree(farg_names[i]);
+        }
+        efree(farg_names);
+    }
 	if (formatted && U_FAILURE( INTL_DATA_ERROR_CODE(mfo) ) ) {
 			efree(formatted);
 	}
diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp
index 508bdb6..67d3558 100755
--- a/ext/intl/msgformat/msgformat_helpers.cpp
+++ b/ext/intl/msgformat/msgformat_helpers.cpp
@@ -24,6 +24,9 @@
 #include <math.h>
 #include <unicode/msgfmt.h>
 #include <unicode/chariter.h>
+#include <unicode/messagepattern.h>
+
+#include <map>
 
 extern "C" {
 #include "php_intl.h"
@@ -31,6 +34,9 @@ extern "C" {
 #include "msgformat_format.h"
 #include "msgformat_helpers.h"
 #include "intl_convert.h"
+/* avoid redefinition of int8_t, already defined in unicode/pwin32.h */
+#define _MSC_STDINT_H_ 1
+#include "ext/date/php_date.h"
 }
 
 U_NAMESPACE_BEGIN
@@ -43,87 +49,301 @@ class MessageFormatAdapter {
 public:
     static const Formattable::Type* getArgTypeList(const MessageFormat& m,
                                                    int32_t& count);
+    static const MessagePattern getMessagePattern(MessageFormat* m);
 };
 const Formattable::Type*
 MessageFormatAdapter::getArgTypeList(const MessageFormat& m,
                                      int32_t& count) {
     return m.getArgTypeList(count);
 }
+const MessagePattern
+MessageFormatAdapter::getMessagePattern(MessageFormat* m) {
+    return m->msgPattern;
+}
 U_NAMESPACE_END
 
-U_CFUNC int32_t umsg_format_arg_count(UMessageFormat *fmt) 
+U_CFUNC int32_t umsg_format_arg_count(UMessageFormat *fmt)
 {
 	int32_t fmt_count = 0;
 	MessageFormatAdapter::getArgTypeList(*(const MessageFormat*)fmt, fmt_count);
 	return fmt_count;
 }
 
-U_CFUNC void umsg_format_helper(UMessageFormat *fmt, int arg_count, zval **args, UChar **formatted, int *formatted_len, UErrorCode *status TSRMLS_DC)
+double umsg_helper_zval_to_millis(zval *z, UErrorCode *status TSRMLS_DC) {
+    double rv = 0.0;
+    if (Z_TYPE_P(z) == IS_DOUBLE) {
+        rv = U_MILLIS_PER_SECOND * Z_DVAL_P(z);
+    }
+    else if (Z_TYPE_P(z) == IS_LONG) {
+        rv = U_MILLIS_PER_SECOND * (double) Z_LVAL_P(z);
+    }
+    else if (Z_TYPE_P(z) == IS_OBJECT) {
+        /* Borrowed from datefmt_format() in intl/dateformat/dateformat_format.c */
+        if (instanceof_function(Z_OBJCE_P(z), php_date_get_date_ce() TSRMLS_CC)) {
+            zval retval;
+            zval *zfuncname;
+            INIT_ZVAL(retval);
+            MAKE_STD_ZVAL(zfuncname);
+            ZVAL_STRING(zfuncname, "getTimestamp", 1);
+            if (call_user_function(NULL, &(z), zfuncname, &retval, 0, NULL TSRMLS_CC) != SUCCESS || Z_TYPE(retval) != IS_LONG) {
+                *status = U_RESOURCE_TYPE_MISMATCH;
+            } else {
+                rv = U_MILLIS_PER_SECOND * (double) Z_LVAL(retval);
+            }
+            zval_ptr_dtor(&zfuncname);
+        } else {
+            *status = U_ILLEGAL_ARGUMENT_ERROR;
+        }
+    }
+    return rv;
+}
+
+U_CFUNC void umsg_format_helper(UMessageFormat *fmt, int arg_count, zval **args, char **arg_names, UChar **formatted, int *formatted_len, UErrorCode *status TSRMLS_DC)
 {
-	int fmt_count = 0;
-    const Formattable::Type* argTypes =
-		MessageFormatAdapter::getArgTypeList(*(const MessageFormat*)fmt, fmt_count);
-	Formattable* fargs = new Formattable[fmt_count ? fmt_count : 1];
-
-	for(int32_t i = 0; i < fmt_count; ++i) {
-        UChar  *stringVal = NULL;
-		int     stringLen = 0;
-		int64_t tInt64 = 0;
-
-		switch(argTypes[i]) {
-			case Formattable::kDate:
-				convert_to_long_ex(&args[i]);
-				fargs[i].setDate(U_MILLIS_PER_SECOND * (double)Z_LVAL_P(args[i]));
-				break;
-
-			case Formattable::kDouble:
-				convert_to_double_ex(&args[i]);
-			    fargs[i].setDouble(Z_DVAL_P(args[i]));
-				break;
-            
-	        case Formattable::kLong:
-				convert_to_long_ex(&args[i]);
-			    fargs[i].setLong(Z_LVAL_P(args[i]));
-				break;
-
-	        case Formattable::kInt64:
-				if(Z_TYPE_P(args[i]) == IS_DOUBLE) {
-					tInt64 = (int64_t)Z_DVAL_P(args[i]);
-				} else if(Z_TYPE_P(args[i]) == IS_LONG) {
-					tInt64 = (int64_t)Z_LVAL_P(args[i]);
-				} else {
-					SEPARATE_ZVAL_IF_NOT_REF(&args[i]);
-					convert_scalar_to_number( args[i] TSRMLS_CC );
-					tInt64 = (Z_TYPE_P(args[i]) == IS_DOUBLE)?(int64_t)Z_DVAL_P(args[i]):Z_LVAL_P(args[i]);
-				}
-			    fargs[i].setInt64(tInt64);
-				break;
-            
-	        case Formattable::kString:
-		        convert_to_string_ex(&args[i]);
-				intl_convert_utf8_to_utf16(&stringVal, &stringLen, Z_STRVAL_P(args[i]), Z_STRLEN_P(args[i]), status);
-				if(U_FAILURE(*status)){
-					delete[] fargs;
-					return;
-				}
-				fargs[i].setString(stringVal);
-				efree(stringVal);
-			    break;
-            
-			case Formattable::kArray:
-			case Formattable::kObject:
-				*status = U_UNSUPPORTED_ERROR;
-				delete[] fargs;
-				return;
-        }		
-	}
+	int fmt_count;
+    int32_t i;
+	Formattable* fargs;
+    UnicodeString *farg_names;
+    MessageFormat *mf = (MessageFormat *) fmt;
+    MessagePattern mp = MessageFormatAdapter::getMessagePattern(mf);
+    std::map<UnicodeString, Formattable::Type> argTypesNamed;
+    std::map<int32_t, Formattable::Type> argTypesNumbered;
+
+    int32_t usingNamedArguments = mf->usesNamedArguments();
+
+    /*
+      looking through the pattern, go to each arg_start part type.
+      the arg-typeof that tells us the argument type (simple, complicated)
+      then the next part is either the arg_name or arg number
+      and then if it's simple after that there could be a part-type=arg-type whise substring will tell us number, spellout, etc
+      if the next thing isn't an arg-type then assume string
+      same name that appears more than once in a complicated pattern will appear more than once, we could
+      -- ignore subsequent occurances
+      -- complain if types differ?
+    */
+
+    int32_t parts_count = mp.countParts();
+
+    for (i = 0; i < parts_count; i++) {
+        MessagePattern::Part p = mp.getPart(i);
+        if (p.getType() == UMSGPAT_PART_TYPE_ARG_START) {
+            MessagePattern::Part name_part = mp.getPart(++i); /* Getting name, advancing i */
+            UnicodeString argName;
+            int32_t argNumber;
+            if (name_part.getType() == UMSGPAT_PART_TYPE_ARG_NAME) {
+                argName = mp.getSubstring(name_part);
+            }
+            else if (name_part.getType() == UMSGPAT_PART_TYPE_ARG_NUMBER) {
+                argNumber = name_part.getValue();
+            }
+            /* If we haven't seen this arg name before */
+            int seenBefore = usingNamedArguments ? argTypesNamed.count(argName) : argTypesNumbered.count(argNumber);
+            if (0 == seenBefore) {
+                Formattable::Type fargType;
+                UMessagePatternArgType argType = p.getArgType();
+                /* No type specified, treat it as a string */
+                if (argType == UMSGPAT_ARG_TYPE_NONE) {
+                    fargType = Formattable::kString;
+                }
+                /* Some type was specified, might be simple or complicated */
+                else {
+                    if (argType == UMSGPAT_ARG_TYPE_SIMPLE) {
+                        /* For a SIMPLE arg, after the name part, there should be
+                         * an ARG_TYPE part whose string value tells us what to do */
+                        MessagePattern::Part type_part = mp.getPart(++i); /* Getting type, advancing i */
+                        if (type_part.getType() == UMSGPAT_PART_TYPE_ARG_TYPE) {
+                            UnicodeString typeString = mp.getSubstring(type_part);
+                            /* This is all based on the rules in the docs for MessageFormat
+                             * @see http://icu-project.org/apiref/icu4c/classMessageFormat.html */
+                            if (typeString == "number") {
+                                MessagePattern::Part style_part = mp.getPart(i + 1); /* Not advancing i */
+                                if (style_part.getType() == UMSGPAT_PART_TYPE_ARG_STYLE) {
+                                    UnicodeString styleString = mp.getSubstring(style_part);
+                                    if (styleString == "integer") {
+                                        fargType = Formattable::kInt64;
+                                    }
+                                    else if (styleString == "currency") {
+                                        fargType = Formattable::kDouble;
+                                    }
+                                    else if (styleString == "percent") {
+                                        fargType = Formattable::kDouble;
+                                    }
+                                }
+                                // if missing style, part, make it a double
+                                else {
+                                    fargType = Formattable::kDouble;
+                                }
+                            }
+                            else if ((typeString == "date") || (typeString == "time")) {
+                                fargType = Formattable::kDate;
+                            }
+                            else if ((typeString == "spellout") || (typeString == "ordinal") || (typeString == "duration")) {
+                                fargType = Formattable::kDouble;
+                            }
+
+                        }
+                        else {
+                            /* If there's no UMSGPAT_PART_TYPE_ARG_TYPE right after a
+                             * UMSGPAT_ARG_TYPE_SIMPLE argument, then the pattern
+                             * is broken. */
+                            *status = U_PARSE_ERROR;
+                            return;
+                        }
+                    }
+                    else if (argType == UMSGPAT_ARG_TYPE_PLURAL) {
+                        fargType = Formattable::kDouble;
+                    }
+                    else if (argType == UMSGPAT_ARG_TYPE_CHOICE) {
+                        fargType = Formattable::kDouble;
+                    }
+                    else if (argType == UMSGPAT_ARG_TYPE_SELECT) {
+                        fargType = Formattable::kString;
+                    }
+                    else {
+                        fargType = Formattable::kString;
+                    }
+                } /* was type specified? */
+                if (usingNamedArguments) {
+                    argTypesNamed.insert(std::pair<UnicodeString, Formattable::Type>(argName, fargType));
+                } else {
+                    argTypesNumbered.insert(std::pair<int32_t, Formattable::Type>(argNumber, fargType));
+                }
+            } /* Haven't seen arg before? */
+        } /* checking for ARG_START */
+    } /* visiting each part */
+
+#define CLEANUP_AND_RETURN_ON_ERROR(status) do { \
+        if (U_FAILURE(*status)) {                \
+            delete[] fargs;                      \
+            if (usingNamedArguments) {           \
+                delete[] farg_names;             \
+            }                                    \
+            return;                              \
+        }                                        \
+    } while (0)
+
+
+    fmt_count = arg_count;
+    fargs = new Formattable[fmt_count];
+    if (usingNamedArguments) {
+        farg_names = new UnicodeString[fmt_count];
+    }
+    for (int32_t i = 0; i < fmt_count; ++i) {
+            UChar* text = NULL;
+            int textLen = 0;
+            int found = 0;
+            Formattable::Type argType;
+
+            if (usingNamedArguments) {
+                intl_convert_utf8_to_utf16(&text, &textLen, arg_names[i], strlen(arg_names[i]), status);
+                CLEANUP_AND_RETURN_ON_ERROR(status);
+                farg_names[i].setTo(text, textLen);
+                efree(text);
+                text = NULL; textLen = 0;
+                std::map<UnicodeString, Formattable::Type>::iterator it;
+                it = argTypesNamed.find(farg_names[i]);
+                if (it != argTypesNamed.end()) {
+                    argType = it->second;
+                    found = 1;
+                }
+            }
+            else {
+                std::map<int32_t, Formattable::Type>::iterator it;
+                it = argTypesNumbered.find(i);
+                if (it != argTypesNumbered.end()) {
+                    argType = it->second;
+                    found = 1;
+                }
+            }
+            if (found) {
+                switch (argType) {
+                case Formattable::kString:
+                    /* This implicitly converts objects by attempting to call __toString() */
+                    convert_to_string_ex(&args[i]);
+                    intl_convert_utf8_to_utf16(&text, &textLen, Z_STRVAL_P(args[i]), Z_STRLEN_P(args[i]), status);
+                    CLEANUP_AND_RETURN_ON_ERROR(status);
+                    fargs[i].setString(text);
+                    efree(text);
+                    text = NULL; textLen = 0;
+                    break;
+                case Formattable::kDouble:
+                    {
+                        double d;
+                        if(Z_TYPE_P(args[i]) == IS_DOUBLE) {
+                            d = Z_DVAL_P(args[i]);
+                        } else if(Z_TYPE_P(args[i]) == IS_LONG) {
+                            d = (double)Z_LVAL_P(args[i]);
+                        } else {
+                            SEPARATE_ZVAL_IF_NOT_REF(&args[i]);
+                            convert_scalar_to_number( args[i] TSRMLS_CC );
+                            d = (Z_TYPE_P(args[i]) == IS_DOUBLE)?Z_DVAL_P(args[i]):(double)Z_LVAL_P(args[i]);
+                        }
+                        fargs[i].setDouble(d);
+                        break;
+                    }
+                case Formattable::kInt64:
+                    {
+                        int64_t tInt64;
+                        if(Z_TYPE_P(args[i]) == IS_DOUBLE) {
+                            tInt64 = (int64_t)Z_DVAL_P(args[i]);
+                        } else if(Z_TYPE_P(args[i]) == IS_LONG) {
+                            tInt64 = (int64_t)Z_LVAL_P(args[i]);
+                        } else {
+                            SEPARATE_ZVAL_IF_NOT_REF(&args[i]);
+                            convert_scalar_to_number( args[i] TSRMLS_CC );
+                            tInt64 = (Z_TYPE_P(args[i]) == IS_DOUBLE)?(int64_t)Z_DVAL_P(args[i]):Z_LVAL_P(args[i]);
+                        }
+                        fargs[i].setInt64(tInt64);
+                        break;
+                    }
+                case Formattable::kDate:
+                    {
+                        double dd = umsg_helper_zval_to_millis(args[i], status TSRMLS_CC);
+                        CLEANUP_AND_RETURN_ON_ERROR(status);
+                        fargs[i].setDate(dd);
+                        break;
+                    }
+                }
+            }
+            else {
+                /* We couldn't find any information about the argument in the pattern, this
+                 * means it's an extra argument. So convert it to a number if it's a number or
+                 * bool or null and to a string if it's anything else. */
+                switch (Z_TYPE_P(args[i])) {
+                case IS_DOUBLE:
+                    fargs[i].setDouble(Z_DVAL_P(args[i]));
+                    break;
+                case IS_BOOL:
+                    convert_to_long_ex(&args[i]);
+                    /* Intentional fallthrough */
+                case IS_LONG:
+                    fargs[i].setInt64((int64_t) Z_LVAL_P(args[i]));
+                    break;
+                case IS_NULL:
+                    fargs[i].setInt64((int64_t) 0);
+                    break;
+                default:
+                    convert_to_string_ex(&args[i]);
+                    intl_convert_utf8_to_utf16(&text, &textLen, Z_STRVAL_P(args[i]), Z_STRLEN_P(args[i]), status);
+                    CLEANUP_AND_RETURN_ON_ERROR(status);
+                    fargs[i].setString(text);
+                    efree(text);
+                    text = NULL; textLen = 0;
+                    break;
+                }
+            }
+    } // visiting each argument argument
 
     UnicodeString resultStr;
     FieldPosition fieldPosition(0);
-    
-    /* format the message */
-    ((const MessageFormat*)fmt)->format(fargs, fmt_count, resultStr, fieldPosition, *status);
 
+    /* format the message */
+    if (usingNamedArguments) {
+        mf->format(farg_names, fargs, fmt_count, resultStr, *status);
+        delete[] farg_names;
+    } else {
+        mf->format(fargs, fmt_count, resultStr, fieldPosition, *status);
+    }
     delete[] fargs;
 
     if(U_FAILURE(*status)){
@@ -157,7 +377,7 @@ U_CFUNC void umsg_parse_helper(UMessageFormat *fmt, int *count, zval ***args, UC
 		int stmp_len;
 
 		ALLOC_INIT_ZVAL((*args)[i]);
-		
+
 		switch(fargs[i].getType()) {
         case Formattable::kDate:
 			aDate = ((double)fargs[i].getDate())/U_MILLIS_PER_SECOND;
diff --git a/ext/intl/msgformat/msgformat_helpers.h b/ext/intl/msgformat/msgformat_helpers.h
index 30c7e39..f5b01d7 100755
--- a/ext/intl/msgformat/msgformat_helpers.h
+++ b/ext/intl/msgformat/msgformat_helpers.h
@@ -17,8 +17,8 @@
 #ifndef MSG_FORMAT_HELPERS_H
 #define MSG_FORMAT_HELPERS_H
 
-int32_t umsg_format_arg_count(UMessageFormat *fmt); 
-void umsg_format_helper(UMessageFormat *fmt, int arg_count, zval **args,
+int32_t umsg_format_arg_count(UMessageFormat *fmt);
+void umsg_format_helper(UMessageFormat *fmt, int arg_count, zval **args, char **arg_names,
 						UChar **formatted, int *formatted_len, UErrorCode *status TSRMLS_DC);
 void umsg_parse_helper(UMessageFormat *fmt, int *count, zval ***args,
 					   UChar *source, int source_len, UErrorCode *status);
diff --git a/ext/intl/tests/msgfmt_format_subpatterns.phpt b/ext/intl/tests/msgfmt_format_subpatterns.phpt
new file mode 100644
index 0000000..5a57df6
--- /dev/null
+++ b/ext/intl/tests/msgfmt_format_subpatterns.phpt
@@ -0,0 +1,71 @@
+--TEST--
+msgfmt_format() with subpatterns
+--SKIPIF--
+<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+--FILE--
+<?php
+
+/*
+ * Format a number using misc locales/patterns.
+ */
+
+
+function ut_main()
+{
+
+$pattern=<<<_MSG_
+{0, select,
+  female {{1, plural, offset:1
+      =0 {{2} does not give a party.}
+      =1 {{2} invites {3} to her party.}
+      =2 {{2} invites {3} and one other person to her party.}
+     other {{2} invites {3} as one of the # people invited to her party.}}}
+  male   {{1, plural, offset:1
+      =0 {{2} does not give a party.}
+      =1 {{2} invites {3} to his party.}
+      =2 {{2} invites {3} and one other person to his party.}
+     other {{2} invites {3} as one of the # other people invited to his party.}}}
+  other {{1, plural, offset:1
+      =0 {{2} does not give a party.}
+      =1 {{2} invites {3} to their party.}
+      =2 {{2} invites {3} and one other person to their party.}
+      other {{2} invites {3} as one of the # other people invited to their party.}}}}
+_MSG_;
+
+
+$args = array(
+      array('female', 0,  'Alice', 'Bob'),
+      array('male',   1,  'Alice', 'Bob'),
+      array('none',   2,  'Alice', 'Bob'),
+      array('female', 27, 'Alice', 'Bob'),
+);
+
+$str_res = '';
+
+        $fmt = ut_msgfmt_create( 'en_US', $pattern );
+		if(!$fmt) {
+			$str_res .= dump(intl_get_error_message())."\n";
+			continue;
+		}
+        foreach ($args as $arg) {
+            $str_res .= dump( ut_msgfmt_format($fmt, $arg) ). "\n";
+            $str_res .= dump( ut_msgfmt_format_message('en_US', $pattern, $arg) ) . "\n";
+    }
+    return $str_res;
+}
+
+include_once( 'ut_common.inc' );
+
+// Run the test
+ut_run();
+
+?>
+--EXPECT--
+'Alice does not give a party.'
+'Alice does not give a party.'
+'Alice invites Bob to his party.'
+'Alice invites Bob to his party.'
+'Alice invites Bob and one other person to their party.'
+'Alice invites Bob and one other person to their party.'
+'Alice invites Bob as one of the 27 people invited to her party.'
+'Alice invites Bob as one of the 27 people invited to her party.'
diff --git a/ext/intl/tests/msgfmt_format_subpatterns_named.phpt b/ext/intl/tests/msgfmt_format_subpatterns_named.phpt
new file mode 100644
index 0000000..94329ed
--- /dev/null
+++ b/ext/intl/tests/msgfmt_format_subpatterns_named.phpt
@@ -0,0 +1,71 @@
+--TEST--
+msgfmt_format() with named subpatterns
+--SKIPIF--
+<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+--FILE--
+<?php
+
+/*
+ * Format a number using misc locales/patterns.
+ */
+
+
+function ut_main()
+{
+
+$pattern=<<<_MSG_
+{gender_of_host, select,
+  female {{num_guests, plural, offset:1
+      =0 {{host} does not give a party.}
+      =1 {{host} invites {guest} to her party.}
+      =2 {{host} invites {guest} and one other person to her party.}
+     other {{host} invites {guest} as one of the # people invited to her party.}}}
+  male   {{num_guests, plural, offset:1
+      =0 {{host} does not give a party.}
+      =1 {{host} invites {guest} to his party.}
+      =2 {{host} invites {guest} and one other person to his party.}
+     other {{host} invites {guest} as one of the # people invited to his party.}}}
+  other {{num_guests, plural, offset:1
+      =0 {{host} does not give a party.}
+      =1 {{host} invites {guest} to their party.}
+      =2 {{host} invites {guest} and one other person to their party.}
+     other {{host} invites {guest} as one of the # people invited to their party.}}}}
+_MSG_;
+
+
+$args = array(
+      array('gender_of_host' => 'female', 'num_guests' => 0, 'host' => 'Alice', 'guest' => 'Bob'),
+      array('gender_of_host' => 'male', 'num_guests' => 1, 'host' => 'Alice', 'guest' => 'Bob'),
+      array('gender_of_host' => 'none', 'num_guests' => 2, 'host' => 'Alice', 'guest' => 'Bob'),
+      array('gender_of_host' => 'female', 'num_guests' => 27, 'host' => 'Alice', 'guest' => 'Bob'),
+);
+
+$str_res = '';
+
+        $fmt = ut_msgfmt_create( 'en_US', $pattern );
+		if(!$fmt) {
+			$str_res .= dump(intl_get_error_message())."\n";
+			continue;
+		}
+        foreach ($args as $arg) {
+            $str_res .= dump( ut_msgfmt_format($fmt, $arg) ). "\n";
+            $str_res .= dump( ut_msgfmt_format_message('en_US', $pattern, $arg) ) . "\n";
+    }
+    return $str_res;
+}
+
+include_once( 'ut_common.inc' );
+
+// Run the test
+ut_run();
+
+?>
+--EXPECT--
+'Alice does not give a party.'
+'Alice does not give a party.'
+'Alice invites Bob to his party.'
+'Alice invites Bob to his party.'
+'Alice invites Bob and one other person to their party.'
+'Alice invites Bob and one other person to their party.'
+'Alice invites Bob as one of the 27 people invited to her party.'
+'Alice invites Bob as one of the 27 people invited to her party.'
\ No newline at end of file


commit 8da61c62d931bb76faba55bb2fcbd1938b2f96fc
Merge: 5852e5f cd16174
Author: Rasmus Lerdorf <rasmus at php.net>
Date:   Sun May 13 11:48:25 2012 -0700

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix grammo



commit cd16174f14a93b89f064108d72b4fb612345de8f
Author: Rasmus Lerdorf <rasmus at php.net>
Date:   Sun May 13 11:45:41 2012 -0700

    Fix grammo

diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c
index bfe1abd..b908df9 100644
--- a/ext/standard/filestat.c
+++ b/ext/standard/filestat.c
@@ -803,7 +803,7 @@ PHP_FUNCTION(touch)
 PHPAPI void php_clear_stat_cache(zend_bool clear_realpath_cache, const char *filename, int filename_len TSRMLS_DC)
 {
 	/* always clear CurrentStatFile and CurrentLStatFile even if filename is not NULL
-	 * as it may contains outdated data (e.g. "nlink" for a directory when deleting a file
+	 * as it may contain outdated data (e.g. "nlink" for a directory when deleting a file
 	 * in this directory, as shown by lstat_stat_variation9.phpt) */
 	if (BG(CurrentStatFile)) {
 		efree(BG(CurrentStatFile));


commit ec061a93c53c8cde10237741e98e992c1a05d148
Author: Nikita Popov <nikic at php.net>
Date:   Thu Apr 12 11:54:52 2012 +0200

    Allow arbitrary expressions for empty()
    
    This change is as per RFC https://wiki.php.net/rfc/empty_isset_exprs.
    
    The change allows passing the result of function calls and other
    expressions to the empty() language construct. This is accomplished by
    simply rewriting empty(expr) to !expr.
    
    The change does not affect the suppression of errors when using empty()
    on variables. empty($undefinedVar) will continue not to throw errors.
    When an expression is used inside empty() on the other hand, errors will
    not be suppressed. Thus empty($undefinedVar + $somethingElse) *will*
    throw a notice.
    
    The change also does not make empty() into a real function, so using
    'empty' as a callback is still not possible.
    
    In addition to the empty() changes the commit adds nicer error messages
    when isset() is used on function call results or other expressions.

diff --git a/NEWS b/NEWS
index 42c2f83..87ecf08 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,9 @@ PHP                                                                        NEWS
   . World domination
   . Improve set_exception_handler while doing reset.(Laruence)
   . Support constant array/string dereferencing. (Laruence)
+  . Add support for using empty() on the result of function calls and
+    other expressions (https://wiki.php.net/rfc/empty_isset_exprs).
+    (Nikita Popov)
 
 - Core:
   . Fixed bug #61681 (Malformed grammar). (Nikita Popov, Etienne, Laruence).
diff --git a/UPGRADING b/UPGRADING
index 27d01cb..0fae614 100755
--- a/UPGRADING
+++ b/UPGRADING
@@ -28,6 +28,9 @@ PHP X.Y UPGRADE NOTES
 
 - Support constant array/string dereferencing. (Laruence)
   (https://wiki.php.net/rfc/constdereference)
+- Add support for using empty() on the result of function calls and
+  other expressions. Thus it is now possible to write empty(getArray()),
+  for example. (https://wiki.php.net/rfc/empty_isset_exprs)
 
 ========================================
 2. Changes in SAPI modules
@@ -51,7 +54,7 @@ PHP X.Y UPGRADE NOTES
   - Implemented format character "Z": NUL-padded string
   - "a" now does not remove trailing NUL characters on unpack() anymore
   - "A" will now strip all trailing ASCII whitespace on unpack() (it used to
-    remove only trailing spaces.
+    remove only trailing spaces)
 
 ========================================
 5. New Functions
diff --git a/Zend/tests/empty_with_expr.phpt b/Zend/tests/empty_with_expr.phpt
new file mode 100644
index 0000000..582eb3d
--- /dev/null
+++ b/Zend/tests/empty_with_expr.phpt
@@ -0,0 +1,32 @@
+--TEST--
+empty() with arbitrary expressions
+--FILE--
+<?php
+
+function getEmptyArray() { return []; }
+function getNonEmptyArray() { return [1, 2, 3]; }
+
+var_dump(empty([]));
+var_dump(empty([1, 2, 3]));
+
+var_dump(empty(getEmptyArray()));
+var_dump(empty(getNonEmptyArray()));
+
+var_dump(empty([] + []));
+var_dump(empty([1, 2, 3] + []));
+
+var_dump(empty("string"));
+var_dump(empty(""));
+var_dump(empty(true));
+var_dump(empty(false));
+--EXPECT--
+bool(true)
+bool(false)
+bool(true)
+bool(false)
+bool(true)
+bool(false)
+bool(false)
+bool(true)
+bool(false)
+bool(true)
diff --git a/Zend/tests/isset_expr_error.phpt b/Zend/tests/isset_expr_error.phpt
new file mode 100644
index 0000000..27fc6cd
--- /dev/null
+++ b/Zend/tests/isset_expr_error.phpt
@@ -0,0 +1,8 @@
+--TEST--
+Error message for isset(func())
+--FILE--
+<?php
+isset(1 + 1);
+?>
+--EXPECTF--
+Fatal error: Cannot use isset() on the result of an expression (you can use "null !== expression" instead) in %s on line %d
diff --git a/Zend/tests/isset_func_error.phpt b/Zend/tests/isset_func_error.phpt
new file mode 100644
index 0000000..7d1036d
--- /dev/null
+++ b/Zend/tests/isset_func_error.phpt
@@ -0,0 +1,8 @@
+--TEST--
+Error message for isset(func())
+--FILE--
+<?php
+isset(abc());
+?>
+--EXPECTF--
+Fatal error: Cannot use isset() on the result of a function call (you can use "null !== func()" instead) in %s on line %d
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 602b600..37f2dc2 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -6089,7 +6089,16 @@ void zend_do_isset_or_isempty(int type, znode *result, znode *variable TSRMLS_DC
 
 	zend_do_end_variable_parse(variable, BP_VAR_IS, 0 TSRMLS_CC);
 
-	zend_check_writable_variable(variable);
+	if (zend_is_function_or_method_call(variable)) {
+		if (type == ZEND_ISEMPTY) {
+			/* empty(func()) can be transformed to !func() */
+			zend_do_unary_op(ZEND_BOOL_NOT, result, variable TSRMLS_CC);
+		} else {
+			zend_error(E_COMPILE_ERROR, "Cannot use isset() on the result of a function call (you can use \"null !== func()\" instead)");
+		}
+
+		return;
+	}
 
 	if (variable->op_type == IS_CV) {
 		last_op = get_next_op(CG(active_op_array) TSRMLS_CC);
diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y
index 893e013..5a5bb60 100644
--- a/Zend/zend_language_parser.y
+++ b/Zend/zend_language_parser.y
@@ -1158,6 +1158,7 @@ encaps_var_offset:
 internal_functions_in_yacc:
 		T_ISSET '(' isset_variables ')' { $$ = $3; }
 	|	T_EMPTY '(' variable ')'	{ zend_do_isset_or_isempty(ZEND_ISEMPTY, &$$, &$3 TSRMLS_CC); }
+	|	T_EMPTY '(' expr_without_variable ')' { zend_do_unary_op(ZEND_BOOL_NOT, &$$, &$3 TSRMLS_CC); }
 	|	T_INCLUDE expr 			{ zend_do_include_or_eval(ZEND_INCLUDE, &$$, &$2 TSRMLS_CC); }
 	|	T_INCLUDE_ONCE expr 	{ zend_do_include_or_eval(ZEND_INCLUDE_ONCE, &$$, &$2 TSRMLS_CC); }
 	|	T_EVAL '(' expr ')' 	{ zend_do_include_or_eval(ZEND_EVAL, &$$, &$3 TSRMLS_CC); }
@@ -1166,8 +1167,13 @@ internal_functions_in_yacc:
 ;
 
 isset_variables:
-		variable 				{ zend_do_isset_or_isempty(ZEND_ISSET, &$$, &$1 TSRMLS_CC); }
-	|	isset_variables ',' { zend_do_boolean_and_begin(&$1, &$2 TSRMLS_CC); } variable { znode tmp; zend_do_isset_or_isempty(ZEND_ISSET, &tmp, &$4 TSRMLS_CC); zend_do_boolean_and_end(&$$, &$1, &tmp, &$2 TSRMLS_CC); }
+		isset_variable			{ $$ = $1; }
+	|	isset_variables ',' { zend_do_boolean_and_begin(&$1, &$2 TSRMLS_CC); } isset_variable { zend_do_boolean_and_end(&$$, &$1, &$4, &$2 TSRMLS_CC); }
+;
+
+isset_variable:
+		variable				{ zend_do_isset_or_isempty(ZEND_ISSET, &$$, &$1 TSRMLS_CC); }
+	|	expr_without_variable	{ zend_error(E_COMPILE_ERROR, "Cannot use isset() on the result of an expression (you can use \"null !== expression\" instead)"); }
 ;
 
 class_constant:


commit 58482206f5e101ea8a1768375439021891c84bdf
Author: Stanislav Malyshev <stas at php.net>
Date:   Wed May 9 13:37:49 2012 -0700

    update NEWS

diff --git a/NEWS b/NEWS
index a872112..a4486c8 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,6 @@
 PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-?? ??? 2012, PHP 5.4.2
+?? ??? 2012, PHP 5.4.4
 
 - CLI Server:
   . Implemented FR #61977 (Need CLI web-server support for files with .htm & 
@@ -51,6 +51,18 @@ PHP                                                                        NEWS
     sent when no compression). (Mike)
   . Fixed bug #61443 (can't change zlib.output_compression on the fly). (Mike)
 
+08 May 2012, PHP 5.4.3
+
+- CGI
+  . Re-Fix PHP-CGI query string parameter vulnerability, CVE-2012-1823.
+    (Stas)
+  . Fix bug #61807 - Buffer Overflow in apache_request_headers.
+    (nyt-php at countercultured dot net). 
+
+03 May 2012, PHP 5.4.2
+
+- Fix PHP-CGI query string parameter vulnerability, CVE-2012-1823. (Rasmus)
+
 26 Apr 2012, PHP 5.4.1
 
 - CLI Server:


commit 5852e5f48d7b013108b98b9c57c18383765d21ea
Merge: 3478b49 6a50955
Author: Xinchen Hui <laruence at php.net>
Date:   Sat May 12 13:21:49 2012 +0800

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fixed Bug #62005 (unexpected behavior when incrementally assigning to a member of a null object)
      fix stack overflow in php_intlog10abs()
      fix stack overflow in php_intlog10abs()



commit 6a5095582a1e3b9a065863c9990e2f001d1cdc10
Merge: 8b4b70d 3332943
Author: Xinchen Hui <laruence at php.net>
Date:   Sat May 12 13:19:27 2012 +0800

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fixed Bug #62005 (unexpected behavior when incrementally assigning to a member of a null object)
      fix stack overflow in php_intlog10abs()
    
    Conflicts:
    	Zend/zend_execute.c

diff --cc NEWS
index 3717537,1057db7..a872112
--- a/NEWS
+++ b/NEWS
@@@ -16,27 -11,19 +16,29 @@@ PH
      (Laruence)
  
  - Core:
+   . Fixed bug #62005 (unexpected behavior when incrementally assigning to a 
+     member of a null object). (Laruence)
 +  . Fixed bug #61978 (Object recursion not detected for classes that implement
 +    JsonSerializable). (Felipe)
    . Fixed bug #61730 (Segfault from array_walk modifying an array passed by
      reference). (Laruence)
 +  . Fixed bug #61922 (ZTS build doesn't accept zend.script_encoding config).
 +    (Laruence)
    . Fixed missing bound check in iptcparse(). (chris at chiappa.net)
 -  . Fixed bug #61764 ('I' unpacks n as signed if n > 2^31-1 on LP64). (Gustavo)
 +  . Fixed bug #61827 (incorrect \e processing on Windows) (Anatoliy)
 +  . Fixed bug #61761 ('Overriding' a private static method with a different 
 +    signature causes crash). (Laruence)
 +  . Fixed bug #61728 (PHP crash when calling ob_start in request_shutdown 
 +    phase). (Laruence)
 +  . Fixed bug #61660 (bin2hex(hex2bin($data)) != $data). (Nikita Popov)
 +  . Fixed bug #61650 (ini parser crashes when using ${xxxx} ini variables
 +    (without apache2)). (Laruence)
 +  . Fixed bug #61605 (header_remove() does not remove all headers). (Laruence)
    . Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename
      set to null). (Anatoliy)
 -  . Fixed bug #61713 (Logic error in charset detection for htmlentities).
 -    (Anatoliy)
    . Fixed bug #61991 (long overflow in realpath_cache_get()). (Anatoliy)
  
 -- Fileinfo:
 +- FPM
    . Fixed bug #61812 (Uninitialised value used in libmagic). 
      (Laruence, Gustavo)
  
diff --cc Zend/tests/bug62005.phpt
index 0000000,4ff4b2c..c99b287
mode 000000,100644..100644
--- a/Zend/tests/bug62005.phpt
+++ b/Zend/tests/bug62005.phpt
@@@ -1,0 -1,15 +1,15 @@@
+ --TEST--
+ Bug #62005 (unexpected behavior when incrementally assigning to a member of a null object)
+ --FILE--
+ <?php
+ function add_points($player, $points) {
+     $player->energy += $points;
+     print_r($player);
+ }
+ add_points(NULL, 2);
+ --EXPECTF--
 -Strict Standards: Creating default object from empty value in %sbug62005.php on line %d
++Warning: Creating default object from empty value in %sbug62005.php on line %d
+ stdClass Object
+ (
+     [energy] => 2
+ )
diff --cc Zend/zend_execute.c
index d72fc73,4423921..205531f
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@@ -557,8 -435,7 +557,7 @@@ static inline void make_real_object(zva
  		SEPARATE_ZVAL_IF_NOT_REF(object_ptr);
  		zval_dtor(*object_ptr);
  		object_init(*object_ptr);
 -		zend_error(E_STRICT, "Creating default object from empty value");
++		zend_error(E_WARNING, "Creating default object from empty value");
  	}
  }
  


commit 3332943c9d20a8b5e09816b11f38742de0e16085
Author: Xinchen Hui <laruence at php.net>
Date:   Sat May 12 13:13:44 2012 +0800

    Fixed Bug #62005 (unexpected behavior when incrementally assigning to a member of a null object)

diff --git a/NEWS b/NEWS
index e9c1370..1057db7 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,8 @@ PHP                                                                        NEWS
     (Laruence)
 
 - Core:
+  . Fixed bug #62005 (unexpected behavior when incrementally assigning to a 
+    member of a null object). (Laruence)
   . Fixed bug #61730 (Segfault from array_walk modifying an array passed by
     reference). (Laruence)
   . Fixed missing bound check in iptcparse(). (chris at chiappa.net)
diff --git a/Zend/tests/bug62005.phpt b/Zend/tests/bug62005.phpt
new file mode 100644
index 0000000..4ff4b2c
--- /dev/null
+++ b/Zend/tests/bug62005.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Bug #62005 (unexpected behavior when incrementally assigning to a member of a null object)
+--FILE--
+<?php
+function add_points($player, $points) {
+    $player->energy += $points;
+    print_r($player);
+}
+add_points(NULL, 2);
+--EXPECTF--
+Strict Standards: Creating default object from empty value in %sbug62005.php on line %d
+stdClass Object
+(
+    [energy] => 2
+)
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 705c713..4423921 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -432,11 +432,10 @@ static inline void make_real_object(zval **object_ptr TSRMLS_DC)
 		|| (Z_TYPE_PP(object_ptr) == IS_BOOL && Z_LVAL_PP(object_ptr) == 0)
 		|| (Z_TYPE_PP(object_ptr) == IS_STRING && Z_STRLEN_PP(object_ptr) == 0)
 	) {
-		zend_error(E_STRICT, "Creating default object from empty value");
-
 		SEPARATE_ZVAL_IF_NOT_REF(object_ptr);
 		zval_dtor(*object_ptr);
 		object_init(*object_ptr);
+		zend_error(E_STRICT, "Creating default object from empty value");
 	}
 }
 


commit 8b4b70df56e14be0f7172b5cc5f8da44b3272ac3
Author: Nuno Lopes <nlopess at php.net>
Date:   Fri May 11 12:50:29 2012 -0400

    fix stack overflow in php_intlog10abs()
    
    bug uncovered by LLVM/clang's new -fbounds-checking switch
    this patch fixes a crash in ext/standard/tests/math/round_large_exp.phpt

diff --git a/ext/standard/math.c b/ext/standard/math.c
index 302fbda..65187f6 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -37,7 +37,7 @@ static inline int php_intlog10abs(double value) {
 	int result;
 	value = fabs(value);
 
-	if (value < 1e-8 || value > 1e23) {
+	if (value < 1e-8 || value > 1e22) {
 		result = (int)floor(log10(value));
 	} else {
 		static const double values[] = {
@@ -46,7 +46,7 @@ static inline int php_intlog10abs(double value) {
 			1e8,  1e9,  1e10, 1e11, 1e12, 1e13, 1e14, 1e15,
 			1e16, 1e17, 1e18, 1e19, 1e20, 1e21, 1e22};
 		/* Do a binary search with 5 steps */
-		result = 16;
+		result = 15;
 		if (value < values[result]) {
 			result -= 8;
 		} else {


commit 950d5ee590214742799836d3d939ee59f641bdf4
Author: Nuno Lopes <nlopess at php.net>
Date:   Fri May 11 12:50:29 2012 -0400

    fix stack overflow in php_intlog10abs()
    
    bug uncovered by LLVM/clang's new -fbounds-checking switch
    this patch fixes a crash in ext/standard/tests/math/round_large_exp.phpt

diff --git a/ext/standard/math.c b/ext/standard/math.c
index 21c730c..749c77c 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -37,7 +37,7 @@ static inline int php_intlog10abs(double value) {
 	int result;
 	value = fabs(value);
 
-	if (value < 1e-8 || value > 1e23) {
+	if (value < 1e-8 || value > 1e22) {
 		result = (int)floor(log10(value));
 	} else {
 		static const double values[] = {
@@ -46,7 +46,7 @@ static inline int php_intlog10abs(double value) {
 			1e8,  1e9,  1e10, 1e11, 1e12, 1e13, 1e14, 1e15,
 			1e16, 1e17, 1e18, 1e19, 1e20, 1e21, 1e22};
 		/* Do a binary search with 5 steps */
-		result = 16;
+		result = 15;
 		if (value < values[result]) {
 			result -= 8;
 		} else {


commit 3478b49fe9d36ea7720a611e58018ca98ed7a0e6
Merge: 5c87ca2 257d0b5
Author: Nuno Lopes <nlopess at php.net>
Date:   Fri May 11 13:04:32 2012 -0400

    Merge branch 'master' of https://git.php.net/push/php-src



commit 5c87ca2d2770e18c385d4b770123b9b21eeaa053
Author: Nuno Lopes <nlopess at php.net>
Date:   Fri May 11 12:50:29 2012 -0400

    fix stack overflow in php_intlog10abs()
    
    bug uncovered by LLVM/clang's new -fbounds-checking switch
    this patch fixes a crash in ext/standard/tests/math/round_large_exp.phpt

diff --git a/ext/standard/math.c b/ext/standard/math.c
index 302fbda..65187f6 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -37,7 +37,7 @@ static inline int php_intlog10abs(double value) {
 	int result;
 	value = fabs(value);
 
-	if (value < 1e-8 || value > 1e23) {
+	if (value < 1e-8 || value > 1e22) {
 		result = (int)floor(log10(value));
 	} else {
 		static const double values[] = {
@@ -46,7 +46,7 @@ static inline int php_intlog10abs(double value) {
 			1e8,  1e9,  1e10, 1e11, 1e12, 1e13, 1e14, 1e15,
 			1e16, 1e17, 1e18, 1e19, 1e20, 1e21, 1e22};
 		/* Do a binary search with 5 steps */
-		result = 16;
+		result = 15;
 		if (value < values[result]) {
 			result -= 8;
 		} else {


commit 257d0b5566024b00994b6eeb6c89b6d5f00d4e72
Merge: e7934c0 4458f3b
Author: Anatoliy Belsky <ab at php.net>
Date:   Fri May 11 14:39:29 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug #61990 ext\spl\examples\tests\dualiterator_001.phpt fails



commit 4458f3bcf65e5826f4cfb8ffd00cd3b8161f37bd
Merge: 24e03d8 81ba6b1
Author: Anatoliy Belsky <ab at php.net>
Date:   Fri May 11 14:38:43 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug #61990 ext\spl\examples\tests\dualiterator_001.phpt fails



commit e7934c0ffaa96e206312e1305c23e349f75e05cc
Merge: d0d7340 24e03d8
Author: Xinchen Hui <laruence at php.net>
Date:   Fri May 11 20:27:07 2012 +0800

    Merge branch 'PHP-5.4'



commit 81ba6b14c7b1b934f4d3e2896f861a42b07aa838
Author: Anatoliy Belsky <ab at php.net>
Date:   Fri May 11 14:24:12 2012 +0200

    Fix bug #61990 ext\spl\examples\tests\dualiterator_001.phpt fails
    
    This fixes a general issue. In this ticket and not for the first time
    is being seen, that people are trying to use data from "examples"
    in the tests. When extracting a test pack only "tests" and its siblings
    was taken into account. Now "examples" are copied as well.

diff --git a/win32/build/mkdist.php b/win32/build/mkdist.php
index 17f7cd0..5ed9bdc 100644
--- a/win32/build/mkdist.php
+++ b/win32/build/mkdist.php
@@ -401,7 +401,7 @@ function copy_test_dir($directory, $dest)
 	while (FALSE !== ($file = readdir($directory_list))) {
 		$full_path = $directory . '/' . $file;
 		if($file != '.' && $file != '..' && $file != '.svn' && is_dir($full_path)) {
-			if ($file == 'tests') {
+			if ($file == 'tests' || $file == 'examples') {
 				if (!is_dir($dest . '/' . $full_path)) {
 					mkdir($dest . '/' . $full_path , 0775, true);
 				}


commit 24e03d875f0a264de3609c7813be1d813dabbdf7
Merge: b43d6c8 0cb4849
Author: Xinchen Hui <laruence at php.net>
Date:   Fri May 11 20:07:27 2012 +0800

    Merge branch 'remove-useless-func-decleare' of https://github.com/reeze/php-src into PHP-5.4



commit 0cb4849e533334ee860f44f0f8409a9d5c09f7c9
Author: Reeze Xia <reeze.xia at gmail.com>
Date:   Fri May 11 16:52:12 2012 +0800

    Cleanup useless function declaration for traits

diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index 8a81a95..f164122 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -518,10 +518,6 @@ void zend_prepare_trait_precedence(znode *result, znode *method_reference, znode
 void zend_prepare_reference(znode *result, znode *class_name, znode *method_name TSRMLS_DC);
 void zend_prepare_trait_alias(znode *result, znode *method_reference, znode *modifiers, znode *alias TSRMLS_DC);
 
-void init_trait_alias_list(znode* result, const znode* trait_alias TSRMLS_DC);
-void add_trait_alias(znode* result, const znode* trait_alias TSRMLS_DC);
-void init_trait_alias(znode* result, const znode* method_name, const znode* alias, const znode* modifiers TSRMLS_DC);
-
 ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce TSRMLS_DC);
 void zend_do_early_binding(TSRMLS_D);
 ZEND_API void zend_do_delayed_early_binding(const zend_op_array *op_array TSRMLS_DC);


commit d0d7340d50f178691c8e436391168cf6cc1fea3e
Merge: 27685b7 b43d6c8
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu May 10 17:35:09 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug #61992 ext\standard\tests\general_functions\bug44295.phpt fails



commit b43d6c852238de8c3e010bb4a5041e9c03e4db2c
Merge: fc0c905 266578f
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu May 10 17:32:21 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug #61992 ext\standard\tests\general_functions\bug44295.phpt fails



commit 266578f58483a08d7af51714636564df36a926d0
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu May 10 17:07:38 2012 +0200

    Fix bug #61992 ext\standard\tests\general_functions\bug44295.phpt fails
    
    Exception text differ on windows

diff --git a/ext/standard/tests/general_functions/bug44295-win.phpt b/ext/standard/tests/general_functions/bug44295-win.phpt
new file mode 100644
index 0000000..d210a54
--- /dev/null
+++ b/ext/standard/tests/general_functions/bug44295-win.phpt
@@ -0,0 +1,29 @@
+--TEST--
+user defined error handler + set_error_handling(EH_THROW)
+--SKIPIF--
+<?php
+	if(substr(PHP_OS, 0, 3) != "WIN") die("skip Windows only");
+	if (!extension_loaded("spl") || is_dir('c:\\not\\exists\\here')) die("skip");
+?>
+--FILE--
+<?php
+$dir = 'c:\\not\\exists\\here';
+
+set_error_handler('my_error_handler');
+function my_error_handler() {$a = func_get_args(); print "in error handler\n"; }
+
+try {
+        print "before\n";
+        $iter = new DirectoryIterator($dir);
+        print get_class($iter) . "\n";
+        print "after\n";
+} catch (Exception $e) {
+        print "in catch: ".$e->getMessage()."\n";
+}
+?>
+==DONE==
+<?php exit(0); ?>
+--EXPECT--
+before
+in catch: DirectoryIterator::__construct(c:\not\exists\here,c:\not\exists\here): The system cannot find the path specified. (code: 3)
+==DONE==
diff --git a/ext/standard/tests/general_functions/bug44295.phpt b/ext/standard/tests/general_functions/bug44295.phpt
index 9c12719..a184719 100644
--- a/ext/standard/tests/general_functions/bug44295.phpt
+++ b/ext/standard/tests/general_functions/bug44295.phpt
@@ -1,7 +1,10 @@
 --TEST--
 user defined error handler + set_error_handling(EH_THROW)
 --SKIPIF--
-<?php if (!extension_loaded("spl") || is_dir('/this/path/does/not/exist')) die("skip"); ?>
+<?php
+	if(substr(PHP_OS, 0, 3) == "WIN") die("skip Not for Windows");
+	if (!extension_loaded("spl") || is_dir('/this/path/does/not/exist')) die("skip");
+?>
 --FILE--
 <?php
 $dir = '/this/path/does/not/exist';


commit 27685b7bb537b2a1113e0877a89ff863dea55827
Merge: 4184551 fc0c905
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu May 10 15:58:30 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      updated NEWS



commit fc0c9054e68a109c36143dafa4fdb133dfb17a5b
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu May 10 15:56:50 2012 +0200

    updated NEWS

diff --git a/NEWS b/NEWS
index cb00f7a..3717537 100644
--- a/NEWS
+++ b/NEWS
@@ -34,6 +34,7 @@ PHP                                                                        NEWS
   . Fixed bug #61605 (header_remove() does not remove all headers). (Laruence)
   . Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename
     set to null). (Anatoliy)
+  . Fixed bug #61991 (long overflow in realpath_cache_get()). (Anatoliy)
 
 - FPM
   . Fixed bug #61812 (Uninitialised value used in libmagic). 


commit 4184551b943597ff54706a17cdd2e7f2fd214088
Merge: f6558a2 19f85f8
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu May 10 15:53:08 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      updated NEWS



commit 19f85f8676bfb993a3f1838429afe8597c65dbd2
Merge: 10d5f23 652632a
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu May 10 15:52:37 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      updated NEWS



commit 652632a89bc4ec1623ddcc41da82bd888c874b29
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu May 10 15:48:56 2012 +0200

    updated NEWS

diff --git a/NEWS b/NEWS
index bd194be..e9c1370 100644
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,7 @@ PHP                                                                        NEWS
     set to null). (Anatoliy)
   . Fixed bug #61713 (Logic error in charset detection for htmlentities).
     (Anatoliy)
+  . Fixed bug #61991 (long overflow in realpath_cache_get()). (Anatoliy)
 
 - Fileinfo:
   . Fixed bug #61812 (Uninitialised value used in libmagic). 


commit f6558a295d42dbfd7d14b190cfaad1cdb2671c72
Merge: e3f2c76 10d5f23
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu May 10 15:40:17 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug ext\standard\tests\file\realpath_cache_win32.phpt fails



commit 10d5f2301a463a719f3b4289625bd280e69ae54c
Merge: f76d7be f7d8b27
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu May 10 15:36:47 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug ext\standard\tests\file\realpath_cache_win32.phpt fails



commit f7d8b274c7affabd3158075ff1feec45e2cdf56f
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu May 10 15:27:44 2012 +0200

    Fix bug ext\standard\tests\file\realpath_cache_win32.phpt fails
    
    What happens here is trivial long overflow. Despite the bug attracted
    attention on windows, the same story is on linux. Just wait for a big
    anough bucket->key . The linux test had %i to check the key value
    which should be %d all the way.

diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c
index 94a7b89..349526e 100644
--- a/ext/standard/filestat.c
+++ b/ext/standard/filestat.c
@@ -1160,7 +1160,12 @@ PHP_FUNCTION(realpath_cache_get)
 			MAKE_STD_ZVAL(entry);
 			array_init(entry);
 
-			add_assoc_long(entry, "key", bucket->key);
+			/* bucket->key is unsigned long */
+			if (LONG_MAX >= bucket->key) {
+				add_assoc_long(entry, "key", bucket->key);
+			} else {
+				add_assoc_double(entry, "key", (double)bucket->key);
+			}
 			add_assoc_bool(entry, "is_dir", bucket->is_dir);
 			add_assoc_stringl(entry, "realpath", bucket->realpath, bucket->realpath_len, 1);
 			add_assoc_long(entry, "expires", bucket->expires);
diff --git a/ext/standard/tests/file/realpath_cache.phpt b/ext/standard/tests/file/realpath_cache.phpt
index a476063..92d6fc5 100644
--- a/ext/standard/tests/file/realpath_cache.phpt
+++ b/ext/standard/tests/file/realpath_cache.phpt
@@ -19,7 +19,7 @@ echo "Done\n";
 int(%d)
 array(4) {
   ["key"]=>
-  int(%i)
+  %s(%d)
   ["is_dir"]=>
   bool(true)
   ["realpath"]=>
diff --git a/ext/standard/tests/file/realpath_cache_win32.phpt b/ext/standard/tests/file/realpath_cache_win32.phpt
index 16fc412..a4c663f 100644
--- a/ext/standard/tests/file/realpath_cache_win32.phpt
+++ b/ext/standard/tests/file/realpath_cache_win32.phpt
@@ -19,7 +19,7 @@ echo "Done\n";
 int(%d)
 array(8) {
   ["key"]=>
-  int(%d)
+  %s(%d)
   ["is_dir"]=>
   bool(true)
   ["realpath"]=>


commit e3f2c769899b77cb30153a235ea65ede9483bd13
Merge: 134da93 f76d7be
Author: Anatoliy Belsky <ab at php.net>
Date:   Wed May 9 13:06:47 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug 61901 ext\phar\tests\phar_buildfromdirectory2.phpt fails



commit f76d7be8764787899f5d776fee967570659132a1
Merge: d394c17 7fb16d5
Author: Anatoliy Belsky <ab at php.net>
Date:   Wed May 9 13:04:32 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug 61901 ext\phar\tests\phar_buildfromdirectory2.phpt fails



commit 7fb16d5bd9cd5a317c52ed36b5a94fc5e0067b4a
Author: Anatoliy Belsky <ab at php.net>
Date:   Wed May 9 13:02:33 2012 +0200

    Fix bug 61901 ext\phar\tests\phar_buildfromdirectory2.phpt fails
    
    Another error message is produced by win specific code

diff --git a/ext/phar/tests/phar_buildfromdirectory2-win.phpt b/ext/phar/tests/phar_buildfromdirectory2-win.phpt
new file mode 100644
index 0000000..9dbcf96
--- /dev/null
+++ b/ext/phar/tests/phar_buildfromdirectory2-win.phpt
@@ -0,0 +1,30 @@
+--TEST--
+Phar::buildFromDirectory() - non-directory passed as first parameter
+--SKIPIF--
+<?php
+	if (!extension_loaded("phar")) die("skip");
+	if (substr(PHP_OS, 0, 3) != "WIN") die("skip Windows only test");
+?>
+--INI--
+phar.require_hash=0
+phar.readonly=0
+--FILE--
+<?php
+try {
+	$phar = new Phar(dirname(__FILE__) . '/buildfromdirectory.phar');
+	$phar->buildFromDirectory(1);
+} catch (Exception $e) {
+	var_dump(get_class($e));
+	echo $e->getMessage() . "\n";
+}
+?>
+===DONE===
+--CLEAN--
+<?php 
+unlink(dirname(__FILE__) . '/buildfromdirectory.phar');
+__HALT_COMPILER();
+?>
+--EXPECTF--
+%s(24) "UnexpectedValueException"
+RecursiveDirectoryIterator::__construct(1,1): The system cannot find the file specified. (code: 2)
+===DONE===
diff --git a/ext/phar/tests/phar_buildfromdirectory2.phpt b/ext/phar/tests/phar_buildfromdirectory2.phpt
index 6c67f20..639ff0b 100644
--- a/ext/phar/tests/phar_buildfromdirectory2.phpt
+++ b/ext/phar/tests/phar_buildfromdirectory2.phpt
@@ -1,7 +1,10 @@
 --TEST--
 Phar::buildFromDirectory() - non-directory passed as first parameter
 --SKIPIF--
-<?php if (!extension_loaded("phar")) die("skip"); ?>
+<?php
+	if (!extension_loaded("phar")) die("skip");
+	if (substr(PHP_OS, 0, 3) == "WIN") die("skip not for Windows");
+?>
 --INI--
 phar.require_hash=0
 phar.readonly=0


commit 134da93fbde6623b68dca1d9ee853fdb3c330c4a
Merge: 6707560 d394c17
Author: Xinchen Hui <laruence at php.net>
Date:   Wed May 9 11:29:19 2012 +0800

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Correct test title



commit d394c17293df2405b10aaec1804edd65e1d8efe8
Author: Xinchen Hui <laruence at php.net>
Date:   Wed May 9 11:28:57 2012 +0800

    Correct test title

diff --git a/sapi/cli/tests/bug61977.phpt b/sapi/cli/tests/bug61977.phpt
index edb7b78..2f19806 100644
--- a/sapi/cli/tests/bug61977.phpt
+++ b/sapi/cli/tests/bug61977.phpt
@@ -1,5 +1,5 @@
 --TEST--
-Bug #60159 (Router returns false, but POST is not passed to requested resource)
+Bug #61977 (Need CLI web-server support for files with .htm & svg extensions)
 --SKIPIF--
 <?php
 include "skipif.inc"; 


commit 67075609d3082a09cb469e77343bed005fc29ba8
Merge: c4d0b79 1e60d0c
Author: Xinchen Hui <laruence at php.net>
Date:   Wed May 9 11:28:09 2012 +0800

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Implemented FR #61977 (Need CLI web-server support for files with .htm & svg extensions)



commit 1e60d0c105f065f395b5ae02608eaec9b42708f8
Author: Xinchen Hui <laruence at php.net>
Date:   Wed May 9 11:27:39 2012 +0800

    Implemented FR #61977 (Need CLI web-server support for files with .htm & svg extensions)

diff --git a/NEWS b/NEWS
index d989f34..cb00f7a 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ PHP                                                                        NEWS
 ?? ??? 2012, PHP 5.4.2
 
 - CLI Server:
+  . Implemented FR #61977 (Need CLI web-server support for files with .htm & 
+    svg extensions). (Sixd, Laruence)
   . Fixed bug #61546 (functions related to current script failed when chdir() 
     in cli sapi). (Laruence, reeze.xia at gmail.com)
   . Improved performance while sending error page, this also fixed
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c
index e052aa8..87ab7b4 100644
--- a/sapi/cli/php_cli_server.c
+++ b/sapi/cli/php_cli_server.c
@@ -251,15 +251,17 @@ static php_cli_server_http_reponse_status_code_pair template_map[] = {
 };
 
 static php_cli_server_ext_mime_type_pair mime_type_map[] = {
+	{ "html", "text/html" },
+	{ "htm", "text/html" },
+	{ "js", "text/javascript" },
+	{ "css", "text/css" },
 	{ "gif", "image/gif" },
-	{ "png", "image/png" },
-	{ "jpe", "image/jpeg" },
 	{ "jpg", "image/jpeg" },
 	{ "jpeg", "image/jpeg" },
-	{ "css", "text/css" },
-	{ "html", "text/html" },
+	{ "png", "image/png" },
+	{ "jpe", "image/jpeg" },
+	{ "svg", "image/svg+xml" },
 	{ "txt", "text/plain" },
-	{ "js", "text/javascript" },
 	{ NULL, NULL }
 };
 
diff --git a/sapi/cli/tests/bug61977.phpt b/sapi/cli/tests/bug61977.phpt
new file mode 100644
index 0000000..edb7b78
--- /dev/null
+++ b/sapi/cli/tests/bug61977.phpt
@@ -0,0 +1,157 @@
+--TEST--
+Bug #60159 (Router returns false, but POST is not passed to requested resource)
+--SKIPIF--
+<?php
+include "skipif.inc"; 
+?>
+--FILE--
+<?php
+include "php_cli_server.inc";
+php_cli_server_start('<?php ?>', true);
+$doc_root = __DIR__;
+
+list($host, $port) = explode(':', PHP_CLI_SERVER_ADDRESS);
+$port = intval($port)?:80;
+
+$fp = fsockopen($host, $port, $errno, $errstr, 0.5);
+if (!$fp) {
+  die("connect failed");
+}
+
+file_put_contents($doc_root . '/foo.html', '');
+if(fwrite($fp, <<<HEADER
+GET /foo.html HTTP/1.1
+Host: {$host}
+
+
+HEADER
+)) {
+	while (!feof($fp)) {
+		$text = fgets($fp);
+        if (strncasecmp("Content-type:", $text, 13) == 0) {
+           echo "foo.html => ", $text;
+        }
+	}
+}
+ at unlink($doc_root . '/foo.html');
+fclose($fp);
+
+
+$fp = fsockopen($host, $port, $errno, $errstr, 0.5);
+if (!$fp) {
+  die("connect failed");
+}
+file_put_contents($doc_root . '/foo.htm', '');
+if(fwrite($fp, <<<HEADER
+GET /foo.htm HTTP/1.1
+Host: {$host}
+
+
+HEADER
+)) {
+	while (!feof($fp)) {
+		$text = fgets($fp);
+        if (strncasecmp("Content-type:", $text, 13) == 0) {
+           echo "foo.htm => ", $text;
+        }
+	}
+}
+ at unlink($doc_root . '/foo.htm');
+fclose($fp);
+
+
+$fp = fsockopen($host, $port, $errno, $errstr, 0.5);
+if (!$fp) {
+  die("connect failed");
+}
+file_put_contents($doc_root . '/foo.svg', '');
+if(fwrite($fp, <<<HEADER
+GET /foo.svg HTTP/1.1
+Host: {$host}
+
+
+HEADER
+)) {
+	while (!feof($fp)) {
+		$text = fgets($fp);
+        if (strncasecmp("Content-type:", $text, 13) == 0) {
+           echo "foo.svg => ", $text;
+        }
+	}
+}
+ at unlink($doc_root . '/foo.svg');
+fclose($fp);
+
+$fp = fsockopen($host, $port, $errno, $errstr, 0.5);
+if (!$fp) {
+  die("connect failed");
+}
+file_put_contents($doc_root . '/foo.css', '');
+if(fwrite($fp, <<<HEADER
+GET /foo.css HTTP/1.1
+Host: {$host}
+
+
+HEADER
+)) {
+	while (!feof($fp)) {
+		$text = fgets($fp);
+        if (strncasecmp("Content-type:", $text, 13) == 0) {
+           echo "foo.css => ", $text;
+        }
+	}
+}
+ at unlink($doc_root . '/foo.css');
+fclose($fp);
+
+$fp = fsockopen($host, $port, $errno, $errstr, 0.5);
+if (!$fp) {
+  die("connect failed");
+}
+file_put_contents($doc_root . '/foo.js', '');
+if(fwrite($fp, <<<HEADER
+GET /foo.js HTTP/1.1
+Host: {$host}
+
+
+HEADER
+)) {
+	while (!feof($fp)) {
+		$text = fgets($fp);
+        if (strncasecmp("Content-type:", $text, 13) == 0) {
+           echo "foo.js => ", $text;
+        }
+	}
+}
+ at unlink($doc_root . '/foo.js');
+fclose($fp);
+
+$fp = fsockopen($host, $port, $errno, $errstr, 0.5);
+if (!$fp) {
+  die("connect failed");
+}
+file_put_contents($doc_root . '/foo.png', '');
+if(fwrite($fp, <<<HEADER
+GET /foo.png HTTP/1.1
+Host: {$host}
+
+
+HEADER
+)) {
+	while (!feof($fp)) {
+		$text = fgets($fp);
+        if (strncasecmp("Content-type:", $text, 13) == 0) {
+           echo "foo.png => ", $text;
+        }
+	}
+}
+ at unlink($doc_root . '/foo.png');
+fclose($fp);
+?>
+--EXPECTF--
+foo.html => Content-Type: text/html; charset=UTF-8
+foo.htm => Content-Type: text/html; charset=UTF-8
+foo.svg => Content-Type: image/svg+xml
+foo.css => Content-Type: text/css; charset=UTF-8
+foo.js => Content-Type: text/javascript; charset=UTF-8
+foo.png => Content-Type: image/png


commit c4d0b796c2cdd7d0c93451bc0f9ea1d3dfb6c747
Merge: 4dc9545 7b2ab56
Author: Xinchen Hui <laruence at php.net>
Date:   Wed May 9 11:23:37 2012 +0800

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix test failed,  the fsockopen will be refused immediately if the server is not set up.
      - BFN



commit 7b2ab569976f63b22ba1c69e78e782a693d5076a
Author: Xinchen Hui <laruence at php.net>
Date:   Wed May 9 11:21:24 2012 +0800

    Fix test failed,  the fsockopen will be refused immediately if the server is not set up.

diff --git a/sapi/cli/tests/php_cli_server.inc b/sapi/cli/tests/php_cli_server.inc
index d24a679..3479cd0 100644
--- a/sapi/cli/tests/php_cli_server.inc
+++ b/sapi/cli/tests/php_cli_server.inc
@@ -37,16 +37,14 @@ function php_cli_server_start($code = 'echo "Hello world";', $no_router = FALSE)
 	
 	// note: even when server prints 'Listening on localhost:8964...Press Ctrl-C to quit.'
 	//       it might not be listening yet...need to wait until fsockopen() call returns
-	$fp = fsockopen(PHP_CLI_SERVER_HOSTNAME, PHP_CLI_SERVER_PORT);
-	if ($fp) {
-		// server will report Unexpected EOF error (socket opened, closed without writing
-		// anything) but that can be ignored
-		fclose($fp);
-	} else {
-		// test will fail to connect if server doesn't start listening/accepting
-		// in the next few microseconds
-	}
+    $i = 0;
+    while (($i++ < 5) && !($fp = @fsockopen(PHP_CLI_SERVER_HOSTNAME, PHP_CLI_SERVER_PORT))) {
+        usleep(10000);
+    }
 
+    if ($fp) {
+        fclose($fp);
+    }
 
 	register_shutdown_function(
 		function($handle) use($router) {
@@ -56,7 +54,6 @@ function php_cli_server_start($code = 'echo "Hello world";', $no_router = FALSE)
 			$handle
 		);
 	// don't bother sleeping, server is already up
-	//usleep(50000);
 	// server can take a variable amount of time to be up, so just sleeping a guessed amount of time
 	// does not work. this is why tests sometimes pass and sometimes fail. to get a reliable pass
 	// sleeping doesn't work.


commit f46a064760bd99223d8a8aec9df9807bab262022
Author: Felipe Pena <felipensp at gmail.com>
Date:   Tue May 8 21:07:29 2012 -0300

    - BFN

diff --git a/NEWS b/NEWS
index 6008f42..d989f34 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,8 @@ PHP                                                                        NEWS
     (Laruence)
 
 - Core:
+  . Fixed bug #61978 (Object recursion not detected for classes that implement
+    JsonSerializable). (Felipe)
   . Fixed bug #61730 (Segfault from array_walk modifying an array passed by
     reference). (Laruence)
   . Fixed bug #61922 (ZTS build doesn't accept zend.script_encoding config).


commit 4dc9545aaa8aaefffc7b4be05ae7bc6690531dec
Merge: e675670 92bc49b
Author: Felipe Pena <felipensp at gmail.com>
Date:   Tue May 8 21:06:15 2012 -0300

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      - Fixed bug #61978 (Object recursion not detected for classes that implement JsonSerializable)



commit 92bc49b2b06417f86dc0fc537326e60f4d0a0c0b
Author: Felipe Pena <felipensp at gmail.com>
Date:   Tue May 8 21:05:51 2012 -0300

    - Fixed bug #61978 (Object recursion not detected for classes that implement JsonSerializable)

diff --git a/ext/json/json.c b/ext/json/json.c
index fc1fcb7..557fbc3 100644
--- a/ext/json/json.c
+++ b/ext/json/json.c
@@ -513,6 +513,19 @@ static void json_encode_serializable_object(smart_str *buf, zval *val, int optio
 {
 	zend_class_entry *ce = Z_OBJCE_P(val);
 	zval *retval = NULL, fname;
+	HashTable* myht;
+	
+	if (Z_TYPE_P(val) == IS_ARRAY) {
+		myht = HASH_OF(val);
+	} else {
+		myht = Z_OBJPROP_P(val);
+	}	
+	
+	if (myht && myht->nApplyCount > 1) {
+		php_error_docref(NULL TSRMLS_CC, E_WARNING, "recursion detected");
+		smart_str_appendl(buf, "null", 4);
+		return;
+	}
 
 	ZVAL_STRING(&fname, "jsonSerialize", 0);
 
diff --git a/ext/json/tests/bug61978.phpt b/ext/json/tests/bug61978.phpt
new file mode 100644
index 0000000..2c73297
--- /dev/null
+++ b/ext/json/tests/bug61978.phpt
@@ -0,0 +1,47 @@
+--TEST--
+Bug #61978 (Object recursion not detected for classes that implement JsonSerializable)
+--SKIPIF--
+<?php if (!extension_loaded("json")) print "skip"; ?>
+--FILE--
+<?php
+
+class JsonTest1 {
+    public $test;
+    public $me;
+    public function __construct() {
+        $this->test = '123';
+        $this->me  = $this;
+    }
+}
+
+class JsonTest2 implements JsonSerializable {
+    public $test;
+    public function __construct() {
+        $this->test = '123';
+    }
+    public function jsonSerialize() {
+        return array(
+            'test' => $this->test,
+            'me'   => $this
+        );
+    }
+}
+
+
+$obj1 = new JsonTest1();
+var_dump(json_encode($obj1));
+
+echo "\n==\n";
+
+$obj2 = new JsonTest2();
+var_dump(json_encode($obj2));
+
+?>
+--EXPECTF--
+Warning: json_encode(): recursion detected in %s on line %d
+string(44) "{"test":"123","me":{"test":"123","me":null}}"
+
+==
+
+Warning: json_encode(): recursion detected in %s on line %d
+string(44) "{"test":"123","me":{"test":"123","me":null}}"


commit e67567088ef3897f6be0193e07a81cdb3c19b28f
Merge: 5fce7fe 2cb0ed1
Author: David Soria Parra <dsp at php.net>
Date:   Tue May 8 22:09:13 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Typo



commit 2cb0ed1328da3bca00990648c3dfc90c957395f1
Author: David Soria Parra <dsp at php.net>
Date:   Tue May 8 22:08:54 2012 +0200

    Typo

diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c
index 0850425..e052aa8 100644
--- a/sapi/cli/php_cli_server.c
+++ b/sapi/cli/php_cli_server.c
@@ -1356,7 +1356,7 @@ static void php_cli_server_request_translate_vpath(php_cli_server_request *reque
 	if (prev_path) {
 		request->path_info_len = prev_path_len;
 #ifdef PHP_WIN32
-		while (prev_pach_len--) {
+		while (prev_path_len--) {
 			if (prev_path[prev_path_len] == '\\') {
 				prev_path[prev_path_len] = '/';
 			}


commit 5fce7fe885d818d667b69ac40595f7e8b106307e
Merge: 0877906 87fa84a
Author: Anatoliy Belsky <ab at php.net>
Date:   Tue May 8 19:36:15 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug 61746 Failing tests in ext/standard/tests/file/windows_links/*



commit 87fa84abde7bb49e58136ea239ce4d25d211bb7e
Merge: 057f471 c12fdbd
Author: Anatoliy Belsky <ab at php.net>
Date:   Tue May 8 19:35:13 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug 61746 Failing tests in ext/standard/tests/file/windows_links/*



commit c12fdbde5fe1da3f5ddd3be70a807b46755ff118
Author: Matt Ficken <mattficken at php.net>
Date:   Tue May 8 19:31:41 2012 +0200

    Fix bug 61746 Failing tests in ext/standard/tests/file/windows_links/*
    
    Fixed that again for systems having their %SYSTEMROOT% not in
    c:\windows

diff --git a/ext/standard/tests/file/windows_links/bug48746.phpt b/ext/standard/tests/file/windows_links/bug48746.phpt
index a47b7cb..55465ae 100644
--- a/ext/standard/tests/file/windows_links/bug48746.phpt
+++ b/ext/standard/tests/file/windows_links/bug48746.phpt
@@ -9,7 +9,8 @@ Venkat Raman Don (don.raman at microsoft.com)
 if(substr(PHP_OS, 0, 3) != 'WIN' ) {
     die('skip windows only test');
 }
-$cmd = "mklink.exe /?";
+include_once __DIR__ . '/common.inc';
+$cmd = "mklink /?";
 $ret = @exec($cmd, $output, $return_val);
 if (count($output) == 0) {
     die("mklink.exe not found in PATH");
@@ -17,7 +18,8 @@ if (count($output) == 0) {
 ?>
 --FILE--
 <?php
-$mountvol = "c:\\Windows\\System32\\mountvol.exe";
+include_once __DIR__ . '/common.inc';
+$mountvol = get_mountvol();
 $old_dir = __DIR__;
 $dirname = __DIR__ . "\\mnt\\test\\directory";
 mkdir($dirname, 0700, true);
diff --git a/ext/standard/tests/file/windows_links/bug48746_1.phpt b/ext/standard/tests/file/windows_links/bug48746_1.phpt
index 716c656..5d8e685 100644
--- a/ext/standard/tests/file/windows_links/bug48746_1.phpt
+++ b/ext/standard/tests/file/windows_links/bug48746_1.phpt
@@ -9,7 +9,8 @@ Venkat Raman Don (don.raman at microsoft.com)
 if(substr(PHP_OS, 0, 3) != 'WIN' ) {
     die('skip windows only test');
 }
-$cmd = "mklink.exe /?";
+include_once __DIR__ . '/common.inc';
+$cmd = "mklink /?";
 $ret = @exec($cmd, $output, $return_val);
 if (count($output) == 0) {
     die("mklink.exe not found in PATH");
@@ -17,7 +18,8 @@ if (count($output) == 0) {
 ?>
 --FILE--
 <?php
-$mountvol = "c:\\Windows\\System32\\mountvol.exe";
+include_once __DIR__ . '/common.inc';
+$mountvol = get_mountvol();
 $old_dir = __DIR__;
 $dirname = __DIR__ . "\\mnt\\test\\directory";
 exec("mkdir " . $dirname, $output, $ret_val);
@@ -54,4 +56,4 @@ I am included.
 I am included.
 bool(true)
 bool(true)
-bool(true)
+bool(true)
diff --git a/ext/standard/tests/file/windows_links/bug48746_2.phpt b/ext/standard/tests/file/windows_links/bug48746_2.phpt
index 637152c..56924a5 100644
--- a/ext/standard/tests/file/windows_links/bug48746_2.phpt
+++ b/ext/standard/tests/file/windows_links/bug48746_2.phpt
@@ -9,15 +9,17 @@ Venkat Raman Don (don.raman at microsoft.com)
 if(substr(PHP_OS, 0, 3) != 'WIN' ) {
     die('skip windows only test');
 }
+include_once __DIR__ . '/common.inc';
 $ret = exec('mklink bug48746_tmp.lnk ' . __FILE__ .' 2>&1', $out);
 if (strpos($ret, 'privilege')) {
 	die('skip. SeCreateSymbolicLinkPrivilege not enable for this user.');
 }
-unlink('mklink bug48746_tmp.lnk');
+unlink('bug48746_tmp.lnk');
 ?>
 --FILE--
 <?php
-$mountvol = "c:\\Windows\\System32\\mountvol.exe";
+include_once __DIR__ . '/common.inc';
+$mountvol = get_mountvol();
 $old_dir = __DIR__;
 $dirname = __DIR__ . "\\mnt\\test\\directory";
 exec("mkdir " . $dirname, $output, $ret_val);
@@ -64,4 +66,4 @@ Array
     [1] => ..
     [2] => a.php
     [3] => b.php
-)
+)
diff --git a/ext/standard/tests/file/windows_links/bug48746_3.phpt b/ext/standard/tests/file/windows_links/bug48746_3.phpt
index a0dcbdc..b88ab76 100644
--- a/ext/standard/tests/file/windows_links/bug48746_3.phpt
+++ b/ext/standard/tests/file/windows_links/bug48746_3.phpt
@@ -9,7 +9,8 @@ Venkat Raman Don (don.raman at microsoft.com)
 if(substr(PHP_OS, 0, 3) != 'WIN' ) {
 	die('skip windows only test');
 }
-$ret = exec('junction /? 2>&1', $out);
+include_once __DIR__ . '/common.inc';
+$ret = exec(get_junction().' /? 2>&1', $out);
 if (strpos($out[0], 'recognized')) {
 	die('skip. junction.exe not found in PATH.');
 }
@@ -17,11 +18,12 @@ if (strpos($out[0], 'recognized')) {
 ?>
 --FILE--
 <?php
+include_once __DIR__ . '/common.inc';
 $old_dir = __DIR__;
 $dirname = __DIR__ . "\\mnt\\test\\directory";
 exec("mkdir " . $dirname, $output, $ret_val);
 chdir(__DIR__ . "\\mnt\\test");
-exec("junction junction directory", $output, $ret_val);
+exec(get_junction()." junction directory", $output, $ret_val);
 file_put_contents("junction\\a.php", "<?php echo \"I am included.\n\" ?>");
 file_put_contents("junction\\b.php", "<?php echo \"I am included.\n\" ?>");
 include "junction/a.php";
@@ -45,4 +47,4 @@ Array
     [1] => ..
     [2] => a.php
     [3] => b.php
-)
+)
diff --git a/ext/standard/tests/file/windows_links/common.inc b/ext/standard/tests/file/windows_links/common.inc
new file mode 100644
index 0000000..2d4b47c
--- /dev/null
+++ b/ext/standard/tests/file/windows_links/common.inc
@@ -0,0 +1,23 @@
+<?php
+
+function get_sysroot() {
+	// usually c:\\windows, but not always
+	return exec('echo %SYSTEMROOT%');
+}
+
+function get_junction(){
+	// junction.exe isn't included with Windows
+	// its a sysinternals tool for working with filesystem links
+	// see: http://technet.microsoft.com/en-us/sysinternals/bb896768
+	
+	// install somewhere that is on %path% or added to %path%
+	return "junction.exe";
+}
+
+function get_mountvol() {
+	$sysroot = get_sysroot();
+
+	return "$sysroot\\System32\\mountvol.exe";
+}
+
+?>


commit 08779069e86d72336f52078276c3296455fae4f7
Merge: eafc567 057f471
Author: Stanislav Malyshev <stas at php.net>
Date:   Tue May 8 10:21:10 2012 -0700

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      c++ comments
      restore BC
      ws + restore BC to apache_request_headers
      fix bug #61807 - Buffer Overflow in apache_request_headers



commit 057f4719d3825fff3f0cfe0f263168b227d93205
Author: Stanislav Malyshev <stas at php.net>
Date:   Tue May 8 10:18:06 2012 -0700

    c++ comments

diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index ba89c54..7856e0c 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -1615,21 +1615,21 @@ PHP_FUNCTION(apache_request_headers) /* {{{ */
 				p = var + 5;
 
 				var = q = t;
-				// First char keep uppercase
+				/* First char keep uppercase */
 				*q++ = *p++;
 				while (*p) {
 					if (*p == '=') {
-						// End of name
+						/* End of name */
 						break;
 					} else if (*p == '_') {
 						*q++ = '-';
 						p++;
-						// First char after - keep uppercase
+						/* First char after - keep uppercase */
 						if (*p && *p!='=') {
 							*q++ = *p++;
 						}
 					} else if (*p >= 'A' && *p <= 'Z') {
-						// lowercase
+						/* lowercase */
 						*q++ = (*p++ - 'A' + 'a');
 					} else {
 						*q++ = *p++;


commit 1919ec5a55d971610eab86eb64b18b7eacfefe81
Author: Stanislav Malyshev <stas at php.net>
Date:   Mon May 7 22:22:56 2012 -0700

    restore BC

diff --git a/sapi/cgi/tests/apache_request_headers.phpt b/sapi/cgi/tests/apache_request_headers.phpt
index 37e077e..2c82d57 100644
--- a/sapi/cgi/tests/apache_request_headers.phpt
+++ b/sapi/cgi/tests/apache_request_headers.phpt
@@ -40,7 +40,7 @@ Array
 )
 Array
 (
-    [X--Test] => AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+    [X-_test] => AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
 )
 Array
 (


commit bd8912e47c8a74406fe49555a3eb76a8c3197b27
Author: Stanislav Malyshev <stas at php.net>
Date:   Mon May 7 21:54:19 2012 -0700

    ws + restore BC to apache_request_headers

diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index a0a1ada..ba89c54 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -1615,21 +1615,21 @@ PHP_FUNCTION(apache_request_headers) /* {{{ */
 				p = var + 5;
 
 				var = q = t;
-                                // First char keep uppercase
+				// First char keep uppercase
 				*q++ = *p++;
 				while (*p) {
 					if (*p == '=') {
-                                               // End of name
-                                               break;
-                                        } else if (*p == '_') {
+						// End of name
+						break;
+					} else if (*p == '_') {
 						*q++ = '-';
 						p++;
-                                                // First char after - keep uppercase
-						if (*p && *p!='=' && *p!='_') {
+						// First char after - keep uppercase
+						if (*p && *p!='=') {
 							*q++ = *p++;
 						}
 					} else if (*p >= 'A' && *p <= 'Z') {
-                                                // lowercase
+						// lowercase
 						*q++ = (*p++ - 'A' + 'a');
 					} else {
 						*q++ = *p++;


commit 20364bcff9f38bed83245d785cc8ec3a072e4da5
Author: Stanislav Malyshev <stas at php.net>
Date:   Mon May 7 12:24:22 2012 -0700

    fix bug #61807 - Buffer Overflow in apache_request_headers

diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index d25cad4..a0a1ada 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -1615,15 +1615,21 @@ PHP_FUNCTION(apache_request_headers) /* {{{ */
 				p = var + 5;
 
 				var = q = t;
+                                // First char keep uppercase
 				*q++ = *p++;
 				while (*p) {
-					if (*p == '_') {
+					if (*p == '=') {
+                                               // End of name
+                                               break;
+                                        } else if (*p == '_') {
 						*q++ = '-';
 						p++;
-						if (*p) {
+                                                // First char after - keep uppercase
+						if (*p && *p!='=' && *p!='_') {
 							*q++ = *p++;
 						}
 					} else if (*p >= 'A' && *p <= 'Z') {
+                                                // lowercase
 						*q++ = (*p++ - 'A' + 'a');
 					} else {
 						*q++ = *p++;
diff --git a/sapi/cgi/tests/apache_request_headers.phpt b/sapi/cgi/tests/apache_request_headers.phpt
new file mode 100644
index 0000000..37e077e
--- /dev/null
+++ b/sapi/cgi/tests/apache_request_headers.phpt
@@ -0,0 +1,49 @@
+--TEST--
+apache_request_headers() stack overflow.
+--SKIPIF--
+<?php 
+include "skipif.inc"; 
+?>
+--FILE--
+<?php
+include "include.inc";
+
+$php = get_cgi_path();
+reset_env_vars();
+
+$file = dirname(__FILE__)."/012.test.php";
+
+file_put_contents($file, '<?php print_r(apache_request_headers()); ?>');
+
+passthru("$php $file");
+
+$names = array('HTTP_X_TEST', 'HTTP_X__TEST', 'HTTP_X_');
+foreach ($names as $name) {
+	putenv($name."=".str_repeat("A", 256));
+	passthru("$php -q $file");
+	putenv($name);
+}
+unlink($file);
+
+echo "Done\n";
+?>
+--EXPECTF--	
+X-Powered-By: PHP/%s
+Content-type: text/html
+
+Array
+(
+)
+Array
+(
+    [X-Test] => AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+)
+Array
+(
+    [X--Test] => AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+)
+Array
+(
+    [X-] => AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+)
+Done


commit eafc567213886cc049fdbca147ab5d84dd93b117
Merge: c5da8e6 0b4d7a4
Author: Anatoliy Belsky <ab at php.net>
Date:   Tue May 8 18:53:36 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      updated NEWS



commit 0b4d7a455d8f2bffaa9c4f9cbd7aff8e3e740fe8
Merge: 4b30798 838b4b8
Author: Anatoliy Belsky <ab at php.net>
Date:   Tue May 8 18:52:48 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      updated NEWS



commit 838b4b8ff7d78dfb0da99e0b17568558a85a1c2a
Author: Anatoliy Belsky <ab at php.net>
Date:   Tue May 8 18:51:49 2012 +0200

    updated NEWS

diff --git a/NEWS b/NEWS
index c354b39..bd194be 100644
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,8 @@ PHP                                                                        NEWS
   . Fixed bug #61764 ('I' unpacks n as signed if n > 2^31-1 on LP64). (Gustavo)
   . Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename
     set to null). (Anatoliy)
+  . Fixed bug #61713 (Logic error in charset detection for htmlentities).
+    (Anatoliy)
 
 - Fileinfo:
   . Fixed bug #61812 (Uninitialised value used in libmagic). 


commit c5da8e699f3321fe1065df45b218d187ea7365a9
Merge: 8c69c6c 4b30798
Author: Anatoliy Belsky <ab at php.net>
Date:   Tue May 8 18:35:15 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug 61713 check also that mbstring's found any internal_encoding



commit 4b307984dfd14388af5d11f2ac630e2496c15659
Merge: 8987ad5 d776a93
Author: Anatoliy Belsky <ab at php.net>
Date:   Tue May 8 18:34:32 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug 61713 check also that mbstring's found any internal_encoding



commit d776a933eb270c7aa094c937168966fa89e2fa5c
Author: Anatoliy Belsky <ab at php.net>
Date:   Tue May 8 18:31:11 2012 +0200

    Fix bug 61713 check also that mbstring's found any internal_encoding

diff --git a/ext/standard/html.c b/ext/standard/html.c
index c813af5..058708e 100644
--- a/ext/standard/html.c
+++ b/ext/standard/html.c
@@ -785,18 +785,20 @@ static enum entity_charset determine_charset(char *charset_hint TSRMLS_DC)
 			charset_hint = Z_STRVAL_P(uf_result);
 			len = Z_STRLEN_P(uf_result);
 			
-			if (len == 4) { /* sizeof(none|auto|pass)-1 */
-				if (!memcmp("pass", charset_hint, sizeof("pass") - 1) || 
-				    !memcmp("auto", charset_hint, sizeof("auto") - 1) || 
-				    !memcmp("none", charset_hint, sizeof("none") - 1)) {
-					
-					charset_hint = NULL;
-					len = 0;
+			if (charset_hint != NULL && len != 0) {
+				if (len == 4) { /* sizeof(none|auto|pass)-1 */
+					if (!memcmp("pass", charset_hint, sizeof("pass") - 1) ||
+						!memcmp("auto", charset_hint, sizeof("auto") - 1) ||
+						!memcmp("none", charset_hint, sizeof("none") - 1)) {
+
+						charset_hint = NULL;
+						len = 0;
+					}
+				} else {
+					/* Jump to det_charset only if mbstring isn't one of above eq pass, auto, none.
+					   Otherwise try default_charset next */
+					goto det_charset;
 				}
-			} else {
-				/* Jump to det_charset only if mbstring isn't one of above eq pass, auto, none.
-				   Otherwise try default_charset next */
-				goto det_charset;
 			}
 		}
 	}


commit 8c69c6c6b08421939a45de40182401f6a87c30d7
Merge: 544c6f2 8987ad5
Author: Anatoliy Belsky <ab at php.net>
Date:   Tue May 8 18:15:19 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug #61713 ext\standard\tests\strings\htmlentities10.phpt fails



commit 8987ad5cb2d334f65a6732d8904b2e2381e5f9c4
Merge: e8e6611 3a4a253
Author: Anatoliy Belsky <ab at php.net>
Date:   Tue May 8 18:14:38 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug #61713 ext\standard\tests\strings\htmlentities10.phpt fails



commit 3a4a25358fe3f389c434f68e59bfd70b25b93b29
Author: Anatoliy Belsky <ab at php.net>
Date:   Tue May 8 17:42:01 2012 +0200

    Fix bug #61713 ext\standard\tests\strings\htmlentities10.phpt fails
    
    There is a logic error in charset detection part for htmlentities.
    When mbstring is compiled shared and mbstring.internal_encoding
    is set to pass, it prevents default_charset from being checked
    resulting iso-8859-1 being choosed.

diff --git a/ext/standard/html.c b/ext/standard/html.c
index 81c69de..c813af5 100644
--- a/ext/standard/html.c
+++ b/ext/standard/html.c
@@ -793,8 +793,11 @@ static enum entity_charset determine_charset(char *charset_hint TSRMLS_DC)
 					charset_hint = NULL;
 					len = 0;
 				}
+			} else {
+				/* Jump to det_charset only if mbstring isn't one of above eq pass, auto, none.
+				   Otherwise try default_charset next */
+				goto det_charset;
 			}
-			goto det_charset;
 		}
 	}
 #endif


commit 544c6f2f224586b24990b342b187a8ddf8c1aedf
Merge: 6e96d7c e8e6611
Author: Johannes Schlüter <johannes at php.net>
Date:   Tue May 8 17:30:46 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix #61704 (Crash apache, phpinfo() threading issue)
      Fix folding marks



commit e8e661128a4dcee9d2f35ed3443d567ba2ad7870
Author: Johannes Schlüter <johannes at php.net>
Date:   Tue May 8 17:30:05 2012 +0200

    Fix #61704 (Crash apache, phpinfo() threading issue)

diff --git a/NEWS b/NEWS
index f88bf70..6008f42 100644
--- a/NEWS
+++ b/NEWS
@@ -110,6 +110,7 @@ PHP                                                                        NEWS
   . Fixed bug #61003 (mysql_stat() require a valid connection). (Johannes).
 
 - mysqlnd
+  . Fixed bug #61704 (Crash apache, phpinfo() threading issue). (Johannes)
   . Fixed bug #60948 (mysqlnd FTBFS when -Wformat-security is enabled).
     (Johannes)
 
diff --git a/ext/mysqlnd/mysqlnd_plugin.c b/ext/mysqlnd/mysqlnd_plugin.c
index 457596f..2dbb57d 100644
--- a/ext/mysqlnd/mysqlnd_plugin.c
+++ b/ext/mysqlnd/mysqlnd_plugin.c
@@ -169,7 +169,24 @@ PHPAPI void * _mysqlnd_plugin_find(const char * const name TSRMLS_DC)
 /* {{{ _mysqlnd_plugin_apply_with_argument */
 PHPAPI void _mysqlnd_plugin_apply_with_argument(apply_func_arg_t apply_func, void * argument TSRMLS_DC)
 {
-	zend_hash_apply_with_argument(&mysqlnd_registered_plugins, apply_func, argument TSRMLS_CC);
+	/* Note: We want to be thread-safe (read-only), so we can use neither
+	 * zend_hash_apply_with_argument nor zend_hash_internal_pointer_reset and
+	 * friends
+	 */
+	Bucket *p;
+
+	p = mysqlnd_registered_plugins.pListHead;
+	while (p != NULL) {
+		int result = apply_func(p->pData, argument TSRMLS_CC);
+
+		if (result & ZEND_HASH_APPLY_REMOVE) {
+			php_error_docref(NULL TSRMLS_CC, E_WARNING, "mysqlnd_plugin_apply_with_argument must not remove table entries");
+		}
+		p = p->pListNext;
+		if (result & ZEND_HASH_APPLY_STOP) {
+			break;
+		}
+	}
 }
 /* }}} */
 
diff --git a/ext/mysqlnd/php_mysqlnd.c b/ext/mysqlnd/php_mysqlnd.c
index 1022285..20fcc5e 100644
--- a/ext/mysqlnd/php_mysqlnd.c
+++ b/ext/mysqlnd/php_mysqlnd.c
@@ -135,16 +135,22 @@ mysqlnd_minfo_dump_loaded_plugins(void *pDest, void * buf TSRMLS_DC)
 /* }}} */
 
 /* {{{ mysqlnd_minfo_dump_api_plugins */
-static int
-mysqlnd_minfo_dump_api_plugins(void * pDest, void * buf TSRMLS_DC)
+static void
+mysqlnd_minfo_dump_api_plugins(smart_str * buffer TSRMLS_DC)
 {
-	smart_str * buffer = (smart_str *) buf;
-	MYSQLND_REVERSE_API * ext = *(MYSQLND_REVERSE_API **) pDest;
-	if (buffer->len) {
-		smart_str_appendc(buffer, ',');
+	HashTable *ht = mysqlnd_reverse_api_get_api_list(TSRMLS_C);
+	Bucket *p;
+
+	p = ht->pListHead;
+	while(p != NULL) {
+		MYSQLND_REVERSE_API * ext = *(MYSQLND_REVERSE_API **) p->pData;
+		if (buffer->len) {
+			smart_str_appendc(buffer, ',');
+		}
+		smart_str_appends(buffer, ext->module->name);
+
+		p = p->pListNext;
 	}
-	smart_str_appends(buffer, ext->module->name);
-	return ZEND_HASH_APPLY_KEEP;
 }
 /* }}} */
 
@@ -189,7 +195,7 @@ PHP_MINFO_FUNCTION(mysqlnd)
 		php_info_print_table_row(2, "Loaded plugins", tmp_str.c);
 		smart_str_free(&tmp_str);
 
-		zend_hash_apply_with_argument(mysqlnd_reverse_api_get_api_list(TSRMLS_C), mysqlnd_minfo_dump_api_plugins, &tmp_str TSRMLS_CC);
+		mysqlnd_minfo_dump_api_plugins(&tmp_str TSRMLS_CC);
 		smart_str_0(&tmp_str);
 		php_info_print_table_row(2, "API Extensions", tmp_str.c);
 		smart_str_free(&tmp_str);


commit fb3b6bcf8384c375ddffce85d5e652ec609ccf7a
Author: Johannes Schlüter <johannes at php.net>
Date:   Tue May 8 15:18:33 2012 +0200

    Fix folding marks

diff --git a/ext/mysqlnd/mysqlnd_plugin.c b/ext/mysqlnd/mysqlnd_plugin.c
index b295ad7..457596f 100644
--- a/ext/mysqlnd/mysqlnd_plugin.c
+++ b/ext/mysqlnd/mysqlnd_plugin.c
@@ -65,7 +65,7 @@ static struct st_mysqlnd_typeii_plugin_example mysqlnd_example_plugin =
 };
 
 
-/* {{{ mysqlnd_plugin_subsystem_init */
+/* {{{ mysqlnd_example_plugin_end */
 static 
 enum_func_status mysqlnd_example_plugin_end(void * p TSRMLS_DC)
 {
@@ -78,7 +78,7 @@ enum_func_status mysqlnd_example_plugin_end(void * p TSRMLS_DC)
 /* }}} */
 
 
-/* {{{ mysqlnd_plugin_subsystem_init */
+/* {{{ mysqlnd_example_plugin_register */
 void
 mysqlnd_example_plugin_register(TSRMLS_D)
 {
@@ -104,7 +104,7 @@ mysqlnd_plugin_subsystem_init(TSRMLS_D)
 /* }}} */
 
 
-/* {{{ mysqlnd_plugin_subsystem_init */
+/* {{{ mysqlnd_plugin_end_apply_func */
 int
 mysqlnd_plugin_end_apply_func(void *pDest TSRMLS_DC)
 {
@@ -136,7 +136,7 @@ PHPAPI unsigned int mysqlnd_plugin_register()
 /* }}} */
 
 
-/* {{{ mysqlnd_plugin_register */
+/* {{{ mysqlnd_plugin_register_ex */
 PHPAPI unsigned int mysqlnd_plugin_register_ex(struct st_mysqlnd_plugin_header * plugin TSRMLS_DC)
 {
 	if (plugin) {


commit 6e96d7cd5ef255b1152ec8312145195dc4b3be6c
Merge: 857fc1b 3400914
Author: Johannes Schlüter <johannes at php.net>
Date:   Tue May 8 11:50:19 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      This will be PHP 5.3.14
      improve fix for CVE-2012-1823
      improve fix for CVE-2012-1823



commit 340091469a2838ee633764279d988e830f40acde
Merge: b501017 e120a0c
Author: Johannes Schlüter <johannes at php.net>
Date:   Tue May 8 11:49:50 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      This will be PHP 5.3.14
      improve fix for CVE-2012-1823



commit e120a0c7f30953774d3ff2ac1a14b2ab623a047c
Author: Johannes Schlüter <johannes at php.net>
Date:   Tue May 8 11:28:15 2012 +0200

    This will be PHP 5.3.14

diff --git a/NEWS b/NEWS
index c2b10e5..c354b39 100644
--- a/NEWS
+++ b/NEWS
@@ -40,13 +40,19 @@ PHP                                                                        NEWS
   . Fixed bug #61961 (file_get_contents leaks when access empty file with
     maxlen set). (Reeze)
 
-(merge after 5.3.11 release)
+08 May 2012, PHP 5.3.13
+- CGI
+  . Improve fix for PHP-CGI query string parameter vulnerability, CVE-2012-2311.
+    (Stas)
+
+03 May 2012, PHP 5.3.12
+- Fix PHP-CGI query string parameter vulnerability, CVE-2012-1823. (Rasmus)
+
+26 Apr 2012, PHP 5.3.11
 
 - Core:
-  . Fixed bug #61605 (header_remove() does not remove all headers).
-    (Laruence)
-  . Fixed bug #61541 (Segfault when using ob_* in output_callback).
-    (reeze.xia at gmail.com)
+  . Fixed bug #61650 (ini parser crashes when using ${xxxx} ini variables
+    (without apache2)). (Laruence)
   . Fixed bug #61273 (call_user_func_array with more than 16333 arguments
     leaks / crashes). (Laruence)
   . Fixed bug #61165 (Segfault - strip_tags()). (Laruence)
@@ -93,14 +99,17 @@ PHP                                                                        NEWS
   . Fixed bug #61172 (Add Apache 2.4 support). (Chris Jones)
 
 - Fileinfo
+  . Upgraded libmagic to 5.11 (Pierre, Anatoliy)
+  . Fixed bug #61565 where php_stream_open_wrapper_ex tries to open a
+    directory descriptor under windows. (Anatoliy)
+  . Fixed bug #61566 failure caused by the posix lseek and read versions
+    under windows in cdf_read(). (Anatoliy)
   . Fixed bug #61173 (Unable to detect error from finfo constructor). (Gustavo)
 
 - Firebird Database extension (ibase):
   . Fixed bug #60802 (ibase_trans() gives segfault when passing params).
 
 - Libxml:
-  . Fixed bug #61617 (Libxml tests failed(ht is already destroyed)).
-    (Laruence)
   . Fixed bug #61367 (open_basedir bypass using libxml RSHUTDOWN). 
     (Tim Starling)
 
@@ -123,6 +132,10 @@ PHP                                                                        NEWS
 - PDO_Sqlite extension:
   . Add createCollation support. (Damien)
 
+- pgsql:
+  . Fixed bug #60718 (Compile problem with libpq (PostgreSQL 7.3 or less).
+    (Yasuo Ohgaki)
+
 - Phar:
   . Fixed bug #61184 (Phar::webPhar() generates headers with trailing NUL
     bytes). (Nikic)
diff --git a/configure.in b/configure.in
index b257cbb..35356d0 100644
--- a/configure.in
+++ b/configure.in
@@ -41,7 +41,7 @@ AC_CONFIG_HEADER(main/php_config.h)
 
 PHP_MAJOR_VERSION=5
 PHP_MINOR_VERSION=3
-PHP_RELEASE_VERSION=13
+PHP_RELEASE_VERSION=14
 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/main/php_version.h b/main/php_version.h
index 358c6c0..0b523d7 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 3
-#define PHP_RELEASE_VERSION 13
+#define PHP_RELEASE_VERSION 14
 #define PHP_EXTRA_VERSION "-dev"
-#define PHP_VERSION "5.3.13-dev"
-#define PHP_VERSION_ID 50313
+#define PHP_VERSION "5.3.14-dev"
+#define PHP_VERSION_ID 50314


commit b50101764ba0f8d61c010886aca812e740c8193c
Author: Stanislav Malyshev <stas at php.net>
Date:   Mon May 7 12:08:36 2012 -0700

    improve fix for CVE-2012-1823

diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 5c1c55e..d25cad4 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -1807,10 +1807,15 @@ int main(int argc, char *argv[])
 		}
 	}
 
-	if(query_string = getenv("QUERY_STRING")) {
+	if((query_string = getenv("QUERY_STRING")) != NULL && strchr(query_string, '=') == NULL) {
+		/* we've got query string that has no = - apache CGI will pass it to command line */
+		unsigned char *p;
 		decoded_query_string = strdup(query_string);
 		php_url_decode(decoded_query_string, strlen(decoded_query_string));
-		if(*decoded_query_string == '-' && strchr(decoded_query_string, '=') == NULL) {
+		for (p = decoded_query_string; *p &&  *p <= ' '; p++) {
+			/* skip all leading spaces */
+		}
+		if(*p == '-') {
 			skip_getopt = 1;
 		}
 		free(decoded_query_string);
@@ -2074,7 +2079,7 @@ consult the installation file that came with this distribution, or visit \n\
 	}
 
 	zend_first_try {
-		while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 1, 2)) != -1) {
+		while (!skip_getopt && (c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 1, 2)) != -1) {
 			switch (c) {
 				case 'T':
 					benchmark = 1;


commit 000e84aa88ce16deabbf61e7086fc8db63ca88aa
Author: Stanislav Malyshev <stas at php.net>
Date:   Mon May 7 12:08:36 2012 -0700

    improve fix for CVE-2012-1823

diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 760ad66..a7ac26f 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -1561,10 +1561,15 @@ int main(int argc, char *argv[])
 		}
 	}
 
-	if(query_string = getenv("QUERY_STRING")) {
+	if((query_string = getenv("QUERY_STRING")) != NULL && strchr(query_string, '=') == NULL) {
+		/* we've got query string that has no = - apache CGI will pass it to command line */
+		unsigned char *p;
 		decoded_query_string = strdup(query_string);
 		php_url_decode(decoded_query_string, strlen(decoded_query_string));
-		if(*decoded_query_string == '-' && strchr(decoded_query_string, '=') == NULL) {
+		for (p = decoded_query_string; *p &&  *p <= ' '; p++) {
+			/* skip all leading spaces */
+		}
+		if(*p == '-') {
 			skip_getopt = 1;
 		}
 		free(decoded_query_string);
@@ -1819,7 +1824,7 @@ consult the installation file that came with this distribution, or visit \n\
 	}
 
 	zend_first_try {
-		while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 1, 2)) != -1) {
+		while (!skip_getopt && (c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 1, 2)) != -1) {
 			switch (c) {
 				case 'T':
 					benchmark = 1;


commit 857fc1b473f5d27ed5ea6aa78420498dbb71c6b6
Merge: 2c505ec 36587ff
Author: Stanislav Malyshev <stas at php.net>
Date:   Mon May 7 12:12:48 2012 -0700

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      improve fix for CVE-2012-1823
      Fix for CVE-2012-1823



commit 36587ff335612e4dfe4723dab47954718f5a2878
Merge: 0556103 7de4b75
Author: Stanislav Malyshev <stas at php.net>
Date:   Mon May 7 12:10:36 2012 -0700

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      improve fix for CVE-2012-1823
      Fix for CVE-2012-1823



commit 7de4b75f74a817c3fead32710e04cd015bcc5360
Author: Stanislav Malyshev <stas at php.net>
Date:   Mon May 7 12:08:36 2012 -0700

    improve fix for CVE-2012-1823

diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 760ad66..a7ac26f 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -1561,10 +1561,15 @@ int main(int argc, char *argv[])
 		}
 	}
 
-	if(query_string = getenv("QUERY_STRING")) {
+	if((query_string = getenv("QUERY_STRING")) != NULL && strchr(query_string, '=') == NULL) {
+		/* we've got query string that has no = - apache CGI will pass it to command line */
+		unsigned char *p;
 		decoded_query_string = strdup(query_string);
 		php_url_decode(decoded_query_string, strlen(decoded_query_string));
-		if(*decoded_query_string == '-' && strchr(decoded_query_string, '=') == NULL) {
+		for (p = decoded_query_string; *p &&  *p <= ' '; p++) {
+			/* skip all leading spaces */
+		}
+		if(*p == '-') {
 			skip_getopt = 1;
 		}
 		free(decoded_query_string);
@@ -1819,7 +1824,7 @@ consult the installation file that came with this distribution, or visit \n\
 	}
 
 	zend_first_try {
-		while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 1, 2)) != -1) {
+		while (!skip_getopt && (c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 1, 2)) != -1) {
 			switch (c) {
 				case 'T':
 					benchmark = 1;


commit 004941af15674eeb5d12b8459b8ff50c25758150
Author: Rasmus Lerdorf <rasmus at php.net>
Date:   Thu May 3 15:51:52 2012 +0200

    Fix for CVE-2012-1823

diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 56c736f..760ad66 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -70,6 +70,7 @@
 #include "php_main.h"
 #include "fopen_wrappers.h"
 #include "ext/standard/php_standard.h"
+#include "ext/standard/url.h"
 
 #ifdef PHP_WIN32
 # include <io.h>
@@ -1508,6 +1509,9 @@ int main(int argc, char *argv[])
 #ifndef PHP_WIN32
 	int status = 0;
 #endif
+	char *query_string;
+	char *decoded_query_string;
+	int skip_getopt = 0;
 
 #if 0 && defined(PHP_DEBUG)
 	/* IIS is always making things more difficult.  This allows
@@ -1557,7 +1561,16 @@ int main(int argc, char *argv[])
 		}
 	}
 
-	while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0, 2)) != -1) {
+	if(query_string = getenv("QUERY_STRING")) {
+		decoded_query_string = strdup(query_string);
+		php_url_decode(decoded_query_string, strlen(decoded_query_string));
+		if(*decoded_query_string == '-' && strchr(decoded_query_string, '=') == NULL) {
+			skip_getopt = 1;
+		}
+		free(decoded_query_string);
+	}
+
+	while (!skip_getopt && (c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0, 2)) != -1) {
 		switch (c) {
 			case 'c':
 				if (cgi_sapi_module.php_ini_path_override) {


commit 2c505ecc57092cac1cd554fd0f645c5f05db9f65
Merge: c75cbd6 0966406
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon May 7 15:40:48 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug 61905 ext\phar\tests\zip\phar_commitwrite.phpt fails
      Fix bug 61903 ext\phar\tests\tar\phar_commitwrite.phpt fails



commit 09664063a82e8ad4fc133a92a360050748c53000
Merge: 87a011d 2068419
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon May 7 15:40:16 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug 61905 ext\phar\tests\zip\phar_commitwrite.phpt fails
      Fix bug 61903 ext\phar\tests\tar\phar_commitwrite.phpt fails



commit 2068419ae5c24781714e9d60c4baf64d254d573d
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon May 7 15:39:07 2012 +0200

    Fix bug 61905 ext\phar\tests\zip\phar_commitwrite.phpt fails

diff --git a/ext/phar/tests/zip/phar_commitwrite.phpt b/ext/phar/tests/zip/phar_commitwrite.phpt
index 84bccb9..4e18a6b 100644
--- a/ext/phar/tests/zip/phar_commitwrite.phpt
+++ b/ext/phar/tests/zip/phar_commitwrite.phpt
@@ -5,6 +5,9 @@ Phar::setStub()/stopBuffering() zip-based
 --INI--
 phar.require_hash=0
 phar.readonly=0
+--ENV--
+TEMP=.
+TMP=.
 --FILE--
 <?php
 $p = new Phar(dirname(__FILE__) . '/brandnewphar.phar.zip', 0, 'brandnewphar.phar');
@@ -41,4 +44,4 @@ include 'phar://brandnewphar.phar/startup.php';
 __HALT_COMPILER(); ?>
 "
 bool(true)
-===DONE===
\ No newline at end of file
+===DONE===


commit ce59121c5f3f67f570f462e93354de0cff1bd31a
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon May 7 15:37:29 2012 +0200

    Fix bug 61903 ext\phar\tests\tar\phar_commitwrite.phpt fails

diff --git a/ext/phar/tests/tar/phar_commitwrite.phpt b/ext/phar/tests/tar/phar_commitwrite.phpt
index b926b9a..262ea1d 100644
--- a/ext/phar/tests/tar/phar_commitwrite.phpt
+++ b/ext/phar/tests/tar/phar_commitwrite.phpt
@@ -5,6 +5,9 @@ Phar::setStub()/stopBuffering() tar-based
 --INI--
 phar.require_hash=0
 phar.readonly=0
+--ENV--
+TEMP=.
+TMP=.
 --FILE--
 <?php
 $p = new Phar(dirname(__FILE__) . '/brandnewphar.phar.tar', 0, 'brandnewphar.phar');
@@ -41,4 +44,4 @@ include 'phar://brandnewphar.phar/startup.php';
 __HALT_COMPILER(); ?>
 "
 bool(true)
-===DONE===
\ No newline at end of file
+===DONE===


commit c75cbd62dda8a1fab2a0e68ed07ea73ca5e2b1d2
Author: andrey <andrey at php.net>
Date:   Mon May 7 15:32:00 2012 +0200

    these methods should return a stream. This makes it easier to intercept
    the return value

diff --git a/ext/mysqlnd/mysqlnd_net.c b/ext/mysqlnd/mysqlnd_net.c
index b2fe662..a641a41 100644
--- a/ext/mysqlnd/mysqlnd_net.c
+++ b/ext/mysqlnd/mysqlnd_net.c
@@ -105,7 +105,7 @@ MYSQLND_METHOD(mysqlnd_net, network_write_ex)(MYSQLND_NET * const net, const zen
 /* }}} */
 
 /* {{{ mysqlnd_net::open_pipe */
-static enum_func_status
+static php_stream *
 MYSQLND_METHOD(mysqlnd_net, open_pipe)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len,
 									   const zend_bool persistent,
 									   MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC)
@@ -125,7 +125,7 @@ MYSQLND_METHOD(mysqlnd_net, open_pipe)(MYSQLND_NET * const net, const char * con
 	net_stream = php_stream_open_wrapper((char*) scheme + sizeof("pipe://") - 1, "r+", streams_options, NULL);
 	if (!net_stream) {
 		SET_CLIENT_ERROR(*error_info, CR_CONNECTION_ERROR, UNKNOWN_SQLSTATE, "Unknown errror while connecting");
-		DBG_RETURN(FAIL);
+		DBG_RETURN(NULL);
 	}
 	/*
 	  Streams are not meant for C extensions! Thus we need a hack. Every connected stream will
@@ -136,15 +136,14 @@ MYSQLND_METHOD(mysqlnd_net, open_pipe)(MYSQLND_NET * const net, const char * con
 	zend_hash_index_del(&EG(regular_list), net_stream->rsrc_id);
 	net_stream->in_free = 0;
 
-	(void) net->data->m.set_stream(net, net_stream TSRMLS_CC);
 
-	DBG_RETURN(PASS);
+	DBG_RETURN(net_stream);
 }
 /* }}} */
 
 
 /* {{{ mysqlnd_net::open_tcp_or_unix */
-static enum_func_status
+static php_stream *
 MYSQLND_METHOD(mysqlnd_net, open_tcp_or_unix)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len,
 											  const zend_bool persistent,
 											  MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC)
@@ -191,7 +190,7 @@ MYSQLND_METHOD(mysqlnd_net, open_tcp_or_unix)(MYSQLND_NET * const net, const cha
 			/* no mnd_ since we don't allocate it */
 			efree(errstr);
 		}
-		DBG_RETURN(FAIL);
+		DBG_RETURN(NULL);
 	}
 	if (hashed_details) {
 		/*
@@ -227,8 +226,7 @@ MYSQLND_METHOD(mysqlnd_net, open_tcp_or_unix)(MYSQLND_NET * const net, const cha
 	zend_hash_index_del(&EG(regular_list), net_stream->rsrc_id);
 	net_stream->in_free = 0;
 
-	(void) net->data->m.set_stream(net, net_stream TSRMLS_CC);
-	DBG_RETURN(PASS);
+	DBG_RETURN(net_stream);
 }
 /* }}} */
 
@@ -300,8 +298,11 @@ MYSQLND_METHOD(mysqlnd_net, connect_ex)(MYSQLND_NET * const net, const char * co
 
 	open_stream = net->data->m.get_open_stream(net, scheme, scheme_len, error_info TSRMLS_CC);
 	if (open_stream) {
-		if (PASS == (ret = open_stream(net, scheme, scheme_len, persistent, conn_stats, error_info TSRMLS_CC))) {
+		php_stream * net_stream = open_stream(net, scheme, scheme_len, persistent, conn_stats, error_info TSRMLS_CC);
+		if (net_stream) {
+			(void) net->data->m.set_stream(net, net_stream TSRMLS_CC);
 			net->data->m.post_connect_set_opt(net, scheme, scheme_len, conn_stats, error_info TSRMLS_CC);
+			ret = PASS;
 		}
 	}
 
diff --git a/ext/mysqlnd/mysqlnd_structs.h b/ext/mysqlnd/mysqlnd_structs.h
index 6dcb8b3..b355a0d 100644
--- a/ext/mysqlnd/mysqlnd_structs.h
+++ b/ext/mysqlnd/mysqlnd_structs.h
@@ -283,7 +283,7 @@ typedef enum_func_status	(*func_mysqlnd_net__init)(MYSQLND_NET * const net, MYSQ
 typedef void				(*func_mysqlnd_net__dtor)(MYSQLND_NET * const net, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
 typedef enum_func_status	(*func_mysqlnd_net__connect_ex)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len, const zend_bool persistent, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
 typedef void				(*func_mysqlnd_net__close_stream)(MYSQLND_NET * const net, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
-typedef enum_func_status	(*func_mysqlnd_net__open_stream)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len, const zend_bool persistent, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
+typedef php_stream *		(*func_mysqlnd_net__open_stream)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len, const zend_bool persistent, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
 typedef php_stream *		(*func_mysqlnd_net__get_stream)(const MYSQLND_NET * const net TSRMLS_DC);
 typedef php_stream *		(*func_mysqlnd_net__set_stream)(MYSQLND_NET * const net, php_stream * net_stream TSRMLS_DC);
 typedef func_mysqlnd_net__open_stream (*func_mysqlnd_net__get_open_stream)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);


commit 68536a41672ead2d2872af01af4d4167c47366c0
Author: andrey <andrey at php.net>
Date:   Mon May 7 13:55:40 2012 +0200

    comment for the #else

diff --git a/ext/mysqlnd/mysqlnd_debug.h b/ext/mysqlnd/mysqlnd_debug.h
index d805178..3372e73 100644
--- a/ext/mysqlnd/mysqlnd_debug.h
+++ b/ext/mysqlnd/mysqlnd_debug.h
@@ -141,7 +141,7 @@ PHPAPI char * mysqlnd_get_backtrace(uint max_levels, size_t * length TSRMLS_DC);
 
 
 
-#else
+#else  /* defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 1400)) */
 static inline void DBG_INF_EX(MYSQLND_DEBUG * dbg_obj, const char * const msg) {}
 static inline void DBG_ERR_EX(MYSQLND_DEBUG * dbg_obj, const char * const msg) {}
 static inline void DBG_INF_FMT_EX(MYSQLND_DEBUG * dbg_obj, ...) {}


commit 9927cc5f4b0e626e601d542b0b50e82c54650ac8
Merge: ec15908 692cc97
Author: andrey <andrey at php.net>
Date:   Mon May 7 13:32:05 2012 +0200

    Merge branch 'master' of git.php.net:php-src



commit ec159081a0fcdad31a3f8450d00128229683bf14
Author: andrey <andrey at php.net>
Date:   Mon May 7 13:31:42 2012 +0200

    reorganize things a bit...just shifting code

diff --git a/ext/mysqlnd/mysqlnd_net.c b/ext/mysqlnd/mysqlnd_net.c
index 3f332ae..b2fe662 100644
--- a/ext/mysqlnd/mysqlnd_net.c
+++ b/ext/mysqlnd/mysqlnd_net.c
@@ -266,8 +266,15 @@ MYSQLND_METHOD(mysqlnd_net, get_open_stream)(MYSQLND_NET * const net, const char
 {
 	func_mysqlnd_net__open_stream ret = NULL;
 	DBG_ENTER("mysqlnd_net::get_open_stream");
-	ret = (scheme_len > (sizeof("pipe://") - 1) && !memcmp(scheme, "pipe://", sizeof("pipe://") - 1))? net->data->m.open_pipe:
-																									   net->data->m.open_tcp_or_unix;
+	if (scheme_len > (sizeof("pipe://") - 1) && !memcmp(scheme, "pipe://", sizeof("pipe://") - 1)) {
+		ret = net->data->m.open_pipe;
+	} else if ((scheme_len > (sizeof("tcp://") - 1) && !memcmp(scheme, "tcp://", sizeof("tcp://") - 1))
+				||
+				(scheme_len > (sizeof("unix://") - 1) && !memcmp(scheme, "unix://", sizeof("unix://") - 1)))
+	{
+		ret = net->data->m.open_tcp_or_unix;
+	}
+
 	if (!ret) {
 		SET_CLIENT_ERROR(*error_info, CR_CONNECTION_ERROR, UNKNOWN_SQLSTATE, "No handler for this scheme");
 	}	
@@ -514,7 +521,7 @@ MYSQLND_METHOD(mysqlnd_net, read_compressed_packet_from_stream_and_fill_read_buf
 		(MYSQLND_NET * net, size_t net_payload_size, MYSQLND_STATS * conn_stats, MYSQLND_ERROR_INFO * error_info TSRMLS_DC)
 {
 	size_t decompressed_size;
-	enum_func_status ret = PASS;
+	enum_func_status retval = PASS;
 	zend_uchar * compressed_data = NULL;
 	zend_uchar comp_header[COMPRESSED_HEADER_SIZE];
 	DBG_ENTER("mysqlnd_net::read_compressed_packet_from_stream_and_fill_read_buffe");
@@ -531,19 +538,19 @@ MYSQLND_METHOD(mysqlnd_net, read_compressed_packet_from_stream_and_fill_read_buf
 	if (decompressed_size) {
 		compressed_data = mnd_emalloc(net_payload_size);
 		if (FAIL == net->data->m.network_read_ex(net, compressed_data, net_payload_size, conn_stats, error_info TSRMLS_CC)) {
-			ret = FAIL;
+			retval = FAIL;
 			goto end;
 		}
 		net->uncompressed_data = mysqlnd_create_read_buffer(decompressed_size TSRMLS_CC);
-		ret = net->data->m.decode(net->uncompressed_data->data, decompressed_size, compressed_data, net_payload_size TSRMLS_CC);
-		if (ret == FAIL) {
+		retval = net->data->m.decode(net->uncompressed_data->data, decompressed_size, compressed_data, net_payload_size TSRMLS_CC);
+		if (FAIL == retval) {
 			goto end;
 		}
 	} else {
 		DBG_INF_FMT("The server decided not to compress the data. Our job is easy. Copying %u bytes", net_payload_size);
 		net->uncompressed_data = mysqlnd_create_read_buffer(net_payload_size TSRMLS_CC);
 		if (FAIL == net->data->m.network_read_ex(net, net->uncompressed_data->data, net_payload_size, conn_stats, error_info TSRMLS_CC)) {
-			ret = FAIL;
+			retval = FAIL;
 			goto end;
 		}
 	}
@@ -551,7 +558,7 @@ end:
 	if (compressed_data) {
 		mnd_efree(compressed_data);
 	}
-	DBG_RETURN(ret);
+	DBG_RETURN(retval);
 }
 /* }}} */
 #endif /* MYSQLND_COMPRESSION_ENABLED */
@@ -909,6 +916,7 @@ MYSQLND_METHOD(mysqlnd_net, enable_ssl)(MYSQLND_NET * const net TSRMLS_DC)
 	DBG_RETURN(PASS);
 #else
 	DBG_ENTER("mysqlnd_net::enable_ssl");
+	DBG_INFO("MYSQLND_SSL_SUPPORTED is not defined");
 	DBG_RETURN(PASS);
 #endif
 }
@@ -1069,8 +1077,9 @@ MYSQLND_CLASS_METHODS_START(mysqlnd_net)
 	MYSQLND_METHOD(mysqlnd_net, close_stream),
 	MYSQLND_METHOD(mysqlnd_net, open_pipe),
 	MYSQLND_METHOD(mysqlnd_net, open_tcp_or_unix),
-	NULL, /* unused 1 */
-	NULL, /* unused 2 */
+	MYSQLND_METHOD(mysqlnd_net, get_stream),
+	MYSQLND_METHOD(mysqlnd_net, set_stream),
+	MYSQLND_METHOD(mysqlnd_net, get_open_stream),
 	MYSQLND_METHOD(mysqlnd_net, post_connect_set_opt),
 	MYSQLND_METHOD(mysqlnd_net, set_client_option),
 	MYSQLND_METHOD(mysqlnd_net, decode),
@@ -1088,9 +1097,11 @@ MYSQLND_CLASS_METHODS_START(mysqlnd_net)
 #else
 	NULL,
 #endif
-	MYSQLND_METHOD(mysqlnd_net, get_stream),
-	MYSQLND_METHOD(mysqlnd_net, set_stream),
-	MYSQLND_METHOD(mysqlnd_net, get_open_stream)
+	NULL, /* unused 1 */
+	NULL, /* unused 2 */
+	NULL, /* unused 3 */
+	NULL, /* unused 4 */
+	NULL  /* unused 5 */
 MYSQLND_CLASS_METHODS_END;
 
 
diff --git a/ext/mysqlnd/mysqlnd_structs.h b/ext/mysqlnd/mysqlnd_structs.h
index 7b8386a..6dcb8b3 100644
--- a/ext/mysqlnd/mysqlnd_structs.h
+++ b/ext/mysqlnd/mysqlnd_structs.h
@@ -284,11 +284,11 @@ typedef void				(*func_mysqlnd_net__dtor)(MYSQLND_NET * const net, MYSQLND_STATS
 typedef enum_func_status	(*func_mysqlnd_net__connect_ex)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len, const zend_bool persistent, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
 typedef void				(*func_mysqlnd_net__close_stream)(MYSQLND_NET * const net, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
 typedef enum_func_status	(*func_mysqlnd_net__open_stream)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len, const zend_bool persistent, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
-typedef void				(*func_mysqlnd_net__post_connect_set_opt)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
-typedef enum_func_status	(*func_mysqlnd_net__read_compressed_packet_from_stream_and_fill_read_buffer)(MYSQLND_NET * net, size_t net_payload_size, MYSQLND_STATS * conn_stats, MYSQLND_ERROR_INFO * error_info TSRMLS_DC);
 typedef php_stream *		(*func_mysqlnd_net__get_stream)(const MYSQLND_NET * const net TSRMLS_DC);
 typedef php_stream *		(*func_mysqlnd_net__set_stream)(MYSQLND_NET * const net, php_stream * net_stream TSRMLS_DC);
 typedef func_mysqlnd_net__open_stream (*func_mysqlnd_net__get_open_stream)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
+typedef void				(*func_mysqlnd_net__post_connect_set_opt)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
+typedef enum_func_status	(*func_mysqlnd_net__read_compressed_packet_from_stream_and_fill_read_buffer)(MYSQLND_NET * net, size_t net_payload_size, MYSQLND_STATS * conn_stats, MYSQLND_ERROR_INFO * error_info TSRMLS_DC);
 
 struct st_mysqlnd_net_methods
 {
@@ -299,8 +299,10 @@ struct st_mysqlnd_net_methods
 	func_mysqlnd_net__open_stream open_pipe;
 	func_mysqlnd_net__open_stream open_tcp_or_unix;
 
-	void * unused1;
-	void * unused2;
+	func_mysqlnd_net__get_stream get_stream;
+	func_mysqlnd_net__set_stream set_stream;
+	func_mysqlnd_net__get_open_stream get_open_stream;
+
 	func_mysqlnd_net__post_connect_set_opt post_connect_set_opt;
 
 	func_mysqlnd_net__set_client_option set_client_option;
@@ -318,11 +320,11 @@ struct st_mysqlnd_net_methods
 
 	func_mysqlnd_net__read_compressed_packet_from_stream_and_fill_read_buffer read_compressed_packet_from_stream_and_fill_read_buffer;
 
-	func_mysqlnd_net__get_stream get_stream;
-	func_mysqlnd_net__set_stream set_stream;
-	func_mysqlnd_net__get_open_stream get_open_stream;
-	void * unused6;
-	void * unused7;
+	void * unused1;
+	void * unused2;
+	void * unused3;
+	void * unused4;
+	void * unused5;
 };
 
 


commit 692cc976ca6860400a0538835d5be8249eaf8f60
Merge: 067fad1 87a011d
Author: Anatoliy Belsky <ab at php.net>
Date:   Sun May 6 18:06:12 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug 61769 Random failure of php_cli_server*phpt tests



commit 87a011d3723aa9500e12a3f982df6b1f5cdfaedd
Author: Matt Ficken <mattficken at php.net>
Date:   Sun May 6 18:05:02 2012 +0200

    Fix bug 61769 Random failure of php_cli_server*phpt tests

diff --git a/sapi/cli/tests/php_cli_server.inc b/sapi/cli/tests/php_cli_server.inc
index 44ee76e..d24a679 100644
--- a/sapi/cli/tests/php_cli_server.inc
+++ b/sapi/cli/tests/php_cli_server.inc
@@ -1,5 +1,7 @@
 <?php
-define ("PHP_CLI_SERVER_ADDRESS", "localhost:8964");
+define ("PHP_CLI_SERVER_HOSTNAME", "localhost");
+define ("PHP_CLI_SERVER_PORT", 8964);
+define ("PHP_CLI_SERVER_ADDRESS", PHP_CLI_SERVER_HOSTNAME.":".PHP_CLI_SERVER_PORT);
 
 function php_cli_server_start($code = 'echo "Hello world";', $no_router = FALSE) {
 	$php_executable = getenv('TEST_PHP_EXECUTABLE');
@@ -32,6 +34,19 @@ function php_cli_server_start($code = 'echo "Hello world";', $no_router = FALSE)
 
 		$handle = proc_open($cmd, $descriptorspec, $pipes, $doc_root);
 	}
+	
+	// note: even when server prints 'Listening on localhost:8964...Press Ctrl-C to quit.'
+	//       it might not be listening yet...need to wait until fsockopen() call returns
+	$fp = fsockopen(PHP_CLI_SERVER_HOSTNAME, PHP_CLI_SERVER_PORT);
+	if ($fp) {
+		// server will report Unexpected EOF error (socket opened, closed without writing
+		// anything) but that can be ignored
+		fclose($fp);
+	} else {
+		// test will fail to connect if server doesn't start listening/accepting
+		// in the next few microseconds
+	}
+
 
 	register_shutdown_function(
 		function($handle) use($router) {
@@ -40,7 +55,11 @@ function php_cli_server_start($code = 'echo "Hello world";', $no_router = FALSE)
 		},
 			$handle
 		);
-	usleep(50000);
+	// don't bother sleeping, server is already up
+	//usleep(50000);
+	// server can take a variable amount of time to be up, so just sleeping a guessed amount of time
+	// does not work. this is why tests sometimes pass and sometimes fail. to get a reliable pass
+	// sleeping doesn't work.
 }
 ?>
 
diff --git a/sapi/cli/tests/php_cli_server_014.phpt b/sapi/cli/tests/php_cli_server_014.phpt
index 4b56caa..2eca870 100644
--- a/sapi/cli/tests/php_cli_server_014.phpt
+++ b/sapi/cli/tests/php_cli_server_014.phpt
@@ -13,6 +13,10 @@ list($host, $port) = explode(':', PHP_CLI_SERVER_ADDRESS);
 $port = intval($port)?:80;
 $output = '';
 
+// note: select() on Windows (& some other platforms) has historical issues with
+//       timeouts less than 1000 millis(0.5). it may be better to increase these
+//       timeouts to 1000 millis(1.0) (fsockopen eventually calls select()).
+//       see articles like: http://support.microsoft.com/kb/257821
 $fp = fsockopen($host, $port, $errno, $errstr, 0.5);
 if (!$fp) {
   die("connect failed");


commit 067fad1b52e0db5914c1a2ce12e4fecfbe95320c
Merge: 5ad35d6 ad3a42c
Author: Xinchen Hui <laruence at php.net>
Date:   Sun May 6 20:37:33 2012 +0800

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      correct variable name



commit ad3a42c26c185d47aee8e69aad255c8824af4ded
Author: Xinchen Hui <laruence at php.net>
Date:   Sun May 6 20:37:03 2012 +0800

    correct variable name

diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c
index a3ed390..0850425 100644
--- a/sapi/cli/php_cli_server.c
+++ b/sapi/cli/php_cli_server.c
@@ -1285,8 +1285,8 @@ static void php_cli_server_request_translate_vpath(php_cli_server_request *reque
 	struct stat sb;
 	static const char *index_files[] = { "index.php", "index.html", NULL };
 	char *buf = safe_pemalloc(1, request->vpath_len, 1 + document_root_len + 1 + sizeof("index.html"), 1);
-	char *p = buf, *prev_patch = 0, *q, *vpath;
-	size_t prev_patch_len;
+	char *p = buf, *prev_path = NULL, *q, *vpath;
+	size_t prev_path_len;
 	int  is_static_file = 0;
 
 	if (!buf) {
@@ -1335,8 +1335,8 @@ static void php_cli_server_request_translate_vpath(php_cli_server_request *reque
 					file++;
 				}
 				if (!*file || is_static_file) {
-					if (prev_patch) {
-						pefree(prev_patch, 1);
+					if (prev_path) {
+						pefree(prev_path, 1);
 					}
 					pefree(buf, 1);
 					return;
@@ -1344,25 +1344,25 @@ static void php_cli_server_request_translate_vpath(php_cli_server_request *reque
 			}
 			break; /* regular file */
 		} 
-		if (prev_patch) {
-			pefree(prev_patch, 1);
+		if (prev_path) {
+			pefree(prev_path, 1);
 			*q = DEFAULT_SLASH;
 		}
 		while (q > buf && *(--q) != DEFAULT_SLASH);
-		prev_patch_len = p - q;
-		prev_patch = pestrndup(q, prev_patch_len, 1);
+		prev_path_len = p - q;
+		prev_path = pestrndup(q, prev_path_len, 1);
 		*q = '\0';
 	}
-	if (prev_patch) {
-		request->path_info_len = prev_patch_len;
+	if (prev_path) {
+		request->path_info_len = prev_path_len;
 #ifdef PHP_WIN32
-		while (prev_patch_len--) {
-			if (prev_patch[prev_patch_len] == '\\') {
-				prev_patch[prev_patch_len] = '/';
+		while (prev_pach_len--) {
+			if (prev_path[prev_path_len] == '\\') {
+				prev_path[prev_path_len] = '/';
 			}
 		}
 #endif
-		request->path_info = prev_patch;
+		request->path_info = prev_path;
 		pefree(request->vpath, 1);
 		request->vpath = pestrndup(vpath, q - vpath, 1);
 		request->vpath_len = q - vpath;


commit 5ad35d6c77bb1ac1c98a92f98cb11d2966d80b7b
Merge: 556666c 376635c
Author: Xinchen Hui <laruence at php.net>
Date:   Sun May 6 20:32:33 2012 +0800

    Merge branch 'PHP-5.4'



commit 376635cde8c4646caf8227c7f1d3e059d2817e6a
Merge: 4cceeb2 99076bc
Author: Xinchen Hui <laruence at php.net>
Date:   Sun May 6 20:32:15 2012 +0800

    Merge branch 'PHP-5.3' into PHP-5.4



commit 99076bc24fae6b159c783e4772b0eaf046b5dc2e
Author: Xinchen Hui <laruence at php.net>
Date:   Sun May 6 20:31:40 2012 +0800

    Change the test folder

diff --git a/ext/standard/tests/array/bug61730.phpt b/ext/standard/tests/array/bug61730.phpt
new file mode 100644
index 0000000..0fe9f22
--- /dev/null
+++ b/ext/standard/tests/array/bug61730.phpt
@@ -0,0 +1,37 @@
+--TEST--
+Bug #61730 (Segfault from array_walk modifying an array passed by reference)
+--FILE--
+<?php
+$myArray = array_fill(0, 10, 1);
+
+array_walk(
+    $myArray,
+    function($value, $key) use ($myArray)
+    {
+        reset($myArray);
+    }
+);
+
+array_walk(
+    $myArray,
+    function($value, $key) use (&$myArray)
+    {
+        var_dump($key);
+        unset($myArray[$key]);
+        unset($myArray[$key+1]);
+        unset($myArray[$key+2]);
+    }
+);
+
+
+
+print_r($myArray);
+--EXPECT--
+int(0)
+int(4)
+int(8)
+Array
+(
+    [3] => 1
+    [7] => 1
+)
diff --git a/ext/standard/tests/bug61730.phpt b/ext/standard/tests/bug61730.phpt
deleted file mode 100644
index 0fe9f22..0000000
--- a/ext/standard/tests/bug61730.phpt
+++ /dev/null
@@ -1,37 +0,0 @@
---TEST--
-Bug #61730 (Segfault from array_walk modifying an array passed by reference)
---FILE--
-<?php
-$myArray = array_fill(0, 10, 1);
-
-array_walk(
-    $myArray,
-    function($value, $key) use ($myArray)
-    {
-        reset($myArray);
-    }
-);
-
-array_walk(
-    $myArray,
-    function($value, $key) use (&$myArray)
-    {
-        var_dump($key);
-        unset($myArray[$key]);
-        unset($myArray[$key+1]);
-        unset($myArray[$key+2]);
-    }
-);
-
-
-
-print_r($myArray);
---EXPECT--
-int(0)
-int(4)
-int(8)
-Array
-(
-    [3] => 1
-    [7] => 1
-)


commit 556666cc4ba409a322f053976db0d7df90b2a06c
Merge: 9e1b690 4cceeb2
Author: Xinchen Hui <laruence at php.net>
Date:   Sun May 6 20:29:26 2012 +0800

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fixed bug #61730 (Segfault from array_walk modifying an array passed by reference)



commit 4cceeb25b74eb89ff8d4106d1b195a1c18fc94d8
Merge: bef6111 7ccd594
Author: Xinchen Hui <laruence at php.net>
Date:   Sun May 6 20:06:05 2012 +0800

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fixed bug #61730 (Segfault from array_walk modifying an array passed by reference)

diff --cc NEWS
index 8b82237,c2b10e5..f88bf70
--- a/NEWS
+++ b/NEWS
@@@ -14,18 -11,10 +14,20 @@@ PH
      (Laruence)
  
  - Core:
+   . Fixed bug #61730 (Segfault from array_walk modifying an array passed by
+     reference). (Laruence)
 +  . Fixed bug #61922 (ZTS build doesn't accept zend.script_encoding config).
 +    (Laruence)
    . Fixed missing bound check in iptcparse(). (chris at chiappa.net)
 -  . Fixed bug #61764 ('I' unpacks n as signed if n > 2^31-1 on LP64). (Gustavo)
 +  . Fixed bug #61827 (incorrect \e processing on Windows) (Anatoliy)
 +  . Fixed bug #61761 ('Overriding' a private static method with a different 
 +    signature causes crash). (Laruence)
 +  . Fixed bug #61728 (PHP crash when calling ob_start in request_shutdown 
 +    phase). (Laruence)
 +  . Fixed bug #61660 (bin2hex(hex2bin($data)) != $data). (Nikita Popov)
 +  . Fixed bug #61650 (ini parser crashes when using ${xxxx} ini variables
 +    (without apache2)). (Laruence)
 +  . Fixed bug #61605 (header_remove() does not remove all headers). (Laruence)
    . Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename
      set to null). (Anatoliy)
  


commit 7ccd5943924fd4ad9adcad1fbc547adc79114bff
Author: Xinchen Hui <laruence at php.net>
Date:   Sun May 6 20:01:10 2012 +0800

    Fixed bug #61730 (Segfault from array_walk modifying an array passed by reference)

diff --git a/NEWS b/NEWS
index 0d42b0f..c2b10e5 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,8 @@ PHP                                                                        NEWS
     (Laruence)
 
 - Core:
+  . Fixed bug #61730 (Segfault from array_walk modifying an array passed by
+    reference). (Laruence)
   . Fixed missing bound check in iptcparse(). (chris at chiappa.net)
   . Fixed bug #61764 ('I' unpacks n as signed if n > 2^31-1 on LP64). (Gustavo)
   . Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 9956d00..e804ff8 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -1052,7 +1052,6 @@ static int php_array_walk(HashTable *target_hash, zval *userdata, int recursive
 	char  *string_key;
 	uint   string_key_len;
 	ulong  num_key;
-	HashPosition pos;
 
 	/* Set up known arguments */
 	args[1] = &key;
@@ -1061,15 +1060,14 @@ static int php_array_walk(HashTable *target_hash, zval *userdata, int recursive
 		Z_ADDREF_P(userdata);
 	}
 
-	zend_hash_internal_pointer_reset_ex(target_hash, &pos);
-
 	BG(array_walk_fci).retval_ptr_ptr = &retval_ptr;
 	BG(array_walk_fci).param_count = userdata ? 3 : 2;
 	BG(array_walk_fci).params = args;
 	BG(array_walk_fci).no_separation = 0;
-
+	
 	/* Iterate through hash */
-	while (!EG(exception) && zend_hash_get_current_data_ex(target_hash, (void **)&args[0], &pos) == SUCCESS) {
+	zend_hash_internal_pointer_reset(target_hash);
+	while (!EG(exception) && zend_hash_get_current_data(target_hash, (void **)&args[0]) == SUCCESS) {
 		if (recursive && Z_TYPE_PP(args[0]) == IS_ARRAY) {
 			HashTable *thash;
 			zend_fcall_info orig_array_walk_fci;
@@ -1101,7 +1099,7 @@ static int php_array_walk(HashTable *target_hash, zval *userdata, int recursive
 			MAKE_STD_ZVAL(key);
 
 			/* Set up the key */
-			switch (zend_hash_get_current_key_ex(target_hash, &string_key, &string_key_len, &num_key, 0, &pos)) {
+			switch (zend_hash_get_current_key_ex(target_hash, &string_key, &string_key_len, &num_key, 0, NULL)) {
 				case HASH_KEY_IS_LONG:
 					Z_TYPE_P(key) = IS_LONG;
 					Z_LVAL_P(key) = num_key;
@@ -1129,7 +1127,7 @@ static int php_array_walk(HashTable *target_hash, zval *userdata, int recursive
 			zval_ptr_dtor(&key);
 			key = NULL;
 		}
-		zend_hash_move_forward_ex(target_hash, &pos);
+		zend_hash_move_forward(target_hash);
 	}
 
 	if (userdata) {
diff --git a/ext/standard/tests/bug61730.phpt b/ext/standard/tests/bug61730.phpt
new file mode 100644
index 0000000..0fe9f22
--- /dev/null
+++ b/ext/standard/tests/bug61730.phpt
@@ -0,0 +1,37 @@
+--TEST--
+Bug #61730 (Segfault from array_walk modifying an array passed by reference)
+--FILE--
+<?php
+$myArray = array_fill(0, 10, 1);
+
+array_walk(
+    $myArray,
+    function($value, $key) use ($myArray)
+    {
+        reset($myArray);
+    }
+);
+
+array_walk(
+    $myArray,
+    function($value, $key) use (&$myArray)
+    {
+        var_dump($key);
+        unset($myArray[$key]);
+        unset($myArray[$key+1]);
+        unset($myArray[$key+2]);
+    }
+);
+
+
+
+print_r($myArray);
+--EXPECT--
+int(0)
+int(4)
+int(8)
+Array
+(
+    [3] => 1
+    [7] => 1
+)


commit 9e1b690e0ce4b29416bd9f514a660d12e993aeab
Merge: 71e7c85 bef6111
Author: Nikita Popov <nikic at php.net>
Date:   Sun May 6 13:40:06 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Add NEWS entry for bug #61961
      Fixed Bug #61961 (file_get_content leaks when access empty file with max length)



commit bef6111609bc05ae99f9392e507a47ae09ef72f9
Merge: 0747b29 304ac56
Author: Nikita Popov <nikic at php.net>
Date:   Sun May 6 13:33:47 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Add NEWS entry for bug #61961
      Fixed Bug #61961 (file_get_content leaks when access empty file with max length)



commit 304ac568c56799e60d90fadad3a936b61cab281b
Author: Nikita Popov <nikic at php.net>
Date:   Sun May 6 13:19:17 2012 +0200

    Add NEWS entry for bug #61961

diff --git a/NEWS b/NEWS
index 5dee737..0d42b0f 100644
--- a/NEWS
+++ b/NEWS
@@ -34,6 +34,10 @@ PHP                                                                        NEWS
     library. See https://bugs.gentoo.org/show_bug.cgi?id=364139 for detail.
     (Moriyoshi)
 
+- Streams:
+  . Fixed bug #61961 (file_get_contents leaks when access empty file with
+    maxlen set). (Reeze)
+
 (merge after 5.3.11 release)
 
 - Core:


commit 311ee8f69c9c91b78b35a787a5dbfdb34403753e
Merge: 4632fe0 3e9923d
Author: Nikita Popov <nikic at php.net>
Date:   Sun May 6 12:45:45 2012 +0200

    Merge branch 'pull-request/76' into PHP-5.3



commit 3e9923dd8d08f88740f58e54386c0f7c569a5aa6
Author: Reeze Xia <reeze.xia at gmail.com>
Date:   Sun May 6 18:27:26 2012 +0800

    Fixed Bug #61961 (file_get_content leaks when access empty file with max length)

diff --git a/ext/standard/tests/file/bug61961.phpt b/ext/standard/tests/file/bug61961.phpt
new file mode 100644
index 0000000..ff0279a
--- /dev/null
+++ b/ext/standard/tests/file/bug61961.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Bug #61961 (file_get_content leaks when access empty file with max length)
+--FILE--
+<?php
+$tmp_empty_file = __FILE__ . ".tmp";
+file_put_contents($tmp_empty_file, "");
+
+var_dump(file_get_contents($tmp_empty_file, NULL, NULL, NULL, 10));
+unlink($tmp_empty_file);
+?>
+==DONE==
+--EXPECT--
+string(0) ""
+==DONE==
\ No newline at end of file
diff --git a/main/streams/streams.c b/main/streams/streams.c
index 116c0aa..fe7800b 100755
--- a/main/streams/streams.c
+++ b/main/streams/streams.c
@@ -1366,7 +1366,12 @@ PHPAPI size_t _php_stream_copy_to_mem(php_stream *src, char **buf, size_t maxlen
 			len += ret;
 			ptr += ret;
 		}
-		*ptr = '\0';
+		if (len) {
+			*ptr = '\0';
+		} else {
+			pefree(*buf, persistent);
+			*buf = NULL;
+		}
 		return len;
 	}
 


commit 71e7c854b15db08c7bd9355791f859b5cea6e490
Merge: d3a13c2 0747b29
Author: Xinchen Hui <laruence at php.net>
Date:   Sun May 6 00:53:47 2012 +0800

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      correct NEWS
      Fixed bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction)
      Fixed bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction)



commit 0747b29bdf43be0682d10bdfc788f12f19ccf443
Merge: 19632ae 4632fe0
Author: Xinchen Hui <laruence at php.net>
Date:   Sun May 6 00:52:51 2012 +0800

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      correct NEWS
      Fixed bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction)
    
    Conflicts:
    	ext/curl/interface.c



commit 4632fe0eefb749da5c6bfdf22beaf2ffa80c3a56
Author: Xinchen Hui <laruence at php.net>
Date:   Sun May 6 00:51:20 2012 +0800

    correct NEWS

diff --git a/NEWS b/NEWS
index e4bc495..5dee737 100644
--- a/NEWS
+++ b/NEWS
@@ -6,7 +6,7 @@ PHP                                                                        NEWS
   . Fixed bug #61546 (functions related to current script failed when chdir() 
     in cli sapi). (Laruence, reeze.xia at gmail.com)
 
-- CURL
+- CURL:
   . Fixed bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction).
     (Laruence)
 


commit 19632ae7dcdbbb7c34bf0ffde9fb7858f55424cd
Author: Xinchen Hui <laruence at php.net>
Date:   Sun May 6 00:50:37 2012 +0800

    Fixed bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction)

diff --git a/NEWS b/NEWS
index 9ef6abf..8b82237 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,10 @@ PHP                                                                        NEWS
     bug #61785 (Memory leak when access a non-exists file without router).
     (Laruence)
 
+- CURL:
+  . Fixed bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction).
+    (Laruence)
+
 - Core:
   . Fixed bug #61922 (ZTS build doesn't accept zend.script_encoding config).
     (Laruence)
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index b359952..b03f346 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -2177,7 +2177,7 @@ string_copy:
 
 			convert_to_string_ex(zvalue);
 
-			if (php_check_open_basedir(Z_STRVAL_PP(zvalue) TSRMLS_CC)) {
+			if (!Z_STRLEN_PP(zvalue) || php_check_open_basedir(Z_STRVAL_PP(zvalue) TSRMLS_CC)) {
 				RETVAL_FALSE;
 				return 1;
 			}


commit 035ce937e13d8496795cef9899cc5c5afe9daab7
Author: Xinchen Hui <laruence at php.net>
Date:   Sun May 6 00:40:49 2012 +0800

    Fixed bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction)

diff --git a/NEWS b/NEWS
index 7bb6cc0..e4bc495 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,10 @@ PHP                                                                        NEWS
   . Fixed bug #61546 (functions related to current script failed when chdir() 
     in cli sapi). (Laruence, reeze.xia at gmail.com)
 
+- CURL
+  . Fixed bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction).
+    (Laruence)
+
 - Core:
   . Fixed missing bound check in iptcparse(). (chris at chiappa.net)
   . Fixed bug #61764 ('I' unpacks n as signed if n > 2^31-1 on LP64). (Gustavo)
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index 66aafc0..270a7dd 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -2167,7 +2167,7 @@ string_copy:
 
 			convert_to_string_ex(zvalue);
 
-			if (php_check_open_basedir(Z_STRVAL_PP(zvalue) TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(Z_STRVAL_PP(zvalue), "rb+", CHECKUID_CHECK_MODE_PARAM))) {
+			if (!Z_STRLEN_PP(zvalue) || php_check_open_basedir(Z_STRVAL_PP(zvalue) TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(Z_STRVAL_PP(zvalue), "rb+", CHECKUID_CHECK_MODE_PARAM))) {
 				RETVAL_FALSE;
 				return 1;
 			}
diff --git a/ext/curl/tests/bug61948.phpt b/ext/curl/tests/bug61948.phpt
new file mode 100644
index 0000000..a03fc3b
--- /dev/null
+++ b/ext/curl/tests/bug61948.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction)
+--SKIPIF--
+<?php if (!extension_loaded("curl")) print "skip"; ?>
+--INI--
+open_basedir="/tmp"
+--FILE--
+<?php
+  $ch = curl_init();
+  var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, ""));
+  var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/foo"));
+  var_dump(curl_setopt($ch, CURLOPT_COOKIEFILE, "/xxx/bar"));
+  curl_close($ch);
+?>
+--EXPECTF--
+bool(false)
+bool(true)
+
+Warning: curl_setopt(): open_basedir restriction in effect. File(/xxx/bar) is not within the allowed path(s): (/tmp) in %sbug61948.php on line %d
+bool(false)


commit d3a13c2a108fd9edbab93dc4656979c6ccaff1fb
Merge: 56ac0e7 948ab62
Author: David Soria Parra <dsp at php.net>
Date:   Sat May 5 17:37:35 2012 +0200

    Merge branch 'PHP-5.4'
    
    By Rasmus Lerdorf
    * PHP-5.4:
      Fix for CVE-2012-1823 (cherry picked from commit 29300b1f9dab068d477b241d8fd872e3a7c829b3)
      Fix for CVE-2012-1823



commit 948ab62c253de1460ca91874cb209961cad7bdd9
Merge: 0556103 168e892
Author: David Soria Parra <dsp at php.net>
Date:   Sat May 5 17:36:55 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    By Rasmus Lerdorf
    * PHP-5.3:
      Fix for CVE-2012-1823 (cherry picked from commit 29300b1f9dab068d477b241d8fd872e3a7c829b3)



commit 168e8920be77f3b55a3ae688270b752579681f6e
Author: Rasmus Lerdorf <rasmus at php.net>
Date:   Thu May 3 15:51:52 2012 +0200

    Fix for CVE-2012-1823
    (cherry picked from commit 29300b1f9dab068d477b241d8fd872e3a7c829b3)

diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 56c736f..760ad66 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -70,6 +70,7 @@
 #include "php_main.h"
 #include "fopen_wrappers.h"
 #include "ext/standard/php_standard.h"
+#include "ext/standard/url.h"
 
 #ifdef PHP_WIN32
 # include <io.h>
@@ -1508,6 +1509,9 @@ int main(int argc, char *argv[])
 #ifndef PHP_WIN32
 	int status = 0;
 #endif
+	char *query_string;
+	char *decoded_query_string;
+	int skip_getopt = 0;
 
 #if 0 && defined(PHP_DEBUG)
 	/* IIS is always making things more difficult.  This allows
@@ -1557,7 +1561,16 @@ int main(int argc, char *argv[])
 		}
 	}
 
-	while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0, 2)) != -1) {
+	if(query_string = getenv("QUERY_STRING")) {
+		decoded_query_string = strdup(query_string);
+		php_url_decode(decoded_query_string, strlen(decoded_query_string));
+		if(*decoded_query_string == '-' && strchr(decoded_query_string, '=') == NULL) {
+			skip_getopt = 1;
+		}
+		free(decoded_query_string);
+	}
+
+	while (!skip_getopt && (c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0, 2)) != -1) {
 		switch (c) {
 			case 'c':
 				if (cgi_sapi_module.php_ini_path_override) {


commit 0556103f6a347308351436897b3b632450504dd0
Author: Rasmus Lerdorf <rasmus at php.net>
Date:   Thu May 3 15:51:52 2012 +0200

    Fix for CVE-2012-1823

diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index d9c3181..5c1c55e 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -70,6 +70,7 @@
 #include "php_main.h"
 #include "fopen_wrappers.h"
 #include "ext/standard/php_standard.h"
+#include "ext/standard/url.h"
 
 #ifdef PHP_WIN32
 # include <io.h>
@@ -1753,6 +1754,9 @@ int main(int argc, char *argv[])
 #ifndef PHP_WIN32
 	int status = 0;
 #endif
+	char *query_string;
+	char *decoded_query_string;
+	int skip_getopt = 0;
 
 #if 0 && defined(PHP_DEBUG)
 	/* IIS is always making things more difficult.  This allows
@@ -1803,7 +1807,16 @@ int main(int argc, char *argv[])
 		}
 	}
 
-	while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0, 2)) != -1) {
+	if(query_string = getenv("QUERY_STRING")) {
+		decoded_query_string = strdup(query_string);
+		php_url_decode(decoded_query_string, strlen(decoded_query_string));
+		if(*decoded_query_string == '-' && strchr(decoded_query_string, '=') == NULL) {
+			skip_getopt = 1;
+		}
+		free(decoded_query_string);
+	}
+
+	while (!skip_getopt && (c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0, 2)) != -1) {
 		switch (c) {
 			case 'c':
 				if (cgi_sapi_module.php_ini_path_override) {


commit 56ac0e71bbcc593dd3893b7986e51698bc18e38e
Merge: 7388c08 f5936cc
Author: Anatoliy Belsky <ab at php.net>
Date:   Fri May 4 11:42:28 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug #61906 ext\phar\tests\zip\phar_setsignaturealgo2.phpt fails



commit f5936cceeb26d6094f0e142fcaed510ba5549c4f
Merge: 16fdf86 8a10259
Author: Anatoliy Belsky <ab at php.net>
Date:   Fri May 4 11:42:05 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug #61906 ext\phar\tests\zip\phar_setsignaturealgo2.phpt fails



commit 8a10259642f05b11f5fefa1399605a08957f5e59
Author: Anatoliy Belsky <ab at php.net>
Date:   Fri May 4 11:40:49 2012 +0200

    Fix bug #61906 ext\phar\tests\zip\phar_setsignaturealgo2.phpt fails

diff --git a/ext/phar/tests/zip/phar_setsignaturealgo2.phpt b/ext/phar/tests/zip/phar_setsignaturealgo2.phpt
index 372f7dd..7d3730c 100644
--- a/ext/phar/tests/zip/phar_setsignaturealgo2.phpt
+++ b/ext/phar/tests/zip/phar_setsignaturealgo2.phpt
@@ -49,8 +49,10 @@ var_dump($p->getSignature());
 echo $e->getMessage();
 }
 try {
-$keys=openssl_pkey_new();
-openssl_pkey_export($keys, $privkey);
+$config = dirname(__FILE__) . '/../files/openssl.cnf';
+$config_arg = array('config' => $config);
+$keys=openssl_pkey_new($config_arg);
+openssl_pkey_export($keys, $privkey, NULL, $config_arg);
 $pubkey=openssl_pkey_get_details($keys);
 $p->setSignatureAlgorithm(Phar::OPENSSL, $privkey);
 


commit 7388c085bf6ed2d8b712990f31aa30191e969bde
Merge: 6b16f7c 16fdf86
Author: Anatoliy Belsky <ab at php.net>
Date:   Fri May 4 11:38:43 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug #61904 ext\phar\tests\tar\phar_setsignaturealgo2.phpt
      Bump to next version
    
    Conflicts:
    	configure.in
    	main/php_version.h



commit 16fdf86ea3b4edd22373951aee59a82dc241f62e
Merge: 31ab04e 6c12252
Author: Anatoliy Belsky <ab at php.net>
Date:   Fri May 4 11:32:12 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug #61904 ext\phar\tests\tar\phar_setsignaturealgo2.phpt



commit 6c12252790cdd75bd79335013badc657fd78af1a
Author: Anatoliy Belsky <ab at php.net>
Date:   Fri May 4 11:29:49 2012 +0200

    Fix bug #61904 ext\phar\tests\tar\phar_setsignaturealgo2.phpt

diff --git a/ext/phar/tests/tar/phar_setsignaturealgo2.phpt b/ext/phar/tests/tar/phar_setsignaturealgo2.phpt
index 422ca90..c16e752 100644
--- a/ext/phar/tests/tar/phar_setsignaturealgo2.phpt
+++ b/ext/phar/tests/tar/phar_setsignaturealgo2.phpt
@@ -32,9 +32,11 @@ var_dump($p->getSignature());
 echo $e->getMessage();
 }
 try {
+$config = dirname(__FILE__) . '/../files/openssl.cnf';
+$config_arg = array('config' => $config);
 $private = openssl_get_privatekey(file_get_contents(dirname(dirname(__FILE__)) . '/files/private.pem'));
 $pkey = '';
-openssl_pkey_export($private, $pkey);
+openssl_pkey_export($private, $pkey, NULL, $config_arg);
 $p->setSignatureAlgorithm(Phar::OPENSSL, $pkey);
 var_dump($p->getSignature());
 } catch (Exception $e) {


commit 31ab04ee25bc9d4edfa524c2a11a33f8cbc8d1b6
Merge: 72f19e9 0956c00
Author: Christopher Jones <sixd at php.net>
Date:   Thu May 3 12:22:39 2012 -0700

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Bump to next version
    
    Conflicts:
    	configure.in
    	main/php_version.h

diff --cc configure.in
index edc2455,b257cbb..3d529c6
--- a/configure.in
+++ b/configure.in
@@@ -17,109 -38,10 +17,109 @@@ PHP_CONFIG_NICE(config.nice
  PHP_CANONICAL_HOST_TARGET
  
  AC_CONFIG_HEADER(main/php_config.h)
 +AH_TOP([
 +#if defined(__GNUC__) && __GNUC__ >= 4
 +# define ZEND_API __attribute__ ((visibility("default")))
 +# define ZEND_DLEXPORT __attribute__ ((visibility("default")))
 +#else
 +# define ZEND_API
 +# define ZEND_DLEXPORT
 +#endif
 +
 +#define ZEND_DLIMPORT
 +
 +#undef uint
 +#undef ulong
 +
 +/* Define if you want to enable memory limit support */
 +#define MEMORY_LIMIT 0
 +])
 +AH_BOTTOM([
 +#ifndef ZEND_ACCONFIG_H_NO_C_PROTOS
 +
 +#ifdef HAVE_STDLIB_H
 +# include <stdlib.h>
 +#endif
 +
 +#ifdef HAVE_SYS_TYPES_H
 +# include <sys/types.h>
 +#endif
 +
 +#ifdef HAVE_SYS_SELECT_H
 +#include <sys/select.h>
 +#endif
 +
 +#ifdef HAVE_IEEEFP_H
 +# include <ieeefp.h>
 +#endif
 +
 +#ifdef HAVE_STRING_H
 +# include <string.h>
 +#else
 +# include <strings.h>
 +#endif
 +
 +#if ZEND_BROKEN_SPRINTF
 +int zend_sprintf(char *buffer, const char *format, ...);
 +#else
 +# define zend_sprintf sprintf
 +#endif
 +
 +#include <math.h>
 +
 +/* To enable the is_nan, is_infinite and is_finite PHP functions */
 +#ifdef NETWARE
 +	#define HAVE_ISNAN 1
 +	#define HAVE_ISINF 1
 +	#define HAVE_ISFINITE 1
 +#endif
 +
 +#ifndef zend_isnan
 +#ifdef HAVE_ISNAN
 +#define zend_isnan(a) isnan(a)
 +#elif defined(HAVE_FPCLASS)
 +#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
 +#else
 +#define zend_isnan(a) 0
 +#endif
 +#endif
 +
 +#ifdef HAVE_ISINF
 +#define zend_isinf(a) isinf(a)
 +#elif defined(INFINITY)
 +/* Might not work, but is required by ISO C99 */
 +#define zend_isinf(a) (((a)==INFINITY)?1:0)
 +#elif defined(HAVE_FPCLASS)
 +#define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF))
 +#else
 +#define zend_isinf(a) 0
 +#endif
 +
 +#ifdef HAVE_FINITE
 +#define zend_finite(a) finite(a)
 +#elif defined(HAVE_ISFINITE) || defined(isfinite)
 +#define zend_finite(a) isfinite(a)
 +#elif defined(fpclassify)
 +#define zend_finite(a) ((fpclassify((a))!=FP_INFINITE&&fpclassify((a))!=FP_NAN)?1:0)
 +#else
 +#define zend_finite(a) (zend_isnan(a) ? 0 : zend_isinf(a) ? 0 : 1)
 +#endif
 +
 +#endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */
 +
 +#ifdef NETWARE
 +#ifdef USE_WINSOCK
 +#/*This detection against winsock is of no use*/ undef HAVE_SOCKLEN_T
 +#/*This detection against winsock is of no use*/ undef HAVE_SYS_SOCKET_H
 +#endif
 +#endif
 +
 +#undef PTHREADS
 +])
  
  PHP_MAJOR_VERSION=5
 -PHP_MINOR_VERSION=3
 -PHP_RELEASE_VERSION=13
 +PHP_MINOR_VERSION=4
- PHP_RELEASE_VERSION=2
++PHP_RELEASE_VERSION=3
  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 --cc main/php_version.h
index 13478d1,358c6c0..3e80008
--- a/main/php_version.h
+++ b/main/php_version.h
@@@ -1,8 -1,8 +1,8 @@@
  /* automatically generated by configure */
  /* edit configure.in to change version number */
  #define PHP_MAJOR_VERSION 5
 -#define PHP_MINOR_VERSION 3
 -#define PHP_RELEASE_VERSION 13
 +#define PHP_MINOR_VERSION 4
- #define PHP_RELEASE_VERSION 2
++#define PHP_RELEASE_VERSION 3
  #define PHP_EXTRA_VERSION "-dev"
- #define PHP_VERSION "5.4.2-dev"
- #define PHP_VERSION_ID 50402
 -#define PHP_VERSION "5.3.13-dev"
 -#define PHP_VERSION_ID 50313
++#define PHP_VERSION "5.4.3-dev"
++#define PHP_VERSION_ID 50403


commit 0956c00af999c295c5a13644ec835da8f96ad48d
Author: Christopher Jones <sixd at php.net>
Date:   Thu May 3 12:03:49 2012 -0700

    Bump to next version
    
    Bump PHP version number

diff --git a/configure.in b/configure.in
index f038f87..b257cbb 100644
--- a/configure.in
+++ b/configure.in
@@ -41,7 +41,7 @@ AC_CONFIG_HEADER(main/php_config.h)
 
 PHP_MAJOR_VERSION=5
 PHP_MINOR_VERSION=3
-PHP_RELEASE_VERSION=12
+PHP_RELEASE_VERSION=13
 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/main/php_version.h b/main/php_version.h
index 401ab97..358c6c0 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 3
-#define PHP_RELEASE_VERSION 12
+#define PHP_RELEASE_VERSION 13
 #define PHP_EXTRA_VERSION "-dev"
-#define PHP_VERSION "5.3.12-dev"
-#define PHP_VERSION_ID 50312
+#define PHP_VERSION "5.3.13-dev"
+#define PHP_VERSION_ID 50313


commit 6b16f7cd690ecd9a32723c69d90888401c83914b
Merge: f1f1c5c 72f19e9
Author: Xinchen Hui <laruence at php.net>
Date:   Thu May 3 22:40:51 2012 +0800

    Merge branch 'PHP-5.4'



commit 72f19e9a8bcf5712b24fa333a26616eff19ac1ce
Author: Xinchen Hui <laruence at php.net>
Date:   Thu May 3 22:39:53 2012 +0800

    Fixed bug #61922 (ZTS build doesn't accept zend.script_encoding config)

diff --git a/NEWS b/NEWS
index 8796cf4..9ef6abf 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,8 @@ PHP                                                                        NEWS
     (Laruence)
 
 - Core:
+  . Fixed bug #61922 (ZTS build doesn't accept zend.script_encoding config).
+    (Laruence)
   . Fixed missing bound check in iptcparse(). (chris at chiappa.net)
   . Fixed bug #61827 (incorrect \e processing on Windows) (Anatoliy)
   . Fixed bug #61761 ('Overriding' a private static method with a different 
diff --git a/Zend/zend.c b/Zend/zend.c
index dd299f1..37a1a27 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -781,6 +781,8 @@ void zend_register_standard_ini_entries(TSRMLS_D) /* {{{ */
 void zend_post_startup(TSRMLS_D) /* {{{ */
 {
 #ifdef ZTS
+	zend_encoding **script_encoding_list;
+
 	zend_compiler_globals *compiler_globals = ts_resource(compiler_globals_id);
 	zend_executor_globals *executor_globals = ts_resource(executor_globals_id);
 
@@ -795,7 +797,12 @@ void zend_post_startup(TSRMLS_D) /* {{{ */
 	zend_destroy_rsrc_list(&EG(persistent_list) TSRMLS_CC);
 	free(compiler_globals->function_table);
 	free(compiler_globals->class_table);
-	compiler_globals_ctor(compiler_globals, tsrm_ls);
+	if ((script_encoding_list = (zend_encoding **)compiler_globals->script_encoding_list)) {
+		compiler_globals_ctor(compiler_globals, tsrm_ls);
+		compiler_globals->script_encoding_list = (const zend_encoding **)script_encoding_list;
+	} else {
+		compiler_globals_ctor(compiler_globals, tsrm_ls);
+	}
 	free(EG(zend_constants));
 	executor_globals_ctor(executor_globals, tsrm_ls);
 	global_persistent_list = &EG(persistent_list);


commit f1f1c5c90035c8fc0d8957a1c35ebb4c9df781b6
Merge: 267f691 e022bfe
Author: andrey <andrey at php.net>
Date:   Thu May 3 15:34:24 2012 +0200

    Merge branch 'master' of git.php.net:php-src



commit 267f691a45cc18a819bc2742b87dc7eae91934bc
Author: andrey <andrey at php.net>
Date:   Thu May 3 15:33:47 2012 +0200

    bump mysqlnd versions

diff --git a/ext/mysqlnd/mysqlnd.h b/ext/mysqlnd/mysqlnd.h
index c32ac72..33338cf 100644
--- a/ext/mysqlnd/mysqlnd.h
+++ b/ext/mysqlnd/mysqlnd.h
@@ -22,10 +22,10 @@
 #ifndef MYSQLND_H
 #define MYSQLND_H
 
-#define MYSQLND_VERSION "mysqlnd 5.0.10-dev - 20111026 - $Id$"
-#define MYSQLND_VERSION_ID 50010
+#define MYSQLND_VERSION "mysqlnd 5.0.11-dev - 20120503 - $Id$"
+#define MYSQLND_VERSION_ID 50011
 
-#define MYSQLND_PLUGIN_API_VERSION 1
+#define MYSQLND_PLUGIN_API_VERSION 2
 
 #define MYSQLND_STRING_TO_INT_CONVERSION
 /*


commit e022bfe34a2701d568a2a794a8f8f4432cf798ff
Merge: b850fa1 d74d88f
Author: Xinchen Hui <laruence at php.net>
Date:   Thu May 3 20:00:10 2012 +0800

    Merge remote-tracking branch 'origin/PHP-5.4'
    
    * origin/PHP-5.4:
      Fixed test bug #61892



commit d74d88fbb9c29b1dd5ff05a54b72cf7c9250955c
Author: Xinchen Hui <laruence at php.net>
Date:   Thu May 3 19:56:49 2012 +0800

    Fixed test bug #61892

diff --git a/Zend/tests/gc_029.phpt b/Zend/tests/gc_029.phpt
index 4380534..edd2317 100644
--- a/Zend/tests/gc_029.phpt
+++ b/Zend/tests/gc_029.phpt
@@ -1,5 +1,7 @@
 --TEST--
 GC 029: GC and destructors
+--SKIPIF--
+<?php if (PHP_ZTS) { print "skip only for no-zts build"; }
 --INI--
 zend.enable_gc=1
 --FILE--
diff --git a/Zend/tests/gc_029_zts.phpt b/Zend/tests/gc_029_zts.phpt
new file mode 100644
index 0000000..fc77e1f
--- /dev/null
+++ b/Zend/tests/gc_029_zts.phpt
@@ -0,0 +1,37 @@
+--TEST--
+GC 029: GC and destructors
+--SKIPIF-- 
+<?php if (!PHP_ZTS) { print "skip only for zts build"; }
+--INI--
+zend.enable_gc=1
+--FILE--
+<?php
+class Foo {
+	public $bar;
+	public $x = array(1,2,3);
+	function __destruct() {
+		if ($this->bar !== null) {
+			$this->x = null;
+			unset($this->bar);
+		}
+	}
+}
+class Bar {
+	public $foo;
+        function __destruct() {
+                if ($this->foo !== null) {
+                        unset($this->foo);
+                }
+        }
+
+}
+$foo = new Foo();
+$bar = new Bar();
+$foo->bar = $bar;
+$bar->foo = $foo;
+unset($foo);
+unset($bar);
+var_dump(gc_collect_cycles());
+?>
+--EXPECT--
+int(3)


commit b850fa14e0fc75cc025972ab1582fbf56f9d2770
Author: andrey <andrey at php.net>
Date:   Thu May 3 13:34:26 2012 +0200

    phoenix from the ashes

diff --git a/ext/mysqli/tests/local_infile_tools.inc b/ext/mysqli/tests/local_infile_tools.inc
new file mode 100644
index 0000000..bb9872f
--- /dev/null
+++ b/ext/mysqli/tests/local_infile_tools.inc
@@ -0,0 +1,156 @@
+<?php
+	/* Utility function for mysqli_set_local_infile*.phpt tests */
+	function shutdown_clean($file) {
+		if ($file) {
+			unlink($file);
+		}
+	}
+
+	function check_local_infile_support($link, $engine, $table_name = 'test') {
+
+		if (!$res = mysqli_query($link, 'SHOW VARIABLES LIKE "local_infile"'))
+			return "Cannot check if Server variable 'local_infile' is set to 'ON'";
+
+		$row = mysqli_fetch_assoc($res);
+		mysqli_free_result($res);
+		if ('ON' != $row['Value'])
+			return sprintf("Server variable 'local_infile' seems not set to 'ON', found '%s'", $row['Value']);
+
+		if (!mysqli_query($link, sprintf('DROP TABLE IF EXISTS %s', $table_name))) {
+			return "Failed to drop old test table";
+		}
+
+		if (!mysqli_query($link, $sql = sprintf('CREATE TABLE %s(id INT, label CHAR(1), PRIMARY KEY(id)) ENGINE=%s',
+			$table_name, $engine)))
+			return "Failed to create test table: $sql";
+
+		$file = create_standard_csv(1, false);
+		if (!$file) {
+			mysqli_query($link, sprintf('DROP TABLE IF EXISTS %s', $table_name));
+			return "Cannot create CSV file";
+		}
+
+		if (!@mysqli_query($link, sprintf("LOAD DATA LOCAL INFILE '%s'
+			INTO TABLE %s
+			FIELDS TERMINATED BY ';' OPTIONALLY ENCLOSED BY '\''
+			LINES TERMINATED BY '\n'",
+			mysqli_real_escape_string($link, $file),
+			$table_name))) {
+			  if (1148 == mysqli_errno($link)) {
+				  mysqli_query($link, sprintf('DROP TABLE IF EXISTS %s', $table_name));
+				  return "Cannot test LOAD DATA LOCAL INFILE, [1148] The used command is not allowed with this MySQL version";
+			  } else if ($link->errno) {
+				  return $link->error;
+			  }
+		}
+		mysqli_query($link, sprintf('DROP TABLE IF EXISTS %s', $table_name));
+		return "";
+	}
+
+	function create_standard_csv($offset, $verbose = true) {
+		// create a CVS file
+		$file = tempnam(sys_get_temp_dir(), 'mysqli_test');
+		if (!$fp = fopen($file, 'w')) {
+			if ($verbose)
+				printf("[%03d + 1] Cannot create CVS file '%s'\n", $offset, $file);
+			return NULL;
+		} else {
+			/* Looks ugly? No, handy if you have crashes... */
+			register_shutdown_function("shutdown_clean", $file);
+		}
+
+		if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1)) {
+			if (!fwrite($fp, (binary)"'97';'x';\n") ||
+				!fwrite($fp, (binary)"'98';'y';\n") ||
+				!fwrite($fp, (binary)"99;'z';\n")) {
+				if ($verbose)
+					printf("[%03d + 2] Cannot write CVS file '%s'\n", $offset, $file);
+				return NULL;
+			}
+		} else {
+			if (!fwrite($fp, "97;'x';\n") ||
+				!fwrite($fp, "98;'y';\n") ||
+				!fwrite($fp, "99;'z';\n")) {
+				if ($verbose)
+					printf("[%03d + 3] Cannot write CVS file '%s'\n", $offset, $file);
+				return NULL;
+			}
+		}
+
+		fclose($fp);
+
+		if (!chmod($file, 0644)) {
+			if ($verbose)
+				printf("[%03d + 4] Cannot change the file perms of '%s' from 0600 to 0644, MySQL might not be able to read it\n",
+					$offset, $file);
+			return NULL;
+		}
+		return $file;
+	}
+
+	function try_handler($offset, $link, $file, $handler, $expected = null) {
+
+		if ('default' == $handler) {
+			mysqli_set_local_infile_default($link);
+		} else if (!mysqli_set_local_infile_handler($link, $handler)) {
+			printf("[%03d] Cannot set infile handler to '%s'\n", $offset, $handler);
+			return false;
+		}
+		printf("Callback set to '%s'\n", $handler);
+
+		if (!mysqli_query($link, sprintf("DELETE FROM test"))) {
+			printf("[%03d] Cannot remove records, [%d] %s\n", $offset + 1, mysqli_errno($link), mysqli_error($link));
+			return false;
+		}
+
+		if (!@mysqli_query($link, sprintf("LOAD DATA LOCAL INFILE '%s'
+			INTO TABLE test
+			FIELDS TERMINATED BY ';' OPTIONALLY ENCLOSED BY '\''
+			LINES TERMINATED BY '\n'",
+			mysqli_real_escape_string($link, $file)))) {
+			printf("[%03d] LOAD DATA failed, [%d] %s\n",
+				$offset + 2,
+				mysqli_errno($link), mysqli_error($link));
+		}
+
+		if (!$res = mysqli_query($link, "SELECT id, label FROM test ORDER BY id")) {
+			printf("[%03d] [%d] %s\n", $offset + 3, mysqli_errno($link), mysqli_error($link));
+			return false;
+		}
+
+		if (!is_array($expected))
+			return true;
+
+		foreach ($expected as $k => $values) {
+			if (!$tmp = mysqli_fetch_assoc($res)) {
+				printf("[%03d/%d] [%d] '%s'\n", $offset + 4, $k, mysqli_errno($link), mysqli_error($link));
+				return false;
+			}
+			if ($values['id'] != $tmp['id']) {
+				printf("[%03d/%d] Expecting %s got %s\n",
+					$offset + 5, $k,
+					$values['id'], $tmp['id']);
+					return false;
+			}
+			if ($values['label'] != $tmp['label']) {
+				printf("[%03d/%d] Expecting %s got %s\n",
+					$offset + 6, $k,
+					$values['label'], $tmp['label']);
+					return false;
+			}
+		}
+
+		if ($res && $tmp = mysqli_fetch_assoc($res)) {
+			printf("[%03d] More results than expected!\n", $offset + 7);
+			do {
+				var_dump($tmp);
+			} while ($tmp = mysqli_fetch_assoc($res));
+			return false;
+		}
+
+		if ($res)
+			mysqli_free_result($res);
+
+		return true;
+	}
+?>
\ No newline at end of file


commit 0ce37188cd06d498049d009af3db579ebe0ce298
Author: andrey <andrey at php.net>
Date:   Thu May 3 13:02:34 2012 +0200

    here comes the news

diff --git a/NEWS b/NEWS
index ff5a31d..42c2f83 100644
--- a/NEWS
+++ b/NEWS
@@ -38,6 +38,10 @@ PHP                                                                        NEWS
 	still exists for backward compatibility but is doing nothing). (Pierrick)
   . Fixed bug #54995 (Missing CURLINFO_RESPONSE_CODE support). (Pierrick)
 
+- MySQLi
+  . Dropped support for LOAD DATA LOCAL INFILE handlers when using libmysql.
+    Known for stability problems. (Andrey)
+
 - PCRE:
   . Deprecated the /e modifier
     (https://wiki.php.net/rfc/remove_preg_replace_eval_modifier). (Nikita Popov)


commit e0c7ed91a4e14ff1a166dd46fceaf6ae4af0fd19
Merge: 5225950 604d11e
Author: andrey <andrey at php.net>
Date:   Thu May 3 13:00:17 2012 +0200

    Merge branch 'master' of git.php.net:php-src



commit 522595086b8d654a2fd954977f7f443f2578de22
Author: andrey <andrey at php.net>
Date:   Thu May 3 12:55:03 2012 +0200

    Remove support for local infile handler in mysqli from 5.5
    
    This removes the following functions from the API:
    mysqli_set_local_infile_default()
    mysqli_set_local_infile_handler()
    
    Using these functions is known to be lead to stability problems in
    mysqli. It was only enabled when compiling against libmysql. mysqlnd
    doesn't have this support for local infile. However, with mysqlnd it can
    be emulated by using stream handlers like in:
    
    $c->query("LOAD DATA LOCAL INFILE "http://example.com/import.csv" INTO ...")
    All available protocols, as well as user implemented ones can be added.

diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c
index f18a503..54c9574 100644
--- a/ext/mysqli/mysqli.c
+++ b/ext/mysqli/mysqli.c
@@ -1321,218 +1321,6 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
 }
 /* }}} */
 
-
-#if !defined(MYSQLI_USE_MYSQLND)
-
-#define ALLOC_CALLBACK_ARGS(a, b, c)\
-if (c) {\
-	a = (zval ***)safe_emalloc(c, sizeof(zval **), 0);\
-	for (i = b; i < c; i++) {\
-		a[i] = emalloc(sizeof(zval *));\
-		MAKE_STD_ZVAL(*a[i]);\
-	}\
-}
-
-#define FREE_CALLBACK_ARGS(a, b, c)\
-if (a) {\
-	for (i=b; i < c; i++) {\
-		zval_ptr_dtor(a[i]);\
-		efree(a[i]);\
-	}\
-	efree(a);\
-}
-
-#define LOCAL_INFILE_ERROR_MSG(source,dest)\
-	memset(source, 0, LOCAL_INFILE_ERROR_LEN);\
-	memcpy(source, dest, MIN(strlen(dest), LOCAL_INFILE_ERROR_LEN-1));\
-	php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", dest);
-
-
-/* {{{ php_local_infile_init
- */
-static int php_local_infile_init(void **ptr, const char *filename, void *userdata)
-{
-	mysqli_local_infile			*data;
-	MY_MYSQL					*mysql;
-	php_stream_context			*context = NULL;
-
-	TSRMLS_FETCH();
-
-	/* save pointer to MY_MYSQL structure (userdata) */
-	if (!(*ptr= data= ((mysqli_local_infile *)calloc(1, sizeof(mysqli_local_infile))))) {
-		return 1;
-	}
-
-	if (!(mysql = (MY_MYSQL *)userdata)) {
-		LOCAL_INFILE_ERROR_MSG(data->error_msg, ER(CR_UNKNOWN_ERROR));
-		return 1;
-	}
-
-	/* check open_basedir */
-	if (PG(open_basedir)) {
-		if (php_check_open_basedir_ex(filename, 0 TSRMLS_CC) == -1) {
-			LOCAL_INFILE_ERROR_MSG(data->error_msg, "open_basedir restriction in effect. Unable to open file");
-			return 1;
-		}
-	}
-
-	mysql->li_stream = php_stream_open_wrapper_ex((char *)filename, "r", 0, NULL, context);
-
-	if (mysql->li_stream == NULL) {
-		snprintf((char *)data->error_msg, sizeof(data->error_msg), "Can't find file '%-.64s'.", filename);
-		return 1;
-	}
-
-	data->userdata = mysql;
-
-	return 0;
-}
-/* }}} */
-
-/* {{{ int php_local_infile_read */
-static int php_local_infile_read(void *ptr, char *buf, uint buf_len)
-{
-	mysqli_local_infile			*data;
-	MY_MYSQL					*mysql;
-	zval						***callback_args;
-	zval						*retval;
-	zval						*fp;
-	int							argc = 4;
-	int							i;
-	long						rc;
-
-	TSRMLS_FETCH();
-
-	data= (mysqli_local_infile *)ptr;
-	mysql = data->userdata;
-
-	/* default processing */
-	if (!mysql->li_read) {
-		int count = (int)php_stream_read(mysql->li_stream, buf, buf_len);
-
-		if (count < 0) {
-			LOCAL_INFILE_ERROR_MSG(data->error_msg, ER(2));
-		}
-
-		return count;
-	}
-
-	ALLOC_CALLBACK_ARGS(callback_args, 1, argc);
-
-	/* set parameters: filepointer, buffer, buffer_len, errormsg */
-
-	MAKE_STD_ZVAL(fp);
-	php_stream_to_zval(mysql->li_stream, fp);
-	callback_args[0] = &fp;
-	ZVAL_STRING(*callback_args[1], "", 1);
-	ZVAL_LONG(*callback_args[2], buf_len);
-	ZVAL_STRING(*callback_args[3], "", 1);
-
-	if (call_user_function_ex(EG(function_table),
-						NULL,
-						mysql->li_read,
-						&retval,
-						argc,
-						callback_args,
-						0,
-						NULL TSRMLS_CC) == SUCCESS) {
-
-		rc = Z_LVAL_P(retval);
-		zval_ptr_dtor(&retval);
-
-		if (rc > 0) {
-			if (rc >= 0 && rc != Z_STRLEN_P(*callback_args[1])) {
-				LOCAL_INFILE_ERROR_MSG(data->error_msg,
-							"Mismatch between the return value of the callback and the content "
-							"length of the buffer.");
-				rc = -1;
-			} else if (rc > buf_len) {
-				/* check buffer overflow */
-				LOCAL_INFILE_ERROR_MSG(data->error_msg, "Too much data returned");
-				rc = -1;
-			} else {
-				memcpy(buf, Z_STRVAL_P(*callback_args[1]), MIN(rc, Z_STRLEN_P(*callback_args[1])));
-			}
-		} else if (rc < 0) {
-			LOCAL_INFILE_ERROR_MSG(data->error_msg, Z_STRVAL_P(*callback_args[3]));
-		}
-	} else {
-		LOCAL_INFILE_ERROR_MSG(data->error_msg, "Can't execute load data local init callback function");
-		rc = -1;
-	}
-	/*
-	  If the (ab)user has closed the file handle we should
-	  not try to use it anymore or even close it
-	*/
-	if (!zend_rsrc_list_get_rsrc_type(Z_LVAL_P(fp) TSRMLS_CC)) {
-		LOCAL_INFILE_ERROR_MSG(data->error_msg, "File handle closed");
-		rc = -1;
-		/* Thus the end handler won't try to free already freed memory */
-		mysql->li_stream = NULL;
-	}
-
-	FREE_CALLBACK_ARGS(callback_args, 1, argc);
-	efree(fp);
-	return rc;
-}
-/* }}} */
-
-/* {{{ php_local_infile_error
- */
-static int php_local_infile_error(void *ptr, char *error_msg, uint error_msg_len)
-{
-	mysqli_local_infile *data = (mysqli_local_infile *) ptr;
-
-	if (data) {
-		strlcpy(error_msg, data->error_msg, error_msg_len);
-		return 2000;
-	}
-	strlcpy(error_msg, ER(CR_OUT_OF_MEMORY), error_msg_len);
-	return CR_OUT_OF_MEMORY;
-}
-/* }}} */
-
-/* {{{ php_local_infile_end
- */
-static void php_local_infile_end(void *ptr)
-{
-	mysqli_local_infile		*data;
-	MY_MYSQL				*mysql;
-
-	TSRMLS_FETCH();
-
-	data= (mysqli_local_infile *)ptr;
-
-	if (!data || !(mysql = data->userdata)) {
-		if (data) {
-			free(data);
-		}
-		return;
-	}
-
-	if (mysql->li_stream) {
-		php_stream_close(mysql->li_stream);
-	}
-	free(data);
-	return;
-}
-/* }}} */
-
-
-/* {{{ void php_set_local_infile_handler_default
-*/
-void php_set_local_infile_handler_default(MY_MYSQL *mysql) {
-	/* register internal callback functions */
-	mysql_set_local_infile_handler(mysql->mysql, &php_local_infile_init, &php_local_infile_read,
-				&php_local_infile_end, &php_local_infile_error, (void *)mysql);
-	if (mysql->li_read) {
-		zval_ptr_dtor(&mysql->li_read);
-		mysql->li_read = NULL;
-	}
-}
-/* }}} */
-#endif
-
 /*
  * Local variables:
  * tab-width: 4
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c
index ce7588e..22eae7e 100644
--- a/ext/mysqli/mysqli_api.c
+++ b/ext/mysqli/mysqli_api.c
@@ -1456,64 +1456,6 @@ PHP_FUNCTION(mysqli_kill)
 }
 /* }}} */
 
-/* {{{ proto void mysqli_set_local_infile_default(object link)
-   unsets user defined handler for load local infile command */
-#if !defined(MYSQLI_USE_MYSQLND)
-PHP_FUNCTION(mysqli_set_local_infile_default)
-{
-	MY_MYSQL	*mysql;
-	zval		*mysql_link;
-
-	if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &mysql_link, mysqli_link_class_entry) == FAILURE) {
-		return;
-	}
-
-	MYSQLI_FETCH_RESOURCE_CONN(mysql, &mysql_link, MYSQLI_STATUS_VALID);
-
-	if (mysql->li_read) {
-		zval_ptr_dtor(&(mysql->li_read));
-		mysql->li_read = NULL;
-	}
-}
-/* }}} */
-
-/* {{{ proto bool mysqli_set_local_infile_handler(object link, callback read_func)
-   Set callback functions for LOAD DATA LOCAL INFILE */
-PHP_FUNCTION(mysqli_set_local_infile_handler)
-{
-	MY_MYSQL	*mysql;
-	zval		*mysql_link;
-	char		*callback_name;
-	zval		*callback_func;
-
-	if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Oz", &mysql_link, mysqli_link_class_entry,
-			&callback_func) == FAILURE) {
-		return;
-	}
-
-	MYSQLI_FETCH_RESOURCE_CONN(mysql, &mysql_link, MYSQLI_STATUS_VALID);
-
-	/* check callback function */
-	if (!zend_is_callable(callback_func, 0, &callback_name TSRMLS_CC)) {
-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not a valid callback function %s", callback_name);
-		efree(callback_name);
-		RETURN_FALSE;
-	}
-	efree(callback_name);
-
-	/* save callback function */
-	if (!mysql->li_read) {
-		MAKE_STD_ZVAL(mysql->li_read);
-	} else {
-		zval_dtor(mysql->li_read);
-	}
-	ZVAL_ZVAL(mysql->li_read, callback_func, 1, 0);
-
-	RETURN_TRUE;
-}
-#endif
-/* }}} */
-
 /* {{{ proto bool mysqli_more_results(object link)
    check if there any more query results from a multi query */
 PHP_FUNCTION(mysqli_more_results)
diff --git a/ext/mysqli/mysqli_fe.c b/ext/mysqli/mysqli_fe.c
index 9ebb935..80ae848 100644
--- a/ext/mysqli/mysqli_fe.c
+++ b/ext/mysqli/mysqli_fe.c
@@ -200,16 +200,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_kill, 0, 0, 1)
 	ZEND_ARG_INFO(0, connection_id)
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_set_local_infile_handler, 0, 0, 2)
-	MYSQLI_ZEND_ARG_OBJ_INFO_LINK()
-	ZEND_ARG_INFO(0, read_callback)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_set_local_infile_handler, 0, 0, 1)
-	MYSQLI_ZEND_ARG_OBJ_INFO_LINK()
-	ZEND_ARG_INFO(0, read_callback)
-ZEND_END_ARG_INFO()
-
 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_query, 0, 0, 2)
 	MYSQLI_ZEND_ARG_OBJ_INFO_LINK()
 	ZEND_ARG_INFO(0, query)
@@ -388,10 +378,6 @@ const zend_function_entry mysqli_functions[] = {
 	PHP_FE(mysqli_info,									arginfo_mysqli_only_link)
 	PHP_FE(mysqli_insert_id,							arginfo_mysqli_only_link)
 	PHP_FE(mysqli_kill,									arginfo_mysqli_kill)
-#if !defined(MYSQLI_USE_MYSQLND)
-	PHP_FE(mysqli_set_local_infile_default,				arginfo_mysqli_only_link)
-	PHP_FE(mysqli_set_local_infile_handler,				arginfo_mysqli_set_local_infile_handler)
-#endif
 	PHP_FE(mysqli_more_results,							arginfo_mysqli_only_link)
 	PHP_FE(mysqli_multi_query, 							arginfo_mysqli_query)
 	PHP_FE(mysqli_next_result,							arginfo_mysqli_only_link)
@@ -490,10 +476,6 @@ const zend_function_entry mysqli_link_methods[] = {
 	PHP_FALIAS(get_warnings, mysqli_get_warnings, arginfo_mysqli_no_params)
 	PHP_FALIAS(init,mysqli_init, arginfo_mysqli_no_params)
 	PHP_FALIAS(kill,mysqli_kill, arginfo_class_mysqli_kill)
-#if !defined(MYSQLI_USE_MYSQLND)
-	PHP_FALIAS(set_local_infile_default, mysqli_set_local_infile_default, arginfo_mysqli_no_params)
-	PHP_FALIAS(set_local_infile_handler, mysqli_set_local_infile_handler, arginfo_class_mysqli_set_local_infile_handler)
-#endif
 	PHP_FALIAS(multi_query, mysqli_multi_query, arginfo_class_mysqli_query)
 	PHP_FALIAS(mysqli, mysqli_link_construct, arginfo_mysqli_connect)
 	PHP_FALIAS(more_results, mysqli_more_results, arginfo_mysqli_no_params)
diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c
index 0cc1240..fee65ee 100644
--- a/ext/mysqli/mysqli_nonapi.c
+++ b/ext/mysqli/mysqli_nonapi.c
@@ -259,9 +259,6 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne
 
 #if !defined(MYSQLI_USE_MYSQLND)
 	mysql->mysql->reconnect = MyG(reconnect);
-
-	/* set our own local_infile handler */
-	php_set_local_infile_handler_default(mysql);
 #endif
 
 	mysql_options(mysql->mysql, MYSQL_OPT_LOCAL_INFILE, (char *)&MyG(allow_local_infile));
diff --git a/ext/mysqli/mysqli_priv.h b/ext/mysqli/mysqli_priv.h
index 9dd1111..ecbdacb 100644
--- a/ext/mysqli/mysqli_priv.h
+++ b/ext/mysqli/mysqli_priv.h
@@ -76,7 +76,6 @@ extern void php_clear_warnings(MYSQLI_WARNING *w);
 extern void php_free_stmt_bind_buffer(BIND_BUFFER bbuf, int type);
 extern void php_mysqli_report_error(const char *sqlstate, int errorno, const char *error TSRMLS_DC);
 extern void php_mysqli_report_index(const char *query, unsigned int status TSRMLS_DC);
-extern void php_set_local_infile_handler_default(MY_MYSQL *);
 extern void php_mysqli_throw_sql_exception(char *sqlstate, int errorno TSRMLS_DC, char *format, ...);
 
 #ifdef HAVE_SPL
diff --git a/ext/mysqli/php_mysqli_structs.h b/ext/mysqli/php_mysqli_structs.h
index 32e3e1e..1d363ab 100644
--- a/ext/mysqli/php_mysqli_structs.h
+++ b/ext/mysqli/php_mysqli_structs.h
@@ -158,12 +158,6 @@ typedef struct _mysqli_property_entry {
 	int (*w_func)(mysqli_object *obj, zval *value TSRMLS_DC);
 } mysqli_property_entry;
 
-#if !defined(MYSQLI_USE_MYSQLND)
-typedef struct {
-	char	error_msg[LOCAL_INFILE_ERROR_LEN];
-  	void	*userdata;
-} mysqli_local_infile;
-#endif
 
 typedef struct {
 	zend_ptr_stack free_links;
diff --git a/ext/mysqli/tests/local_infile_tools.inc b/ext/mysqli/tests/local_infile_tools.inc
deleted file mode 100644
index bb9872f..0000000
--- a/ext/mysqli/tests/local_infile_tools.inc
+++ /dev/null
@@ -1,156 +0,0 @@
-<?php
-	/* Utility function for mysqli_set_local_infile*.phpt tests */
-	function shutdown_clean($file) {
-		if ($file) {
-			unlink($file);
-		}
-	}
-
-	function check_local_infile_support($link, $engine, $table_name = 'test') {
-
-		if (!$res = mysqli_query($link, 'SHOW VARIABLES LIKE "local_infile"'))
-			return "Cannot check if Server variable 'local_infile' is set to 'ON'";
-
-		$row = mysqli_fetch_assoc($res);
-		mysqli_free_result($res);
-		if ('ON' != $row['Value'])
-			return sprintf("Server variable 'local_infile' seems not set to 'ON', found '%s'", $row['Value']);
-
-		if (!mysqli_query($link, sprintf('DROP TABLE IF EXISTS %s', $table_name))) {
-			return "Failed to drop old test table";
-		}
-
-		if (!mysqli_query($link, $sql = sprintf('CREATE TABLE %s(id INT, label CHAR(1), PRIMARY KEY(id)) ENGINE=%s',
-			$table_name, $engine)))
-			return "Failed to create test table: $sql";
-
-		$file = create_standard_csv(1, false);
-		if (!$file) {
-			mysqli_query($link, sprintf('DROP TABLE IF EXISTS %s', $table_name));
-			return "Cannot create CSV file";
-		}
-
-		if (!@mysqli_query($link, sprintf("LOAD DATA LOCAL INFILE '%s'
-			INTO TABLE %s
-			FIELDS TERMINATED BY ';' OPTIONALLY ENCLOSED BY '\''
-			LINES TERMINATED BY '\n'",
-			mysqli_real_escape_string($link, $file),
-			$table_name))) {
-			  if (1148 == mysqli_errno($link)) {
-				  mysqli_query($link, sprintf('DROP TABLE IF EXISTS %s', $table_name));
-				  return "Cannot test LOAD DATA LOCAL INFILE, [1148] The used command is not allowed with this MySQL version";
-			  } else if ($link->errno) {
-				  return $link->error;
-			  }
-		}
-		mysqli_query($link, sprintf('DROP TABLE IF EXISTS %s', $table_name));
-		return "";
-	}
-
-	function create_standard_csv($offset, $verbose = true) {
-		// create a CVS file
-		$file = tempnam(sys_get_temp_dir(), 'mysqli_test');
-		if (!$fp = fopen($file, 'w')) {
-			if ($verbose)
-				printf("[%03d + 1] Cannot create CVS file '%s'\n", $offset, $file);
-			return NULL;
-		} else {
-			/* Looks ugly? No, handy if you have crashes... */
-			register_shutdown_function("shutdown_clean", $file);
-		}
-
-		if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1)) {
-			if (!fwrite($fp, (binary)"'97';'x';\n") ||
-				!fwrite($fp, (binary)"'98';'y';\n") ||
-				!fwrite($fp, (binary)"99;'z';\n")) {
-				if ($verbose)
-					printf("[%03d + 2] Cannot write CVS file '%s'\n", $offset, $file);
-				return NULL;
-			}
-		} else {
-			if (!fwrite($fp, "97;'x';\n") ||
-				!fwrite($fp, "98;'y';\n") ||
-				!fwrite($fp, "99;'z';\n")) {
-				if ($verbose)
-					printf("[%03d + 3] Cannot write CVS file '%s'\n", $offset, $file);
-				return NULL;
-			}
-		}
-
-		fclose($fp);
-
-		if (!chmod($file, 0644)) {
-			if ($verbose)
-				printf("[%03d + 4] Cannot change the file perms of '%s' from 0600 to 0644, MySQL might not be able to read it\n",
-					$offset, $file);
-			return NULL;
-		}
-		return $file;
-	}
-
-	function try_handler($offset, $link, $file, $handler, $expected = null) {
-
-		if ('default' == $handler) {
-			mysqli_set_local_infile_default($link);
-		} else if (!mysqli_set_local_infile_handler($link, $handler)) {
-			printf("[%03d] Cannot set infile handler to '%s'\n", $offset, $handler);
-			return false;
-		}
-		printf("Callback set to '%s'\n", $handler);
-
-		if (!mysqli_query($link, sprintf("DELETE FROM test"))) {
-			printf("[%03d] Cannot remove records, [%d] %s\n", $offset + 1, mysqli_errno($link), mysqli_error($link));
-			return false;
-		}
-
-		if (!@mysqli_query($link, sprintf("LOAD DATA LOCAL INFILE '%s'
-			INTO TABLE test
-			FIELDS TERMINATED BY ';' OPTIONALLY ENCLOSED BY '\''
-			LINES TERMINATED BY '\n'",
-			mysqli_real_escape_string($link, $file)))) {
-			printf("[%03d] LOAD DATA failed, [%d] %s\n",
-				$offset + 2,
-				mysqli_errno($link), mysqli_error($link));
-		}
-
-		if (!$res = mysqli_query($link, "SELECT id, label FROM test ORDER BY id")) {
-			printf("[%03d] [%d] %s\n", $offset + 3, mysqli_errno($link), mysqli_error($link));
-			return false;
-		}
-
-		if (!is_array($expected))
-			return true;
-
-		foreach ($expected as $k => $values) {
-			if (!$tmp = mysqli_fetch_assoc($res)) {
-				printf("[%03d/%d] [%d] '%s'\n", $offset + 4, $k, mysqli_errno($link), mysqli_error($link));
-				return false;
-			}
-			if ($values['id'] != $tmp['id']) {
-				printf("[%03d/%d] Expecting %s got %s\n",
-					$offset + 5, $k,
-					$values['id'], $tmp['id']);
-					return false;
-			}
-			if ($values['label'] != $tmp['label']) {
-				printf("[%03d/%d] Expecting %s got %s\n",
-					$offset + 6, $k,
-					$values['label'], $tmp['label']);
-					return false;
-			}
-		}
-
-		if ($res && $tmp = mysqli_fetch_assoc($res)) {
-			printf("[%03d] More results than expected!\n", $offset + 7);
-			do {
-				var_dump($tmp);
-			} while ($tmp = mysqli_fetch_assoc($res));
-			return false;
-		}
-
-		if ($res)
-			mysqli_free_result($res);
-
-		return true;
-	}
-?>
\ No newline at end of file
diff --git a/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt b/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt
index c6d4e7c..139325a 100644
--- a/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt
+++ b/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt
@@ -67,12 +67,6 @@ require_once('skipifconnectfailure.inc');
 		$expected_methods['get_connection_stats']	= true;
 		$expected_methods['reap_async_query']	= true;
 		$expected_methods['poll'] = true;
-	} else {
-		// libmysql only
-		if (function_exists('mysqli_ssl_set'))
-			$expected_methods['ssl_set'] = true;
-		$expected_methods['set_local_infile_default']	= true;
-		$expected_methods['set_local_infile_handler']	= true;
 	}
 
 	/* we should add ruled when to expect them */
diff --git a/ext/mysqli/tests/mysqli_query_local_infile_large.phpt b/ext/mysqli/tests/mysqli_query_local_infile_large.phpt
deleted file mode 100644
index 76bc415..0000000
--- a/ext/mysqli/tests/mysqli_query_local_infile_large.phpt
+++ /dev/null
@@ -1,103 +0,0 @@
---TEST--
-mysql_query(LOAD DATA LOCAL INFILE) with large data set (10MB)
---SKIPIF--
-<?php
-require_once('skipif.inc');
-require_once('skipifconnectfailure.inc');
-
-$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
-if (!$link)
-	die(sprintf("skip Can't connect [%d] %s", mysqli_connect_errno(), mysqli_connect_error()));
-
-include_once("local_infile_tools.inc");
-if ($msg = check_local_infile_support($link, $engine))
-	die(sprintf("skip %s, [%d] %s", $msg, $link->errno, $link->error));
-
-mysqli_close($link);
-?>
---INI--
-mysqli.allow_local_infile=1
---FILE--
-<?php
-	// Create a large CVS file
-	$file = tempnam(sys_get_temp_dir(), 'mysqli_test.cvs');
-	if (!$fp = fopen($file, 'w'))
-		printf("[001] Cannot create CVS file '%s'\n", $file);
-
-	$data = str_repeat("a", 127) . ";" . str_repeat("b", 127) . "\n";
-
-	$runtime = 5;
-	$max_bytes = 1024 * 1024 * 10;
-
-	$start = microtime(true);
-	$bytes = 0;
-	$rowno = 0;
-	while (($bytes < $max_bytes) && ((microtime(true) - $start) < $runtime)) {
-		if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1))
-			$bytes += fwrite($fp, (binary)(++$rowno . ";" . $data));
-		else
-			$bytes += fwrite($fp, ++$rowno . ";" . $data);
-	}
-	fclose($fp);
-	printf("Filesize in bytes: %d\nRows: %d\n", $bytes, $rowno);
-
-	require_once("connect.inc");
- 	if (!($link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)))
-		printf("[002] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
-
-	if (!mysqli_query($link, "DROP TABLE IF EXISTS test") ||
-			!mysqli_query($link, "CREATE TABLE test(id INT, col1 VARCHAR(255), col2 VARCHAR(255)) ENGINE = " . $engine))
-		printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
-
-	if (!mysqli_query($link, sprintf("LOAD DATA LOCAL INFILE '%s' INTO TABLE test FIELDS TERMINATED BY ';'", mysqli_real_escape_string($link, $file))))
-		printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
-
-	if ((!is_string(mysqli_info($link))) || ('' == mysqli_info($link))) {
-		printf("[005] [%d] %s, mysqli_info not set \n", mysqli_errno($link), mysqli_error($link));
-	}
-
-	if (!($res = mysqli_query($link, "SELECT COUNT(*) AS _num FROM test")))
-		printf("[006] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
-
-	$row = mysqli_fetch_assoc($res);
-	if (($row["_num"] != $rowno))
-		printf("[007] Expecting %d rows, found %d\n", $rowno, $row["_num"]);
-
-	mysqli_free_result($res);
-
-	$random = mt_rand(1, $rowno);
-	if (!$res = mysqli_query($link, "SELECT id, col1, col2 FROM test WHERE id = " . $random))
-			printf("[008] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
-
-	$row = mysqli_fetch_assoc($res);
-	var_dump($row);
-	mysqli_free_result($res);
-
-	mysqli_close($link);
-	print "done!";
-?>
---CLEAN--
-<?php
-$file = tempnam(sys_get_temp_dir(), 'mysqli_test.cvs');
-if (file_exists($file))
-	unlink($file);
-
-require_once("connect.inc");
-if (!($link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)))
-	printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
-
-if (!mysqli_query($link, "DROP TABLE IF EXISTS test"))
-	printf("[c002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
-?>
---EXPECTF--
-Filesize in bytes: %d
-Rows: %d
-array(3) {
-  [%u|b%"id"]=>
-  %unicode|string%(%d) "%d"
-  [%u|b%"col1"]=>
-  %unicode|string%(127) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
-  [%u|b%"col2"]=>
-  %unicode|string%(127) "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
-}
-done!
\ No newline at end of file
diff --git a/ext/mysqli/tests/mysqli_set_local_infile_default.phpt b/ext/mysqli/tests/mysqli_set_local_infile_default.phpt
deleted file mode 100644
index 0348b01..0000000
--- a/ext/mysqli/tests/mysqli_set_local_infile_default.phpt
+++ /dev/null
@@ -1,132 +0,0 @@
---TEST--
-mysqli_set_local_infile_default()
---SKIPIF--
-<?php
-require_once('skipif.inc');
-require_once('skipifemb.inc');
-require_once('skipifconnectfailure.inc');
-
-if (!function_exists('mysqli_set_local_infile_handler'))
-	die("skip - function not available.");
-
-$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
-if (!$link)
-	die(sprintf("skip Can't connect [%d] %s", mysqli_connect_errno(), mysqli_connect_error()));
-
-include_once("local_infile_tools.inc");
-if ($msg = check_local_infile_support($link, $engine))
-	die(sprintf("skip %s, [%d] %s", $msg, $link->errno, $link->error));
-
-mysqli_close($link);
-?>
---INI--
-mysqli.allow_local_infile=1
---FILE--
-<?php
-	require_once('connect.inc');
-	require_once('local_infile_tools.inc');
-
-	$link = $tmp = null;
-	if (!is_null($tmp = @mysqli_set_local_infile_default()))
-		printf("[001] Expecting NULL got %s/%s\n", gettype($tmp), $tmp);
-
-	if (!is_null($tmp = @mysqli_set_local_infile_default($link)))
-		printf("[002] Expecting NULL got %s/%s\n", gettype($tmp), $tmp);
-
-	$link = new mysqli();
-	if (!is_null($tmp = @mysqli_set_local_infile_default($link)))
-		printf("[002a] Expecting NULL got %s/%s\n", gettype($tmp), $tmp);
-
-	include("table.inc");
-
-	if (!is_null($tmp = @mysqli_set_local_infile_default($link, 'foo')))
-		printf("[003] Expecting NULL got %s/%s\n", gettype($tmp), $tmp);
-
-
-	function callback_simple($fp, &$buffer, $buflen, &$error) {
-		static $invocation = 0;
-
-		printf("Callback: %d\n", $invocation);
-
-		$invocation++;
-		if (!is_resource($fp))
-			printf("[012] First argument passed to callback is not a resource but %s/%s\n",
-				$fp, gettype($fp));
-
-		if (!$buffer = fread($fp, $buflen)) {
-			if ($invocation == 1) {
-				printf("[013] Cannot read from stream\n");
-				$error = 'Cannot read from stream';
-			} else {
-				return strlen($buffer);
-			}
-		}
-
-		$lines = explode("\n", $buffer);
-		if (count($lines) != 4 && strlen($buffer) > 0) {
-			printf("[014] Test is too simple to handle a buffer of size %d that cannot hold all lines\n", $buflen);
-			$error = 'Parser too simple';
-		}
-
-		$buffer = '';
-		foreach ($lines as $k => $line) {
-			if ('' === trim($line))
-				continue;
-
-			$columns = explode(';', $line);
-			if (empty($columns)) {
-				printf("[015] Cannot parse columns\n");
-				$error = 'Cannot parse columns';
-			}
-
-			// increase id column value
-			$columns[0] += 1;
-			$buffer .= implode(';', $columns);
-			$buffer .= "\n";
-		}
-
-		return strlen($buffer);
-	}
-
-	$file = create_standard_csv(4);
-	$expected = array(
-		array('id' => 98,   'label' => 'x'),
-		array('id' => 99,   'label' => 'y'),
-		array('id' => 100,  'label' => 'z'),
-	);
-	try_handler(10, $link, $file, 'callback_simple', $expected);
-
-	$expected = array(
-		array('id' => 97,   'label' => 'x'),
-		array('id' => 98,   'label' => 'y'),
-		array('id' => 99,   'label' => 'z'),
-	);
-	try_handler(20, $link, $file, 'default', $expected);
-
-	$expected = array(
-		array('id' => 98,   'label' => 'x'),
-		array('id' => 99,   'label' => 'y'),
-		array('id' => 100,  'label' => 'z'),
-	);
-	try_handler(30, $link, $file, 'callback_simple', $expected);
-
-	mysqli_close($link);
-
-	if (!is_null($tmp = @mysqli_set_local_infile_default($link)))
-		printf("[300] Expecting NULL/NULL got %s/%s\n", $tmp, gettype($tmp));
-
-	print "done!";
-?>
---CLEAN--
-<?php
-	require_once("clean_table.inc");
-?>
---EXPECTF--
-Callback set to 'callback_simple'
-Callback: 0
-Callback: 1
-Callback set to 'default'
-Callback set to 'callback_simple'
-Callback: 2
-Callback: 3
-done!
\ No newline at end of file
diff --git a/ext/mysqli/tests/mysqli_set_local_infile_handler.phpt b/ext/mysqli/tests/mysqli_set_local_infile_handler.phpt
deleted file mode 100644
index 58f4c70..0000000
--- a/ext/mysqli/tests/mysqli_set_local_infile_handler.phpt
+++ /dev/null
@@ -1,196 +0,0 @@
---TEST--
-mysqli_set_local_infile_handler()
---SKIPIF--
-<?php
-require_once('skipif.inc');
-require_once('skipifemb.inc');
-require_once('skipifconnectfailure.inc');
-
-if (!function_exists('mysqli_set_local_infile_handler'))
-	die("skip - function not available.");
-
-require_once('connect.inc');
-if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
-	die("skip Cannot connect to MySQL");
-
-include_once("local_infile_tools.inc");
-if ($msg = check_local_infile_support($link, $engine))
-	die(sprintf("skip %s, [%d] %s", $msg, $link->errno, $link->error));
-
-mysqli_close($link);
-?>
---INI--
-mysqli.allow_local_infile=1
---FILE--
-<?php
-	require_once('connect.inc');
-	require_once('local_infile_tools.inc');
-	require_once('table.inc');
-
-	function callback_simple($fp, &$buffer, $buflen, &$error) {
-		static $invocation = 0;
-
-		printf("Callback: %d\n", $invocation);
-
-		$invocation++;
-		if (!is_resource($fp))
-			printf("[012] First argument passed to callback is not a resource but %s/%s\n",
-				$fp, gettype($fp));
-
-		if (!$buffer = fread($fp, $buflen)) {
-			if ($invocation == 1) {
-				printf("[013] Cannot read from stream\n");
-					$error = 'Cannot read from stream';
-			} else {
-				return strlen($buffer);
-			}
-		}
-
-		$lines = explode("\n", $buffer);
-		if (count($lines) != 4 && strlen($buffer) > 0) {
-			printf("[014] Test is too simple to handle a buffer of size %d that cannot hold all lines\n", $buflen);
-			$error = 'Parser too simple';
-		}
-
-		$buffer = '';
-		foreach ($lines as $k => $line) {
-			if ('' === trim($line))
-				continue;
-
-			$columns = explode(';', $line);
-			if (empty($columns)) {
-				printf("[015] Cannot parse columns\n");
-				$error = 'Cannot parse columns';
-			}
-
-			// increase id column value
-			$columns[0] += 1;
-			$buffer .= implode(';', $columns);
-			$buffer .= "\n";
-		}
-
-		return strlen($buffer);
-	}
-
-	function callback_fclose($fp, &$buffer, $buflen, &$error) {
-		static $invocation = 0;
-
-		printf("Callback: %d\n", $invocation++);
-
-		fclose($fp);
-		return strlen($buffer);
-	}
-
-	function callback_closefile($fp, &$buffer, $buflen, &$error) {
-		static $invocation = 0;
-
-		printf("Callback: %d\n", $invocation++);
-		flush();
-		if (is_resource($fp))
-			fclose($fp);
-		$buffer = "1;'a';\n";
-		if ($invocation > 10)
-			return 0;
-
-		return strlen($buffer);
-	}
-
-	function callback_invalid_args($fp, &$buffer, $buflen) {
-		static $invocation = 0;
-
-		printf("Callback: %d\n", $invocation++);
-		$buffer = fread($fp, $buflen);
-
-		return strlen($buffer);
-	}
-
-	function callback_error($fp, &$buffer, $buflen, &$error) {
-		static $invocation = 0;
-
-		printf("Callback: %d\n", $invocation++);
-		$buffer = fread($fp, $buflen);
-		$error = 'How to access this error?';
-
-		return -1;
-	}
-
-	if (!is_null($tmp = @mysqli_set_local_infile_handler()))
-		printf("[001] Expecting NULL/NULL got %s/%s\n", $tmp, gettype($tmp));
-
-	$handle = null;
-	if (!is_null($tmp = @mysqli_set_local_infile_handler($handle)))
-		printf("[002] Expecting NULL/NULL got %s/%s\n", $tmp, gettype($tmp));
-
-	$handle = @new mysqli();
-	if (!is_null($tmp = @mysqli_set_local_infile_handler($handle, 'callback_simple')))
-		printf("[003] Expecting NULL/NULL got %s/%s\n", $tmp, gettype($tmp));
-
-	if (false !== ($tmp = @mysqli_set_local_infile_handler($link, 'unknown')))
-		printf("[004] Expecting false/boolean got %s/%s\n", $tmp, gettype($tmp));
-
-	$file = create_standard_csv(5);
-
-	$expected = array(
-		array('id' => 98,   'label' => 'x'),
-		array('id' => 99,   'label' => 'y'),
-		array('id' => 100,  'label' => 'z'),
-	);
-	try_handler(10, $link, $file, 'callback_simple', $expected);
-
-	$expected = array();
-	try_handler(20, $link, $file, 'callback_fclose', $expected);
-
-	// FIXME - TODO - KLUDGE -
-  // IMHO this is wrong. ext/mysqli should bail as the function signature
-  // is not complete. That's a BC break, OK, but it makes perfectly sense.
-	$expected = array();
-	try_handler(30, $link, $file, 'callback_invalid_args', $expected);
-
-	$expected = array();
-	try_handler(40, $link, $file, 'callback_error', $expected);
-
-
-	mysqli_close($link);
-
-	if (!is_null($tmp = @mysqli_set_local_infile_handler($link, 'callback_simple')))
-		printf("[300] Expecting NULL/NULL got %s/%s\n", $tmp, gettype($tmp));
-
-	print "done!";
-?>
---CLEAN--
-<?php
-	require_once("clean_table.inc");
-?>
---EXPECTF--
-Callback set to 'callback_simple'
-Callback: 0
-Callback: 1
-Callback set to 'callback_fclose'
-Callback: 0
-[022] LOAD DATA failed, [2000] File handle close%s
-Callback set to 'callback_invalid_args'
-Callback: 0
-Callback: 1
-[037] More results than expected!
-array(2) {
-  [%u|b%"id"]=>
-  %unicode|string%(2) "97"
-  [%u|b%"label"]=>
-  %unicode|string%(1) "x"
-}
-array(2) {
-  [%u|b%"id"]=>
-  %unicode|string%(2) "98"
-  [%u|b%"label"]=>
-  %unicode|string%(1) "y"
-}
-array(2) {
-  [%u|b%"id"]=>
-  %unicode|string%(2) "99"
-  [%u|b%"label"]=>
-  %unicode|string%(1) "z"
-}
-Callback set to 'callback_error'
-Callback: 0
-[042] LOAD DATA failed, [2000] How to access this error?
-done!
\ No newline at end of file
diff --git a/ext/mysqli/tests/mysqli_set_local_infile_handler_bad_character.phpt b/ext/mysqli/tests/mysqli_set_local_infile_handler_bad_character.phpt
deleted file mode 100644
index b8f51c2..0000000
--- a/ext/mysqli/tests/mysqli_set_local_infile_handler_bad_character.phpt
+++ /dev/null
@@ -1,82 +0,0 @@
---TEST--
-mysqli_set_local_infile_handler() - random ASCII character including \0
---SKIPIF--
-<?php
-require_once('skipif.inc');
-require_once('skipifemb.inc');
-require_once('skipifconnectfailure.inc');
-require_once('connect.inc');
-
-if (!function_exists('mysqli_set_local_infile_handler'))
-    die("skip - function not available.");
-
-if (!$TEST_EXPERIMENTAL)
-    die("skip - experimental (= unsupported) feature");
-
-if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
-	die("skip Cannot connect to MySQL");
-
-include_once("local_infile_tools.inc");
-if ($msg = check_local_infile_support($link, $engine))
-	die(sprintf("skip %s, [%d] %s", $msg, $link->errno, $link->error));
-
-mysqli_close($link);
-?>
---INI--
-mysqli.allow_local_infile=1
---FILE--
-<?php
-	require_once('connect.inc');
-	require_once('local_infile_tools.inc');
-	require_once('table.inc');
-
-	function callback_bad_character($fp, &$buffer, $buflen, &$error) {
-		static $invocation = 0;
-
-		printf("Callback: %d\n", $invocation++);
-
-		$num_chars = (version_compare(PHP_VERSION, '5.9.9', '>') == 1) ? (floor($buflen / 2) - 10) : ($buflen - 5);
-		$part1 = floor($num_chars / 2);
-		$part2 = $num_chars - $part1;
-
-		$buffer = '';
-		for ($i = 0; $i < $part1; $i++)
-			$buffer .= chr(mt_rand(0, 255));
-
-		$buffer .= ';"';
-
-		for ($i = 0; $i < $part2; $i++)
-			$buffer .= chr(mt_rand(0, 255));
-
-		$buffer .= '";';
-		if ($invocation > 10)
-			return 0;
-
-		return strlen($buffer);
-	}
-
-	$file = create_standard_csv(5);
-	/* we feed the handler with random data, therefore we cannot specify and expected rows */
-	try_handler(20, $link, $file, 'callback_bad_character');
-
-	mysqli_close($link);
-	print "done!";
-?>
---CLEAN--
-<?php
-	require_once("clean_table.inc");
-?>
---EXPECTF--
-Callback set to 'callback_bad_character'
-Callback: 0
-Callback: 1
-Callback: 2
-Callback: 3
-Callback: 4
-Callback: 5
-Callback: 6
-Callback: 7
-Callback: 8
-Callback: 9
-Callback: 10
-done!
\ No newline at end of file
diff --git a/ext/mysqli/tests/mysqli_set_local_infile_handler_buffer_overflow.phpt b/ext/mysqli/tests/mysqli_set_local_infile_handler_buffer_overflow.phpt
deleted file mode 100644
index a3c8801..0000000
--- a/ext/mysqli/tests/mysqli_set_local_infile_handler_buffer_overflow.phpt
+++ /dev/null
@@ -1,60 +0,0 @@
---TEST--
-mysqli_set_local_infile_handler() - buffer overflow
---SKIPIF--
-<?php
-require_once('skipif.inc');
-require_once('skipifemb.inc');
-require_once('skipifconnectfailure.inc');
-
-if (!function_exists('mysqli_set_local_infile_handler'))
-	die("skip - function not available.");
-
-require_once('connect.inc');
-if (!$TEST_EXPERIMENTAL)
-	die("skip - experimental (= unsupported) feature");
-
-if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
-	die("skip Cannot connect to MySQL");
-
-include_once("local_infile_tools.inc");
-if ($msg = check_local_infile_support($link, $engine))
-	die(sprintf("skip %s, [%d] %s", $msg, $link->errno, $link->error));
-
-mysqli_close($link);
-?>
---INI--
-mysqli.allow_local_infile=1
---FILE--
-<?php
-	require_once('connect.inc');
-	require_once('local_infile_tools.inc');
-	require_once('table.inc');
-
-	function callback_buffer_overflow($fp, &$buffer, $buflen, &$error) {
-		static $invocation = 0;
-
-		printf("Callback: %d\n", $invocation);
-		$buffer = fread($fp, $buflen);
-
-		$buffer = str_repeat(';', $buflen * 2);
-		return strlen($buffer);
-	}
-
-	$file = create_standard_csv(5);
-	$expected = array();
-	try_handler(20, $link, $file, 'callback_buffer_overflow', $expected);
-
-	mysqli_close($link);
-	print "done!";
-?>
---CLEAN--
-<?php
-	require_once("clean_table.inc");
-?>
---EXPECTF--
-Callback set to 'callback_buffer_overflow'
-Callback: 0
-
-Warning: mysqli_query(): Too much data returned in %s on line %d
-[022] LOAD DATA failed, [%d] Too much data returned
-done!
\ No newline at end of file
diff --git a/ext/mysqli/tests/mysqli_set_local_infile_handler_close_link.phpt b/ext/mysqli/tests/mysqli_set_local_infile_handler_close_link.phpt
deleted file mode 100644
index 408bb29..0000000
--- a/ext/mysqli/tests/mysqli_set_local_infile_handler_close_link.phpt
+++ /dev/null
@@ -1,61 +0,0 @@
---TEST--
-mysqli_set_local_infile_handler() - close database link
---SKIPIF--
-<?php
-require_once('skipif.inc');
-require_once('skipifemb.inc');
-require_once('skipifconnectfailure.inc');
-
-if (!function_exists('mysqli_set_local_infile_handler'))
-	die("skip - function not available.");
-
-require_once('connect.inc');
-if (!$TEST_EXPERIMENTAL)
-	die("skip - experimental (= unsupported) feature");
-
-if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
-	die("skip Cannot connect to MySQL");
-
-include_once("local_infile_tools.inc");
-if ($msg = check_local_infile_support($link, $engine))
-	die(sprintf("skip %s, [%d] %s", $msg, $link->errno, $link->error));
-
-mysqli_close($link);
-?>
---INI--
-mysqli.allow_local_infile=1
---FILE--
-<?php
-	require("table.inc");
-	require_once('local_infile_tools.inc');
-
-	function callback_close_link($fp, &$buffer, $buflen, &$error) {
-		global $link;
-		static $invocation = 0;
-
-		printf("Callback: %d\n", $invocation++);
-		flush();
-		if (is_object($link))
-			mysqli_close($link);
-
-		$buffer = "1;'a';\n";
-		if ($invocation > 10)
-			return 0;
-
-		return strlen($buffer);
-	}
-
-	$file = create_standard_csv(1);
-	$expected = array(array('id' => 1, 'label' => 'a'));
-	try_handler(20, $link, $file, 'callback_close_link', $expected);
-	mysqli_close($link);
-	print "done!";
-?>
---CLEAN--
-<?php
-	require_once("clean_table.inc");
-?>
---EXPECTF--
-Callback set to 'callback_close_link'
-Callback: 0
-done!
\ No newline at end of file
diff --git a/ext/mysqli/tests/mysqli_set_local_infile_handler_closefile.phpt b/ext/mysqli/tests/mysqli_set_local_infile_handler_closefile.phpt
deleted file mode 100644
index 168cbc1..0000000
--- a/ext/mysqli/tests/mysqli_set_local_infile_handler_closefile.phpt
+++ /dev/null
@@ -1,70 +0,0 @@
---TEST--
-mysqli_set_local_infile_handler() - do not use the file pointer
---SKIPIF--
-<?php
-require_once('skipif.inc');
-require_once('skipifemb.inc');
-require_once('skipifconnectfailure.inc');
-
-if (!function_exists('mysqli_set_local_infile_handler'))
-	die("skip - function not available.");
-
-require_once('connect.inc');
-if (!$TEST_EXPERIMENTAL)
-	die("skip - experimental (= unsupported) feature");
-
-if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
-	die("skip Cannot connect to MySQL");
-
-include_once("local_infile_tools.inc");
-if ($msg = check_local_infile_support($link, $engine))
-	die(sprintf("skip %s, [%d] %s", $msg, $link->errno, $link->error));
-
-mysqli_close($link);
-?>
---INI--
-mysqli.allow_local_infile=1
---FILE--
-<?php
-	require_once("table.inc");
-	require_once('local_infile_tools.inc');
-
-	function callback_closefile($fp, &$buffer, $buflen, &$error) {
-		static $invocation = 0;
-
-		printf("Callback: %d\n", $invocation++);
-		flush();
-		if (is_resource($fp))
-			fclose($fp);
-		$buffer = "1;'a';\n";
-		if ($invocation > 10)
-			return 0;
-
-		return strlen($buffer);
-	}
-
-	$file = create_standard_csv(1);
-	$expected = array(array('id' => 1, 'label' => 'a'));
-	try_handler(20, $link, $file, 'callback_closefile', $expected);
-
-	mysqli_close($link);
-	print "done!";
-?>
---CLEAN--
-<?php
-	require_once("clean_table.inc");
-?>
---EXPECTF--
-Callback set to 'callback_closefile'
-Callback: 0
-Callback: 1
-Callback: 2
-Callback: 3
-Callback: 4
-Callback: 5
-Callback: 6
-Callback: 7
-Callback: 8
-Callback: 9
-Callback: 10
-done!
\ No newline at end of file
diff --git a/ext/mysqli/tests/mysqli_set_local_infile_handler_closures.phpt b/ext/mysqli/tests/mysqli_set_local_infile_handler_closures.phpt
deleted file mode 100755
index ad7ab32..0000000
--- a/ext/mysqli/tests/mysqli_set_local_infile_handler_closures.phpt
+++ /dev/null
@@ -1,62 +0,0 @@
---TEST--
-mysqli_set_local_infile_handler() - use closures as handler
---SKIPIF--
-<?php
-require_once('skipif.inc');
-require_once('skipifemb.inc');
-require_once('skipifconnectfailure.inc');
-
-if (!function_exists('mysqli_set_local_infile_handler'))
-	die("skip - function not available.");
-
-require_once('connect.inc');
-if (!$TEST_EXPERIMENTAL)
-	die("skip - experimental (= unsupported) feature");
-
-if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
-	die("skip Cannot connect to MySQL");
-
-include_once("local_infile_tools.inc");
-if ($msg = check_local_infile_support($link, $engine))
-	die(sprintf("skip %s, [%d] %s", $msg, $link->errno, $link->error));
-
-mysqli_close($link);
-?>
---INI--
-mysqli.allow_local_infile=1
---FILE--
-<?php
-	require_once('connect.inc');
-	require_once('local_infile_tools.inc');
-	require_once('table.inc');
-
-	$callback_replace_buffer = function ($fp, &$buffer, $buflen, &$error) {
-		static $invocation = 0;
-
-		printf("Callback: %d\n", $invocation++);
-		flush();
-
-		$buffer = fread($fp, $buflen);
-
-		if ($invocation > 10)
-			return 0;
-
-		return strlen($buffer);
-	};
-
-	$file = create_standard_csv(1);
-	if (!try_handler(20, $link, $file, $callback_replace_buffer, null))
-		printf("[008] Failure\n");
-
-	mysqli_close($link);
-	print "done!";
-?>
---CLEAN--
-<?php
-	require_once("clean_table.inc");
-?>
---EXPECTF--
-Callback set to 'Closure object'
-Callback: 0
-Callback: 1
-done!
\ No newline at end of file
diff --git a/ext/mysqli/tests/mysqli_set_local_infile_handler_kill_link.phpt b/ext/mysqli/tests/mysqli_set_local_infile_handler_kill_link.phpt
deleted file mode 100644
index b2b42a2..0000000
--- a/ext/mysqli/tests/mysqli_set_local_infile_handler_kill_link.phpt
+++ /dev/null
@@ -1,61 +0,0 @@
---TEST--
-mysqli_set_local_infile_handler() - kill database link
---SKIPIF--
-<?php
-require_once('skipif.inc');
-require_once('skipifemb.inc');
-require_once('skipifconnectfailure.inc');
-
-if (!function_exists('mysqli_set_local_infile_handler'))
-	die("skip - function not available.");
-
-require_once('connect.inc');
-if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
-	die("skip Cannot connect to MySQL");
-
-include_once("local_infile_tools.inc");
-if ($msg = check_local_infile_support($link, $engine))
-	die(sprintf("skip %s, [%d] %s", $msg, $link->errno, $link->error));
-
-mysqli_close($link);
-?>
---INI--
-mysqli.allow_local_infile=1
---FILE--
-<?php
-	require("table.inc");
-	require_once('local_infile_tools.inc');
-
-	function callback_kill_link($fp, &$buffer, $buflen, &$error) {
-		global $link;
-		static $invocation = 0;
-
-		printf("Callback: %d\n", $invocation++);
-		flush();
-		if (is_object($link))
-			mysqli_kill($link, mysqli_thread_id($link));
-
-		$buffer = "1;'a';\n";
-		if ($invocation > 10)
-			return 0;
-
-		mysqli_set_local_infile_default($link);
-		return strlen($buffer);
-	}
-
-	$file = create_standard_csv(1);
-	$expected = array(array('id' => 1, 'label' => 'a'));
-	try_handler(20, $link, $file, 'callback_kill_link', $expected);
-
-	mysqli_close($link);
-	print "done!";
-?>
---CLEAN--
-<?php
-	require_once("clean_table.inc");
-?>
---EXPECTF--
-Callback set to 'callback_kill_link'
-Callback: 0
-[022] LOAD DATA failed, [2000] Can't execute load data local init callback function
-done!
\ No newline at end of file
diff --git a/ext/mysqli/tests/mysqli_set_local_infile_handler_negative_len.phpt b/ext/mysqli/tests/mysqli_set_local_infile_handler_negative_len.phpt
deleted file mode 100644
index 16e38c5..0000000
--- a/ext/mysqli/tests/mysqli_set_local_infile_handler_negative_len.phpt
+++ /dev/null
@@ -1,58 +0,0 @@
---TEST--
-mysqli_set_local_infile_handler() - negative return value/buflen to indicate an error
---SKIPIF--
-<?php
-require_once('skipif.inc');
-require_once('skipifemb.inc');
-require_once('skipifconnectfailure.inc');
-
-if (!function_exists('mysqli_set_local_infile_handler'))
-	die("skip - function not available.");
-
-require_once('connect.inc');
-if (!$TEST_EXPERIMENTAL)
-	die("skip - experimental (= unsupported) feature");
-
-if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
-	die("skip Cannot connect to MySQL");
-
-include_once("local_infile_tools.inc");
-if ($msg = check_local_infile_support($link, $engine))
-	die(sprintf("skip %s, [%d] %s", $msg, $link->errno, $link->error));
-
-mysqli_close($link);
-?>
---INI--
-mysqli.allow_local_infile=1
---FILE--
-<?php
-	require_once('connect.inc');
-	require_once('local_infile_tools.inc');
-	require_once('table.inc');
-
-	function callback_negative_len($fp, &$buffer, $buflen, &$error) {
-		static $invocation = 0;
-
-		printf("Callback: %d\n", $invocation);
-		$buffer = fread($fp, $buflen);
-
-		$error = "negative length means error";
-		return -1;
-	}
-
-	$file = create_standard_csv(1);
-	$expected = array();
-	try_handler(20, $link, $file, 'callback_negative_len', $expected);
-
-	mysqli_close($link);
-	print "done!";
-?>
---CLEAN--
-<?php
-	require_once("clean_table.inc");
-?>
---EXPECTF--
-Callback set to 'callback_negative_len'
-Callback: 0
-[022] LOAD DATA failed, [2000] negative length means error
-done!
\ No newline at end of file
diff --git a/ext/mysqli/tests/mysqli_set_local_infile_handler_nested_call.phpt b/ext/mysqli/tests/mysqli_set_local_infile_handler_nested_call.phpt
deleted file mode 100644
index 4663fe2..0000000
--- a/ext/mysqli/tests/mysqli_set_local_infile_handler_nested_call.phpt
+++ /dev/null
@@ -1,107 +0,0 @@
---TEST--
-mysqli_set_local_infile_handler() - nested calls
---SKIPIF--
-<?php
-require_once('skipif.inc');
-require_once('skipifemb.inc');
-require_once('skipifconnectfailure.inc');
-
-if (!function_exists('mysqli_set_local_infile_handler'))
-	die("skip - function not available.");
-
-require_once('connect.inc');
-if (!$TEST_EXPERIMENTAL)
-	die("skip - experimental (= unsupported) feature");
-
-if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
-	die("skip Cannot connect to MySQL");
-
-include_once("local_infile_tools.inc");
-if ($msg = check_local_infile_support($link, $engine))
-	die(sprintf("skip %s, [%d] %s", $msg, $link->errno, $link->error));
-
-mysqli_close($link);
-?>
---INI--
-mysqli.allow_local_infile=1
---FILE--
-<?php
-	require_once('connect.inc');
-	require_once('local_infile_tools.inc');
-	require_once('table.inc');
-
-	function callback_simple($fp, &$buffer, $buflen, &$error) {
-		static $invocation = 0;
-
-		printf("Callback - callback_simple(): %d\n", $invocation);
-
-		$invocation++;
-		if (!is_resource($fp))
-			printf("[012] First argument passed to callback is not a resource but %s/%s\n",
-				$fp, gettype($fp));
-
-		if (!$buffer = fread($fp, $buflen)) {
-			if ($invocation == 1) {
-				printf("[013] Cannot read from stream\n");
-				$error = 'Cannot read from stream';
-			} else {
-				return strlen($buffer);
-			}
-		}
-
-		$lines = explode("\n", $buffer);
-		if (count($lines) != 4 && strlen($buffer) > 0) {
-			printf("[014] Test is too simple to handle a buffer of size %d that cannot hold all lines\n", $buflen);
-			$error = 'Parser too simple';
-		}
-
-		$buffer = '';
-		foreach ($lines as $k => $line) {
-			if ('' === trim($line))
-				continue;
-
-			$columns = explode(';', $line);
-			if (empty($columns)) {
-				printf("[015] Cannot parse columns\n");
-				$error = 'Cannot parse columns';
-			}
-
-			// increase id column value
-			$columns[0] += 1;
-			$buffer .= implode(';', $columns);
-			$buffer .= "\n";
-		}
-
-		/* report the wrong length */
-		return strlen($buffer);
-	}
-
-	function callback_report_short_len($fp, &$buffer, $buflen, &$error) {
-		static $invocation = 0;
-
-		printf("Callback - report_short_len(): %d\n", $invocation++);
-		return callback_simple($fp, $buffer, $buflen, $error);
-	}
-
-	$file = create_standard_csv(1);
-	$expected = array(
-		array('id' => 98,   'label' => 'x'),
-		array('id' => 99,   'label' => 'y'),
-		array('id' => 100,  'label' => 'z'),
-	);
-	try_handler(20, $link, $file, 'callback_report_short_len', $expected);
-
-	mysqli_close($link);
-	print "done!";
-?>
---CLEAN--
-<?php
-	require_once("clean_table.inc");
-?>
---EXPECTF--
-Callback set to 'callback_report_short_len'
-Callback - report_short_len(): 0
-Callback - callback_simple(): 0
-Callback - report_short_len(): 1
-Callback - callback_simple(): 1
-done!
\ No newline at end of file
diff --git a/ext/mysqli/tests/mysqli_set_local_infile_handler_new_query.phpt b/ext/mysqli/tests/mysqli_set_local_infile_handler_new_query.phpt
deleted file mode 100644
index ca06435..0000000
--- a/ext/mysqli/tests/mysqli_set_local_infile_handler_new_query.phpt
+++ /dev/null
@@ -1,71 +0,0 @@
---TEST--
-mysqli_set_local_infile_handler() - run new query on db link
---SKIPIF--
-<?php
-require_once('skipif.inc');
-require_once('skipifemb.inc');
-require_once('skipifconnectfailure.inc');
-
-if (!function_exists('mysqli_set_local_infile_handler'))
-	die("skip - function not available.");
-
-require_once('connect.inc');
-if (!$TEST_EXPERIMENTAL)
-	die("skip - experimental (= unsupported) feature");
-
-if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
-	die("skip Cannot connect to MySQL");
-
-include_once("local_infile_tools.inc");
-if ($msg = check_local_infile_support($link, $engine))
-	die(sprintf("skip %s, [%d] %s", $msg, $link->errno, $link->error));
-
-mysqli_close($link);
-?>
---INI--
-mysqli.allow_local_infile=1
---FILE--
-<?php
-	require_once('connect.inc');
-	require_once('local_infile_tools.inc');
-	require_once('table.inc');
-
-	function callback_new_query($fp, &$buffer, $buflen, &$error) {
-		global $link;
-		static $invocation = 0;
-
-		printf("Callback: %d\n", $invocation++);
-		flush();
-		if (is_object($link)) {
-			if (!$res = mysqli_query($link, "SELECT id, label FROM test")) {
-				printf("[Callback 001 - %03d] Cannot run query, [%d] %s\n",
-					$invocation, mysqli_errno($link), mysqli_error($link));
-			}
-			if ($res)
-				mysqli_free_result($res);
-			}
-			$buffer = "1;'a';\n";
-			if ($invocation > 10)
-				return 0;
-
-			mysqli_set_local_infile_default($link);
-			return strlen($buffer);
-	}
-
-	$file = create_standard_csv(1);
-	$expected = array(array('id' => 1, 'label' => 'a'));
-	try_handler(20, $link, $file, 'callback_new_query', $expected);
-
-	mysqli_close($link);
-	print "done!";
-?>
---CLEAN--
-<?php
-	require_once("clean_table.inc");
-?>
---EXPECTF--
-Callback set to 'callback_new_query'
-Callback: 0
-[Callback 001 - 001] Cannot run query, [2014] Commands out of sync; you can't run this command now
-[022] LOAD DATA failed, [2000] Can't execute load data local init callback function
-done!
\ No newline at end of file
diff --git a/ext/mysqli/tests/mysqli_set_local_infile_handler_nofileop.phpt b/ext/mysqli/tests/mysqli_set_local_infile_handler_nofileop.phpt
deleted file mode 100644
index 601a09e..0000000
--- a/ext/mysqli/tests/mysqli_set_local_infile_handler_nofileop.phpt
+++ /dev/null
@@ -1,70 +0,0 @@
---TEST--
-mysqli_set_local_infile_handler() - do not use the file pointer
---SKIPIF--
-<?php
-require_once('skipif.inc');
-require_once('skipifemb.inc');
-require_once('skipifconnectfailure.inc');
-
-if (!function_exists('mysqli_set_local_infile_handler'))
-	die("skip - function not available.");
-
-require_once('connect.inc');
-if (!$TEST_EXPERIMENTAL)
-	die("skip - experimental (= unsupported) feature");
-
-if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
-	die("skip Cannot connect to MySQL");
-
-include_once("local_infile_tools.inc");
-if ($msg = check_local_infile_support($link, $engine))
-	die(sprintf("skip %s, [%d] %s", $msg, $link->errno, $link->error));
-
-mysqli_close($link);
-?>
---INI--
-mysqli.allow_local_infile=1
---FILE--
-<?php
-	require_once('connect.inc');
-	require_once('local_infile_tools.inc');
-	require_once('table.inc');
-
-	function callback_nofileop($fp, &$buffer, $buflen, &$error) {
-		static $invocation = 0;
-
-		printf("Callback: %d\n", $invocation++);
-		flush();
-
-		$buffer = "1;'a';\n";
-		if ($invocation > 10)
-			return 0;
-
-		return strlen($buffer);
-	}
-
-	$file = create_standard_csv(1);
-	$expected = array(array('id' => 1, 'label' => 'a'));
-	try_handler(20, $link, $file, 'callback_nofileop', $expected);
-
-	mysqli_close($link);
-	print "done!";
-?>
---CLEAN--
-<?php
-	require_once("clean_table.inc");
-?>
---EXPECTF--
-Callback set to 'callback_nofileop'
-Callback: 0
-Callback: 1
-Callback: 2
-Callback: 3
-Callback: 4
-Callback: 5
-Callback: 6
-Callback: 7
-Callback: 8
-Callback: 9
-Callback: 10
-done!
\ No newline at end of file
diff --git a/ext/mysqli/tests/mysqli_set_local_infile_handler_openbasedir.phpt b/ext/mysqli/tests/mysqli_set_local_infile_handler_openbasedir.phpt
deleted file mode 100644
index 7163aca..0000000
--- a/ext/mysqli/tests/mysqli_set_local_infile_handler_openbasedir.phpt
+++ /dev/null
@@ -1,115 +0,0 @@
---TEST--
-mysqli_set_local_infile_handler() - open basedir restrictions
---SKIPIF--
-<?php
-if (!$fp = @fopen('skipif.inc', 'r'))
-  die("skip open_basedir restrictions forbid opening include files");
-
-include_once('skipif.inc');
-include_once('skipifemb.inc');
-include_once('skipifconnectfailure.inc');
-
-if (!function_exists('mysqli_set_local_infile_handler'))
-	die("skip - function not available.");
-
-include_once('connect.inc');
-if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
-	die("skip Cannot connect to MySQL");
-
-if (!$res = mysqli_query($link, 'SHOW VARIABLES LIKE "local_infile"')) {
-	mysqli_close($link);
-	die("skip Cannot check if Server variable 'local_infile' is set to 'ON'");
-}
-
-include_once("local_infile_tools.inc");
-if ($msg = check_local_infile_support($link, $engine))
-	die(sprintf("skip %s, [%d] %s", $msg, $link->errno, $link->error));
-
-mysqli_close($link);
-?>
---INI--
-open_basedir="."
---FILE--
-<?php
-	@include('connect.inc');
-	if (!isset($db)) {
-		// stupid run-tests.php - any idea how to set system ini setting dynamically???
-		print "Warning: tempnam(): open_basedir restriction in effect. File(grrr) is not within the allowed path(s): (grrr) in grrr on line 0
-[005 + 1] Cannot create CVS file ''
-Callback set to 'callback_simple'
-[012] LOAD DATA failed, [0] grrr
-[014/0] [0] ''
-done!";
-		die();
-	}
-
-	require_once('connect.inc');
-	require_once('local_infile_tools.inc');
-	require_once('table.inc');
-
-	function callback_simple($fp, &$buffer, $buflen, &$error) {
-		static $invocation = 0;
-
-		printf("Callback: %d\n", $invocation);
-
-		$invocation++;
-		if (!is_resource($fp))
-			printf("[012] First argument passed to callback is not a resource but %s/%s\n",
-				$fp, gettype($fp));
-
-		if (!$buffer = fread($fp, $buflen)) {
-			if ($invocation == 1) {
-				printf("[013] Cannot read from stream\n");
-					$error = 'Cannot read from stream';
-			} else {
-				return strlen($buffer);
-			}
-		}
-
-		$lines = explode("\n", $buffer);
-		if (count($lines) != 4 && strlen($buffer) > 0) {
-			printf("[014] Test is too simple to handle a buffer of size %d that cannot hold all lines\n", $buflen);
-			$error = 'Parser too simple';
-		}
-
-		$buffer = '';
-		foreach ($lines as $k => $line) {
-			if ('' === trim($line))
-				continue;
-
-			$columns = explode(';', $line);
-			if (empty($columns)) {
-				printf("[015] Cannot parse columns\n");
-				$error = 'Cannot parse columns';
-			}
-
-			// increase id column value
-			$columns[0] += 1;
-			$buffer .= implode(';', $columns);
-			$buffer .= "\n";
-		}
-
-		return strlen($buffer);
-	}
-
-	$file = create_standard_csv(5);
-	$expected = array(
-		array('id' => 98,   'label' => 'x'),
-		array('id' => 99,   'label' => 'y'),
-		array('id' => 100,  'label' => 'z'),
-	);
-	try_handler(10, $link, $file, 'callback_simple', $expected);
-	mysqli_close($link);
-	print "done!";
-?>
---CLEAN--
-<?php
-	require_once("clean_table.inc");
-?>
---EXPECTF--
-Warning: tempnam(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (%s) in %s on line %d
-[005 + 1] Cannot create CVS file ''
-Callback set to 'callback_simple'
-[012] LOAD DATA failed, [%d] %s
-[014/0] [0] ''
-done!
\ No newline at end of file
diff --git a/ext/mysqli/tests/mysqli_set_local_infile_handler_replace_buffer.phpt b/ext/mysqli/tests/mysqli_set_local_infile_handler_replace_buffer.phpt
deleted file mode 100644
index 0d4024e..0000000
--- a/ext/mysqli/tests/mysqli_set_local_infile_handler_replace_buffer.phpt
+++ /dev/null
@@ -1,78 +0,0 @@
---TEST--
-mysqli_set_local_infile_handler() - replace buffer pointer
---SKIPIF--
-<?php
-require_once('skipif.inc');
-require_once('skipifemb.inc');
-require_once('skipifconnectfailure.inc');
-
-if (!function_exists('mysqli_set_local_infile_handler'))
-	die("skip - function not available.");
-
-require_once('connect.inc');
-if (!$TEST_EXPERIMENTAL)
-	die("skip - experimental (= unsupported) feature");
-
-if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
-	die("skip Cannot connect to MySQL");
-
-include_once("local_infile_tools.inc");
-if ($msg = check_local_infile_support($link, $engine))
-	die(sprintf("skip %s, [%d] %s", $msg, $link->errno, $link->error));
-
-mysqli_close($link);
-?>
---INI--
-mysqli.allow_local_infile=1
---FILE--
-<?php
-	require_once('connect.inc');
-	require_once('local_infile_tools.inc');
-	require_once('table.inc');
-
-	function callback_replace_buffer($fp, &$buffer, $buflen, &$error) {
-		static $invocation = 0;
-
-		printf("Callback: %d\n", $invocation++);
-		flush();
-
-		$buffer = fread($fp, $buflen);
-
-		$ret = "1;'a';\n";
-		$buffer = $ret;
-
-		$num_chars = ((version_compare(PHP_VERSION, '5.9.9', '>') == 1)) ? floor($buflen / 2) : $buflen;
-		assert(strlen($buffer) < $num_chars);
-
-		if ($invocation > 10)
-			return 0;
-
-		return strlen($buffer);
-	}
-
-	$file = create_standard_csv(1);
-	$expected = array(array('id' => 1, 'label' => 'a'));
-	if (!try_handler(20, $link, $file, 'callback_replace_buffer', $expected))
-		printf("[008] Failure\n");
-
-	mysqli_close($link);
-	print "done!";
-?>
---CLEAN--
-<?php
-	require_once("clean_table.inc");
-?>
---EXPECTF--
-Callback set to 'callback_replace_buffer'
-Callback: 0
-Callback: 1
-Callback: 2
-Callback: 3
-Callback: 4
-Callback: 5
-Callback: 6
-Callback: 7
-Callback: 8
-Callback: 9
-Callback: 10
-done!
\ No newline at end of file
diff --git a/ext/mysqli/tests/mysqli_set_local_infile_handler_short_len.phpt b/ext/mysqli/tests/mysqli_set_local_infile_handler_short_len.phpt
deleted file mode 100644
index b3144e4..0000000
--- a/ext/mysqli/tests/mysqli_set_local_infile_handler_short_len.phpt
+++ /dev/null
@@ -1,101 +0,0 @@
---TEST--
-mysqli_set_local_infile_handler() - report shorter buffer
---SKIPIF--
-<?php
-require_once('skipif.inc');
-require_once('skipifemb.inc');
-require_once('skipifconnectfailure.inc');
-
-if (!function_exists('mysqli_set_local_infile_handler'))
-	die("skip - function not available.");
-
-require_once('connect.inc');
-if (!$TEST_EXPERIMENTAL)
-	die("skip - experimental (= unsupported) feature");
-
-if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
-	die("skip Cannot connect to MySQL");
-
-include_once("local_infile_tools.inc");
-if ($msg = check_local_infile_support($link, $engine))
-	die(sprintf("skip %s, [%d] %s", $msg, $link->errno, $link->error));
-
-mysqli_close($link);
-?>
---INI--
-mysqli.allow_local_infile=1
---FILE--
-<?php
-	require_once('connect.inc');
-	require_once('local_infile_tools.inc');
-	require_once('table.inc');
-
-	function callback_short_len($fp, &$buffer, $buflen, &$error) {
-		static $invocation = 0;
-
-		printf("Callback: %d\n", $invocation);
-
-		$invocation++;
-		if (!is_resource($fp))
-			printf("[012] First argument passed to callback is not a resource but %s/%s\n",
-				$fp, gettype($fp));
-
-		if (!$buffer = fread($fp, $buflen)) {
-			if ($invocation == 1) {
-				printf("[013] Cannot read from stream\n");
-				$error = 'Cannot read from stream';
-			} else {
-				return strlen($buffer);
-			}
-		}
-
-		$lines = explode("\n", $buffer);
-		if (count($lines) != 4 && strlen($buffer) > 0) {
-			printf("[014] Test is too simple to handle a buffer of size %d that cannot hold all lines\n", $buflen);
-			$error = 'Parser too simple';
-		}
-
-		$buffer = '';
-		foreach ($lines as $k => $line) {
-			if ('' === trim($line))
-					continue;
-
-			$columns = explode(';', $line);
-			if (empty($columns)) {
-				printf("[015] Cannot parse columns\n");
-				$error = 'Cannot parse columns';
-			}
-
-			// increase id column value
-			$columns[0] += 1;
-			$buffer .= implode(';', $columns);
-			$buffer .= "\n";
-		}
-
-		/* report the wrong length */
-		return strlen($buffer) - 1;
-	}
-
-	$file = create_standard_csv(1);
-	$expected = array(
-		array('id' => 98,   'label' => 'x'),
-		array('id' => 99,   'label' => 'y'),
-		array('id' => 100,  'label' => 'z'),
-	);
-	try_handler(20, $link, $file, 'callback_short_len', $expected);
-
-	mysqli_close($link);
-	print "done!";
-?>
---CLEAN--
-<?php
-	require_once("clean_table.inc");
-?>
---EXPECTF--
-Callback set to 'callback_short_len'
-Callback: 0
-
-Warning: mysqli_query(): Mismatch between the return value of the callback and the content length of the buffer. in %s on line %d
-[022] LOAD DATA failed, [2000] Mismatch between the return value of the callback and the content length of the buffer.
-[024/0] [0] ''
-done!
\ No newline at end of file
diff --git a/ext/mysqli/tests/mysqli_set_local_infile_handler_unregister.phpt b/ext/mysqli/tests/mysqli_set_local_infile_handler_unregister.phpt
deleted file mode 100644
index f287f4d..0000000
--- a/ext/mysqli/tests/mysqli_set_local_infile_handler_unregister.phpt
+++ /dev/null
@@ -1,64 +0,0 @@
---TEST--
-mysqli_set_local_infile_handler() - do not use the file pointer
---SKIPIF--
-<?php
-require_once('skipif.inc');
-require_once('skipifemb.inc');
-require_once('skipifconnectfailure.inc');
-
-if (!function_exists('mysqli_set_local_infile_handler'))
-	die("skip - function not available.");
-
-require_once('connect.inc');
-if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
-	die("skip Cannot connect to MySQL");
-
-include_once("local_infile_tools.inc");
-if ($msg = check_local_infile_support($link, $engine))
-	die(sprintf("skip %s, [%d] %s", $msg, $link->errno, $link->error));
-
-mysqli_close($link);
-?>
---INI--
-mysqli.allow_local_infile=1
---FILE--
-<?php
-	require_once('connect.inc');
-	require_once('local_infile_tools.inc');
-	require_once('table.inc');
-
-	function callback_unregister($fp, &$buffer, $buflen, &$error) {
-		global $link;
-		static $invocation = 0;
-
-		printf("Callback: %d\n", $invocation++);
-		flush();
-		if (is_resource($fp))
-				fclose($fp);
-		$buffer = "1;'a';\n";
-		if ($invocation > 10)
-			return 0;
-
-		mysqli_set_local_infile_default($link);
-		return strlen($buffer);
-	}
-
-	$file = create_standard_csv(1);
-	$expected = array(array('id' => 1, 'label' => 'a'));
-	try_handler(20, $link, $file, 'callback_unregister', $expected);
-
-	mysqli_close($link);
-	print "done!";
-?>
---CLEAN--
-<?php
-	require_once("clean_table.inc");
-?>
---EXPECTF--
-Callback set to 'callback_unregister'
-Callback: 0
-
-Warning: mysqli_query(): File handle closed in %s on line %d
-[022] LOAD DATA failed, [2000] File handle closed
-[024/0] [0] ''
-done!


commit 604d11ee6c267dcf5c886c68acc645a298f4d64e
Merge: 57f7bd0 75d23f5
Author: Xinchen Hui <laruence at php.net>
Date:   Thu May 3 18:41:45 2012 +0800

    Merge remote-tracking branch 'origin/PHP-5.4'



commit 75d23f571479b15e48e3f51aa6ec12759f5fef01
Merge: cdce62b bbf8a50
Author: Xinchen Hui <laruence at php.net>
Date:   Thu May 3 18:40:57 2012 +0800

    Merge remote-tracking branch 'origin/PHP-5.3' into PHP-5.4
    
    * origin/PHP-5.3:
      Fix typo



commit bbf8a50281ae46c6572bd5e68f62826cde356a28
Author: Xinchen Hui <laruence at php.net>
Date:   Thu May 3 18:37:19 2012 +0800

    Fix typo
    
    picked form pull request of reeze.xia at gmail.com

diff --git a/Zend/zend_interfaces.c b/Zend/zend_interfaces.c
index 218bad4..47dbe0b 100755
--- a/Zend/zend_interfaces.c
+++ b/Zend/zend_interfaces.c
@@ -127,7 +127,7 @@ ZEND_API zval *zend_user_it_new_iterator(zend_class_entry *ce, zval *object TSRM
 }
 /* }}} */
 
-/* {{{ zend_user_it_dtor */
+/* {{{ zend_user_it_invalidate_current */
 ZEND_API void zend_user_it_invalidate_current(zend_object_iterator *_iter TSRMLS_DC)
 {
 	zend_user_iterator *iter = (zend_user_iterator*)_iter;


commit 57f7bd0d858542cfc23a35b9f619137489c873f9
Author: andrey <andrey at php.net>
Date:   Thu May 3 12:22:25 2012 +0200

    remove dead and unused for more than 8 years code

diff --git a/ext/mysqli/mysqli_report.h b/ext/mysqli/mysqli_report.h
deleted file mode 100644
index 4035a4b..0000000
--- a/ext/mysqli/mysqli_report.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
-  +----------------------------------------------------------------------+
-  | PHP Version 5                                                        |
-  +----------------------------------------------------------------------+
-  | Copyright (c) 1997-2012 The PHP Group                                |
-  +----------------------------------------------------------------------+
-  | This source file is subject to version 3.01 of the PHP license,      |
-  | that is bundled with this package in the file LICENSE, and is        |
-  | available through the world-wide-web at the following url:           |
-  | http://www.php.net/license/3_01.txt                                  |
-  | If you did not receive a copy of the PHP license and are unable to   |
-  | obtain it through the world-wide-web, please send a note to          |
-  | license at php.net so we can mail you a copy immediately.               |
-  +----------------------------------------------------------------------+
-  | Author: Georg Richter <georg at php.net>                                |
-  +----------------------------------------------------------------------+
-
-  $Id$
-*/
-
-#ifndef __HAVE_MYSQLI_PROFILER_H__
-#define __HAVE_MYSQLI_PROFILER_H__
-
-#ifdef PHP_WIN32
-#include <process.h>
-#include <direct.h>
-#include "win32/time.h"
-#else
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <sys/time.h>
-#endif
-
-typedef struct {
-	struct timeval	starttime, 
-					endtime;		/* execution time */
-} PR_TIME_INFO;
-
-
-#define MYSQLI_PR_REPORT_STDERR		1
-#define MYSQLI_PR_REPORT_PORT		2
-
-
-
-/*** PROFILER MACROS ***/
-#define MYSQLI_PROFILER_STARTTIME(ptr) if (MyG(profiler.mode)) gettimeofday(&ptr.starttime, NULL)
-#define MYSQLI_PROFILER_ENDTIME(ptr) if (MyG(profiler.mode)) gettimeofday(&ptr.endtime, NULL)
-#define MYSQLI_PROFILER_REPORT(_type, _time, ptr) if (MyG(profiler.mode)) php_mysqli_profiler_report(_type, _time, (void *)ptr)
-
-
-
-#endif
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * indent-tabs-mode: t
- * End:
- * vim600: noet sw=4 ts=4 fdm=marker
- * vim<600: noet sw=4 ts=4
- */
diff --git a/ext/mysqli/package.xml b/ext/mysqli/package.xml
index 6de81d7..c27316a 100644
--- a/ext/mysqli/package.xml
+++ b/ext/mysqli/package.xml
@@ -43,7 +43,6 @@ package.xml added to support installation using pear installer
    <file role="src" name="mysqli_prop.c"/>
    <file role="src" name="mysqli_repl.c"/>
    <file role="src" name="mysqli_report.c"/>
-   <file role="src" name="mysqli_report.h"/>
    <file role="src" name="php_mysqli.h"/>
    <file role="doc" name="CREDITS"/>
    <file role="test" name="tests/001.phpt"/>
diff --git a/ext/mysqli/php_mysqli_structs.h b/ext/mysqli/php_mysqli_structs.h
index ed468e2..32e3e1e 100644
--- a/ext/mysqli/php_mysqli_structs.h
+++ b/ext/mysqli/php_mysqli_structs.h
@@ -131,12 +131,6 @@ typedef struct {
 } MY_MYSQL;
 
 typedef struct {
-	int			mode;
-	int			socket;
-	FILE		*fp;
-} PROFILER;
-
-typedef struct {
 	void				*ptr;		/* resource: (mysql, result, stmt)   */
 	void				*info;		/* additional buffer				 */
 	enum mysqli_status	status;		/* object status */


commit 62de1cfe3386190eeb9fc3f4cd9067e58fd88f18
Merge: cd9e4d1 cdce62b
Author: Anatoliy Belsky <ab at php.net>
Date:   Wed May 2 21:42:57 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug 61902 ext\phar\tests\phar_setsignaturealgo2.phpt falis



commit cdce62b724379ea2eb22c0cac426ca6db187d5d4
Merge: 6741949 69ed09a
Author: Anatoliy Belsky <ab at php.net>
Date:   Wed May 2 21:41:33 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug 61902 ext\phar\tests\phar_setsignaturealgo2.phpt falis



commit 69ed09a31c6ebb07c85013d1fab33b48efb438e1
Author: Anatoliy Belsky <ab at php.net>
Date:   Wed May 2 21:38:32 2012 +0200

    Fix bug 61902 ext\phar\tests\phar_setsignaturealgo2.phpt falis
    
    openssl needs explicit openssl.cnf on windows

diff --git a/ext/phar/tests/files/openssl.cnf b/ext/phar/tests/files/openssl.cnf
new file mode 100644
index 0000000..10e6907
--- /dev/null
+++ b/ext/phar/tests/files/openssl.cnf
@@ -0,0 +1,43 @@
+[ req ]
+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
+string_mask = MASK:4294967295
+
+
+[ req_distinguished_name ]
+countryName			= Country Name (2 letter code)
+countryName_default		= AU
+countryName_min			= 2
+countryName_max			= 2
+stateOrProvinceName		= State or Province Name (full name)
+stateOrProvinceName_default	= Some-State
+localityName			= Locality Name (eg, city)
+0.organizationName		= Organization Name (eg, company)
+0.organizationName_default	= Internet Widgits Pty Ltd
+organizationalUnitName		= Organizational Unit Name (eg, section)
+commonName			= Common Name (eg, YOUR name)
+commonName_max			= 64
+emailAddress			= Email Address
+emailAddress_max		= 64
+
+[ req_attributes ]
+challengePassword		= A challenge password
+challengePassword_min		= 4
+challengePassword_max		= 20
+unstructuredName		= An optional company name
+
+[ v3_req ]
+basicConstraints = CA:FALSE
+keyUsage = nonRepudiation, digitalSignature, keyEncipherment
+
+[ v3_ca ]
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid:always,issuer:always
+basicConstraints = CA:true
+
+[ usr_cert ]
+basicConstraints=CA:FALSE
+
diff --git a/ext/phar/tests/phar_setsignaturealgo2.phpt b/ext/phar/tests/phar_setsignaturealgo2.phpt
index 66edb61..9f548d0 100644
--- a/ext/phar/tests/phar_setsignaturealgo2.phpt
+++ b/ext/phar/tests/phar_setsignaturealgo2.phpt
@@ -34,9 +34,11 @@ var_dump($p->getSignature());
 echo $e->getMessage();
 }
 try {
+$config = dirname(__FILE__) . '/files/openssl.cnf';
+$config_arg = array('config' => $config);
 $private = openssl_get_privatekey(file_get_contents(dirname(__FILE__) . '/files/private.pem'));
 $pkey = '';
-openssl_pkey_export($private, $pkey);
+openssl_pkey_export($private, $pkey, NULL, $config_arg);
 $p->setSignatureAlgorithm(Phar::OPENSSL, $pkey);
 var_dump($p->getSignature());
 } catch (Exception $e) {


commit cd9e4d1defeb0d111221c6b8670ec39603dc49ff
Merge: 8c41e45 6741949
Author: andrey <andrey at php.net>
Date:   Wed May 2 16:15:35 2012 +0200

    Merge branch 'PHP-5.4'



commit 67419499b2869feb0ad91c022da78df7845ab00d
Merge: e25eea8 b42d000
Author: andrey <andrey at php.net>
Date:   Wed May 2 15:57:08 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4



commit b42d000471a1da27626d4fecb538069409ed61fd
Author: andrey <andrey at php.net>
Date:   Wed May 2 15:55:22 2012 +0200

    Fix for bug#61411
    
    Bug #61411 PDO Segfaults with PERSISTENT == TRUE && EMULATE_PREPARES == FALSE
    Wrong allocation, that doesn't follow the scheme of using stmt->persistent
    was the root cause of the problem and the crash at free.

diff --git a/ext/mysqlnd/mysqlnd_ps.c b/ext/mysqlnd/mysqlnd_ps.c
index b1ce6df..2044390 100644
--- a/ext/mysqlnd/mysqlnd_ps.c
+++ b/ext/mysqlnd/mysqlnd_ps.c
@@ -1630,9 +1630,9 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_one_result)(MYSQLND_STMT * const s, unsigned i
 		mysqlnd_stmt_separate_one_result_bind(s, param_no TSRMLS_CC);
 		/* Guaranteed is that stmt->result_bind is NULL */
 		if (!stmt->result_bind) {
-			stmt->result_bind = mnd_ecalloc(stmt->field_count, sizeof(MYSQLND_RESULT_BIND));
+			stmt->result_bind = mnd_pecalloc(stmt->field_count, sizeof(MYSQLND_RESULT_BIND), stmt->persistent);
 		} else {
-			stmt->result_bind = mnd_erealloc(stmt->result_bind, stmt->field_count * sizeof(MYSQLND_RESULT_BIND));
+			stmt->result_bind = mnd_perealloc(stmt->result_bind, stmt->field_count * sizeof(MYSQLND_RESULT_BIND), stmt->persistent);
 		}
 		if (!stmt->result_bind) {
 			DBG_RETURN(FAIL);
diff --git a/ext/pdo_mysql/tests/bug_61411.phpt b/ext/pdo_mysql/tests/bug_61411.phpt
new file mode 100644
index 0000000..794d307
--- /dev/null
+++ b/ext/pdo_mysql/tests/bug_61411.phpt
@@ -0,0 +1,53 @@
+--TEST--
+Bug #61411 (PDO Segfaults with PERSISTENT == TRUE && EMULATE_PREPARES == FALSE)
+--SKIPIF--
+<?php
+if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
+require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+MySQLPDOTest::skip();
+$db = MySQLPDOTest::factory();
+
+$row = $db->query('SELECT VERSION() as _version')->fetch(PDO::FETCH_ASSOC);
+$matches = array();
+if (!preg_match('/^(\d+)\.(\d+)\.(\d+)/ismU', $row['_version'], $matches))
+	die(sprintf("skip Cannot determine MySQL Server version\n"));
+
+$version = $matches[0] * 10000 + $matches[1] * 100 + $matches[2];
+if ($version < 40106)
+	die(sprintf("skip Need MySQL Server 4.1.6+, found %d.%02d.%02d (%d)\n",
+		$matches[0], $matches[1], $matches[2], $version));
+?>
+--FILE--
+<?php
+require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+
+$attr	= getenv('PDOTEST_ATTR');
+if (!$attr) {
+	$attr = array();
+} else {
+	$attr = unserialize($attr);
+}
+$attr[PDO::ATTR_PERSISTENT] = true;
+$attr[PDO::ATTR_EMULATE_PREPARES] = false;
+putenv('PDOTEST_ATTR='.serialize($attr));
+
+$db = MySQLPDOTest::factory();
+
+$stmt = $db->prepare("SELECT 1");
+$stmt->execute();
+
+foreach ($stmt as $line) {
+	var_dump($line);
+}
+
+print "done!";
+?>
+--EXPECTF--
+array(2) {
+  [1]=>
+  int(1)
+  [2]=>
+  int(1)
+}
+done!


commit 8c41e45eec83abdb57f0f3f447fdfee9c627caaf
Merge: a499dfc e25eea8
Author: Stanislav Malyshev <stas at php.net>
Date:   Wed May 2 00:11:19 2012 -0700

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      merge 5.3.11 stuff
      organize NEWS
      Revert "Fix bug #61537 (json_encode() incorrectly truncates/discards information) and"



commit e25eea8b838e22692c59cad1279a2e13970d5254
Author: Stanislav Malyshev <stas at php.net>
Date:   Wed May 2 00:08:04 2012 -0700

    merge 5.3.11 stuff

diff --git a/NEWS b/NEWS
index f0edcb7..8796cf4 100644
--- a/NEWS
+++ b/NEWS
@@ -599,6 +599,161 @@ PHP                                                                        NEWS
   . Fixed bug #55544 (ob_gzhandler always conflicts with zlib.output_compression).
     (Mike)
 
+26 Apr 2012, PHP 5.3.11
+
+- Core:
+  . Fixed bug #61605 (header_remove() does not remove all headers).
+    (Laruence)
+  . Fixed bug #61541 (Segfault when using ob_* in output_callback).
+    (reeze.xia at gmail.com)
+  . Fixed bug #61273 (call_user_func_array with more than 16333 arguments
+    leaks / crashes). (Laruence)
+  . Fixed bug #61165 (Segfault - strip_tags()). (Laruence)
+  . Improved max_input_vars directive to check nested variables (Dmitry).
+  . Fixed bug #61095 (Incorect lexing of 0x00*+<NUM>). (Etienne)
+  . Fixed bug #61087 (Memory leak in parse_ini_file when specifying
+    invalid scanner mode). (Nikic, Laruence)
+  . Fixed bug #61072 (Memory leak when restoring an exception handler).
+    (Nikic, Laruence)
+  . Fixed bug #61058 (array_fill leaks if start index is PHP_INT_MAX).
+    (Laruence)
+  . Fixed bug #61043 (Regression in magic_quotes_gpc fix for CVE-2012-0831).
+    (Ondřej Surý)
+  . Fixed bug #61000 (Exceeding max nesting level doesn't delete numerical
+    vars). (Laruence)
+  . Fixed bug #60895 (Possible invalid handler usage in windows random
+    functions). (Pierre)
+  . Fixed bug #60825 (Segfault when running symfony 2 tests).
+    (Dmitry, Laruence)
+  . Fixed bug #60801 (strpbrk() mishandles NUL byte). (Adam)
+  . Fixed bug #60569 (Nullbyte truncates Exception $message). (Ilia)
+  . Fixed bug #60227 (header() cannot detect the multi-line header with CR).
+    (rui, Gustavo)
+  . Fixed bug #60222 (time_nanosleep() does validate input params). (Ilia)
+  . Fixed bug #54374 (Insufficient validating of upload name leading to 
+    corrupted $_FILES indices). (CVE-2012-1172). (Stas, lekensteyn at
+    gmail dot com, Pierre)
+  . Fixed bug #52719 (array_walk_recursive crashes if third param of the
+    function is by reference). (Nikita Popov)
+  . Fixed bug #51860 (Include fails with toplevel symlink to /). (Dmitry)
+
+- DOM
+  . Added debug info handler to DOM objects. (Gustavo, Joey Smith)
+
+- FPM
+  . Fixed bug #61430 (Transposed memset() params in sapi/fpm/fpm/fpm_shm.c).
+    (michaelhood at gmail dot com, Ilia)
+
+- Ibase
+  . Fixed bug #60947 (Segmentation fault while executing ibase_db_info).
+    (Ilia)
+
+- Installation
+  . Fixed bug #61172 (Add Apache 2.4 support). (Chris Jones)
+
+- Fileinfo
+  . Fixed bug #61173 (Unable to detect error from finfo constructor). (Gustavo)
+
+- Firebird Database extension (ibase):
+  . Fixed bug #60802 (ibase_trans() gives segfault when passing params).
+
+- Libxml:
+  . Fixed bug #61617 (Libxml tests failed(ht is already destroyed)).
+    (Laruence)
+  . Fixed bug #61367 (open_basedir bypass using libxml RSHUTDOWN). 
+    (Tim Starling)
+
+- mysqli
+  . Fixed bug #61003 (mysql_stat() require a valid connection). (Johannes).
+
+- PDO_mysql
+  . Fixed bug #61207 (PDO::nextRowset() after a multi-statement query doesn't
+    always work). (Johannes)
+  . Fixed bug #61194 (PDO should export compression flag with myslqnd).
+    (Johannes)
+
+- PDO_odbc 
+  . Fixed bug #61212 (PDO ODBC Segfaults on SQL_SUCESS_WITH_INFO). (Ilia)
+
+- PDO_pgsql
+  . Fixed bug #61267 (pdo_pgsql's PDO::exec() returns the number of SELECTed
+    rows on postgresql >= 9). (ben dot pineau at gmail dot com)
+
+- PDO_Sqlite extension:
+  . Add createCollation support. (Damien)
+
+- Phar:
+  . Fixed bug #61184 (Phar::webPhar() generates headers with trailing NUL
+    bytes). (Nikic)
+
+- PHP-FPM SAPI:
+  . Fixed bug #60811 (php-fpm compilation problem). (rasmus)
+
+- Readline:
+  . Fixed bug #61088 (Memory leak in readline_callback_handler_install).
+    (Nikic, Laruence)
+  . Add open_basedir checks to readline_write_history and readline_read_history.
+    (Rasmus, reported by Mateusz Goik)
+
+- Reflection:
+  . Fixed bug #61388 (ReflectionObject:getProperties() issues invalid reads
+    when get_properties returns a hash table with (inaccessible) dynamic
+    numeric properties). (Gustavo)
+  . Fixed bug #60968 (Late static binding doesn't work with 
+    ReflectionMethod::invokeArgs()). (Laruence)
+
+- SOAP
+  . Fixed basic HTTP authentication for WSDL sub requests. (Dmitry)
+  . Fixed bug #60887 (SoapClient ignores user_agent option and sends no
+    User-Agent header). (carloschilazo at gmail dot com)
+  . Fixed bug #60842, #51775 (Chunked response parsing error when 
+    chunksize length line is > 10 bytes). (Ilia)
+  . Fixed bug #49853 (Soap Client stream context header option ignored).
+    (Dmitry)
+
+- SPL
+  . Fixed memory leak when calling SplFileInfo's constructor twice. (Felipe)
+  . Fixed bug #61418 (Segmentation fault when DirectoryIterator's or
+    FilesystemIterator's iterators are requested more than once without
+    having had its dtor callback called in between). (Gustavo)
+  . Fixed bug #61347 (inconsistent isset behavior of Arrayobject). (Laruence)
+  . Fixed bug #61326 (ArrayObject comparison). (Gustavo)
+
+- SQLite3 extension:
+  . Add createCollation() method. (Brad Dewar)
+
+- Session:
+  . Fixed bug #60860 (session.save_handler=user without defined function core
+    dumps). (Felipe)
+  . Fixed bug #60634 (Segmentation fault when trying to die() in
+    SessionHandler::write()). (Ilia)
+
+- Streams:
+  . Fixed bug #61371 (stream_context_create() causes memory leaks on use
+    streams_socket_create). (Gustavo)
+  . Fixed bug #61253 (Wrappers opened with errors concurrency problem on ZTS).
+    (Gustavo)
+  . Fixed bug #61115 (stream related segfault on fatal error in
+    php_stream_context_link). (Gustavo)
+  . Fixed bug #60817 (stream_get_line() reads from stream even when there is
+    already sufficient data buffered). stream_get_line() now behaves more like
+    fgets(), as is documented. (Gustavo)
+  . Further fix for bug #60455 (stream_get_line misbehaves if EOF is not
+    detected together with the last read). (Gustavo)
+  . Fixed bug #60106 (stream_socket_server silently truncates long unix
+    socket paths). (Ilia)
+
+- Tidy:
+  . Fixed bug #54682 (tidy null pointer dereference). (Tony, David Soria Parra)
+
+- XMLRPC:
+  . Fixed bug #61264 (xmlrpc_parse_method_descriptions leaks temporary
+    variable). (Nikita Popov)
+  . Fixed bug #61097 (Memory leak in xmlrpc functions copying zvals). (Nikic)
+
+- Zlib:
+  . Fixed bug #61139 (gzopen leaks when specifying invalid mode). (Nikic)
+
 02 Feb 2012, PHP 5.3.10
 
 - Core:


commit b0e8be8aeacc743125a7834aaf50b4fb8e6ca405
Author: Stanislav Malyshev <stas at php.net>
Date:   Wed May 2 00:00:59 2012 -0700

    organize NEWS

diff --git a/NEWS b/NEWS
index d538460..f0edcb7 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,6 @@
 PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-?? ??? 2012, PHP 5.4.1 RC1
+?? ??? 2012, PHP 5.4.2
 
 - CLI Server:
   . Fixed bug #61546 (functions related to current script failed when chdir() 
@@ -8,10 +8,6 @@ PHP                                                                        NEWS
   . Improved performance while sending error page, this also fixed
     bug #61785 (Memory leak when access a non-exists file without router).
     (Laruence)
-  . Fixed bug #61461 (missing checks around malloc() calls). (Ilia)
-  . Implemented FR #60850 (Built in web server does not set 
-    $_SERVER['SCRIPT_FILENAME'] when using router). (Laruence)
-  . "Connection: close" instead of "Connection: closed" (Gustavo)
 
 - Core:
   . Fixed missing bound check in iptcparse(). (chris at chiappa.net)
@@ -24,6 +20,32 @@ PHP                                                                        NEWS
   . Fixed bug #61650 (ini parser crashes when using ${xxxx} ini variables
     (without apache2)). (Laruence)
   . Fixed bug #61605 (header_remove() does not remove all headers). (Laruence)
+  . Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename
+    set to null). (Anatoliy)
+
+- FPM
+  . Fixed bug #61812 (Uninitialised value used in libmagic). 
+    (Laruence, Gustavo)
+
+- Libxml:
+  . Fixed bug #61617 (Libxml tests failed(ht is already destroyed)).
+    (Laruence)
+
+- Zlib:
+  . Fixed bug #61820 (using ob_gzhandler will complain about headers already 
+    sent when no compression). (Mike)
+  . Fixed bug #61443 (can't change zlib.output_compression on the fly). (Mike)
+
+26 Apr 2012, PHP 5.4.1
+
+- CLI Server:
+  . Fixed bug #61461 (missing checks around malloc() calls). (Ilia)
+  . Implemented FR #60850 (Built in web server does not set 
+    $_SERVER['SCRIPT_FILENAME'] when using router). (Laruence)
+  . "Connection: close" instead of "Connection: closed" (Gustavo)
+
+- Core:
+  . Fixed crash in ZTS using same class in many threads. (Johannes)
   . Fixed bug #61374 (html_entity_decode tries to decode code points that don't
     exist in ISO-8859-1). (Gustavo)
   . Fixed bug #61273 (call_user_func_array with more than 16333 arguments 
@@ -51,15 +73,14 @@ PHP                                                                        NEWS
   . Fixed bug #60573 (type hinting with "self" keyword causes weird errors).
     (Laruence)
   . Fixed bug #60569 (Nullbyte truncates Exception $message). (Ilia)
-  . Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename
-    set to null). (Anatoliy)
   . Fixed bug #52719 (array_walk_recursive crashes if third param of the
     function is by reference). (Nikita Popov)
   . Improve performance of set_exception_handler while doing reset (Laruence)
 
+- fileinfo:
+  . Fix fileinfo test problems. (Anatoliy Belsky)
+
 - FPM
-  . Fixed bug #61812 (Uninitialised value used in libmagic). 
-    (Laruence, Gustavo)
   . Fixed bug #61430 (Transposed memset() params in sapi/fpm/fpm/fpm_shm.c).
     (michaelhood at gmail dot com, Ilia)
 
@@ -74,10 +95,6 @@ PHP                                                                        NEWS
   . Fixed bug #61487 (Incorrent bounds checking in grapheme_strpos).
     (Stas)
 
-- Libxml:
-  . Fixed bug #61617 (Libxml tests failed(ht is already destroyed)).
-    (Laruence)
-
 - mbstring:
   . MFH mb_ereg_replace_callback() for security enhancements. (Rui)
 
@@ -146,9 +163,6 @@ PHP                                                                        NEWS
     Popov)
 
 - Zlib:
-  . Fixed bug #61820 (using ob_gzhandler will complain about headers already 
-    sent when no compression). (Mike)
-  . Fixed bug #61443 (can't change zlib.output_compression on the fly). (Mike)
   . Fixed bug #61306 (initialization of global inappropriate for ZTS). (Gustavo)
   . Fixed bug #61287 (A particular string fails to decompress). (Mike)
   . Fixed bug #61139 (gzopen leaks when specifying invalid mode). (Nikita Popov)


commit 7bbd5521d28ee77c5a8df80174f52dad0112e872
Author: Stanislav Malyshev <stas at php.net>
Date:   Tue May 1 23:51:41 2012 -0700

    Revert "Fix bug #61537 (json_encode() incorrectly truncates/discards information) and"
    
    This reverts commit cb2a1c71c96d7c9b2ee03d77beae0c8e0d385f1b.
    The fix is not correct, not fixed after discussion on github.
    Please fix the issues and reapply the patch

diff --git a/NEWS b/NEWS
index 11251eb..d538460 100644
--- a/NEWS
+++ b/NEWS
@@ -74,10 +74,6 @@ PHP                                                                        NEWS
   . Fixed bug #61487 (Incorrent bounds checking in grapheme_strpos).
     (Stas)
 
-- JSON
-  . Fixed bug #61537 (json_encode() incorrectly truncates/discards
-    information). (Adam)
-
 - Libxml:
   . Fixed bug #61617 (Libxml tests failed(ht is already destroyed)).
     (Laruence)
diff --git a/ext/json/json.c b/ext/json/json.c
index 853611e..fc1fcb7 100644
--- a/ext/json/json.c
+++ b/ext/json/json.c
@@ -96,7 +96,6 @@ static PHP_MINIT_FUNCTION(json)
 	REGISTER_LONG_CONSTANT("JSON_UNESCAPED_SLASHES", PHP_JSON_UNESCAPED_SLASHES, CONST_CS | CONST_PERSISTENT);
 	REGISTER_LONG_CONSTANT("JSON_PRETTY_PRINT", PHP_JSON_PRETTY_PRINT, CONST_CS | CONST_PERSISTENT);
 	REGISTER_LONG_CONSTANT("JSON_UNESCAPED_UNICODE", PHP_JSON_UNESCAPED_UNICODE, CONST_CS | CONST_PERSISTENT);
-	REGISTER_LONG_CONSTANT("JSON_PARTIAL_OUTPUT_ON_ERROR", PHP_JSON_PARTIAL_OUTPUT_ON_ERROR, CONST_CS | CONST_PERSISTENT);
 
 	REGISTER_LONG_CONSTANT("JSON_ERROR_NONE", PHP_JSON_ERROR_NONE, CONST_CS | CONST_PERSISTENT);
 	REGISTER_LONG_CONSTANT("JSON_ERROR_DEPTH", PHP_JSON_ERROR_DEPTH, CONST_CS | CONST_PERSISTENT);
@@ -390,7 +389,9 @@ static void json_escape_string(smart_str *buf, char *s, int len, int options TSR
 		}
 		if (ulen < 0) {
 			JSON_G(error_code) = PHP_JSON_ERROR_UTF8;
-			php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid UTF-8 sequence in argument");
+			if (!PG(display_errors)) {
+				php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid UTF-8 sequence in argument");
+			}
 			smart_str_appendl(buf, "null", 4);
 		} else {
 			smart_str_appendl(buf, "\"\"", 2);
@@ -688,11 +689,7 @@ static PHP_FUNCTION(json_encode)
 
 	php_json_encode(&buf, parameter, options TSRMLS_CC);
 
-	if (JSON_G(error_code) != PHP_JSON_ERROR_NONE && options ^ PHP_JSON_PARTIAL_OUTPUT_ON_ERROR) {
-		ZVAL_FALSE(return_value);
-	} else {
-		ZVAL_STRINGL(return_value, buf.c, buf.len, 1);
-	}
+	ZVAL_STRINGL(return_value, buf.c, buf.len, 1);
 
 	smart_str_free(&buf);
 }
diff --git a/ext/json/php_json.h b/ext/json/php_json.h
index 20426c0..ef3e4b5 100644
--- a/ext/json/php_json.h
+++ b/ext/json/php_json.h
@@ -63,7 +63,6 @@ extern zend_class_entry *php_json_serializable_ce;
 #define PHP_JSON_UNESCAPED_SLASHES	(1<<6)
 #define PHP_JSON_PRETTY_PRINT	(1<<7)
 #define PHP_JSON_UNESCAPED_UNICODE	(1<<8)
-#define PHP_JSON_PARTIAL_OUTPUT_ON_ERROR	(1<<9)
 
 /* Internal flags */
 #define PHP_JSON_OUTPUT_ARRAY	0
diff --git a/ext/json/tests/bug43941.phpt b/ext/json/tests/bug43941.phpt
new file mode 100644
index 0000000..0f86d1d
--- /dev/null
+++ b/ext/json/tests/bug43941.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Bug #43941 (json_encode() invalid UTF-8)
+--SKIPIF--
+<?php if (!extension_loaded("json")) print "skip"; ?>
+--FILE--
+<?php
+
+var_dump(json_encode("abc"));
+var_dump(json_encode("ab\xE0"));
+var_dump(json_encode("ab\xE0c"));
+var_dump(json_encode(array("ab\xE0", "ab\xE0c", "abc")));
+
+echo "Done\n";
+?>
+--EXPECTF--
+string(5) ""abc""
+string(4) "null"
+string(4) "null"
+string(17) "[null,null,"abc"]"
+Done
+
diff --git a/ext/json/tests/bug54058.phpt b/ext/json/tests/bug54058.phpt
index 08c7f57..3b1136b 100644
--- a/ext/json/tests/bug54058.phpt
+++ b/ext/json/tests/bug54058.phpt
@@ -29,14 +29,7 @@ json_encode($c);
 var_dump(json_last_error());
 ?>
 --EXPECTF--
-Warning: json_encode(): Invalid UTF-8 sequence in argument in %s on line %d
 int(5)
-
-Warning: json_encode(): Invalid UTF-8 sequence in argument in %s on line %d
 int(5)
-
-Warning: json_encode(): Invalid UTF-8 sequence in argument in %s on line %d
 int(5)
-
-Warning: json_encode(): Invalid UTF-8 sequence in argument in %s on line %d
 int(5)
diff --git a/ext/json/tests/bug61537.phpt b/ext/json/tests/bug61537.phpt
deleted file mode 100644
index e2abdda..0000000
--- a/ext/json/tests/bug61537.phpt
+++ /dev/null
@@ -1,30 +0,0 @@
---TEST--
-Bug #61537 (json_encode() incorrectly truncates/discards information)
---SKIPIF--
-<?php if (!extension_loaded("json")) print "skip"; ?>
---FILE--
-<?php
-$invalid_utf8 = "\x9f";
-var_dump(json_encode($invalid_utf8), json_last_error());
-var_dump(json_encode($invalid_utf8, JSON_PARTIAL_OUTPUT_ON_ERROR), json_last_error());
-
-$invalid_utf8 = "an invalid sequen\xce in the middle of a string";
-var_dump(json_encode($invalid_utf8), json_last_error());
-var_dump(json_encode($invalid_utf8, JSON_PARTIAL_OUTPUT_ON_ERROR), json_last_error());
-?>
---EXPECTF--
-Warning: json_encode(): Invalid UTF-8 sequence in argument in %s on line %d
-bool(false)
-int(5)
-
-Warning: json_encode(): Invalid UTF-8 sequence in argument in %s on line %d
-string(4) "null"
-int(5)
-
-Warning: json_encode(): Invalid UTF-8 sequence in argument in %s on line %d
-bool(false)
-int(5)
-
-Warning: json_encode(): Invalid UTF-8 sequence in argument in %s on line %d
-string(4) "null"
-int(5)


commit a499dfc37dde04f8d5f3c1cabaeef1cb5d985376
Merge: f2e8177 93192ec
Author: Christopher Jones <sixd at php.net>
Date:   Tue May 1 15:51:01 2012 -0700

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Make output order for dom007.phpt platform independent



commit 93192ec56df762341125f257cc61ab0c3e64ea76
Merge: cac09f3 72507d3
Author: Christopher Jones <sixd at php.net>
Date:   Tue May 1 15:49:19 2012 -0700

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Make output order for dom007.phpt platform independent



commit 72507d38fb6701471053ef6bee65dfbe63184ec9
Merge: 02e25df d14f233
Author: Christopher Jones <sixd at php.net>
Date:   Tue May 1 15:47:54 2012 -0700

    Merge branch 'bug61810' into PHP-5.3
    
    * bug61810:
      Make output order for dom007.phpt platform independent



commit d14f23365cda4e830aa09fcf1d64c07c4fde21c9
Author: Christopher Jones <sixd at php.net>
Date:   Tue May 1 15:43:31 2012 -0700

    Make output order for dom007.phpt platform independent
    
    This test has long been near the top of the reported output diffs.
    For example, on http://qa.php.net/reports/?version=5.4.0 it has diffed
    1307 times out of 3543 reports, at time of this commit.  (The second
    highest diff has occurred 710 times.)

diff --git a/ext/dom/tests/dom007.phpt b/ext/dom/tests/dom007.phpt
index 649d630..5d12aa3 100644
--- a/ext/dom/tests/dom007.phpt
+++ b/ext/dom/tests/dom007.phpt
@@ -63,12 +63,24 @@ echo "\n";
 $ents = $dtd->entities;
 $length = $ents->length;
 echo "Length: ".$length."\n";
+
+$xkeys = array();
 foreach ($ents AS $key=>$node) {
-	echo "Key: $key Name: ".$node->nodeName."\n";
+	$xkeys[] = "Key: $key Name: ".$node->nodeName."\n";
+}
+sort($xkeys);  // fix inconsistent output ordering (bug #61810)
+foreach ($xkeys as $key => $node) {
+	echo $node;
 }
 echo "\n";
+
+$xkeys = array();
 for($x=0; $x < $length; $x++) {
-	echo "Index $x: ".$ents->item($x)->nodeName."\n";
+	$xkeys[] = "Index: ".$ents->item($x)->nodeName."\n";
+}
+sort($xkeys);  // fix inconsistent output ordering (bug #61810)
+foreach ($xkeys as $key => $node) {
+	echo $node;
 }
 
 echo "\n";
@@ -87,13 +99,13 @@ Index 0: GIF (image/gif) (-)
 NULL
 
 Length: 3
-Key: test Name: test
-Key: rdf Name: rdf
 Key: myimage Name: myimage
+Key: rdf Name: rdf
+Key: test Name: test
 
-Index 0: test
-Index 1: rdf
-Index 2: myimage
+Index: myimage
+Index: rdf
+Index: test
 
 NULL
 NULL


commit f2e81779a70a7202df38084bbcb4f0a81397cbda
Merge: 1c2c620 cac09f3
Author: Christopher Jones <sixd at php.net>
Date:   Tue May 1 14:47:18 2012 -0700

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix masking in bug61115-1.phpt
    
    Conflicts:
    	Zend/zend_language_scanner.c
    	Zend/zend_language_scanner_defs.h



commit cac09f333384463613d1a27e79f9c7fa949f87db
Merge: 4deb0f1 02e25df
Author: Christopher Jones <sixd at php.net>
Date:   Tue May 1 14:34:54 2012 -0700

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix masking in bug61115-1.phpt



commit 02e25df8b5a7c60364c7153c03da59de3a556a87
Merge: d26e006 c864b1c
Author: Christopher Jones <sixd at php.net>
Date:   Tue May 1 14:33:57 2012 -0700

    Merge branch 'fix-bug61115-1.phpt-for-no-debug' into PHP-5.3
    
    * fix-bug61115-1.phpt-for-no-debug:
      Fix masking in bug61115-1.phpt



commit c864b1ca2f7bfaee43795085df7ee5b739c9aa5f
Author: Christopher Jones <sixd at php.net>
Date:   Tue May 1 14:32:09 2012 -0700

    Fix masking in bug61115-1.phpt
    
    The test bug61115-1.phpt was diffing for non-debug builds

diff --git a/ext/standard/tests/streams/bug61115-1.phpt b/ext/standard/tests/streams/bug61115-1.phpt
index 573496e..89374e7 100644
--- a/ext/standard/tests/streams/bug61115-1.phpt
+++ b/ext/standard/tests/streams/bug61115-1.phpt
@@ -8,4 +8,4 @@ stream_context_get_options($fileResourceTemp);
 ftruncate($fileResourceTemp, PHP_INT_MAX);
 ?>
 --EXPECTF--
-Fatal error: Allowed memory size of %d bytes exhausted %s (tried to allocate %d bytes) in %s on line %d
+Fatal error: Allowed memory size of %d bytes exhausted%s(tried to allocate %d bytes) in %s on line %d


commit 1c2c620a583ac9df213e57839aae2a7a7307b42e
Author: Felipe Pena <felipensp at gmail.com>
Date:   Mon Apr 30 15:57:09 2012 -0300

    - Regenerated files

diff --git a/Zend/zend_language_scanner.c b/Zend/zend_language_scanner.c
index 5d45155..0bfbac9 100644
--- a/Zend/zend_language_scanner.c
+++ b/Zend/zend_language_scanner.c
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Mon Apr 30 10:33:28 2012 */
+/* Generated by re2c 0.13.5 on Mon Apr 30 15:56:25 2012 */
 #line 1 "Zend/zend_language_scanner.l"
 /*
    +----------------------------------------------------------------------+
@@ -32,11 +32,12 @@
 #endif
 
 #include "zend_language_scanner_defs.h"
+
+#include <errno.h>
+#include "zend.h"
 #ifdef PHP_WIN32
 # include <Winuser.h>
 #endif
-#include <errno.h>
-#include "zend.h"
 #include "zend_alloc.h"
 #include <zend_language_parser.h>
 #include "zend_compile.h"
@@ -997,7 +998,7 @@ restart:
 yymore_restart:
 
 
-#line 1001 "Zend/zend_language_scanner.c"
+#line 1002 "Zend/zend_language_scanner.c"
 {
 	YYCTYPE yych;
 	unsigned int yyaccept = 0;
@@ -1096,7 +1097,7 @@ yyc_INITIAL:
 yy3:
 		YYDEBUG(3, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1790 "Zend/zend_language_scanner.l"
+#line 1791 "Zend/zend_language_scanner.l"
 		{
 	if (YYCURSOR > YYLIMIT) {
 		return 0;
@@ -1156,7 +1157,7 @@ inline_html:
 	HANDLE_NEWLINES(yytext, yyleng);
 	return T_INLINE_HTML;
 }
-#line 1160 "Zend/zend_language_scanner.c"
+#line 1161 "Zend/zend_language_scanner.c"
 yy4:
 		YYDEBUG(4, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1174,7 +1175,7 @@ yy5:
 yy6:
 		YYDEBUG(6, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1778 "Zend/zend_language_scanner.l"
+#line 1779 "Zend/zend_language_scanner.l"
 		{
 	if (CG(short_tags)) {
 		zendlval->value.str.val = yytext; /* no copying - intentional */
@@ -1186,14 +1187,14 @@ yy6:
 		goto inline_char_handler;
 	}
 }
-#line 1190 "Zend/zend_language_scanner.c"
+#line 1191 "Zend/zend_language_scanner.c"
 yy7:
 		YYDEBUG(7, *YYCURSOR);
 		++YYCURSOR;
 		if ((yych = *YYCURSOR) == '=') goto yy43;
 		YYDEBUG(8, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1755 "Zend/zend_language_scanner.l"
+#line 1756 "Zend/zend_language_scanner.l"
 		{
 	if (CG(asp_tags)) {
 		zendlval->value.str.val = yytext; /* no copying - intentional */
@@ -1205,7 +1206,7 @@ yy7:
 		goto inline_char_handler;
 	}
 }
-#line 1209 "Zend/zend_language_scanner.c"
+#line 1210 "Zend/zend_language_scanner.c"
 yy9:
 		YYDEBUG(9, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1391,7 +1392,7 @@ yy35:
 		++YYCURSOR;
 		YYDEBUG(38, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1715 "Zend/zend_language_scanner.l"
+#line 1716 "Zend/zend_language_scanner.l"
 		{
 	YYCTYPE *bracket = (YYCTYPE*)zend_memrchr(yytext, '<', yyleng - (sizeof("script language=php>") - 1));
 
@@ -1408,7 +1409,7 @@ yy35:
 	BEGIN(ST_IN_SCRIPTING);
 	return T_OPEN_TAG;
 }
-#line 1412 "Zend/zend_language_scanner.c"
+#line 1413 "Zend/zend_language_scanner.c"
 yy39:
 		YYDEBUG(39, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1435,7 +1436,7 @@ yy43:
 		++YYCURSOR;
 		YYDEBUG(44, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1733 "Zend/zend_language_scanner.l"
+#line 1734 "Zend/zend_language_scanner.l"
 		{
 	if (CG(asp_tags)) {
 		zendlval->value.str.val = yytext; /* no copying - intentional */
@@ -1447,13 +1448,13 @@ yy43:
 		goto inline_char_handler;
 	}
 }
-#line 1451 "Zend/zend_language_scanner.c"
+#line 1452 "Zend/zend_language_scanner.c"
 yy45:
 		YYDEBUG(45, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(46, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1746 "Zend/zend_language_scanner.l"
+#line 1747 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.str.val = yytext; /* no copying - intentional */
 	zendlval->value.str.len = yyleng;
@@ -1461,7 +1462,7 @@ yy45:
 	BEGIN(ST_IN_SCRIPTING);
 	return T_OPEN_TAG_WITH_ECHO;
 }
-#line 1465 "Zend/zend_language_scanner.c"
+#line 1466 "Zend/zend_language_scanner.c"
 yy47:
 		YYDEBUG(47, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1488,7 +1489,7 @@ yy50:
 yy51:
 		YYDEBUG(51, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1768 "Zend/zend_language_scanner.l"
+#line 1769 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.str.val = yytext; /* no copying - intentional */
 	zendlval->value.str.len = yyleng;
@@ -1497,7 +1498,7 @@ yy51:
 	BEGIN(ST_IN_SCRIPTING);
 	return T_OPEN_TAG;
 }
-#line 1501 "Zend/zend_language_scanner.c"
+#line 1502 "Zend/zend_language_scanner.c"
 yy52:
 		YYDEBUG(52, *YYCURSOR);
 		++YYCURSOR;
@@ -1568,7 +1569,7 @@ yyc_ST_BACKQUOTE:
 yy56:
 		YYDEBUG(56, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2241 "Zend/zend_language_scanner.l"
+#line 2242 "Zend/zend_language_scanner.l"
 		{
 	if (YYCURSOR > YYLIMIT) {
 		return 0;
@@ -1609,7 +1610,7 @@ yy56:
 	zend_scan_escape_string(zendlval, yytext, yyleng, '`' TSRMLS_CC);
 	return T_ENCAPSED_AND_WHITESPACE;
 }
-#line 1613 "Zend/zend_language_scanner.c"
+#line 1614 "Zend/zend_language_scanner.c"
 yy57:
 		YYDEBUG(57, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1620,12 +1621,12 @@ yy58:
 		++YYCURSOR;
 		YYDEBUG(59, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2185 "Zend/zend_language_scanner.l"
+#line 2186 "Zend/zend_language_scanner.l"
 		{
 	BEGIN(ST_IN_SCRIPTING);
 	return '`';
 }
-#line 1629 "Zend/zend_language_scanner.c"
+#line 1630 "Zend/zend_language_scanner.c"
 yy60:
 		YYDEBUG(60, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1635,14 +1636,14 @@ yy61:
 		++YYCURSOR;
 		YYDEBUG(62, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2172 "Zend/zend_language_scanner.l"
+#line 2173 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.lval = (long) '{';
 	yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
 	yyless(1);
 	return T_CURLY_OPEN;
 }
-#line 1646 "Zend/zend_language_scanner.c"
+#line 1647 "Zend/zend_language_scanner.c"
 yy63:
 		YYDEBUG(63, *YYCURSOR);
 		yyaccept = 0;
@@ -1658,24 +1659,24 @@ yy63:
 yy65:
 		YYDEBUG(65, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1872 "Zend/zend_language_scanner.l"
+#line 1873 "Zend/zend_language_scanner.l"
 		{
 	zend_copy_value(zendlval, (yytext+1), (yyleng-1));
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 1668 "Zend/zend_language_scanner.c"
+#line 1669 "Zend/zend_language_scanner.c"
 yy66:
 		YYDEBUG(66, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(67, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1448 "Zend/zend_language_scanner.l"
+#line 1449 "Zend/zend_language_scanner.l"
 		{
 	yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC);
 	return T_DOLLAR_OPEN_CURLY_BRACES;
 }
-#line 1679 "Zend/zend_language_scanner.c"
+#line 1680 "Zend/zend_language_scanner.c"
 yy68:
 		YYDEBUG(68, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1689,7 +1690,7 @@ yy70:
 		++YYCURSOR;
 		YYDEBUG(71, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1864 "Zend/zend_language_scanner.l"
+#line 1865 "Zend/zend_language_scanner.l"
 		{
 	yyless(yyleng - 1);
 	yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
@@ -1697,7 +1698,7 @@ yy70:
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 1701 "Zend/zend_language_scanner.c"
+#line 1702 "Zend/zend_language_scanner.c"
 yy72:
 		YYDEBUG(72, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1715,7 +1716,7 @@ yy73:
 		++YYCURSOR;
 		YYDEBUG(74, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1854 "Zend/zend_language_scanner.l"
+#line 1855 "Zend/zend_language_scanner.l"
 		{
 	yyless(yyleng - 3);
 	yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
@@ -1723,7 +1724,7 @@ yy73:
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 1727 "Zend/zend_language_scanner.c"
+#line 1728 "Zend/zend_language_scanner.c"
 	}
 /* *********************************** */
 yyc_ST_DOUBLE_QUOTES:
@@ -1791,7 +1792,7 @@ yy77:
 yy78:
 		YYDEBUG(78, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2191 "Zend/zend_language_scanner.l"
+#line 2192 "Zend/zend_language_scanner.l"
 		{
 	if (GET_DOUBLE_QUOTES_SCANNED_LENGTH()) {
 		YYCURSOR += GET_DOUBLE_QUOTES_SCANNED_LENGTH() - 1;
@@ -1840,7 +1841,7 @@ double_quotes_scan_done:
 	zend_scan_escape_string(zendlval, yytext, yyleng, '"' TSRMLS_CC);
 	return T_ENCAPSED_AND_WHITESPACE;
 }
-#line 1844 "Zend/zend_language_scanner.c"
+#line 1845 "Zend/zend_language_scanner.c"
 yy79:
 		YYDEBUG(79, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1851,12 +1852,12 @@ yy80:
 		++YYCURSOR;
 		YYDEBUG(81, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2180 "Zend/zend_language_scanner.l"
+#line 2181 "Zend/zend_language_scanner.l"
 		{
 	BEGIN(ST_IN_SCRIPTING);
 	return '"';
 }
-#line 1860 "Zend/zend_language_scanner.c"
+#line 1861 "Zend/zend_language_scanner.c"
 yy82:
 		YYDEBUG(82, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1866,14 +1867,14 @@ yy83:
 		++YYCURSOR;
 		YYDEBUG(84, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2172 "Zend/zend_language_scanner.l"
+#line 2173 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.lval = (long) '{';
 	yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
 	yyless(1);
 	return T_CURLY_OPEN;
 }
-#line 1877 "Zend/zend_language_scanner.c"
+#line 1878 "Zend/zend_language_scanner.c"
 yy85:
 		YYDEBUG(85, *YYCURSOR);
 		yyaccept = 0;
@@ -1889,24 +1890,24 @@ yy85:
 yy87:
 		YYDEBUG(87, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1872 "Zend/zend_language_scanner.l"
+#line 1873 "Zend/zend_language_scanner.l"
 		{
 	zend_copy_value(zendlval, (yytext+1), (yyleng-1));
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 1899 "Zend/zend_language_scanner.c"
+#line 1900 "Zend/zend_language_scanner.c"
 yy88:
 		YYDEBUG(88, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(89, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1448 "Zend/zend_language_scanner.l"
+#line 1449 "Zend/zend_language_scanner.l"
 		{
 	yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC);
 	return T_DOLLAR_OPEN_CURLY_BRACES;
 }
-#line 1910 "Zend/zend_language_scanner.c"
+#line 1911 "Zend/zend_language_scanner.c"
 yy90:
 		YYDEBUG(90, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1920,7 +1921,7 @@ yy92:
 		++YYCURSOR;
 		YYDEBUG(93, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1864 "Zend/zend_language_scanner.l"
+#line 1865 "Zend/zend_language_scanner.l"
 		{
 	yyless(yyleng - 1);
 	yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
@@ -1928,7 +1929,7 @@ yy92:
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 1932 "Zend/zend_language_scanner.c"
+#line 1933 "Zend/zend_language_scanner.c"
 yy94:
 		YYDEBUG(94, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1946,7 +1947,7 @@ yy95:
 		++YYCURSOR;
 		YYDEBUG(96, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1854 "Zend/zend_language_scanner.l"
+#line 1855 "Zend/zend_language_scanner.l"
 		{
 	yyless(yyleng - 3);
 	yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
@@ -1954,7 +1955,7 @@ yy95:
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 1958 "Zend/zend_language_scanner.c"
+#line 1959 "Zend/zend_language_scanner.c"
 	}
 /* *********************************** */
 yyc_ST_END_HEREDOC:
@@ -1965,7 +1966,7 @@ yyc_ST_END_HEREDOC:
 	++YYCURSOR;
 	YYDEBUG(100, *YYCURSOR);
 	yyleng = YYCURSOR - SCNG(yy_text);
-#line 2159 "Zend/zend_language_scanner.l"
+#line 2160 "Zend/zend_language_scanner.l"
 	{
 	YYCURSOR += CG(heredoc_len) - 1;
 	yyleng = CG(heredoc_len);
@@ -1977,7 +1978,7 @@ yyc_ST_END_HEREDOC:
 	BEGIN(ST_IN_SCRIPTING);
 	return T_END_HEREDOC;
 }
-#line 1981 "Zend/zend_language_scanner.c"
+#line 1982 "Zend/zend_language_scanner.c"
 /* *********************************** */
 yyc_ST_HEREDOC:
 	{
@@ -2039,7 +2040,7 @@ yy103:
 yy104:
 		YYDEBUG(104, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2283 "Zend/zend_language_scanner.l"
+#line 2284 "Zend/zend_language_scanner.l"
 		{
 	int newline = 0;
 
@@ -2110,7 +2111,7 @@ heredoc_scan_done:
 	zend_scan_escape_string(zendlval, yytext, yyleng - newline, 0 TSRMLS_CC);
 	return T_ENCAPSED_AND_WHITESPACE;
 }
-#line 2114 "Zend/zend_language_scanner.c"
+#line 2115 "Zend/zend_language_scanner.c"
 yy105:
 		YYDEBUG(105, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -2125,14 +2126,14 @@ yy107:
 		++YYCURSOR;
 		YYDEBUG(108, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2172 "Zend/zend_language_scanner.l"
+#line 2173 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.lval = (long) '{';
 	yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
 	yyless(1);
 	return T_CURLY_OPEN;
 }
-#line 2136 "Zend/zend_language_scanner.c"
+#line 2137 "Zend/zend_language_scanner.c"
 yy109:
 		YYDEBUG(109, *YYCURSOR);
 		yyaccept = 0;
@@ -2148,24 +2149,24 @@ yy109:
 yy111:
 		YYDEBUG(111, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1872 "Zend/zend_language_scanner.l"
+#line 1873 "Zend/zend_language_scanner.l"
 		{
 	zend_copy_value(zendlval, (yytext+1), (yyleng-1));
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 2158 "Zend/zend_language_scanner.c"
+#line 2159 "Zend/zend_language_scanner.c"
 yy112:
 		YYDEBUG(112, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(113, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1448 "Zend/zend_language_scanner.l"
+#line 1449 "Zend/zend_language_scanner.l"
 		{
 	yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC);
 	return T_DOLLAR_OPEN_CURLY_BRACES;
 }
-#line 2169 "Zend/zend_language_scanner.c"
+#line 2170 "Zend/zend_language_scanner.c"
 yy114:
 		YYDEBUG(114, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -2179,7 +2180,7 @@ yy116:
 		++YYCURSOR;
 		YYDEBUG(117, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1864 "Zend/zend_language_scanner.l"
+#line 1865 "Zend/zend_language_scanner.l"
 		{
 	yyless(yyleng - 1);
 	yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
@@ -2187,7 +2188,7 @@ yy116:
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 2191 "Zend/zend_language_scanner.c"
+#line 2192 "Zend/zend_language_scanner.c"
 yy118:
 		YYDEBUG(118, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -2205,7 +2206,7 @@ yy119:
 		++YYCURSOR;
 		YYDEBUG(120, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1854 "Zend/zend_language_scanner.l"
+#line 1855 "Zend/zend_language_scanner.l"
 		{
 	yyless(yyleng - 3);
 	yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
@@ -2213,7 +2214,7 @@ yy119:
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 2217 "Zend/zend_language_scanner.c"
+#line 2218 "Zend/zend_language_scanner.c"
 	}
 /* *********************************** */
 yyc_ST_IN_SCRIPTING:
@@ -2394,13 +2395,13 @@ yy123:
 yy124:
 		YYDEBUG(124, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1895 "Zend/zend_language_scanner.l"
+#line 1896 "Zend/zend_language_scanner.l"
 		{
 	zend_copy_value(zendlval, yytext, yyleng);
 	zendlval->type = IS_STRING;
 	return T_STRING;
 }
-#line 2404 "Zend/zend_language_scanner.c"
+#line 2405 "Zend/zend_language_scanner.c"
 yy125:
 		YYDEBUG(125, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -2626,11 +2627,11 @@ yy137:
 yy138:
 		YYDEBUG(138, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1437 "Zend/zend_language_scanner.l"
+#line 1438 "Zend/zend_language_scanner.l"
 		{
 	return yytext[0];
 }
-#line 2634 "Zend/zend_language_scanner.c"
+#line 2635 "Zend/zend_language_scanner.c"
 yy139:
 		YYDEBUG(139, *YYCURSOR);
 		++YYCURSOR;
@@ -2639,7 +2640,7 @@ yy139:
 yy140:
 		YYDEBUG(140, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1168 "Zend/zend_language_scanner.l"
+#line 1169 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.str.val = yytext; /* no copying - intentional */
 	zendlval->value.str.len = yyleng;
@@ -2647,7 +2648,7 @@ yy140:
 	HANDLE_NEWLINES(yytext, yyleng);
 	return T_WHITESPACE;
 }
-#line 2651 "Zend/zend_language_scanner.c"
+#line 2652 "Zend/zend_language_scanner.c"
 yy141:
 		YYDEBUG(141, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -2658,11 +2659,11 @@ yy142:
 		++YYCURSOR;
 		YYDEBUG(143, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1197 "Zend/zend_language_scanner.l"
+#line 1198 "Zend/zend_language_scanner.l"
 		{
 	return T_NS_SEPARATOR;
 }
-#line 2666 "Zend/zend_language_scanner.c"
+#line 2667 "Zend/zend_language_scanner.c"
 yy144:
 		YYDEBUG(144, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -2890,18 +2891,18 @@ yy167:
 		++YYCURSOR;
 		YYDEBUG(168, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1442 "Zend/zend_language_scanner.l"
+#line 1443 "Zend/zend_language_scanner.l"
 		{
 	yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
 	return '{';
 }
-#line 2899 "Zend/zend_language_scanner.c"
+#line 2900 "Zend/zend_language_scanner.c"
 yy169:
 		YYDEBUG(169, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(170, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1454 "Zend/zend_language_scanner.l"
+#line 1455 "Zend/zend_language_scanner.l"
 		{
 	RESET_DOC_COMMENT();
 	if (!zend_stack_is_empty(&SCNG(state_stack))) {
@@ -2909,7 +2910,7 @@ yy169:
 	}
 	return '}';
 }
-#line 2913 "Zend/zend_language_scanner.c"
+#line 2914 "Zend/zend_language_scanner.c"
 yy171:
 		YYDEBUG(171, *YYCURSOR);
 		yyaccept = 2;
@@ -2937,7 +2938,7 @@ yy171:
 yy172:
 		YYDEBUG(172, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1505 "Zend/zend_language_scanner.l"
+#line 1506 "Zend/zend_language_scanner.l"
 		{
 	if (yyleng < MAX_LENGTH_OF_LONG - 1) { /* Won't overflow */
 		zendlval->value.lval = strtol(yytext, NULL, 0);
@@ -2958,7 +2959,7 @@ yy172:
 	zendlval->type = IS_LONG;
 	return T_LNUMBER;
 }
-#line 2962 "Zend/zend_language_scanner.c"
+#line 2963 "Zend/zend_language_scanner.c"
 yy173:
 		YYDEBUG(173, *YYCURSOR);
 		yyaccept = 2;
@@ -2986,7 +2987,7 @@ yy175:
 yy176:
 		YYDEBUG(176, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1902 "Zend/zend_language_scanner.l"
+#line 1903 "Zend/zend_language_scanner.l"
 		{
 	while (YYCURSOR < YYLIMIT) {
 		switch (*YYCURSOR++) {
@@ -3020,14 +3021,14 @@ yy176:
 
 	return T_COMMENT;
 }
-#line 3024 "Zend/zend_language_scanner.c"
+#line 3025 "Zend/zend_language_scanner.c"
 yy177:
 		YYDEBUG(177, *YYCURSOR);
 		++YYCURSOR;
 yy178:
 		YYDEBUG(178, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1993 "Zend/zend_language_scanner.l"
+#line 1994 "Zend/zend_language_scanner.l"
 		{
 	register char *s, *t;
 	char *end;
@@ -3095,14 +3096,14 @@ yy178:
 	}
 	return T_CONSTANT_ENCAPSED_STRING;
 }
-#line 3099 "Zend/zend_language_scanner.c"
+#line 3100 "Zend/zend_language_scanner.c"
 yy179:
 		YYDEBUG(179, *YYCURSOR);
 		++YYCURSOR;
 yy180:
 		YYDEBUG(180, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2062 "Zend/zend_language_scanner.l"
+#line 2063 "Zend/zend_language_scanner.l"
 		{
 	int bprefix = (yytext[0] != '"') ? 1 : 0;
 
@@ -3143,24 +3144,24 @@ yy180:
 	BEGIN(ST_DOUBLE_QUOTES);
 	return '"';
 }
-#line 3147 "Zend/zend_language_scanner.c"
+#line 3148 "Zend/zend_language_scanner.c"
 yy181:
 		YYDEBUG(181, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(182, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2153 "Zend/zend_language_scanner.l"
+#line 2154 "Zend/zend_language_scanner.l"
 		{
 	BEGIN(ST_BACKQUOTE);
 	return '`';
 }
-#line 3158 "Zend/zend_language_scanner.c"
+#line 3159 "Zend/zend_language_scanner.c"
 yy183:
 		YYDEBUG(183, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(184, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2411 "Zend/zend_language_scanner.l"
+#line 2412 "Zend/zend_language_scanner.l"
 		{
 	if (YYCURSOR > YYLIMIT) {
 		return 0;
@@ -3169,7 +3170,7 @@ yy183:
 	zend_error(E_COMPILE_WARNING,"Unexpected character in input:  '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE);
 	goto restart;
 }
-#line 3173 "Zend/zend_language_scanner.c"
+#line 3174 "Zend/zend_language_scanner.c"
 yy185:
 		YYDEBUG(185, *YYCURSOR);
 		++YYCURSOR;
@@ -3196,13 +3197,13 @@ yy187:
 yy189:
 		YYDEBUG(189, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1570 "Zend/zend_language_scanner.l"
+#line 1571 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.dval = zend_strtod(yytext, NULL);
 	zendlval->type = IS_DOUBLE;
 	return T_DNUMBER;
 }
-#line 3206 "Zend/zend_language_scanner.c"
+#line 3207 "Zend/zend_language_scanner.c"
 yy190:
 		YYDEBUG(190, *YYCURSOR);
 		yyaccept = 2;
@@ -3294,7 +3295,7 @@ yy199:
 		}
 		YYDEBUG(201, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1480 "Zend/zend_language_scanner.l"
+#line 1481 "Zend/zend_language_scanner.l"
 		{
 	char *bin = yytext + 2; /* Skip "0b" */
 	int len = yyleng - 2;
@@ -3319,7 +3320,7 @@ yy199:
 		return T_DNUMBER;
 	}
 }
-#line 3323 "Zend/zend_language_scanner.c"
+#line 3324 "Zend/zend_language_scanner.c"
 yy202:
 		YYDEBUG(202, *YYCURSOR);
 		++YYCURSOR;
@@ -3331,7 +3332,7 @@ yy202:
 		}
 		YYDEBUG(204, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1526 "Zend/zend_language_scanner.l"
+#line 1527 "Zend/zend_language_scanner.l"
 		{
 	char *hex = yytext + 2; /* Skip "0x" */
 	int len = yyleng - 2;
@@ -3356,7 +3357,7 @@ yy202:
 		return T_DNUMBER;
 	}
 }
-#line 3360 "Zend/zend_language_scanner.c"
+#line 3361 "Zend/zend_language_scanner.c"
 yy205:
 		YYDEBUG(205, *YYCURSOR);
 		++YYCURSOR;
@@ -3365,7 +3366,7 @@ yy205:
 yy206:
 		YYDEBUG(206, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1970 "Zend/zend_language_scanner.l"
+#line 1971 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.str.val = yytext; /* no copying - intentional */
 	zendlval->value.str.len = yyleng;
@@ -3373,7 +3374,7 @@ yy206:
 	BEGIN(INITIAL);
 	return T_CLOSE_TAG;  /* implicit ';' at php-end tag */
 }
-#line 3377 "Zend/zend_language_scanner.c"
+#line 3378 "Zend/zend_language_scanner.c"
 yy207:
 		YYDEBUG(207, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -3407,13 +3408,13 @@ yy209:
 yy211:
 		YYDEBUG(211, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1872 "Zend/zend_language_scanner.l"
+#line 1873 "Zend/zend_language_scanner.l"
 		{
 	zend_copy_value(zendlval, (yytext+1), (yyleng-1));
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 3417 "Zend/zend_language_scanner.c"
+#line 3418 "Zend/zend_language_scanner.c"
 yy212:
 		YYDEBUG(212, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -3427,11 +3428,11 @@ yy213:
 		}
 		YYDEBUG(214, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1425 "Zend/zend_language_scanner.l"
+#line 1426 "Zend/zend_language_scanner.l"
 		{
 	return T_LOGICAL_XOR;
 }
-#line 3435 "Zend/zend_language_scanner.c"
+#line 3436 "Zend/zend_language_scanner.c"
 yy215:
 		YYDEBUG(215, *YYCURSOR);
 		++YYCURSOR;
@@ -3440,61 +3441,61 @@ yy215:
 		}
 		YYDEBUG(216, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1417 "Zend/zend_language_scanner.l"
+#line 1418 "Zend/zend_language_scanner.l"
 		{
 	return T_LOGICAL_OR;
 }
-#line 3448 "Zend/zend_language_scanner.c"
+#line 3449 "Zend/zend_language_scanner.c"
 yy217:
 		YYDEBUG(217, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(218, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1405 "Zend/zend_language_scanner.l"
+#line 1406 "Zend/zend_language_scanner.l"
 		{
 	return T_XOR_EQUAL;
 }
-#line 3458 "Zend/zend_language_scanner.c"
+#line 3459 "Zend/zend_language_scanner.c"
 yy219:
 		YYDEBUG(219, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(220, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1409 "Zend/zend_language_scanner.l"
+#line 1410 "Zend/zend_language_scanner.l"
 		{
 	return T_BOOLEAN_OR;
 }
-#line 3468 "Zend/zend_language_scanner.c"
+#line 3469 "Zend/zend_language_scanner.c"
 yy221:
 		YYDEBUG(221, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(222, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1401 "Zend/zend_language_scanner.l"
+#line 1402 "Zend/zend_language_scanner.l"
 		{
 	return T_OR_EQUAL;
 }
-#line 3478 "Zend/zend_language_scanner.c"
+#line 3479 "Zend/zend_language_scanner.c"
 yy223:
 		YYDEBUG(223, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(224, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1413 "Zend/zend_language_scanner.l"
+#line 1414 "Zend/zend_language_scanner.l"
 		{
 	return T_BOOLEAN_AND;
 }
-#line 3488 "Zend/zend_language_scanner.c"
+#line 3489 "Zend/zend_language_scanner.c"
 yy225:
 		YYDEBUG(225, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(226, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1397 "Zend/zend_language_scanner.l"
+#line 1398 "Zend/zend_language_scanner.l"
 		{
 	return T_AND_EQUAL;
 }
-#line 3498 "Zend/zend_language_scanner.c"
+#line 3499 "Zend/zend_language_scanner.c"
 yy227:
 		YYDEBUG(227, *YYCURSOR);
 		++YYCURSOR;
@@ -3503,7 +3504,7 @@ yy227:
 yy228:
 		YYDEBUG(228, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1979 "Zend/zend_language_scanner.l"
+#line 1980 "Zend/zend_language_scanner.l"
 		{
 	if (CG(asp_tags)) {
 		BEGIN(INITIAL);
@@ -3516,17 +3517,17 @@ yy228:
 		return yytext[0];
 	}
 }
-#line 3520 "Zend/zend_language_scanner.c"
+#line 3521 "Zend/zend_language_scanner.c"
 yy229:
 		YYDEBUG(229, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(230, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1385 "Zend/zend_language_scanner.l"
+#line 1386 "Zend/zend_language_scanner.l"
 		{
 	return T_MOD_EQUAL;
 }
-#line 3530 "Zend/zend_language_scanner.c"
+#line 3531 "Zend/zend_language_scanner.c"
 yy231:
 		YYDEBUG(231, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -3557,11 +3558,11 @@ yy235:
 		++YYCURSOR;
 		YYDEBUG(236, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1381 "Zend/zend_language_scanner.l"
+#line 1382 "Zend/zend_language_scanner.l"
 		{
 	return T_CONCAT_EQUAL;
 }
-#line 3565 "Zend/zend_language_scanner.c"
+#line 3566 "Zend/zend_language_scanner.c"
 yy237:
 		YYDEBUG(237, *YYCURSOR);
 		yyaccept = 4;
@@ -3570,7 +3571,7 @@ yy237:
 yy238:
 		YYDEBUG(238, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1936 "Zend/zend_language_scanner.l"
+#line 1937 "Zend/zend_language_scanner.l"
 		{
 	int doc_com;
 
@@ -3604,7 +3605,7 @@ yy238:
 
 	return T_COMMENT;
 }
-#line 3608 "Zend/zend_language_scanner.c"
+#line 3609 "Zend/zend_language_scanner.c"
 yy239:
 		YYDEBUG(239, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -3614,11 +3615,11 @@ yy240:
 		++YYCURSOR;
 		YYDEBUG(241, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1377 "Zend/zend_language_scanner.l"
+#line 1378 "Zend/zend_language_scanner.l"
 		{
 	return T_DIV_EQUAL;
 }
-#line 3622 "Zend/zend_language_scanner.c"
+#line 3623 "Zend/zend_language_scanner.c"
 yy242:
 		YYDEBUG(242, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -3641,42 +3642,42 @@ yy245:
 		++YYCURSOR;
 		YYDEBUG(246, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1373 "Zend/zend_language_scanner.l"
+#line 1374 "Zend/zend_language_scanner.l"
 		{
 	return T_MUL_EQUAL;
 }
-#line 3649 "Zend/zend_language_scanner.c"
+#line 3650 "Zend/zend_language_scanner.c"
 yy247:
 		YYDEBUG(247, *YYCURSOR);
 		++YYCURSOR;
 		if ((yych = *YYCURSOR) == '=') goto yy251;
 		YYDEBUG(248, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1433 "Zend/zend_language_scanner.l"
+#line 1434 "Zend/zend_language_scanner.l"
 		{
 	return T_SR;
 }
-#line 3660 "Zend/zend_language_scanner.c"
+#line 3661 "Zend/zend_language_scanner.c"
 yy249:
 		YYDEBUG(249, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(250, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1361 "Zend/zend_language_scanner.l"
+#line 1362 "Zend/zend_language_scanner.l"
 		{
 	return T_IS_GREATER_OR_EQUAL;
 }
-#line 3670 "Zend/zend_language_scanner.c"
+#line 3671 "Zend/zend_language_scanner.c"
 yy251:
 		YYDEBUG(251, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(252, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1393 "Zend/zend_language_scanner.l"
+#line 1394 "Zend/zend_language_scanner.l"
 		{
 	return T_SR_EQUAL;
 }
-#line 3680 "Zend/zend_language_scanner.c"
+#line 3681 "Zend/zend_language_scanner.c"
 yy253:
 		YYDEBUG(253, *YYCURSOR);
 		yyaccept = 5;
@@ -3687,11 +3688,11 @@ yy253:
 yy254:
 		YYDEBUG(254, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1429 "Zend/zend_language_scanner.l"
+#line 1430 "Zend/zend_language_scanner.l"
 		{
 	return T_SL;
 }
-#line 3695 "Zend/zend_language_scanner.c"
+#line 3696 "Zend/zend_language_scanner.c"
 yy255:
 		YYDEBUG(255, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -3703,22 +3704,22 @@ yy256:
 		++YYCURSOR;
 		YYDEBUG(257, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1357 "Zend/zend_language_scanner.l"
+#line 1358 "Zend/zend_language_scanner.l"
 		{
 	return T_IS_SMALLER_OR_EQUAL;
 }
-#line 3711 "Zend/zend_language_scanner.c"
+#line 3712 "Zend/zend_language_scanner.c"
 yy258:
 		YYDEBUG(258, *YYCURSOR);
 		++YYCURSOR;
 yy259:
 		YYDEBUG(259, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1353 "Zend/zend_language_scanner.l"
+#line 1354 "Zend/zend_language_scanner.l"
 		{
 	return T_IS_NOT_EQUAL;
 }
-#line 3722 "Zend/zend_language_scanner.c"
+#line 3723 "Zend/zend_language_scanner.c"
 yy260:
 		YYDEBUG(260, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -3769,11 +3770,11 @@ yy267:
 		++YYCURSOR;
 		YYDEBUG(268, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1389 "Zend/zend_language_scanner.l"
+#line 1390 "Zend/zend_language_scanner.l"
 		{
 	return T_SL_EQUAL;
 }
-#line 3777 "Zend/zend_language_scanner.c"
+#line 3778 "Zend/zend_language_scanner.c"
 yy269:
 		YYDEBUG(269, *YYCURSOR);
 		++YYCURSOR;
@@ -3878,7 +3879,7 @@ yy278:
 yy279:
 		YYDEBUG(279, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2104 "Zend/zend_language_scanner.l"
+#line 2105 "Zend/zend_language_scanner.l"
 		{
 	char *s;
 	int bprefix = (yytext[0] != '<') ? 1 : 0;
@@ -3926,7 +3927,7 @@ yy279:
 
 	return T_START_HEREDOC;
 }
-#line 3930 "Zend/zend_language_scanner.c"
+#line 3931 "Zend/zend_language_scanner.c"
 yy280:
 		YYDEBUG(280, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -3966,31 +3967,31 @@ yy283:
 		++YYCURSOR;
 		YYDEBUG(285, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1345 "Zend/zend_language_scanner.l"
+#line 1346 "Zend/zend_language_scanner.l"
 		{
 	return T_IS_NOT_IDENTICAL;
 }
-#line 3974 "Zend/zend_language_scanner.c"
+#line 3975 "Zend/zend_language_scanner.c"
 yy286:
 		YYDEBUG(286, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(287, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1365 "Zend/zend_language_scanner.l"
+#line 1366 "Zend/zend_language_scanner.l"
 		{
 	return T_PLUS_EQUAL;
 }
-#line 3984 "Zend/zend_language_scanner.c"
+#line 3985 "Zend/zend_language_scanner.c"
 yy288:
 		YYDEBUG(288, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(289, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1333 "Zend/zend_language_scanner.l"
+#line 1334 "Zend/zend_language_scanner.l"
 		{
 	return T_INC;
 }
-#line 3994 "Zend/zend_language_scanner.c"
+#line 3995 "Zend/zend_language_scanner.c"
 yy290:
 		YYDEBUG(290, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4009,42 +4010,42 @@ yy292:
 		}
 		YYDEBUG(293, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1321 "Zend/zend_language_scanner.l"
+#line 1322 "Zend/zend_language_scanner.l"
 		{
 	return T_LIST;
 }
-#line 4017 "Zend/zend_language_scanner.c"
+#line 4018 "Zend/zend_language_scanner.c"
 yy294:
 		YYDEBUG(294, *YYCURSOR);
 		++YYCURSOR;
 		if ((yych = *YYCURSOR) == '=') goto yy298;
 		YYDEBUG(295, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1349 "Zend/zend_language_scanner.l"
+#line 1350 "Zend/zend_language_scanner.l"
 		{
 	return T_IS_EQUAL;
 }
-#line 4028 "Zend/zend_language_scanner.c"
+#line 4029 "Zend/zend_language_scanner.c"
 yy296:
 		YYDEBUG(296, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(297, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1317 "Zend/zend_language_scanner.l"
+#line 1318 "Zend/zend_language_scanner.l"
 		{
 	return T_DOUBLE_ARROW;
 }
-#line 4038 "Zend/zend_language_scanner.c"
+#line 4039 "Zend/zend_language_scanner.c"
 yy298:
 		YYDEBUG(298, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(299, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1341 "Zend/zend_language_scanner.l"
+#line 1342 "Zend/zend_language_scanner.l"
 		{
 	return T_IS_IDENTICAL;
 }
-#line 4048 "Zend/zend_language_scanner.c"
+#line 4049 "Zend/zend_language_scanner.c"
 yy300:
 		YYDEBUG(300, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4174,7 +4175,7 @@ yy316:
 		}
 		YYDEBUG(319, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1705 "Zend/zend_language_scanner.l"
+#line 1706 "Zend/zend_language_scanner.l"
 		{
 	if (CG(current_namespace)) {
 		*zendlval = *CG(current_namespace);
@@ -4184,7 +4185,7 @@ yy316:
 	}
 	return T_NS_C;
 }
-#line 4188 "Zend/zend_language_scanner.c"
+#line 4189 "Zend/zend_language_scanner.c"
 yy320:
 		YYDEBUG(320, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4204,7 +4205,7 @@ yy321:
 		}
 		YYDEBUG(324, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1678 "Zend/zend_language_scanner.l"
+#line 1679 "Zend/zend_language_scanner.l"
 		{
 	char *filename = zend_get_compiled_filename(TSRMLS_C);
 	const size_t filename_len = strlen(filename);
@@ -4231,7 +4232,7 @@ yy321:
 	zendlval->type = IS_STRING;
 	return T_DIR;
 }
-#line 4235 "Zend/zend_language_scanner.c"
+#line 4236 "Zend/zend_language_scanner.c"
 yy325:
 		YYDEBUG(325, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4256,13 +4257,13 @@ yy327:
 		}
 		YYDEBUG(330, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1660 "Zend/zend_language_scanner.l"
+#line 1661 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.lval = CG(zend_lineno);
 	zendlval->type = IS_LONG;
 	return T_LINE;
 }
-#line 4266 "Zend/zend_language_scanner.c"
+#line 4267 "Zend/zend_language_scanner.c"
 yy331:
 		YYDEBUG(331, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4297,7 +4298,7 @@ yy335:
 		}
 		YYDEBUG(338, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1639 "Zend/zend_language_scanner.l"
+#line 1640 "Zend/zend_language_scanner.l"
 		{
 	const char *class_name = CG(active_class_entry) ? CG(active_class_entry)->name : NULL;
 	const char *func_name = CG(active_op_array)? CG(active_op_array)->function_name : NULL;
@@ -4318,7 +4319,7 @@ yy335:
 	zendlval->type = IS_STRING;
 	return T_METHOD_C;
 }
-#line 4322 "Zend/zend_language_scanner.c"
+#line 4323 "Zend/zend_language_scanner.c"
 yy339:
 		YYDEBUG(339, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4369,7 +4370,7 @@ yy346:
 		}
 		YYDEBUG(349, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1623 "Zend/zend_language_scanner.l"
+#line 1624 "Zend/zend_language_scanner.l"
 		{
 	const char *func_name = NULL;
 
@@ -4385,7 +4386,7 @@ yy346:
 	zendlval->type = IS_STRING;
 	return T_FUNC_C;
 }
-#line 4389 "Zend/zend_language_scanner.c"
+#line 4390 "Zend/zend_language_scanner.c"
 yy350:
 		YYDEBUG(350, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4405,7 +4406,7 @@ yy351:
 		}
 		YYDEBUG(354, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1666 "Zend/zend_language_scanner.l"
+#line 1667 "Zend/zend_language_scanner.l"
 		{
 	char *filename = zend_get_compiled_filename(TSRMLS_C);
 
@@ -4417,7 +4418,7 @@ yy351:
 	zendlval->type = IS_STRING;
 	return T_FILE;
 }
-#line 4421 "Zend/zend_language_scanner.c"
+#line 4422 "Zend/zend_language_scanner.c"
 yy355:
 		YYDEBUG(355, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4447,7 +4448,7 @@ yy358:
 		}
 		YYDEBUG(361, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1603 "Zend/zend_language_scanner.l"
+#line 1604 "Zend/zend_language_scanner.l"
 		{
 	const char *trait_name = NULL;
 	
@@ -4467,7 +4468,7 @@ yy358:
 	
 	return T_TRAIT_C;
 }
-#line 4471 "Zend/zend_language_scanner.c"
+#line 4472 "Zend/zend_language_scanner.c"
 yy362:
 		YYDEBUG(362, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4497,7 +4498,7 @@ yy365:
 		}
 		YYDEBUG(368, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1576 "Zend/zend_language_scanner.l"
+#line 1577 "Zend/zend_language_scanner.l"
 		{
 	const char *class_name = NULL;
 	
@@ -4524,7 +4525,7 @@ yy365:
 	}
 	return T_CLASS_C;
 }
-#line 4528 "Zend/zend_language_scanner.c"
+#line 4529 "Zend/zend_language_scanner.c"
 yy369:
 		YYDEBUG(369, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4586,11 +4587,11 @@ yy380:
 		}
 		YYDEBUG(381, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1285 "Zend/zend_language_scanner.l"
+#line 1286 "Zend/zend_language_scanner.l"
 		{
 	return T_HALT_COMPILER;
 }
-#line 4594 "Zend/zend_language_scanner.c"
+#line 4595 "Zend/zend_language_scanner.c"
 yy382:
 		YYDEBUG(382, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4610,11 +4611,11 @@ yy384:
 		}
 		YYDEBUG(385, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1265 "Zend/zend_language_scanner.l"
+#line 1266 "Zend/zend_language_scanner.l"
 		{
 	return T_USE;
 }
-#line 4618 "Zend/zend_language_scanner.c"
+#line 4619 "Zend/zend_language_scanner.c"
 yy386:
 		YYDEBUG(386, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4633,11 +4634,11 @@ yy388:
 		}
 		YYDEBUG(389, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1313 "Zend/zend_language_scanner.l"
+#line 1314 "Zend/zend_language_scanner.l"
 		{
 	return T_UNSET;
 }
-#line 4641 "Zend/zend_language_scanner.c"
+#line 4642 "Zend/zend_language_scanner.c"
 yy390:
 		YYDEBUG(390, *YYCURSOR);
 		++YYCURSOR;
@@ -4809,11 +4810,11 @@ yy405:
 		++YYCURSOR;
 		YYDEBUG(407, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1213 "Zend/zend_language_scanner.l"
+#line 1214 "Zend/zend_language_scanner.l"
 		{
 	return T_INT_CAST;
 }
-#line 4817 "Zend/zend_language_scanner.c"
+#line 4818 "Zend/zend_language_scanner.c"
 yy408:
 		YYDEBUG(408, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4857,11 +4858,11 @@ yy413:
 		++YYCURSOR;
 		YYDEBUG(416, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1217 "Zend/zend_language_scanner.l"
+#line 1218 "Zend/zend_language_scanner.l"
 		{
 	return T_DOUBLE_CAST;
 }
-#line 4865 "Zend/zend_language_scanner.c"
+#line 4866 "Zend/zend_language_scanner.c"
 yy417:
 		YYDEBUG(417, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4931,11 +4932,11 @@ yy427:
 		++YYCURSOR;
 		YYDEBUG(430, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1221 "Zend/zend_language_scanner.l"
+#line 1222 "Zend/zend_language_scanner.l"
 		{
 	return T_STRING_CAST;
 }
-#line 4939 "Zend/zend_language_scanner.c"
+#line 4940 "Zend/zend_language_scanner.c"
 yy431:
 		YYDEBUG(431, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4968,11 +4969,11 @@ yy434:
 		++YYCURSOR;
 		YYDEBUG(437, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1225 "Zend/zend_language_scanner.l"
+#line 1226 "Zend/zend_language_scanner.l"
 		{
 	return T_ARRAY_CAST;
 }
-#line 4976 "Zend/zend_language_scanner.c"
+#line 4977 "Zend/zend_language_scanner.c"
 yy438:
 		YYDEBUG(438, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5010,11 +5011,11 @@ yy442:
 		++YYCURSOR;
 		YYDEBUG(445, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1229 "Zend/zend_language_scanner.l"
+#line 1230 "Zend/zend_language_scanner.l"
 		{
 	return T_OBJECT_CAST;
 }
-#line 5018 "Zend/zend_language_scanner.c"
+#line 5019 "Zend/zend_language_scanner.c"
 yy446:
 		YYDEBUG(446, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5055,11 +5056,11 @@ yy451:
 		++YYCURSOR;
 		YYDEBUG(453, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1233 "Zend/zend_language_scanner.l"
+#line 1234 "Zend/zend_language_scanner.l"
 		{
 	return T_BOOL_CAST;
 }
-#line 5063 "Zend/zend_language_scanner.c"
+#line 5064 "Zend/zend_language_scanner.c"
 yy454:
 		YYDEBUG(454, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5119,11 +5120,11 @@ yy462:
 		++YYCURSOR;
 		YYDEBUG(465, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1237 "Zend/zend_language_scanner.l"
+#line 1238 "Zend/zend_language_scanner.l"
 		{
 	return T_UNSET_CAST;
 }
-#line 5127 "Zend/zend_language_scanner.c"
+#line 5128 "Zend/zend_language_scanner.c"
 yy466:
 		YYDEBUG(466, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5137,11 +5138,11 @@ yy467:
 		}
 		YYDEBUG(468, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1209 "Zend/zend_language_scanner.l"
+#line 1210 "Zend/zend_language_scanner.l"
 		{
 	return T_VAR;
 }
-#line 5145 "Zend/zend_language_scanner.c"
+#line 5146 "Zend/zend_language_scanner.c"
 yy469:
 		YYDEBUG(469, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5161,11 +5162,11 @@ yy471:
 		}
 		YYDEBUG(472, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1201 "Zend/zend_language_scanner.l"
+#line 1202 "Zend/zend_language_scanner.l"
 		{
 	return T_NEW;
 }
-#line 5169 "Zend/zend_language_scanner.c"
+#line 5170 "Zend/zend_language_scanner.c"
 yy473:
 		YYDEBUG(473, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5204,21 +5205,21 @@ yy479:
 		}
 		YYDEBUG(480, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1261 "Zend/zend_language_scanner.l"
+#line 1262 "Zend/zend_language_scanner.l"
 		{
 	return T_NAMESPACE;
 }
-#line 5212 "Zend/zend_language_scanner.c"
+#line 5213 "Zend/zend_language_scanner.c"
 yy481:
 		YYDEBUG(481, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(482, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1193 "Zend/zend_language_scanner.l"
+#line 1194 "Zend/zend_language_scanner.l"
 		{
 	return T_PAAMAYIM_NEKUDOTAYIM;
 }
-#line 5222 "Zend/zend_language_scanner.c"
+#line 5223 "Zend/zend_language_scanner.c"
 yy483:
 		YYDEBUG(483, *YYCURSOR);
 		++YYCURSOR;
@@ -5240,32 +5241,32 @@ yy485:
 		++YYCURSOR;
 		YYDEBUG(486, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1369 "Zend/zend_language_scanner.l"
+#line 1370 "Zend/zend_language_scanner.l"
 		{
 	return T_MINUS_EQUAL;
 }
-#line 5248 "Zend/zend_language_scanner.c"
+#line 5249 "Zend/zend_language_scanner.c"
 yy487:
 		YYDEBUG(487, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(488, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1337 "Zend/zend_language_scanner.l"
+#line 1338 "Zend/zend_language_scanner.l"
 		{
 	return T_DEC;
 }
-#line 5258 "Zend/zend_language_scanner.c"
+#line 5259 "Zend/zend_language_scanner.c"
 yy489:
 		YYDEBUG(489, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(490, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1163 "Zend/zend_language_scanner.l"
+#line 1164 "Zend/zend_language_scanner.l"
 		{
 	yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
 	return T_OBJECT_OPERATOR;
 }
-#line 5269 "Zend/zend_language_scanner.c"
+#line 5270 "Zend/zend_language_scanner.c"
 yy491:
 		YYDEBUG(491, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5310,11 +5311,11 @@ yy496:
 		}
 		YYDEBUG(497, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1309 "Zend/zend_language_scanner.l"
+#line 1310 "Zend/zend_language_scanner.l"
 		{
 	return T_PUBLIC;
 }
-#line 5318 "Zend/zend_language_scanner.c"
+#line 5319 "Zend/zend_language_scanner.c"
 yy498:
 		YYDEBUG(498, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5369,11 +5370,11 @@ yy505:
 		}
 		YYDEBUG(506, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1305 "Zend/zend_language_scanner.l"
+#line 1306 "Zend/zend_language_scanner.l"
 		{
 	return T_PROTECTED;
 }
-#line 5377 "Zend/zend_language_scanner.c"
+#line 5378 "Zend/zend_language_scanner.c"
 yy507:
 		YYDEBUG(507, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5403,11 +5404,11 @@ yy511:
 		}
 		YYDEBUG(512, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1301 "Zend/zend_language_scanner.l"
+#line 1302 "Zend/zend_language_scanner.l"
 		{
 	return T_PRIVATE;
 }
-#line 5411 "Zend/zend_language_scanner.c"
+#line 5412 "Zend/zend_language_scanner.c"
 yy513:
 		YYDEBUG(513, *YYCURSOR);
 		++YYCURSOR;
@@ -5416,11 +5417,11 @@ yy513:
 		}
 		YYDEBUG(514, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1139 "Zend/zend_language_scanner.l"
+#line 1140 "Zend/zend_language_scanner.l"
 		{
 	return T_PRINT;
 }
-#line 5424 "Zend/zend_language_scanner.c"
+#line 5425 "Zend/zend_language_scanner.c"
 yy515:
 		YYDEBUG(515, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5445,11 +5446,11 @@ yy518:
 		}
 		YYDEBUG(519, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1131 "Zend/zend_language_scanner.l"
+#line 1132 "Zend/zend_language_scanner.l"
 		{
 	return T_GOTO;
 }
-#line 5453 "Zend/zend_language_scanner.c"
+#line 5454 "Zend/zend_language_scanner.c"
 yy520:
 		YYDEBUG(520, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5473,11 +5474,11 @@ yy523:
 		}
 		YYDEBUG(524, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1273 "Zend/zend_language_scanner.l"
+#line 1274 "Zend/zend_language_scanner.l"
 		{
 	return T_GLOBAL;
 }
-#line 5481 "Zend/zend_language_scanner.c"
+#line 5482 "Zend/zend_language_scanner.c"
 yy525:
 		YYDEBUG(525, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5514,11 +5515,11 @@ yy531:
 		}
 		YYDEBUG(532, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1123 "Zend/zend_language_scanner.l"
+#line 1124 "Zend/zend_language_scanner.l"
 		{
 	return T_BREAK;
 }
-#line 5522 "Zend/zend_language_scanner.c"
+#line 5523 "Zend/zend_language_scanner.c"
 yy533:
 		YYDEBUG(533, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5558,11 +5559,11 @@ yy539:
 		}
 		YYDEBUG(540, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1107 "Zend/zend_language_scanner.l"
+#line 1108 "Zend/zend_language_scanner.l"
 		{
 	return T_SWITCH;
 }
-#line 5566 "Zend/zend_language_scanner.c"
+#line 5567 "Zend/zend_language_scanner.c"
 yy541:
 		YYDEBUG(541, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5586,11 +5587,11 @@ yy544:
 		}
 		YYDEBUG(545, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1289 "Zend/zend_language_scanner.l"
+#line 1290 "Zend/zend_language_scanner.l"
 		{
 	return T_STATIC;
 }
-#line 5594 "Zend/zend_language_scanner.c"
+#line 5595 "Zend/zend_language_scanner.c"
 yy546:
 		YYDEBUG(546, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5617,11 +5618,11 @@ yy549:
 		}
 		YYDEBUG(550, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1103 "Zend/zend_language_scanner.l"
+#line 1104 "Zend/zend_language_scanner.l"
 		{
 	return T_AS;
 }
-#line 5625 "Zend/zend_language_scanner.c"
+#line 5626 "Zend/zend_language_scanner.c"
 yy551:
 		YYDEBUG(551, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5640,11 +5641,11 @@ yy553:
 		}
 		YYDEBUG(554, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1325 "Zend/zend_language_scanner.l"
+#line 1326 "Zend/zend_language_scanner.l"
 		{
 	return T_ARRAY;
 }
-#line 5648 "Zend/zend_language_scanner.c"
+#line 5649 "Zend/zend_language_scanner.c"
 yy555:
 		YYDEBUG(555, *YYCURSOR);
 		++YYCURSOR;
@@ -5653,11 +5654,11 @@ yy555:
 		}
 		YYDEBUG(556, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1421 "Zend/zend_language_scanner.l"
+#line 1422 "Zend/zend_language_scanner.l"
 		{
 	return T_LOGICAL_AND;
 }
-#line 5661 "Zend/zend_language_scanner.c"
+#line 5662 "Zend/zend_language_scanner.c"
 yy557:
 		YYDEBUG(557, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5691,11 +5692,11 @@ yy562:
 		}
 		YYDEBUG(563, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1293 "Zend/zend_language_scanner.l"
+#line 1294 "Zend/zend_language_scanner.l"
 		{
 	return T_ABSTRACT;
 }
-#line 5699 "Zend/zend_language_scanner.c"
+#line 5700 "Zend/zend_language_scanner.c"
 yy564:
 		YYDEBUG(564, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5719,11 +5720,11 @@ yy567:
 		}
 		YYDEBUG(568, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1063 "Zend/zend_language_scanner.l"
+#line 1064 "Zend/zend_language_scanner.l"
 		{
 	return T_WHILE;
 }
-#line 5727 "Zend/zend_language_scanner.c"
+#line 5728 "Zend/zend_language_scanner.c"
 yy569:
 		YYDEBUG(569, *YYCURSOR);
 		++YYCURSOR;
@@ -5732,11 +5733,11 @@ yy569:
 		}
 		YYDEBUG(570, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1047 "Zend/zend_language_scanner.l"
+#line 1048 "Zend/zend_language_scanner.l"
 		{
 	return T_IF;
 }
-#line 5740 "Zend/zend_language_scanner.c"
+#line 5741 "Zend/zend_language_scanner.c"
 yy571:
 		YYDEBUG(571, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5788,11 +5789,11 @@ yy576:
 		}
 		YYDEBUG(577, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1277 "Zend/zend_language_scanner.l"
+#line 1278 "Zend/zend_language_scanner.l"
 		{
 	return T_ISSET;
 }
-#line 5796 "Zend/zend_language_scanner.c"
+#line 5797 "Zend/zend_language_scanner.c"
 yy578:
 		YYDEBUG(578, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5846,11 +5847,11 @@ yy584:
 yy585:
 		YYDEBUG(585, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1245 "Zend/zend_language_scanner.l"
+#line 1246 "Zend/zend_language_scanner.l"
 		{
 	return T_INCLUDE;
 }
-#line 5854 "Zend/zend_language_scanner.c"
+#line 5855 "Zend/zend_language_scanner.c"
 yy586:
 		YYDEBUG(586, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5879,11 +5880,11 @@ yy590:
 		}
 		YYDEBUG(591, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1249 "Zend/zend_language_scanner.l"
+#line 1250 "Zend/zend_language_scanner.l"
 		{
 	return T_INCLUDE_ONCE;
 }
-#line 5887 "Zend/zend_language_scanner.c"
+#line 5888 "Zend/zend_language_scanner.c"
 yy592:
 		YYDEBUG(592, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5917,11 +5918,11 @@ yy597:
 		}
 		YYDEBUG(598, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1147 "Zend/zend_language_scanner.l"
+#line 1148 "Zend/zend_language_scanner.l"
 		{
 	return T_INTERFACE;
 }
-#line 5925 "Zend/zend_language_scanner.c"
+#line 5926 "Zend/zend_language_scanner.c"
 yy599:
 		YYDEBUG(599, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5971,11 +5972,11 @@ yy605:
 		}
 		YYDEBUG(606, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1269 "Zend/zend_language_scanner.l"
+#line 1270 "Zend/zend_language_scanner.l"
 		{
         return T_INSTEADOF;
 }
-#line 5979 "Zend/zend_language_scanner.c"
+#line 5980 "Zend/zend_language_scanner.c"
 yy607:
 		YYDEBUG(607, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6004,11 +6005,11 @@ yy611:
 		}
 		YYDEBUG(612, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1099 "Zend/zend_language_scanner.l"
+#line 1100 "Zend/zend_language_scanner.l"
 		{
 	return T_INSTANCEOF;
 }
-#line 6012 "Zend/zend_language_scanner.c"
+#line 6013 "Zend/zend_language_scanner.c"
 yy613:
 		YYDEBUG(613, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6052,11 +6053,11 @@ yy620:
 		}
 		YYDEBUG(621, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1159 "Zend/zend_language_scanner.l"
+#line 1160 "Zend/zend_language_scanner.l"
 		{
 	return T_IMPLEMENTS;
 }
-#line 6060 "Zend/zend_language_scanner.c"
+#line 6061 "Zend/zend_language_scanner.c"
 yy622:
 		YYDEBUG(622, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6084,11 +6085,11 @@ yy623:
 		}
 		YYDEBUG(625, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1035 "Zend/zend_language_scanner.l"
+#line 1036 "Zend/zend_language_scanner.l"
 		{
 	return T_TRY;
 }
-#line 6092 "Zend/zend_language_scanner.c"
+#line 6093 "Zend/zend_language_scanner.c"
 yy626:
 		YYDEBUG(626, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6107,11 +6108,11 @@ yy628:
 		}
 		YYDEBUG(629, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1151 "Zend/zend_language_scanner.l"
+#line 1152 "Zend/zend_language_scanner.l"
 		{
 	return T_TRAIT;
 }
-#line 6115 "Zend/zend_language_scanner.c"
+#line 6116 "Zend/zend_language_scanner.c"
 yy630:
 		YYDEBUG(630, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6130,11 +6131,11 @@ yy632:
 		}
 		YYDEBUG(633, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1043 "Zend/zend_language_scanner.l"
+#line 1044 "Zend/zend_language_scanner.l"
 		{
 	return T_THROW;
 }
-#line 6138 "Zend/zend_language_scanner.c"
+#line 6139 "Zend/zend_language_scanner.c"
 yy634:
 		YYDEBUG(634, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6195,11 +6196,11 @@ yy640:
 yy641:
 		YYDEBUG(641, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1253 "Zend/zend_language_scanner.l"
+#line 1254 "Zend/zend_language_scanner.l"
 		{
 	return T_REQUIRE;
 }
-#line 6203 "Zend/zend_language_scanner.c"
+#line 6204 "Zend/zend_language_scanner.c"
 yy642:
 		YYDEBUG(642, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6228,11 +6229,11 @@ yy646:
 		}
 		YYDEBUG(647, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1257 "Zend/zend_language_scanner.l"
+#line 1258 "Zend/zend_language_scanner.l"
 		{
 	return T_REQUIRE_ONCE;
 }
-#line 6236 "Zend/zend_language_scanner.c"
+#line 6237 "Zend/zend_language_scanner.c"
 yy648:
 		YYDEBUG(648, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6251,11 +6252,11 @@ yy650:
 		}
 		YYDEBUG(651, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1031 "Zend/zend_language_scanner.l"
+#line 1032 "Zend/zend_language_scanner.l"
 		{
 	return T_RETURN;
 }
-#line 6259 "Zend/zend_language_scanner.c"
+#line 6260 "Zend/zend_language_scanner.c"
 yy652:
 		YYDEBUG(652, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6345,11 +6346,11 @@ yy661:
 		}
 		YYDEBUG(662, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1127 "Zend/zend_language_scanner.l"
+#line 1128 "Zend/zend_language_scanner.l"
 		{
 	return T_CONTINUE;
 }
-#line 6353 "Zend/zend_language_scanner.c"
+#line 6354 "Zend/zend_language_scanner.c"
 yy663:
 		YYDEBUG(663, *YYCURSOR);
 		++YYCURSOR;
@@ -6358,11 +6359,11 @@ yy663:
 		}
 		YYDEBUG(664, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1027 "Zend/zend_language_scanner.l"
+#line 1028 "Zend/zend_language_scanner.l"
 		{
 	return T_CONST;
 }
-#line 6366 "Zend/zend_language_scanner.c"
+#line 6367 "Zend/zend_language_scanner.c"
 yy665:
 		YYDEBUG(665, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6387,11 +6388,11 @@ yy668:
 		}
 		YYDEBUG(669, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1205 "Zend/zend_language_scanner.l"
+#line 1206 "Zend/zend_language_scanner.l"
 		{
 	return T_CLONE;
 }
-#line 6395 "Zend/zend_language_scanner.c"
+#line 6396 "Zend/zend_language_scanner.c"
 yy670:
 		YYDEBUG(670, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6405,11 +6406,11 @@ yy671:
 		}
 		YYDEBUG(672, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1143 "Zend/zend_language_scanner.l"
+#line 1144 "Zend/zend_language_scanner.l"
 		{
 	return T_CLASS;
 }
-#line 6413 "Zend/zend_language_scanner.c"
+#line 6414 "Zend/zend_language_scanner.c"
 yy673:
 		YYDEBUG(673, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6455,11 +6456,11 @@ yy680:
 		}
 		YYDEBUG(681, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1329 "Zend/zend_language_scanner.l"
+#line 1330 "Zend/zend_language_scanner.l"
 		{
  return T_CALLABLE;
 }
-#line 6463 "Zend/zend_language_scanner.c"
+#line 6464 "Zend/zend_language_scanner.c"
 yy682:
 		YYDEBUG(682, *YYCURSOR);
 		++YYCURSOR;
@@ -6468,11 +6469,11 @@ yy682:
 		}
 		YYDEBUG(683, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1115 "Zend/zend_language_scanner.l"
+#line 1116 "Zend/zend_language_scanner.l"
 		{
 	return T_CASE;
 }
-#line 6476 "Zend/zend_language_scanner.c"
+#line 6477 "Zend/zend_language_scanner.c"
 yy684:
 		YYDEBUG(684, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6486,11 +6487,11 @@ yy685:
 		}
 		YYDEBUG(686, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1039 "Zend/zend_language_scanner.l"
+#line 1040 "Zend/zend_language_scanner.l"
 		{
 	return T_CATCH;
 }
-#line 6494 "Zend/zend_language_scanner.c"
+#line 6495 "Zend/zend_language_scanner.c"
 yy687:
 		YYDEBUG(687, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6541,11 +6542,11 @@ yy695:
 		}
 		YYDEBUG(696, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1023 "Zend/zend_language_scanner.l"
+#line 1024 "Zend/zend_language_scanner.l"
 		{
 	return T_FUNCTION;
 }
-#line 6549 "Zend/zend_language_scanner.c"
+#line 6550 "Zend/zend_language_scanner.c"
 yy697:
 		YYDEBUG(697, *YYCURSOR);
 		++YYCURSOR;
@@ -6569,11 +6570,11 @@ yy697:
 yy698:
 		YYDEBUG(698, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1075 "Zend/zend_language_scanner.l"
+#line 1076 "Zend/zend_language_scanner.l"
 		{
 	return T_FOR;
 }
-#line 6577 "Zend/zend_language_scanner.c"
+#line 6578 "Zend/zend_language_scanner.c"
 yy699:
 		YYDEBUG(699, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6597,11 +6598,11 @@ yy702:
 		}
 		YYDEBUG(703, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1083 "Zend/zend_language_scanner.l"
+#line 1084 "Zend/zend_language_scanner.l"
 		{
 	return T_FOREACH;
 }
-#line 6605 "Zend/zend_language_scanner.c"
+#line 6606 "Zend/zend_language_scanner.c"
 yy704:
 		YYDEBUG(704, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6620,11 +6621,11 @@ yy706:
 		}
 		YYDEBUG(707, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1297 "Zend/zend_language_scanner.l"
+#line 1298 "Zend/zend_language_scanner.l"
 		{
 	return T_FINAL;
 }
-#line 6628 "Zend/zend_language_scanner.c"
+#line 6629 "Zend/zend_language_scanner.c"
 yy708:
 		YYDEBUG(708, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6655,11 +6656,11 @@ yy710:
 		}
 		YYDEBUG(711, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1071 "Zend/zend_language_scanner.l"
+#line 1072 "Zend/zend_language_scanner.l"
 		{
 	return T_DO;
 }
-#line 6663 "Zend/zend_language_scanner.c"
+#line 6664 "Zend/zend_language_scanner.c"
 yy712:
 		YYDEBUG(712, *YYCURSOR);
 		++YYCURSOR;
@@ -6668,11 +6669,11 @@ yy712:
 		}
 		YYDEBUG(713, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1019 "Zend/zend_language_scanner.l"
+#line 1020 "Zend/zend_language_scanner.l"
 		{
 	return T_EXIT;
 }
-#line 6676 "Zend/zend_language_scanner.c"
+#line 6677 "Zend/zend_language_scanner.c"
 yy714:
 		YYDEBUG(714, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6707,11 +6708,11 @@ yy719:
 		}
 		YYDEBUG(720, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1119 "Zend/zend_language_scanner.l"
+#line 1120 "Zend/zend_language_scanner.l"
 		{
 	return T_DEFAULT;
 }
-#line 6715 "Zend/zend_language_scanner.c"
+#line 6716 "Zend/zend_language_scanner.c"
 yy721:
 		YYDEBUG(721, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6735,11 +6736,11 @@ yy724:
 		}
 		YYDEBUG(725, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1091 "Zend/zend_language_scanner.l"
+#line 1092 "Zend/zend_language_scanner.l"
 		{
 	return T_DECLARE;
 }
-#line 6743 "Zend/zend_language_scanner.c"
+#line 6744 "Zend/zend_language_scanner.c"
 yy726:
 		YYDEBUG(726, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6819,11 +6820,11 @@ yy737:
 		}
 		YYDEBUG(738, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1155 "Zend/zend_language_scanner.l"
+#line 1156 "Zend/zend_language_scanner.l"
 		{
 	return T_EXTENDS;
 }
-#line 6827 "Zend/zend_language_scanner.c"
+#line 6828 "Zend/zend_language_scanner.c"
 yy739:
 		YYDEBUG(739, *YYCURSOR);
 		++YYCURSOR;
@@ -6832,11 +6833,11 @@ yy739:
 		}
 		YYDEBUG(740, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1015 "Zend/zend_language_scanner.l"
+#line 1016 "Zend/zend_language_scanner.l"
 		{
 	return T_EXIT;
 }
-#line 6840 "Zend/zend_language_scanner.c"
+#line 6841 "Zend/zend_language_scanner.c"
 yy741:
 		YYDEBUG(741, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6850,11 +6851,11 @@ yy742:
 		}
 		YYDEBUG(743, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1241 "Zend/zend_language_scanner.l"
+#line 1242 "Zend/zend_language_scanner.l"
 		{
 	return T_EVAL;
 }
-#line 6858 "Zend/zend_language_scanner.c"
+#line 6859 "Zend/zend_language_scanner.c"
 yy744:
 		YYDEBUG(744, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6924,11 +6925,11 @@ yy753:
 		}
 		YYDEBUG(754, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1067 "Zend/zend_language_scanner.l"
+#line 1068 "Zend/zend_language_scanner.l"
 		{
 	return T_ENDWHILE;
 }
-#line 6932 "Zend/zend_language_scanner.c"
+#line 6933 "Zend/zend_language_scanner.c"
 yy755:
 		YYDEBUG(755, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6957,11 +6958,11 @@ yy759:
 		}
 		YYDEBUG(760, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1111 "Zend/zend_language_scanner.l"
+#line 1112 "Zend/zend_language_scanner.l"
 		{
 	return T_ENDSWITCH;
 }
-#line 6965 "Zend/zend_language_scanner.c"
+#line 6966 "Zend/zend_language_scanner.c"
 yy761:
 		YYDEBUG(761, *YYCURSOR);
 		++YYCURSOR;
@@ -6970,11 +6971,11 @@ yy761:
 		}
 		YYDEBUG(762, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1055 "Zend/zend_language_scanner.l"
+#line 1056 "Zend/zend_language_scanner.l"
 		{
 	return T_ENDIF;
 }
-#line 6978 "Zend/zend_language_scanner.c"
+#line 6979 "Zend/zend_language_scanner.c"
 yy763:
 		YYDEBUG(763, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7003,11 +7004,11 @@ yy764:
 yy765:
 		YYDEBUG(765, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1079 "Zend/zend_language_scanner.l"
+#line 1080 "Zend/zend_language_scanner.l"
 		{
 	return T_ENDFOR;
 }
-#line 7011 "Zend/zend_language_scanner.c"
+#line 7012 "Zend/zend_language_scanner.c"
 yy766:
 		YYDEBUG(766, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7031,11 +7032,11 @@ yy769:
 		}
 		YYDEBUG(770, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1087 "Zend/zend_language_scanner.l"
+#line 1088 "Zend/zend_language_scanner.l"
 		{
 	return T_ENDFOREACH;
 }
-#line 7039 "Zend/zend_language_scanner.c"
+#line 7040 "Zend/zend_language_scanner.c"
 yy771:
 		YYDEBUG(771, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7069,11 +7070,11 @@ yy776:
 		}
 		YYDEBUG(777, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1095 "Zend/zend_language_scanner.l"
+#line 1096 "Zend/zend_language_scanner.l"
 		{
 	return T_ENDDECLARE;
 }
-#line 7077 "Zend/zend_language_scanner.c"
+#line 7078 "Zend/zend_language_scanner.c"
 yy778:
 		YYDEBUG(778, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7092,11 +7093,11 @@ yy780:
 		}
 		YYDEBUG(781, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1281 "Zend/zend_language_scanner.l"
+#line 1282 "Zend/zend_language_scanner.l"
 		{
 	return T_EMPTY;
 }
-#line 7100 "Zend/zend_language_scanner.c"
+#line 7101 "Zend/zend_language_scanner.c"
 yy782:
 		YYDEBUG(782, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7125,11 +7126,11 @@ yy783:
 yy784:
 		YYDEBUG(784, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1059 "Zend/zend_language_scanner.l"
+#line 1060 "Zend/zend_language_scanner.l"
 		{
 	return T_ELSE;
 }
-#line 7133 "Zend/zend_language_scanner.c"
+#line 7134 "Zend/zend_language_scanner.c"
 yy785:
 		YYDEBUG(785, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7143,11 +7144,11 @@ yy786:
 		}
 		YYDEBUG(787, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1051 "Zend/zend_language_scanner.l"
+#line 1052 "Zend/zend_language_scanner.l"
 		{
 	return T_ELSEIF;
 }
-#line 7151 "Zend/zend_language_scanner.c"
+#line 7152 "Zend/zend_language_scanner.c"
 yy788:
 		YYDEBUG(788, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7161,11 +7162,11 @@ yy789:
 		}
 		YYDEBUG(790, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1135 "Zend/zend_language_scanner.l"
+#line 1136 "Zend/zend_language_scanner.l"
 		{
 	return T_ECHO;
 }
-#line 7169 "Zend/zend_language_scanner.c"
+#line 7170 "Zend/zend_language_scanner.c"
 	}
 /* *********************************** */
 yyc_ST_LOOKING_FOR_PROPERTY:
@@ -7238,7 +7239,7 @@ yy793:
 yy794:
 		YYDEBUG(794, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1168 "Zend/zend_language_scanner.l"
+#line 1169 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.str.val = yytext; /* no copying - intentional */
 	zendlval->value.str.len = yyleng;
@@ -7246,7 +7247,7 @@ yy794:
 	HANDLE_NEWLINES(yytext, yyleng);
 	return T_WHITESPACE;
 }
-#line 7250 "Zend/zend_language_scanner.c"
+#line 7251 "Zend/zend_language_scanner.c"
 yy795:
 		YYDEBUG(795, *YYCURSOR);
 		++YYCURSOR;
@@ -7254,13 +7255,13 @@ yy795:
 yy796:
 		YYDEBUG(796, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1187 "Zend/zend_language_scanner.l"
+#line 1188 "Zend/zend_language_scanner.l"
 		{
 	yyless(0);
 	yy_pop_state(TSRMLS_C);
 	goto restart;
 }
-#line 7264 "Zend/zend_language_scanner.c"
+#line 7265 "Zend/zend_language_scanner.c"
 yy797:
 		YYDEBUG(797, *YYCURSOR);
 		++YYCURSOR;
@@ -7269,14 +7270,14 @@ yy797:
 yy798:
 		YYDEBUG(798, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1180 "Zend/zend_language_scanner.l"
+#line 1181 "Zend/zend_language_scanner.l"
 		{
 	yy_pop_state(TSRMLS_C);
 	zend_copy_value(zendlval, yytext, yyleng);
 	zendlval->type = IS_STRING;
 	return T_STRING;
 }
-#line 7280 "Zend/zend_language_scanner.c"
+#line 7281 "Zend/zend_language_scanner.c"
 yy799:
 		YYDEBUG(799, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7297,11 +7298,11 @@ yy802:
 		++YYCURSOR;
 		YYDEBUG(803, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1176 "Zend/zend_language_scanner.l"
+#line 1177 "Zend/zend_language_scanner.l"
 		{
 	return T_OBJECT_OPERATOR;
 }
-#line 7305 "Zend/zend_language_scanner.c"
+#line 7306 "Zend/zend_language_scanner.c"
 yy804:
 		YYDEBUG(804, *YYCURSOR);
 		++YYCURSOR;
@@ -7386,14 +7387,14 @@ yy808:
 yy809:
 		YYDEBUG(809, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1473 "Zend/zend_language_scanner.l"
+#line 1474 "Zend/zend_language_scanner.l"
 		{
 	yyless(0);
 	yy_pop_state(TSRMLS_C);
 	yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
 	goto restart;
 }
-#line 7397 "Zend/zend_language_scanner.c"
+#line 7398 "Zend/zend_language_scanner.c"
 yy810:
 		YYDEBUG(810, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7418,7 +7419,7 @@ yy814:
 		++YYCURSOR;
 		YYDEBUG(815, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1463 "Zend/zend_language_scanner.l"
+#line 1464 "Zend/zend_language_scanner.l"
 		{
 	yyless(yyleng - 1);
 	zend_copy_value(zendlval, yytext, yyleng);
@@ -7427,7 +7428,7 @@ yy814:
 	yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
 	return T_STRING_VARNAME;
 }
-#line 7431 "Zend/zend_language_scanner.c"
+#line 7432 "Zend/zend_language_scanner.c"
 	}
 /* *********************************** */
 yyc_ST_NOWDOC:
@@ -7438,7 +7439,7 @@ yyc_ST_NOWDOC:
 	++YYCURSOR;
 	YYDEBUG(819, *YYCURSOR);
 	yyleng = YYCURSOR - SCNG(yy_text);
-#line 2355 "Zend/zend_language_scanner.l"
+#line 2356 "Zend/zend_language_scanner.l"
 	{
 	int newline = 0;
 
@@ -7493,7 +7494,7 @@ nowdoc_scan_done:
 	HANDLE_NEWLINES(yytext, yyleng - newline);
 	return T_ENCAPSED_AND_WHITESPACE;
 }
-#line 7497 "Zend/zend_language_scanner.c"
+#line 7498 "Zend/zend_language_scanner.c"
 /* *********************************** */
 yyc_ST_VAR_OFFSET:
 	{
@@ -7600,7 +7601,7 @@ yy822:
 yy823:
 		YYDEBUG(823, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1551 "Zend/zend_language_scanner.l"
+#line 1552 "Zend/zend_language_scanner.l"
 		{ /* Offset could be treated as a long */
 	if (yyleng < MAX_LENGTH_OF_LONG - 1 || (yyleng == MAX_LENGTH_OF_LONG - 1 && strcmp(yytext, long_min_digits) < 0)) {
 		zendlval->value.lval = strtol(yytext, NULL, 10);
@@ -7612,7 +7613,7 @@ yy823:
 	}
 	return T_NUM_STRING;
 }
-#line 7616 "Zend/zend_language_scanner.c"
+#line 7617 "Zend/zend_language_scanner.c"
 yy824:
 		YYDEBUG(824, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7632,23 +7633,23 @@ yy825:
 yy826:
 		YYDEBUG(826, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1883 "Zend/zend_language_scanner.l"
+#line 1884 "Zend/zend_language_scanner.l"
 		{
 	/* Only '[' can be valid, but returning other tokens will allow a more explicit parse error */
 	return yytext[0];
 }
-#line 7641 "Zend/zend_language_scanner.c"
+#line 7642 "Zend/zend_language_scanner.c"
 yy827:
 		YYDEBUG(827, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(828, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1878 "Zend/zend_language_scanner.l"
+#line 1879 "Zend/zend_language_scanner.l"
 		{
 	yy_pop_state(TSRMLS_C);
 	return ']';
 }
-#line 7652 "Zend/zend_language_scanner.c"
+#line 7653 "Zend/zend_language_scanner.c"
 yy829:
 		YYDEBUG(829, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7658,14 +7659,14 @@ yy830:
 		++YYCURSOR;
 		YYDEBUG(831, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1888 "Zend/zend_language_scanner.l"
+#line 1889 "Zend/zend_language_scanner.l"
 		{
 	/* Invalid rule to return a more explicit parse error with proper line number */
 	yyless(0);
 	yy_pop_state(TSRMLS_C);
 	return T_ENCAPSED_AND_WHITESPACE;
 }
-#line 7669 "Zend/zend_language_scanner.c"
+#line 7670 "Zend/zend_language_scanner.c"
 yy832:
 		YYDEBUG(832, *YYCURSOR);
 		++YYCURSOR;
@@ -7674,19 +7675,19 @@ yy832:
 yy833:
 		YYDEBUG(833, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1895 "Zend/zend_language_scanner.l"
+#line 1896 "Zend/zend_language_scanner.l"
 		{
 	zend_copy_value(zendlval, yytext, yyleng);
 	zendlval->type = IS_STRING;
 	return T_STRING;
 }
-#line 7684 "Zend/zend_language_scanner.c"
+#line 7685 "Zend/zend_language_scanner.c"
 yy834:
 		YYDEBUG(834, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(835, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2411 "Zend/zend_language_scanner.l"
+#line 2412 "Zend/zend_language_scanner.l"
 		{
 	if (YYCURSOR > YYLIMIT) {
 		return 0;
@@ -7695,7 +7696,7 @@ yy834:
 	zend_error(E_COMPILE_WARNING,"Unexpected character in input:  '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE);
 	goto restart;
 }
-#line 7699 "Zend/zend_language_scanner.c"
+#line 7700 "Zend/zend_language_scanner.c"
 yy836:
 		YYDEBUG(836, *YYCURSOR);
 		++YYCURSOR;
@@ -7731,13 +7732,13 @@ yy838:
 yy840:
 		YYDEBUG(840, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1872 "Zend/zend_language_scanner.l"
+#line 1873 "Zend/zend_language_scanner.l"
 		{
 	zend_copy_value(zendlval, (yytext+1), (yyleng-1));
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 7741 "Zend/zend_language_scanner.c"
+#line 7742 "Zend/zend_language_scanner.c"
 yy841:
 		YYDEBUG(841, *YYCURSOR);
 		++YYCURSOR;
@@ -7777,14 +7778,14 @@ yy846:
 yy848:
 		YYDEBUG(848, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1563 "Zend/zend_language_scanner.l"
+#line 1564 "Zend/zend_language_scanner.l"
 		{ /* Offset must be treated as a string */
 	zendlval->value.str.val = (char *)estrndup(yytext, yyleng);
 	zendlval->value.str.len = yyleng;
 	zendlval->type = IS_STRING;
 	return T_NUM_STRING;
 }
-#line 7788 "Zend/zend_language_scanner.c"
+#line 7789 "Zend/zend_language_scanner.c"
 yy849:
 		YYDEBUG(849, *YYCURSOR);
 		++YYCURSOR;
@@ -7807,6 +7808,6 @@ yy851:
 		goto yy848;
 	}
 }
-#line 2420 "Zend/zend_language_scanner.l"
+#line 2421 "Zend/zend_language_scanner.l"
 
 }
diff --git a/Zend/zend_language_scanner_defs.h b/Zend/zend_language_scanner_defs.h
index 06a2f19..5ef78a9 100644
--- a/Zend/zend_language_scanner_defs.h
+++ b/Zend/zend_language_scanner_defs.h
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Mon Apr 30 10:33:28 2012 */
+/* Generated by re2c 0.13.5 on Mon Apr 30 15:56:25 2012 */
 #line 3 "Zend/zend_language_scanner_defs.h"
 
 enum YYCONDTYPE {


commit 4deb0f1a0a34e6db1960a602132a062226e9b5d8
Author: Felipe Pena <felipensp at gmail.com>
Date:   Mon Apr 30 15:57:00 2012 -0300

    - Regenerated files

diff --git a/Zend/zend_language_scanner.c b/Zend/zend_language_scanner.c
index 262fa43..e3d3de2 100644
--- a/Zend/zend_language_scanner.c
+++ b/Zend/zend_language_scanner.c
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Mon Apr 30 10:28:29 2012 */
+/* Generated by re2c 0.13.5 on Mon Apr 30 15:55:05 2012 */
 #line 1 "Zend/zend_language_scanner.l"
 /*
    +----------------------------------------------------------------------+
@@ -32,11 +32,12 @@
 #endif
 
 #include "zend_language_scanner_defs.h"
+
+#include <errno.h>
+#include "zend.h"
 #ifdef PHP_WIN32
 # include <Winuser.h>
 #endif
-#include <errno.h>
-#include "zend.h"
 #include "zend_alloc.h"
 #include <zend_language_parser.h>
 #include "zend_compile.h"
@@ -997,7 +998,7 @@ restart:
 yymore_restart:
 
 
-#line 1001 "Zend/zend_language_scanner.c"
+#line 1002 "Zend/zend_language_scanner.c"
 {
 	YYCTYPE yych;
 	unsigned int yyaccept = 0;
@@ -1096,7 +1097,7 @@ yyc_INITIAL:
 yy3:
 		YYDEBUG(3, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1789 "Zend/zend_language_scanner.l"
+#line 1790 "Zend/zend_language_scanner.l"
 		{
 	if (YYCURSOR > YYLIMIT) {
 		return 0;
@@ -1156,7 +1157,7 @@ inline_html:
 	HANDLE_NEWLINES(yytext, yyleng);
 	return T_INLINE_HTML;
 }
-#line 1160 "Zend/zend_language_scanner.c"
+#line 1161 "Zend/zend_language_scanner.c"
 yy4:
 		YYDEBUG(4, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1174,7 +1175,7 @@ yy5:
 yy6:
 		YYDEBUG(6, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1777 "Zend/zend_language_scanner.l"
+#line 1778 "Zend/zend_language_scanner.l"
 		{
 	if (CG(short_tags)) {
 		zendlval->value.str.val = yytext; /* no copying - intentional */
@@ -1186,14 +1187,14 @@ yy6:
 		goto inline_char_handler;
 	}
 }
-#line 1190 "Zend/zend_language_scanner.c"
+#line 1191 "Zend/zend_language_scanner.c"
 yy7:
 		YYDEBUG(7, *YYCURSOR);
 		++YYCURSOR;
 		if ((yych = *YYCURSOR) == '=') goto yy43;
 		YYDEBUG(8, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1754 "Zend/zend_language_scanner.l"
+#line 1755 "Zend/zend_language_scanner.l"
 		{
 	if (CG(asp_tags)) {
 		zendlval->value.str.val = yytext; /* no copying - intentional */
@@ -1205,7 +1206,7 @@ yy7:
 		goto inline_char_handler;
 	}
 }
-#line 1209 "Zend/zend_language_scanner.c"
+#line 1210 "Zend/zend_language_scanner.c"
 yy9:
 		YYDEBUG(9, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1391,7 +1392,7 @@ yy35:
 		++YYCURSOR;
 		YYDEBUG(38, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1714 "Zend/zend_language_scanner.l"
+#line 1715 "Zend/zend_language_scanner.l"
 		{
 	YYCTYPE *bracket = (YYCTYPE*)zend_memrchr(yytext, '<', yyleng - (sizeof("script language=php>") - 1));
 
@@ -1408,7 +1409,7 @@ yy35:
 	BEGIN(ST_IN_SCRIPTING);
 	return T_OPEN_TAG;
 }
-#line 1412 "Zend/zend_language_scanner.c"
+#line 1413 "Zend/zend_language_scanner.c"
 yy39:
 		YYDEBUG(39, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1435,7 +1436,7 @@ yy43:
 		++YYCURSOR;
 		YYDEBUG(44, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1732 "Zend/zend_language_scanner.l"
+#line 1733 "Zend/zend_language_scanner.l"
 		{
 	if (CG(asp_tags)) {
 		zendlval->value.str.val = yytext; /* no copying - intentional */
@@ -1447,13 +1448,13 @@ yy43:
 		goto inline_char_handler;
 	}
 }
-#line 1451 "Zend/zend_language_scanner.c"
+#line 1452 "Zend/zend_language_scanner.c"
 yy45:
 		YYDEBUG(45, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(46, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1745 "Zend/zend_language_scanner.l"
+#line 1746 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.str.val = yytext; /* no copying - intentional */
 	zendlval->value.str.len = yyleng;
@@ -1461,7 +1462,7 @@ yy45:
 	BEGIN(ST_IN_SCRIPTING);
 	return T_OPEN_TAG_WITH_ECHO;
 }
-#line 1465 "Zend/zend_language_scanner.c"
+#line 1466 "Zend/zend_language_scanner.c"
 yy47:
 		YYDEBUG(47, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1488,7 +1489,7 @@ yy50:
 yy51:
 		YYDEBUG(51, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1767 "Zend/zend_language_scanner.l"
+#line 1768 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.str.val = yytext; /* no copying - intentional */
 	zendlval->value.str.len = yyleng;
@@ -1497,7 +1498,7 @@ yy51:
 	BEGIN(ST_IN_SCRIPTING);
 	return T_OPEN_TAG;
 }
-#line 1501 "Zend/zend_language_scanner.c"
+#line 1502 "Zend/zend_language_scanner.c"
 yy52:
 		YYDEBUG(52, *YYCURSOR);
 		++YYCURSOR;
@@ -1568,7 +1569,7 @@ yyc_ST_BACKQUOTE:
 yy56:
 		YYDEBUG(56, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2240 "Zend/zend_language_scanner.l"
+#line 2241 "Zend/zend_language_scanner.l"
 		{
 	if (YYCURSOR > YYLIMIT) {
 		return 0;
@@ -1609,7 +1610,7 @@ yy56:
 	zend_scan_escape_string(zendlval, yytext, yyleng, '`' TSRMLS_CC);
 	return T_ENCAPSED_AND_WHITESPACE;
 }
-#line 1613 "Zend/zend_language_scanner.c"
+#line 1614 "Zend/zend_language_scanner.c"
 yy57:
 		YYDEBUG(57, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1620,12 +1621,12 @@ yy58:
 		++YYCURSOR;
 		YYDEBUG(59, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2184 "Zend/zend_language_scanner.l"
+#line 2185 "Zend/zend_language_scanner.l"
 		{
 	BEGIN(ST_IN_SCRIPTING);
 	return '`';
 }
-#line 1629 "Zend/zend_language_scanner.c"
+#line 1630 "Zend/zend_language_scanner.c"
 yy60:
 		YYDEBUG(60, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1635,14 +1636,14 @@ yy61:
 		++YYCURSOR;
 		YYDEBUG(62, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2171 "Zend/zend_language_scanner.l"
+#line 2172 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.lval = (long) '{';
 	yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
 	yyless(1);
 	return T_CURLY_OPEN;
 }
-#line 1646 "Zend/zend_language_scanner.c"
+#line 1647 "Zend/zend_language_scanner.c"
 yy63:
 		YYDEBUG(63, *YYCURSOR);
 		yyaccept = 0;
@@ -1658,24 +1659,24 @@ yy63:
 yy65:
 		YYDEBUG(65, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1871 "Zend/zend_language_scanner.l"
+#line 1872 "Zend/zend_language_scanner.l"
 		{
 	zend_copy_value(zendlval, (yytext+1), (yyleng-1));
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 1668 "Zend/zend_language_scanner.c"
+#line 1669 "Zend/zend_language_scanner.c"
 yy66:
 		YYDEBUG(66, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(67, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1448 "Zend/zend_language_scanner.l"
+#line 1449 "Zend/zend_language_scanner.l"
 		{
 	yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC);
 	return T_DOLLAR_OPEN_CURLY_BRACES;
 }
-#line 1679 "Zend/zend_language_scanner.c"
+#line 1680 "Zend/zend_language_scanner.c"
 yy68:
 		YYDEBUG(68, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1689,7 +1690,7 @@ yy70:
 		++YYCURSOR;
 		YYDEBUG(71, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1863 "Zend/zend_language_scanner.l"
+#line 1864 "Zend/zend_language_scanner.l"
 		{
 	yyless(yyleng - 1);
 	yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
@@ -1697,7 +1698,7 @@ yy70:
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 1701 "Zend/zend_language_scanner.c"
+#line 1702 "Zend/zend_language_scanner.c"
 yy72:
 		YYDEBUG(72, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1715,7 +1716,7 @@ yy73:
 		++YYCURSOR;
 		YYDEBUG(74, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1853 "Zend/zend_language_scanner.l"
+#line 1854 "Zend/zend_language_scanner.l"
 		{
 	yyless(yyleng - 3);
 	yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
@@ -1723,7 +1724,7 @@ yy73:
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 1727 "Zend/zend_language_scanner.c"
+#line 1728 "Zend/zend_language_scanner.c"
 	}
 /* *********************************** */
 yyc_ST_DOUBLE_QUOTES:
@@ -1791,7 +1792,7 @@ yy77:
 yy78:
 		YYDEBUG(78, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2190 "Zend/zend_language_scanner.l"
+#line 2191 "Zend/zend_language_scanner.l"
 		{
 	if (GET_DOUBLE_QUOTES_SCANNED_LENGTH()) {
 		YYCURSOR += GET_DOUBLE_QUOTES_SCANNED_LENGTH() - 1;
@@ -1840,7 +1841,7 @@ double_quotes_scan_done:
 	zend_scan_escape_string(zendlval, yytext, yyleng, '"' TSRMLS_CC);
 	return T_ENCAPSED_AND_WHITESPACE;
 }
-#line 1844 "Zend/zend_language_scanner.c"
+#line 1845 "Zend/zend_language_scanner.c"
 yy79:
 		YYDEBUG(79, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1851,12 +1852,12 @@ yy80:
 		++YYCURSOR;
 		YYDEBUG(81, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2179 "Zend/zend_language_scanner.l"
+#line 2180 "Zend/zend_language_scanner.l"
 		{
 	BEGIN(ST_IN_SCRIPTING);
 	return '"';
 }
-#line 1860 "Zend/zend_language_scanner.c"
+#line 1861 "Zend/zend_language_scanner.c"
 yy82:
 		YYDEBUG(82, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1866,14 +1867,14 @@ yy83:
 		++YYCURSOR;
 		YYDEBUG(84, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2171 "Zend/zend_language_scanner.l"
+#line 2172 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.lval = (long) '{';
 	yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
 	yyless(1);
 	return T_CURLY_OPEN;
 }
-#line 1877 "Zend/zend_language_scanner.c"
+#line 1878 "Zend/zend_language_scanner.c"
 yy85:
 		YYDEBUG(85, *YYCURSOR);
 		yyaccept = 0;
@@ -1889,24 +1890,24 @@ yy85:
 yy87:
 		YYDEBUG(87, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1871 "Zend/zend_language_scanner.l"
+#line 1872 "Zend/zend_language_scanner.l"
 		{
 	zend_copy_value(zendlval, (yytext+1), (yyleng-1));
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 1899 "Zend/zend_language_scanner.c"
+#line 1900 "Zend/zend_language_scanner.c"
 yy88:
 		YYDEBUG(88, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(89, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1448 "Zend/zend_language_scanner.l"
+#line 1449 "Zend/zend_language_scanner.l"
 		{
 	yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC);
 	return T_DOLLAR_OPEN_CURLY_BRACES;
 }
-#line 1910 "Zend/zend_language_scanner.c"
+#line 1911 "Zend/zend_language_scanner.c"
 yy90:
 		YYDEBUG(90, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1920,7 +1921,7 @@ yy92:
 		++YYCURSOR;
 		YYDEBUG(93, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1863 "Zend/zend_language_scanner.l"
+#line 1864 "Zend/zend_language_scanner.l"
 		{
 	yyless(yyleng - 1);
 	yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
@@ -1928,7 +1929,7 @@ yy92:
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 1932 "Zend/zend_language_scanner.c"
+#line 1933 "Zend/zend_language_scanner.c"
 yy94:
 		YYDEBUG(94, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1946,7 +1947,7 @@ yy95:
 		++YYCURSOR;
 		YYDEBUG(96, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1853 "Zend/zend_language_scanner.l"
+#line 1854 "Zend/zend_language_scanner.l"
 		{
 	yyless(yyleng - 3);
 	yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
@@ -1954,7 +1955,7 @@ yy95:
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 1958 "Zend/zend_language_scanner.c"
+#line 1959 "Zend/zend_language_scanner.c"
 	}
 /* *********************************** */
 yyc_ST_END_HEREDOC:
@@ -1965,7 +1966,7 @@ yyc_ST_END_HEREDOC:
 	++YYCURSOR;
 	YYDEBUG(100, *YYCURSOR);
 	yyleng = YYCURSOR - SCNG(yy_text);
-#line 2158 "Zend/zend_language_scanner.l"
+#line 2159 "Zend/zend_language_scanner.l"
 	{
 	YYCURSOR += CG(heredoc_len) - 1;
 	yyleng = CG(heredoc_len);
@@ -1977,7 +1978,7 @@ yyc_ST_END_HEREDOC:
 	BEGIN(ST_IN_SCRIPTING);
 	return T_END_HEREDOC;
 }
-#line 1981 "Zend/zend_language_scanner.c"
+#line 1982 "Zend/zend_language_scanner.c"
 /* *********************************** */
 yyc_ST_HEREDOC:
 	{
@@ -2039,7 +2040,7 @@ yy103:
 yy104:
 		YYDEBUG(104, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2282 "Zend/zend_language_scanner.l"
+#line 2283 "Zend/zend_language_scanner.l"
 		{
 	int newline = 0;
 
@@ -2110,7 +2111,7 @@ heredoc_scan_done:
 	zend_scan_escape_string(zendlval, yytext, yyleng - newline, 0 TSRMLS_CC);
 	return T_ENCAPSED_AND_WHITESPACE;
 }
-#line 2114 "Zend/zend_language_scanner.c"
+#line 2115 "Zend/zend_language_scanner.c"
 yy105:
 		YYDEBUG(105, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -2125,14 +2126,14 @@ yy107:
 		++YYCURSOR;
 		YYDEBUG(108, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2171 "Zend/zend_language_scanner.l"
+#line 2172 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.lval = (long) '{';
 	yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
 	yyless(1);
 	return T_CURLY_OPEN;
 }
-#line 2136 "Zend/zend_language_scanner.c"
+#line 2137 "Zend/zend_language_scanner.c"
 yy109:
 		YYDEBUG(109, *YYCURSOR);
 		yyaccept = 0;
@@ -2148,24 +2149,24 @@ yy109:
 yy111:
 		YYDEBUG(111, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1871 "Zend/zend_language_scanner.l"
+#line 1872 "Zend/zend_language_scanner.l"
 		{
 	zend_copy_value(zendlval, (yytext+1), (yyleng-1));
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 2158 "Zend/zend_language_scanner.c"
+#line 2159 "Zend/zend_language_scanner.c"
 yy112:
 		YYDEBUG(112, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(113, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1448 "Zend/zend_language_scanner.l"
+#line 1449 "Zend/zend_language_scanner.l"
 		{
 	yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC);
 	return T_DOLLAR_OPEN_CURLY_BRACES;
 }
-#line 2169 "Zend/zend_language_scanner.c"
+#line 2170 "Zend/zend_language_scanner.c"
 yy114:
 		YYDEBUG(114, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -2179,7 +2180,7 @@ yy116:
 		++YYCURSOR;
 		YYDEBUG(117, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1863 "Zend/zend_language_scanner.l"
+#line 1864 "Zend/zend_language_scanner.l"
 		{
 	yyless(yyleng - 1);
 	yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
@@ -2187,7 +2188,7 @@ yy116:
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 2191 "Zend/zend_language_scanner.c"
+#line 2192 "Zend/zend_language_scanner.c"
 yy118:
 		YYDEBUG(118, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -2205,7 +2206,7 @@ yy119:
 		++YYCURSOR;
 		YYDEBUG(120, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1853 "Zend/zend_language_scanner.l"
+#line 1854 "Zend/zend_language_scanner.l"
 		{
 	yyless(yyleng - 3);
 	yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
@@ -2213,7 +2214,7 @@ yy119:
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 2217 "Zend/zend_language_scanner.c"
+#line 2218 "Zend/zend_language_scanner.c"
 	}
 /* *********************************** */
 yyc_ST_IN_SCRIPTING:
@@ -2394,13 +2395,13 @@ yy123:
 yy124:
 		YYDEBUG(124, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1894 "Zend/zend_language_scanner.l"
+#line 1895 "Zend/zend_language_scanner.l"
 		{
 	zend_copy_value(zendlval, yytext, yyleng);
 	zendlval->type = IS_STRING;
 	return T_STRING;
 }
-#line 2404 "Zend/zend_language_scanner.c"
+#line 2405 "Zend/zend_language_scanner.c"
 yy125:
 		YYDEBUG(125, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -2626,11 +2627,11 @@ yy137:
 yy138:
 		YYDEBUG(138, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1437 "Zend/zend_language_scanner.l"
+#line 1438 "Zend/zend_language_scanner.l"
 		{
 	return yytext[0];
 }
-#line 2634 "Zend/zend_language_scanner.c"
+#line 2635 "Zend/zend_language_scanner.c"
 yy139:
 		YYDEBUG(139, *YYCURSOR);
 		++YYCURSOR;
@@ -2639,7 +2640,7 @@ yy139:
 yy140:
 		YYDEBUG(140, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1168 "Zend/zend_language_scanner.l"
+#line 1169 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.str.val = yytext; /* no copying - intentional */
 	zendlval->value.str.len = yyleng;
@@ -2647,7 +2648,7 @@ yy140:
 	HANDLE_NEWLINES(yytext, yyleng);
 	return T_WHITESPACE;
 }
-#line 2651 "Zend/zend_language_scanner.c"
+#line 2652 "Zend/zend_language_scanner.c"
 yy141:
 		YYDEBUG(141, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -2658,11 +2659,11 @@ yy142:
 		++YYCURSOR;
 		YYDEBUG(143, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1197 "Zend/zend_language_scanner.l"
+#line 1198 "Zend/zend_language_scanner.l"
 		{
 	return T_NS_SEPARATOR;
 }
-#line 2666 "Zend/zend_language_scanner.c"
+#line 2667 "Zend/zend_language_scanner.c"
 yy144:
 		YYDEBUG(144, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -2890,18 +2891,18 @@ yy167:
 		++YYCURSOR;
 		YYDEBUG(168, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1442 "Zend/zend_language_scanner.l"
+#line 1443 "Zend/zend_language_scanner.l"
 		{
 	yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
 	return '{';
 }
-#line 2899 "Zend/zend_language_scanner.c"
+#line 2900 "Zend/zend_language_scanner.c"
 yy169:
 		YYDEBUG(169, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(170, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1454 "Zend/zend_language_scanner.l"
+#line 1455 "Zend/zend_language_scanner.l"
 		{
 	RESET_DOC_COMMENT();
 	if (!zend_stack_is_empty(&SCNG(state_stack))) {
@@ -2909,7 +2910,7 @@ yy169:
 	}
 	return '}';
 }
-#line 2913 "Zend/zend_language_scanner.c"
+#line 2914 "Zend/zend_language_scanner.c"
 yy171:
 		YYDEBUG(171, *YYCURSOR);
 		yyaccept = 2;
@@ -2937,7 +2938,7 @@ yy171:
 yy172:
 		YYDEBUG(172, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1504 "Zend/zend_language_scanner.l"
+#line 1505 "Zend/zend_language_scanner.l"
 		{
 	if (yyleng < MAX_LENGTH_OF_LONG - 1) { /* Won't overflow */
 		zendlval->value.lval = strtol(yytext, NULL, 0);
@@ -2958,7 +2959,7 @@ yy172:
 	zendlval->type = IS_LONG;
 	return T_LNUMBER;
 }
-#line 2962 "Zend/zend_language_scanner.c"
+#line 2963 "Zend/zend_language_scanner.c"
 yy173:
 		YYDEBUG(173, *YYCURSOR);
 		yyaccept = 2;
@@ -2986,7 +2987,7 @@ yy175:
 yy176:
 		YYDEBUG(176, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1901 "Zend/zend_language_scanner.l"
+#line 1902 "Zend/zend_language_scanner.l"
 		{
 	while (YYCURSOR < YYLIMIT) {
 		switch (*YYCURSOR++) {
@@ -3020,14 +3021,14 @@ yy176:
 
 	return T_COMMENT;
 }
-#line 3024 "Zend/zend_language_scanner.c"
+#line 3025 "Zend/zend_language_scanner.c"
 yy177:
 		YYDEBUG(177, *YYCURSOR);
 		++YYCURSOR;
 yy178:
 		YYDEBUG(178, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1992 "Zend/zend_language_scanner.l"
+#line 1993 "Zend/zend_language_scanner.l"
 		{
 	register char *s, *t;
 	char *end;
@@ -3095,14 +3096,14 @@ yy178:
 	}
 	return T_CONSTANT_ENCAPSED_STRING;
 }
-#line 3099 "Zend/zend_language_scanner.c"
+#line 3100 "Zend/zend_language_scanner.c"
 yy179:
 		YYDEBUG(179, *YYCURSOR);
 		++YYCURSOR;
 yy180:
 		YYDEBUG(180, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2061 "Zend/zend_language_scanner.l"
+#line 2062 "Zend/zend_language_scanner.l"
 		{
 	int bprefix = (yytext[0] != '"') ? 1 : 0;
 
@@ -3143,24 +3144,24 @@ yy180:
 	BEGIN(ST_DOUBLE_QUOTES);
 	return '"';
 }
-#line 3147 "Zend/zend_language_scanner.c"
+#line 3148 "Zend/zend_language_scanner.c"
 yy181:
 		YYDEBUG(181, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(182, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2152 "Zend/zend_language_scanner.l"
+#line 2153 "Zend/zend_language_scanner.l"
 		{
 	BEGIN(ST_BACKQUOTE);
 	return '`';
 }
-#line 3158 "Zend/zend_language_scanner.c"
+#line 3159 "Zend/zend_language_scanner.c"
 yy183:
 		YYDEBUG(183, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(184, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2410 "Zend/zend_language_scanner.l"
+#line 2411 "Zend/zend_language_scanner.l"
 		{
 	if (YYCURSOR > YYLIMIT) {
 		return 0;
@@ -3169,7 +3170,7 @@ yy183:
 	zend_error(E_COMPILE_WARNING,"Unexpected character in input:  '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE);
 	goto restart;
 }
-#line 3173 "Zend/zend_language_scanner.c"
+#line 3174 "Zend/zend_language_scanner.c"
 yy185:
 		YYDEBUG(185, *YYCURSOR);
 		++YYCURSOR;
@@ -3196,13 +3197,13 @@ yy187:
 yy189:
 		YYDEBUG(189, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1569 "Zend/zend_language_scanner.l"
+#line 1570 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.dval = zend_strtod(yytext, NULL);
 	zendlval->type = IS_DOUBLE;
 	return T_DNUMBER;
 }
-#line 3206 "Zend/zend_language_scanner.c"
+#line 3207 "Zend/zend_language_scanner.c"
 yy190:
 		YYDEBUG(190, *YYCURSOR);
 		yyaccept = 2;
@@ -3294,7 +3295,7 @@ yy199:
 		}
 		YYDEBUG(201, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1479 "Zend/zend_language_scanner.l"
+#line 1480 "Zend/zend_language_scanner.l"
 		{
 	char *bin = yytext + 2; /* Skip "0b" */
 	int len = yyleng - 2;
@@ -3319,7 +3320,7 @@ yy199:
 		return T_DNUMBER;
 	}
 }
-#line 3323 "Zend/zend_language_scanner.c"
+#line 3324 "Zend/zend_language_scanner.c"
 yy202:
 		YYDEBUG(202, *YYCURSOR);
 		++YYCURSOR;
@@ -3331,7 +3332,7 @@ yy202:
 		}
 		YYDEBUG(204, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1525 "Zend/zend_language_scanner.l"
+#line 1526 "Zend/zend_language_scanner.l"
 		{
 	char *hex = yytext + 2; /* Skip "0x" */
 	int len = yyleng - 2;
@@ -3356,7 +3357,7 @@ yy202:
 		return T_DNUMBER;
 	}
 }
-#line 3360 "Zend/zend_language_scanner.c"
+#line 3361 "Zend/zend_language_scanner.c"
 yy205:
 		YYDEBUG(205, *YYCURSOR);
 		++YYCURSOR;
@@ -3365,7 +3366,7 @@ yy205:
 yy206:
 		YYDEBUG(206, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1969 "Zend/zend_language_scanner.l"
+#line 1970 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.str.val = yytext; /* no copying - intentional */
 	zendlval->value.str.len = yyleng;
@@ -3373,7 +3374,7 @@ yy206:
 	BEGIN(INITIAL);
 	return T_CLOSE_TAG;  /* implicit ';' at php-end tag */
 }
-#line 3377 "Zend/zend_language_scanner.c"
+#line 3378 "Zend/zend_language_scanner.c"
 yy207:
 		YYDEBUG(207, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -3407,13 +3408,13 @@ yy209:
 yy211:
 		YYDEBUG(211, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1871 "Zend/zend_language_scanner.l"
+#line 1872 "Zend/zend_language_scanner.l"
 		{
 	zend_copy_value(zendlval, (yytext+1), (yyleng-1));
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 3417 "Zend/zend_language_scanner.c"
+#line 3418 "Zend/zend_language_scanner.c"
 yy212:
 		YYDEBUG(212, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -3427,11 +3428,11 @@ yy213:
 		}
 		YYDEBUG(214, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1425 "Zend/zend_language_scanner.l"
+#line 1426 "Zend/zend_language_scanner.l"
 		{
 	return T_LOGICAL_XOR;
 }
-#line 3435 "Zend/zend_language_scanner.c"
+#line 3436 "Zend/zend_language_scanner.c"
 yy215:
 		YYDEBUG(215, *YYCURSOR);
 		++YYCURSOR;
@@ -3440,61 +3441,61 @@ yy215:
 		}
 		YYDEBUG(216, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1417 "Zend/zend_language_scanner.l"
+#line 1418 "Zend/zend_language_scanner.l"
 		{
 	return T_LOGICAL_OR;
 }
-#line 3448 "Zend/zend_language_scanner.c"
+#line 3449 "Zend/zend_language_scanner.c"
 yy217:
 		YYDEBUG(217, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(218, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1405 "Zend/zend_language_scanner.l"
+#line 1406 "Zend/zend_language_scanner.l"
 		{
 	return T_XOR_EQUAL;
 }
-#line 3458 "Zend/zend_language_scanner.c"
+#line 3459 "Zend/zend_language_scanner.c"
 yy219:
 		YYDEBUG(219, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(220, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1409 "Zend/zend_language_scanner.l"
+#line 1410 "Zend/zend_language_scanner.l"
 		{
 	return T_BOOLEAN_OR;
 }
-#line 3468 "Zend/zend_language_scanner.c"
+#line 3469 "Zend/zend_language_scanner.c"
 yy221:
 		YYDEBUG(221, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(222, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1401 "Zend/zend_language_scanner.l"
+#line 1402 "Zend/zend_language_scanner.l"
 		{
 	return T_OR_EQUAL;
 }
-#line 3478 "Zend/zend_language_scanner.c"
+#line 3479 "Zend/zend_language_scanner.c"
 yy223:
 		YYDEBUG(223, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(224, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1413 "Zend/zend_language_scanner.l"
+#line 1414 "Zend/zend_language_scanner.l"
 		{
 	return T_BOOLEAN_AND;
 }
-#line 3488 "Zend/zend_language_scanner.c"
+#line 3489 "Zend/zend_language_scanner.c"
 yy225:
 		YYDEBUG(225, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(226, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1397 "Zend/zend_language_scanner.l"
+#line 1398 "Zend/zend_language_scanner.l"
 		{
 	return T_AND_EQUAL;
 }
-#line 3498 "Zend/zend_language_scanner.c"
+#line 3499 "Zend/zend_language_scanner.c"
 yy227:
 		YYDEBUG(227, *YYCURSOR);
 		++YYCURSOR;
@@ -3503,7 +3504,7 @@ yy227:
 yy228:
 		YYDEBUG(228, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1978 "Zend/zend_language_scanner.l"
+#line 1979 "Zend/zend_language_scanner.l"
 		{
 	if (CG(asp_tags)) {
 		BEGIN(INITIAL);
@@ -3516,17 +3517,17 @@ yy228:
 		return yytext[0];
 	}
 }
-#line 3520 "Zend/zend_language_scanner.c"
+#line 3521 "Zend/zend_language_scanner.c"
 yy229:
 		YYDEBUG(229, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(230, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1385 "Zend/zend_language_scanner.l"
+#line 1386 "Zend/zend_language_scanner.l"
 		{
 	return T_MOD_EQUAL;
 }
-#line 3530 "Zend/zend_language_scanner.c"
+#line 3531 "Zend/zend_language_scanner.c"
 yy231:
 		YYDEBUG(231, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -3557,11 +3558,11 @@ yy235:
 		++YYCURSOR;
 		YYDEBUG(236, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1381 "Zend/zend_language_scanner.l"
+#line 1382 "Zend/zend_language_scanner.l"
 		{
 	return T_CONCAT_EQUAL;
 }
-#line 3565 "Zend/zend_language_scanner.c"
+#line 3566 "Zend/zend_language_scanner.c"
 yy237:
 		YYDEBUG(237, *YYCURSOR);
 		yyaccept = 4;
@@ -3570,7 +3571,7 @@ yy237:
 yy238:
 		YYDEBUG(238, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1935 "Zend/zend_language_scanner.l"
+#line 1936 "Zend/zend_language_scanner.l"
 		{
 	int doc_com;
 
@@ -3604,7 +3605,7 @@ yy238:
 
 	return T_COMMENT;
 }
-#line 3608 "Zend/zend_language_scanner.c"
+#line 3609 "Zend/zend_language_scanner.c"
 yy239:
 		YYDEBUG(239, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -3614,11 +3615,11 @@ yy240:
 		++YYCURSOR;
 		YYDEBUG(241, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1377 "Zend/zend_language_scanner.l"
+#line 1378 "Zend/zend_language_scanner.l"
 		{
 	return T_DIV_EQUAL;
 }
-#line 3622 "Zend/zend_language_scanner.c"
+#line 3623 "Zend/zend_language_scanner.c"
 yy242:
 		YYDEBUG(242, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -3641,42 +3642,42 @@ yy245:
 		++YYCURSOR;
 		YYDEBUG(246, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1373 "Zend/zend_language_scanner.l"
+#line 1374 "Zend/zend_language_scanner.l"
 		{
 	return T_MUL_EQUAL;
 }
-#line 3649 "Zend/zend_language_scanner.c"
+#line 3650 "Zend/zend_language_scanner.c"
 yy247:
 		YYDEBUG(247, *YYCURSOR);
 		++YYCURSOR;
 		if ((yych = *YYCURSOR) == '=') goto yy251;
 		YYDEBUG(248, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1433 "Zend/zend_language_scanner.l"
+#line 1434 "Zend/zend_language_scanner.l"
 		{
 	return T_SR;
 }
-#line 3660 "Zend/zend_language_scanner.c"
+#line 3661 "Zend/zend_language_scanner.c"
 yy249:
 		YYDEBUG(249, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(250, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1361 "Zend/zend_language_scanner.l"
+#line 1362 "Zend/zend_language_scanner.l"
 		{
 	return T_IS_GREATER_OR_EQUAL;
 }
-#line 3670 "Zend/zend_language_scanner.c"
+#line 3671 "Zend/zend_language_scanner.c"
 yy251:
 		YYDEBUG(251, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(252, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1393 "Zend/zend_language_scanner.l"
+#line 1394 "Zend/zend_language_scanner.l"
 		{
 	return T_SR_EQUAL;
 }
-#line 3680 "Zend/zend_language_scanner.c"
+#line 3681 "Zend/zend_language_scanner.c"
 yy253:
 		YYDEBUG(253, *YYCURSOR);
 		yyaccept = 5;
@@ -3687,11 +3688,11 @@ yy253:
 yy254:
 		YYDEBUG(254, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1429 "Zend/zend_language_scanner.l"
+#line 1430 "Zend/zend_language_scanner.l"
 		{
 	return T_SL;
 }
-#line 3695 "Zend/zend_language_scanner.c"
+#line 3696 "Zend/zend_language_scanner.c"
 yy255:
 		YYDEBUG(255, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -3703,22 +3704,22 @@ yy256:
 		++YYCURSOR;
 		YYDEBUG(257, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1357 "Zend/zend_language_scanner.l"
+#line 1358 "Zend/zend_language_scanner.l"
 		{
 	return T_IS_SMALLER_OR_EQUAL;
 }
-#line 3711 "Zend/zend_language_scanner.c"
+#line 3712 "Zend/zend_language_scanner.c"
 yy258:
 		YYDEBUG(258, *YYCURSOR);
 		++YYCURSOR;
 yy259:
 		YYDEBUG(259, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1353 "Zend/zend_language_scanner.l"
+#line 1354 "Zend/zend_language_scanner.l"
 		{
 	return T_IS_NOT_EQUAL;
 }
-#line 3722 "Zend/zend_language_scanner.c"
+#line 3723 "Zend/zend_language_scanner.c"
 yy260:
 		YYDEBUG(260, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -3769,11 +3770,11 @@ yy267:
 		++YYCURSOR;
 		YYDEBUG(268, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1389 "Zend/zend_language_scanner.l"
+#line 1390 "Zend/zend_language_scanner.l"
 		{
 	return T_SL_EQUAL;
 }
-#line 3777 "Zend/zend_language_scanner.c"
+#line 3778 "Zend/zend_language_scanner.c"
 yy269:
 		YYDEBUG(269, *YYCURSOR);
 		++YYCURSOR;
@@ -3878,7 +3879,7 @@ yy278:
 yy279:
 		YYDEBUG(279, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2103 "Zend/zend_language_scanner.l"
+#line 2104 "Zend/zend_language_scanner.l"
 		{
 	char *s;
 	int bprefix = (yytext[0] != '<') ? 1 : 0;
@@ -3926,7 +3927,7 @@ yy279:
 
 	return T_START_HEREDOC;
 }
-#line 3930 "Zend/zend_language_scanner.c"
+#line 3931 "Zend/zend_language_scanner.c"
 yy280:
 		YYDEBUG(280, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -3966,31 +3967,31 @@ yy283:
 		++YYCURSOR;
 		YYDEBUG(285, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1345 "Zend/zend_language_scanner.l"
+#line 1346 "Zend/zend_language_scanner.l"
 		{
 	return T_IS_NOT_IDENTICAL;
 }
-#line 3974 "Zend/zend_language_scanner.c"
+#line 3975 "Zend/zend_language_scanner.c"
 yy286:
 		YYDEBUG(286, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(287, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1365 "Zend/zend_language_scanner.l"
+#line 1366 "Zend/zend_language_scanner.l"
 		{
 	return T_PLUS_EQUAL;
 }
-#line 3984 "Zend/zend_language_scanner.c"
+#line 3985 "Zend/zend_language_scanner.c"
 yy288:
 		YYDEBUG(288, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(289, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1333 "Zend/zend_language_scanner.l"
+#line 1334 "Zend/zend_language_scanner.l"
 		{
 	return T_INC;
 }
-#line 3994 "Zend/zend_language_scanner.c"
+#line 3995 "Zend/zend_language_scanner.c"
 yy290:
 		YYDEBUG(290, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4009,42 +4010,42 @@ yy292:
 		}
 		YYDEBUG(293, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1321 "Zend/zend_language_scanner.l"
+#line 1322 "Zend/zend_language_scanner.l"
 		{
 	return T_LIST;
 }
-#line 4017 "Zend/zend_language_scanner.c"
+#line 4018 "Zend/zend_language_scanner.c"
 yy294:
 		YYDEBUG(294, *YYCURSOR);
 		++YYCURSOR;
 		if ((yych = *YYCURSOR) == '=') goto yy298;
 		YYDEBUG(295, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1349 "Zend/zend_language_scanner.l"
+#line 1350 "Zend/zend_language_scanner.l"
 		{
 	return T_IS_EQUAL;
 }
-#line 4028 "Zend/zend_language_scanner.c"
+#line 4029 "Zend/zend_language_scanner.c"
 yy296:
 		YYDEBUG(296, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(297, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1317 "Zend/zend_language_scanner.l"
+#line 1318 "Zend/zend_language_scanner.l"
 		{
 	return T_DOUBLE_ARROW;
 }
-#line 4038 "Zend/zend_language_scanner.c"
+#line 4039 "Zend/zend_language_scanner.c"
 yy298:
 		YYDEBUG(298, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(299, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1341 "Zend/zend_language_scanner.l"
+#line 1342 "Zend/zend_language_scanner.l"
 		{
 	return T_IS_IDENTICAL;
 }
-#line 4048 "Zend/zend_language_scanner.c"
+#line 4049 "Zend/zend_language_scanner.c"
 yy300:
 		YYDEBUG(300, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4174,7 +4175,7 @@ yy316:
 		}
 		YYDEBUG(319, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1704 "Zend/zend_language_scanner.l"
+#line 1705 "Zend/zend_language_scanner.l"
 		{
 	if (CG(current_namespace)) {
 		*zendlval = *CG(current_namespace);
@@ -4184,7 +4185,7 @@ yy316:
 	}
 	return T_NS_C;
 }
-#line 4188 "Zend/zend_language_scanner.c"
+#line 4189 "Zend/zend_language_scanner.c"
 yy320:
 		YYDEBUG(320, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4204,7 +4205,7 @@ yy321:
 		}
 		YYDEBUG(324, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1677 "Zend/zend_language_scanner.l"
+#line 1678 "Zend/zend_language_scanner.l"
 		{
 	char *filename = zend_get_compiled_filename(TSRMLS_C);
 	const size_t filename_len = strlen(filename);
@@ -4231,7 +4232,7 @@ yy321:
 	zendlval->type = IS_STRING;
 	return T_DIR;
 }
-#line 4235 "Zend/zend_language_scanner.c"
+#line 4236 "Zend/zend_language_scanner.c"
 yy325:
 		YYDEBUG(325, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4256,13 +4257,13 @@ yy327:
 		}
 		YYDEBUG(330, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1659 "Zend/zend_language_scanner.l"
+#line 1660 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.lval = CG(zend_lineno);
 	zendlval->type = IS_LONG;
 	return T_LINE;
 }
-#line 4266 "Zend/zend_language_scanner.c"
+#line 4267 "Zend/zend_language_scanner.c"
 yy331:
 		YYDEBUG(331, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4297,7 +4298,7 @@ yy335:
 		}
 		YYDEBUG(338, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1638 "Zend/zend_language_scanner.l"
+#line 1639 "Zend/zend_language_scanner.l"
 		{
 	const char *class_name = CG(active_class_entry) ? CG(active_class_entry)->name : NULL;
 	const char *func_name = CG(active_op_array)? CG(active_op_array)->function_name : NULL;
@@ -4318,7 +4319,7 @@ yy335:
 	zendlval->type = IS_STRING;
 	return T_METHOD_C;
 }
-#line 4322 "Zend/zend_language_scanner.c"
+#line 4323 "Zend/zend_language_scanner.c"
 yy339:
 		YYDEBUG(339, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4369,7 +4370,7 @@ yy346:
 		}
 		YYDEBUG(349, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1622 "Zend/zend_language_scanner.l"
+#line 1623 "Zend/zend_language_scanner.l"
 		{
 	const char *func_name = NULL;
 
@@ -4385,7 +4386,7 @@ yy346:
 	zendlval->type = IS_STRING;
 	return T_FUNC_C;
 }
-#line 4389 "Zend/zend_language_scanner.c"
+#line 4390 "Zend/zend_language_scanner.c"
 yy350:
 		YYDEBUG(350, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4405,7 +4406,7 @@ yy351:
 		}
 		YYDEBUG(354, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1665 "Zend/zend_language_scanner.l"
+#line 1666 "Zend/zend_language_scanner.l"
 		{
 	char *filename = zend_get_compiled_filename(TSRMLS_C);
 
@@ -4417,7 +4418,7 @@ yy351:
 	zendlval->type = IS_STRING;
 	return T_FILE;
 }
-#line 4421 "Zend/zend_language_scanner.c"
+#line 4422 "Zend/zend_language_scanner.c"
 yy355:
 		YYDEBUG(355, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4447,7 +4448,7 @@ yy358:
 		}
 		YYDEBUG(361, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1602 "Zend/zend_language_scanner.l"
+#line 1603 "Zend/zend_language_scanner.l"
 		{
 	const char *trait_name = NULL;
 	
@@ -4467,7 +4468,7 @@ yy358:
 	
 	return T_TRAIT_C;
 }
-#line 4471 "Zend/zend_language_scanner.c"
+#line 4472 "Zend/zend_language_scanner.c"
 yy362:
 		YYDEBUG(362, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4497,7 +4498,7 @@ yy365:
 		}
 		YYDEBUG(368, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1575 "Zend/zend_language_scanner.l"
+#line 1576 "Zend/zend_language_scanner.l"
 		{
 	const char *class_name = NULL;
 	
@@ -4524,7 +4525,7 @@ yy365:
 	}
 	return T_CLASS_C;
 }
-#line 4528 "Zend/zend_language_scanner.c"
+#line 4529 "Zend/zend_language_scanner.c"
 yy369:
 		YYDEBUG(369, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4586,11 +4587,11 @@ yy380:
 		}
 		YYDEBUG(381, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1285 "Zend/zend_language_scanner.l"
+#line 1286 "Zend/zend_language_scanner.l"
 		{
 	return T_HALT_COMPILER;
 }
-#line 4594 "Zend/zend_language_scanner.c"
+#line 4595 "Zend/zend_language_scanner.c"
 yy382:
 		YYDEBUG(382, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4610,11 +4611,11 @@ yy384:
 		}
 		YYDEBUG(385, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1265 "Zend/zend_language_scanner.l"
+#line 1266 "Zend/zend_language_scanner.l"
 		{
 	return T_USE;
 }
-#line 4618 "Zend/zend_language_scanner.c"
+#line 4619 "Zend/zend_language_scanner.c"
 yy386:
 		YYDEBUG(386, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4633,11 +4634,11 @@ yy388:
 		}
 		YYDEBUG(389, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1313 "Zend/zend_language_scanner.l"
+#line 1314 "Zend/zend_language_scanner.l"
 		{
 	return T_UNSET;
 }
-#line 4641 "Zend/zend_language_scanner.c"
+#line 4642 "Zend/zend_language_scanner.c"
 yy390:
 		YYDEBUG(390, *YYCURSOR);
 		++YYCURSOR;
@@ -4809,11 +4810,11 @@ yy405:
 		++YYCURSOR;
 		YYDEBUG(407, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1213 "Zend/zend_language_scanner.l"
+#line 1214 "Zend/zend_language_scanner.l"
 		{
 	return T_INT_CAST;
 }
-#line 4817 "Zend/zend_language_scanner.c"
+#line 4818 "Zend/zend_language_scanner.c"
 yy408:
 		YYDEBUG(408, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4857,11 +4858,11 @@ yy413:
 		++YYCURSOR;
 		YYDEBUG(416, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1217 "Zend/zend_language_scanner.l"
+#line 1218 "Zend/zend_language_scanner.l"
 		{
 	return T_DOUBLE_CAST;
 }
-#line 4865 "Zend/zend_language_scanner.c"
+#line 4866 "Zend/zend_language_scanner.c"
 yy417:
 		YYDEBUG(417, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4931,11 +4932,11 @@ yy427:
 		++YYCURSOR;
 		YYDEBUG(430, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1221 "Zend/zend_language_scanner.l"
+#line 1222 "Zend/zend_language_scanner.l"
 		{
 	return T_STRING_CAST;
 }
-#line 4939 "Zend/zend_language_scanner.c"
+#line 4940 "Zend/zend_language_scanner.c"
 yy431:
 		YYDEBUG(431, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4968,11 +4969,11 @@ yy434:
 		++YYCURSOR;
 		YYDEBUG(437, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1225 "Zend/zend_language_scanner.l"
+#line 1226 "Zend/zend_language_scanner.l"
 		{
 	return T_ARRAY_CAST;
 }
-#line 4976 "Zend/zend_language_scanner.c"
+#line 4977 "Zend/zend_language_scanner.c"
 yy438:
 		YYDEBUG(438, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5010,11 +5011,11 @@ yy442:
 		++YYCURSOR;
 		YYDEBUG(445, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1229 "Zend/zend_language_scanner.l"
+#line 1230 "Zend/zend_language_scanner.l"
 		{
 	return T_OBJECT_CAST;
 }
-#line 5018 "Zend/zend_language_scanner.c"
+#line 5019 "Zend/zend_language_scanner.c"
 yy446:
 		YYDEBUG(446, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5055,11 +5056,11 @@ yy451:
 		++YYCURSOR;
 		YYDEBUG(453, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1233 "Zend/zend_language_scanner.l"
+#line 1234 "Zend/zend_language_scanner.l"
 		{
 	return T_BOOL_CAST;
 }
-#line 5063 "Zend/zend_language_scanner.c"
+#line 5064 "Zend/zend_language_scanner.c"
 yy454:
 		YYDEBUG(454, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5119,11 +5120,11 @@ yy462:
 		++YYCURSOR;
 		YYDEBUG(465, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1237 "Zend/zend_language_scanner.l"
+#line 1238 "Zend/zend_language_scanner.l"
 		{
 	return T_UNSET_CAST;
 }
-#line 5127 "Zend/zend_language_scanner.c"
+#line 5128 "Zend/zend_language_scanner.c"
 yy466:
 		YYDEBUG(466, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5137,11 +5138,11 @@ yy467:
 		}
 		YYDEBUG(468, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1209 "Zend/zend_language_scanner.l"
+#line 1210 "Zend/zend_language_scanner.l"
 		{
 	return T_VAR;
 }
-#line 5145 "Zend/zend_language_scanner.c"
+#line 5146 "Zend/zend_language_scanner.c"
 yy469:
 		YYDEBUG(469, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5161,11 +5162,11 @@ yy471:
 		}
 		YYDEBUG(472, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1201 "Zend/zend_language_scanner.l"
+#line 1202 "Zend/zend_language_scanner.l"
 		{
 	return T_NEW;
 }
-#line 5169 "Zend/zend_language_scanner.c"
+#line 5170 "Zend/zend_language_scanner.c"
 yy473:
 		YYDEBUG(473, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5204,21 +5205,21 @@ yy479:
 		}
 		YYDEBUG(480, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1261 "Zend/zend_language_scanner.l"
+#line 1262 "Zend/zend_language_scanner.l"
 		{
 	return T_NAMESPACE;
 }
-#line 5212 "Zend/zend_language_scanner.c"
+#line 5213 "Zend/zend_language_scanner.c"
 yy481:
 		YYDEBUG(481, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(482, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1193 "Zend/zend_language_scanner.l"
+#line 1194 "Zend/zend_language_scanner.l"
 		{
 	return T_PAAMAYIM_NEKUDOTAYIM;
 }
-#line 5222 "Zend/zend_language_scanner.c"
+#line 5223 "Zend/zend_language_scanner.c"
 yy483:
 		YYDEBUG(483, *YYCURSOR);
 		++YYCURSOR;
@@ -5240,32 +5241,32 @@ yy485:
 		++YYCURSOR;
 		YYDEBUG(486, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1369 "Zend/zend_language_scanner.l"
+#line 1370 "Zend/zend_language_scanner.l"
 		{
 	return T_MINUS_EQUAL;
 }
-#line 5248 "Zend/zend_language_scanner.c"
+#line 5249 "Zend/zend_language_scanner.c"
 yy487:
 		YYDEBUG(487, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(488, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1337 "Zend/zend_language_scanner.l"
+#line 1338 "Zend/zend_language_scanner.l"
 		{
 	return T_DEC;
 }
-#line 5258 "Zend/zend_language_scanner.c"
+#line 5259 "Zend/zend_language_scanner.c"
 yy489:
 		YYDEBUG(489, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(490, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1163 "Zend/zend_language_scanner.l"
+#line 1164 "Zend/zend_language_scanner.l"
 		{
 	yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
 	return T_OBJECT_OPERATOR;
 }
-#line 5269 "Zend/zend_language_scanner.c"
+#line 5270 "Zend/zend_language_scanner.c"
 yy491:
 		YYDEBUG(491, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5310,11 +5311,11 @@ yy496:
 		}
 		YYDEBUG(497, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1309 "Zend/zend_language_scanner.l"
+#line 1310 "Zend/zend_language_scanner.l"
 		{
 	return T_PUBLIC;
 }
-#line 5318 "Zend/zend_language_scanner.c"
+#line 5319 "Zend/zend_language_scanner.c"
 yy498:
 		YYDEBUG(498, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5369,11 +5370,11 @@ yy505:
 		}
 		YYDEBUG(506, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1305 "Zend/zend_language_scanner.l"
+#line 1306 "Zend/zend_language_scanner.l"
 		{
 	return T_PROTECTED;
 }
-#line 5377 "Zend/zend_language_scanner.c"
+#line 5378 "Zend/zend_language_scanner.c"
 yy507:
 		YYDEBUG(507, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5403,11 +5404,11 @@ yy511:
 		}
 		YYDEBUG(512, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1301 "Zend/zend_language_scanner.l"
+#line 1302 "Zend/zend_language_scanner.l"
 		{
 	return T_PRIVATE;
 }
-#line 5411 "Zend/zend_language_scanner.c"
+#line 5412 "Zend/zend_language_scanner.c"
 yy513:
 		YYDEBUG(513, *YYCURSOR);
 		++YYCURSOR;
@@ -5416,11 +5417,11 @@ yy513:
 		}
 		YYDEBUG(514, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1139 "Zend/zend_language_scanner.l"
+#line 1140 "Zend/zend_language_scanner.l"
 		{
 	return T_PRINT;
 }
-#line 5424 "Zend/zend_language_scanner.c"
+#line 5425 "Zend/zend_language_scanner.c"
 yy515:
 		YYDEBUG(515, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5445,11 +5446,11 @@ yy518:
 		}
 		YYDEBUG(519, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1131 "Zend/zend_language_scanner.l"
+#line 1132 "Zend/zend_language_scanner.l"
 		{
 	return T_GOTO;
 }
-#line 5453 "Zend/zend_language_scanner.c"
+#line 5454 "Zend/zend_language_scanner.c"
 yy520:
 		YYDEBUG(520, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5473,11 +5474,11 @@ yy523:
 		}
 		YYDEBUG(524, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1273 "Zend/zend_language_scanner.l"
+#line 1274 "Zend/zend_language_scanner.l"
 		{
 	return T_GLOBAL;
 }
-#line 5481 "Zend/zend_language_scanner.c"
+#line 5482 "Zend/zend_language_scanner.c"
 yy525:
 		YYDEBUG(525, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5514,11 +5515,11 @@ yy531:
 		}
 		YYDEBUG(532, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1123 "Zend/zend_language_scanner.l"
+#line 1124 "Zend/zend_language_scanner.l"
 		{
 	return T_BREAK;
 }
-#line 5522 "Zend/zend_language_scanner.c"
+#line 5523 "Zend/zend_language_scanner.c"
 yy533:
 		YYDEBUG(533, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5558,11 +5559,11 @@ yy539:
 		}
 		YYDEBUG(540, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1107 "Zend/zend_language_scanner.l"
+#line 1108 "Zend/zend_language_scanner.l"
 		{
 	return T_SWITCH;
 }
-#line 5566 "Zend/zend_language_scanner.c"
+#line 5567 "Zend/zend_language_scanner.c"
 yy541:
 		YYDEBUG(541, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5586,11 +5587,11 @@ yy544:
 		}
 		YYDEBUG(545, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1289 "Zend/zend_language_scanner.l"
+#line 1290 "Zend/zend_language_scanner.l"
 		{
 	return T_STATIC;
 }
-#line 5594 "Zend/zend_language_scanner.c"
+#line 5595 "Zend/zend_language_scanner.c"
 yy546:
 		YYDEBUG(546, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5617,11 +5618,11 @@ yy549:
 		}
 		YYDEBUG(550, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1103 "Zend/zend_language_scanner.l"
+#line 1104 "Zend/zend_language_scanner.l"
 		{
 	return T_AS;
 }
-#line 5625 "Zend/zend_language_scanner.c"
+#line 5626 "Zend/zend_language_scanner.c"
 yy551:
 		YYDEBUG(551, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5640,11 +5641,11 @@ yy553:
 		}
 		YYDEBUG(554, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1325 "Zend/zend_language_scanner.l"
+#line 1326 "Zend/zend_language_scanner.l"
 		{
 	return T_ARRAY;
 }
-#line 5648 "Zend/zend_language_scanner.c"
+#line 5649 "Zend/zend_language_scanner.c"
 yy555:
 		YYDEBUG(555, *YYCURSOR);
 		++YYCURSOR;
@@ -5653,11 +5654,11 @@ yy555:
 		}
 		YYDEBUG(556, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1421 "Zend/zend_language_scanner.l"
+#line 1422 "Zend/zend_language_scanner.l"
 		{
 	return T_LOGICAL_AND;
 }
-#line 5661 "Zend/zend_language_scanner.c"
+#line 5662 "Zend/zend_language_scanner.c"
 yy557:
 		YYDEBUG(557, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5691,11 +5692,11 @@ yy562:
 		}
 		YYDEBUG(563, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1293 "Zend/zend_language_scanner.l"
+#line 1294 "Zend/zend_language_scanner.l"
 		{
 	return T_ABSTRACT;
 }
-#line 5699 "Zend/zend_language_scanner.c"
+#line 5700 "Zend/zend_language_scanner.c"
 yy564:
 		YYDEBUG(564, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5719,11 +5720,11 @@ yy567:
 		}
 		YYDEBUG(568, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1063 "Zend/zend_language_scanner.l"
+#line 1064 "Zend/zend_language_scanner.l"
 		{
 	return T_WHILE;
 }
-#line 5727 "Zend/zend_language_scanner.c"
+#line 5728 "Zend/zend_language_scanner.c"
 yy569:
 		YYDEBUG(569, *YYCURSOR);
 		++YYCURSOR;
@@ -5732,11 +5733,11 @@ yy569:
 		}
 		YYDEBUG(570, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1047 "Zend/zend_language_scanner.l"
+#line 1048 "Zend/zend_language_scanner.l"
 		{
 	return T_IF;
 }
-#line 5740 "Zend/zend_language_scanner.c"
+#line 5741 "Zend/zend_language_scanner.c"
 yy571:
 		YYDEBUG(571, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5788,11 +5789,11 @@ yy576:
 		}
 		YYDEBUG(577, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1277 "Zend/zend_language_scanner.l"
+#line 1278 "Zend/zend_language_scanner.l"
 		{
 	return T_ISSET;
 }
-#line 5796 "Zend/zend_language_scanner.c"
+#line 5797 "Zend/zend_language_scanner.c"
 yy578:
 		YYDEBUG(578, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5846,11 +5847,11 @@ yy584:
 yy585:
 		YYDEBUG(585, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1245 "Zend/zend_language_scanner.l"
+#line 1246 "Zend/zend_language_scanner.l"
 		{
 	return T_INCLUDE;
 }
-#line 5854 "Zend/zend_language_scanner.c"
+#line 5855 "Zend/zend_language_scanner.c"
 yy586:
 		YYDEBUG(586, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5879,11 +5880,11 @@ yy590:
 		}
 		YYDEBUG(591, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1249 "Zend/zend_language_scanner.l"
+#line 1250 "Zend/zend_language_scanner.l"
 		{
 	return T_INCLUDE_ONCE;
 }
-#line 5887 "Zend/zend_language_scanner.c"
+#line 5888 "Zend/zend_language_scanner.c"
 yy592:
 		YYDEBUG(592, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5917,11 +5918,11 @@ yy597:
 		}
 		YYDEBUG(598, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1147 "Zend/zend_language_scanner.l"
+#line 1148 "Zend/zend_language_scanner.l"
 		{
 	return T_INTERFACE;
 }
-#line 5925 "Zend/zend_language_scanner.c"
+#line 5926 "Zend/zend_language_scanner.c"
 yy599:
 		YYDEBUG(599, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5971,11 +5972,11 @@ yy605:
 		}
 		YYDEBUG(606, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1269 "Zend/zend_language_scanner.l"
+#line 1270 "Zend/zend_language_scanner.l"
 		{
         return T_INSTEADOF;
 }
-#line 5979 "Zend/zend_language_scanner.c"
+#line 5980 "Zend/zend_language_scanner.c"
 yy607:
 		YYDEBUG(607, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6004,11 +6005,11 @@ yy611:
 		}
 		YYDEBUG(612, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1099 "Zend/zend_language_scanner.l"
+#line 1100 "Zend/zend_language_scanner.l"
 		{
 	return T_INSTANCEOF;
 }
-#line 6012 "Zend/zend_language_scanner.c"
+#line 6013 "Zend/zend_language_scanner.c"
 yy613:
 		YYDEBUG(613, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6052,11 +6053,11 @@ yy620:
 		}
 		YYDEBUG(621, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1159 "Zend/zend_language_scanner.l"
+#line 1160 "Zend/zend_language_scanner.l"
 		{
 	return T_IMPLEMENTS;
 }
-#line 6060 "Zend/zend_language_scanner.c"
+#line 6061 "Zend/zend_language_scanner.c"
 yy622:
 		YYDEBUG(622, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6084,11 +6085,11 @@ yy623:
 		}
 		YYDEBUG(625, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1035 "Zend/zend_language_scanner.l"
+#line 1036 "Zend/zend_language_scanner.l"
 		{
 	return T_TRY;
 }
-#line 6092 "Zend/zend_language_scanner.c"
+#line 6093 "Zend/zend_language_scanner.c"
 yy626:
 		YYDEBUG(626, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6107,11 +6108,11 @@ yy628:
 		}
 		YYDEBUG(629, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1151 "Zend/zend_language_scanner.l"
+#line 1152 "Zend/zend_language_scanner.l"
 		{
 	return T_TRAIT;
 }
-#line 6115 "Zend/zend_language_scanner.c"
+#line 6116 "Zend/zend_language_scanner.c"
 yy630:
 		YYDEBUG(630, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6130,11 +6131,11 @@ yy632:
 		}
 		YYDEBUG(633, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1043 "Zend/zend_language_scanner.l"
+#line 1044 "Zend/zend_language_scanner.l"
 		{
 	return T_THROW;
 }
-#line 6138 "Zend/zend_language_scanner.c"
+#line 6139 "Zend/zend_language_scanner.c"
 yy634:
 		YYDEBUG(634, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6195,11 +6196,11 @@ yy640:
 yy641:
 		YYDEBUG(641, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1253 "Zend/zend_language_scanner.l"
+#line 1254 "Zend/zend_language_scanner.l"
 		{
 	return T_REQUIRE;
 }
-#line 6203 "Zend/zend_language_scanner.c"
+#line 6204 "Zend/zend_language_scanner.c"
 yy642:
 		YYDEBUG(642, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6228,11 +6229,11 @@ yy646:
 		}
 		YYDEBUG(647, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1257 "Zend/zend_language_scanner.l"
+#line 1258 "Zend/zend_language_scanner.l"
 		{
 	return T_REQUIRE_ONCE;
 }
-#line 6236 "Zend/zend_language_scanner.c"
+#line 6237 "Zend/zend_language_scanner.c"
 yy648:
 		YYDEBUG(648, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6251,11 +6252,11 @@ yy650:
 		}
 		YYDEBUG(651, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1031 "Zend/zend_language_scanner.l"
+#line 1032 "Zend/zend_language_scanner.l"
 		{
 	return T_RETURN;
 }
-#line 6259 "Zend/zend_language_scanner.c"
+#line 6260 "Zend/zend_language_scanner.c"
 yy652:
 		YYDEBUG(652, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6345,11 +6346,11 @@ yy661:
 		}
 		YYDEBUG(662, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1127 "Zend/zend_language_scanner.l"
+#line 1128 "Zend/zend_language_scanner.l"
 		{
 	return T_CONTINUE;
 }
-#line 6353 "Zend/zend_language_scanner.c"
+#line 6354 "Zend/zend_language_scanner.c"
 yy663:
 		YYDEBUG(663, *YYCURSOR);
 		++YYCURSOR;
@@ -6358,11 +6359,11 @@ yy663:
 		}
 		YYDEBUG(664, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1027 "Zend/zend_language_scanner.l"
+#line 1028 "Zend/zend_language_scanner.l"
 		{
 	return T_CONST;
 }
-#line 6366 "Zend/zend_language_scanner.c"
+#line 6367 "Zend/zend_language_scanner.c"
 yy665:
 		YYDEBUG(665, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6387,11 +6388,11 @@ yy668:
 		}
 		YYDEBUG(669, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1205 "Zend/zend_language_scanner.l"
+#line 1206 "Zend/zend_language_scanner.l"
 		{
 	return T_CLONE;
 }
-#line 6395 "Zend/zend_language_scanner.c"
+#line 6396 "Zend/zend_language_scanner.c"
 yy670:
 		YYDEBUG(670, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6405,11 +6406,11 @@ yy671:
 		}
 		YYDEBUG(672, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1143 "Zend/zend_language_scanner.l"
+#line 1144 "Zend/zend_language_scanner.l"
 		{
 	return T_CLASS;
 }
-#line 6413 "Zend/zend_language_scanner.c"
+#line 6414 "Zend/zend_language_scanner.c"
 yy673:
 		YYDEBUG(673, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6455,11 +6456,11 @@ yy680:
 		}
 		YYDEBUG(681, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1329 "Zend/zend_language_scanner.l"
+#line 1330 "Zend/zend_language_scanner.l"
 		{
  return T_CALLABLE;
 }
-#line 6463 "Zend/zend_language_scanner.c"
+#line 6464 "Zend/zend_language_scanner.c"
 yy682:
 		YYDEBUG(682, *YYCURSOR);
 		++YYCURSOR;
@@ -6468,11 +6469,11 @@ yy682:
 		}
 		YYDEBUG(683, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1115 "Zend/zend_language_scanner.l"
+#line 1116 "Zend/zend_language_scanner.l"
 		{
 	return T_CASE;
 }
-#line 6476 "Zend/zend_language_scanner.c"
+#line 6477 "Zend/zend_language_scanner.c"
 yy684:
 		YYDEBUG(684, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6486,11 +6487,11 @@ yy685:
 		}
 		YYDEBUG(686, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1039 "Zend/zend_language_scanner.l"
+#line 1040 "Zend/zend_language_scanner.l"
 		{
 	return T_CATCH;
 }
-#line 6494 "Zend/zend_language_scanner.c"
+#line 6495 "Zend/zend_language_scanner.c"
 yy687:
 		YYDEBUG(687, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6541,11 +6542,11 @@ yy695:
 		}
 		YYDEBUG(696, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1023 "Zend/zend_language_scanner.l"
+#line 1024 "Zend/zend_language_scanner.l"
 		{
 	return T_FUNCTION;
 }
-#line 6549 "Zend/zend_language_scanner.c"
+#line 6550 "Zend/zend_language_scanner.c"
 yy697:
 		YYDEBUG(697, *YYCURSOR);
 		++YYCURSOR;
@@ -6569,11 +6570,11 @@ yy697:
 yy698:
 		YYDEBUG(698, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1075 "Zend/zend_language_scanner.l"
+#line 1076 "Zend/zend_language_scanner.l"
 		{
 	return T_FOR;
 }
-#line 6577 "Zend/zend_language_scanner.c"
+#line 6578 "Zend/zend_language_scanner.c"
 yy699:
 		YYDEBUG(699, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6597,11 +6598,11 @@ yy702:
 		}
 		YYDEBUG(703, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1083 "Zend/zend_language_scanner.l"
+#line 1084 "Zend/zend_language_scanner.l"
 		{
 	return T_FOREACH;
 }
-#line 6605 "Zend/zend_language_scanner.c"
+#line 6606 "Zend/zend_language_scanner.c"
 yy704:
 		YYDEBUG(704, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6620,11 +6621,11 @@ yy706:
 		}
 		YYDEBUG(707, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1297 "Zend/zend_language_scanner.l"
+#line 1298 "Zend/zend_language_scanner.l"
 		{
 	return T_FINAL;
 }
-#line 6628 "Zend/zend_language_scanner.c"
+#line 6629 "Zend/zend_language_scanner.c"
 yy708:
 		YYDEBUG(708, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6655,11 +6656,11 @@ yy710:
 		}
 		YYDEBUG(711, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1071 "Zend/zend_language_scanner.l"
+#line 1072 "Zend/zend_language_scanner.l"
 		{
 	return T_DO;
 }
-#line 6663 "Zend/zend_language_scanner.c"
+#line 6664 "Zend/zend_language_scanner.c"
 yy712:
 		YYDEBUG(712, *YYCURSOR);
 		++YYCURSOR;
@@ -6668,11 +6669,11 @@ yy712:
 		}
 		YYDEBUG(713, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1019 "Zend/zend_language_scanner.l"
+#line 1020 "Zend/zend_language_scanner.l"
 		{
 	return T_EXIT;
 }
-#line 6676 "Zend/zend_language_scanner.c"
+#line 6677 "Zend/zend_language_scanner.c"
 yy714:
 		YYDEBUG(714, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6707,11 +6708,11 @@ yy719:
 		}
 		YYDEBUG(720, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1119 "Zend/zend_language_scanner.l"
+#line 1120 "Zend/zend_language_scanner.l"
 		{
 	return T_DEFAULT;
 }
-#line 6715 "Zend/zend_language_scanner.c"
+#line 6716 "Zend/zend_language_scanner.c"
 yy721:
 		YYDEBUG(721, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6735,11 +6736,11 @@ yy724:
 		}
 		YYDEBUG(725, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1091 "Zend/zend_language_scanner.l"
+#line 1092 "Zend/zend_language_scanner.l"
 		{
 	return T_DECLARE;
 }
-#line 6743 "Zend/zend_language_scanner.c"
+#line 6744 "Zend/zend_language_scanner.c"
 yy726:
 		YYDEBUG(726, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6819,11 +6820,11 @@ yy737:
 		}
 		YYDEBUG(738, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1155 "Zend/zend_language_scanner.l"
+#line 1156 "Zend/zend_language_scanner.l"
 		{
 	return T_EXTENDS;
 }
-#line 6827 "Zend/zend_language_scanner.c"
+#line 6828 "Zend/zend_language_scanner.c"
 yy739:
 		YYDEBUG(739, *YYCURSOR);
 		++YYCURSOR;
@@ -6832,11 +6833,11 @@ yy739:
 		}
 		YYDEBUG(740, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1015 "Zend/zend_language_scanner.l"
+#line 1016 "Zend/zend_language_scanner.l"
 		{
 	return T_EXIT;
 }
-#line 6840 "Zend/zend_language_scanner.c"
+#line 6841 "Zend/zend_language_scanner.c"
 yy741:
 		YYDEBUG(741, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6850,11 +6851,11 @@ yy742:
 		}
 		YYDEBUG(743, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1241 "Zend/zend_language_scanner.l"
+#line 1242 "Zend/zend_language_scanner.l"
 		{
 	return T_EVAL;
 }
-#line 6858 "Zend/zend_language_scanner.c"
+#line 6859 "Zend/zend_language_scanner.c"
 yy744:
 		YYDEBUG(744, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6924,11 +6925,11 @@ yy753:
 		}
 		YYDEBUG(754, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1067 "Zend/zend_language_scanner.l"
+#line 1068 "Zend/zend_language_scanner.l"
 		{
 	return T_ENDWHILE;
 }
-#line 6932 "Zend/zend_language_scanner.c"
+#line 6933 "Zend/zend_language_scanner.c"
 yy755:
 		YYDEBUG(755, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6957,11 +6958,11 @@ yy759:
 		}
 		YYDEBUG(760, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1111 "Zend/zend_language_scanner.l"
+#line 1112 "Zend/zend_language_scanner.l"
 		{
 	return T_ENDSWITCH;
 }
-#line 6965 "Zend/zend_language_scanner.c"
+#line 6966 "Zend/zend_language_scanner.c"
 yy761:
 		YYDEBUG(761, *YYCURSOR);
 		++YYCURSOR;
@@ -6970,11 +6971,11 @@ yy761:
 		}
 		YYDEBUG(762, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1055 "Zend/zend_language_scanner.l"
+#line 1056 "Zend/zend_language_scanner.l"
 		{
 	return T_ENDIF;
 }
-#line 6978 "Zend/zend_language_scanner.c"
+#line 6979 "Zend/zend_language_scanner.c"
 yy763:
 		YYDEBUG(763, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7003,11 +7004,11 @@ yy764:
 yy765:
 		YYDEBUG(765, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1079 "Zend/zend_language_scanner.l"
+#line 1080 "Zend/zend_language_scanner.l"
 		{
 	return T_ENDFOR;
 }
-#line 7011 "Zend/zend_language_scanner.c"
+#line 7012 "Zend/zend_language_scanner.c"
 yy766:
 		YYDEBUG(766, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7031,11 +7032,11 @@ yy769:
 		}
 		YYDEBUG(770, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1087 "Zend/zend_language_scanner.l"
+#line 1088 "Zend/zend_language_scanner.l"
 		{
 	return T_ENDFOREACH;
 }
-#line 7039 "Zend/zend_language_scanner.c"
+#line 7040 "Zend/zend_language_scanner.c"
 yy771:
 		YYDEBUG(771, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7069,11 +7070,11 @@ yy776:
 		}
 		YYDEBUG(777, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1095 "Zend/zend_language_scanner.l"
+#line 1096 "Zend/zend_language_scanner.l"
 		{
 	return T_ENDDECLARE;
 }
-#line 7077 "Zend/zend_language_scanner.c"
+#line 7078 "Zend/zend_language_scanner.c"
 yy778:
 		YYDEBUG(778, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7092,11 +7093,11 @@ yy780:
 		}
 		YYDEBUG(781, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1281 "Zend/zend_language_scanner.l"
+#line 1282 "Zend/zend_language_scanner.l"
 		{
 	return T_EMPTY;
 }
-#line 7100 "Zend/zend_language_scanner.c"
+#line 7101 "Zend/zend_language_scanner.c"
 yy782:
 		YYDEBUG(782, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7125,11 +7126,11 @@ yy783:
 yy784:
 		YYDEBUG(784, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1059 "Zend/zend_language_scanner.l"
+#line 1060 "Zend/zend_language_scanner.l"
 		{
 	return T_ELSE;
 }
-#line 7133 "Zend/zend_language_scanner.c"
+#line 7134 "Zend/zend_language_scanner.c"
 yy785:
 		YYDEBUG(785, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7143,11 +7144,11 @@ yy786:
 		}
 		YYDEBUG(787, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1051 "Zend/zend_language_scanner.l"
+#line 1052 "Zend/zend_language_scanner.l"
 		{
 	return T_ELSEIF;
 }
-#line 7151 "Zend/zend_language_scanner.c"
+#line 7152 "Zend/zend_language_scanner.c"
 yy788:
 		YYDEBUG(788, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7161,11 +7162,11 @@ yy789:
 		}
 		YYDEBUG(790, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1135 "Zend/zend_language_scanner.l"
+#line 1136 "Zend/zend_language_scanner.l"
 		{
 	return T_ECHO;
 }
-#line 7169 "Zend/zend_language_scanner.c"
+#line 7170 "Zend/zend_language_scanner.c"
 	}
 /* *********************************** */
 yyc_ST_LOOKING_FOR_PROPERTY:
@@ -7238,7 +7239,7 @@ yy793:
 yy794:
 		YYDEBUG(794, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1168 "Zend/zend_language_scanner.l"
+#line 1169 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.str.val = yytext; /* no copying - intentional */
 	zendlval->value.str.len = yyleng;
@@ -7246,7 +7247,7 @@ yy794:
 	HANDLE_NEWLINES(yytext, yyleng);
 	return T_WHITESPACE;
 }
-#line 7250 "Zend/zend_language_scanner.c"
+#line 7251 "Zend/zend_language_scanner.c"
 yy795:
 		YYDEBUG(795, *YYCURSOR);
 		++YYCURSOR;
@@ -7254,13 +7255,13 @@ yy795:
 yy796:
 		YYDEBUG(796, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1187 "Zend/zend_language_scanner.l"
+#line 1188 "Zend/zend_language_scanner.l"
 		{
 	yyless(0);
 	yy_pop_state(TSRMLS_C);
 	goto restart;
 }
-#line 7264 "Zend/zend_language_scanner.c"
+#line 7265 "Zend/zend_language_scanner.c"
 yy797:
 		YYDEBUG(797, *YYCURSOR);
 		++YYCURSOR;
@@ -7269,14 +7270,14 @@ yy797:
 yy798:
 		YYDEBUG(798, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1180 "Zend/zend_language_scanner.l"
+#line 1181 "Zend/zend_language_scanner.l"
 		{
 	yy_pop_state(TSRMLS_C);
 	zend_copy_value(zendlval, yytext, yyleng);
 	zendlval->type = IS_STRING;
 	return T_STRING;
 }
-#line 7280 "Zend/zend_language_scanner.c"
+#line 7281 "Zend/zend_language_scanner.c"
 yy799:
 		YYDEBUG(799, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7297,11 +7298,11 @@ yy802:
 		++YYCURSOR;
 		YYDEBUG(803, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1176 "Zend/zend_language_scanner.l"
+#line 1177 "Zend/zend_language_scanner.l"
 		{
 	return T_OBJECT_OPERATOR;
 }
-#line 7305 "Zend/zend_language_scanner.c"
+#line 7306 "Zend/zend_language_scanner.c"
 yy804:
 		YYDEBUG(804, *YYCURSOR);
 		++YYCURSOR;
@@ -7371,7 +7372,7 @@ yy808:
 yy809:
 		YYDEBUG(809, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1463 "Zend/zend_language_scanner.l"
+#line 1464 "Zend/zend_language_scanner.l"
 		{
 	zend_copy_value(zendlval, yytext, yyleng);
 	zendlval->type = IS_STRING;
@@ -7379,20 +7380,20 @@ yy809:
 	yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
 	return T_STRING_VARNAME;
 }
-#line 7383 "Zend/zend_language_scanner.c"
+#line 7384 "Zend/zend_language_scanner.c"
 yy810:
 		YYDEBUG(810, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(811, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1472 "Zend/zend_language_scanner.l"
+#line 1473 "Zend/zend_language_scanner.l"
 		{
 	yyless(0);
 	yy_pop_state(TSRMLS_C);
 	yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
 	goto restart;
 }
-#line 7396 "Zend/zend_language_scanner.c"
+#line 7397 "Zend/zend_language_scanner.c"
 yy812:
 		YYDEBUG(812, *YYCURSOR);
 		++YYCURSOR;
@@ -7414,7 +7415,7 @@ yyc_ST_NOWDOC:
 	++YYCURSOR;
 	YYDEBUG(817, *YYCURSOR);
 	yyleng = YYCURSOR - SCNG(yy_text);
-#line 2354 "Zend/zend_language_scanner.l"
+#line 2355 "Zend/zend_language_scanner.l"
 	{
 	int newline = 0;
 
@@ -7469,7 +7470,7 @@ nowdoc_scan_done:
 	HANDLE_NEWLINES(yytext, yyleng - newline);
 	return T_ENCAPSED_AND_WHITESPACE;
 }
-#line 7473 "Zend/zend_language_scanner.c"
+#line 7474 "Zend/zend_language_scanner.c"
 /* *********************************** */
 yyc_ST_VAR_OFFSET:
 	{
@@ -7576,7 +7577,7 @@ yy820:
 yy821:
 		YYDEBUG(821, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1550 "Zend/zend_language_scanner.l"
+#line 1551 "Zend/zend_language_scanner.l"
 		{ /* Offset could be treated as a long */
 	if (yyleng < MAX_LENGTH_OF_LONG - 1 || (yyleng == MAX_LENGTH_OF_LONG - 1 && strcmp(yytext, long_min_digits) < 0)) {
 		zendlval->value.lval = strtol(yytext, NULL, 10);
@@ -7588,7 +7589,7 @@ yy821:
 	}
 	return T_NUM_STRING;
 }
-#line 7592 "Zend/zend_language_scanner.c"
+#line 7593 "Zend/zend_language_scanner.c"
 yy822:
 		YYDEBUG(822, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7608,23 +7609,23 @@ yy823:
 yy824:
 		YYDEBUG(824, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1882 "Zend/zend_language_scanner.l"
+#line 1883 "Zend/zend_language_scanner.l"
 		{
 	/* Only '[' can be valid, but returning other tokens will allow a more explicit parse error */
 	return yytext[0];
 }
-#line 7617 "Zend/zend_language_scanner.c"
+#line 7618 "Zend/zend_language_scanner.c"
 yy825:
 		YYDEBUG(825, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(826, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1877 "Zend/zend_language_scanner.l"
+#line 1878 "Zend/zend_language_scanner.l"
 		{
 	yy_pop_state(TSRMLS_C);
 	return ']';
 }
-#line 7628 "Zend/zend_language_scanner.c"
+#line 7629 "Zend/zend_language_scanner.c"
 yy827:
 		YYDEBUG(827, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7634,14 +7635,14 @@ yy828:
 		++YYCURSOR;
 		YYDEBUG(829, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1887 "Zend/zend_language_scanner.l"
+#line 1888 "Zend/zend_language_scanner.l"
 		{
 	/* Invalid rule to return a more explicit parse error with proper line number */
 	yyless(0);
 	yy_pop_state(TSRMLS_C);
 	return T_ENCAPSED_AND_WHITESPACE;
 }
-#line 7645 "Zend/zend_language_scanner.c"
+#line 7646 "Zend/zend_language_scanner.c"
 yy830:
 		YYDEBUG(830, *YYCURSOR);
 		++YYCURSOR;
@@ -7650,19 +7651,19 @@ yy830:
 yy831:
 		YYDEBUG(831, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1894 "Zend/zend_language_scanner.l"
+#line 1895 "Zend/zend_language_scanner.l"
 		{
 	zend_copy_value(zendlval, yytext, yyleng);
 	zendlval->type = IS_STRING;
 	return T_STRING;
 }
-#line 7660 "Zend/zend_language_scanner.c"
+#line 7661 "Zend/zend_language_scanner.c"
 yy832:
 		YYDEBUG(832, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(833, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2410 "Zend/zend_language_scanner.l"
+#line 2411 "Zend/zend_language_scanner.l"
 		{
 	if (YYCURSOR > YYLIMIT) {
 		return 0;
@@ -7671,7 +7672,7 @@ yy832:
 	zend_error(E_COMPILE_WARNING,"Unexpected character in input:  '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE);
 	goto restart;
 }
-#line 7675 "Zend/zend_language_scanner.c"
+#line 7676 "Zend/zend_language_scanner.c"
 yy834:
 		YYDEBUG(834, *YYCURSOR);
 		++YYCURSOR;
@@ -7707,13 +7708,13 @@ yy836:
 yy838:
 		YYDEBUG(838, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1871 "Zend/zend_language_scanner.l"
+#line 1872 "Zend/zend_language_scanner.l"
 		{
 	zend_copy_value(zendlval, (yytext+1), (yyleng-1));
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 7717 "Zend/zend_language_scanner.c"
+#line 7718 "Zend/zend_language_scanner.c"
 yy839:
 		YYDEBUG(839, *YYCURSOR);
 		++YYCURSOR;
@@ -7753,14 +7754,14 @@ yy844:
 yy846:
 		YYDEBUG(846, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1562 "Zend/zend_language_scanner.l"
+#line 1563 "Zend/zend_language_scanner.l"
 		{ /* Offset must be treated as a string */
 	zendlval->value.str.val = (char *)estrndup(yytext, yyleng);
 	zendlval->value.str.len = yyleng;
 	zendlval->type = IS_STRING;
 	return T_NUM_STRING;
 }
-#line 7764 "Zend/zend_language_scanner.c"
+#line 7765 "Zend/zend_language_scanner.c"
 yy847:
 		YYDEBUG(847, *YYCURSOR);
 		++YYCURSOR;
@@ -7783,6 +7784,6 @@ yy849:
 		goto yy846;
 	}
 }
-#line 2419 "Zend/zend_language_scanner.l"
+#line 2420 "Zend/zend_language_scanner.l"
 
 }
diff --git a/Zend/zend_language_scanner_defs.h b/Zend/zend_language_scanner_defs.h
index 5aede18..dbf8674 100644
--- a/Zend/zend_language_scanner_defs.h
+++ b/Zend/zend_language_scanner_defs.h
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Mon Apr 30 10:28:29 2012 */
+/* Generated by re2c 0.13.5 on Mon Apr 30 15:55:05 2012 */
 #line 3 "Zend/zend_language_scanner_defs.h"
 
 enum YYCONDTYPE {


commit 45ef3c759e80b4eda2e24b2f497be58268989b5f
Merge: 3e7af0f 79961dc
Author: Felipe Pena <felipensp at gmail.com>
Date:   Mon Apr 30 15:56:15 2012 -0300

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      - Fixed Windows build



commit 79961dccab18c34befa5b4bc4f6170ea2988e30e
Author: Felipe Pena <felipensp at gmail.com>
Date:   Mon Apr 30 15:55:57 2012 -0300

    - Fixed Windows build

diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l
index 2e3d452..703ca96 100644
--- a/Zend/zend_language_scanner.l
+++ b/Zend/zend_language_scanner.l
@@ -30,11 +30,12 @@
 #endif
 
 #include "zend_language_scanner_defs.h"
+
+#include <errno.h>
+#include "zend.h"
 #ifdef PHP_WIN32
 # include <Winuser.h>
 #endif
-#include <errno.h>
-#include "zend.h"
 #include "zend_alloc.h"
 #include <zend_language_parser.h>
 #include "zend_compile.h"


commit 3e7af0f25ab4cde49b539f2e99f29fba2a95149d
Merge: 8382da0 2ab5b57
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 30 17:35:32 2012 +0200

    Merge branch 'master' of git.php.net:php-src



commit 8382da04923aae8abb70c1f4445e464345caa63a
Merge: ea23192 819a7ae
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 30 17:31:31 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug 61868 ext\dom\tests\DOMDocument_validate_on_parse_variation.phpt fails
      - Regenerated files
    
    Conflicts:
    	Zend/zend_language_scanner.c
    	Zend/zend_language_scanner_defs.h



commit 2ab5b57cd470555889bd8fdfdd7825b178337065
Merge: 174bf90 ea23192
Author: andrey <andrey at php.net>
Date:   Mon Apr 30 17:31:06 2012 +0200

    Merge branch 'master' of git.php.net:php-src



commit 819a7ae6a1f1786716d77741ca5d8ad0189a0c2c
Merge: 47c8b60 1622843
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 30 17:25:25 2012 +0200

    Merge branch 'PHP-5.4' of git.php.net:php-src into PHP-5.4



commit 47c8b6039a104d0f064e9ad962016dbd86cf8d8c
Merge: fc24e74 d26e006
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 30 17:25:11 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug 61868 ext\dom\tests\DOMDocument_validate_on_parse_variation.phpt fails



commit d26e006d7f01db6fab3942ebbf073beaabf57e2d
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 30 17:23:49 2012 +0200

    Fix bug 61868 ext\dom\tests\DOMDocument_validate_on_parse_variation.phpt fails

diff --git a/ext/dom/tests/DOMDocument_validate_on_parse_variation.phpt b/ext/dom/tests/DOMDocument_validate_on_parse_variation.phpt
index 403e01a..d0cea29 100644
--- a/ext/dom/tests/DOMDocument_validate_on_parse_variation.phpt
+++ b/ext/dom/tests/DOMDocument_validate_on_parse_variation.phpt
@@ -12,7 +12,7 @@ require_once('skipif.inc');
 
 require_once('dom_test.inc');
 
-chdir(__DIR__ . "/../examples");
+chdir(__DIR__);
 $XMLStringGood = file_get_contents('note.xml');
 
 $dom = new DOMDocument;
diff --git a/ext/dom/tests/note.dtd b/ext/dom/tests/note.dtd
new file mode 100644
index 0000000..c2d558e
--- /dev/null
+++ b/ext/dom/tests/note.dtd
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!ELEMENT note (to,from,heading,body)>
+<!ELEMENT to (#PCDATA)>
+<!ELEMENT from (#PCDATA)>
+<!ELEMENT heading (#PCDATA)>
+<!ELEMENT body (#PCDATA)>
diff --git a/ext/dom/tests/note.xml b/ext/dom/tests/note.xml
new file mode 100644
index 0000000..49614a1
--- /dev/null
+++ b/ext/dom/tests/note.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<!DOCTYPE note SYSTEM "note.dtd">
+<note>
+<to>PHP User Group</to>
+<from>Shane</from>
+<heading>Reminder</heading>
+<body>Don't forget the meeting tonight!</body>
+</note> 


commit 174bf906f8cf96cf0c1c1719bde9c7a7f1fa7064
Author: andrey <andrey at php.net>
Date:   Mon Apr 30 17:01:56 2012 +0200

    refactor MYSQLND_NET, split it two parts for easy resharing

diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c
index 797cadd..300a7ee 100644
--- a/ext/mysqlnd/mysqlnd.c
+++ b/ext/mysqlnd/mysqlnd.c
@@ -114,7 +114,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, free_contents)(MYSQLND_CONN_DATA * conn TSRMLS
 	}
 
 	if (conn->net) {
-		conn->net->m.free_contents(conn->net TSRMLS_CC);
+		conn->net->data->m.free_contents(conn->net TSRMLS_CC);
 	}
 
 	DBG_INF("Freeing memory of members");
@@ -457,9 +457,9 @@ mysqlnd_switch_to_ssl_if_needed(
 			goto end;
 		}
 
-		conn->net->m.set_client_option(conn->net, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, (const char *) &verify TSRMLS_CC);
+		conn->net->data->m.set_client_option(conn->net, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, (const char *) &verify TSRMLS_CC);
 
-		if (FAIL == conn->net->m.enable_ssl(conn->net TSRMLS_CC)) {
+		if (FAIL == conn->net->data->m.enable_ssl(conn->net TSRMLS_CC)) {
 			goto end;
 		}
 	}
@@ -623,6 +623,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
 	zend_bool reconnect = FALSE;
 	zend_bool saved_compression = FALSE;
 	zend_bool local_tx_started = FALSE;
+	MYSQLND_NET * net = conn->net;
 
 	MYSQLND_PACKET_GREET * greet_packet = NULL;
 
@@ -655,14 +656,14 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
 			MYSQLND_DEC_CONN_STATISTIC(conn->stats, STAT_OPENED_PERSISTENT_CONNECTIONS);
 		}
 		/* Now reconnect using the same handle */
-		if (conn->net->compressed) {
+		if (net->data->compressed) {
 			/*
 			  we need to save the state. As we will re-connect, net->compressed should be off, or
 			  we will look for a compression header as part of the greet message, but there will
 			  be none.
 			*/
 			saved_compression = TRUE;
-			conn->net->compressed = FALSE;
+			net->data->compressed = FALSE;
 		}
 	} else {
 		unsigned int max_allowed_size = MYSQLND_ASSEMBLED_PACKET_MAX_SIZE;
@@ -734,13 +735,13 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
 		goto err; /* OOM */
 	}
 
-	if (FAIL == conn->net->m.connect_ex(conn->net, conn->scheme, conn->scheme_len, conn->persistent,
+	if (FAIL == net->data->m.connect_ex(conn->net, conn->scheme, conn->scheme_len, conn->persistent,
 										conn->stats, conn->error_info TSRMLS_CC))
 	{
 		goto err;
 	}
 
-	DBG_INF_FMT("stream=%p", conn->net->stream);
+	DBG_INF_FMT("stream=%p", net->data->m.get_stream(net TSRMLS_CC));
 
 	if (FAIL == PACKET_READ(greet_packet, conn)) {
 		DBG_ERR("Error while reading greeting packet");
@@ -780,7 +781,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
 		mysql_flags &= ~CLIENT_COMPRESS;
 	}
 #else
-	if (conn->net->options.flags & MYSQLND_NET_FLAG_USE_COMPRESSION) {
+	if (net->data->options.flags & MYSQLND_NET_FLAG_USE_COMPRESSION) {
 		mysql_flags |= CLIENT_COMPRESS;
 	}
 #endif
@@ -789,8 +790,8 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
 		mysql_flags &= ~CLIENT_SSL;
 	}
 #else
-	if (conn->net->options.ssl_key || conn->net->options.ssl_cert ||
-		conn->net->options.ssl_ca || conn->net->options.ssl_capath || conn->net->options.ssl_cipher)
+	if (net->data->options.ssl_key || net->data->options.ssl_cert ||
+		net->data->options.ssl_ca || net->data->options.ssl_capath || net->data->options.ssl_cipher)
 	{
 		mysql_flags |= CLIENT_SSL;
 	}
@@ -806,14 +807,14 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
 		CONN_SET_STATE(conn, CONN_READY);
 
 		if (saved_compression) {
-			conn->net->compressed = TRUE;
+			net->data->compressed = TRUE;
 		}
 		/*
 		  If a connect on a existing handle is performed and mysql_flags is
 		  passed which doesn't CLIENT_COMPRESS, then we need to overwrite the value
 		  which we set based on saved_compression.
 		*/
-		conn->net->compressed = mysql_flags & CLIENT_COMPRESS? TRUE:FALSE;
+		net->data->compressed = mysql_flags & CLIENT_COMPRESS? TRUE:FALSE;
 
 		conn->user				= mnd_pestrdup(user, conn->persistent);
 		conn->user_len			= strlen(conn->user);
@@ -1142,7 +1143,7 @@ static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, p
 		 * when casting.  It is only used here so that the buffered data warning
 		 * is not displayed.
 		 * */
-		if (SUCCESS == php_stream_cast((*p)->data->net->stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL,
+		if (SUCCESS == php_stream_cast((*p)->data->net->data->m.get_stream((*p)->data->net TSRMLS_CC), PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL,
 										(void*)&this_fd, 1) && this_fd >= 0) {
 
 			PHP_SAFE_FD_SET(this_fd, fds);
@@ -1167,7 +1168,7 @@ static int mysqlnd_stream_array_from_fd_set(MYSQLND ** conn_array, fd_set * fds
 	MYSQLND **fwd = conn_array, **bckwd = conn_array;
 
 	while (*fwd) {
-		if (SUCCESS == php_stream_cast((*fwd)->data->net->stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL,
+		if (SUCCESS == php_stream_cast((*fwd)->data->net->data->m.get_stream((*fwd)->data->net TSRMLS_CC), PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL,
 										(void*)&this_fd, 1) && this_fd >= 0) {
 			if (PHP_SAFE_FD_ISSET(this_fd, fds)) {
 				if (disproportion) {
@@ -1438,14 +1439,15 @@ MYSQLND_METHOD(mysqlnd_conn_data, ssl_set)(MYSQLND_CONN_DATA * const conn, const
 {
 	size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, ssl_set);
 	enum_func_status ret = FAIL;
+	MYSQLND_NET * net = conn->net;
 	DBG_ENTER("mysqlnd_conn_data::ssl_set");
 
 	if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
-		ret = (PASS == conn->net->m.set_client_option(conn->net, MYSQLND_OPT_SSL_KEY, key TSRMLS_CC) &&
-			PASS == conn->net->m.set_client_option(conn->net, MYSQLND_OPT_SSL_CERT, cert TSRMLS_CC) &&
-			PASS == conn->net->m.set_client_option(conn->net, MYSQLND_OPT_SSL_CA, ca TSRMLS_CC) &&
-			PASS == conn->net->m.set_client_option(conn->net, MYSQLND_OPT_SSL_CAPATH, capath TSRMLS_CC) &&
-			PASS == conn->net->m.set_client_option(conn->net, MYSQLND_OPT_SSL_CIPHER, cipher TSRMLS_CC)) ? PASS : FAIL;
+		ret = (PASS == net->data->m.set_client_option(net, MYSQLND_OPT_SSL_KEY, key TSRMLS_CC) &&
+			PASS == net->data->m.set_client_option(net, MYSQLND_OPT_SSL_CERT, cert TSRMLS_CC) &&
+			PASS == net->data->m.set_client_option(net, MYSQLND_OPT_SSL_CA, ca TSRMLS_CC) &&
+			PASS == net->data->m.set_client_option(net, MYSQLND_OPT_SSL_CAPATH, capath TSRMLS_CC) &&
+			PASS == net->data->m.set_client_option(net, MYSQLND_OPT_SSL_CIPHER, cipher TSRMLS_CC)) ? PASS : FAIL;
 
 		conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
 	}
@@ -1717,10 +1719,11 @@ static enum_func_status
 MYSQLND_METHOD(mysqlnd_conn_data, send_close)(MYSQLND_CONN_DATA * const conn TSRMLS_DC)
 {
 	enum_func_status ret = PASS;
+	MYSQLND_NET * net = conn->net;
+	php_stream * net_stream = net->data->m.get_stream(net TSRMLS_CC);
 
 	DBG_ENTER("mysqlnd_send_close");
-	DBG_INF_FMT("conn=%llu conn->net->stream->abstract=%p",
-				conn->thread_id, conn->net->stream? conn->net->stream->abstract:NULL);
+	DBG_INF_FMT("conn=%llu net->data->stream->abstract=%p", conn->thread_id, net_stream? net_stream->abstract:NULL);
 
 	if (CONN_GET_STATE(conn) >= CONN_READY) {
 		MYSQLND_DEC_CONN_STATISTIC(conn->stats, STAT_OPENED_CONNECTIONS);
@@ -1731,7 +1734,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, send_close)(MYSQLND_CONN_DATA * const conn TSR
 	switch (CONN_GET_STATE(conn)) {
 		case CONN_READY:
 			DBG_INF("Connection clean, sending COM_QUIT");
-			if (conn->net->stream) {
+			if (net_stream) {
 				ret = conn->m->simple_command(conn, COM_QUIT, NULL, 0, PROT_LAST, TRUE, TRUE TSRMLS_CC);
 			}
 			/* Do nothing */
@@ -2264,7 +2267,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(MYSQLND_CONN_DATA * const c
 		case MYSQL_OPT_CONNECT_TIMEOUT:
 		case MYSQLND_OPT_NET_CMD_BUFFER_SIZE:
 		case MYSQLND_OPT_NET_READ_BUFFER_SIZE:
-			ret = conn->net->m.set_client_option(conn->net, option, value TSRMLS_CC);
+			ret = conn->net->data->m.set_client_option(conn->net, option, value TSRMLS_CC);
 			break;
 #if MYSQLND_UNICODE
 		case MYSQLND_OPT_NUMERIC_AND_DATETIME_AS_UNICODE:
diff --git a/ext/mysqlnd/mysqlnd_driver.c b/ext/mysqlnd/mysqlnd_driver.c
index e645b88..e55a0bc 100644
--- a/ext/mysqlnd/mysqlnd_driver.c
+++ b/ext/mysqlnd/mysqlnd_driver.c
@@ -249,17 +249,29 @@ MYSQLND_METHOD(mysqlnd_object_factory, get_prepared_statement)(MYSQLND_CONN_DATA
 PHPAPI MYSQLND_NET *
 MYSQLND_METHOD(mysqlnd_object_factory, get_io_channel)(zend_bool persistent, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info TSRMLS_DC)
 {
-	size_t alloc_size = sizeof(MYSQLND_NET) + mysqlnd_plugin_count() * sizeof(void *);
-	MYSQLND_NET * net = mnd_pecalloc(1, alloc_size, persistent);
+	size_t net_alloc_size = sizeof(MYSQLND_NET) + mysqlnd_plugin_count() * sizeof(void *);
+	size_t net_data_alloc_size = sizeof(MYSQLND_NET_DATA) + mysqlnd_plugin_count() * sizeof(void *);
+	MYSQLND_NET * net = mnd_pecalloc(1, net_alloc_size, persistent);
+	MYSQLND_NET_DATA * net_data = mnd_pecalloc(1, net_data_alloc_size, persistent);
 
 	DBG_ENTER("mysqlnd_object_factory::get_io_channel");
 	DBG_INF_FMT("persistent=%u", persistent);
-	if (net) {
-		net->persistent = persistent;
-		net->m = *mysqlnd_net_get_methods();
+	if (net && net_data) {
+		net->data = net_data;
+		net->persistent = net->data->persistent = persistent;
+		net->data->m = *mysqlnd_net_get_methods();
 
-		if (PASS != net->m.init(net, stats, error_info TSRMLS_CC)) {
-			net->m.dtor(net, stats, error_info TSRMLS_CC);
+		if (PASS != net->data->m.init(net, stats, error_info TSRMLS_CC)) {
+			net->data->m.dtor(net, stats, error_info TSRMLS_CC);
+			net = NULL;
+		}
+	} else {
+		if (net_data) {
+			mnd_pefree(net_data, persistent);
+			net_data = NULL;
+		}
+		if (net) {
+			mnd_pefree(net, persistent);
 			net = NULL;
 		}
 	}
diff --git a/ext/mysqlnd/mysqlnd_loaddata.c b/ext/mysqlnd/mysqlnd_loaddata.c
index 8e8622e..61cf235 100644
--- a/ext/mysqlnd/mysqlnd_loaddata.c
+++ b/ext/mysqlnd/mysqlnd_loaddata.c
@@ -172,7 +172,7 @@ mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * filename, zen
 	if (!(conn->options->flags & CLIENT_LOCAL_FILES)) {
 		php_error_docref(NULL TSRMLS_CC, E_WARNING, "LOAD DATA LOCAL INFILE forbidden");
 		/* write empty packet to server */
-		ret = net->m.send_ex(net, empty_packet, 0, conn->stats, conn->error_info TSRMLS_CC);
+		ret = net->data->m.send_ex(net, empty_packet, 0, conn->stats, conn->error_info TSRMLS_CC);
 		*is_warning = TRUE;
 		goto infile_error;
 	}
@@ -192,13 +192,13 @@ mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * filename, zen
 		tmp_error_no = infile.local_infile_error(info, tmp_buf, sizeof(tmp_buf) TSRMLS_CC);
 		SET_CLIENT_ERROR(*conn->error_info, tmp_error_no, UNKNOWN_SQLSTATE, tmp_buf);
 		/* write empty packet to server */
-		ret = net->m.send_ex(net, empty_packet, 0, conn->stats, conn->error_info TSRMLS_CC);
+		ret = net->data->m.send_ex(net, empty_packet, 0, conn->stats, conn->error_info TSRMLS_CC);
 		goto infile_error;
 	}
 
 	/* read data */
 	while ((bufsize = infile.local_infile_read (info, buf + MYSQLND_HEADER_SIZE, buflen - MYSQLND_HEADER_SIZE TSRMLS_CC)) > 0) {
-		if ((ret = net->m.send_ex(net, buf, bufsize, conn->stats, conn->error_info TSRMLS_CC)) == 0) {
+		if ((ret = net->data->m.send_ex(net, buf, bufsize, conn->stats, conn->error_info TSRMLS_CC)) == 0) {
 			DBG_ERR_FMT("Error during read : %d %s %s", CR_SERVER_LOST, UNKNOWN_SQLSTATE, lost_conn);
 			SET_CLIENT_ERROR(*conn->error_info, CR_SERVER_LOST, UNKNOWN_SQLSTATE, lost_conn);
 			goto infile_error;
@@ -206,7 +206,7 @@ mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * filename, zen
 	}
 
 	/* send empty packet for eof */
-	if ((ret = net->m.send_ex(net, empty_packet, 0, conn->stats, conn->error_info TSRMLS_CC)) == 0) {
+	if ((ret = net->data->m.send_ex(net, empty_packet, 0, conn->stats, conn->error_info TSRMLS_CC)) == 0) {
 		SET_CLIENT_ERROR(*conn->error_info, CR_SERVER_LOST, UNKNOWN_SQLSTATE, lost_conn);
 		goto infile_error;
 	}
diff --git a/ext/mysqlnd/mysqlnd_net.c b/ext/mysqlnd/mysqlnd_net.c
index 800f577..3f332ae 100644
--- a/ext/mysqlnd/mysqlnd_net.c
+++ b/ext/mysqlnd/mysqlnd_net.c
@@ -67,16 +67,17 @@ MYSQLND_METHOD(mysqlnd_net, network_read_ex)(MYSQLND_NET * const net, zend_uchar
 											 MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC)
 {
 	enum_func_status return_value = PASS;
+	php_stream * net_stream = net->data->m.get_stream(net TSRMLS_CC);
+	size_t old_chunk_size = net_stream->chunk_size;
 	size_t to_read = count, ret;
-	size_t old_chunk_size = net->stream->chunk_size;
 	zend_uchar * p = buffer;
 
 	DBG_ENTER("mysqlnd_net::network_read_ex");
 	DBG_INF_FMT("count="MYSQLND_SZ_T_SPEC, count);
 
-	net->stream->chunk_size = MIN(to_read, net->options.net_read_buffer_size);
+	net_stream->chunk_size = MIN(to_read, net->data->options.net_read_buffer_size);
 	while (to_read) {
-		if (!(ret = php_stream_read(net->stream, (char *) p, to_read))) {
+		if (!(ret = php_stream_read(net_stream, (char *) p, to_read))) {
 			DBG_ERR_FMT("Error while reading header from socket");
 			return_value = FAIL;
 			break;
@@ -85,7 +86,7 @@ MYSQLND_METHOD(mysqlnd_net, network_read_ex)(MYSQLND_NET * const net, zend_uchar
 		to_read -= ret;
 	}
 	MYSQLND_INC_CONN_STATISTIC_W_VALUE(stats, STAT_BYTES_RECEIVED, count - to_read);
-	net->stream->chunk_size = old_chunk_size;
+	net_stream->chunk_size = old_chunk_size;
 	DBG_RETURN(return_value);
 }
 /* }}} */
@@ -98,7 +99,7 @@ MYSQLND_METHOD(mysqlnd_net, network_write_ex)(MYSQLND_NET * const net, const zen
 {
 	size_t ret;
 	DBG_ENTER("mysqlnd_net::network_write_ex");
-	ret = php_stream_write(net->stream, (char *)buffer, count);
+	ret = php_stream_write(net->data->m.get_stream(net TSRMLS_CC), (char *)buffer, count);
 	DBG_RETURN(ret);
 }
 /* }}} */
@@ -114,13 +115,15 @@ MYSQLND_METHOD(mysqlnd_net, open_pipe)(MYSQLND_NET * const net, const char * con
 #else
 	unsigned int streams_options = 0;
 #endif
+	php_stream * net_stream = NULL;
+
 	DBG_ENTER("mysqlnd_net::open_pipe");
 	if (persistent) {
 		streams_options |= STREAM_OPEN_PERSISTENT;
 	}
 	streams_options |= IGNORE_URL;
-	net->stream = php_stream_open_wrapper((char*) scheme + sizeof("pipe://") - 1, "r+", streams_options, NULL);
-	if (!net->stream) {
+	net_stream = php_stream_open_wrapper((char*) scheme + sizeof("pipe://") - 1, "r+", streams_options, NULL);
+	if (!net_stream) {
 		SET_CLIENT_ERROR(*error_info, CR_CONNECTION_ERROR, UNKNOWN_SQLSTATE, "Unknown errror while connecting");
 		DBG_RETURN(FAIL);
 	}
@@ -129,9 +132,11 @@ MYSQLND_METHOD(mysqlnd_net, open_pipe)(MYSQLND_NET * const net, const char * con
 	  be registered as resource (in EG(regular_list). So far, so good. However, it won't be
 	  unregistered yntil the script ends. So, we need to take care of that.
 	*/
-	net->stream->in_free = 1;
-	zend_hash_index_del(&EG(regular_list), net->stream->rsrc_id);
-	net->stream->in_free = 0;
+	net_stream->in_free = 1;
+	zend_hash_index_del(&EG(regular_list), net_stream->rsrc_id);
+	net_stream->in_free = 0;
+
+	(void) net->data->m.set_stream(net, net_stream TSRMLS_CC);
 
 	DBG_RETURN(PASS);
 }
@@ -155,24 +160,27 @@ MYSQLND_METHOD(mysqlnd_net, open_tcp_or_unix)(MYSQLND_NET * const net, const cha
 	char * errstr = NULL;
 	int errcode = 0;
 	struct timeval tv;
+	php_stream * net_stream = NULL;
 
 	DBG_ENTER("mysqlnd_net::open_tcp_or_unix");
 
+	net->data->stream = NULL;
+
 	if (persistent) {
 		hashed_details_len = mnd_sprintf(&hashed_details, 0, "%p", net);
 		DBG_INF_FMT("hashed_details=%s", hashed_details);
 	}
 
-	if (net->options.timeout_connect) {
-		tv.tv_sec = net->options.timeout_connect;
+	if (net->data->options.timeout_connect) {
+		tv.tv_sec = net->data->options.timeout_connect;
 		tv.tv_usec = 0;
 	}
 
 	DBG_INF_FMT("calling php_stream_xport_create");
-	net->stream = php_stream_xport_create(scheme, scheme_len, streams_options, streams_flags,
-										  hashed_details, (net->options.timeout_connect) ? &tv : NULL,
+	net_stream = php_stream_xport_create(scheme, scheme_len, streams_options, streams_flags,
+										  hashed_details, (net->data->options.timeout_connect) ? &tv : NULL,
 										  NULL /*ctx*/, &errstr, &errcode);
-	if (errstr || !net->stream) {
+	if (errstr || !net_stream) {
 		DBG_ERR("Error");
 		if (hashed_details) {
 			mnd_sprintf_free(hashed_details);
@@ -199,13 +207,13 @@ MYSQLND_METHOD(mysqlnd_net, open_tcp_or_unix)(MYSQLND_NET * const net, const cha
 			  but STREAMS suck big time regarding persistent streams.
 			  Just not compatible for extensions that need persistency.
 			*/
-			net->stream->in_free = 1;
+			net_stream->in_free = 1;
 			zend_hash_del(&EG(persistent_list), hashed_details, hashed_details_len + 1);
-			net->stream->in_free = 0;
+			net_stream->in_free = 0;
 		}
 #if ZEND_DEBUG
 		/* Shut-up the streams, they don't know what they are doing */
-		net->stream->__exposed = 1;
+		net_stream->__exposed = 1;
 #endif
 		mnd_sprintf_free(hashed_details);
 	}
@@ -215,33 +223,35 @@ MYSQLND_METHOD(mysqlnd_net, open_tcp_or_unix)(MYSQLND_NET * const net, const cha
 	  be registered as resource (in EG(regular_list). So far, so good. However, it won't be
 	  unregistered yntil the script ends. So, we need to take care of that.
 	*/
-	net->stream->in_free = 1;
-	zend_hash_index_del(&EG(regular_list), net->stream->rsrc_id);
-	net->stream->in_free = 0;
+	net_stream->in_free = 1;
+	zend_hash_index_del(&EG(regular_list), net_stream->rsrc_id);
+	net_stream->in_free = 0;
 
+	(void) net->data->m.set_stream(net, net_stream TSRMLS_CC);
 	DBG_RETURN(PASS);
 }
 /* }}} */
 
 
-/* {{{ mysqlnd_net::connect_ex */
+/* {{{ mysqlnd_net::post_connect_set_opt */
 static void
 MYSQLND_METHOD(mysqlnd_net, post_connect_set_opt)(MYSQLND_NET * const net,
 												  const char * const scheme, const size_t scheme_len,
 												  MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC)
 {
+	php_stream * net_stream = net->data->m.get_stream(net TSRMLS_CC);
 	DBG_ENTER("mysqlnd_net::post_connect_set_opt");
-	if (net->options.timeout_read) {
+	if (net->data->options.timeout_read) {
 		struct timeval tv;
-		DBG_INF_FMT("setting %u as PHP_STREAM_OPTION_READ_TIMEOUT", net->options.timeout_read);
-		tv.tv_sec = net->options.timeout_read;
+		DBG_INF_FMT("setting %u as PHP_STREAM_OPTION_READ_TIMEOUT", net->data->options.timeout_read);
+		tv.tv_sec = net->data->options.timeout_read;
 		tv.tv_usec = 0;
-		php_stream_set_option(net->stream, PHP_STREAM_OPTION_READ_TIMEOUT, 0, &tv);
+		php_stream_set_option(net_stream, PHP_STREAM_OPTION_READ_TIMEOUT, 0, &tv);
 	}
 
 	if (!memcmp(scheme, "tcp://", sizeof("tcp://") - 1)) {
 		/* TCP -> Set TCP_NODELAY */
-		mysqlnd_set_sock_no_delay(net->stream TSRMLS_CC);
+		mysqlnd_set_sock_no_delay(net_stream TSRMLS_CC);
 	}
 
 	DBG_VOID_RETURN;
@@ -249,6 +259,24 @@ MYSQLND_METHOD(mysqlnd_net, post_connect_set_opt)(MYSQLND_NET * const net,
 /* }}} */
 
 
+/* {{{ mysqlnd_net::get_open_stream */
+static func_mysqlnd_net__open_stream
+MYSQLND_METHOD(mysqlnd_net, get_open_stream)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len,
+											 MYSQLND_ERROR_INFO * const error_info TSRMLS_DC)
+{
+	func_mysqlnd_net__open_stream ret = NULL;
+	DBG_ENTER("mysqlnd_net::get_open_stream");
+	ret = (scheme_len > (sizeof("pipe://") - 1) && !memcmp(scheme, "pipe://", sizeof("pipe://") - 1))? net->data->m.open_pipe:
+																									   net->data->m.open_tcp_or_unix;
+	if (!ret) {
+		SET_CLIENT_ERROR(*error_info, CR_CONNECTION_ERROR, UNKNOWN_SQLSTATE, "No handler for this scheme");
+	}	
+	
+	DBG_RETURN(ret);
+}
+/* }}} */
+
+
 /* {{{ mysqlnd_net::connect_ex */
 static enum_func_status
 MYSQLND_METHOD(mysqlnd_net, connect_ex)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len,
@@ -261,13 +289,13 @@ MYSQLND_METHOD(mysqlnd_net, connect_ex)(MYSQLND_NET * const net, const char * co
 
 	net->packet_no = net->compressed_envelope_packet_no = 0;
 
-	net->m.close_stream(net, conn_stats, error_info TSRMLS_CC);
-
-	open_stream = (scheme_len > (sizeof("pipe://") - 1) && !memcmp(scheme, "pipe://", sizeof("pipe://") - 1))? net->m.open_pipe:
-																											   net->m.open_tcp_or_unix;
+	net->data->m.close_stream(net, conn_stats, error_info TSRMLS_CC);
 
-	if (PASS == (ret = open_stream(net, scheme, scheme_len, persistent, conn_stats, error_info TSRMLS_CC))) {
-		net->m.post_connect_set_opt(net, scheme, scheme_len, conn_stats, error_info TSRMLS_CC);
+	open_stream = net->data->m.get_open_stream(net, scheme, scheme_len, error_info TSRMLS_CC);
+	if (open_stream) {
+		if (PASS == (ret = open_stream(net, scheme, scheme_len, persistent, conn_stats, error_info TSRMLS_CC))) {
+			net->data->m.post_connect_set_opt(net, scheme, scheme_len, conn_stats, error_info TSRMLS_CC);
+		}
 	}
 
 	DBG_RETURN(ret);
@@ -309,9 +337,9 @@ MYSQLND_METHOD(mysqlnd_net, send_ex)(MYSQLND_NET * const net, zend_uchar * const
 	size_t to_be_sent;
 
 	DBG_ENTER("mysqlnd_net::send_ex");
-	DBG_INF_FMT("count=" MYSQLND_SZ_T_SPEC " compression=%u", count, net->compressed);
+	DBG_INF_FMT("count=" MYSQLND_SZ_T_SPEC " compression=%u", count, net->data->compressed);
 
-	if (net->compressed == TRUE) {
+	if (net->data->compressed == TRUE) {
 		size_t comp_buf_size = MYSQLND_HEADER_SIZE + COMPRESSED_HEADER_SIZE + MYSQLND_HEADER_SIZE + MIN(left, MYSQLND_MAX_PACKET_SIZE);
 		DBG_INF_FMT("compress_buf_size="MYSQLND_SZ_T_SPEC, comp_buf_size);
 		compress_buf = mnd_emalloc(comp_buf_size);
@@ -320,7 +348,7 @@ MYSQLND_METHOD(mysqlnd_net, send_ex)(MYSQLND_NET * const net, zend_uchar * const
 	do {
 		to_be_sent = MIN(left, MYSQLND_MAX_PACKET_SIZE);
 #ifdef MYSQLND_COMPRESSION_ENABLED
-		if (net->compressed == TRUE) {
+		if (net->data->compressed == TRUE) {
 			/* here we need to compress the data and then write it, first comes the compressed header */
 			size_t tmp_complen = to_be_sent;
 			size_t payload_size;
@@ -329,7 +357,7 @@ MYSQLND_METHOD(mysqlnd_net, send_ex)(MYSQLND_NET * const net, zend_uchar * const
 			STORE_HEADER_SIZE(safe_storage, uncompressed_payload);
 			int3store(uncompressed_payload, to_be_sent);
 			int1store(uncompressed_payload + 3, net->packet_no);
-			if (PASS == net->m.encode((compress_buf + COMPRESSED_HEADER_SIZE + MYSQLND_HEADER_SIZE), &tmp_complen,
+			if (PASS == net->data->m.encode((compress_buf + COMPRESSED_HEADER_SIZE + MYSQLND_HEADER_SIZE), &tmp_complen,
 									   uncompressed_payload, to_be_sent + MYSQLND_HEADER_SIZE TSRMLS_CC))
 			{
 				int3store(compress_buf + MYSQLND_HEADER_SIZE, to_be_sent + MYSQLND_HEADER_SIZE);
@@ -344,14 +372,14 @@ MYSQLND_METHOD(mysqlnd_net, send_ex)(MYSQLND_NET * const net, zend_uchar * const
 			int3store(compress_buf, payload_size);
 			int1store(compress_buf + 3, net->packet_no);
 			DBG_INF_FMT("writing "MYSQLND_SZ_T_SPEC" bytes to the network", payload_size + MYSQLND_HEADER_SIZE + COMPRESSED_HEADER_SIZE);
-			bytes_sent = net->m.network_write_ex(net, compress_buf, payload_size + MYSQLND_HEADER_SIZE + COMPRESSED_HEADER_SIZE,
+			bytes_sent = net->data->m.network_write_ex(net, compress_buf, payload_size + MYSQLND_HEADER_SIZE + COMPRESSED_HEADER_SIZE,
 												 conn_stats, error_info TSRMLS_CC);
 			net->compressed_envelope_packet_no++;
   #if WHEN_WE_NEED_TO_CHECK_WHETHER_COMPRESSION_WORKS_CORRECTLY
 			if (res == Z_OK) {
 				size_t decompressed_size = left + MYSQLND_HEADER_SIZE;
 				zend_uchar * decompressed_data = mnd_malloc(decompressed_size);
-				int error = net->m.decode(decompressed_data, decompressed_size,
+				int error = net->data->m.decode(decompressed_data, decompressed_size,
 										  compress_buf + MYSQLND_HEADER_SIZE + COMPRESSED_HEADER_SIZE, payload_size);
 				if (error == Z_OK) {
 					int i;
@@ -376,7 +404,7 @@ MYSQLND_METHOD(mysqlnd_net, send_ex)(MYSQLND_NET * const net, zend_uchar * const
 			STORE_HEADER_SIZE(safe_storage, p);
 			int3store(p, to_be_sent);
 			int1store(p + 3, net->packet_no);
-			bytes_sent = net->m.network_write_ex(net, p, to_be_sent + MYSQLND_HEADER_SIZE, conn_stats, error_info TSRMLS_CC);
+			bytes_sent = net->data->m.network_write_ex(net, p, to_be_sent + MYSQLND_HEADER_SIZE, conn_stats, error_info TSRMLS_CC);
 			RESTORE_HEADER_SIZE(p, safe_storage);
 			net->compressed_envelope_packet_no++;
 		}
@@ -492,7 +520,7 @@ MYSQLND_METHOD(mysqlnd_net, read_compressed_packet_from_stream_and_fill_read_buf
 	DBG_ENTER("mysqlnd_net::read_compressed_packet_from_stream_and_fill_read_buffe");
 
 	/* Read the compressed header */
-	if (FAIL == net->m.network_read_ex(net, comp_header, COMPRESSED_HEADER_SIZE, conn_stats, error_info TSRMLS_CC)) {
+	if (FAIL == net->data->m.network_read_ex(net, comp_header, COMPRESSED_HEADER_SIZE, conn_stats, error_info TSRMLS_CC)) {
 		DBG_RETURN(FAIL);
 	}
 	decompressed_size = uint3korr(comp_header);
@@ -502,19 +530,19 @@ MYSQLND_METHOD(mysqlnd_net, read_compressed_packet_from_stream_and_fill_read_buf
 
 	if (decompressed_size) {
 		compressed_data = mnd_emalloc(net_payload_size);
-		if (FAIL == net->m.network_read_ex(net, compressed_data, net_payload_size, conn_stats, error_info TSRMLS_CC)) {
+		if (FAIL == net->data->m.network_read_ex(net, compressed_data, net_payload_size, conn_stats, error_info TSRMLS_CC)) {
 			ret = FAIL;
 			goto end;
 		}
 		net->uncompressed_data = mysqlnd_create_read_buffer(decompressed_size TSRMLS_CC);
-		ret = net->m.decode(net->uncompressed_data->data, decompressed_size, compressed_data, net_payload_size TSRMLS_CC);
+		ret = net->data->m.decode(net->uncompressed_data->data, decompressed_size, compressed_data, net_payload_size TSRMLS_CC);
 		if (ret == FAIL) {
 			goto end;
 		}
 	} else {
 		DBG_INF_FMT("The server decided not to compress the data. Our job is easy. Copying %u bytes", net_payload_size);
 		net->uncompressed_data = mysqlnd_create_read_buffer(net_payload_size TSRMLS_CC);
-		if (FAIL == net->m.network_read_ex(net, net->uncompressed_data->data, net_payload_size, conn_stats, error_info TSRMLS_CC)) {
+		if (FAIL == net->data->m.network_read_ex(net, net->uncompressed_data->data, net_payload_size, conn_stats, error_info TSRMLS_CC)) {
 			ret = FAIL;
 			goto end;
 		}
@@ -590,7 +618,7 @@ MYSQLND_METHOD(mysqlnd_net, receive_ex)(MYSQLND_NET * const net, zend_uchar * co
 
 	DBG_ENTER("mysqlnd_net::receive_ex");
 #ifdef MYSQLND_COMPRESSION_ENABLED
-	if (net->compressed) {
+	if (net->data->compressed) {
 		if (net->uncompressed_data) {
 			size_t to_read_from_buffer = MIN(net->uncompressed_data->bytes_left(net->uncompressed_data), to_read);
 			DBG_INF_FMT("reading %u from uncompressed_data buffer", to_read_from_buffer);
@@ -610,7 +638,7 @@ MYSQLND_METHOD(mysqlnd_net, receive_ex)(MYSQLND_NET * const net, zend_uchar * co
 			size_t net_payload_size;
 			zend_uchar packet_no;
 
-			if (FAIL == net->m.network_read_ex(net, net_header, MYSQLND_HEADER_SIZE, conn_stats, error_info TSRMLS_CC)) {
+			if (FAIL == net->data->m.network_read_ex(net, net_header, MYSQLND_HEADER_SIZE, conn_stats, error_info TSRMLS_CC)) {
 				DBG_RETURN(FAIL);
 			}
 			net_payload_size = uint3korr(net_header);
@@ -628,7 +656,7 @@ MYSQLND_METHOD(mysqlnd_net, receive_ex)(MYSQLND_NET * const net, zend_uchar * co
 			DBG_INF_FMT("HEADER: hwd_packet_no=%u size=%3u", packet_no, (unsigned long) net_payload_size);
 #endif
 			/* Now let's read from the wire, decompress it and fill the read buffer */
-			net->m.read_compressed_packet_from_stream_and_fill_read_buffer(net, net_payload_size, conn_stats, error_info TSRMLS_CC);
+			net->data->m.read_compressed_packet_from_stream_and_fill_read_buffer(net, net_payload_size, conn_stats, error_info TSRMLS_CC);
 
 			/*
 			  Now a bit of recursion - read from the read buffer,
@@ -636,12 +664,12 @@ MYSQLND_METHOD(mysqlnd_net, receive_ex)(MYSQLND_NET * const net, zend_uchar * co
 			  is not enough, then the recursive call will try to
 			  satisfy it until it is satisfied.
 			*/
-			DBG_RETURN(net->m.receive_ex(net, p, to_read, conn_stats, error_info TSRMLS_CC));
+			DBG_RETURN(net->data->m.receive_ex(net, p, to_read, conn_stats, error_info TSRMLS_CC));
 		}
 		DBG_RETURN(PASS);
 	}
 #endif /* MYSQLND_COMPRESSION_ENABLED */
-	DBG_RETURN(net->m.network_read_ex(net, p, to_read, conn_stats, error_info TSRMLS_CC));
+	DBG_RETURN(net->data->m.network_read_ex(net, p, to_read, conn_stats, error_info TSRMLS_CC));
 }
 /* }}} */
 
@@ -668,80 +696,80 @@ MYSQLND_METHOD(mysqlnd_net, set_client_option)(MYSQLND_NET * const net, enum mys
 			break;
 		case MYSQLND_OPT_NET_READ_BUFFER_SIZE:
 			DBG_INF("MYSQLND_OPT_NET_READ_BUFFER_SIZE");
-			net->options.net_read_buffer_size = *(unsigned int*) value;
-			DBG_INF_FMT("new_length=%u", net->options.net_read_buffer_size);
+			net->data->options.net_read_buffer_size = *(unsigned int*) value;
+			DBG_INF_FMT("new_length=%u", net->data->options.net_read_buffer_size);
 			break;
 		case MYSQL_OPT_CONNECT_TIMEOUT:
 			DBG_INF("MYSQL_OPT_CONNECT_TIMEOUT");
-			net->options.timeout_connect = *(unsigned int*) value;
+			net->data->options.timeout_connect = *(unsigned int*) value;
 			break;
 		case MYSQLND_OPT_SSL_KEY:
 			{
 				zend_bool pers = net->persistent;
-				if (net->options.ssl_key) {
-					mnd_pefree(net->options.ssl_key, pers);
+				if (net->data->options.ssl_key) {
+					mnd_pefree(net->data->options.ssl_key, pers);
 				}
-				net->options.ssl_key = value? mnd_pestrdup(value, pers) : NULL;
+				net->data->options.ssl_key = value? mnd_pestrdup(value, pers) : NULL;
 				break;
 			}
 		case MYSQLND_OPT_SSL_CERT:
 			{
 				zend_bool pers = net->persistent;
-				if (net->options.ssl_cert) {
-					mnd_pefree(net->options.ssl_cert, pers);
+				if (net->data->options.ssl_cert) {
+					mnd_pefree(net->data->options.ssl_cert, pers);
 				}
-				net->options.ssl_cert = value? mnd_pestrdup(value, pers) : NULL;
+				net->data->options.ssl_cert = value? mnd_pestrdup(value, pers) : NULL;
 				break;
 			}
 		case MYSQLND_OPT_SSL_CA:
 			{
 				zend_bool pers = net->persistent;
-				if (net->options.ssl_ca) {
-					mnd_pefree(net->options.ssl_ca, pers);
+				if (net->data->options.ssl_ca) {
+					mnd_pefree(net->data->options.ssl_ca, pers);
 				}
-				net->options.ssl_ca = value? mnd_pestrdup(value, pers) : NULL;
+				net->data->options.ssl_ca = value? mnd_pestrdup(value, pers) : NULL;
 				break;
 			}
 		case MYSQLND_OPT_SSL_CAPATH:
 			{
 				zend_bool pers = net->persistent;
-				if (net->options.ssl_capath) {
-					mnd_pefree(net->options.ssl_capath, pers);
+				if (net->data->options.ssl_capath) {
+					mnd_pefree(net->data->options.ssl_capath, pers);
 				}
-				net->options.ssl_capath = value? mnd_pestrdup(value, pers) : NULL;
+				net->data->options.ssl_capath = value? mnd_pestrdup(value, pers) : NULL;
 				break;
 			}
 		case MYSQLND_OPT_SSL_CIPHER:
 			{
 				zend_bool pers = net->persistent;
-				if (net->options.ssl_cipher) {
-					mnd_pefree(net->options.ssl_cipher, pers);
+				if (net->data->options.ssl_cipher) {
+					mnd_pefree(net->data->options.ssl_cipher, pers);
 				}
-				net->options.ssl_cipher = value? mnd_pestrdup(value, pers) : NULL;
+				net->data->options.ssl_cipher = value? mnd_pestrdup(value, pers) : NULL;
 				break;
 			}
 		case MYSQLND_OPT_SSL_PASSPHRASE:
 			{
 				zend_bool pers = net->persistent;
-				if (net->options.ssl_passphrase) {
-					mnd_pefree(net->options.ssl_passphrase, pers);
+				if (net->data->options.ssl_passphrase) {
+					mnd_pefree(net->data->options.ssl_passphrase, pers);
 				}
-				net->options.ssl_passphrase = value? mnd_pestrdup(value, pers) : NULL;
+				net->data->options.ssl_passphrase = value? mnd_pestrdup(value, pers) : NULL;
 				break;
 			}
 		case MYSQL_OPT_SSL_VERIFY_SERVER_CERT:
-			net->options.ssl_verify_peer = value? ((*(zend_bool *)value)? TRUE:FALSE): FALSE;
+			net->data->options.ssl_verify_peer = value? ((*(zend_bool *)value)? TRUE:FALSE): FALSE;
 			break;
 		case MYSQL_OPT_READ_TIMEOUT:
-			net->options.timeout_read = *(unsigned int*) value;
+			net->data->options.timeout_read = *(unsigned int*) value;
 			break;
 #ifdef WHEN_SUPPORTED_BY_MYSQLI
 		case MYSQL_OPT_WRITE_TIMEOUT:
-			net->options.timeout_write = *(unsigned int*) value;
+			net->data->options.timeout_write = *(unsigned int*) value;
 			break;
 #endif
 		case MYSQL_OPT_COMPRESS:
-			net->options.flags |= MYSQLND_NET_FLAG_USE_COMPRESSION;
+			net->data->options.flags |= MYSQLND_NET_FLAG_USE_COMPRESSION;
 			break;
 		default:
 			DBG_RETURN(FAIL);
@@ -765,7 +793,8 @@ MYSQLND_METHOD(mysqlnd_net, consume_uneaten_data)(MYSQLND_NET * const net, enum
 	char tmp_buf[256];
 	size_t skipped_bytes = 0;
 	int opt = PHP_STREAM_OPTION_BLOCKING;
-	int was_blocked = net->stream->ops->set_option(net->stream, opt, 0, NULL TSRMLS_CC);
+	php_stream * net_stream = net->data->get_stream(net TSRMLS_CC);
+	int was_blocked = net_stream->ops->set_option(net_stream, opt, 0, NULL TSRMLS_CC);
 
 	DBG_ENTER("mysqlnd_net::consume_uneaten_data");
 
@@ -774,11 +803,11 @@ MYSQLND_METHOD(mysqlnd_net, consume_uneaten_data)(MYSQLND_NET * const net, enum
 		int bytes_consumed;
 
 		do {
-			skipped_bytes += (bytes_consumed = php_stream_read(net->stream, tmp_buf, sizeof(tmp_buf)));
+			skipped_bytes += (bytes_consumed = php_stream_read(net_stream, tmp_buf, sizeof(tmp_buf)));
 		} while (bytes_consumed == sizeof(tmp_buf));
 
 		if (was_blocked) {
-			net->stream->ops->set_option(net->stream, opt, 1, NULL TSRMLS_CC);
+			net_stream->ops->set_option(net_stream, opt, 1, NULL TSRMLS_CC);
 		}
 
 		if (bytes_consumed) {
@@ -806,53 +835,55 @@ static enum_func_status
 MYSQLND_METHOD(mysqlnd_net, enable_ssl)(MYSQLND_NET * const net TSRMLS_DC)
 {
 #ifdef MYSQLND_SSL_SUPPORTED
-	php_stream_context *context = php_stream_context_alloc(TSRMLS_C);
+	php_stream_context * context = php_stream_context_alloc(TSRMLS_C);
+	php_stream * net_stream = net->data->m.get_stream(net TSRMLS_CC);
+
 	DBG_ENTER("mysqlnd_net::enable_ssl");
 	if (!context) {
 		DBG_RETURN(FAIL);
 	}
 
-	if (net->options.ssl_key) {
+	if (net->data->options.ssl_key) {
 		zval key_zval;
-		ZVAL_STRING(&key_zval, net->options.ssl_key, 0);
+		ZVAL_STRING(&key_zval, net->data->options.ssl_key, 0);
 		php_stream_context_set_option(context, "ssl", "local_pk", &key_zval);
 	}
-	if (net->options.ssl_verify_peer) {
+	if (net->data->options.ssl_verify_peer) {
 		zval verify_peer_zval;
 		ZVAL_TRUE(&verify_peer_zval);
 		php_stream_context_set_option(context, "ssl", "verify_peer", &verify_peer_zval);
 	}
-	if (net->options.ssl_cert) {
+	if (net->data->options.ssl_cert) {
 		zval cert_zval;
-		ZVAL_STRING(&cert_zval, net->options.ssl_cert, 0);
+		ZVAL_STRING(&cert_zval, net->data->options.ssl_cert, 0);
 		php_stream_context_set_option(context, "ssl", "local_cert", &cert_zval);
-		if (!net->options.ssl_key) {
+		if (!net->data->options.ssl_key) {
 			php_stream_context_set_option(context, "ssl", "local_pk", &cert_zval);
 		}
 	}
-	if (net->options.ssl_ca) {
+	if (net->data->options.ssl_ca) {
 		zval cafile_zval;
-		ZVAL_STRING(&cafile_zval, net->options.ssl_ca, 0);
+		ZVAL_STRING(&cafile_zval, net->data->options.ssl_ca, 0);
 		php_stream_context_set_option(context, "ssl", "cafile", &cafile_zval);
 	}
-	if (net->options.ssl_capath) {
+	if (net->data->options.ssl_capath) {
 		zval capath_zval;
-		ZVAL_STRING(&capath_zval, net->options.ssl_capath, 0);
+		ZVAL_STRING(&capath_zval, net->data->options.ssl_capath, 0);
 		php_stream_context_set_option(context, "ssl", "cafile", &capath_zval);
 	}
-	if (net->options.ssl_passphrase) {
+	if (net->data->options.ssl_passphrase) {
 		zval passphrase_zval;
-		ZVAL_STRING(&passphrase_zval, net->options.ssl_passphrase, 0);
+		ZVAL_STRING(&passphrase_zval, net->data->options.ssl_passphrase, 0);
 		php_stream_context_set_option(context, "ssl", "passphrase", &passphrase_zval);
 	}
-	if (net->options.ssl_cipher) {
+	if (net->data->options.ssl_cipher) {
 		zval cipher_zval;
-		ZVAL_STRING(&cipher_zval, net->options.ssl_cipher, 0);
+		ZVAL_STRING(&cipher_zval, net->data->options.ssl_cipher, 0);
 		php_stream_context_set_option(context, "ssl", "ciphers", &cipher_zval);
 	}
-	php_stream_context_set(net->stream, context);
-	if (php_stream_xport_crypto_setup(net->stream, STREAM_CRYPTO_METHOD_TLS_CLIENT, NULL TSRMLS_CC) < 0 ||
-	    php_stream_xport_crypto_enable(net->stream, 1 TSRMLS_CC) < 0)
+	php_stream_context_set(net_stream, context);
+	if (php_stream_xport_crypto_setup(net_stream, STREAM_CRYPTO_METHOD_TLS_CLIENT, NULL TSRMLS_CC) < 0 ||
+	    php_stream_xport_crypto_enable(net_stream, 1 TSRMLS_CC) < 0)
 	{
 		DBG_ERR("Cannot connect to MySQL by using SSL");
 		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot connect to MySQL by using SSL");
@@ -865,14 +896,14 @@ MYSQLND_METHOD(mysqlnd_net, enable_ssl)(MYSQLND_NET * const net TSRMLS_DC)
 	  of the context, which means usage of already freed memory, bad. Actually we don't need this
 	  context anymore after we have enabled SSL on the connection. Thus it is very simple, we remove it.
 	*/
-	php_stream_context_set(net->stream, NULL);
+	php_stream_context_set(net_stream, NULL);
 
-	if (net->options.timeout_read) {
+	if (net->data->options.timeout_read) {
 		struct timeval tv;
-		DBG_INF_FMT("setting %u as PHP_STREAM_OPTION_READ_TIMEOUT", net->options.timeout_read);
-		tv.tv_sec = net->options.timeout_read;
+		DBG_INF_FMT("setting %u as PHP_STREAM_OPTION_READ_TIMEOUT", net->data->options.timeout_read);
+		tv.tv_sec = net->data->options.timeout_read;
 		tv.tv_usec = 0;
-		php_stream_set_option(net->stream, PHP_STREAM_OPTION_READ_TIMEOUT, 0, &tv);
+		php_stream_set_option(net_stream, PHP_STREAM_OPTION_READ_TIMEOUT, 0, &tv);
 	}
 
 	DBG_RETURN(PASS);
@@ -906,25 +937,25 @@ MYSQLND_METHOD(mysqlnd_net, free_contents)(MYSQLND_NET * net TSRMLS_DC)
 		net->uncompressed_data->free_buffer(&net->uncompressed_data TSRMLS_CC);
 	}
 #endif
-	if (net->options.ssl_key) {
-		mnd_pefree(net->options.ssl_key, pers);
-		net->options.ssl_key = NULL;
+	if (net->data->options.ssl_key) {
+		mnd_pefree(net->data->options.ssl_key, pers);
+		net->data->options.ssl_key = NULL;
 	}
-	if (net->options.ssl_cert) {
-		mnd_pefree(net->options.ssl_cert, pers);
-		net->options.ssl_cert = NULL;
+	if (net->data->options.ssl_cert) {
+		mnd_pefree(net->data->options.ssl_cert, pers);
+		net->data->options.ssl_cert = NULL;
 	}
-	if (net->options.ssl_ca) {
-		mnd_pefree(net->options.ssl_ca, pers);
-		net->options.ssl_ca = NULL;
+	if (net->data->options.ssl_ca) {
+		mnd_pefree(net->data->options.ssl_ca, pers);
+		net->data->options.ssl_ca = NULL;
 	}
-	if (net->options.ssl_capath) {
-		mnd_pefree(net->options.ssl_capath, pers);
-		net->options.ssl_capath = NULL;
+	if (net->data->options.ssl_capath) {
+		mnd_pefree(net->data->options.ssl_capath, pers);
+		net->data->options.ssl_capath = NULL;
 	}
-	if (net->options.ssl_cipher) {
-		mnd_pefree(net->options.ssl_cipher, pers);
-		net->options.ssl_cipher = NULL;
+	if (net->data->options.ssl_cipher) {
+		mnd_pefree(net->data->options.ssl_cipher, pers);
+		net->data->options.ssl_cipher = NULL;
 	}
 
 	DBG_VOID_RETURN;
@@ -936,24 +967,25 @@ MYSQLND_METHOD(mysqlnd_net, free_contents)(MYSQLND_NET * net TSRMLS_DC)
 static void
 MYSQLND_METHOD(mysqlnd_net, close_stream)(MYSQLND_NET * const net, MYSQLND_STATS * const stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC)
 {
+	php_stream * net_stream;
 	DBG_ENTER("mysqlnd_net::close_stream");
-	if (net && net->stream) {
+	if (net && (net_stream = net->data->m.get_stream(net TSRMLS_CC))) {
 		zend_bool pers = net->persistent;
-		DBG_INF_FMT("Freeing stream. abstract=%p", net->stream->abstract);
+		DBG_INF_FMT("Freeing stream. abstract=%p", net_stream->abstract);
 		if (pers) {
 			if (EG(active)) {
-				php_stream_free(net->stream, PHP_STREAM_FREE_CLOSE_PERSISTENT | PHP_STREAM_FREE_RSRC_DTOR);
+				php_stream_free(net_stream, PHP_STREAM_FREE_CLOSE_PERSISTENT | PHP_STREAM_FREE_RSRC_DTOR);
 			} else {
 				/*
 				  otherwise we will crash because the EG(persistent_list) has been freed already,
 				  before the modules are shut down
 				*/
-				php_stream_free(net->stream, PHP_STREAM_FREE_CLOSE | PHP_STREAM_FREE_RSRC_DTOR);
+				php_stream_free(net_stream, PHP_STREAM_FREE_CLOSE | PHP_STREAM_FREE_RSRC_DTOR);
 			}
 		} else {
-			php_stream_free(net->stream, PHP_STREAM_FREE_CLOSE);
+			php_stream_free(net_stream, PHP_STREAM_FREE_CLOSE);
 		}
-		net->stream = NULL;
+		(void) net->data->m.set_stream(net, NULL TSRMLS_CC);
 	}
 
 	DBG_VOID_RETURN;
@@ -969,13 +1001,13 @@ MYSQLND_METHOD(mysqlnd_net, init)(MYSQLND_NET * const net, MYSQLND_STATS * const
 	DBG_ENTER("mysqlnd_net::init");
 
 	buf_size = MYSQLND_G(net_cmd_buffer_size); /* this is long, cast to unsigned int*/
-	net->m.set_client_option(net, MYSQLND_OPT_NET_CMD_BUFFER_SIZE, (char *) &buf_size TSRMLS_CC);
+	net->data->m.set_client_option(net, MYSQLND_OPT_NET_CMD_BUFFER_SIZE, (char *) &buf_size TSRMLS_CC);
 
 	buf_size = MYSQLND_G(net_read_buffer_size); /* this is long, cast to unsigned int*/
-	net->m.set_client_option(net, MYSQLND_OPT_NET_READ_BUFFER_SIZE, (char *)&buf_size TSRMLS_CC);
+	net->data->m.set_client_option(net, MYSQLND_OPT_NET_READ_BUFFER_SIZE, (char *)&buf_size TSRMLS_CC);
 
 	buf_size = MYSQLND_G(net_read_timeout); /* this is long, cast to unsigned int*/
-	net->m.set_client_option(net, MYSQL_OPT_READ_TIMEOUT, (char *)&buf_size TSRMLS_CC);
+	net->data->m.set_client_option(net, MYSQL_OPT_READ_TIMEOUT, (char *)&buf_size TSRMLS_CC);
 
 	DBG_RETURN(PASS);
 }
@@ -988,22 +1020,48 @@ MYSQLND_METHOD(mysqlnd_net, dtor)(MYSQLND_NET * const net, MYSQLND_STATS * const
 {
 	DBG_ENTER("mysqlnd_net::dtor");
 	if (net) {
-		zend_bool pers = net->persistent;
-	
-		net->m.free_contents(net TSRMLS_CC);
-		net->m.close_stream(net, stats, error_info TSRMLS_CC);
+		net->data->m.free_contents(net TSRMLS_CC);
+		net->data->m.close_stream(net, stats, error_info TSRMLS_CC);
+
 		if (net->cmd_buffer.buffer) {
 			DBG_INF("Freeing cmd buffer");
-			mnd_pefree(net->cmd_buffer.buffer, pers);
+			mnd_pefree(net->cmd_buffer.buffer, net->persistent);
 			net->cmd_buffer.buffer = NULL;
 		}
-		mnd_pefree(net, pers);
+
+		mnd_pefree(net->data, net->data->persistent);
+		mnd_pefree(net, net->persistent);
 	}
 	DBG_VOID_RETURN;
 }
 /* }}} */
 
 
+/* {{{ mysqlnd_net::get_stream */
+static php_stream *
+MYSQLND_METHOD(mysqlnd_net, get_stream)(const MYSQLND_NET * const net TSRMLS_DC)
+{
+	DBG_ENTER("mysqlnd_net::get_stream");
+	DBG_RETURN(net? net->data->stream:NULL);
+}
+/* }}} */
+
+
+/* {{{ mysqlnd_net::set_stream */
+static php_stream *
+MYSQLND_METHOD(mysqlnd_net, set_stream)(MYSQLND_NET * const net, php_stream * net_stream TSRMLS_DC)
+{
+	php_stream * ret = NULL;
+	DBG_ENTER("mysqlnd_net::set_stream");
+	if (net) {
+		net->data->stream = net_stream;
+		ret = net->data->stream;
+	}
+	DBG_RETURN(ret);
+}
+/* }}} */
+
+
 MYSQLND_CLASS_METHODS_START(mysqlnd_net)
 	MYSQLND_METHOD(mysqlnd_net, init),
 	MYSQLND_METHOD(mysqlnd_net, dtor),
@@ -1026,10 +1084,13 @@ MYSQLND_CLASS_METHODS_START(mysqlnd_net)
 	MYSQLND_METHOD(mysqlnd_net, send_ex),
 	MYSQLND_METHOD(mysqlnd_net, receive_ex),
 #ifdef MYSQLND_COMPRESSION_ENABLED
-	MYSQLND_METHOD(mysqlnd_net, read_compressed_packet_from_stream_and_fill_read_buffer)
+	MYSQLND_METHOD(mysqlnd_net, read_compressed_packet_from_stream_and_fill_read_buffer),
 #else
-	NULL
+	NULL,
 #endif
+	MYSQLND_METHOD(mysqlnd_net, get_stream),
+	MYSQLND_METHOD(mysqlnd_net, set_stream),
+	MYSQLND_METHOD(mysqlnd_net, get_open_stream)
 MYSQLND_CLASS_METHODS_END;
 
 
@@ -1051,7 +1112,7 @@ mysqlnd_net_free(MYSQLND_NET * const net, MYSQLND_STATS * stats, MYSQLND_ERROR_I
 {
 	DBG_ENTER("mysqlnd_net_free");
 	if (net) {
-		net->m.dtor(net, stats, error_info TSRMLS_CC);
+		net->data->m.dtor(net, stats, error_info TSRMLS_CC);
 	}
 	DBG_VOID_RETURN;
 }
diff --git a/ext/mysqlnd/mysqlnd_structs.h b/ext/mysqlnd/mysqlnd_structs.h
index 43eba40..7b8386a 100644
--- a/ext/mysqlnd/mysqlnd_structs.h
+++ b/ext/mysqlnd/mysqlnd_structs.h
@@ -213,6 +213,7 @@ typedef struct st_mysqlnd_net_options
 typedef struct st_mysqlnd_connection MYSQLND;
 typedef struct st_mysqlnd_connection_data MYSQLND_CONN_DATA;
 typedef struct st_mysqlnd_net	MYSQLND_NET;
+typedef struct st_mysqlnd_net_data	MYSQLND_NET_DATA;
 typedef struct st_mysqlnd_protocol	MYSQLND_PROTOCOL;
 typedef struct st_mysqlnd_res	MYSQLND_RES;
 typedef char** 					MYSQLND_ROW_C;		/* return data as array of strings */
@@ -285,6 +286,9 @@ typedef void				(*func_mysqlnd_net__close_stream)(MYSQLND_NET * const net, MYSQL
 typedef enum_func_status	(*func_mysqlnd_net__open_stream)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len, const zend_bool persistent, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
 typedef void				(*func_mysqlnd_net__post_connect_set_opt)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
 typedef enum_func_status	(*func_mysqlnd_net__read_compressed_packet_from_stream_and_fill_read_buffer)(MYSQLND_NET * net, size_t net_payload_size, MYSQLND_STATS * conn_stats, MYSQLND_ERROR_INFO * error_info TSRMLS_DC);
+typedef php_stream *		(*func_mysqlnd_net__get_stream)(const MYSQLND_NET * const net TSRMLS_DC);
+typedef php_stream *		(*func_mysqlnd_net__set_stream)(MYSQLND_NET * const net, php_stream * net_stream TSRMLS_DC);
+typedef func_mysqlnd_net__open_stream (*func_mysqlnd_net__get_open_stream)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len, MYSQLND_ERROR_INFO * const error_info TSRMLS_DC);
 
 struct st_mysqlnd_net_methods
 {
@@ -314,9 +318,9 @@ struct st_mysqlnd_net_methods
 
 	func_mysqlnd_net__read_compressed_packet_from_stream_and_fill_read_buffer read_compressed_packet_from_stream_and_fill_read_buffer;
 
-	void * unused3;
-	void * unused4;
-	void * unused5;
+	func_mysqlnd_net__get_stream get_stream;
+	func_mysqlnd_net__set_stream set_stream;
+	func_mysqlnd_net__get_open_stream get_open_stream;
 	void * unused6;
 	void * unused7;
 };
@@ -768,31 +772,43 @@ struct st_mysqlnd_stmt_methods
 };
 
 
-struct st_mysqlnd_net
+struct st_mysqlnd_net_data
 {
 	php_stream			*stream;
+	zend_bool			compressed;
+#ifdef MYSQLND_DO_WIRE_CHECK_BEFORE_COMMAND
+	zend_uchar			last_command;
+#else
+	zend_uchar			unused_pad1;
+#endif
+	MYSQLND_NET_OPTIONS	options;
+
+	unsigned int		refcount;
+
+	zend_bool			persistent;
+
+	struct st_mysqlnd_net_methods m;
+};
+
+
+struct st_mysqlnd_net
+{
+	struct st_mysqlnd_net_data * data;
+
 	/* sequence for simple checking of correct packets */
 	zend_uchar			packet_no;
-	zend_bool			compressed;
 	zend_uchar			compressed_envelope_packet_no;
+
 #ifdef MYSQLND_COMPRESSION_ENABLED
 	MYSQLND_READ_BUFFER	* uncompressed_data;
 #else
 	void * 				unused_pad1;
 #endif
-#ifdef MYSQLND_DO_WIRE_CHECK_BEFORE_COMMAND
-	zend_uchar			last_command;
-#else
-	zend_uchar			unused_pad2;
-#endif
+
 	/* cmd buffer */
 	MYSQLND_CMD_BUFFER	cmd_buffer;
 
-	MYSQLND_NET_OPTIONS	options;
-
-	zend_bool			persistent;
-
-	struct st_mysqlnd_net_methods m;
+	zend_bool persistent;
 };
 
 
diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c
index ce94ad8..3551c02 100644
--- a/ext/mysqlnd/mysqlnd_wireprotocol.c
+++ b/ext/mysqlnd/mysqlnd_wireprotocol.c
@@ -47,7 +47,7 @@
 						(buf_size), (packet)->header.size, (packet)->header.size - (buf_size)); \
 						DBG_RETURN(FAIL); \
 		}\
-		if (FAIL == conn->net->m.receive_ex((conn)->net, (buf), (packet)->header.size, (conn)->stats, ((conn)->error_info) TSRMLS_CC)) { \
+		if (FAIL == conn->net->data->m.receive_ex((conn)->net, (buf), (packet)->header.size, (conn)->stats, ((conn)->error_info) TSRMLS_CC)) { \
 			CONN_SET_STATE(conn, CONN_QUIT_SENT); \
 			SET_CLIENT_ERROR(*conn->error_info, CR_SERVER_GONE_ERROR, UNKNOWN_SQLSTATE, mysqlnd_server_gone);\
 			php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", mysqlnd_server_gone); \
@@ -264,8 +264,8 @@ mysqlnd_read_header(MYSQLND_NET * net, MYSQLND_PACKET_HEADER * header,
 	zend_uchar buffer[MYSQLND_HEADER_SIZE];
 
 	DBG_ENTER(mysqlnd_read_header_name);
-	DBG_INF_FMT("compressed=%u", net->compressed);
-	if (FAIL == net->m.receive_ex(net, buffer, MYSQLND_HEADER_SIZE, conn_stats, error_info TSRMLS_CC)) {
+	DBG_INF_FMT("compressed=%u", net->data->compressed);
+	if (FAIL == net->data->m.receive_ex(net, buffer, MYSQLND_HEADER_SIZE, conn_stats, error_info TSRMLS_CC)) {
 		DBG_RETURN(FAIL);
 	}
 
@@ -279,7 +279,7 @@ mysqlnd_read_header(MYSQLND_NET * net, MYSQLND_PACKET_HEADER * header,
 							STAT_PROTOCOL_OVERHEAD_IN, MYSQLND_HEADER_SIZE,
 							STAT_PACKETS_RECEIVED, 1);
 
-	if (net->compressed || net->packet_no == header->packet_no) {
+	if (net->data->compressed || net->packet_no == header->packet_no) {
 		/*
 		  Have to increase the number, so we can send correct number back. It will
 		  round at 255 as this is unsigned char. The server needs this for simple
@@ -549,7 +549,7 @@ size_t php_mysqlnd_auth_write(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC
 		}
 		DBG_RETURN(p - buffer - MYSQLND_HEADER_SIZE);
 	} else {
-		size_t sent = conn->net->m.send_ex(conn->net, buffer, p - buffer - MYSQLND_HEADER_SIZE, conn->stats, conn->error_info TSRMLS_CC);
+		size_t sent = conn->net->data->m.send_ex(conn->net, buffer, p - buffer - MYSQLND_HEADER_SIZE, conn->stats, conn->error_info TSRMLS_CC);
 		if (!sent) {
 			CONN_SET_STATE(conn, CONN_QUIT_SENT);
 		}
@@ -709,7 +709,7 @@ php_mysqlnd_change_auth_response_write(void * _packet, MYSQLND_CONN_DATA * conn
 	}
 
 	{
-		size_t sent = conn->net->m.send_ex(conn->net, buffer, p - buffer - MYSQLND_HEADER_SIZE, conn->stats, conn->error_info TSRMLS_CC);
+		size_t sent = conn->net->data->m.send_ex(conn->net, buffer, p - buffer - MYSQLND_HEADER_SIZE, conn->stats, conn->error_info TSRMLS_CC);
 		if (buffer != conn->net->cmd_buffer.buffer) {
 			mnd_efree(buffer);
 		}
@@ -923,14 +923,14 @@ size_t php_mysqlnd_cmd_write(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
 	MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_PACKETS_SENT_CMD);
 
 #ifdef MYSQLND_DO_WIRE_CHECK_BEFORE_COMMAND
-	net->m.consume_uneaten_data(net, packet->command TSRMLS_CC);
+	net->data->m.consume_uneaten_data(net, packet->command TSRMLS_CC);
 #endif
 
 	if (!packet->argument || !packet->arg_len) {
 		zend_uchar buffer[MYSQLND_HEADER_SIZE + 1];
 
 		int1store(buffer + MYSQLND_HEADER_SIZE, packet->command);
-		sent = net->m.send_ex(net, buffer, 1, conn->stats, conn->error_info TSRMLS_CC);
+		sent = net->data->m.send_ex(net, buffer, 1, conn->stats, conn->error_info TSRMLS_CC);
 	} else {
 		size_t tmp_len = packet->arg_len + 1 + MYSQLND_HEADER_SIZE;
 		zend_uchar *tmp, *p;
@@ -945,7 +945,7 @@ size_t php_mysqlnd_cmd_write(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
 
 		memcpy(p, packet->argument, packet->arg_len);
 
-		sent = net->m.send_ex(net, tmp, tmp_len - MYSQLND_HEADER_SIZE, conn->stats, conn->error_info TSRMLS_CC);
+		sent = net->data->m.send_ex(net, tmp, tmp_len - MYSQLND_HEADER_SIZE, conn->stats, conn->error_info TSRMLS_CC);
 		if (tmp != net->cmd_buffer.buffer) {
 			MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_CMD_BUFFER_TOO_SMALL);
 			mnd_efree(tmp);
@@ -1388,7 +1388,7 @@ php_mysqlnd_read_row_ex(MYSQLND_CONN_DATA * conn, MYSQLND_MEMORY_POOL * result_s
 			p = (*buffer)->ptr + (*data_size - header.size);
 		}
 
-		if (PASS != (ret = conn->net->m.receive_ex(conn->net, p, header.size, conn->stats, conn->error_info TSRMLS_CC))) {
+		if (PASS != (ret = conn->net->data->m.receive_ex(conn->net, p, header.size, conn->stats, conn->error_info TSRMLS_CC))) {
 			DBG_ERR("Empty row packet body");
 			php_error(E_WARNING, "Empty row packet body");
 			break;
@@ -1744,10 +1744,8 @@ php_mysqlnd_rowp_read_text_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval
 static enum_func_status
 php_mysqlnd_rowp_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
 {
-	MYSQLND_NET * net = conn->net;
 	zend_uchar *p;
 	enum_func_status ret = PASS;
-	size_t old_chunk_size = net->stream->chunk_size;
 	MYSQLND_PACKET_ROW *packet= (MYSQLND_PACKET_ROW *) _packet;
 	size_t post_alloc_for_bit_fields = 0;
 	size_t data_size = 0;
@@ -1829,7 +1827,6 @@ php_mysqlnd_rowp_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC)
 	}
 
 end:
-	net->stream->chunk_size = old_chunk_size;
 	DBG_RETURN(ret);
 }
 /* }}} */


commit 16228431624b589419903cc7e4feba1d5240e5e1
Author: Felipe Pena <felipensp at gmail.com>
Date:   Mon Apr 30 10:35:28 2012 -0300

    - Regenerated files

diff --git a/Zend/zend_language_scanner.c b/Zend/zend_language_scanner.c
index 3f6189e..262fa43 100644
--- a/Zend/zend_language_scanner.c
+++ b/Zend/zend_language_scanner.c
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Thu Mar  1 21:27:30 2012 */
+/* Generated by re2c 0.13.5 on Mon Apr 30 10:28:29 2012 */
 #line 1 "Zend/zend_language_scanner.l"
 /*
    +----------------------------------------------------------------------+
@@ -32,7 +32,9 @@
 #endif
 
 #include "zend_language_scanner_defs.h"
-
+#ifdef PHP_WIN32
+# include <Winuser.h>
+#endif
 #include <errno.h>
 #include "zend.h"
 #include "zend_alloc.h"
@@ -907,7 +909,11 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo
 					zendlval->value.str.len--;
 					break;
 				case 'e':
+#ifdef PHP_WIN32
+					*t++ = VK_ESCAPE;
+#else
 					*t++ = '\e';
+#endif
 					zendlval->value.str.len--;
 					break;
 				case '"':
@@ -991,7 +997,7 @@ restart:
 yymore_restart:
 
 
-#line 995 "Zend/zend_language_scanner.c"
+#line 1001 "Zend/zend_language_scanner.c"
 {
 	YYCTYPE yych;
 	unsigned int yyaccept = 0;
@@ -1090,7 +1096,7 @@ yyc_INITIAL:
 yy3:
 		YYDEBUG(3, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1783 "Zend/zend_language_scanner.l"
+#line 1789 "Zend/zend_language_scanner.l"
 		{
 	if (YYCURSOR > YYLIMIT) {
 		return 0;
@@ -1150,7 +1156,7 @@ inline_html:
 	HANDLE_NEWLINES(yytext, yyleng);
 	return T_INLINE_HTML;
 }
-#line 1154 "Zend/zend_language_scanner.c"
+#line 1160 "Zend/zend_language_scanner.c"
 yy4:
 		YYDEBUG(4, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1168,7 +1174,7 @@ yy5:
 yy6:
 		YYDEBUG(6, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1771 "Zend/zend_language_scanner.l"
+#line 1777 "Zend/zend_language_scanner.l"
 		{
 	if (CG(short_tags)) {
 		zendlval->value.str.val = yytext; /* no copying - intentional */
@@ -1180,14 +1186,14 @@ yy6:
 		goto inline_char_handler;
 	}
 }
-#line 1184 "Zend/zend_language_scanner.c"
+#line 1190 "Zend/zend_language_scanner.c"
 yy7:
 		YYDEBUG(7, *YYCURSOR);
 		++YYCURSOR;
 		if ((yych = *YYCURSOR) == '=') goto yy43;
 		YYDEBUG(8, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1748 "Zend/zend_language_scanner.l"
+#line 1754 "Zend/zend_language_scanner.l"
 		{
 	if (CG(asp_tags)) {
 		zendlval->value.str.val = yytext; /* no copying - intentional */
@@ -1199,7 +1205,7 @@ yy7:
 		goto inline_char_handler;
 	}
 }
-#line 1203 "Zend/zend_language_scanner.c"
+#line 1209 "Zend/zend_language_scanner.c"
 yy9:
 		YYDEBUG(9, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1385,7 +1391,7 @@ yy35:
 		++YYCURSOR;
 		YYDEBUG(38, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1708 "Zend/zend_language_scanner.l"
+#line 1714 "Zend/zend_language_scanner.l"
 		{
 	YYCTYPE *bracket = (YYCTYPE*)zend_memrchr(yytext, '<', yyleng - (sizeof("script language=php>") - 1));
 
@@ -1402,7 +1408,7 @@ yy35:
 	BEGIN(ST_IN_SCRIPTING);
 	return T_OPEN_TAG;
 }
-#line 1406 "Zend/zend_language_scanner.c"
+#line 1412 "Zend/zend_language_scanner.c"
 yy39:
 		YYDEBUG(39, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1429,7 +1435,7 @@ yy43:
 		++YYCURSOR;
 		YYDEBUG(44, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1726 "Zend/zend_language_scanner.l"
+#line 1732 "Zend/zend_language_scanner.l"
 		{
 	if (CG(asp_tags)) {
 		zendlval->value.str.val = yytext; /* no copying - intentional */
@@ -1441,13 +1447,13 @@ yy43:
 		goto inline_char_handler;
 	}
 }
-#line 1445 "Zend/zend_language_scanner.c"
+#line 1451 "Zend/zend_language_scanner.c"
 yy45:
 		YYDEBUG(45, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(46, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1739 "Zend/zend_language_scanner.l"
+#line 1745 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.str.val = yytext; /* no copying - intentional */
 	zendlval->value.str.len = yyleng;
@@ -1455,7 +1461,7 @@ yy45:
 	BEGIN(ST_IN_SCRIPTING);
 	return T_OPEN_TAG_WITH_ECHO;
 }
-#line 1459 "Zend/zend_language_scanner.c"
+#line 1465 "Zend/zend_language_scanner.c"
 yy47:
 		YYDEBUG(47, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1482,7 +1488,7 @@ yy50:
 yy51:
 		YYDEBUG(51, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1761 "Zend/zend_language_scanner.l"
+#line 1767 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.str.val = yytext; /* no copying - intentional */
 	zendlval->value.str.len = yyleng;
@@ -1491,7 +1497,7 @@ yy51:
 	BEGIN(ST_IN_SCRIPTING);
 	return T_OPEN_TAG;
 }
-#line 1495 "Zend/zend_language_scanner.c"
+#line 1501 "Zend/zend_language_scanner.c"
 yy52:
 		YYDEBUG(52, *YYCURSOR);
 		++YYCURSOR;
@@ -1562,7 +1568,7 @@ yyc_ST_BACKQUOTE:
 yy56:
 		YYDEBUG(56, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2234 "Zend/zend_language_scanner.l"
+#line 2240 "Zend/zend_language_scanner.l"
 		{
 	if (YYCURSOR > YYLIMIT) {
 		return 0;
@@ -1603,7 +1609,7 @@ yy56:
 	zend_scan_escape_string(zendlval, yytext, yyleng, '`' TSRMLS_CC);
 	return T_ENCAPSED_AND_WHITESPACE;
 }
-#line 1607 "Zend/zend_language_scanner.c"
+#line 1613 "Zend/zend_language_scanner.c"
 yy57:
 		YYDEBUG(57, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1614,12 +1620,12 @@ yy58:
 		++YYCURSOR;
 		YYDEBUG(59, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2178 "Zend/zend_language_scanner.l"
+#line 2184 "Zend/zend_language_scanner.l"
 		{
 	BEGIN(ST_IN_SCRIPTING);
 	return '`';
 }
-#line 1623 "Zend/zend_language_scanner.c"
+#line 1629 "Zend/zend_language_scanner.c"
 yy60:
 		YYDEBUG(60, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1629,14 +1635,14 @@ yy61:
 		++YYCURSOR;
 		YYDEBUG(62, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2165 "Zend/zend_language_scanner.l"
+#line 2171 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.lval = (long) '{';
 	yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
 	yyless(1);
 	return T_CURLY_OPEN;
 }
-#line 1640 "Zend/zend_language_scanner.c"
+#line 1646 "Zend/zend_language_scanner.c"
 yy63:
 		YYDEBUG(63, *YYCURSOR);
 		yyaccept = 0;
@@ -1652,24 +1658,24 @@ yy63:
 yy65:
 		YYDEBUG(65, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1865 "Zend/zend_language_scanner.l"
+#line 1871 "Zend/zend_language_scanner.l"
 		{
 	zend_copy_value(zendlval, (yytext+1), (yyleng-1));
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 1662 "Zend/zend_language_scanner.c"
+#line 1668 "Zend/zend_language_scanner.c"
 yy66:
 		YYDEBUG(66, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(67, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1442 "Zend/zend_language_scanner.l"
+#line 1448 "Zend/zend_language_scanner.l"
 		{
 	yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC);
 	return T_DOLLAR_OPEN_CURLY_BRACES;
 }
-#line 1673 "Zend/zend_language_scanner.c"
+#line 1679 "Zend/zend_language_scanner.c"
 yy68:
 		YYDEBUG(68, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1683,7 +1689,7 @@ yy70:
 		++YYCURSOR;
 		YYDEBUG(71, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1857 "Zend/zend_language_scanner.l"
+#line 1863 "Zend/zend_language_scanner.l"
 		{
 	yyless(yyleng - 1);
 	yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
@@ -1691,7 +1697,7 @@ yy70:
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 1695 "Zend/zend_language_scanner.c"
+#line 1701 "Zend/zend_language_scanner.c"
 yy72:
 		YYDEBUG(72, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1709,7 +1715,7 @@ yy73:
 		++YYCURSOR;
 		YYDEBUG(74, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1847 "Zend/zend_language_scanner.l"
+#line 1853 "Zend/zend_language_scanner.l"
 		{
 	yyless(yyleng - 3);
 	yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
@@ -1717,7 +1723,7 @@ yy73:
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 1721 "Zend/zend_language_scanner.c"
+#line 1727 "Zend/zend_language_scanner.c"
 	}
 /* *********************************** */
 yyc_ST_DOUBLE_QUOTES:
@@ -1785,7 +1791,7 @@ yy77:
 yy78:
 		YYDEBUG(78, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2184 "Zend/zend_language_scanner.l"
+#line 2190 "Zend/zend_language_scanner.l"
 		{
 	if (GET_DOUBLE_QUOTES_SCANNED_LENGTH()) {
 		YYCURSOR += GET_DOUBLE_QUOTES_SCANNED_LENGTH() - 1;
@@ -1834,7 +1840,7 @@ double_quotes_scan_done:
 	zend_scan_escape_string(zendlval, yytext, yyleng, '"' TSRMLS_CC);
 	return T_ENCAPSED_AND_WHITESPACE;
 }
-#line 1838 "Zend/zend_language_scanner.c"
+#line 1844 "Zend/zend_language_scanner.c"
 yy79:
 		YYDEBUG(79, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1845,12 +1851,12 @@ yy80:
 		++YYCURSOR;
 		YYDEBUG(81, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2173 "Zend/zend_language_scanner.l"
+#line 2179 "Zend/zend_language_scanner.l"
 		{
 	BEGIN(ST_IN_SCRIPTING);
 	return '"';
 }
-#line 1854 "Zend/zend_language_scanner.c"
+#line 1860 "Zend/zend_language_scanner.c"
 yy82:
 		YYDEBUG(82, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1860,14 +1866,14 @@ yy83:
 		++YYCURSOR;
 		YYDEBUG(84, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2165 "Zend/zend_language_scanner.l"
+#line 2171 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.lval = (long) '{';
 	yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
 	yyless(1);
 	return T_CURLY_OPEN;
 }
-#line 1871 "Zend/zend_language_scanner.c"
+#line 1877 "Zend/zend_language_scanner.c"
 yy85:
 		YYDEBUG(85, *YYCURSOR);
 		yyaccept = 0;
@@ -1883,24 +1889,24 @@ yy85:
 yy87:
 		YYDEBUG(87, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1865 "Zend/zend_language_scanner.l"
+#line 1871 "Zend/zend_language_scanner.l"
 		{
 	zend_copy_value(zendlval, (yytext+1), (yyleng-1));
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 1893 "Zend/zend_language_scanner.c"
+#line 1899 "Zend/zend_language_scanner.c"
 yy88:
 		YYDEBUG(88, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(89, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1442 "Zend/zend_language_scanner.l"
+#line 1448 "Zend/zend_language_scanner.l"
 		{
 	yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC);
 	return T_DOLLAR_OPEN_CURLY_BRACES;
 }
-#line 1904 "Zend/zend_language_scanner.c"
+#line 1910 "Zend/zend_language_scanner.c"
 yy90:
 		YYDEBUG(90, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1914,7 +1920,7 @@ yy92:
 		++YYCURSOR;
 		YYDEBUG(93, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1857 "Zend/zend_language_scanner.l"
+#line 1863 "Zend/zend_language_scanner.l"
 		{
 	yyless(yyleng - 1);
 	yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
@@ -1922,7 +1928,7 @@ yy92:
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 1926 "Zend/zend_language_scanner.c"
+#line 1932 "Zend/zend_language_scanner.c"
 yy94:
 		YYDEBUG(94, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1940,7 +1946,7 @@ yy95:
 		++YYCURSOR;
 		YYDEBUG(96, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1847 "Zend/zend_language_scanner.l"
+#line 1853 "Zend/zend_language_scanner.l"
 		{
 	yyless(yyleng - 3);
 	yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
@@ -1948,7 +1954,7 @@ yy95:
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 1952 "Zend/zend_language_scanner.c"
+#line 1958 "Zend/zend_language_scanner.c"
 	}
 /* *********************************** */
 yyc_ST_END_HEREDOC:
@@ -1959,7 +1965,7 @@ yyc_ST_END_HEREDOC:
 	++YYCURSOR;
 	YYDEBUG(100, *YYCURSOR);
 	yyleng = YYCURSOR - SCNG(yy_text);
-#line 2152 "Zend/zend_language_scanner.l"
+#line 2158 "Zend/zend_language_scanner.l"
 	{
 	YYCURSOR += CG(heredoc_len) - 1;
 	yyleng = CG(heredoc_len);
@@ -1971,7 +1977,7 @@ yyc_ST_END_HEREDOC:
 	BEGIN(ST_IN_SCRIPTING);
 	return T_END_HEREDOC;
 }
-#line 1975 "Zend/zend_language_scanner.c"
+#line 1981 "Zend/zend_language_scanner.c"
 /* *********************************** */
 yyc_ST_HEREDOC:
 	{
@@ -2033,7 +2039,7 @@ yy103:
 yy104:
 		YYDEBUG(104, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2276 "Zend/zend_language_scanner.l"
+#line 2282 "Zend/zend_language_scanner.l"
 		{
 	int newline = 0;
 
@@ -2104,7 +2110,7 @@ heredoc_scan_done:
 	zend_scan_escape_string(zendlval, yytext, yyleng - newline, 0 TSRMLS_CC);
 	return T_ENCAPSED_AND_WHITESPACE;
 }
-#line 2108 "Zend/zend_language_scanner.c"
+#line 2114 "Zend/zend_language_scanner.c"
 yy105:
 		YYDEBUG(105, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -2119,14 +2125,14 @@ yy107:
 		++YYCURSOR;
 		YYDEBUG(108, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2165 "Zend/zend_language_scanner.l"
+#line 2171 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.lval = (long) '{';
 	yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
 	yyless(1);
 	return T_CURLY_OPEN;
 }
-#line 2130 "Zend/zend_language_scanner.c"
+#line 2136 "Zend/zend_language_scanner.c"
 yy109:
 		YYDEBUG(109, *YYCURSOR);
 		yyaccept = 0;
@@ -2142,24 +2148,24 @@ yy109:
 yy111:
 		YYDEBUG(111, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1865 "Zend/zend_language_scanner.l"
+#line 1871 "Zend/zend_language_scanner.l"
 		{
 	zend_copy_value(zendlval, (yytext+1), (yyleng-1));
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 2152 "Zend/zend_language_scanner.c"
+#line 2158 "Zend/zend_language_scanner.c"
 yy112:
 		YYDEBUG(112, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(113, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1442 "Zend/zend_language_scanner.l"
+#line 1448 "Zend/zend_language_scanner.l"
 		{
 	yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC);
 	return T_DOLLAR_OPEN_CURLY_BRACES;
 }
-#line 2163 "Zend/zend_language_scanner.c"
+#line 2169 "Zend/zend_language_scanner.c"
 yy114:
 		YYDEBUG(114, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -2173,7 +2179,7 @@ yy116:
 		++YYCURSOR;
 		YYDEBUG(117, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1857 "Zend/zend_language_scanner.l"
+#line 1863 "Zend/zend_language_scanner.l"
 		{
 	yyless(yyleng - 1);
 	yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
@@ -2181,7 +2187,7 @@ yy116:
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 2185 "Zend/zend_language_scanner.c"
+#line 2191 "Zend/zend_language_scanner.c"
 yy118:
 		YYDEBUG(118, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -2199,7 +2205,7 @@ yy119:
 		++YYCURSOR;
 		YYDEBUG(120, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1847 "Zend/zend_language_scanner.l"
+#line 1853 "Zend/zend_language_scanner.l"
 		{
 	yyless(yyleng - 3);
 	yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
@@ -2207,7 +2213,7 @@ yy119:
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 2211 "Zend/zend_language_scanner.c"
+#line 2217 "Zend/zend_language_scanner.c"
 	}
 /* *********************************** */
 yyc_ST_IN_SCRIPTING:
@@ -2388,13 +2394,13 @@ yy123:
 yy124:
 		YYDEBUG(124, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1888 "Zend/zend_language_scanner.l"
+#line 1894 "Zend/zend_language_scanner.l"
 		{
 	zend_copy_value(zendlval, yytext, yyleng);
 	zendlval->type = IS_STRING;
 	return T_STRING;
 }
-#line 2398 "Zend/zend_language_scanner.c"
+#line 2404 "Zend/zend_language_scanner.c"
 yy125:
 		YYDEBUG(125, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -2620,11 +2626,11 @@ yy137:
 yy138:
 		YYDEBUG(138, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1431 "Zend/zend_language_scanner.l"
+#line 1437 "Zend/zend_language_scanner.l"
 		{
 	return yytext[0];
 }
-#line 2628 "Zend/zend_language_scanner.c"
+#line 2634 "Zend/zend_language_scanner.c"
 yy139:
 		YYDEBUG(139, *YYCURSOR);
 		++YYCURSOR;
@@ -2633,7 +2639,7 @@ yy139:
 yy140:
 		YYDEBUG(140, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1162 "Zend/zend_language_scanner.l"
+#line 1168 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.str.val = yytext; /* no copying - intentional */
 	zendlval->value.str.len = yyleng;
@@ -2641,7 +2647,7 @@ yy140:
 	HANDLE_NEWLINES(yytext, yyleng);
 	return T_WHITESPACE;
 }
-#line 2645 "Zend/zend_language_scanner.c"
+#line 2651 "Zend/zend_language_scanner.c"
 yy141:
 		YYDEBUG(141, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -2652,11 +2658,11 @@ yy142:
 		++YYCURSOR;
 		YYDEBUG(143, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1191 "Zend/zend_language_scanner.l"
+#line 1197 "Zend/zend_language_scanner.l"
 		{
 	return T_NS_SEPARATOR;
 }
-#line 2660 "Zend/zend_language_scanner.c"
+#line 2666 "Zend/zend_language_scanner.c"
 yy144:
 		YYDEBUG(144, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -2884,18 +2890,18 @@ yy167:
 		++YYCURSOR;
 		YYDEBUG(168, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1436 "Zend/zend_language_scanner.l"
+#line 1442 "Zend/zend_language_scanner.l"
 		{
 	yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
 	return '{';
 }
-#line 2893 "Zend/zend_language_scanner.c"
+#line 2899 "Zend/zend_language_scanner.c"
 yy169:
 		YYDEBUG(169, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(170, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1448 "Zend/zend_language_scanner.l"
+#line 1454 "Zend/zend_language_scanner.l"
 		{
 	RESET_DOC_COMMENT();
 	if (!zend_stack_is_empty(&SCNG(state_stack))) {
@@ -2903,7 +2909,7 @@ yy169:
 	}
 	return '}';
 }
-#line 2907 "Zend/zend_language_scanner.c"
+#line 2913 "Zend/zend_language_scanner.c"
 yy171:
 		YYDEBUG(171, *YYCURSOR);
 		yyaccept = 2;
@@ -2931,7 +2937,7 @@ yy171:
 yy172:
 		YYDEBUG(172, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1498 "Zend/zend_language_scanner.l"
+#line 1504 "Zend/zend_language_scanner.l"
 		{
 	if (yyleng < MAX_LENGTH_OF_LONG - 1) { /* Won't overflow */
 		zendlval->value.lval = strtol(yytext, NULL, 0);
@@ -2952,7 +2958,7 @@ yy172:
 	zendlval->type = IS_LONG;
 	return T_LNUMBER;
 }
-#line 2956 "Zend/zend_language_scanner.c"
+#line 2962 "Zend/zend_language_scanner.c"
 yy173:
 		YYDEBUG(173, *YYCURSOR);
 		yyaccept = 2;
@@ -2980,7 +2986,7 @@ yy175:
 yy176:
 		YYDEBUG(176, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1895 "Zend/zend_language_scanner.l"
+#line 1901 "Zend/zend_language_scanner.l"
 		{
 	while (YYCURSOR < YYLIMIT) {
 		switch (*YYCURSOR++) {
@@ -3014,14 +3020,14 @@ yy176:
 
 	return T_COMMENT;
 }
-#line 3018 "Zend/zend_language_scanner.c"
+#line 3024 "Zend/zend_language_scanner.c"
 yy177:
 		YYDEBUG(177, *YYCURSOR);
 		++YYCURSOR;
 yy178:
 		YYDEBUG(178, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1986 "Zend/zend_language_scanner.l"
+#line 1992 "Zend/zend_language_scanner.l"
 		{
 	register char *s, *t;
 	char *end;
@@ -3089,14 +3095,14 @@ yy178:
 	}
 	return T_CONSTANT_ENCAPSED_STRING;
 }
-#line 3093 "Zend/zend_language_scanner.c"
+#line 3099 "Zend/zend_language_scanner.c"
 yy179:
 		YYDEBUG(179, *YYCURSOR);
 		++YYCURSOR;
 yy180:
 		YYDEBUG(180, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2055 "Zend/zend_language_scanner.l"
+#line 2061 "Zend/zend_language_scanner.l"
 		{
 	int bprefix = (yytext[0] != '"') ? 1 : 0;
 
@@ -3137,24 +3143,24 @@ yy180:
 	BEGIN(ST_DOUBLE_QUOTES);
 	return '"';
 }
-#line 3141 "Zend/zend_language_scanner.c"
+#line 3147 "Zend/zend_language_scanner.c"
 yy181:
 		YYDEBUG(181, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(182, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2146 "Zend/zend_language_scanner.l"
+#line 2152 "Zend/zend_language_scanner.l"
 		{
 	BEGIN(ST_BACKQUOTE);
 	return '`';
 }
-#line 3152 "Zend/zend_language_scanner.c"
+#line 3158 "Zend/zend_language_scanner.c"
 yy183:
 		YYDEBUG(183, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(184, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2404 "Zend/zend_language_scanner.l"
+#line 2410 "Zend/zend_language_scanner.l"
 		{
 	if (YYCURSOR > YYLIMIT) {
 		return 0;
@@ -3163,7 +3169,7 @@ yy183:
 	zend_error(E_COMPILE_WARNING,"Unexpected character in input:  '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE);
 	goto restart;
 }
-#line 3167 "Zend/zend_language_scanner.c"
+#line 3173 "Zend/zend_language_scanner.c"
 yy185:
 		YYDEBUG(185, *YYCURSOR);
 		++YYCURSOR;
@@ -3190,13 +3196,13 @@ yy187:
 yy189:
 		YYDEBUG(189, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1563 "Zend/zend_language_scanner.l"
+#line 1569 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.dval = zend_strtod(yytext, NULL);
 	zendlval->type = IS_DOUBLE;
 	return T_DNUMBER;
 }
-#line 3200 "Zend/zend_language_scanner.c"
+#line 3206 "Zend/zend_language_scanner.c"
 yy190:
 		YYDEBUG(190, *YYCURSOR);
 		yyaccept = 2;
@@ -3288,7 +3294,7 @@ yy199:
 		}
 		YYDEBUG(201, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1473 "Zend/zend_language_scanner.l"
+#line 1479 "Zend/zend_language_scanner.l"
 		{
 	char *bin = yytext + 2; /* Skip "0b" */
 	int len = yyleng - 2;
@@ -3313,7 +3319,7 @@ yy199:
 		return T_DNUMBER;
 	}
 }
-#line 3317 "Zend/zend_language_scanner.c"
+#line 3323 "Zend/zend_language_scanner.c"
 yy202:
 		YYDEBUG(202, *YYCURSOR);
 		++YYCURSOR;
@@ -3325,7 +3331,7 @@ yy202:
 		}
 		YYDEBUG(204, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1519 "Zend/zend_language_scanner.l"
+#line 1525 "Zend/zend_language_scanner.l"
 		{
 	char *hex = yytext + 2; /* Skip "0x" */
 	int len = yyleng - 2;
@@ -3350,7 +3356,7 @@ yy202:
 		return T_DNUMBER;
 	}
 }
-#line 3354 "Zend/zend_language_scanner.c"
+#line 3360 "Zend/zend_language_scanner.c"
 yy205:
 		YYDEBUG(205, *YYCURSOR);
 		++YYCURSOR;
@@ -3359,7 +3365,7 @@ yy205:
 yy206:
 		YYDEBUG(206, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1963 "Zend/zend_language_scanner.l"
+#line 1969 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.str.val = yytext; /* no copying - intentional */
 	zendlval->value.str.len = yyleng;
@@ -3367,7 +3373,7 @@ yy206:
 	BEGIN(INITIAL);
 	return T_CLOSE_TAG;  /* implicit ';' at php-end tag */
 }
-#line 3371 "Zend/zend_language_scanner.c"
+#line 3377 "Zend/zend_language_scanner.c"
 yy207:
 		YYDEBUG(207, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -3401,13 +3407,13 @@ yy209:
 yy211:
 		YYDEBUG(211, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1865 "Zend/zend_language_scanner.l"
+#line 1871 "Zend/zend_language_scanner.l"
 		{
 	zend_copy_value(zendlval, (yytext+1), (yyleng-1));
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 3411 "Zend/zend_language_scanner.c"
+#line 3417 "Zend/zend_language_scanner.c"
 yy212:
 		YYDEBUG(212, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -3421,11 +3427,11 @@ yy213:
 		}
 		YYDEBUG(214, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1419 "Zend/zend_language_scanner.l"
+#line 1425 "Zend/zend_language_scanner.l"
 		{
 	return T_LOGICAL_XOR;
 }
-#line 3429 "Zend/zend_language_scanner.c"
+#line 3435 "Zend/zend_language_scanner.c"
 yy215:
 		YYDEBUG(215, *YYCURSOR);
 		++YYCURSOR;
@@ -3434,61 +3440,61 @@ yy215:
 		}
 		YYDEBUG(216, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1411 "Zend/zend_language_scanner.l"
+#line 1417 "Zend/zend_language_scanner.l"
 		{
 	return T_LOGICAL_OR;
 }
-#line 3442 "Zend/zend_language_scanner.c"
+#line 3448 "Zend/zend_language_scanner.c"
 yy217:
 		YYDEBUG(217, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(218, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1399 "Zend/zend_language_scanner.l"
+#line 1405 "Zend/zend_language_scanner.l"
 		{
 	return T_XOR_EQUAL;
 }
-#line 3452 "Zend/zend_language_scanner.c"
+#line 3458 "Zend/zend_language_scanner.c"
 yy219:
 		YYDEBUG(219, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(220, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1403 "Zend/zend_language_scanner.l"
+#line 1409 "Zend/zend_language_scanner.l"
 		{
 	return T_BOOLEAN_OR;
 }
-#line 3462 "Zend/zend_language_scanner.c"
+#line 3468 "Zend/zend_language_scanner.c"
 yy221:
 		YYDEBUG(221, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(222, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1395 "Zend/zend_language_scanner.l"
+#line 1401 "Zend/zend_language_scanner.l"
 		{
 	return T_OR_EQUAL;
 }
-#line 3472 "Zend/zend_language_scanner.c"
+#line 3478 "Zend/zend_language_scanner.c"
 yy223:
 		YYDEBUG(223, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(224, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1407 "Zend/zend_language_scanner.l"
+#line 1413 "Zend/zend_language_scanner.l"
 		{
 	return T_BOOLEAN_AND;
 }
-#line 3482 "Zend/zend_language_scanner.c"
+#line 3488 "Zend/zend_language_scanner.c"
 yy225:
 		YYDEBUG(225, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(226, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1391 "Zend/zend_language_scanner.l"
+#line 1397 "Zend/zend_language_scanner.l"
 		{
 	return T_AND_EQUAL;
 }
-#line 3492 "Zend/zend_language_scanner.c"
+#line 3498 "Zend/zend_language_scanner.c"
 yy227:
 		YYDEBUG(227, *YYCURSOR);
 		++YYCURSOR;
@@ -3497,7 +3503,7 @@ yy227:
 yy228:
 		YYDEBUG(228, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1972 "Zend/zend_language_scanner.l"
+#line 1978 "Zend/zend_language_scanner.l"
 		{
 	if (CG(asp_tags)) {
 		BEGIN(INITIAL);
@@ -3510,17 +3516,17 @@ yy228:
 		return yytext[0];
 	}
 }
-#line 3514 "Zend/zend_language_scanner.c"
+#line 3520 "Zend/zend_language_scanner.c"
 yy229:
 		YYDEBUG(229, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(230, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1379 "Zend/zend_language_scanner.l"
+#line 1385 "Zend/zend_language_scanner.l"
 		{
 	return T_MOD_EQUAL;
 }
-#line 3524 "Zend/zend_language_scanner.c"
+#line 3530 "Zend/zend_language_scanner.c"
 yy231:
 		YYDEBUG(231, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -3551,11 +3557,11 @@ yy235:
 		++YYCURSOR;
 		YYDEBUG(236, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1375 "Zend/zend_language_scanner.l"
+#line 1381 "Zend/zend_language_scanner.l"
 		{
 	return T_CONCAT_EQUAL;
 }
-#line 3559 "Zend/zend_language_scanner.c"
+#line 3565 "Zend/zend_language_scanner.c"
 yy237:
 		YYDEBUG(237, *YYCURSOR);
 		yyaccept = 4;
@@ -3564,7 +3570,7 @@ yy237:
 yy238:
 		YYDEBUG(238, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1929 "Zend/zend_language_scanner.l"
+#line 1935 "Zend/zend_language_scanner.l"
 		{
 	int doc_com;
 
@@ -3598,7 +3604,7 @@ yy238:
 
 	return T_COMMENT;
 }
-#line 3602 "Zend/zend_language_scanner.c"
+#line 3608 "Zend/zend_language_scanner.c"
 yy239:
 		YYDEBUG(239, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -3608,11 +3614,11 @@ yy240:
 		++YYCURSOR;
 		YYDEBUG(241, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1371 "Zend/zend_language_scanner.l"
+#line 1377 "Zend/zend_language_scanner.l"
 		{
 	return T_DIV_EQUAL;
 }
-#line 3616 "Zend/zend_language_scanner.c"
+#line 3622 "Zend/zend_language_scanner.c"
 yy242:
 		YYDEBUG(242, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -3635,42 +3641,42 @@ yy245:
 		++YYCURSOR;
 		YYDEBUG(246, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1367 "Zend/zend_language_scanner.l"
+#line 1373 "Zend/zend_language_scanner.l"
 		{
 	return T_MUL_EQUAL;
 }
-#line 3643 "Zend/zend_language_scanner.c"
+#line 3649 "Zend/zend_language_scanner.c"
 yy247:
 		YYDEBUG(247, *YYCURSOR);
 		++YYCURSOR;
 		if ((yych = *YYCURSOR) == '=') goto yy251;
 		YYDEBUG(248, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1427 "Zend/zend_language_scanner.l"
+#line 1433 "Zend/zend_language_scanner.l"
 		{
 	return T_SR;
 }
-#line 3654 "Zend/zend_language_scanner.c"
+#line 3660 "Zend/zend_language_scanner.c"
 yy249:
 		YYDEBUG(249, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(250, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1355 "Zend/zend_language_scanner.l"
+#line 1361 "Zend/zend_language_scanner.l"
 		{
 	return T_IS_GREATER_OR_EQUAL;
 }
-#line 3664 "Zend/zend_language_scanner.c"
+#line 3670 "Zend/zend_language_scanner.c"
 yy251:
 		YYDEBUG(251, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(252, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1387 "Zend/zend_language_scanner.l"
+#line 1393 "Zend/zend_language_scanner.l"
 		{
 	return T_SR_EQUAL;
 }
-#line 3674 "Zend/zend_language_scanner.c"
+#line 3680 "Zend/zend_language_scanner.c"
 yy253:
 		YYDEBUG(253, *YYCURSOR);
 		yyaccept = 5;
@@ -3681,11 +3687,11 @@ yy253:
 yy254:
 		YYDEBUG(254, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1423 "Zend/zend_language_scanner.l"
+#line 1429 "Zend/zend_language_scanner.l"
 		{
 	return T_SL;
 }
-#line 3689 "Zend/zend_language_scanner.c"
+#line 3695 "Zend/zend_language_scanner.c"
 yy255:
 		YYDEBUG(255, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -3697,22 +3703,22 @@ yy256:
 		++YYCURSOR;
 		YYDEBUG(257, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1351 "Zend/zend_language_scanner.l"
+#line 1357 "Zend/zend_language_scanner.l"
 		{
 	return T_IS_SMALLER_OR_EQUAL;
 }
-#line 3705 "Zend/zend_language_scanner.c"
+#line 3711 "Zend/zend_language_scanner.c"
 yy258:
 		YYDEBUG(258, *YYCURSOR);
 		++YYCURSOR;
 yy259:
 		YYDEBUG(259, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1347 "Zend/zend_language_scanner.l"
+#line 1353 "Zend/zend_language_scanner.l"
 		{
 	return T_IS_NOT_EQUAL;
 }
-#line 3716 "Zend/zend_language_scanner.c"
+#line 3722 "Zend/zend_language_scanner.c"
 yy260:
 		YYDEBUG(260, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -3763,11 +3769,11 @@ yy267:
 		++YYCURSOR;
 		YYDEBUG(268, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1383 "Zend/zend_language_scanner.l"
+#line 1389 "Zend/zend_language_scanner.l"
 		{
 	return T_SL_EQUAL;
 }
-#line 3771 "Zend/zend_language_scanner.c"
+#line 3777 "Zend/zend_language_scanner.c"
 yy269:
 		YYDEBUG(269, *YYCURSOR);
 		++YYCURSOR;
@@ -3872,7 +3878,7 @@ yy278:
 yy279:
 		YYDEBUG(279, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2097 "Zend/zend_language_scanner.l"
+#line 2103 "Zend/zend_language_scanner.l"
 		{
 	char *s;
 	int bprefix = (yytext[0] != '<') ? 1 : 0;
@@ -3920,7 +3926,7 @@ yy279:
 
 	return T_START_HEREDOC;
 }
-#line 3924 "Zend/zend_language_scanner.c"
+#line 3930 "Zend/zend_language_scanner.c"
 yy280:
 		YYDEBUG(280, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -3960,31 +3966,31 @@ yy283:
 		++YYCURSOR;
 		YYDEBUG(285, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1339 "Zend/zend_language_scanner.l"
+#line 1345 "Zend/zend_language_scanner.l"
 		{
 	return T_IS_NOT_IDENTICAL;
 }
-#line 3968 "Zend/zend_language_scanner.c"
+#line 3974 "Zend/zend_language_scanner.c"
 yy286:
 		YYDEBUG(286, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(287, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1359 "Zend/zend_language_scanner.l"
+#line 1365 "Zend/zend_language_scanner.l"
 		{
 	return T_PLUS_EQUAL;
 }
-#line 3978 "Zend/zend_language_scanner.c"
+#line 3984 "Zend/zend_language_scanner.c"
 yy288:
 		YYDEBUG(288, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(289, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1327 "Zend/zend_language_scanner.l"
+#line 1333 "Zend/zend_language_scanner.l"
 		{
 	return T_INC;
 }
-#line 3988 "Zend/zend_language_scanner.c"
+#line 3994 "Zend/zend_language_scanner.c"
 yy290:
 		YYDEBUG(290, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4003,42 +4009,42 @@ yy292:
 		}
 		YYDEBUG(293, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1315 "Zend/zend_language_scanner.l"
+#line 1321 "Zend/zend_language_scanner.l"
 		{
 	return T_LIST;
 }
-#line 4011 "Zend/zend_language_scanner.c"
+#line 4017 "Zend/zend_language_scanner.c"
 yy294:
 		YYDEBUG(294, *YYCURSOR);
 		++YYCURSOR;
 		if ((yych = *YYCURSOR) == '=') goto yy298;
 		YYDEBUG(295, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1343 "Zend/zend_language_scanner.l"
+#line 1349 "Zend/zend_language_scanner.l"
 		{
 	return T_IS_EQUAL;
 }
-#line 4022 "Zend/zend_language_scanner.c"
+#line 4028 "Zend/zend_language_scanner.c"
 yy296:
 		YYDEBUG(296, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(297, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1311 "Zend/zend_language_scanner.l"
+#line 1317 "Zend/zend_language_scanner.l"
 		{
 	return T_DOUBLE_ARROW;
 }
-#line 4032 "Zend/zend_language_scanner.c"
+#line 4038 "Zend/zend_language_scanner.c"
 yy298:
 		YYDEBUG(298, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(299, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1335 "Zend/zend_language_scanner.l"
+#line 1341 "Zend/zend_language_scanner.l"
 		{
 	return T_IS_IDENTICAL;
 }
-#line 4042 "Zend/zend_language_scanner.c"
+#line 4048 "Zend/zend_language_scanner.c"
 yy300:
 		YYDEBUG(300, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4168,7 +4174,7 @@ yy316:
 		}
 		YYDEBUG(319, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1698 "Zend/zend_language_scanner.l"
+#line 1704 "Zend/zend_language_scanner.l"
 		{
 	if (CG(current_namespace)) {
 		*zendlval = *CG(current_namespace);
@@ -4178,7 +4184,7 @@ yy316:
 	}
 	return T_NS_C;
 }
-#line 4182 "Zend/zend_language_scanner.c"
+#line 4188 "Zend/zend_language_scanner.c"
 yy320:
 		YYDEBUG(320, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4198,7 +4204,7 @@ yy321:
 		}
 		YYDEBUG(324, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1671 "Zend/zend_language_scanner.l"
+#line 1677 "Zend/zend_language_scanner.l"
 		{
 	char *filename = zend_get_compiled_filename(TSRMLS_C);
 	const size_t filename_len = strlen(filename);
@@ -4225,7 +4231,7 @@ yy321:
 	zendlval->type = IS_STRING;
 	return T_DIR;
 }
-#line 4229 "Zend/zend_language_scanner.c"
+#line 4235 "Zend/zend_language_scanner.c"
 yy325:
 		YYDEBUG(325, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4250,13 +4256,13 @@ yy327:
 		}
 		YYDEBUG(330, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1653 "Zend/zend_language_scanner.l"
+#line 1659 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.lval = CG(zend_lineno);
 	zendlval->type = IS_LONG;
 	return T_LINE;
 }
-#line 4260 "Zend/zend_language_scanner.c"
+#line 4266 "Zend/zend_language_scanner.c"
 yy331:
 		YYDEBUG(331, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4291,7 +4297,7 @@ yy335:
 		}
 		YYDEBUG(338, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1632 "Zend/zend_language_scanner.l"
+#line 1638 "Zend/zend_language_scanner.l"
 		{
 	const char *class_name = CG(active_class_entry) ? CG(active_class_entry)->name : NULL;
 	const char *func_name = CG(active_op_array)? CG(active_op_array)->function_name : NULL;
@@ -4312,7 +4318,7 @@ yy335:
 	zendlval->type = IS_STRING;
 	return T_METHOD_C;
 }
-#line 4316 "Zend/zend_language_scanner.c"
+#line 4322 "Zend/zend_language_scanner.c"
 yy339:
 		YYDEBUG(339, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4363,7 +4369,7 @@ yy346:
 		}
 		YYDEBUG(349, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1616 "Zend/zend_language_scanner.l"
+#line 1622 "Zend/zend_language_scanner.l"
 		{
 	const char *func_name = NULL;
 
@@ -4379,7 +4385,7 @@ yy346:
 	zendlval->type = IS_STRING;
 	return T_FUNC_C;
 }
-#line 4383 "Zend/zend_language_scanner.c"
+#line 4389 "Zend/zend_language_scanner.c"
 yy350:
 		YYDEBUG(350, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4399,7 +4405,7 @@ yy351:
 		}
 		YYDEBUG(354, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1659 "Zend/zend_language_scanner.l"
+#line 1665 "Zend/zend_language_scanner.l"
 		{
 	char *filename = zend_get_compiled_filename(TSRMLS_C);
 
@@ -4411,7 +4417,7 @@ yy351:
 	zendlval->type = IS_STRING;
 	return T_FILE;
 }
-#line 4415 "Zend/zend_language_scanner.c"
+#line 4421 "Zend/zend_language_scanner.c"
 yy355:
 		YYDEBUG(355, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4441,7 +4447,7 @@ yy358:
 		}
 		YYDEBUG(361, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1596 "Zend/zend_language_scanner.l"
+#line 1602 "Zend/zend_language_scanner.l"
 		{
 	const char *trait_name = NULL;
 	
@@ -4461,7 +4467,7 @@ yy358:
 	
 	return T_TRAIT_C;
 }
-#line 4465 "Zend/zend_language_scanner.c"
+#line 4471 "Zend/zend_language_scanner.c"
 yy362:
 		YYDEBUG(362, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4491,7 +4497,7 @@ yy365:
 		}
 		YYDEBUG(368, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1569 "Zend/zend_language_scanner.l"
+#line 1575 "Zend/zend_language_scanner.l"
 		{
 	const char *class_name = NULL;
 	
@@ -4518,7 +4524,7 @@ yy365:
 	}
 	return T_CLASS_C;
 }
-#line 4522 "Zend/zend_language_scanner.c"
+#line 4528 "Zend/zend_language_scanner.c"
 yy369:
 		YYDEBUG(369, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4580,11 +4586,11 @@ yy380:
 		}
 		YYDEBUG(381, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1279 "Zend/zend_language_scanner.l"
+#line 1285 "Zend/zend_language_scanner.l"
 		{
 	return T_HALT_COMPILER;
 }
-#line 4588 "Zend/zend_language_scanner.c"
+#line 4594 "Zend/zend_language_scanner.c"
 yy382:
 		YYDEBUG(382, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4604,11 +4610,11 @@ yy384:
 		}
 		YYDEBUG(385, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1259 "Zend/zend_language_scanner.l"
+#line 1265 "Zend/zend_language_scanner.l"
 		{
 	return T_USE;
 }
-#line 4612 "Zend/zend_language_scanner.c"
+#line 4618 "Zend/zend_language_scanner.c"
 yy386:
 		YYDEBUG(386, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4627,11 +4633,11 @@ yy388:
 		}
 		YYDEBUG(389, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1307 "Zend/zend_language_scanner.l"
+#line 1313 "Zend/zend_language_scanner.l"
 		{
 	return T_UNSET;
 }
-#line 4635 "Zend/zend_language_scanner.c"
+#line 4641 "Zend/zend_language_scanner.c"
 yy390:
 		YYDEBUG(390, *YYCURSOR);
 		++YYCURSOR;
@@ -4803,11 +4809,11 @@ yy405:
 		++YYCURSOR;
 		YYDEBUG(407, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1207 "Zend/zend_language_scanner.l"
+#line 1213 "Zend/zend_language_scanner.l"
 		{
 	return T_INT_CAST;
 }
-#line 4811 "Zend/zend_language_scanner.c"
+#line 4817 "Zend/zend_language_scanner.c"
 yy408:
 		YYDEBUG(408, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4851,11 +4857,11 @@ yy413:
 		++YYCURSOR;
 		YYDEBUG(416, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1211 "Zend/zend_language_scanner.l"
+#line 1217 "Zend/zend_language_scanner.l"
 		{
 	return T_DOUBLE_CAST;
 }
-#line 4859 "Zend/zend_language_scanner.c"
+#line 4865 "Zend/zend_language_scanner.c"
 yy417:
 		YYDEBUG(417, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4925,11 +4931,11 @@ yy427:
 		++YYCURSOR;
 		YYDEBUG(430, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1215 "Zend/zend_language_scanner.l"
+#line 1221 "Zend/zend_language_scanner.l"
 		{
 	return T_STRING_CAST;
 }
-#line 4933 "Zend/zend_language_scanner.c"
+#line 4939 "Zend/zend_language_scanner.c"
 yy431:
 		YYDEBUG(431, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4962,11 +4968,11 @@ yy434:
 		++YYCURSOR;
 		YYDEBUG(437, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1219 "Zend/zend_language_scanner.l"
+#line 1225 "Zend/zend_language_scanner.l"
 		{
 	return T_ARRAY_CAST;
 }
-#line 4970 "Zend/zend_language_scanner.c"
+#line 4976 "Zend/zend_language_scanner.c"
 yy438:
 		YYDEBUG(438, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5004,11 +5010,11 @@ yy442:
 		++YYCURSOR;
 		YYDEBUG(445, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1223 "Zend/zend_language_scanner.l"
+#line 1229 "Zend/zend_language_scanner.l"
 		{
 	return T_OBJECT_CAST;
 }
-#line 5012 "Zend/zend_language_scanner.c"
+#line 5018 "Zend/zend_language_scanner.c"
 yy446:
 		YYDEBUG(446, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5049,11 +5055,11 @@ yy451:
 		++YYCURSOR;
 		YYDEBUG(453, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1227 "Zend/zend_language_scanner.l"
+#line 1233 "Zend/zend_language_scanner.l"
 		{
 	return T_BOOL_CAST;
 }
-#line 5057 "Zend/zend_language_scanner.c"
+#line 5063 "Zend/zend_language_scanner.c"
 yy454:
 		YYDEBUG(454, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5113,11 +5119,11 @@ yy462:
 		++YYCURSOR;
 		YYDEBUG(465, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1231 "Zend/zend_language_scanner.l"
+#line 1237 "Zend/zend_language_scanner.l"
 		{
 	return T_UNSET_CAST;
 }
-#line 5121 "Zend/zend_language_scanner.c"
+#line 5127 "Zend/zend_language_scanner.c"
 yy466:
 		YYDEBUG(466, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5131,11 +5137,11 @@ yy467:
 		}
 		YYDEBUG(468, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1203 "Zend/zend_language_scanner.l"
+#line 1209 "Zend/zend_language_scanner.l"
 		{
 	return T_VAR;
 }
-#line 5139 "Zend/zend_language_scanner.c"
+#line 5145 "Zend/zend_language_scanner.c"
 yy469:
 		YYDEBUG(469, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5155,11 +5161,11 @@ yy471:
 		}
 		YYDEBUG(472, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1195 "Zend/zend_language_scanner.l"
+#line 1201 "Zend/zend_language_scanner.l"
 		{
 	return T_NEW;
 }
-#line 5163 "Zend/zend_language_scanner.c"
+#line 5169 "Zend/zend_language_scanner.c"
 yy473:
 		YYDEBUG(473, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5198,21 +5204,21 @@ yy479:
 		}
 		YYDEBUG(480, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1255 "Zend/zend_language_scanner.l"
+#line 1261 "Zend/zend_language_scanner.l"
 		{
 	return T_NAMESPACE;
 }
-#line 5206 "Zend/zend_language_scanner.c"
+#line 5212 "Zend/zend_language_scanner.c"
 yy481:
 		YYDEBUG(481, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(482, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1187 "Zend/zend_language_scanner.l"
+#line 1193 "Zend/zend_language_scanner.l"
 		{
 	return T_PAAMAYIM_NEKUDOTAYIM;
 }
-#line 5216 "Zend/zend_language_scanner.c"
+#line 5222 "Zend/zend_language_scanner.c"
 yy483:
 		YYDEBUG(483, *YYCURSOR);
 		++YYCURSOR;
@@ -5234,32 +5240,32 @@ yy485:
 		++YYCURSOR;
 		YYDEBUG(486, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1363 "Zend/zend_language_scanner.l"
+#line 1369 "Zend/zend_language_scanner.l"
 		{
 	return T_MINUS_EQUAL;
 }
-#line 5242 "Zend/zend_language_scanner.c"
+#line 5248 "Zend/zend_language_scanner.c"
 yy487:
 		YYDEBUG(487, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(488, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1331 "Zend/zend_language_scanner.l"
+#line 1337 "Zend/zend_language_scanner.l"
 		{
 	return T_DEC;
 }
-#line 5252 "Zend/zend_language_scanner.c"
+#line 5258 "Zend/zend_language_scanner.c"
 yy489:
 		YYDEBUG(489, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(490, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1157 "Zend/zend_language_scanner.l"
+#line 1163 "Zend/zend_language_scanner.l"
 		{
 	yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
 	return T_OBJECT_OPERATOR;
 }
-#line 5263 "Zend/zend_language_scanner.c"
+#line 5269 "Zend/zend_language_scanner.c"
 yy491:
 		YYDEBUG(491, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5304,11 +5310,11 @@ yy496:
 		}
 		YYDEBUG(497, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1303 "Zend/zend_language_scanner.l"
+#line 1309 "Zend/zend_language_scanner.l"
 		{
 	return T_PUBLIC;
 }
-#line 5312 "Zend/zend_language_scanner.c"
+#line 5318 "Zend/zend_language_scanner.c"
 yy498:
 		YYDEBUG(498, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5363,11 +5369,11 @@ yy505:
 		}
 		YYDEBUG(506, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1299 "Zend/zend_language_scanner.l"
+#line 1305 "Zend/zend_language_scanner.l"
 		{
 	return T_PROTECTED;
 }
-#line 5371 "Zend/zend_language_scanner.c"
+#line 5377 "Zend/zend_language_scanner.c"
 yy507:
 		YYDEBUG(507, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5397,11 +5403,11 @@ yy511:
 		}
 		YYDEBUG(512, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1295 "Zend/zend_language_scanner.l"
+#line 1301 "Zend/zend_language_scanner.l"
 		{
 	return T_PRIVATE;
 }
-#line 5405 "Zend/zend_language_scanner.c"
+#line 5411 "Zend/zend_language_scanner.c"
 yy513:
 		YYDEBUG(513, *YYCURSOR);
 		++YYCURSOR;
@@ -5410,11 +5416,11 @@ yy513:
 		}
 		YYDEBUG(514, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1133 "Zend/zend_language_scanner.l"
+#line 1139 "Zend/zend_language_scanner.l"
 		{
 	return T_PRINT;
 }
-#line 5418 "Zend/zend_language_scanner.c"
+#line 5424 "Zend/zend_language_scanner.c"
 yy515:
 		YYDEBUG(515, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5439,11 +5445,11 @@ yy518:
 		}
 		YYDEBUG(519, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1125 "Zend/zend_language_scanner.l"
+#line 1131 "Zend/zend_language_scanner.l"
 		{
 	return T_GOTO;
 }
-#line 5447 "Zend/zend_language_scanner.c"
+#line 5453 "Zend/zend_language_scanner.c"
 yy520:
 		YYDEBUG(520, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5467,11 +5473,11 @@ yy523:
 		}
 		YYDEBUG(524, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1267 "Zend/zend_language_scanner.l"
+#line 1273 "Zend/zend_language_scanner.l"
 		{
 	return T_GLOBAL;
 }
-#line 5475 "Zend/zend_language_scanner.c"
+#line 5481 "Zend/zend_language_scanner.c"
 yy525:
 		YYDEBUG(525, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5508,11 +5514,11 @@ yy531:
 		}
 		YYDEBUG(532, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1117 "Zend/zend_language_scanner.l"
+#line 1123 "Zend/zend_language_scanner.l"
 		{
 	return T_BREAK;
 }
-#line 5516 "Zend/zend_language_scanner.c"
+#line 5522 "Zend/zend_language_scanner.c"
 yy533:
 		YYDEBUG(533, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5552,11 +5558,11 @@ yy539:
 		}
 		YYDEBUG(540, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1101 "Zend/zend_language_scanner.l"
+#line 1107 "Zend/zend_language_scanner.l"
 		{
 	return T_SWITCH;
 }
-#line 5560 "Zend/zend_language_scanner.c"
+#line 5566 "Zend/zend_language_scanner.c"
 yy541:
 		YYDEBUG(541, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5580,11 +5586,11 @@ yy544:
 		}
 		YYDEBUG(545, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1283 "Zend/zend_language_scanner.l"
+#line 1289 "Zend/zend_language_scanner.l"
 		{
 	return T_STATIC;
 }
-#line 5588 "Zend/zend_language_scanner.c"
+#line 5594 "Zend/zend_language_scanner.c"
 yy546:
 		YYDEBUG(546, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5611,11 +5617,11 @@ yy549:
 		}
 		YYDEBUG(550, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1097 "Zend/zend_language_scanner.l"
+#line 1103 "Zend/zend_language_scanner.l"
 		{
 	return T_AS;
 }
-#line 5619 "Zend/zend_language_scanner.c"
+#line 5625 "Zend/zend_language_scanner.c"
 yy551:
 		YYDEBUG(551, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5634,11 +5640,11 @@ yy553:
 		}
 		YYDEBUG(554, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1319 "Zend/zend_language_scanner.l"
+#line 1325 "Zend/zend_language_scanner.l"
 		{
 	return T_ARRAY;
 }
-#line 5642 "Zend/zend_language_scanner.c"
+#line 5648 "Zend/zend_language_scanner.c"
 yy555:
 		YYDEBUG(555, *YYCURSOR);
 		++YYCURSOR;
@@ -5647,11 +5653,11 @@ yy555:
 		}
 		YYDEBUG(556, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1415 "Zend/zend_language_scanner.l"
+#line 1421 "Zend/zend_language_scanner.l"
 		{
 	return T_LOGICAL_AND;
 }
-#line 5655 "Zend/zend_language_scanner.c"
+#line 5661 "Zend/zend_language_scanner.c"
 yy557:
 		YYDEBUG(557, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5685,11 +5691,11 @@ yy562:
 		}
 		YYDEBUG(563, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1287 "Zend/zend_language_scanner.l"
+#line 1293 "Zend/zend_language_scanner.l"
 		{
 	return T_ABSTRACT;
 }
-#line 5693 "Zend/zend_language_scanner.c"
+#line 5699 "Zend/zend_language_scanner.c"
 yy564:
 		YYDEBUG(564, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5713,11 +5719,11 @@ yy567:
 		}
 		YYDEBUG(568, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1057 "Zend/zend_language_scanner.l"
+#line 1063 "Zend/zend_language_scanner.l"
 		{
 	return T_WHILE;
 }
-#line 5721 "Zend/zend_language_scanner.c"
+#line 5727 "Zend/zend_language_scanner.c"
 yy569:
 		YYDEBUG(569, *YYCURSOR);
 		++YYCURSOR;
@@ -5726,11 +5732,11 @@ yy569:
 		}
 		YYDEBUG(570, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1041 "Zend/zend_language_scanner.l"
+#line 1047 "Zend/zend_language_scanner.l"
 		{
 	return T_IF;
 }
-#line 5734 "Zend/zend_language_scanner.c"
+#line 5740 "Zend/zend_language_scanner.c"
 yy571:
 		YYDEBUG(571, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5782,11 +5788,11 @@ yy576:
 		}
 		YYDEBUG(577, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1271 "Zend/zend_language_scanner.l"
+#line 1277 "Zend/zend_language_scanner.l"
 		{
 	return T_ISSET;
 }
-#line 5790 "Zend/zend_language_scanner.c"
+#line 5796 "Zend/zend_language_scanner.c"
 yy578:
 		YYDEBUG(578, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5840,11 +5846,11 @@ yy584:
 yy585:
 		YYDEBUG(585, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1239 "Zend/zend_language_scanner.l"
+#line 1245 "Zend/zend_language_scanner.l"
 		{
 	return T_INCLUDE;
 }
-#line 5848 "Zend/zend_language_scanner.c"
+#line 5854 "Zend/zend_language_scanner.c"
 yy586:
 		YYDEBUG(586, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5873,11 +5879,11 @@ yy590:
 		}
 		YYDEBUG(591, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1243 "Zend/zend_language_scanner.l"
+#line 1249 "Zend/zend_language_scanner.l"
 		{
 	return T_INCLUDE_ONCE;
 }
-#line 5881 "Zend/zend_language_scanner.c"
+#line 5887 "Zend/zend_language_scanner.c"
 yy592:
 		YYDEBUG(592, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5911,11 +5917,11 @@ yy597:
 		}
 		YYDEBUG(598, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1141 "Zend/zend_language_scanner.l"
+#line 1147 "Zend/zend_language_scanner.l"
 		{
 	return T_INTERFACE;
 }
-#line 5919 "Zend/zend_language_scanner.c"
+#line 5925 "Zend/zend_language_scanner.c"
 yy599:
 		YYDEBUG(599, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5965,11 +5971,11 @@ yy605:
 		}
 		YYDEBUG(606, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1263 "Zend/zend_language_scanner.l"
+#line 1269 "Zend/zend_language_scanner.l"
 		{
         return T_INSTEADOF;
 }
-#line 5973 "Zend/zend_language_scanner.c"
+#line 5979 "Zend/zend_language_scanner.c"
 yy607:
 		YYDEBUG(607, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5998,11 +6004,11 @@ yy611:
 		}
 		YYDEBUG(612, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1093 "Zend/zend_language_scanner.l"
+#line 1099 "Zend/zend_language_scanner.l"
 		{
 	return T_INSTANCEOF;
 }
-#line 6006 "Zend/zend_language_scanner.c"
+#line 6012 "Zend/zend_language_scanner.c"
 yy613:
 		YYDEBUG(613, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6046,11 +6052,11 @@ yy620:
 		}
 		YYDEBUG(621, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1153 "Zend/zend_language_scanner.l"
+#line 1159 "Zend/zend_language_scanner.l"
 		{
 	return T_IMPLEMENTS;
 }
-#line 6054 "Zend/zend_language_scanner.c"
+#line 6060 "Zend/zend_language_scanner.c"
 yy622:
 		YYDEBUG(622, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6078,11 +6084,11 @@ yy623:
 		}
 		YYDEBUG(625, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1029 "Zend/zend_language_scanner.l"
+#line 1035 "Zend/zend_language_scanner.l"
 		{
 	return T_TRY;
 }
-#line 6086 "Zend/zend_language_scanner.c"
+#line 6092 "Zend/zend_language_scanner.c"
 yy626:
 		YYDEBUG(626, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6101,11 +6107,11 @@ yy628:
 		}
 		YYDEBUG(629, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1145 "Zend/zend_language_scanner.l"
+#line 1151 "Zend/zend_language_scanner.l"
 		{
 	return T_TRAIT;
 }
-#line 6109 "Zend/zend_language_scanner.c"
+#line 6115 "Zend/zend_language_scanner.c"
 yy630:
 		YYDEBUG(630, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6124,11 +6130,11 @@ yy632:
 		}
 		YYDEBUG(633, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1037 "Zend/zend_language_scanner.l"
+#line 1043 "Zend/zend_language_scanner.l"
 		{
 	return T_THROW;
 }
-#line 6132 "Zend/zend_language_scanner.c"
+#line 6138 "Zend/zend_language_scanner.c"
 yy634:
 		YYDEBUG(634, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6189,11 +6195,11 @@ yy640:
 yy641:
 		YYDEBUG(641, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1247 "Zend/zend_language_scanner.l"
+#line 1253 "Zend/zend_language_scanner.l"
 		{
 	return T_REQUIRE;
 }
-#line 6197 "Zend/zend_language_scanner.c"
+#line 6203 "Zend/zend_language_scanner.c"
 yy642:
 		YYDEBUG(642, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6222,11 +6228,11 @@ yy646:
 		}
 		YYDEBUG(647, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1251 "Zend/zend_language_scanner.l"
+#line 1257 "Zend/zend_language_scanner.l"
 		{
 	return T_REQUIRE_ONCE;
 }
-#line 6230 "Zend/zend_language_scanner.c"
+#line 6236 "Zend/zend_language_scanner.c"
 yy648:
 		YYDEBUG(648, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6245,11 +6251,11 @@ yy650:
 		}
 		YYDEBUG(651, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1025 "Zend/zend_language_scanner.l"
+#line 1031 "Zend/zend_language_scanner.l"
 		{
 	return T_RETURN;
 }
-#line 6253 "Zend/zend_language_scanner.c"
+#line 6259 "Zend/zend_language_scanner.c"
 yy652:
 		YYDEBUG(652, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6339,11 +6345,11 @@ yy661:
 		}
 		YYDEBUG(662, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1121 "Zend/zend_language_scanner.l"
+#line 1127 "Zend/zend_language_scanner.l"
 		{
 	return T_CONTINUE;
 }
-#line 6347 "Zend/zend_language_scanner.c"
+#line 6353 "Zend/zend_language_scanner.c"
 yy663:
 		YYDEBUG(663, *YYCURSOR);
 		++YYCURSOR;
@@ -6352,11 +6358,11 @@ yy663:
 		}
 		YYDEBUG(664, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1021 "Zend/zend_language_scanner.l"
+#line 1027 "Zend/zend_language_scanner.l"
 		{
 	return T_CONST;
 }
-#line 6360 "Zend/zend_language_scanner.c"
+#line 6366 "Zend/zend_language_scanner.c"
 yy665:
 		YYDEBUG(665, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6381,11 +6387,11 @@ yy668:
 		}
 		YYDEBUG(669, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1199 "Zend/zend_language_scanner.l"
+#line 1205 "Zend/zend_language_scanner.l"
 		{
 	return T_CLONE;
 }
-#line 6389 "Zend/zend_language_scanner.c"
+#line 6395 "Zend/zend_language_scanner.c"
 yy670:
 		YYDEBUG(670, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6399,11 +6405,11 @@ yy671:
 		}
 		YYDEBUG(672, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1137 "Zend/zend_language_scanner.l"
+#line 1143 "Zend/zend_language_scanner.l"
 		{
 	return T_CLASS;
 }
-#line 6407 "Zend/zend_language_scanner.c"
+#line 6413 "Zend/zend_language_scanner.c"
 yy673:
 		YYDEBUG(673, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6449,11 +6455,11 @@ yy680:
 		}
 		YYDEBUG(681, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1323 "Zend/zend_language_scanner.l"
+#line 1329 "Zend/zend_language_scanner.l"
 		{
  return T_CALLABLE;
 }
-#line 6457 "Zend/zend_language_scanner.c"
+#line 6463 "Zend/zend_language_scanner.c"
 yy682:
 		YYDEBUG(682, *YYCURSOR);
 		++YYCURSOR;
@@ -6462,11 +6468,11 @@ yy682:
 		}
 		YYDEBUG(683, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1109 "Zend/zend_language_scanner.l"
+#line 1115 "Zend/zend_language_scanner.l"
 		{
 	return T_CASE;
 }
-#line 6470 "Zend/zend_language_scanner.c"
+#line 6476 "Zend/zend_language_scanner.c"
 yy684:
 		YYDEBUG(684, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6480,11 +6486,11 @@ yy685:
 		}
 		YYDEBUG(686, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1033 "Zend/zend_language_scanner.l"
+#line 1039 "Zend/zend_language_scanner.l"
 		{
 	return T_CATCH;
 }
-#line 6488 "Zend/zend_language_scanner.c"
+#line 6494 "Zend/zend_language_scanner.c"
 yy687:
 		YYDEBUG(687, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6535,11 +6541,11 @@ yy695:
 		}
 		YYDEBUG(696, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1017 "Zend/zend_language_scanner.l"
+#line 1023 "Zend/zend_language_scanner.l"
 		{
 	return T_FUNCTION;
 }
-#line 6543 "Zend/zend_language_scanner.c"
+#line 6549 "Zend/zend_language_scanner.c"
 yy697:
 		YYDEBUG(697, *YYCURSOR);
 		++YYCURSOR;
@@ -6563,11 +6569,11 @@ yy697:
 yy698:
 		YYDEBUG(698, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1069 "Zend/zend_language_scanner.l"
+#line 1075 "Zend/zend_language_scanner.l"
 		{
 	return T_FOR;
 }
-#line 6571 "Zend/zend_language_scanner.c"
+#line 6577 "Zend/zend_language_scanner.c"
 yy699:
 		YYDEBUG(699, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6591,11 +6597,11 @@ yy702:
 		}
 		YYDEBUG(703, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1077 "Zend/zend_language_scanner.l"
+#line 1083 "Zend/zend_language_scanner.l"
 		{
 	return T_FOREACH;
 }
-#line 6599 "Zend/zend_language_scanner.c"
+#line 6605 "Zend/zend_language_scanner.c"
 yy704:
 		YYDEBUG(704, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6614,11 +6620,11 @@ yy706:
 		}
 		YYDEBUG(707, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1291 "Zend/zend_language_scanner.l"
+#line 1297 "Zend/zend_language_scanner.l"
 		{
 	return T_FINAL;
 }
-#line 6622 "Zend/zend_language_scanner.c"
+#line 6628 "Zend/zend_language_scanner.c"
 yy708:
 		YYDEBUG(708, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6649,11 +6655,11 @@ yy710:
 		}
 		YYDEBUG(711, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1065 "Zend/zend_language_scanner.l"
+#line 1071 "Zend/zend_language_scanner.l"
 		{
 	return T_DO;
 }
-#line 6657 "Zend/zend_language_scanner.c"
+#line 6663 "Zend/zend_language_scanner.c"
 yy712:
 		YYDEBUG(712, *YYCURSOR);
 		++YYCURSOR;
@@ -6662,11 +6668,11 @@ yy712:
 		}
 		YYDEBUG(713, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1013 "Zend/zend_language_scanner.l"
+#line 1019 "Zend/zend_language_scanner.l"
 		{
 	return T_EXIT;
 }
-#line 6670 "Zend/zend_language_scanner.c"
+#line 6676 "Zend/zend_language_scanner.c"
 yy714:
 		YYDEBUG(714, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6701,11 +6707,11 @@ yy719:
 		}
 		YYDEBUG(720, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1113 "Zend/zend_language_scanner.l"
+#line 1119 "Zend/zend_language_scanner.l"
 		{
 	return T_DEFAULT;
 }
-#line 6709 "Zend/zend_language_scanner.c"
+#line 6715 "Zend/zend_language_scanner.c"
 yy721:
 		YYDEBUG(721, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6729,11 +6735,11 @@ yy724:
 		}
 		YYDEBUG(725, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1085 "Zend/zend_language_scanner.l"
+#line 1091 "Zend/zend_language_scanner.l"
 		{
 	return T_DECLARE;
 }
-#line 6737 "Zend/zend_language_scanner.c"
+#line 6743 "Zend/zend_language_scanner.c"
 yy726:
 		YYDEBUG(726, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6813,11 +6819,11 @@ yy737:
 		}
 		YYDEBUG(738, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1149 "Zend/zend_language_scanner.l"
+#line 1155 "Zend/zend_language_scanner.l"
 		{
 	return T_EXTENDS;
 }
-#line 6821 "Zend/zend_language_scanner.c"
+#line 6827 "Zend/zend_language_scanner.c"
 yy739:
 		YYDEBUG(739, *YYCURSOR);
 		++YYCURSOR;
@@ -6826,11 +6832,11 @@ yy739:
 		}
 		YYDEBUG(740, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1009 "Zend/zend_language_scanner.l"
+#line 1015 "Zend/zend_language_scanner.l"
 		{
 	return T_EXIT;
 }
-#line 6834 "Zend/zend_language_scanner.c"
+#line 6840 "Zend/zend_language_scanner.c"
 yy741:
 		YYDEBUG(741, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6844,11 +6850,11 @@ yy742:
 		}
 		YYDEBUG(743, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1235 "Zend/zend_language_scanner.l"
+#line 1241 "Zend/zend_language_scanner.l"
 		{
 	return T_EVAL;
 }
-#line 6852 "Zend/zend_language_scanner.c"
+#line 6858 "Zend/zend_language_scanner.c"
 yy744:
 		YYDEBUG(744, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6918,11 +6924,11 @@ yy753:
 		}
 		YYDEBUG(754, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1061 "Zend/zend_language_scanner.l"
+#line 1067 "Zend/zend_language_scanner.l"
 		{
 	return T_ENDWHILE;
 }
-#line 6926 "Zend/zend_language_scanner.c"
+#line 6932 "Zend/zend_language_scanner.c"
 yy755:
 		YYDEBUG(755, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6951,11 +6957,11 @@ yy759:
 		}
 		YYDEBUG(760, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1105 "Zend/zend_language_scanner.l"
+#line 1111 "Zend/zend_language_scanner.l"
 		{
 	return T_ENDSWITCH;
 }
-#line 6959 "Zend/zend_language_scanner.c"
+#line 6965 "Zend/zend_language_scanner.c"
 yy761:
 		YYDEBUG(761, *YYCURSOR);
 		++YYCURSOR;
@@ -6964,11 +6970,11 @@ yy761:
 		}
 		YYDEBUG(762, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1049 "Zend/zend_language_scanner.l"
+#line 1055 "Zend/zend_language_scanner.l"
 		{
 	return T_ENDIF;
 }
-#line 6972 "Zend/zend_language_scanner.c"
+#line 6978 "Zend/zend_language_scanner.c"
 yy763:
 		YYDEBUG(763, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6997,11 +7003,11 @@ yy764:
 yy765:
 		YYDEBUG(765, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1073 "Zend/zend_language_scanner.l"
+#line 1079 "Zend/zend_language_scanner.l"
 		{
 	return T_ENDFOR;
 }
-#line 7005 "Zend/zend_language_scanner.c"
+#line 7011 "Zend/zend_language_scanner.c"
 yy766:
 		YYDEBUG(766, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7025,11 +7031,11 @@ yy769:
 		}
 		YYDEBUG(770, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1081 "Zend/zend_language_scanner.l"
+#line 1087 "Zend/zend_language_scanner.l"
 		{
 	return T_ENDFOREACH;
 }
-#line 7033 "Zend/zend_language_scanner.c"
+#line 7039 "Zend/zend_language_scanner.c"
 yy771:
 		YYDEBUG(771, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7063,11 +7069,11 @@ yy776:
 		}
 		YYDEBUG(777, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1089 "Zend/zend_language_scanner.l"
+#line 1095 "Zend/zend_language_scanner.l"
 		{
 	return T_ENDDECLARE;
 }
-#line 7071 "Zend/zend_language_scanner.c"
+#line 7077 "Zend/zend_language_scanner.c"
 yy778:
 		YYDEBUG(778, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7086,11 +7092,11 @@ yy780:
 		}
 		YYDEBUG(781, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1275 "Zend/zend_language_scanner.l"
+#line 1281 "Zend/zend_language_scanner.l"
 		{
 	return T_EMPTY;
 }
-#line 7094 "Zend/zend_language_scanner.c"
+#line 7100 "Zend/zend_language_scanner.c"
 yy782:
 		YYDEBUG(782, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7119,11 +7125,11 @@ yy783:
 yy784:
 		YYDEBUG(784, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1053 "Zend/zend_language_scanner.l"
+#line 1059 "Zend/zend_language_scanner.l"
 		{
 	return T_ELSE;
 }
-#line 7127 "Zend/zend_language_scanner.c"
+#line 7133 "Zend/zend_language_scanner.c"
 yy785:
 		YYDEBUG(785, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7137,11 +7143,11 @@ yy786:
 		}
 		YYDEBUG(787, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1045 "Zend/zend_language_scanner.l"
+#line 1051 "Zend/zend_language_scanner.l"
 		{
 	return T_ELSEIF;
 }
-#line 7145 "Zend/zend_language_scanner.c"
+#line 7151 "Zend/zend_language_scanner.c"
 yy788:
 		YYDEBUG(788, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7155,11 +7161,11 @@ yy789:
 		}
 		YYDEBUG(790, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1129 "Zend/zend_language_scanner.l"
+#line 1135 "Zend/zend_language_scanner.l"
 		{
 	return T_ECHO;
 }
-#line 7163 "Zend/zend_language_scanner.c"
+#line 7169 "Zend/zend_language_scanner.c"
 	}
 /* *********************************** */
 yyc_ST_LOOKING_FOR_PROPERTY:
@@ -7232,7 +7238,7 @@ yy793:
 yy794:
 		YYDEBUG(794, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1162 "Zend/zend_language_scanner.l"
+#line 1168 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.str.val = yytext; /* no copying - intentional */
 	zendlval->value.str.len = yyleng;
@@ -7240,7 +7246,7 @@ yy794:
 	HANDLE_NEWLINES(yytext, yyleng);
 	return T_WHITESPACE;
 }
-#line 7244 "Zend/zend_language_scanner.c"
+#line 7250 "Zend/zend_language_scanner.c"
 yy795:
 		YYDEBUG(795, *YYCURSOR);
 		++YYCURSOR;
@@ -7248,13 +7254,13 @@ yy795:
 yy796:
 		YYDEBUG(796, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1181 "Zend/zend_language_scanner.l"
+#line 1187 "Zend/zend_language_scanner.l"
 		{
 	yyless(0);
 	yy_pop_state(TSRMLS_C);
 	goto restart;
 }
-#line 7258 "Zend/zend_language_scanner.c"
+#line 7264 "Zend/zend_language_scanner.c"
 yy797:
 		YYDEBUG(797, *YYCURSOR);
 		++YYCURSOR;
@@ -7263,14 +7269,14 @@ yy797:
 yy798:
 		YYDEBUG(798, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1174 "Zend/zend_language_scanner.l"
+#line 1180 "Zend/zend_language_scanner.l"
 		{
 	yy_pop_state(TSRMLS_C);
 	zend_copy_value(zendlval, yytext, yyleng);
 	zendlval->type = IS_STRING;
 	return T_STRING;
 }
-#line 7274 "Zend/zend_language_scanner.c"
+#line 7280 "Zend/zend_language_scanner.c"
 yy799:
 		YYDEBUG(799, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7291,11 +7297,11 @@ yy802:
 		++YYCURSOR;
 		YYDEBUG(803, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1170 "Zend/zend_language_scanner.l"
+#line 1176 "Zend/zend_language_scanner.l"
 		{
 	return T_OBJECT_OPERATOR;
 }
-#line 7299 "Zend/zend_language_scanner.c"
+#line 7305 "Zend/zend_language_scanner.c"
 yy804:
 		YYDEBUG(804, *YYCURSOR);
 		++YYCURSOR;
@@ -7365,7 +7371,7 @@ yy808:
 yy809:
 		YYDEBUG(809, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1457 "Zend/zend_language_scanner.l"
+#line 1463 "Zend/zend_language_scanner.l"
 		{
 	zend_copy_value(zendlval, yytext, yyleng);
 	zendlval->type = IS_STRING;
@@ -7373,20 +7379,20 @@ yy809:
 	yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
 	return T_STRING_VARNAME;
 }
-#line 7377 "Zend/zend_language_scanner.c"
+#line 7383 "Zend/zend_language_scanner.c"
 yy810:
 		YYDEBUG(810, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(811, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1466 "Zend/zend_language_scanner.l"
+#line 1472 "Zend/zend_language_scanner.l"
 		{
 	yyless(0);
 	yy_pop_state(TSRMLS_C);
 	yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
 	goto restart;
 }
-#line 7390 "Zend/zend_language_scanner.c"
+#line 7396 "Zend/zend_language_scanner.c"
 yy812:
 		YYDEBUG(812, *YYCURSOR);
 		++YYCURSOR;
@@ -7408,7 +7414,7 @@ yyc_ST_NOWDOC:
 	++YYCURSOR;
 	YYDEBUG(817, *YYCURSOR);
 	yyleng = YYCURSOR - SCNG(yy_text);
-#line 2348 "Zend/zend_language_scanner.l"
+#line 2354 "Zend/zend_language_scanner.l"
 	{
 	int newline = 0;
 
@@ -7463,7 +7469,7 @@ nowdoc_scan_done:
 	HANDLE_NEWLINES(yytext, yyleng - newline);
 	return T_ENCAPSED_AND_WHITESPACE;
 }
-#line 7467 "Zend/zend_language_scanner.c"
+#line 7473 "Zend/zend_language_scanner.c"
 /* *********************************** */
 yyc_ST_VAR_OFFSET:
 	{
@@ -7570,7 +7576,7 @@ yy820:
 yy821:
 		YYDEBUG(821, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1544 "Zend/zend_language_scanner.l"
+#line 1550 "Zend/zend_language_scanner.l"
 		{ /* Offset could be treated as a long */
 	if (yyleng < MAX_LENGTH_OF_LONG - 1 || (yyleng == MAX_LENGTH_OF_LONG - 1 && strcmp(yytext, long_min_digits) < 0)) {
 		zendlval->value.lval = strtol(yytext, NULL, 10);
@@ -7582,7 +7588,7 @@ yy821:
 	}
 	return T_NUM_STRING;
 }
-#line 7586 "Zend/zend_language_scanner.c"
+#line 7592 "Zend/zend_language_scanner.c"
 yy822:
 		YYDEBUG(822, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7602,23 +7608,23 @@ yy823:
 yy824:
 		YYDEBUG(824, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1876 "Zend/zend_language_scanner.l"
+#line 1882 "Zend/zend_language_scanner.l"
 		{
 	/* Only '[' can be valid, but returning other tokens will allow a more explicit parse error */
 	return yytext[0];
 }
-#line 7611 "Zend/zend_language_scanner.c"
+#line 7617 "Zend/zend_language_scanner.c"
 yy825:
 		YYDEBUG(825, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(826, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1871 "Zend/zend_language_scanner.l"
+#line 1877 "Zend/zend_language_scanner.l"
 		{
 	yy_pop_state(TSRMLS_C);
 	return ']';
 }
-#line 7622 "Zend/zend_language_scanner.c"
+#line 7628 "Zend/zend_language_scanner.c"
 yy827:
 		YYDEBUG(827, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7628,14 +7634,14 @@ yy828:
 		++YYCURSOR;
 		YYDEBUG(829, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1881 "Zend/zend_language_scanner.l"
+#line 1887 "Zend/zend_language_scanner.l"
 		{
 	/* Invalid rule to return a more explicit parse error with proper line number */
 	yyless(0);
 	yy_pop_state(TSRMLS_C);
 	return T_ENCAPSED_AND_WHITESPACE;
 }
-#line 7639 "Zend/zend_language_scanner.c"
+#line 7645 "Zend/zend_language_scanner.c"
 yy830:
 		YYDEBUG(830, *YYCURSOR);
 		++YYCURSOR;
@@ -7644,19 +7650,19 @@ yy830:
 yy831:
 		YYDEBUG(831, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1888 "Zend/zend_language_scanner.l"
+#line 1894 "Zend/zend_language_scanner.l"
 		{
 	zend_copy_value(zendlval, yytext, yyleng);
 	zendlval->type = IS_STRING;
 	return T_STRING;
 }
-#line 7654 "Zend/zend_language_scanner.c"
+#line 7660 "Zend/zend_language_scanner.c"
 yy832:
 		YYDEBUG(832, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(833, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2404 "Zend/zend_language_scanner.l"
+#line 2410 "Zend/zend_language_scanner.l"
 		{
 	if (YYCURSOR > YYLIMIT) {
 		return 0;
@@ -7665,7 +7671,7 @@ yy832:
 	zend_error(E_COMPILE_WARNING,"Unexpected character in input:  '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE);
 	goto restart;
 }
-#line 7669 "Zend/zend_language_scanner.c"
+#line 7675 "Zend/zend_language_scanner.c"
 yy834:
 		YYDEBUG(834, *YYCURSOR);
 		++YYCURSOR;
@@ -7701,13 +7707,13 @@ yy836:
 yy838:
 		YYDEBUG(838, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1865 "Zend/zend_language_scanner.l"
+#line 1871 "Zend/zend_language_scanner.l"
 		{
 	zend_copy_value(zendlval, (yytext+1), (yyleng-1));
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 7711 "Zend/zend_language_scanner.c"
+#line 7717 "Zend/zend_language_scanner.c"
 yy839:
 		YYDEBUG(839, *YYCURSOR);
 		++YYCURSOR;
@@ -7747,14 +7753,14 @@ yy844:
 yy846:
 		YYDEBUG(846, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1556 "Zend/zend_language_scanner.l"
+#line 1562 "Zend/zend_language_scanner.l"
 		{ /* Offset must be treated as a string */
 	zendlval->value.str.val = (char *)estrndup(yytext, yyleng);
 	zendlval->value.str.len = yyleng;
 	zendlval->type = IS_STRING;
 	return T_NUM_STRING;
 }
-#line 7758 "Zend/zend_language_scanner.c"
+#line 7764 "Zend/zend_language_scanner.c"
 yy847:
 		YYDEBUG(847, *YYCURSOR);
 		++YYCURSOR;
@@ -7777,6 +7783,6 @@ yy849:
 		goto yy846;
 	}
 }
-#line 2413 "Zend/zend_language_scanner.l"
+#line 2419 "Zend/zend_language_scanner.l"
 
 }
diff --git a/Zend/zend_language_scanner_defs.h b/Zend/zend_language_scanner_defs.h
index 015a903..5aede18 100644
--- a/Zend/zend_language_scanner_defs.h
+++ b/Zend/zend_language_scanner_defs.h
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Thu Mar  1 21:27:30 2012 */
+/* Generated by re2c 0.13.5 on Mon Apr 30 10:28:29 2012 */
 #line 3 "Zend/zend_language_scanner_defs.h"
 
 enum YYCONDTYPE {


commit ea23192910baf03c98998a69e4abc2829af0f24c
Author: Felipe Pena <felipensp at gmail.com>
Date:   Mon Apr 30 10:35:11 2012 -0300

    - Regenerated files

diff --git a/Zend/zend_language_scanner.c b/Zend/zend_language_scanner.c
index 960222a..5d45155 100644
--- a/Zend/zend_language_scanner.c
+++ b/Zend/zend_language_scanner.c
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Mon Apr  9 18:25:45 2012 */
+/* Generated by re2c 0.13.5 on Mon Apr 30 10:33:28 2012 */
 #line 1 "Zend/zend_language_scanner.l"
 /*
    +----------------------------------------------------------------------+
@@ -32,7 +32,9 @@
 #endif
 
 #include "zend_language_scanner_defs.h"
-
+#ifdef PHP_WIN32
+# include <Winuser.h>
+#endif
 #include <errno.h>
 #include "zend.h"
 #include "zend_alloc.h"
@@ -907,7 +909,11 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo
 					zendlval->value.str.len--;
 					break;
 				case 'e':
+#ifdef PHP_WIN32
+					*t++ = VK_ESCAPE;
+#else
 					*t++ = '\e';
+#endif
 					zendlval->value.str.len--;
 					break;
 				case '"':
@@ -991,7 +997,7 @@ restart:
 yymore_restart:
 
 
-#line 995 "Zend/zend_language_scanner.c"
+#line 1001 "Zend/zend_language_scanner.c"
 {
 	YYCTYPE yych;
 	unsigned int yyaccept = 0;
@@ -1090,7 +1096,7 @@ yyc_INITIAL:
 yy3:
 		YYDEBUG(3, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1784 "Zend/zend_language_scanner.l"
+#line 1790 "Zend/zend_language_scanner.l"
 		{
 	if (YYCURSOR > YYLIMIT) {
 		return 0;
@@ -1150,7 +1156,7 @@ inline_html:
 	HANDLE_NEWLINES(yytext, yyleng);
 	return T_INLINE_HTML;
 }
-#line 1154 "Zend/zend_language_scanner.c"
+#line 1160 "Zend/zend_language_scanner.c"
 yy4:
 		YYDEBUG(4, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1168,7 +1174,7 @@ yy5:
 yy6:
 		YYDEBUG(6, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1772 "Zend/zend_language_scanner.l"
+#line 1778 "Zend/zend_language_scanner.l"
 		{
 	if (CG(short_tags)) {
 		zendlval->value.str.val = yytext; /* no copying - intentional */
@@ -1180,14 +1186,14 @@ yy6:
 		goto inline_char_handler;
 	}
 }
-#line 1184 "Zend/zend_language_scanner.c"
+#line 1190 "Zend/zend_language_scanner.c"
 yy7:
 		YYDEBUG(7, *YYCURSOR);
 		++YYCURSOR;
 		if ((yych = *YYCURSOR) == '=') goto yy43;
 		YYDEBUG(8, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1749 "Zend/zend_language_scanner.l"
+#line 1755 "Zend/zend_language_scanner.l"
 		{
 	if (CG(asp_tags)) {
 		zendlval->value.str.val = yytext; /* no copying - intentional */
@@ -1199,7 +1205,7 @@ yy7:
 		goto inline_char_handler;
 	}
 }
-#line 1203 "Zend/zend_language_scanner.c"
+#line 1209 "Zend/zend_language_scanner.c"
 yy9:
 		YYDEBUG(9, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1385,7 +1391,7 @@ yy35:
 		++YYCURSOR;
 		YYDEBUG(38, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1709 "Zend/zend_language_scanner.l"
+#line 1715 "Zend/zend_language_scanner.l"
 		{
 	YYCTYPE *bracket = (YYCTYPE*)zend_memrchr(yytext, '<', yyleng - (sizeof("script language=php>") - 1));
 
@@ -1402,7 +1408,7 @@ yy35:
 	BEGIN(ST_IN_SCRIPTING);
 	return T_OPEN_TAG;
 }
-#line 1406 "Zend/zend_language_scanner.c"
+#line 1412 "Zend/zend_language_scanner.c"
 yy39:
 		YYDEBUG(39, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1429,7 +1435,7 @@ yy43:
 		++YYCURSOR;
 		YYDEBUG(44, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1727 "Zend/zend_language_scanner.l"
+#line 1733 "Zend/zend_language_scanner.l"
 		{
 	if (CG(asp_tags)) {
 		zendlval->value.str.val = yytext; /* no copying - intentional */
@@ -1441,13 +1447,13 @@ yy43:
 		goto inline_char_handler;
 	}
 }
-#line 1445 "Zend/zend_language_scanner.c"
+#line 1451 "Zend/zend_language_scanner.c"
 yy45:
 		YYDEBUG(45, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(46, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1740 "Zend/zend_language_scanner.l"
+#line 1746 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.str.val = yytext; /* no copying - intentional */
 	zendlval->value.str.len = yyleng;
@@ -1455,7 +1461,7 @@ yy45:
 	BEGIN(ST_IN_SCRIPTING);
 	return T_OPEN_TAG_WITH_ECHO;
 }
-#line 1459 "Zend/zend_language_scanner.c"
+#line 1465 "Zend/zend_language_scanner.c"
 yy47:
 		YYDEBUG(47, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1482,7 +1488,7 @@ yy50:
 yy51:
 		YYDEBUG(51, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1762 "Zend/zend_language_scanner.l"
+#line 1768 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.str.val = yytext; /* no copying - intentional */
 	zendlval->value.str.len = yyleng;
@@ -1491,7 +1497,7 @@ yy51:
 	BEGIN(ST_IN_SCRIPTING);
 	return T_OPEN_TAG;
 }
-#line 1495 "Zend/zend_language_scanner.c"
+#line 1501 "Zend/zend_language_scanner.c"
 yy52:
 		YYDEBUG(52, *YYCURSOR);
 		++YYCURSOR;
@@ -1562,7 +1568,7 @@ yyc_ST_BACKQUOTE:
 yy56:
 		YYDEBUG(56, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2235 "Zend/zend_language_scanner.l"
+#line 2241 "Zend/zend_language_scanner.l"
 		{
 	if (YYCURSOR > YYLIMIT) {
 		return 0;
@@ -1603,7 +1609,7 @@ yy56:
 	zend_scan_escape_string(zendlval, yytext, yyleng, '`' TSRMLS_CC);
 	return T_ENCAPSED_AND_WHITESPACE;
 }
-#line 1607 "Zend/zend_language_scanner.c"
+#line 1613 "Zend/zend_language_scanner.c"
 yy57:
 		YYDEBUG(57, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1614,12 +1620,12 @@ yy58:
 		++YYCURSOR;
 		YYDEBUG(59, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2179 "Zend/zend_language_scanner.l"
+#line 2185 "Zend/zend_language_scanner.l"
 		{
 	BEGIN(ST_IN_SCRIPTING);
 	return '`';
 }
-#line 1623 "Zend/zend_language_scanner.c"
+#line 1629 "Zend/zend_language_scanner.c"
 yy60:
 		YYDEBUG(60, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1629,14 +1635,14 @@ yy61:
 		++YYCURSOR;
 		YYDEBUG(62, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2166 "Zend/zend_language_scanner.l"
+#line 2172 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.lval = (long) '{';
 	yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
 	yyless(1);
 	return T_CURLY_OPEN;
 }
-#line 1640 "Zend/zend_language_scanner.c"
+#line 1646 "Zend/zend_language_scanner.c"
 yy63:
 		YYDEBUG(63, *YYCURSOR);
 		yyaccept = 0;
@@ -1652,24 +1658,24 @@ yy63:
 yy65:
 		YYDEBUG(65, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1866 "Zend/zend_language_scanner.l"
+#line 1872 "Zend/zend_language_scanner.l"
 		{
 	zend_copy_value(zendlval, (yytext+1), (yyleng-1));
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 1662 "Zend/zend_language_scanner.c"
+#line 1668 "Zend/zend_language_scanner.c"
 yy66:
 		YYDEBUG(66, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(67, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1442 "Zend/zend_language_scanner.l"
+#line 1448 "Zend/zend_language_scanner.l"
 		{
 	yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC);
 	return T_DOLLAR_OPEN_CURLY_BRACES;
 }
-#line 1673 "Zend/zend_language_scanner.c"
+#line 1679 "Zend/zend_language_scanner.c"
 yy68:
 		YYDEBUG(68, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1683,7 +1689,7 @@ yy70:
 		++YYCURSOR;
 		YYDEBUG(71, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1858 "Zend/zend_language_scanner.l"
+#line 1864 "Zend/zend_language_scanner.l"
 		{
 	yyless(yyleng - 1);
 	yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
@@ -1691,7 +1697,7 @@ yy70:
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 1695 "Zend/zend_language_scanner.c"
+#line 1701 "Zend/zend_language_scanner.c"
 yy72:
 		YYDEBUG(72, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1709,7 +1715,7 @@ yy73:
 		++YYCURSOR;
 		YYDEBUG(74, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1848 "Zend/zend_language_scanner.l"
+#line 1854 "Zend/zend_language_scanner.l"
 		{
 	yyless(yyleng - 3);
 	yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
@@ -1717,7 +1723,7 @@ yy73:
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 1721 "Zend/zend_language_scanner.c"
+#line 1727 "Zend/zend_language_scanner.c"
 	}
 /* *********************************** */
 yyc_ST_DOUBLE_QUOTES:
@@ -1785,7 +1791,7 @@ yy77:
 yy78:
 		YYDEBUG(78, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2185 "Zend/zend_language_scanner.l"
+#line 2191 "Zend/zend_language_scanner.l"
 		{
 	if (GET_DOUBLE_QUOTES_SCANNED_LENGTH()) {
 		YYCURSOR += GET_DOUBLE_QUOTES_SCANNED_LENGTH() - 1;
@@ -1834,7 +1840,7 @@ double_quotes_scan_done:
 	zend_scan_escape_string(zendlval, yytext, yyleng, '"' TSRMLS_CC);
 	return T_ENCAPSED_AND_WHITESPACE;
 }
-#line 1838 "Zend/zend_language_scanner.c"
+#line 1844 "Zend/zend_language_scanner.c"
 yy79:
 		YYDEBUG(79, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1845,12 +1851,12 @@ yy80:
 		++YYCURSOR;
 		YYDEBUG(81, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2174 "Zend/zend_language_scanner.l"
+#line 2180 "Zend/zend_language_scanner.l"
 		{
 	BEGIN(ST_IN_SCRIPTING);
 	return '"';
 }
-#line 1854 "Zend/zend_language_scanner.c"
+#line 1860 "Zend/zend_language_scanner.c"
 yy82:
 		YYDEBUG(82, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1860,14 +1866,14 @@ yy83:
 		++YYCURSOR;
 		YYDEBUG(84, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2166 "Zend/zend_language_scanner.l"
+#line 2172 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.lval = (long) '{';
 	yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
 	yyless(1);
 	return T_CURLY_OPEN;
 }
-#line 1871 "Zend/zend_language_scanner.c"
+#line 1877 "Zend/zend_language_scanner.c"
 yy85:
 		YYDEBUG(85, *YYCURSOR);
 		yyaccept = 0;
@@ -1883,24 +1889,24 @@ yy85:
 yy87:
 		YYDEBUG(87, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1866 "Zend/zend_language_scanner.l"
+#line 1872 "Zend/zend_language_scanner.l"
 		{
 	zend_copy_value(zendlval, (yytext+1), (yyleng-1));
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 1893 "Zend/zend_language_scanner.c"
+#line 1899 "Zend/zend_language_scanner.c"
 yy88:
 		YYDEBUG(88, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(89, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1442 "Zend/zend_language_scanner.l"
+#line 1448 "Zend/zend_language_scanner.l"
 		{
 	yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC);
 	return T_DOLLAR_OPEN_CURLY_BRACES;
 }
-#line 1904 "Zend/zend_language_scanner.c"
+#line 1910 "Zend/zend_language_scanner.c"
 yy90:
 		YYDEBUG(90, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1914,7 +1920,7 @@ yy92:
 		++YYCURSOR;
 		YYDEBUG(93, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1858 "Zend/zend_language_scanner.l"
+#line 1864 "Zend/zend_language_scanner.l"
 		{
 	yyless(yyleng - 1);
 	yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
@@ -1922,7 +1928,7 @@ yy92:
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 1926 "Zend/zend_language_scanner.c"
+#line 1932 "Zend/zend_language_scanner.c"
 yy94:
 		YYDEBUG(94, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -1940,7 +1946,7 @@ yy95:
 		++YYCURSOR;
 		YYDEBUG(96, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1848 "Zend/zend_language_scanner.l"
+#line 1854 "Zend/zend_language_scanner.l"
 		{
 	yyless(yyleng - 3);
 	yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
@@ -1948,7 +1954,7 @@ yy95:
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 1952 "Zend/zend_language_scanner.c"
+#line 1958 "Zend/zend_language_scanner.c"
 	}
 /* *********************************** */
 yyc_ST_END_HEREDOC:
@@ -1959,7 +1965,7 @@ yyc_ST_END_HEREDOC:
 	++YYCURSOR;
 	YYDEBUG(100, *YYCURSOR);
 	yyleng = YYCURSOR - SCNG(yy_text);
-#line 2153 "Zend/zend_language_scanner.l"
+#line 2159 "Zend/zend_language_scanner.l"
 	{
 	YYCURSOR += CG(heredoc_len) - 1;
 	yyleng = CG(heredoc_len);
@@ -1971,7 +1977,7 @@ yyc_ST_END_HEREDOC:
 	BEGIN(ST_IN_SCRIPTING);
 	return T_END_HEREDOC;
 }
-#line 1975 "Zend/zend_language_scanner.c"
+#line 1981 "Zend/zend_language_scanner.c"
 /* *********************************** */
 yyc_ST_HEREDOC:
 	{
@@ -2033,7 +2039,7 @@ yy103:
 yy104:
 		YYDEBUG(104, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2277 "Zend/zend_language_scanner.l"
+#line 2283 "Zend/zend_language_scanner.l"
 		{
 	int newline = 0;
 
@@ -2104,7 +2110,7 @@ heredoc_scan_done:
 	zend_scan_escape_string(zendlval, yytext, yyleng - newline, 0 TSRMLS_CC);
 	return T_ENCAPSED_AND_WHITESPACE;
 }
-#line 2108 "Zend/zend_language_scanner.c"
+#line 2114 "Zend/zend_language_scanner.c"
 yy105:
 		YYDEBUG(105, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -2119,14 +2125,14 @@ yy107:
 		++YYCURSOR;
 		YYDEBUG(108, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2166 "Zend/zend_language_scanner.l"
+#line 2172 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.lval = (long) '{';
 	yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
 	yyless(1);
 	return T_CURLY_OPEN;
 }
-#line 2130 "Zend/zend_language_scanner.c"
+#line 2136 "Zend/zend_language_scanner.c"
 yy109:
 		YYDEBUG(109, *YYCURSOR);
 		yyaccept = 0;
@@ -2142,24 +2148,24 @@ yy109:
 yy111:
 		YYDEBUG(111, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1866 "Zend/zend_language_scanner.l"
+#line 1872 "Zend/zend_language_scanner.l"
 		{
 	zend_copy_value(zendlval, (yytext+1), (yyleng-1));
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 2152 "Zend/zend_language_scanner.c"
+#line 2158 "Zend/zend_language_scanner.c"
 yy112:
 		YYDEBUG(112, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(113, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1442 "Zend/zend_language_scanner.l"
+#line 1448 "Zend/zend_language_scanner.l"
 		{
 	yy_push_state(ST_LOOKING_FOR_VARNAME TSRMLS_CC);
 	return T_DOLLAR_OPEN_CURLY_BRACES;
 }
-#line 2163 "Zend/zend_language_scanner.c"
+#line 2169 "Zend/zend_language_scanner.c"
 yy114:
 		YYDEBUG(114, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -2173,7 +2179,7 @@ yy116:
 		++YYCURSOR;
 		YYDEBUG(117, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1858 "Zend/zend_language_scanner.l"
+#line 1864 "Zend/zend_language_scanner.l"
 		{
 	yyless(yyleng - 1);
 	yy_push_state(ST_VAR_OFFSET TSRMLS_CC);
@@ -2181,7 +2187,7 @@ yy116:
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 2185 "Zend/zend_language_scanner.c"
+#line 2191 "Zend/zend_language_scanner.c"
 yy118:
 		YYDEBUG(118, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -2199,7 +2205,7 @@ yy119:
 		++YYCURSOR;
 		YYDEBUG(120, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1848 "Zend/zend_language_scanner.l"
+#line 1854 "Zend/zend_language_scanner.l"
 		{
 	yyless(yyleng - 3);
 	yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
@@ -2207,7 +2213,7 @@ yy119:
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 2211 "Zend/zend_language_scanner.c"
+#line 2217 "Zend/zend_language_scanner.c"
 	}
 /* *********************************** */
 yyc_ST_IN_SCRIPTING:
@@ -2388,13 +2394,13 @@ yy123:
 yy124:
 		YYDEBUG(124, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1889 "Zend/zend_language_scanner.l"
+#line 1895 "Zend/zend_language_scanner.l"
 		{
 	zend_copy_value(zendlval, yytext, yyleng);
 	zendlval->type = IS_STRING;
 	return T_STRING;
 }
-#line 2398 "Zend/zend_language_scanner.c"
+#line 2404 "Zend/zend_language_scanner.c"
 yy125:
 		YYDEBUG(125, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -2620,11 +2626,11 @@ yy137:
 yy138:
 		YYDEBUG(138, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1431 "Zend/zend_language_scanner.l"
+#line 1437 "Zend/zend_language_scanner.l"
 		{
 	return yytext[0];
 }
-#line 2628 "Zend/zend_language_scanner.c"
+#line 2634 "Zend/zend_language_scanner.c"
 yy139:
 		YYDEBUG(139, *YYCURSOR);
 		++YYCURSOR;
@@ -2633,7 +2639,7 @@ yy139:
 yy140:
 		YYDEBUG(140, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1162 "Zend/zend_language_scanner.l"
+#line 1168 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.str.val = yytext; /* no copying - intentional */
 	zendlval->value.str.len = yyleng;
@@ -2641,7 +2647,7 @@ yy140:
 	HANDLE_NEWLINES(yytext, yyleng);
 	return T_WHITESPACE;
 }
-#line 2645 "Zend/zend_language_scanner.c"
+#line 2651 "Zend/zend_language_scanner.c"
 yy141:
 		YYDEBUG(141, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -2652,11 +2658,11 @@ yy142:
 		++YYCURSOR;
 		YYDEBUG(143, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1191 "Zend/zend_language_scanner.l"
+#line 1197 "Zend/zend_language_scanner.l"
 		{
 	return T_NS_SEPARATOR;
 }
-#line 2660 "Zend/zend_language_scanner.c"
+#line 2666 "Zend/zend_language_scanner.c"
 yy144:
 		YYDEBUG(144, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -2884,18 +2890,18 @@ yy167:
 		++YYCURSOR;
 		YYDEBUG(168, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1436 "Zend/zend_language_scanner.l"
+#line 1442 "Zend/zend_language_scanner.l"
 		{
 	yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
 	return '{';
 }
-#line 2893 "Zend/zend_language_scanner.c"
+#line 2899 "Zend/zend_language_scanner.c"
 yy169:
 		YYDEBUG(169, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(170, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1448 "Zend/zend_language_scanner.l"
+#line 1454 "Zend/zend_language_scanner.l"
 		{
 	RESET_DOC_COMMENT();
 	if (!zend_stack_is_empty(&SCNG(state_stack))) {
@@ -2903,7 +2909,7 @@ yy169:
 	}
 	return '}';
 }
-#line 2907 "Zend/zend_language_scanner.c"
+#line 2913 "Zend/zend_language_scanner.c"
 yy171:
 		YYDEBUG(171, *YYCURSOR);
 		yyaccept = 2;
@@ -2931,7 +2937,7 @@ yy171:
 yy172:
 		YYDEBUG(172, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1499 "Zend/zend_language_scanner.l"
+#line 1505 "Zend/zend_language_scanner.l"
 		{
 	if (yyleng < MAX_LENGTH_OF_LONG - 1) { /* Won't overflow */
 		zendlval->value.lval = strtol(yytext, NULL, 0);
@@ -2952,7 +2958,7 @@ yy172:
 	zendlval->type = IS_LONG;
 	return T_LNUMBER;
 }
-#line 2956 "Zend/zend_language_scanner.c"
+#line 2962 "Zend/zend_language_scanner.c"
 yy173:
 		YYDEBUG(173, *YYCURSOR);
 		yyaccept = 2;
@@ -2980,7 +2986,7 @@ yy175:
 yy176:
 		YYDEBUG(176, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1896 "Zend/zend_language_scanner.l"
+#line 1902 "Zend/zend_language_scanner.l"
 		{
 	while (YYCURSOR < YYLIMIT) {
 		switch (*YYCURSOR++) {
@@ -3014,14 +3020,14 @@ yy176:
 
 	return T_COMMENT;
 }
-#line 3018 "Zend/zend_language_scanner.c"
+#line 3024 "Zend/zend_language_scanner.c"
 yy177:
 		YYDEBUG(177, *YYCURSOR);
 		++YYCURSOR;
 yy178:
 		YYDEBUG(178, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1987 "Zend/zend_language_scanner.l"
+#line 1993 "Zend/zend_language_scanner.l"
 		{
 	register char *s, *t;
 	char *end;
@@ -3089,14 +3095,14 @@ yy178:
 	}
 	return T_CONSTANT_ENCAPSED_STRING;
 }
-#line 3093 "Zend/zend_language_scanner.c"
+#line 3099 "Zend/zend_language_scanner.c"
 yy179:
 		YYDEBUG(179, *YYCURSOR);
 		++YYCURSOR;
 yy180:
 		YYDEBUG(180, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2056 "Zend/zend_language_scanner.l"
+#line 2062 "Zend/zend_language_scanner.l"
 		{
 	int bprefix = (yytext[0] != '"') ? 1 : 0;
 
@@ -3137,24 +3143,24 @@ yy180:
 	BEGIN(ST_DOUBLE_QUOTES);
 	return '"';
 }
-#line 3141 "Zend/zend_language_scanner.c"
+#line 3147 "Zend/zend_language_scanner.c"
 yy181:
 		YYDEBUG(181, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(182, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2147 "Zend/zend_language_scanner.l"
+#line 2153 "Zend/zend_language_scanner.l"
 		{
 	BEGIN(ST_BACKQUOTE);
 	return '`';
 }
-#line 3152 "Zend/zend_language_scanner.c"
+#line 3158 "Zend/zend_language_scanner.c"
 yy183:
 		YYDEBUG(183, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(184, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2405 "Zend/zend_language_scanner.l"
+#line 2411 "Zend/zend_language_scanner.l"
 		{
 	if (YYCURSOR > YYLIMIT) {
 		return 0;
@@ -3163,7 +3169,7 @@ yy183:
 	zend_error(E_COMPILE_WARNING,"Unexpected character in input:  '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE);
 	goto restart;
 }
-#line 3167 "Zend/zend_language_scanner.c"
+#line 3173 "Zend/zend_language_scanner.c"
 yy185:
 		YYDEBUG(185, *YYCURSOR);
 		++YYCURSOR;
@@ -3190,13 +3196,13 @@ yy187:
 yy189:
 		YYDEBUG(189, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1564 "Zend/zend_language_scanner.l"
+#line 1570 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.dval = zend_strtod(yytext, NULL);
 	zendlval->type = IS_DOUBLE;
 	return T_DNUMBER;
 }
-#line 3200 "Zend/zend_language_scanner.c"
+#line 3206 "Zend/zend_language_scanner.c"
 yy190:
 		YYDEBUG(190, *YYCURSOR);
 		yyaccept = 2;
@@ -3288,7 +3294,7 @@ yy199:
 		}
 		YYDEBUG(201, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1474 "Zend/zend_language_scanner.l"
+#line 1480 "Zend/zend_language_scanner.l"
 		{
 	char *bin = yytext + 2; /* Skip "0b" */
 	int len = yyleng - 2;
@@ -3313,7 +3319,7 @@ yy199:
 		return T_DNUMBER;
 	}
 }
-#line 3317 "Zend/zend_language_scanner.c"
+#line 3323 "Zend/zend_language_scanner.c"
 yy202:
 		YYDEBUG(202, *YYCURSOR);
 		++YYCURSOR;
@@ -3325,7 +3331,7 @@ yy202:
 		}
 		YYDEBUG(204, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1520 "Zend/zend_language_scanner.l"
+#line 1526 "Zend/zend_language_scanner.l"
 		{
 	char *hex = yytext + 2; /* Skip "0x" */
 	int len = yyleng - 2;
@@ -3350,7 +3356,7 @@ yy202:
 		return T_DNUMBER;
 	}
 }
-#line 3354 "Zend/zend_language_scanner.c"
+#line 3360 "Zend/zend_language_scanner.c"
 yy205:
 		YYDEBUG(205, *YYCURSOR);
 		++YYCURSOR;
@@ -3359,7 +3365,7 @@ yy205:
 yy206:
 		YYDEBUG(206, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1964 "Zend/zend_language_scanner.l"
+#line 1970 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.str.val = yytext; /* no copying - intentional */
 	zendlval->value.str.len = yyleng;
@@ -3367,7 +3373,7 @@ yy206:
 	BEGIN(INITIAL);
 	return T_CLOSE_TAG;  /* implicit ';' at php-end tag */
 }
-#line 3371 "Zend/zend_language_scanner.c"
+#line 3377 "Zend/zend_language_scanner.c"
 yy207:
 		YYDEBUG(207, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -3401,13 +3407,13 @@ yy209:
 yy211:
 		YYDEBUG(211, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1866 "Zend/zend_language_scanner.l"
+#line 1872 "Zend/zend_language_scanner.l"
 		{
 	zend_copy_value(zendlval, (yytext+1), (yyleng-1));
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 3411 "Zend/zend_language_scanner.c"
+#line 3417 "Zend/zend_language_scanner.c"
 yy212:
 		YYDEBUG(212, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -3421,11 +3427,11 @@ yy213:
 		}
 		YYDEBUG(214, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1419 "Zend/zend_language_scanner.l"
+#line 1425 "Zend/zend_language_scanner.l"
 		{
 	return T_LOGICAL_XOR;
 }
-#line 3429 "Zend/zend_language_scanner.c"
+#line 3435 "Zend/zend_language_scanner.c"
 yy215:
 		YYDEBUG(215, *YYCURSOR);
 		++YYCURSOR;
@@ -3434,61 +3440,61 @@ yy215:
 		}
 		YYDEBUG(216, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1411 "Zend/zend_language_scanner.l"
+#line 1417 "Zend/zend_language_scanner.l"
 		{
 	return T_LOGICAL_OR;
 }
-#line 3442 "Zend/zend_language_scanner.c"
+#line 3448 "Zend/zend_language_scanner.c"
 yy217:
 		YYDEBUG(217, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(218, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1399 "Zend/zend_language_scanner.l"
+#line 1405 "Zend/zend_language_scanner.l"
 		{
 	return T_XOR_EQUAL;
 }
-#line 3452 "Zend/zend_language_scanner.c"
+#line 3458 "Zend/zend_language_scanner.c"
 yy219:
 		YYDEBUG(219, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(220, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1403 "Zend/zend_language_scanner.l"
+#line 1409 "Zend/zend_language_scanner.l"
 		{
 	return T_BOOLEAN_OR;
 }
-#line 3462 "Zend/zend_language_scanner.c"
+#line 3468 "Zend/zend_language_scanner.c"
 yy221:
 		YYDEBUG(221, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(222, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1395 "Zend/zend_language_scanner.l"
+#line 1401 "Zend/zend_language_scanner.l"
 		{
 	return T_OR_EQUAL;
 }
-#line 3472 "Zend/zend_language_scanner.c"
+#line 3478 "Zend/zend_language_scanner.c"
 yy223:
 		YYDEBUG(223, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(224, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1407 "Zend/zend_language_scanner.l"
+#line 1413 "Zend/zend_language_scanner.l"
 		{
 	return T_BOOLEAN_AND;
 }
-#line 3482 "Zend/zend_language_scanner.c"
+#line 3488 "Zend/zend_language_scanner.c"
 yy225:
 		YYDEBUG(225, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(226, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1391 "Zend/zend_language_scanner.l"
+#line 1397 "Zend/zend_language_scanner.l"
 		{
 	return T_AND_EQUAL;
 }
-#line 3492 "Zend/zend_language_scanner.c"
+#line 3498 "Zend/zend_language_scanner.c"
 yy227:
 		YYDEBUG(227, *YYCURSOR);
 		++YYCURSOR;
@@ -3497,7 +3503,7 @@ yy227:
 yy228:
 		YYDEBUG(228, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1973 "Zend/zend_language_scanner.l"
+#line 1979 "Zend/zend_language_scanner.l"
 		{
 	if (CG(asp_tags)) {
 		BEGIN(INITIAL);
@@ -3510,17 +3516,17 @@ yy228:
 		return yytext[0];
 	}
 }
-#line 3514 "Zend/zend_language_scanner.c"
+#line 3520 "Zend/zend_language_scanner.c"
 yy229:
 		YYDEBUG(229, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(230, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1379 "Zend/zend_language_scanner.l"
+#line 1385 "Zend/zend_language_scanner.l"
 		{
 	return T_MOD_EQUAL;
 }
-#line 3524 "Zend/zend_language_scanner.c"
+#line 3530 "Zend/zend_language_scanner.c"
 yy231:
 		YYDEBUG(231, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -3551,11 +3557,11 @@ yy235:
 		++YYCURSOR;
 		YYDEBUG(236, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1375 "Zend/zend_language_scanner.l"
+#line 1381 "Zend/zend_language_scanner.l"
 		{
 	return T_CONCAT_EQUAL;
 }
-#line 3559 "Zend/zend_language_scanner.c"
+#line 3565 "Zend/zend_language_scanner.c"
 yy237:
 		YYDEBUG(237, *YYCURSOR);
 		yyaccept = 4;
@@ -3564,7 +3570,7 @@ yy237:
 yy238:
 		YYDEBUG(238, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1930 "Zend/zend_language_scanner.l"
+#line 1936 "Zend/zend_language_scanner.l"
 		{
 	int doc_com;
 
@@ -3598,7 +3604,7 @@ yy238:
 
 	return T_COMMENT;
 }
-#line 3602 "Zend/zend_language_scanner.c"
+#line 3608 "Zend/zend_language_scanner.c"
 yy239:
 		YYDEBUG(239, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -3608,11 +3614,11 @@ yy240:
 		++YYCURSOR;
 		YYDEBUG(241, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1371 "Zend/zend_language_scanner.l"
+#line 1377 "Zend/zend_language_scanner.l"
 		{
 	return T_DIV_EQUAL;
 }
-#line 3616 "Zend/zend_language_scanner.c"
+#line 3622 "Zend/zend_language_scanner.c"
 yy242:
 		YYDEBUG(242, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -3635,42 +3641,42 @@ yy245:
 		++YYCURSOR;
 		YYDEBUG(246, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1367 "Zend/zend_language_scanner.l"
+#line 1373 "Zend/zend_language_scanner.l"
 		{
 	return T_MUL_EQUAL;
 }
-#line 3643 "Zend/zend_language_scanner.c"
+#line 3649 "Zend/zend_language_scanner.c"
 yy247:
 		YYDEBUG(247, *YYCURSOR);
 		++YYCURSOR;
 		if ((yych = *YYCURSOR) == '=') goto yy251;
 		YYDEBUG(248, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1427 "Zend/zend_language_scanner.l"
+#line 1433 "Zend/zend_language_scanner.l"
 		{
 	return T_SR;
 }
-#line 3654 "Zend/zend_language_scanner.c"
+#line 3660 "Zend/zend_language_scanner.c"
 yy249:
 		YYDEBUG(249, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(250, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1355 "Zend/zend_language_scanner.l"
+#line 1361 "Zend/zend_language_scanner.l"
 		{
 	return T_IS_GREATER_OR_EQUAL;
 }
-#line 3664 "Zend/zend_language_scanner.c"
+#line 3670 "Zend/zend_language_scanner.c"
 yy251:
 		YYDEBUG(251, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(252, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1387 "Zend/zend_language_scanner.l"
+#line 1393 "Zend/zend_language_scanner.l"
 		{
 	return T_SR_EQUAL;
 }
-#line 3674 "Zend/zend_language_scanner.c"
+#line 3680 "Zend/zend_language_scanner.c"
 yy253:
 		YYDEBUG(253, *YYCURSOR);
 		yyaccept = 5;
@@ -3681,11 +3687,11 @@ yy253:
 yy254:
 		YYDEBUG(254, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1423 "Zend/zend_language_scanner.l"
+#line 1429 "Zend/zend_language_scanner.l"
 		{
 	return T_SL;
 }
-#line 3689 "Zend/zend_language_scanner.c"
+#line 3695 "Zend/zend_language_scanner.c"
 yy255:
 		YYDEBUG(255, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -3697,22 +3703,22 @@ yy256:
 		++YYCURSOR;
 		YYDEBUG(257, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1351 "Zend/zend_language_scanner.l"
+#line 1357 "Zend/zend_language_scanner.l"
 		{
 	return T_IS_SMALLER_OR_EQUAL;
 }
-#line 3705 "Zend/zend_language_scanner.c"
+#line 3711 "Zend/zend_language_scanner.c"
 yy258:
 		YYDEBUG(258, *YYCURSOR);
 		++YYCURSOR;
 yy259:
 		YYDEBUG(259, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1347 "Zend/zend_language_scanner.l"
+#line 1353 "Zend/zend_language_scanner.l"
 		{
 	return T_IS_NOT_EQUAL;
 }
-#line 3716 "Zend/zend_language_scanner.c"
+#line 3722 "Zend/zend_language_scanner.c"
 yy260:
 		YYDEBUG(260, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -3763,11 +3769,11 @@ yy267:
 		++YYCURSOR;
 		YYDEBUG(268, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1383 "Zend/zend_language_scanner.l"
+#line 1389 "Zend/zend_language_scanner.l"
 		{
 	return T_SL_EQUAL;
 }
-#line 3771 "Zend/zend_language_scanner.c"
+#line 3777 "Zend/zend_language_scanner.c"
 yy269:
 		YYDEBUG(269, *YYCURSOR);
 		++YYCURSOR;
@@ -3872,7 +3878,7 @@ yy278:
 yy279:
 		YYDEBUG(279, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2098 "Zend/zend_language_scanner.l"
+#line 2104 "Zend/zend_language_scanner.l"
 		{
 	char *s;
 	int bprefix = (yytext[0] != '<') ? 1 : 0;
@@ -3920,7 +3926,7 @@ yy279:
 
 	return T_START_HEREDOC;
 }
-#line 3924 "Zend/zend_language_scanner.c"
+#line 3930 "Zend/zend_language_scanner.c"
 yy280:
 		YYDEBUG(280, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -3960,31 +3966,31 @@ yy283:
 		++YYCURSOR;
 		YYDEBUG(285, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1339 "Zend/zend_language_scanner.l"
+#line 1345 "Zend/zend_language_scanner.l"
 		{
 	return T_IS_NOT_IDENTICAL;
 }
-#line 3968 "Zend/zend_language_scanner.c"
+#line 3974 "Zend/zend_language_scanner.c"
 yy286:
 		YYDEBUG(286, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(287, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1359 "Zend/zend_language_scanner.l"
+#line 1365 "Zend/zend_language_scanner.l"
 		{
 	return T_PLUS_EQUAL;
 }
-#line 3978 "Zend/zend_language_scanner.c"
+#line 3984 "Zend/zend_language_scanner.c"
 yy288:
 		YYDEBUG(288, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(289, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1327 "Zend/zend_language_scanner.l"
+#line 1333 "Zend/zend_language_scanner.l"
 		{
 	return T_INC;
 }
-#line 3988 "Zend/zend_language_scanner.c"
+#line 3994 "Zend/zend_language_scanner.c"
 yy290:
 		YYDEBUG(290, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4003,42 +4009,42 @@ yy292:
 		}
 		YYDEBUG(293, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1315 "Zend/zend_language_scanner.l"
+#line 1321 "Zend/zend_language_scanner.l"
 		{
 	return T_LIST;
 }
-#line 4011 "Zend/zend_language_scanner.c"
+#line 4017 "Zend/zend_language_scanner.c"
 yy294:
 		YYDEBUG(294, *YYCURSOR);
 		++YYCURSOR;
 		if ((yych = *YYCURSOR) == '=') goto yy298;
 		YYDEBUG(295, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1343 "Zend/zend_language_scanner.l"
+#line 1349 "Zend/zend_language_scanner.l"
 		{
 	return T_IS_EQUAL;
 }
-#line 4022 "Zend/zend_language_scanner.c"
+#line 4028 "Zend/zend_language_scanner.c"
 yy296:
 		YYDEBUG(296, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(297, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1311 "Zend/zend_language_scanner.l"
+#line 1317 "Zend/zend_language_scanner.l"
 		{
 	return T_DOUBLE_ARROW;
 }
-#line 4032 "Zend/zend_language_scanner.c"
+#line 4038 "Zend/zend_language_scanner.c"
 yy298:
 		YYDEBUG(298, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(299, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1335 "Zend/zend_language_scanner.l"
+#line 1341 "Zend/zend_language_scanner.l"
 		{
 	return T_IS_IDENTICAL;
 }
-#line 4042 "Zend/zend_language_scanner.c"
+#line 4048 "Zend/zend_language_scanner.c"
 yy300:
 		YYDEBUG(300, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4168,7 +4174,7 @@ yy316:
 		}
 		YYDEBUG(319, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1699 "Zend/zend_language_scanner.l"
+#line 1705 "Zend/zend_language_scanner.l"
 		{
 	if (CG(current_namespace)) {
 		*zendlval = *CG(current_namespace);
@@ -4178,7 +4184,7 @@ yy316:
 	}
 	return T_NS_C;
 }
-#line 4182 "Zend/zend_language_scanner.c"
+#line 4188 "Zend/zend_language_scanner.c"
 yy320:
 		YYDEBUG(320, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4198,7 +4204,7 @@ yy321:
 		}
 		YYDEBUG(324, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1672 "Zend/zend_language_scanner.l"
+#line 1678 "Zend/zend_language_scanner.l"
 		{
 	char *filename = zend_get_compiled_filename(TSRMLS_C);
 	const size_t filename_len = strlen(filename);
@@ -4225,7 +4231,7 @@ yy321:
 	zendlval->type = IS_STRING;
 	return T_DIR;
 }
-#line 4229 "Zend/zend_language_scanner.c"
+#line 4235 "Zend/zend_language_scanner.c"
 yy325:
 		YYDEBUG(325, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4250,13 +4256,13 @@ yy327:
 		}
 		YYDEBUG(330, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1654 "Zend/zend_language_scanner.l"
+#line 1660 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.lval = CG(zend_lineno);
 	zendlval->type = IS_LONG;
 	return T_LINE;
 }
-#line 4260 "Zend/zend_language_scanner.c"
+#line 4266 "Zend/zend_language_scanner.c"
 yy331:
 		YYDEBUG(331, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4291,7 +4297,7 @@ yy335:
 		}
 		YYDEBUG(338, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1633 "Zend/zend_language_scanner.l"
+#line 1639 "Zend/zend_language_scanner.l"
 		{
 	const char *class_name = CG(active_class_entry) ? CG(active_class_entry)->name : NULL;
 	const char *func_name = CG(active_op_array)? CG(active_op_array)->function_name : NULL;
@@ -4312,7 +4318,7 @@ yy335:
 	zendlval->type = IS_STRING;
 	return T_METHOD_C;
 }
-#line 4316 "Zend/zend_language_scanner.c"
+#line 4322 "Zend/zend_language_scanner.c"
 yy339:
 		YYDEBUG(339, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4363,7 +4369,7 @@ yy346:
 		}
 		YYDEBUG(349, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1617 "Zend/zend_language_scanner.l"
+#line 1623 "Zend/zend_language_scanner.l"
 		{
 	const char *func_name = NULL;
 
@@ -4379,7 +4385,7 @@ yy346:
 	zendlval->type = IS_STRING;
 	return T_FUNC_C;
 }
-#line 4383 "Zend/zend_language_scanner.c"
+#line 4389 "Zend/zend_language_scanner.c"
 yy350:
 		YYDEBUG(350, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4399,7 +4405,7 @@ yy351:
 		}
 		YYDEBUG(354, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1660 "Zend/zend_language_scanner.l"
+#line 1666 "Zend/zend_language_scanner.l"
 		{
 	char *filename = zend_get_compiled_filename(TSRMLS_C);
 
@@ -4411,7 +4417,7 @@ yy351:
 	zendlval->type = IS_STRING;
 	return T_FILE;
 }
-#line 4415 "Zend/zend_language_scanner.c"
+#line 4421 "Zend/zend_language_scanner.c"
 yy355:
 		YYDEBUG(355, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4441,7 +4447,7 @@ yy358:
 		}
 		YYDEBUG(361, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1597 "Zend/zend_language_scanner.l"
+#line 1603 "Zend/zend_language_scanner.l"
 		{
 	const char *trait_name = NULL;
 	
@@ -4461,7 +4467,7 @@ yy358:
 	
 	return T_TRAIT_C;
 }
-#line 4465 "Zend/zend_language_scanner.c"
+#line 4471 "Zend/zend_language_scanner.c"
 yy362:
 		YYDEBUG(362, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4491,7 +4497,7 @@ yy365:
 		}
 		YYDEBUG(368, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1570 "Zend/zend_language_scanner.l"
+#line 1576 "Zend/zend_language_scanner.l"
 		{
 	const char *class_name = NULL;
 	
@@ -4518,7 +4524,7 @@ yy365:
 	}
 	return T_CLASS_C;
 }
-#line 4522 "Zend/zend_language_scanner.c"
+#line 4528 "Zend/zend_language_scanner.c"
 yy369:
 		YYDEBUG(369, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4580,11 +4586,11 @@ yy380:
 		}
 		YYDEBUG(381, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1279 "Zend/zend_language_scanner.l"
+#line 1285 "Zend/zend_language_scanner.l"
 		{
 	return T_HALT_COMPILER;
 }
-#line 4588 "Zend/zend_language_scanner.c"
+#line 4594 "Zend/zend_language_scanner.c"
 yy382:
 		YYDEBUG(382, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4604,11 +4610,11 @@ yy384:
 		}
 		YYDEBUG(385, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1259 "Zend/zend_language_scanner.l"
+#line 1265 "Zend/zend_language_scanner.l"
 		{
 	return T_USE;
 }
-#line 4612 "Zend/zend_language_scanner.c"
+#line 4618 "Zend/zend_language_scanner.c"
 yy386:
 		YYDEBUG(386, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4627,11 +4633,11 @@ yy388:
 		}
 		YYDEBUG(389, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1307 "Zend/zend_language_scanner.l"
+#line 1313 "Zend/zend_language_scanner.l"
 		{
 	return T_UNSET;
 }
-#line 4635 "Zend/zend_language_scanner.c"
+#line 4641 "Zend/zend_language_scanner.c"
 yy390:
 		YYDEBUG(390, *YYCURSOR);
 		++YYCURSOR;
@@ -4803,11 +4809,11 @@ yy405:
 		++YYCURSOR;
 		YYDEBUG(407, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1207 "Zend/zend_language_scanner.l"
+#line 1213 "Zend/zend_language_scanner.l"
 		{
 	return T_INT_CAST;
 }
-#line 4811 "Zend/zend_language_scanner.c"
+#line 4817 "Zend/zend_language_scanner.c"
 yy408:
 		YYDEBUG(408, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4851,11 +4857,11 @@ yy413:
 		++YYCURSOR;
 		YYDEBUG(416, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1211 "Zend/zend_language_scanner.l"
+#line 1217 "Zend/zend_language_scanner.l"
 		{
 	return T_DOUBLE_CAST;
 }
-#line 4859 "Zend/zend_language_scanner.c"
+#line 4865 "Zend/zend_language_scanner.c"
 yy417:
 		YYDEBUG(417, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4925,11 +4931,11 @@ yy427:
 		++YYCURSOR;
 		YYDEBUG(430, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1215 "Zend/zend_language_scanner.l"
+#line 1221 "Zend/zend_language_scanner.l"
 		{
 	return T_STRING_CAST;
 }
-#line 4933 "Zend/zend_language_scanner.c"
+#line 4939 "Zend/zend_language_scanner.c"
 yy431:
 		YYDEBUG(431, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -4962,11 +4968,11 @@ yy434:
 		++YYCURSOR;
 		YYDEBUG(437, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1219 "Zend/zend_language_scanner.l"
+#line 1225 "Zend/zend_language_scanner.l"
 		{
 	return T_ARRAY_CAST;
 }
-#line 4970 "Zend/zend_language_scanner.c"
+#line 4976 "Zend/zend_language_scanner.c"
 yy438:
 		YYDEBUG(438, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5004,11 +5010,11 @@ yy442:
 		++YYCURSOR;
 		YYDEBUG(445, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1223 "Zend/zend_language_scanner.l"
+#line 1229 "Zend/zend_language_scanner.l"
 		{
 	return T_OBJECT_CAST;
 }
-#line 5012 "Zend/zend_language_scanner.c"
+#line 5018 "Zend/zend_language_scanner.c"
 yy446:
 		YYDEBUG(446, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5049,11 +5055,11 @@ yy451:
 		++YYCURSOR;
 		YYDEBUG(453, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1227 "Zend/zend_language_scanner.l"
+#line 1233 "Zend/zend_language_scanner.l"
 		{
 	return T_BOOL_CAST;
 }
-#line 5057 "Zend/zend_language_scanner.c"
+#line 5063 "Zend/zend_language_scanner.c"
 yy454:
 		YYDEBUG(454, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5113,11 +5119,11 @@ yy462:
 		++YYCURSOR;
 		YYDEBUG(465, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1231 "Zend/zend_language_scanner.l"
+#line 1237 "Zend/zend_language_scanner.l"
 		{
 	return T_UNSET_CAST;
 }
-#line 5121 "Zend/zend_language_scanner.c"
+#line 5127 "Zend/zend_language_scanner.c"
 yy466:
 		YYDEBUG(466, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5131,11 +5137,11 @@ yy467:
 		}
 		YYDEBUG(468, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1203 "Zend/zend_language_scanner.l"
+#line 1209 "Zend/zend_language_scanner.l"
 		{
 	return T_VAR;
 }
-#line 5139 "Zend/zend_language_scanner.c"
+#line 5145 "Zend/zend_language_scanner.c"
 yy469:
 		YYDEBUG(469, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5155,11 +5161,11 @@ yy471:
 		}
 		YYDEBUG(472, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1195 "Zend/zend_language_scanner.l"
+#line 1201 "Zend/zend_language_scanner.l"
 		{
 	return T_NEW;
 }
-#line 5163 "Zend/zend_language_scanner.c"
+#line 5169 "Zend/zend_language_scanner.c"
 yy473:
 		YYDEBUG(473, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5198,21 +5204,21 @@ yy479:
 		}
 		YYDEBUG(480, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1255 "Zend/zend_language_scanner.l"
+#line 1261 "Zend/zend_language_scanner.l"
 		{
 	return T_NAMESPACE;
 }
-#line 5206 "Zend/zend_language_scanner.c"
+#line 5212 "Zend/zend_language_scanner.c"
 yy481:
 		YYDEBUG(481, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(482, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1187 "Zend/zend_language_scanner.l"
+#line 1193 "Zend/zend_language_scanner.l"
 		{
 	return T_PAAMAYIM_NEKUDOTAYIM;
 }
-#line 5216 "Zend/zend_language_scanner.c"
+#line 5222 "Zend/zend_language_scanner.c"
 yy483:
 		YYDEBUG(483, *YYCURSOR);
 		++YYCURSOR;
@@ -5234,32 +5240,32 @@ yy485:
 		++YYCURSOR;
 		YYDEBUG(486, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1363 "Zend/zend_language_scanner.l"
+#line 1369 "Zend/zend_language_scanner.l"
 		{
 	return T_MINUS_EQUAL;
 }
-#line 5242 "Zend/zend_language_scanner.c"
+#line 5248 "Zend/zend_language_scanner.c"
 yy487:
 		YYDEBUG(487, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(488, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1331 "Zend/zend_language_scanner.l"
+#line 1337 "Zend/zend_language_scanner.l"
 		{
 	return T_DEC;
 }
-#line 5252 "Zend/zend_language_scanner.c"
+#line 5258 "Zend/zend_language_scanner.c"
 yy489:
 		YYDEBUG(489, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(490, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1157 "Zend/zend_language_scanner.l"
+#line 1163 "Zend/zend_language_scanner.l"
 		{
 	yy_push_state(ST_LOOKING_FOR_PROPERTY TSRMLS_CC);
 	return T_OBJECT_OPERATOR;
 }
-#line 5263 "Zend/zend_language_scanner.c"
+#line 5269 "Zend/zend_language_scanner.c"
 yy491:
 		YYDEBUG(491, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5304,11 +5310,11 @@ yy496:
 		}
 		YYDEBUG(497, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1303 "Zend/zend_language_scanner.l"
+#line 1309 "Zend/zend_language_scanner.l"
 		{
 	return T_PUBLIC;
 }
-#line 5312 "Zend/zend_language_scanner.c"
+#line 5318 "Zend/zend_language_scanner.c"
 yy498:
 		YYDEBUG(498, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5363,11 +5369,11 @@ yy505:
 		}
 		YYDEBUG(506, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1299 "Zend/zend_language_scanner.l"
+#line 1305 "Zend/zend_language_scanner.l"
 		{
 	return T_PROTECTED;
 }
-#line 5371 "Zend/zend_language_scanner.c"
+#line 5377 "Zend/zend_language_scanner.c"
 yy507:
 		YYDEBUG(507, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5397,11 +5403,11 @@ yy511:
 		}
 		YYDEBUG(512, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1295 "Zend/zend_language_scanner.l"
+#line 1301 "Zend/zend_language_scanner.l"
 		{
 	return T_PRIVATE;
 }
-#line 5405 "Zend/zend_language_scanner.c"
+#line 5411 "Zend/zend_language_scanner.c"
 yy513:
 		YYDEBUG(513, *YYCURSOR);
 		++YYCURSOR;
@@ -5410,11 +5416,11 @@ yy513:
 		}
 		YYDEBUG(514, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1133 "Zend/zend_language_scanner.l"
+#line 1139 "Zend/zend_language_scanner.l"
 		{
 	return T_PRINT;
 }
-#line 5418 "Zend/zend_language_scanner.c"
+#line 5424 "Zend/zend_language_scanner.c"
 yy515:
 		YYDEBUG(515, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5439,11 +5445,11 @@ yy518:
 		}
 		YYDEBUG(519, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1125 "Zend/zend_language_scanner.l"
+#line 1131 "Zend/zend_language_scanner.l"
 		{
 	return T_GOTO;
 }
-#line 5447 "Zend/zend_language_scanner.c"
+#line 5453 "Zend/zend_language_scanner.c"
 yy520:
 		YYDEBUG(520, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5467,11 +5473,11 @@ yy523:
 		}
 		YYDEBUG(524, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1267 "Zend/zend_language_scanner.l"
+#line 1273 "Zend/zend_language_scanner.l"
 		{
 	return T_GLOBAL;
 }
-#line 5475 "Zend/zend_language_scanner.c"
+#line 5481 "Zend/zend_language_scanner.c"
 yy525:
 		YYDEBUG(525, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5508,11 +5514,11 @@ yy531:
 		}
 		YYDEBUG(532, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1117 "Zend/zend_language_scanner.l"
+#line 1123 "Zend/zend_language_scanner.l"
 		{
 	return T_BREAK;
 }
-#line 5516 "Zend/zend_language_scanner.c"
+#line 5522 "Zend/zend_language_scanner.c"
 yy533:
 		YYDEBUG(533, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5552,11 +5558,11 @@ yy539:
 		}
 		YYDEBUG(540, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1101 "Zend/zend_language_scanner.l"
+#line 1107 "Zend/zend_language_scanner.l"
 		{
 	return T_SWITCH;
 }
-#line 5560 "Zend/zend_language_scanner.c"
+#line 5566 "Zend/zend_language_scanner.c"
 yy541:
 		YYDEBUG(541, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5580,11 +5586,11 @@ yy544:
 		}
 		YYDEBUG(545, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1283 "Zend/zend_language_scanner.l"
+#line 1289 "Zend/zend_language_scanner.l"
 		{
 	return T_STATIC;
 }
-#line 5588 "Zend/zend_language_scanner.c"
+#line 5594 "Zend/zend_language_scanner.c"
 yy546:
 		YYDEBUG(546, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5611,11 +5617,11 @@ yy549:
 		}
 		YYDEBUG(550, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1097 "Zend/zend_language_scanner.l"
+#line 1103 "Zend/zend_language_scanner.l"
 		{
 	return T_AS;
 }
-#line 5619 "Zend/zend_language_scanner.c"
+#line 5625 "Zend/zend_language_scanner.c"
 yy551:
 		YYDEBUG(551, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5634,11 +5640,11 @@ yy553:
 		}
 		YYDEBUG(554, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1319 "Zend/zend_language_scanner.l"
+#line 1325 "Zend/zend_language_scanner.l"
 		{
 	return T_ARRAY;
 }
-#line 5642 "Zend/zend_language_scanner.c"
+#line 5648 "Zend/zend_language_scanner.c"
 yy555:
 		YYDEBUG(555, *YYCURSOR);
 		++YYCURSOR;
@@ -5647,11 +5653,11 @@ yy555:
 		}
 		YYDEBUG(556, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1415 "Zend/zend_language_scanner.l"
+#line 1421 "Zend/zend_language_scanner.l"
 		{
 	return T_LOGICAL_AND;
 }
-#line 5655 "Zend/zend_language_scanner.c"
+#line 5661 "Zend/zend_language_scanner.c"
 yy557:
 		YYDEBUG(557, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5685,11 +5691,11 @@ yy562:
 		}
 		YYDEBUG(563, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1287 "Zend/zend_language_scanner.l"
+#line 1293 "Zend/zend_language_scanner.l"
 		{
 	return T_ABSTRACT;
 }
-#line 5693 "Zend/zend_language_scanner.c"
+#line 5699 "Zend/zend_language_scanner.c"
 yy564:
 		YYDEBUG(564, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5713,11 +5719,11 @@ yy567:
 		}
 		YYDEBUG(568, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1057 "Zend/zend_language_scanner.l"
+#line 1063 "Zend/zend_language_scanner.l"
 		{
 	return T_WHILE;
 }
-#line 5721 "Zend/zend_language_scanner.c"
+#line 5727 "Zend/zend_language_scanner.c"
 yy569:
 		YYDEBUG(569, *YYCURSOR);
 		++YYCURSOR;
@@ -5726,11 +5732,11 @@ yy569:
 		}
 		YYDEBUG(570, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1041 "Zend/zend_language_scanner.l"
+#line 1047 "Zend/zend_language_scanner.l"
 		{
 	return T_IF;
 }
-#line 5734 "Zend/zend_language_scanner.c"
+#line 5740 "Zend/zend_language_scanner.c"
 yy571:
 		YYDEBUG(571, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5782,11 +5788,11 @@ yy576:
 		}
 		YYDEBUG(577, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1271 "Zend/zend_language_scanner.l"
+#line 1277 "Zend/zend_language_scanner.l"
 		{
 	return T_ISSET;
 }
-#line 5790 "Zend/zend_language_scanner.c"
+#line 5796 "Zend/zend_language_scanner.c"
 yy578:
 		YYDEBUG(578, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5840,11 +5846,11 @@ yy584:
 yy585:
 		YYDEBUG(585, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1239 "Zend/zend_language_scanner.l"
+#line 1245 "Zend/zend_language_scanner.l"
 		{
 	return T_INCLUDE;
 }
-#line 5848 "Zend/zend_language_scanner.c"
+#line 5854 "Zend/zend_language_scanner.c"
 yy586:
 		YYDEBUG(586, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5873,11 +5879,11 @@ yy590:
 		}
 		YYDEBUG(591, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1243 "Zend/zend_language_scanner.l"
+#line 1249 "Zend/zend_language_scanner.l"
 		{
 	return T_INCLUDE_ONCE;
 }
-#line 5881 "Zend/zend_language_scanner.c"
+#line 5887 "Zend/zend_language_scanner.c"
 yy592:
 		YYDEBUG(592, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5911,11 +5917,11 @@ yy597:
 		}
 		YYDEBUG(598, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1141 "Zend/zend_language_scanner.l"
+#line 1147 "Zend/zend_language_scanner.l"
 		{
 	return T_INTERFACE;
 }
-#line 5919 "Zend/zend_language_scanner.c"
+#line 5925 "Zend/zend_language_scanner.c"
 yy599:
 		YYDEBUG(599, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5965,11 +5971,11 @@ yy605:
 		}
 		YYDEBUG(606, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1263 "Zend/zend_language_scanner.l"
+#line 1269 "Zend/zend_language_scanner.l"
 		{
         return T_INSTEADOF;
 }
-#line 5973 "Zend/zend_language_scanner.c"
+#line 5979 "Zend/zend_language_scanner.c"
 yy607:
 		YYDEBUG(607, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -5998,11 +6004,11 @@ yy611:
 		}
 		YYDEBUG(612, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1093 "Zend/zend_language_scanner.l"
+#line 1099 "Zend/zend_language_scanner.l"
 		{
 	return T_INSTANCEOF;
 }
-#line 6006 "Zend/zend_language_scanner.c"
+#line 6012 "Zend/zend_language_scanner.c"
 yy613:
 		YYDEBUG(613, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6046,11 +6052,11 @@ yy620:
 		}
 		YYDEBUG(621, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1153 "Zend/zend_language_scanner.l"
+#line 1159 "Zend/zend_language_scanner.l"
 		{
 	return T_IMPLEMENTS;
 }
-#line 6054 "Zend/zend_language_scanner.c"
+#line 6060 "Zend/zend_language_scanner.c"
 yy622:
 		YYDEBUG(622, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6078,11 +6084,11 @@ yy623:
 		}
 		YYDEBUG(625, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1029 "Zend/zend_language_scanner.l"
+#line 1035 "Zend/zend_language_scanner.l"
 		{
 	return T_TRY;
 }
-#line 6086 "Zend/zend_language_scanner.c"
+#line 6092 "Zend/zend_language_scanner.c"
 yy626:
 		YYDEBUG(626, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6101,11 +6107,11 @@ yy628:
 		}
 		YYDEBUG(629, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1145 "Zend/zend_language_scanner.l"
+#line 1151 "Zend/zend_language_scanner.l"
 		{
 	return T_TRAIT;
 }
-#line 6109 "Zend/zend_language_scanner.c"
+#line 6115 "Zend/zend_language_scanner.c"
 yy630:
 		YYDEBUG(630, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6124,11 +6130,11 @@ yy632:
 		}
 		YYDEBUG(633, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1037 "Zend/zend_language_scanner.l"
+#line 1043 "Zend/zend_language_scanner.l"
 		{
 	return T_THROW;
 }
-#line 6132 "Zend/zend_language_scanner.c"
+#line 6138 "Zend/zend_language_scanner.c"
 yy634:
 		YYDEBUG(634, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6189,11 +6195,11 @@ yy640:
 yy641:
 		YYDEBUG(641, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1247 "Zend/zend_language_scanner.l"
+#line 1253 "Zend/zend_language_scanner.l"
 		{
 	return T_REQUIRE;
 }
-#line 6197 "Zend/zend_language_scanner.c"
+#line 6203 "Zend/zend_language_scanner.c"
 yy642:
 		YYDEBUG(642, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6222,11 +6228,11 @@ yy646:
 		}
 		YYDEBUG(647, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1251 "Zend/zend_language_scanner.l"
+#line 1257 "Zend/zend_language_scanner.l"
 		{
 	return T_REQUIRE_ONCE;
 }
-#line 6230 "Zend/zend_language_scanner.c"
+#line 6236 "Zend/zend_language_scanner.c"
 yy648:
 		YYDEBUG(648, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6245,11 +6251,11 @@ yy650:
 		}
 		YYDEBUG(651, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1025 "Zend/zend_language_scanner.l"
+#line 1031 "Zend/zend_language_scanner.l"
 		{
 	return T_RETURN;
 }
-#line 6253 "Zend/zend_language_scanner.c"
+#line 6259 "Zend/zend_language_scanner.c"
 yy652:
 		YYDEBUG(652, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6339,11 +6345,11 @@ yy661:
 		}
 		YYDEBUG(662, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1121 "Zend/zend_language_scanner.l"
+#line 1127 "Zend/zend_language_scanner.l"
 		{
 	return T_CONTINUE;
 }
-#line 6347 "Zend/zend_language_scanner.c"
+#line 6353 "Zend/zend_language_scanner.c"
 yy663:
 		YYDEBUG(663, *YYCURSOR);
 		++YYCURSOR;
@@ -6352,11 +6358,11 @@ yy663:
 		}
 		YYDEBUG(664, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1021 "Zend/zend_language_scanner.l"
+#line 1027 "Zend/zend_language_scanner.l"
 		{
 	return T_CONST;
 }
-#line 6360 "Zend/zend_language_scanner.c"
+#line 6366 "Zend/zend_language_scanner.c"
 yy665:
 		YYDEBUG(665, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6381,11 +6387,11 @@ yy668:
 		}
 		YYDEBUG(669, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1199 "Zend/zend_language_scanner.l"
+#line 1205 "Zend/zend_language_scanner.l"
 		{
 	return T_CLONE;
 }
-#line 6389 "Zend/zend_language_scanner.c"
+#line 6395 "Zend/zend_language_scanner.c"
 yy670:
 		YYDEBUG(670, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6399,11 +6405,11 @@ yy671:
 		}
 		YYDEBUG(672, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1137 "Zend/zend_language_scanner.l"
+#line 1143 "Zend/zend_language_scanner.l"
 		{
 	return T_CLASS;
 }
-#line 6407 "Zend/zend_language_scanner.c"
+#line 6413 "Zend/zend_language_scanner.c"
 yy673:
 		YYDEBUG(673, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6449,11 +6455,11 @@ yy680:
 		}
 		YYDEBUG(681, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1323 "Zend/zend_language_scanner.l"
+#line 1329 "Zend/zend_language_scanner.l"
 		{
  return T_CALLABLE;
 }
-#line 6457 "Zend/zend_language_scanner.c"
+#line 6463 "Zend/zend_language_scanner.c"
 yy682:
 		YYDEBUG(682, *YYCURSOR);
 		++YYCURSOR;
@@ -6462,11 +6468,11 @@ yy682:
 		}
 		YYDEBUG(683, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1109 "Zend/zend_language_scanner.l"
+#line 1115 "Zend/zend_language_scanner.l"
 		{
 	return T_CASE;
 }
-#line 6470 "Zend/zend_language_scanner.c"
+#line 6476 "Zend/zend_language_scanner.c"
 yy684:
 		YYDEBUG(684, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6480,11 +6486,11 @@ yy685:
 		}
 		YYDEBUG(686, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1033 "Zend/zend_language_scanner.l"
+#line 1039 "Zend/zend_language_scanner.l"
 		{
 	return T_CATCH;
 }
-#line 6488 "Zend/zend_language_scanner.c"
+#line 6494 "Zend/zend_language_scanner.c"
 yy687:
 		YYDEBUG(687, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6535,11 +6541,11 @@ yy695:
 		}
 		YYDEBUG(696, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1017 "Zend/zend_language_scanner.l"
+#line 1023 "Zend/zend_language_scanner.l"
 		{
 	return T_FUNCTION;
 }
-#line 6543 "Zend/zend_language_scanner.c"
+#line 6549 "Zend/zend_language_scanner.c"
 yy697:
 		YYDEBUG(697, *YYCURSOR);
 		++YYCURSOR;
@@ -6563,11 +6569,11 @@ yy697:
 yy698:
 		YYDEBUG(698, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1069 "Zend/zend_language_scanner.l"
+#line 1075 "Zend/zend_language_scanner.l"
 		{
 	return T_FOR;
 }
-#line 6571 "Zend/zend_language_scanner.c"
+#line 6577 "Zend/zend_language_scanner.c"
 yy699:
 		YYDEBUG(699, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6591,11 +6597,11 @@ yy702:
 		}
 		YYDEBUG(703, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1077 "Zend/zend_language_scanner.l"
+#line 1083 "Zend/zend_language_scanner.l"
 		{
 	return T_FOREACH;
 }
-#line 6599 "Zend/zend_language_scanner.c"
+#line 6605 "Zend/zend_language_scanner.c"
 yy704:
 		YYDEBUG(704, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6614,11 +6620,11 @@ yy706:
 		}
 		YYDEBUG(707, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1291 "Zend/zend_language_scanner.l"
+#line 1297 "Zend/zend_language_scanner.l"
 		{
 	return T_FINAL;
 }
-#line 6622 "Zend/zend_language_scanner.c"
+#line 6628 "Zend/zend_language_scanner.c"
 yy708:
 		YYDEBUG(708, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6649,11 +6655,11 @@ yy710:
 		}
 		YYDEBUG(711, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1065 "Zend/zend_language_scanner.l"
+#line 1071 "Zend/zend_language_scanner.l"
 		{
 	return T_DO;
 }
-#line 6657 "Zend/zend_language_scanner.c"
+#line 6663 "Zend/zend_language_scanner.c"
 yy712:
 		YYDEBUG(712, *YYCURSOR);
 		++YYCURSOR;
@@ -6662,11 +6668,11 @@ yy712:
 		}
 		YYDEBUG(713, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1013 "Zend/zend_language_scanner.l"
+#line 1019 "Zend/zend_language_scanner.l"
 		{
 	return T_EXIT;
 }
-#line 6670 "Zend/zend_language_scanner.c"
+#line 6676 "Zend/zend_language_scanner.c"
 yy714:
 		YYDEBUG(714, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6701,11 +6707,11 @@ yy719:
 		}
 		YYDEBUG(720, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1113 "Zend/zend_language_scanner.l"
+#line 1119 "Zend/zend_language_scanner.l"
 		{
 	return T_DEFAULT;
 }
-#line 6709 "Zend/zend_language_scanner.c"
+#line 6715 "Zend/zend_language_scanner.c"
 yy721:
 		YYDEBUG(721, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6729,11 +6735,11 @@ yy724:
 		}
 		YYDEBUG(725, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1085 "Zend/zend_language_scanner.l"
+#line 1091 "Zend/zend_language_scanner.l"
 		{
 	return T_DECLARE;
 }
-#line 6737 "Zend/zend_language_scanner.c"
+#line 6743 "Zend/zend_language_scanner.c"
 yy726:
 		YYDEBUG(726, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6813,11 +6819,11 @@ yy737:
 		}
 		YYDEBUG(738, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1149 "Zend/zend_language_scanner.l"
+#line 1155 "Zend/zend_language_scanner.l"
 		{
 	return T_EXTENDS;
 }
-#line 6821 "Zend/zend_language_scanner.c"
+#line 6827 "Zend/zend_language_scanner.c"
 yy739:
 		YYDEBUG(739, *YYCURSOR);
 		++YYCURSOR;
@@ -6826,11 +6832,11 @@ yy739:
 		}
 		YYDEBUG(740, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1009 "Zend/zend_language_scanner.l"
+#line 1015 "Zend/zend_language_scanner.l"
 		{
 	return T_EXIT;
 }
-#line 6834 "Zend/zend_language_scanner.c"
+#line 6840 "Zend/zend_language_scanner.c"
 yy741:
 		YYDEBUG(741, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6844,11 +6850,11 @@ yy742:
 		}
 		YYDEBUG(743, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1235 "Zend/zend_language_scanner.l"
+#line 1241 "Zend/zend_language_scanner.l"
 		{
 	return T_EVAL;
 }
-#line 6852 "Zend/zend_language_scanner.c"
+#line 6858 "Zend/zend_language_scanner.c"
 yy744:
 		YYDEBUG(744, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6918,11 +6924,11 @@ yy753:
 		}
 		YYDEBUG(754, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1061 "Zend/zend_language_scanner.l"
+#line 1067 "Zend/zend_language_scanner.l"
 		{
 	return T_ENDWHILE;
 }
-#line 6926 "Zend/zend_language_scanner.c"
+#line 6932 "Zend/zend_language_scanner.c"
 yy755:
 		YYDEBUG(755, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6951,11 +6957,11 @@ yy759:
 		}
 		YYDEBUG(760, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1105 "Zend/zend_language_scanner.l"
+#line 1111 "Zend/zend_language_scanner.l"
 		{
 	return T_ENDSWITCH;
 }
-#line 6959 "Zend/zend_language_scanner.c"
+#line 6965 "Zend/zend_language_scanner.c"
 yy761:
 		YYDEBUG(761, *YYCURSOR);
 		++YYCURSOR;
@@ -6964,11 +6970,11 @@ yy761:
 		}
 		YYDEBUG(762, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1049 "Zend/zend_language_scanner.l"
+#line 1055 "Zend/zend_language_scanner.l"
 		{
 	return T_ENDIF;
 }
-#line 6972 "Zend/zend_language_scanner.c"
+#line 6978 "Zend/zend_language_scanner.c"
 yy763:
 		YYDEBUG(763, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -6997,11 +7003,11 @@ yy764:
 yy765:
 		YYDEBUG(765, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1073 "Zend/zend_language_scanner.l"
+#line 1079 "Zend/zend_language_scanner.l"
 		{
 	return T_ENDFOR;
 }
-#line 7005 "Zend/zend_language_scanner.c"
+#line 7011 "Zend/zend_language_scanner.c"
 yy766:
 		YYDEBUG(766, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7025,11 +7031,11 @@ yy769:
 		}
 		YYDEBUG(770, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1081 "Zend/zend_language_scanner.l"
+#line 1087 "Zend/zend_language_scanner.l"
 		{
 	return T_ENDFOREACH;
 }
-#line 7033 "Zend/zend_language_scanner.c"
+#line 7039 "Zend/zend_language_scanner.c"
 yy771:
 		YYDEBUG(771, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7063,11 +7069,11 @@ yy776:
 		}
 		YYDEBUG(777, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1089 "Zend/zend_language_scanner.l"
+#line 1095 "Zend/zend_language_scanner.l"
 		{
 	return T_ENDDECLARE;
 }
-#line 7071 "Zend/zend_language_scanner.c"
+#line 7077 "Zend/zend_language_scanner.c"
 yy778:
 		YYDEBUG(778, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7086,11 +7092,11 @@ yy780:
 		}
 		YYDEBUG(781, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1275 "Zend/zend_language_scanner.l"
+#line 1281 "Zend/zend_language_scanner.l"
 		{
 	return T_EMPTY;
 }
-#line 7094 "Zend/zend_language_scanner.c"
+#line 7100 "Zend/zend_language_scanner.c"
 yy782:
 		YYDEBUG(782, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7119,11 +7125,11 @@ yy783:
 yy784:
 		YYDEBUG(784, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1053 "Zend/zend_language_scanner.l"
+#line 1059 "Zend/zend_language_scanner.l"
 		{
 	return T_ELSE;
 }
-#line 7127 "Zend/zend_language_scanner.c"
+#line 7133 "Zend/zend_language_scanner.c"
 yy785:
 		YYDEBUG(785, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7137,11 +7143,11 @@ yy786:
 		}
 		YYDEBUG(787, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1045 "Zend/zend_language_scanner.l"
+#line 1051 "Zend/zend_language_scanner.l"
 		{
 	return T_ELSEIF;
 }
-#line 7145 "Zend/zend_language_scanner.c"
+#line 7151 "Zend/zend_language_scanner.c"
 yy788:
 		YYDEBUG(788, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7155,11 +7161,11 @@ yy789:
 		}
 		YYDEBUG(790, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1129 "Zend/zend_language_scanner.l"
+#line 1135 "Zend/zend_language_scanner.l"
 		{
 	return T_ECHO;
 }
-#line 7163 "Zend/zend_language_scanner.c"
+#line 7169 "Zend/zend_language_scanner.c"
 	}
 /* *********************************** */
 yyc_ST_LOOKING_FOR_PROPERTY:
@@ -7232,7 +7238,7 @@ yy793:
 yy794:
 		YYDEBUG(794, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1162 "Zend/zend_language_scanner.l"
+#line 1168 "Zend/zend_language_scanner.l"
 		{
 	zendlval->value.str.val = yytext; /* no copying - intentional */
 	zendlval->value.str.len = yyleng;
@@ -7240,7 +7246,7 @@ yy794:
 	HANDLE_NEWLINES(yytext, yyleng);
 	return T_WHITESPACE;
 }
-#line 7244 "Zend/zend_language_scanner.c"
+#line 7250 "Zend/zend_language_scanner.c"
 yy795:
 		YYDEBUG(795, *YYCURSOR);
 		++YYCURSOR;
@@ -7248,13 +7254,13 @@ yy795:
 yy796:
 		YYDEBUG(796, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1181 "Zend/zend_language_scanner.l"
+#line 1187 "Zend/zend_language_scanner.l"
 		{
 	yyless(0);
 	yy_pop_state(TSRMLS_C);
 	goto restart;
 }
-#line 7258 "Zend/zend_language_scanner.c"
+#line 7264 "Zend/zend_language_scanner.c"
 yy797:
 		YYDEBUG(797, *YYCURSOR);
 		++YYCURSOR;
@@ -7263,14 +7269,14 @@ yy797:
 yy798:
 		YYDEBUG(798, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1174 "Zend/zend_language_scanner.l"
+#line 1180 "Zend/zend_language_scanner.l"
 		{
 	yy_pop_state(TSRMLS_C);
 	zend_copy_value(zendlval, yytext, yyleng);
 	zendlval->type = IS_STRING;
 	return T_STRING;
 }
-#line 7274 "Zend/zend_language_scanner.c"
+#line 7280 "Zend/zend_language_scanner.c"
 yy799:
 		YYDEBUG(799, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7291,11 +7297,11 @@ yy802:
 		++YYCURSOR;
 		YYDEBUG(803, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1170 "Zend/zend_language_scanner.l"
+#line 1176 "Zend/zend_language_scanner.l"
 		{
 	return T_OBJECT_OPERATOR;
 }
-#line 7299 "Zend/zend_language_scanner.c"
+#line 7305 "Zend/zend_language_scanner.c"
 yy804:
 		YYDEBUG(804, *YYCURSOR);
 		++YYCURSOR;
@@ -7380,14 +7386,14 @@ yy808:
 yy809:
 		YYDEBUG(809, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1467 "Zend/zend_language_scanner.l"
+#line 1473 "Zend/zend_language_scanner.l"
 		{
 	yyless(0);
 	yy_pop_state(TSRMLS_C);
 	yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
 	goto restart;
 }
-#line 7391 "Zend/zend_language_scanner.c"
+#line 7397 "Zend/zend_language_scanner.c"
 yy810:
 		YYDEBUG(810, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7412,7 +7418,7 @@ yy814:
 		++YYCURSOR;
 		YYDEBUG(815, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1457 "Zend/zend_language_scanner.l"
+#line 1463 "Zend/zend_language_scanner.l"
 		{
 	yyless(yyleng - 1);
 	zend_copy_value(zendlval, yytext, yyleng);
@@ -7421,7 +7427,7 @@ yy814:
 	yy_push_state(ST_IN_SCRIPTING TSRMLS_CC);
 	return T_STRING_VARNAME;
 }
-#line 7425 "Zend/zend_language_scanner.c"
+#line 7431 "Zend/zend_language_scanner.c"
 	}
 /* *********************************** */
 yyc_ST_NOWDOC:
@@ -7432,7 +7438,7 @@ yyc_ST_NOWDOC:
 	++YYCURSOR;
 	YYDEBUG(819, *YYCURSOR);
 	yyleng = YYCURSOR - SCNG(yy_text);
-#line 2349 "Zend/zend_language_scanner.l"
+#line 2355 "Zend/zend_language_scanner.l"
 	{
 	int newline = 0;
 
@@ -7487,7 +7493,7 @@ nowdoc_scan_done:
 	HANDLE_NEWLINES(yytext, yyleng - newline);
 	return T_ENCAPSED_AND_WHITESPACE;
 }
-#line 7491 "Zend/zend_language_scanner.c"
+#line 7497 "Zend/zend_language_scanner.c"
 /* *********************************** */
 yyc_ST_VAR_OFFSET:
 	{
@@ -7594,7 +7600,7 @@ yy822:
 yy823:
 		YYDEBUG(823, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1545 "Zend/zend_language_scanner.l"
+#line 1551 "Zend/zend_language_scanner.l"
 		{ /* Offset could be treated as a long */
 	if (yyleng < MAX_LENGTH_OF_LONG - 1 || (yyleng == MAX_LENGTH_OF_LONG - 1 && strcmp(yytext, long_min_digits) < 0)) {
 		zendlval->value.lval = strtol(yytext, NULL, 10);
@@ -7606,7 +7612,7 @@ yy823:
 	}
 	return T_NUM_STRING;
 }
-#line 7610 "Zend/zend_language_scanner.c"
+#line 7616 "Zend/zend_language_scanner.c"
 yy824:
 		YYDEBUG(824, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7626,23 +7632,23 @@ yy825:
 yy826:
 		YYDEBUG(826, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1877 "Zend/zend_language_scanner.l"
+#line 1883 "Zend/zend_language_scanner.l"
 		{
 	/* Only '[' can be valid, but returning other tokens will allow a more explicit parse error */
 	return yytext[0];
 }
-#line 7635 "Zend/zend_language_scanner.c"
+#line 7641 "Zend/zend_language_scanner.c"
 yy827:
 		YYDEBUG(827, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(828, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1872 "Zend/zend_language_scanner.l"
+#line 1878 "Zend/zend_language_scanner.l"
 		{
 	yy_pop_state(TSRMLS_C);
 	return ']';
 }
-#line 7646 "Zend/zend_language_scanner.c"
+#line 7652 "Zend/zend_language_scanner.c"
 yy829:
 		YYDEBUG(829, *YYCURSOR);
 		yych = *++YYCURSOR;
@@ -7652,14 +7658,14 @@ yy830:
 		++YYCURSOR;
 		YYDEBUG(831, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1882 "Zend/zend_language_scanner.l"
+#line 1888 "Zend/zend_language_scanner.l"
 		{
 	/* Invalid rule to return a more explicit parse error with proper line number */
 	yyless(0);
 	yy_pop_state(TSRMLS_C);
 	return T_ENCAPSED_AND_WHITESPACE;
 }
-#line 7663 "Zend/zend_language_scanner.c"
+#line 7669 "Zend/zend_language_scanner.c"
 yy832:
 		YYDEBUG(832, *YYCURSOR);
 		++YYCURSOR;
@@ -7668,19 +7674,19 @@ yy832:
 yy833:
 		YYDEBUG(833, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1889 "Zend/zend_language_scanner.l"
+#line 1895 "Zend/zend_language_scanner.l"
 		{
 	zend_copy_value(zendlval, yytext, yyleng);
 	zendlval->type = IS_STRING;
 	return T_STRING;
 }
-#line 7678 "Zend/zend_language_scanner.c"
+#line 7684 "Zend/zend_language_scanner.c"
 yy834:
 		YYDEBUG(834, *YYCURSOR);
 		++YYCURSOR;
 		YYDEBUG(835, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 2405 "Zend/zend_language_scanner.l"
+#line 2411 "Zend/zend_language_scanner.l"
 		{
 	if (YYCURSOR > YYLIMIT) {
 		return 0;
@@ -7689,7 +7695,7 @@ yy834:
 	zend_error(E_COMPILE_WARNING,"Unexpected character in input:  '%c' (ASCII=%d) state=%d", yytext[0], yytext[0], YYSTATE);
 	goto restart;
 }
-#line 7693 "Zend/zend_language_scanner.c"
+#line 7699 "Zend/zend_language_scanner.c"
 yy836:
 		YYDEBUG(836, *YYCURSOR);
 		++YYCURSOR;
@@ -7725,13 +7731,13 @@ yy838:
 yy840:
 		YYDEBUG(840, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1866 "Zend/zend_language_scanner.l"
+#line 1872 "Zend/zend_language_scanner.l"
 		{
 	zend_copy_value(zendlval, (yytext+1), (yyleng-1));
 	zendlval->type = IS_STRING;
 	return T_VARIABLE;
 }
-#line 7735 "Zend/zend_language_scanner.c"
+#line 7741 "Zend/zend_language_scanner.c"
 yy841:
 		YYDEBUG(841, *YYCURSOR);
 		++YYCURSOR;
@@ -7771,14 +7777,14 @@ yy846:
 yy848:
 		YYDEBUG(848, *YYCURSOR);
 		yyleng = YYCURSOR - SCNG(yy_text);
-#line 1557 "Zend/zend_language_scanner.l"
+#line 1563 "Zend/zend_language_scanner.l"
 		{ /* Offset must be treated as a string */
 	zendlval->value.str.val = (char *)estrndup(yytext, yyleng);
 	zendlval->value.str.len = yyleng;
 	zendlval->type = IS_STRING;
 	return T_NUM_STRING;
 }
-#line 7782 "Zend/zend_language_scanner.c"
+#line 7788 "Zend/zend_language_scanner.c"
 yy849:
 		YYDEBUG(849, *YYCURSOR);
 		++YYCURSOR;
@@ -7801,6 +7807,6 @@ yy851:
 		goto yy848;
 	}
 }
-#line 2414 "Zend/zend_language_scanner.l"
+#line 2420 "Zend/zend_language_scanner.l"
 
 }
diff --git a/Zend/zend_language_scanner_defs.h b/Zend/zend_language_scanner_defs.h
index 57d8576..06a2f19 100644
--- a/Zend/zend_language_scanner_defs.h
+++ b/Zend/zend_language_scanner_defs.h
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Mon Apr  9 18:25:45 2012 */
+/* Generated by re2c 0.13.5 on Mon Apr 30 10:33:28 2012 */
 #line 3 "Zend/zend_language_scanner_defs.h"
 
 enum YYCONDTYPE {


commit 73b61509922a2fba1864a802f1e8e6a5fb7e7677
Merge: 7fa7d9a 3120387
Author: Felipe Pena <felipensp at gmail.com>
Date:   Mon Apr 30 10:31:59 2012 -0300

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      - Changed last commit to use VK_ESCAPE on Windows



commit 31203876173faaf8bc3d7690e81df6404303a62a
Author: Felipe Pena <felipensp at gmail.com>
Date:   Mon Apr 30 10:31:49 2012 -0300

    - Changed last commit to use VK_ESCAPE on Windows

diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l
index 0a35f3f..2e3d452 100644
--- a/Zend/zend_language_scanner.l
+++ b/Zend/zend_language_scanner.l
@@ -30,7 +30,9 @@
 #endif
 
 #include "zend_language_scanner_defs.h"
-
+#ifdef PHP_WIN32
+# include <Winuser.h>
+#endif
 #include <errno.h>
 #include "zend.h"
 #include "zend_alloc.h"
@@ -906,7 +908,7 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo
 					break;
 				case 'e':
 #ifdef PHP_WIN32
-					*t++ = (char) 27;
+					*t++ = VK_ESCAPE;
 #else
 					*t++ = '\e';
 #endif


commit 7fa7d9a8c6f674af4231908e0d59f6a5a1fa7659
Merge: e509088 fc24e74
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 30 14:37:08 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Additional fixs for bug 61746 - prepare/clean acls



commit fc24e74260399bf4a6badeb61f0e0eed4463d1d2
Merge: 36836f1 ec5421d
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 30 14:36:42 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Additional fixs for bug 61746 - prepare/clean acls



commit ec5421d04403ac3e7b013e65fdd7b3ad6fc82c18
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 30 14:33:48 2012 +0200

    Additional fixs for bug 61746 - prepare/clean acls

diff --git a/ext/standard/tests/file/windows_acls/bug44859.phpt b/ext/standard/tests/file/windows_acls/bug44859.phpt
index bb22a5c..952b6eb 100644
--- a/ext/standard/tests/file/windows_acls/bug44859.phpt
+++ b/ext/standard/tests/file/windows_acls/bug44859.phpt
@@ -8,6 +8,7 @@ skipif();
 --FILE--
 <?php
 include_once __DIR__ . '/common.inc';
+fix_acls();
 
 $iteration = array(
 	PHPT_ACL_READ => false,
diff --git a/ext/standard/tests/file/windows_acls/bug44859_2.phpt b/ext/standard/tests/file/windows_acls/bug44859_2.phpt
index 3cc4ed1..d741156 100644
--- a/ext/standard/tests/file/windows_acls/bug44859_2.phpt
+++ b/ext/standard/tests/file/windows_acls/bug44859_2.phpt
@@ -8,6 +8,7 @@ skipif();
 --FILE--
 <?php
 include_once __DIR__ . '/common.inc';
+fix_acls();
 
 $iteration = array(
 	PHPT_ACL_READ => true,
diff --git a/ext/standard/tests/file/windows_acls/bug44859_3.phpt b/ext/standard/tests/file/windows_acls/bug44859_3.phpt
index 7300112..ed57abb 100644
--- a/ext/standard/tests/file/windows_acls/bug44859_3.phpt
+++ b/ext/standard/tests/file/windows_acls/bug44859_3.phpt
@@ -8,6 +8,7 @@ skipif();
 --FILE--
 <?php
 include_once __DIR__ . '/common.inc';
+fix_acls();
 
 $iteration = array(
 	'tiny.exe' => true,
diff --git a/ext/standard/tests/file/windows_acls/bug44859_4.phpt b/ext/standard/tests/file/windows_acls/bug44859_4.phpt
index c1768d0..954c100 100644
--- a/ext/standard/tests/file/windows_acls/bug44859_4.phpt
+++ b/ext/standard/tests/file/windows_acls/bug44859_4.phpt
@@ -10,6 +10,7 @@ skipif();
 --FILE--
 <?php
 include_once __DIR__ . '/common.inc';
+fix_acls();
 
 $iteration = array(
 	PHPT_ACL_READ => true,
diff --git a/ext/standard/tests/file/windows_acls/common.inc b/ext/standard/tests/file/windows_acls/common.inc
index 4007ad0..26fadf3 100644
--- a/ext/standard/tests/file/windows_acls/common.inc
+++ b/ext/standard/tests/file/windows_acls/common.inc
@@ -46,6 +46,16 @@ function get_icacls()
 	return "$sysroot\\System32\\icacls.exe";
 }
 
+function fix_acls() {
+	$user = get_username();
+	/* Current user needs to be owner of the test files. As well
+	   all the other users having acls on the files must loose them.
+	   The following fixes this just partially, as dynamically reading
+	   all the users having acls on a file could be sophisticated. */
+	exec(get_icacls() . ' . /setowner $user /T /L /Q 2> nul');
+	exec(get_icacls() . ' . /remove:g Administrators /T /L /Q 2> nul');
+}
+
 function icacls_set($path, $mode, $perm) {
 	$icacls = get_icacls();
 	$user = get_username();


commit e509088c946ef87472fcb89fe434749615f3fe6f
Merge: 8a0981b 36836f1
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 30 12:11:00 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug 61870 ext\session\tests\bug42596.phpt fails



commit 36836f147c1a2fcc1d35fdd2b51e54c0a083fe13
Merge: 455040c 6806851
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 30 12:10:43 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug 61870 ext\session\tests\bug42596.phpt fails



commit 680685127fc60fb1891effb7afb33639aa231502
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 30 12:06:28 2012 +0200

    Fix bug 61870 ext\session\tests\bug42596.phpt fails

diff --git a/ext/session/tests/bug42596.phpt b/ext/session/tests/bug42596.phpt
index fd9a602..3d11607 100644
--- a/ext/session/tests/bug42596.phpt
+++ b/ext/session/tests/bug42596.phpt
@@ -1,7 +1,10 @@
 --TEST--
 Bug #42596 (session.save_path MODE option will not set "write" bit for group or world)
 --SKIPIF--
-<?php include('skipif.inc'); ?>
+<?php
+	if(substr(PHP_OS, 0, 3) == "WIN") die("skip not for Windows");
+	include('skipif.inc');
+?>
 --INI--
 session.use_cookies=0
 session.cache_limiter=


commit 8a0981b2ef77df1a2d38e1d60b4b42631ba8f73c
Merge: 1ad91b2 455040c
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 30 10:41:13 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug ext\filter\tests\bug52209.phpt fails



commit 455040c4ab07b04547fb6791806d1a9cf6e5a0af
Merge: 72ccce4 8249581
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 30 10:28:00 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug ext\filter\tests\bug52209.phpt fails



commit 8249581a2df0c2546721f6a55e58ba9d5e72653b
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 30 10:25:54 2012 +0200

    Fix bug ext\filter\tests\bug52209.phpt fails

diff --git a/ext/filter/tests/bug52209.phpt b/ext/filter/tests/bug52209.phpt
index bf2ed6c..79db749 100644
--- a/ext/filter/tests/bug52209.phpt
+++ b/ext/filter/tests/bug52209.phpt
@@ -1,7 +1,13 @@
 --TEST--
 Bug #52209 (INPUT_ENV returns NULL for set variables (CLI))
 --SKIPIF--
-<?php if (!extension_loaded("filter") || !empty($_ENV['PWD'])) die("skip"); ?>
+<?php
+/* This test makes no sense on windows as an empty variable 
+   would never show up in the "set" list. Which means, it's 
+   always undefined in PHP. */
+if(substr(PHP_OS, 0, 3) == "WIN") die("skip Not for Windows");
+if (!extension_loaded("filter") || !empty($_ENV['PWD'])) die("skip");
+?>
 --INI--
 variables_order=GPCSE
 --FILE--


commit 1ad91b23413371b5410848c0225b616d7a0d3b39
Merge: 2de316a 72ccce4
Author: Xinchen Hui <laruence at php.net>
Date:   Mon Apr 30 12:36:06 2012 +0800

    Merge remote-tracking branch 'origin/PHP-5.4'



commit 72ccce4b8b1fb2ab4b20333823a67b0d8fde271f
Merge: fd518ff a601605
Author: Xinchen Hui <laruence at php.net>
Date:   Mon Apr 30 12:35:44 2012 +0800

    Merge remote-tracking branch 'origin/PHP-5.3' into PHP-5.4



commit a601605f14ce12977b2d3771fd19421ad2aa2f47
Author: Xinchen Hui <laruence at php.net>
Date:   Mon Apr 30 12:33:55 2012 +0800

    merge test from PHP-5.4

diff --git a/ext/standard/tests/general_functions/proc_nice_basic.phpt b/ext/standard/tests/general_functions/proc_nice_basic.phpt
index 3a95890..83b5165 100644
--- a/ext/standard/tests/general_functions/proc_nice_basic.phpt
+++ b/ext/standard/tests/general_functions/proc_nice_basic.phpt
@@ -13,7 +13,7 @@ if(!function_exists('proc_nice')) die("skip. proc_nice not available ");
 <?php
 	function getNice($id)
 	{
-		$res = shell_exec('ps -p ' . $id .' -o "%p %n"');
+		$res = shell_exec('ps -p ' . $id .' -o "pid,nice"');
 		preg_match('/^\s*\w+\s+\w+\s*(\d+)\s+(\d+)/m', $res, $matches);
 		if (count($matches) > 2)
 			return $matches[2];


commit d80a3d966898565f48af6417f38803ba85c0be3e
Author: Xinchen Hui <laruence at php.net>
Date:   Mon Apr 30 12:31:33 2012 +0800

    Revert "Merge branch 'fix-pro_nice-test' of https://github.com/reeze/php-src into PHP-5.3"
    
    After pushed, I found the test script in 5.4 is already fixed this, so
    revert this change, and be consistent with 5.4's test
    
    This reverts commit 24d85e4bd8d56197ca673791ad007f2e595478cf, reversing
    changes made to bae56a87f81b91cd815604b0f404f616b0d73c2b.

diff --git a/ext/standard/tests/general_functions/proc_nice_basic.phpt b/ext/standard/tests/general_functions/proc_nice_basic.phpt
index b64eab1..3a95890 100644
--- a/ext/standard/tests/general_functions/proc_nice_basic.phpt
+++ b/ext/standard/tests/general_functions/proc_nice_basic.phpt
@@ -13,7 +13,7 @@ if(!function_exists('proc_nice')) die("skip. proc_nice not available ");
 <?php
 	function getNice($id)
 	{
-		$res = shell_exec('ps -p ' . $id .' -o pid -o ni');
+		$res = shell_exec('ps -p ' . $id .' -o "%p %n"');
 		preg_match('/^\s*\w+\s+\w+\s*(\d+)\s+(\d+)/m', $res, $matches);
 		if (count($matches) > 2)
 			return $matches[2];


commit 24d85e4bd8d56197ca673791ad007f2e595478cf
Merge: bae56a8 e52be10
Author: Xinchen Hui <laruence at php.net>
Date:   Mon Apr 30 12:29:15 2012 +0800

    Merge branch 'fix-pro_nice-test' of https://github.com/reeze/php-src into PHP-5.3



commit 2de316ae8b899faeb3d463fc19512026a9ac9ae3
Merge: bbe9eec fd518ff
Author: Xinchen Hui <laruence at php.net>
Date:   Mon Apr 30 12:16:50 2012 +0800

    Merge remote-tracking branch 'origin/PHP-5.4'
    
    * origin/PHP-5.4:
      Fixed bug #61546 (functions related to current script failed when chdir() in cli sapi).
      - BFN
      - BFN



commit fd518ffc7e37a884ced4d34088a6b6c507fd88c2
Merge: b336af2 bae56a8
Author: Xinchen Hui <laruence at php.net>
Date:   Mon Apr 30 12:15:43 2012 +0800

    Merge remote-tracking branch 'origin/PHP-5.3' into PHP-5.4
    
    * origin/PHP-5.3:
      Fixed bug #61546 (functions related to current script failed when chdir() in cli sapi).
      - BFN
    
    Conflicts:
    	sapi/cli/php_cli.c

diff --cc NEWS
index 057e1aa,7bb6cc0..11251eb
--- a/NEWS
+++ b/NEWS
@@@ -1,15 -1,10 +1,17 @@@
  PHP                                                                        NEWS
  |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 -?? ??? 2012, PHP 5.3.12
 +?? ??? 2012, PHP 5.4.1 RC1
  
 -- CLI SAPI:
 +- CLI Server:
+   . Fixed bug #61546 (functions related to current script failed when chdir() 
+     in cli sapi). (Laruence, reeze.xia at gmail.com)
 +  . Improved performance while sending error page, this also fixed
 +    bug #61785 (Memory leak when access a non-exists file without router).
 +    (Laruence)
 +  . Fixed bug #61461 (missing checks around malloc() calls). (Ilia)
 +  . Implemented FR #60850 (Built in web server does not set 
 +    $_SERVER['SCRIPT_FILENAME'] when using router). (Laruence)
 +  . "Connection: close" instead of "Connection: closed" (Gustavo)
  
  - Core:
    . Fixed missing bound check in iptcparse(). (chris at chiappa.net)
diff --cc sapi/cli/php_cli.c
index 801e53b,f26db43..205b9db
--- a/sapi/cli/php_cli.c
+++ b/sapi/cli/php_cli.c
@@@ -650,26 -631,154 +650,26 @@@ static int cli_seek_file_begin(zend_fil
  }
  /* }}} */
  
 -/* {{{ main
 - */
 -#ifdef PHP_CLI_WIN32_NO_CONSOLE
 -int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
 -#else
 -int main(int argc, char *argv[])
 -#endif
 +static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */
  {
 -	volatile int exit_status = SUCCESS;
  	int c;
  	zend_file_handle file_handle;
 -/* temporary locals */
 -	int behavior=PHP_MODE_STANDARD;
 +	int behavior = PHP_MODE_STANDARD;
  	char *reflection_what = NULL;
 -	int orig_optind=php_optind;
 -	char *orig_optarg=php_optarg;
 +	volatile int request_started = 0;
 +	volatile int exit_status = 0;
 +	char *php_optarg = NULL, *orig_optarg = NULL;
 +	int php_optind = 1, orig_optind = 1;
 +	char *exec_direct=NULL, *exec_run=NULL, *exec_begin=NULL, *exec_end=NULL;
  	char *arg_free=NULL, **arg_excp=&arg_free;
- 	char *script_file=NULL;
+ 	char *script_file=NULL, *translated_path = NULL;
  	int interactive=0;
 -	volatile int module_started = 0;
 -	volatile int request_started = 0;
  	int lineno = 0;
 -	char *exec_direct=NULL, *exec_run=NULL, *exec_begin=NULL, *exec_end=NULL;
  	const char *param_error=NULL;
  	int hide_argv = 0;
 -/* end of temporary locals */
 -#ifdef ZTS
 -	void ***tsrm_ls;
 -#endif
 -#ifdef PHP_CLI_WIN32_NO_CONSOLE
 -	int argc = __argc;
 -	char **argv = __argv;
 -#endif
 -	int ini_entries_len = 0;
 -
 -#if defined(PHP_WIN32) && defined(_DEBUG) && defined(PHP_WIN32_DEBUG_HEAP)
 -	{
 -		int tmp_flag;
 -		_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
 -		_CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);
 -		_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE);
 -		_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);
 -		_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE);
 -		_CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);
 -		tmp_flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
 -		tmp_flag |= _CRTDBG_DELAY_FREE_MEM_DF;
 -		tmp_flag |= _CRTDBG_LEAK_CHECK_DF;
 -
 -		_CrtSetDbgFlag(tmp_flag);
 -	}
 -#endif
 -
 -#ifdef HAVE_SIGNAL_H
 -#if defined(SIGPIPE) && defined(SIG_IGN)
 -	signal(SIGPIPE, SIG_IGN); /* ignore SIGPIPE in standalone mode so
 -								that sockets created via fsockopen()
 -								don't kill PHP if the remote site
 -								closes it.  in apache|apxs mode apache
 -								does that for us!  thies at thieso.net
 -								20000419 */
 -#endif
 -#endif
 -
 -
 -#ifdef ZTS
 -	tsrm_startup(1, 1, 0, NULL);
 -	tsrm_ls = ts_resource(0);
 -#endif
 -
 -	cli_sapi_module.ini_defaults = sapi_cli_ini_defaults;
 -	cli_sapi_module.php_ini_path_override = NULL;
 -	cli_sapi_module.phpinfo_as_text = 1;
 -	sapi_startup(&cli_sapi_module);
 -
 -#ifdef PHP_WIN32
 -	_fmode = _O_BINARY;			/*sets default for file streams to binary */
 -	setmode(_fileno(stdin), O_BINARY);		/* make the stdio mode be binary */
 -	setmode(_fileno(stdout), O_BINARY);		/* make the stdio mode be binary */
 -	setmode(_fileno(stderr), O_BINARY);		/* make the stdio mode be binary */
 -#endif
  
 -	ini_entries_len = sizeof(HARDCODED_INI)-2;
 -	cli_sapi_module.ini_entries = malloc(sizeof(HARDCODED_INI));
 -	memcpy(cli_sapi_module.ini_entries, HARDCODED_INI, sizeof(HARDCODED_INI));
 -
 -	while ((c = php_getopt(argc, argv, OPTIONS, &php_optarg, &php_optind, 0, 2))!=-1) {
 -		switch (c) {
 -			case 'c':
 -				if (cli_sapi_module.php_ini_path_override) {
 -					free(cli_sapi_module.php_ini_path_override);
 -				}
 - 				cli_sapi_module.php_ini_path_override = strdup(php_optarg);
 -				break;
 -			case 'n':
 -				cli_sapi_module.php_ini_ignore = 1;
 -				break;
 -			case 'd': {
 -				/* define ini entries on command line */
 -				int len = strlen(php_optarg);
 -				char *val;
 -
 -				if ((val = strchr(php_optarg, '='))) {
 -					val++;
 -					if (!isalnum(*val) && *val != '"' && *val != '\'' && *val != '\0') {
 -						cli_sapi_module.ini_entries = realloc(cli_sapi_module.ini_entries, ini_entries_len + len + sizeof("\"\"\n\0"));
 -						memcpy(cli_sapi_module.ini_entries + ini_entries_len, php_optarg, (val - php_optarg));
 -						ini_entries_len += (val - php_optarg);
 -						memcpy(cli_sapi_module.ini_entries + ini_entries_len, "\"", 1);
 -						ini_entries_len++;
 -						memcpy(cli_sapi_module.ini_entries + ini_entries_len, val, len - (val - php_optarg));
 -						ini_entries_len += len - (val - php_optarg);
 -						memcpy(cli_sapi_module.ini_entries + ini_entries_len, "\"\n\0", sizeof("\"\n\0"));
 -						ini_entries_len += sizeof("\n\0\"") - 2;
 -					} else {
 -						cli_sapi_module.ini_entries = realloc(cli_sapi_module.ini_entries, ini_entries_len + len + sizeof("\n\0"));
 -						memcpy(cli_sapi_module.ini_entries + ini_entries_len, php_optarg, len);
 -						memcpy(cli_sapi_module.ini_entries + ini_entries_len + len, "\n\0", sizeof("\n\0"));
 -						ini_entries_len += len + sizeof("\n\0") - 2;
 -					}
 -				} else {
 -					cli_sapi_module.ini_entries = realloc(cli_sapi_module.ini_entries, ini_entries_len + len + sizeof("=1\n\0"));
 -					memcpy(cli_sapi_module.ini_entries + ini_entries_len, php_optarg, len);
 -					memcpy(cli_sapi_module.ini_entries + ini_entries_len + len, "=1\n\0", sizeof("=1\n\0"));
 -					ini_entries_len += len + sizeof("=1\n\0") - 2;
 -				}
 -				break;
 -			}
 -		}
 -	}
 -	php_optind = orig_optind;
 -	php_optarg = orig_optarg;
 -
 -	cli_sapi_module.executable_location = argv[0];
 -	cli_sapi_module.additional_functions = additional_functions;
 -
 -	/* startup after we get the above ini override se we get things right */
 -	if (cli_sapi_module.startup(&cli_sapi_module)==FAILURE) {
 -		/* there is no way to see if we must call zend_ini_deactivate()
 -		 * since we cannot check if EG(ini_directives) has been initialised
 -		 * because the executor's constructor does not set initialize it.
 -		 * Apart from that there seems no need for zend_ini_deactivate() yet.
 -		 * So we goto out_err.*/
 -		exit_status = 1;
 -		goto out_err;
 -	}
 -	module_started = 1;
 -
 -	zend_first_try {
 +	zend_try {
 +	
  		CG(in_compilation) = 0; /* not initialized but needed for several options */
  		EG(uninitialized_zval_ptr) = NULL;
  
@@@ -947,8 -1078,8 +952,8 @@@
  		SG(request_info).argc=argc-php_optind+1;
  		arg_excp = argv+php_optind-1;
  		arg_free = argv[php_optind-1];
- 		SG(request_info).path_translated = (char*)file_handle.filename;
 -		SG(request_info).path_translated = translated_path? translated_path : file_handle.filename;
 -		argv[php_optind-1] = file_handle.filename;
++		SG(request_info).path_translated = translated_path? translated_path: (char*)file_handle.filename;
 +		argv[php_optind-1] = (char*)file_handle.filename;
  		SG(request_info).argv=argv+php_optind-1;
  
  		if (php_request_startup(TSRMLS_C)==FAILURE) {


commit bae56a87f81b91cd815604b0f404f616b0d73c2b
Author: Xinchen Hui <laruence at php.net>
Date:   Mon Apr 30 12:09:22 2012 +0800

    Fixed bug #61546 (functions related to current script failed when chdir() in cli sapi).

diff --git a/NEWS b/NEWS
index a49ecfa..7bb6cc0 100644
--- a/NEWS
+++ b/NEWS
@@ -2,11 +2,15 @@ PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 2012, PHP 5.3.12
 
+- CLI SAPI:
+  . Fixed bug #61546 (functions related to current script failed when chdir() 
+    in cli sapi). (Laruence, reeze.xia at gmail.com)
+
 - Core:
   . Fixed missing bound check in iptcparse(). (chris at chiappa.net)
   . Fixed bug #61764 ('I' unpacks n as signed if n > 2^31-1 on LP64). (Gustavo)
   . Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename
-   set to null). (Anatoliy)
+    set to null). (Anatoliy)
 
 - Fileinfo:
   . Fixed bug #61812 (Uninitialised value used in libmagic). 
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
index 0fbf7c8..f26db43 100644
--- a/sapi/cli/php_cli.c
+++ b/sapi/cli/php_cli.c
@@ -648,7 +648,7 @@ int main(int argc, char *argv[])
 	int orig_optind=php_optind;
 	char *orig_optarg=php_optarg;
 	char *arg_free=NULL, **arg_excp=&arg_free;
-	char *script_file=NULL;
+	char *script_file=NULL, *translated_path = NULL;
 	int interactive=0;
 	volatile int module_started = 0;
 	volatile int request_started = 0;
@@ -1053,8 +1053,13 @@ int main(int argc, char *argv[])
 		if (script_file) {
 			if (cli_seek_file_begin(&file_handle, script_file, &lineno TSRMLS_CC) != SUCCESS) {
 				goto err;
+			} else {
+				char real_path[MAXPATHLEN];
+				if (VCWD_REALPATH(script_file, real_path)) {
+					translated_path = strdup(real_path);
+				}
+				script_filename = script_file;
 			}
-			script_filename = script_file;
 		} else {
 			/* We could handle PHP_MODE_PROCESS_STDIN in a different manner  */
 			/* here but this would make things only more complicated. And it */
@@ -1073,7 +1078,7 @@ int main(int argc, char *argv[])
 		SG(request_info).argc=argc-php_optind+1;
 		arg_excp = argv+php_optind-1;
 		arg_free = argv[php_optind-1];
-		SG(request_info).path_translated = file_handle.filename;
+		SG(request_info).path_translated = translated_path? translated_path : file_handle.filename;
 		argv[php_optind-1] = file_handle.filename;
 		SG(request_info).argv=argv+php_optind-1;
 
diff --git a/sapi/cli/tests/bug61546.phpt b/sapi/cli/tests/bug61546.phpt
new file mode 100644
index 0000000..2cd690f
--- /dev/null
+++ b/sapi/cli/tests/bug61546.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Bug #61546 (functions related to current script failed when chdir() in cli sapi)
+--FILE--
+<?php
+$php = getenv("TEST_PHP_EXECUTABLE");
+$test_code = <<<PHP
+<?php
+chdir('..');
+var_dump(get_current_user() != "");
+chdir('..');
+var_dump(getmyinode() != false);
+var_dump(getlastmod() != false);
+PHP;
+
+file_put_contents("bug61546_sub.php", $test_code);
+system($php . ' -n bug61546_sub.php');
+unlink("bug61546_sub.php");
+?>
+--EXPECT--
+bool(true)
+bool(true)
+bool(true)


commit b336af29e11fbb31d2737cb7f2e42149e8de4208
Author: Felipe Pena <felipensp at gmail.com>
Date:   Sun Apr 29 19:48:00 2012 -0300

    - BFN

diff --git a/NEWS b/NEWS
index e314f26..057e1aa 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,8 @@ PHP                                                                        NEWS
   . "Connection: close" instead of "Connection: closed" (Gustavo)
 
 - Core:
+  . Fixed missing bound check in iptcparse(). (chris at chiappa.net)
+  . Fixed bug #61827 (incorrect \e processing on Windows) (Anatoliy)
   . Fixed bug #61761 ('Overriding' a private static method with a different 
     signature causes crash). (Laruence)
   . Fixed bug #61728 (PHP crash when calling ob_start in request_shutdown 


commit 9aff3a1156efdfae7660d5b5e7a6d8b29c263722
Author: Felipe Pena <felipensp at gmail.com>
Date:   Sun Apr 29 19:44:27 2012 -0300

    - BFN

diff --git a/NEWS b/NEWS
index b8193c9..a49ecfa 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ PHP                                                                        NEWS
 ?? ??? 2012, PHP 5.3.12
 
 - Core:
+  . Fixed missing bound check in iptcparse(). (chris at chiappa.net)
   . Fixed bug #61764 ('I' unpacks n as signed if n > 2^31-1 on LP64). (Gustavo)
   . Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename
    set to null). (Anatoliy)


commit bbe9eec9a2c385f096f4200e0f70d0aea88117b8
Merge: 7fa45a9 cc5b995
Author: Felipe Pena <felipensp at gmail.com>
Date:   Sun Apr 29 19:36:10 2012 -0300

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      - Fixed bug #61827 (incorrect \e processing on Windows) patch by: ab at php.net



commit cc5b995c78038b92317b38356c9009ff80850d8b
Author: Felipe Pena <felipensp at gmail.com>
Date:   Sun Apr 29 19:35:52 2012 -0300

    - Fixed bug #61827 (incorrect \e processing on Windows) patch by: ab at php.net

diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l
index d530b53..0a35f3f 100644
--- a/Zend/zend_language_scanner.l
+++ b/Zend/zend_language_scanner.l
@@ -905,7 +905,11 @@ static void zend_scan_escape_string(zval *zendlval, char *str, int len, char quo
 					zendlval->value.str.len--;
 					break;
 				case 'e':
+#ifdef PHP_WIN32
+					*t++ = (char) 27;
+#else
 					*t++ = '\e';
+#endif
 					zendlval->value.str.len--;
 					break;
 				case '"':


commit 7fa45a9399922f324a4fe7e4af8d6f40b0592172
Merge: ffec614 6008f9a
Author: Felipe Pena <felipensp at gmail.com>
Date:   Sun Apr 29 19:14:20 2012 -0300

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      - Added missing bound check in iptcparse() (path by chris at chiappa.net)



commit 6008f9af8fa6beab92a4c96d11d641c95f97162c
Merge: 6f8fae6 d44a383
Author: Felipe Pena <felipensp at gmail.com>
Date:   Sun Apr 29 19:14:03 2012 -0300

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      - Added missing bound check in iptcparse() (path by chris at chiappa.net)



commit d44a3839861113dee10c7041d589096b82f23cc5
Author: Felipe Pena <felipensp at gmail.com>
Date:   Sun Apr 29 19:12:12 2012 -0300

    - Added missing bound check in iptcparse() (path by chris at chiappa.net)

diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c
index efd4e44..d1cf42f 100644
--- a/ext/standard/iptc.c
+++ b/ext/standard/iptc.c
@@ -342,13 +342,13 @@ PHP_FUNCTION(iptcparse)
 			len = (((unsigned short) buffer[ inx ])<<8) | (unsigned short)buffer[ inx+1 ];
 			inx += 2;
 		}
-
-		snprintf(key, sizeof(key), "%d#%03d", (unsigned int) dataset, (unsigned int) recnum);
-
-		if ((len > str_len) || (inx + len) > str_len) {
+		
+		if ((len < 0) || (len > str_len) || (inx + len) > str_len) {
 			break;
 		}
 
+		snprintf(key, sizeof(key), "%d#%03d", (unsigned int) dataset, (unsigned int) recnum);
+
 		if (tagsfound == 0) { /* found the 1st tag - initialize the return array */
 			array_init(return_value);
 		}


commit e52be10b30d3efd07ba705801b28ee5173b6fe2c
Author: reeze <reeze.xia at gmail.com>
Date:   Mon Apr 30 00:59:54 2012 +0800

    Fix test for proc_nice: bsd ps command didn't support option -o "%p %n"

diff --git a/ext/standard/tests/general_functions/proc_nice_basic.phpt b/ext/standard/tests/general_functions/proc_nice_basic.phpt
index 3a95890..b64eab1 100644
--- a/ext/standard/tests/general_functions/proc_nice_basic.phpt
+++ b/ext/standard/tests/general_functions/proc_nice_basic.phpt
@@ -13,7 +13,7 @@ if(!function_exists('proc_nice')) die("skip. proc_nice not available ");
 <?php
 	function getNice($id)
 	{
-		$res = shell_exec('ps -p ' . $id .' -o "%p %n"');
+		$res = shell_exec('ps -p ' . $id .' -o pid -o ni');
 		preg_match('/^\s*\w+\s+\w+\s*(\d+)\s+(\d+)/m', $res, $matches);
 		if (count($matches) > 2)
 			return $matches[2];


commit ffec6144123b3d4fdd40be1d8d130f60cb2594d2
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Sat Apr 28 16:32:44 2012 +0100

    Fix build on MS Windows

diff --git a/ext/standard/pack.c b/ext/standard/pack.c
index a21d41b..61228a6 100644
--- a/ext/standard/pack.c
+++ b/ext/standard/pack.c
@@ -719,7 +719,8 @@ PHP_FUNCTION(unpack)
 					case 'Z': {
 						/* Z will strip everything after the first null character */
 						char pad = '\0';
-						int len = inputlen - inputpos;	/* Remaining string */
+						int	 s,
+							 len = inputlen - inputpos;	/* Remaining string */
 
 						/* If size was given take minimum of len and size */
 						if ((size >= 0) && (len > size)) {
@@ -729,7 +730,7 @@ PHP_FUNCTION(unpack)
 						size = len;
 
 						/* Remove everything after the first null */
-						int s = 0;
+						s = 0;
 						while (s++ <= len) {
 							if (input[inputpos + s] == pad)
 								break;


commit a1f7423087c85ecd48a034d4a95a2bf19901f13d
Merge: 3dac5b1 6f8fae6
Author: Anatoliy Belsky <ab at php.net>
Date:   Sat Apr 28 11:45:24 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug 61685 putenv('TZ=UTC') doesn't update timezone for localtime()



commit 6f8fae606bcbf37cea4d6e03a065a705924b08bf
Merge: 3dbe487 dc6d283
Author: Anatoliy Belsky <ab at php.net>
Date:   Sat Apr 28 11:44:54 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug 61685 putenv('TZ=UTC') doesn't update timezone for localtime()



commit dc6d283b1c277c2c99a794d17a2e2540a9f2e60e
Author: Matt Ficken <mattficken at php.net>
Date:   Sat Apr 28 11:42:42 2012 +0200

    Fix bug 61685 putenv('TZ=UTC') doesn't update timezone for localtime()

diff --git a/ext/calendar/tests/unixtojd.phpt b/ext/calendar/tests/unixtojd.phpt
index 11edde5..4eeb1ca 100644
--- a/ext/calendar/tests/unixtojd.phpt
+++ b/ext/calendar/tests/unixtojd.phpt
@@ -2,9 +2,34 @@
 unixtojd()
 --SKIPIF--
 <?php include 'skipif.inc'; ?>
+--ENV--
+TZ=UTC
 --FILE--
 <?php
+// this line has no impact on test output on Windows
 putenv('TZ=UTC');
+// getenv('TZ') returns 'UTC' here
+// putenv (basic_functions.c) does call tzset() when the env var being put is 'TZ'
+//      -adding a call direct to GetEnvironmentVariableA just before tzset() is called to check the value of 'TZ' returns 'UTC'
+// putting a call to date_default_timezone_set() here doesn't help
+//
+// on Windows, the only thing that gets this test to pass is to put TZ=UTC in --ENV-- section
+// 		-since putenv() is written to call tzset() when env var is TZ, I assume that putenv("TZ=UTC") is intended to work
+//			and should work on all platforms(including Windows).
+// easter_date.phpt passes
+//		-doesn't use --ENV-- section
+//		-uses --INI-- section with date.timezone=UTC
+//		-uses putenv('TZ=UTC')
+// date.timezone=UTC
+//		-if ommitted from easter_date.phpt, outputs DATE_TZ_ERRMSG warning
+//			-easter_date() calls mktime() and localtime()
+//			-whereas unixtojd(1000000000) calls localtime(1000000000)
+//		-if ommitted from unixtojd.phpt, does NOT output DATE_TZ_ERRMSG
+//
+// unixtojd() calls php_localtime_r() which for Pacific timezone systems, returns a time -8 hours
+//		-this incorrect localtime is passed to the julian date conversion (GregorianToSDN) function which works (probably correctly)
+//			but returns -1 day from expected because its input is -1 from expected
+
 echo unixtojd(40000). "\n";
 echo unixtojd(1000000000). "\n";
 echo unixtojd(1152459009). "\n";


commit 3dac5b1105ce18f459d4f29ee66e4ccc25e2036d
Merge: 6996a51 3dbe487
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu Apr 26 15:41:06 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug 61786 Failing tests in ext\session\tests\*



commit 3dbe48762fedfefeebd253da96fc84ad669fc10d
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu Apr 26 15:39:45 2012 +0200

    Fix bug 61786 Failing tests in ext\session\tests\*

diff --git a/ext/session/tests/rfc1867_invalid_settings-win.phpt b/ext/session/tests/rfc1867_invalid_settings-win.phpt
new file mode 100644
index 0000000..ed854e8
--- /dev/null
+++ b/ext/session/tests/rfc1867_invalid_settings-win.phpt
@@ -0,0 +1,19 @@
+--TEST--
+session rfc1867 invalid settings
+--INI--
+session.upload_progress.freq=-1
+error_log=
+--SKIPIF--
+<?php 
+include('skipif.inc');
+if(substr(PHP_OS, 0, 3) != "WIN")
+        die("skip windows only test");
+?>
+--FILE--
+<?php
+var_dump(ini_get("session.upload_progress.freq"));
+?>
+--EXPECTF--
+Warning: PHP Startup: session.upload_progress.freq must be greater than or equal to zero in %s
+string(2) "1%"
+PHP Warning:  PHP Startup: session.upload_progress.freq must be greater than or equal to zero in %s
diff --git a/ext/session/tests/rfc1867_invalid_settings.phpt b/ext/session/tests/rfc1867_invalid_settings.phpt
index d954563..640c4d2 100644
--- a/ext/session/tests/rfc1867_invalid_settings.phpt
+++ b/ext/session/tests/rfc1867_invalid_settings.phpt
@@ -4,7 +4,11 @@ session rfc1867 invalid settings
 session.upload_progress.freq=-1
 error_log=
 --SKIPIF--
-<?php include('skipif.inc'); ?>
+<?php 
+include('skipif.inc');
+if(substr(PHP_OS, 0, 3) == "WIN")
+        die("skip Not for Windows");
+?>
 --FILE--
 <?php
 var_dump(ini_get("session.upload_progress.freq"));
diff --git a/ext/session/tests/rfc1867_invalid_settings_2-win.phpt b/ext/session/tests/rfc1867_invalid_settings_2-win.phpt
new file mode 100644
index 0000000..f8e6b6d
--- /dev/null
+++ b/ext/session/tests/rfc1867_invalid_settings_2-win.phpt
@@ -0,0 +1,19 @@
+--TEST--
+session rfc1867 invalid settings 2
+--INI--
+session.upload_progress.freq=200%
+error_log=
+--SKIPIF--
+<?php 
+include('skipif.inc');
+if(substr(PHP_OS, 0, 3) != "WIN")
+        die("skip windows only test");
+?>
+--FILE--
+<?php
+var_dump(ini_get("session.upload_progress.freq"));
+?>
+--EXPECTF--
+Warning: PHP Startup: session.upload_progress.freq cannot be over 100% in %s
+string(2) "1%"
+PHP Warning:  PHP Startup: session.upload_progress.freq cannot be over 100% in %s
diff --git a/ext/session/tests/rfc1867_invalid_settings_2.phpt b/ext/session/tests/rfc1867_invalid_settings_2.phpt
index 544510e..c2a0c6a 100644
--- a/ext/session/tests/rfc1867_invalid_settings_2.phpt
+++ b/ext/session/tests/rfc1867_invalid_settings_2.phpt
@@ -4,7 +4,11 @@ session rfc1867 invalid settings 2
 session.upload_progress.freq=200%
 error_log=
 --SKIPIF--
-<?php include('skipif.inc'); ?>
+<?php 
+include('skipif.inc');
+if(substr(PHP_OS, 0, 3) == "WIN")
+        die("skip Not for Windows");
+?>
 --FILE--
 <?php
 var_dump(ini_get("session.upload_progress.freq"));
diff --git a/ext/session/tests/session_set_save_handler_class_002.phpt b/ext/session/tests/session_set_save_handler_class_002.phpt
index 9d5f732..6fb831f 100644
--- a/ext/session/tests/session_set_save_handler_class_002.phpt
+++ b/ext/session/tests/session_set_save_handler_class_002.phpt
@@ -23,7 +23,7 @@ class MySession2 extends SessionHandler {
 
 	public function open($path, $name) {
 		if (!$path) {
-			$path = '/tmp';
+			$path = sys_get_temp_dir();
 		}
 		$this->path = $path . '/u_sess_' . $name;
 		return true;
diff --git a/ext/session/tests/session_set_save_handler_iface_001.phpt b/ext/session/tests/session_set_save_handler_iface_001.phpt
index c8199ff..39a4b99 100644
--- a/ext/session/tests/session_set_save_handler_iface_001.phpt
+++ b/ext/session/tests/session_set_save_handler_iface_001.phpt
@@ -23,7 +23,7 @@ class MySession2 implements SessionHandlerInterface {
 
 	public function open($path, $name) {
 		if (!$path) {
-			$path = '/tmp';
+			$path = sys_get_temp_dir();
 		}
 		$this->path = $path . '/u_sess_' . $name;
 		return true;
diff --git a/ext/session/tests/session_set_save_handler_iface_002.phpt b/ext/session/tests/session_set_save_handler_iface_002.phpt
index 42e8fbe..40c9ac6 100644
--- a/ext/session/tests/session_set_save_handler_iface_002.phpt
+++ b/ext/session/tests/session_set_save_handler_iface_002.phpt
@@ -32,7 +32,7 @@ class MySession2 implements MySessionHandlerInterface {
 
 	public function open($path, $name) {
 		if (!$path) {
-			$path = '/tmp';
+			$path = sys_get_temp_dir();
 		}
 		$this->path = $path . '/u_sess_' . $name;
 		return true;


commit 6996a51d590a3ebd09d436ea1c64f1863d99bc6a
Merge: e857110 94d96f7
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu Apr 26 15:18:17 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug #61791 ext\sqlite3\tests\sqlite3_15_open_error.phpt fails



commit 94d96f77826e46f114d4bc1777e1edcdfef002a2
Merge: 19df3c1 4daab0a
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu Apr 26 15:17:46 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug #61791 ext\sqlite3\tests\sqlite3_15_open_error.phpt fails
    
    Conflicts:
    	ext/sqlite3/tests/sqlite3_15_open_error.phpt

diff --cc ext/sqlite3/tests/sqlite3_15_open_error.phpt
index ea1ee42,9b0496f..fc05b87
--- a/ext/sqlite3/tests/sqlite3_15_open_error.phpt
+++ b/ext/sqlite3/tests/sqlite3_15_open_error.phpt
@@@ -2,7 -2,10 +2,10 @@@
  SQLite3::open error test
  --SKIPIF--
  <?php
+ if(substr(PHP_OS, 0, 3) == 'WIN' ) {
+ 	die('skip non windows test');
+ }
 -require_once(dirname(__FILE__) . '/skipif.inc');
 +require_once(__DIR__ . '/skipif.inc');
  if (posix_geteuid() == 0) {
      die('SKIP Cannot run test as root.');
  }


commit 4daab0abecd5ee583c005d8e7b6affc08af8639d
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu Apr 26 15:14:26 2012 +0200

    Fix bug #61791 ext\sqlite3\tests\sqlite3_15_open_error.phpt fails

diff --git a/ext/sqlite3/tests/sqlite3_15_open_error-win.phpt b/ext/sqlite3/tests/sqlite3_15_open_error-win.phpt
new file mode 100644
index 0000000..6289fac
--- /dev/null
+++ b/ext/sqlite3/tests/sqlite3_15_open_error-win.phpt
@@ -0,0 +1,37 @@
+--TEST--
+SQLite3::open error test
+--SKIPIF--
+<?php
+if(substr(PHP_OS, 0, 3) != 'WIN' ) {
+	die('skip windows only test');
+}
+require_once(__DIR__ . '/skipif.inc');
+?>
+--FILE--
+<?php
+$sysroot = exec('echo %systemroot%');
+$icacls = "$sysroot\\System32\\icacls.exe";
+$user = get_current_user();
+$unreadable = __DIR__ . '/unreadable.db';
+
+touch($unreadable);
+$cmd = $icacls . ' ' . $unreadable . ' /inheritance:r /deny ' . $user . ':(F,M,R,RX,W)';
+exec($cmd);
+
+try {
+	$db = new SQLite3($unreadable);
+} catch (Exception $e) {
+	echo $e . "\n";
+}
+echo "Done\n";
+
+$cmd = $icacls . ' ' . $unreadable . ' /grant ' . $user . ':(F,M,R,RX,W)';
+exec($cmd);
+unlink($unreadable);
+?>
+--EXPECTF--
+exception 'Exception' with message 'Unable to open database: %s' in %ssqlite3_15_open_error-win.php:%d
+Stack trace:
+#0 %ssqlite3_15_open_error-win.php(%d): SQLite3->__construct('%s')
+#1 {main}
+Done
diff --git a/ext/sqlite3/tests/sqlite3_15_open_error.phpt b/ext/sqlite3/tests/sqlite3_15_open_error.phpt
index f296f82..9b0496f 100644
--- a/ext/sqlite3/tests/sqlite3_15_open_error.phpt
+++ b/ext/sqlite3/tests/sqlite3_15_open_error.phpt
@@ -2,6 +2,9 @@
 SQLite3::open error test
 --SKIPIF--
 <?php
+if(substr(PHP_OS, 0, 3) == 'WIN' ) {
+	die('skip non windows test');
+}
 require_once(dirname(__FILE__) . '/skipif.inc');
 if (posix_geteuid() == 0) {
     die('SKIP Cannot run test as root.');


commit e85711011634dd402ccc01b2f6cc0521e64dc88a
Merge: 71f620d 19df3c1
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu Apr 26 13:30:25 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug #61800 ext\standard\tests\streams\bug61371.phpt fails



commit 19df3c1b1c3bcb120ba63d3537e7177b8826fb96
Merge: 459e758 4e9db5b
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu Apr 26 13:28:49 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug #61800 ext\standard\tests\streams\bug61371.phpt fails



commit 4e9db5ba9fd0dcaa5f86dc644dfa8a7897ae8dd7
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu Apr 26 13:27:01 2012 +0200

    Fix bug #61800 ext\standard\tests\streams\bug61371.phpt fails

diff --git a/ext/standard/tests/streams/bug61371-win.phpt b/ext/standard/tests/streams/bug61371-win.phpt
new file mode 100644
index 0000000..dc70530
--- /dev/null
+++ b/ext/standard/tests/streams/bug61371-win.phpt
@@ -0,0 +1,45 @@
+--TEST--
+Bug #61371: stream_context_create() causes memory leaks on use streams_socket_create
+--SKIPIF--
+<?php
+if(substr(PHP_OS, 0, 3) != 'WIN' ) {
+	die('skip windows only test');
+}
+--FILE--
+<?php
+function test($doFclose) {
+$previous = null;
+$current = null;
+for($test=1;$test<=3;$test++) {
+	$current = memory_get_usage(true);
+	if (!is_null($previous)) {
+		var_dump($previous == $current);
+	}
+	$previous = $current;
+	echo 'memory: '.round($current / 1024, 0)."kb\n";
+	for($i=0;$i<=100;$i++) {
+		$context = stream_context_create(array());
+		$stream = stream_socket_client('udp://127.0.0.1:80', $errno, $errstr, 10, STREAM_CLIENT_CONNECT, $context);
+		if ($doFclose) fclose($stream);
+		unset($context);
+		unset($stream);
+		unset($errno);
+		unset($errstr);
+	}
+}
+}
+
+test(true);
+test(false);
+?>
+--EXPECTF--
+memory: %dkb
+bool(true)
+memory: %dkb
+bool(true)
+memory: %dkb
+memory: %dkb
+bool(true)
+memory: %dkb
+bool(true)
+memory: %dkb
diff --git a/ext/standard/tests/streams/bug61371.phpt b/ext/standard/tests/streams/bug61371.phpt
index 7fbfa56..7c64d1d 100644
--- a/ext/standard/tests/streams/bug61371.phpt
+++ b/ext/standard/tests/streams/bug61371.phpt
@@ -1,5 +1,10 @@
 --TEST--
 Bug #61371: stream_context_create() causes memory leaks on use streams_socket_create
+--SKIPIF--
+<?php
+if(substr(PHP_OS, 0, 3) == 'WIN' ) {
+	die('skip non windows test');
+}
 --FILE--
 <?php
 function test($doFclose) {


commit 71f620d4367205830b58575c2c7d7bbfa9ad2736
Merge: 743a74a 459e758
Author: Anatoliy Belsky <ab at php.net>
Date:   Wed Apr 25 18:53:56 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Partial fix for bug 61743 to get correct icacls path
      sync version
    
    Conflicts:
    	configure.in



commit 459e758f039c59180b1729dada841a0520e67c5b
Merge: 7d3d38a 433290e
Author: Anatoliy Belsky <ab at php.net>
Date:   Wed Apr 25 18:46:22 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Partial fix for bug 61743 to get correct icacls path



commit 433290e199e29f38cfebf54ba213f4abff4e328a
Author: Anatoliy Belsky <ab at php.net>
Date:   Wed Apr 25 18:38:27 2012 +0200

    Partial fix for bug 61743 to get correct icacls path

diff --git a/ext/standard/tests/file/windows_acls/common.inc b/ext/standard/tests/file/windows_acls/common.inc
index c9be2f1..4007ad0 100644
--- a/ext/standard/tests/file/windows_acls/common.inc
+++ b/ext/standard/tests/file/windows_acls/common.inc
@@ -25,16 +25,29 @@ function get_username(){
 		$user = get_current_user();
 	}
 
+	if (!$user) {
+		$user =  exec('echo %USERNAME%');
+	}
+
 	return $user;
 }
 
 function get_domainname()
 {
-	return getenv('USERDOMAIN');
+	$domain = getenv('USERDOMAIN');
+
+	return $domain;
+}
+
+function get_icacls()
+{
+	$sysroot = exec('echo %SYSTEMROOT%');
+
+	return "$sysroot\\System32\\icacls.exe";
 }
 
 function icacls_set($path, $mode, $perm) {
-	$icacls = 'c:\\Windows\\System32\\icacls.exe';
+	$icacls = get_icacls();
 	$user = get_username();
 	$path_escaped =  '"' . $path . '"';
 	$perm_entry = array();


commit 7d3d38abecf8c0c3897afde68a8d0001a27537cb
Author: Stanislav Malyshev <stas at php.net>
Date:   Tue Apr 24 16:30:37 2012 -0700

    sync version

diff --git a/configure.in b/configure.in
index 76f3598..edc2455 100644
--- a/configure.in
+++ b/configure.in
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
 
 PHP_MAJOR_VERSION=5
 PHP_MINOR_VERSION=4
-PHP_RELEASE_VERSION=1
-PHP_EXTRA_VERSION="RC1-dev"
+PHP_RELEASE_VERSION=2
+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`
 


commit 743a74a3c5aaffbaa3a5248ca310d6ca8b41015f
Merge: edbd958 ac4d53c
Author: Michael Wallner <mike at php.net>
Date:   Tue Apr 24 21:22:39 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      fix NEWS order



commit ac4d53cf70c3e50970a339b0920973aa0560b8ec
Author: Michael Wallner <mike at php.net>
Date:   Tue Apr 24 21:22:19 2012 +0200

    fix NEWS order

diff --git a/NEWS b/NEWS
index 94971ac..e314f26 100644
--- a/NEWS
+++ b/NEWS
@@ -12,8 +12,6 @@ PHP                                                                        NEWS
   . "Connection: close" instead of "Connection: closed" (Gustavo)
 
 - Core:
-  . Fixed bug #61820 (using ob_gzhandler will complain about headers already 
-    sent when no compression). (Mike)
   . Fixed bug #61761 ('Overriding' a private static method with a different 
     signature causes crash). (Laruence)
   . Fixed bug #61728 (PHP crash when calling ob_start in request_shutdown 
@@ -22,7 +20,6 @@ PHP                                                                        NEWS
   . Fixed bug #61650 (ini parser crashes when using ${xxxx} ini variables
     (without apache2)). (Laruence)
   . Fixed bug #61605 (header_remove() does not remove all headers). (Laruence)
-  . Fixed bug #61443 (can't change zlib.output_compression on the fly). (Mike)
   . Fixed bug #61374 (html_entity_decode tries to decode code points that don't
     exist in ISO-8859-1). (Gustavo)
   . Fixed bug #61273 (call_user_func_array with more than 16333 arguments 
@@ -149,6 +146,9 @@ PHP                                                                        NEWS
     Popov)
 
 - Zlib:
+  . Fixed bug #61820 (using ob_gzhandler will complain about headers already 
+    sent when no compression). (Mike)
+  . Fixed bug #61443 (can't change zlib.output_compression on the fly). (Mike)
   . Fixed bug #61306 (initialization of global inappropriate for ZTS). (Gustavo)
   . Fixed bug #61287 (A particular string fails to decompress). (Mike)
   . Fixed bug #61139 (gzopen leaks when specifying invalid mode). (Nikita Popov)


commit edbd958815bddfed6dd307026760284e0becfc21
Merge: a983649 52cb8ed
Author: Michael Wallner <mike at php.net>
Date:   Tue Apr 24 20:43:59 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      BFN



commit 52cb8ed314d5f4476547c6c7955ca96de900333a
Author: Michael Wallner <mike at php.net>
Date:   Tue Apr 24 20:40:19 2012 +0200

    BFN

diff --git a/NEWS b/NEWS
index 3a4bc9a..94971ac 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,8 @@ PHP                                                                        NEWS
   . "Connection: close" instead of "Connection: closed" (Gustavo)
 
 - Core:
+  . Fixed bug #61820 (using ob_gzhandler will complain about headers already 
+    sent when no compression). (Mike)
   . Fixed bug #61761 ('Overriding' a private static method with a different 
     signature causes crash). (Laruence)
   . Fixed bug #61728 (PHP crash when calling ob_start in request_shutdown 
@@ -20,6 +22,7 @@ PHP                                                                        NEWS
   . Fixed bug #61650 (ini parser crashes when using ${xxxx} ini variables
     (without apache2)). (Laruence)
   . Fixed bug #61605 (header_remove() does not remove all headers). (Laruence)
+  . Fixed bug #61443 (can't change zlib.output_compression on the fly). (Mike)
   . Fixed bug #61374 (html_entity_decode tries to decode code points that don't
     exist in ISO-8859-1). (Gustavo)
   . Fixed bug #61273 (call_user_func_array with more than 16333 arguments 


commit a9836496e3abdcd3f6069f2d525e1e5c98b303c9
Merge: 342b641 7c93a16
Author: Michael Wallner <mike at php.net>
Date:   Tue Apr 24 20:37:29 2012 +0200

    Merge branch 'PHP-5.4'



commit 7c93a16477d7e4d6e0386d0613558360f036d57b
Author: Michael Wallner <mike at php.net>
Date:   Tue Apr 24 20:35:49 2012 +0200

    fix bug #61443
    
    Since upgrade to PHP 5.4, we can't change zlib.output_compression on the
    fly
    
    the check for PHP_OUTPUT_WRITTEN was over-zealous

diff --git a/ext/zlib/tests/bug61443.phpt b/ext/zlib/tests/bug61443.phpt
new file mode 100644
index 0000000..ea2fa68
--- /dev/null
+++ b/ext/zlib/tests/bug61443.phpt
@@ -0,0 +1,15 @@
+--TEST--
+bug #61443
+--SKIPIF--
+<?php
+extension_loaded("zlib") or die("skip");
+?>
+--FILE--
+<?php
+ob_start(); echo "foo\n"; ob_get_clean(); 
+if(!headers_sent()) ini_set('zlib.output_compression', true); echo "end\n";
+?>
+DONE
+--EXPECTF--
+end
+DONE
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 545979d..f157821 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -884,9 +884,6 @@ static PHP_INI_MH(OnUpdate_zlib_output_compression)
 		if (status & PHP_OUTPUT_SENT) {
 			php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "Cannot change zlib.output_compression - headers already sent");
 			return FAILURE;
-		} else if ((status & PHP_OUTPUT_WRITTEN) && int_value) {
-			php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "Cannot enable zlib.output_compression - there has already been output");
-			return FAILURE;
 		}
 	}
 


commit 342b641a93355e9debea263b66accd5726d8ae04
Merge: 1172071 df00b64
Author: Michael Wallner <mike at php.net>
Date:   Tue Apr 24 19:52:45 2012 +0200

    Merge branch 'PHP-5.4'



commit df00b64cb93dafbe5ae47bf733e826b54b32ae37
Author: Michael Wallner <mike at php.net>
Date:   Tue Apr 24 19:50:00 2012 +0200

    fixed bug #61820
    
    using ob_gzhandler will complain about headers already sent
    when no compression
    
    the Vary header should only be sent on the PHP_OUTPUT_HANDLER_START
    event

diff --git a/ext/zlib/tests/bug61820.phpt b/ext/zlib/tests/bug61820.phpt
new file mode 100644
index 0000000..6f33b54
--- /dev/null
+++ b/ext/zlib/tests/bug61820.phpt
@@ -0,0 +1,23 @@
+--TEST--
+bug #61820 using ob_gzhandler will complain about headers already sent when no compression
+--SKIPIF--
+<?php
+extension_loaded("zlib") or die("skip");
+?>
+--FILE--
+<?php
+ob_start('ob_gzhandler');
+
+echo "Hi there.\n";
+ob_flush();
+flush();
+
+echo "This is confusing...\n";
+ob_flush();
+flush();
+?>
+DONE
+--EXPECT--
+Hi there.
+This is confusing...
+DONE
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index d472573..545979d 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -187,7 +187,9 @@ static int php_zlib_output_handler(void **handler_context, php_output_context *o
 			-Vary: $ HTTP_ACCEPT_ENCODING=gzip ./sapi/cgi/php <<<'<?php ob_start("ob_gzhandler"); echo "foo\n"; ob_end_clean();'
 			-Vary: $ HTTP_ACCEPT_ENCODING= ./sapi/cgi/php <<<'<?php ob_start("ob_gzhandler"); echo "foo\n"; ob_end_clean();'
 		*/
-		if (output_context->op != (PHP_OUTPUT_HANDLER_START|PHP_OUTPUT_HANDLER_CLEAN|PHP_OUTPUT_HANDLER_FINAL)) {
+		if ((output_context->op & PHP_OUTPUT_HANDLER_START)
+		&&	(output_context->op != (PHP_OUTPUT_HANDLER_START|PHP_OUTPUT_HANDLER_CLEAN|PHP_OUTPUT_HANDLER_FINAL))
+		) {
 			sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 1 TSRMLS_CC);
 		}
 		return FAILURE;


commit 117207121cd8e98549fb260a9e1ba142f31c7d42
Merge: c9d89a3 f21376d
Author: Anatoliy Belsky <ab at php.net>
Date:   Tue Apr 24 14:09:07 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug #61413 ext\openssl\tests\openssl_encrypt_crash.phpt fails 5.3 only



commit f21376d6688ef51d6d6764016f8a4c2e2fd57549
Merge: c7f9f54 270a406
Author: Anatoliy Belsky <ab at php.net>
Date:   Tue Apr 24 14:08:26 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug #61413 ext\openssl\tests\openssl_encrypt_crash.phpt fails 5.3 only



commit 270a406ac94b5fc5cc9ef59fc61e3b4b95648a3e
Author: Anatoliy Belsky <ab at php.net>
Date:   Tue Apr 24 14:05:35 2012 +0200

    Fix bug #61413 ext\openssl\tests\openssl_encrypt_crash.phpt fails 5.3 only

diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 7c5afc5..779a91d 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -4677,7 +4677,7 @@ PHP_FUNCTION(openssl_encrypt)
 	int data_len, method_len, password_len, iv_len = 0, max_iv_len;
 	const EVP_CIPHER *cipher_type;
 	EVP_CIPHER_CTX cipher_ctx;
-	int i, outlen, keylen;
+	int i = 0, outlen, keylen;
 	unsigned char *outbuf, *key;
 	zend_bool free_iv;
 


commit c9d89a349b811607bdb4a50883b0ec3a65d561b7
Merge: d77cde4 c7f9f54
Author: Anatoliy Belsky <ab at php.net>
Date:   Tue Apr 24 13:45:07 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Bug 61610 adopted expected warnings for 5.4



commit c7f9f54a2374847fe079c86ed07a90bc501f5660
Author: Anatoliy Belsky <ab at php.net>
Date:   Tue Apr 24 13:36:43 2012 +0200

    Bug 61610 adopted expected warnings for 5.4

diff --git a/ext/date/tests/date_default_timezone_get-1-win32.phpt b/ext/date/tests/date_default_timezone_get-1-win32.phpt
index a12418f..ed9ac1a 100644
--- a/ext/date/tests/date_default_timezone_get-1-win32.phpt
+++ b/ext/date/tests/date_default_timezone_get-1-win32.phpt
@@ -17,8 +17,8 @@ date.timezone=
           parametrized so there is no hardcoded timezone data.*/
 ?>
 --EXPECTF--
-Warning: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected '%s' for '%s' instead in %sdate_default_timezone_get-1-win32.php on line 3
+Warning: date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone '%s' for now, but please set date.timezone to select your timezone. in %s on line %d
 %s
 
-Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected '%s' for '%s' instead in %sdate_default_timezone_get-1-win32.php on line 4
+Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone '%s' for now, but please set date.timezone to select your timezone. in %s on line %d
 %s


commit d77cde46e138b41c944807545489e82c4ac12b8d
Merge: 93d42fb 485638a
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Mon Apr 23 22:10:50 2012 +0100

    Merge branch '5.4'



commit 485638a09c23e48820e0160c26098b0ef571c533
Merge: 883d406 8d748e5
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Mon Apr 23 22:10:23 2012 +0100

    Merge branch '5.3' into 5.4



commit 8d748e5de519867d9b6ce40e3ea28a209b07768f
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Mon Apr 23 22:09:38 2012 +0100

    Fixed bug #61764: 'I' unpacks n as signed if n > 2^31-1 on LP64
    
    Also fixed possible invalid read on big endian LP64.

diff --git a/NEWS b/NEWS
index a483909..b8193c9 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ PHP                                                                        NEWS
 ?? ??? 2012, PHP 5.3.12
 
 - Core:
+  . Fixed bug #61764 ('I' unpacks n as signed if n > 2^31-1 on LP64). (Gustavo)
   . Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename
    set to null). (Anatoliy)
 
diff --git a/ext/standard/pack.c b/ext/standard/pack.c
index 5ad1ecf..5d3c8a8 100644
--- a/ext/standard/pack.c
+++ b/ext/standard/pack.c
@@ -759,16 +759,14 @@ PHP_FUNCTION(unpack)
 
 					case 'i': 
 					case 'I': {
-						long v = 0;
+						long v;
 						int issigned = 0;
 
 						if (type == 'i') {
 							issigned = input[inputpos + (machine_little_endian ? (sizeof(int) - 1) : 0)] & 0x80;
-						} else if (sizeof(long) > 4 && (input[inputpos + machine_endian_long_map[3]] & 0x80) == 0x80) {
-							v = ~INT_MAX;
 						}
 
-						v |= php_unpack(&input[inputpos], sizeof(int), issigned, int_map);
+						v = php_unpack(&input[inputpos], sizeof(int), issigned, int_map);
 						add_assoc_long(return_value, n, v);
 						break;
 					}
diff --git a/ext/standard/tests/strings/bug38770.phpt b/ext/standard/tests/strings/bug38770.phpt
index 417794c..1821639 100644
--- a/ext/standard/tests/strings/bug38770.phpt
+++ b/ext/standard/tests/strings/bug38770.phpt
@@ -7,7 +7,7 @@ if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
 --FILE--
 <?php
 
-foreach (array('N','I','l') as $v) {
+foreach (array('N','l') as $v) {
 	print_r(unpack($v, pack($v, -30000)));
 }
 
@@ -22,8 +22,4 @@ Array
 (
     [1] => -30000
 )
-Array
-(
-    [1] => -30000
-)
 Done
diff --git a/ext/standard/tests/strings/bug61764.phpt b/ext/standard/tests/strings/bug61764.phpt
new file mode 100644
index 0000000..dc44f25
--- /dev/null
+++ b/ext/standard/tests/strings/bug61764.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Bug #61764: 'I' unpacks n as signed if n > 2^31-1 on LP64
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
+--FILE--
+<?php
+//expected -30000 mod 2^32 = 4294937296, and not -30000
+//because we can represent 4294937296 with our PHP int type
+print_r(unpack('I', pack('L', -30000)));
+--EXPECT--
+Array
+(
+    [1] => 4294937296
+)


commit 93d42fb444cbcd3850afd3db028319b8d4c30f10
Merge: 51aacf4 883d406
Author: Felipe Pena <felipensp at gmail.com>
Date:   Mon Apr 23 15:19:35 2012 -0300

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      - Fixed bug #61829 (Memory leak when calling MessageFormatter's constructor twice)



commit 883d40667d1e71b923aa05b7a4fffc8d98ab9b5e
Merge: dd67f06 c8865e3
Author: Felipe Pena <felipensp at gmail.com>
Date:   Mon Apr 23 15:19:23 2012 -0300

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      - Fixed bug #61829 (Memory leak when calling MessageFormatter's constructor twice)



commit c8865e3b84c9a3d08811b3b8f954defcd8fb621d
Author: Felipe Pena <felipensp at gmail.com>
Date:   Mon Apr 23 15:18:12 2012 -0300

    - Fixed bug #61829 (Memory leak when calling MessageFormatter's constructor twice)

diff --git a/ext/intl/msgformat/msgformat.c b/ext/intl/msgformat/msgformat.c
index b31db9d..84f14de 100755
--- a/ext/intl/msgformat/msgformat.c
+++ b/ext/intl/msgformat/msgformat.c
@@ -68,6 +68,10 @@ static void msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
 		INTL_CTOR_CHECK_STATUS(mfo, "msgfmt_create: error converting pattern to quote-friendly format");
 	}
 
+	if ((mfo)->mf_data.orig_format) {
+		msgformat_data_free(&mfo->mf_data TSRMLS_CC);
+	}
+
 	(mfo)->mf_data.orig_format = estrndup(pattern, pattern_len);
 	(mfo)->mf_data.orig_format_len = pattern_len;
 	


commit 51aacf409f6338a29aec00f528cc231eeb971272
Merge: c530fd9 dd67f06
Author: Anatoliy Belsky <ab at php.net>
Date:   Sun Apr 22 19:30:26 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug #61811 three of finfo tests failed, see also #61812.



commit dd67f066f7079b1384deac4cfd0d9249402da43d
Merge: 0d115ca da1b534
Author: Anatoliy Belsky <ab at php.net>
Date:   Sun Apr 22 19:29:52 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug #61811 three of finfo tests failed, see also #61812.



commit da1b5346017899d1f09c908eee2d166249160293
Author: Anatoliy Belsky <ab at php.net>
Date:   Sun Apr 22 19:26:54 2012 +0200

    Fix bug #61811 three of finfo tests failed, see also #61812.
    
    The remaining two was assidentially merged back from 5.4

diff --git a/ext/fileinfo/tests/finfo_open_001.phpt b/ext/fileinfo/tests/finfo_open_001.phpt
index 17935c3..69696eb 100644
--- a/ext/fileinfo/tests/finfo_open_001.phpt
+++ b/ext/fileinfo/tests/finfo_open_001.phpt
@@ -14,28 +14,10 @@ var_dump(finfo_open(FILEINFO_MIME, '/foo/bar/inexistent'));
 
 ?>
 --EXPECTF--
-Warning: finfo_open() expects parameter 2 to be a valid path, string given in %s on line %d
+Warning: finfo_open(): Failed to load magic database at ''. in %s on line %d
 bool(false)
 resource(%d) of type (file_info)
 resource(%d) of type (file_info)
-
-Warning: finfo_open(%s123): failed to open stream: No such file or directory in %s on line %d
-
-Warning: finfo_open(%s123): failed to open stream: No such file or directory in %s on line %d
-
-Warning: finfo_open(): Failed to load magic database at '%s123'. in %s on line %d
 bool(false)
-
-Warning: finfo_open(%s1): failed to open stream: No such file or directory in %s on line %d
-
-Warning: finfo_open(%s1): failed to open stream: No such file or directory in %s on line %d
-
-Warning: finfo_open(): Failed to load magic database at '%s1'. in %s on line %d
 bool(false)
-
-Warning: finfo_open(%sinexistent): failed to open stream: No such file or directory in %s on line %d
-
-Warning: finfo_open(%sinexistent): failed to open stream: No such file or directory in %s on line %d
-
-Warning: finfo_open(): Failed to load magic database at '%sinexistent'. in %s on line %d
 bool(false)
diff --git a/ext/fileinfo/tests/finfo_open_error.phpt b/ext/fileinfo/tests/finfo_open_error.phpt
index 19ae7a6..aae229f 100644
--- a/ext/fileinfo/tests/finfo_open_error.phpt
+++ b/ext/fileinfo/tests/finfo_open_error.phpt
@@ -26,12 +26,6 @@ var_dump( new finfo('foobar') );
 ===DONE===
 --EXPECTF--
 *** Testing finfo_open() : error functionality ***
-
-Warning: finfo_open(%sfoobarfile): failed to open stream: No such file or directory in %s on line %d
-
-Warning: finfo_open(%sfoobarfile): failed to open stream: No such file or directory in %s on line %d
-
-Warning: finfo_open(): Failed to load magic database at '%sfoobarfile'. in %s on line %d
 bool(false)
 
 Warning: finfo_open() expects parameter 1 to be long, array given in %s on line %d
@@ -43,9 +37,9 @@ bool(false)
 Notice: finfo_open(): Warning: using regular magic file `%s' in %s on line %d
 resource(%d) of type (file_info)
 
-Warning: finfo_open() expects parameter 1 to be long, string given in %s on line %d
+Warning: finfo_open() expects parameter 1 to be long, %unicode_string_optional% given in %s on line %d
 bool(false)
 
-Warning: finfo::finfo() expects parameter 1 to be long, string given in %s on line %d
+Warning: finfo::finfo() expects parameter 1 to be long, %unicode_string_optional% given in %s on line %d
 NULL
 ===DONE===


commit c530fd95368b5b2f1c52e15d93d9eb4841c0fe35
Merge: 1b1e911 0d115ca
Author: Xinchen Hui <laruence at php.net>
Date:   Sun Apr 22 20:00:07 2012 +0800

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fixed warning implicit declaration of function 'file_printedlen'



commit 0d115ca2116f7d3cee7f5d1b27622d9acf440284
Merge: 3ca1976 f13b0ed
Author: Xinchen Hui <laruence at php.net>
Date:   Sun Apr 22 19:59:46 2012 +0800

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fixed warning implicit declaration of function 'file_printedlen'



commit f13b0ede0764f63762f105fb6c62de460f7b7490
Author: Xinchen Hui <laruence at php.net>
Date:   Sun Apr 22 19:52:07 2012 +0800

    Fixed warning implicit declaration of function 'file_printedlen'

diff --git a/ext/fileinfo/libmagic.patch b/ext/fileinfo/libmagic.patch
index 73e4826..baeac1d 100644
--- a/ext/fileinfo/libmagic.patch
+++ b/ext/fileinfo/libmagic.patch
@@ -1080,7 +1080,7 @@ diff -u libmagic.orig/compress.c libmagic/compress.c
 +#endif /* if PHP_FILEINFO_UNCOMPRESS */
 diff -u libmagic.orig/file.h libmagic/file.h
 --- libmagic.orig/file.h	2012-04-22 19:30:43.186305188 +0800
-+++ libmagic/file.h	2012-04-22 19:28:57.378309534 +0800
++++ libmagic/file.h	2012-04-22 19:49:58.922256776 +0800
 @@ -33,11 +33,9 @@
  #ifndef __file_h__
  #define __file_h__
@@ -1200,7 +1200,13 @@ diff -u libmagic.orig/file.h libmagic/file.h
  protected void file_showstr(FILE *, const char *, size_t);
  protected size_t file_mbswidth(const char *);
  protected const char *file_getbuffer(struct magic_set *);
-@@ -443,11 +439,8 @@
+@@ -438,16 +434,14 @@
+     size_t *);
+ protected size_t file_pstring_length_size(const struct magic *);
+ protected size_t file_pstring_get_length(const struct magic *, const char *);
++protected size_t file_printedlen(const struct magic_set *ms);
+ #ifdef __EMX__
+ protected int file_os2_apptype(struct magic_set *, const char *, const void *,
      size_t);
  #endif /* __EMX__ */
  
@@ -1212,7 +1218,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
  
  #ifndef HAVE_STRERROR
  extern int sys_nerr;
-@@ -460,17 +453,10 @@
+@@ -460,17 +454,10 @@
  #define strtoul(a, b, c)	strtol(a, b, c)
  #endif
  
@@ -1232,7 +1238,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
  size_t strlcat(char *dst, const char *src, size_t siz);
  #endif
  #ifndef HAVE_GETLINE
-@@ -500,4 +486,12 @@
+@@ -500,4 +487,12 @@
  #define FILE_RCSID(id)
  #endif
  
diff --git a/ext/fileinfo/libmagic/file.h b/ext/fileinfo/libmagic/file.h
index e1269ae..3879b47 100644
--- a/ext/fileinfo/libmagic/file.h
+++ b/ext/fileinfo/libmagic/file.h
@@ -434,6 +434,7 @@ protected int file_looks_utf8(const unsigned char *, size_t, unichar *,
     size_t *);
 protected size_t file_pstring_length_size(const struct magic *);
 protected size_t file_pstring_get_length(const struct magic *, const char *);
+protected size_t file_printedlen(const struct magic_set *ms);
 #ifdef __EMX__
 protected int file_os2_apptype(struct magic_set *, const char *, const void *,
     size_t);


commit 1b1e91167e6be9cd24693841c8850176e277c134
Merge: ca7b122 3ca1976
Author: Xinchen Hui <laruence at php.net>
Date:   Sun Apr 22 19:40:22 2012 +0800

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Update NEWS
      Fixed bug #61812 (Uninitialised value used in libmagic)



commit 3ca1976b3cb3d96bf6514e407e9e02447809dcca
Author: Xinchen Hui <laruence at php.net>
Date:   Sun Apr 22 19:39:50 2012 +0800

    Update NEWS

diff --git a/NEWS b/NEWS
index b336316..3a4bc9a 100644
--- a/NEWS
+++ b/NEWS
@@ -54,6 +54,8 @@ PHP                                                                        NEWS
   . Improve performance of set_exception_handler while doing reset (Laruence)
 
 - FPM
+  . Fixed bug #61812 (Uninitialised value used in libmagic). 
+    (Laruence, Gustavo)
   . Fixed bug #61430 (Transposed memset() params in sapi/fpm/fpm/fpm_shm.c).
     (michaelhood at gmail dot com, Ilia)
 


commit b2253307075d9fd49c6faeed1409827ec7281bc0
Merge: a571039 c06e92a
Author: Xinchen Hui <laruence at php.net>
Date:   Sun Apr 22 19:39:02 2012 +0800

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fixed bug #61812 (Uninitialised value used in libmagic)



commit c06e92a5334c15726901edbca112cfd0d38eec8d
Author: Xinchen Hui <laruence at php.net>
Date:   Sun Apr 22 19:38:14 2012 +0800

    Fixed bug #61812 (Uninitialised value used in libmagic)

diff --git a/NEWS b/NEWS
index 79e9f7a..a483909 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,10 @@ PHP                                                                        NEWS
   . Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename
    set to null). (Anatoliy)
 
+- Fileinfo:
+  . Fixed bug #61812 (Uninitialised value used in libmagic). 
+    (Laruence, Gustavo)
+
 - JSON
   . Fixed bug #61537 (json_encode() incorrectly truncates/discards
     information). (Adam)
diff --git a/ext/fileinfo/libmagic.patch b/ext/fileinfo/libmagic.patch
index a8b3c7a..73e4826 100644
--- a/ext/fileinfo/libmagic.patch
+++ b/ext/fileinfo/libmagic.patch
@@ -1,5 +1,6 @@
---- libmagic.orig/apprentice.c	Mon Apr  2 16:46:43 2012
-+++ libmagic/apprentice.c	Wed Mar 28 15:35:25 2012
+diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
+--- libmagic.orig/apprentice.c	2012-04-22 19:30:43.182305355 +0800
++++ libmagic/apprentice.c	2012-04-22 19:28:57.346309536 +0800
 @@ -29,6 +29,8 @@
   * apprentice - make one pass through /etc/magic, learning its secrets.
   */
@@ -727,8 +728,9 @@
  		m->str_range = swap4(m->str_range);
  		m->str_flags = swap4(m->str_flags);
  	}
---- libmagic.orig/ascmagic.c	Mon Apr  2 16:46:43 2012
-+++ libmagic/ascmagic.c	Wed Mar 28 15:35:25 2012
+diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
+--- libmagic.orig/ascmagic.c	2012-04-22 19:30:43.182305355 +0800
++++ libmagic/ascmagic.c	2012-04-22 19:28:57.330309533 +0800
 @@ -139,10 +139,8 @@
  		/* malloc size is a conservative overestimate; could be
  		   improved, or at least realloced after conversion. */
@@ -752,8 +754,9 @@
  
  	return rv;
  }
---- libmagic.orig/cdf.c	Mon Apr  2 16:46:43 2012
-+++ libmagic/cdf.c	Mon Apr  2 16:41:41 2012
+diff -u libmagic.orig/cdf.c libmagic/cdf.c
+--- libmagic.orig/cdf.c	2012-04-22 19:30:43.182305355 +0800
++++ libmagic/cdf.c	2012-04-22 19:28:57.370309531 +0800
 @@ -43,7 +43,17 @@
  #include <err.h>
  #endif
@@ -815,8 +818,9 @@
  				cdf_print_elapsed_time(buf, sizeof(buf), tp);
  				(void)fprintf(stderr, "timestamp %s\n", buf);
  			} else {
---- libmagic.orig/cdf.h	Mon Apr  2 16:46:43 2012
-+++ libmagic/cdf.h	Wed Mar 28 15:35:25 2012
+diff -u libmagic.orig/cdf.h libmagic/cdf.h
+--- libmagic.orig/cdf.h	2012-04-22 19:30:43.182305355 +0800
++++ libmagic/cdf.h	2012-04-22 19:28:57.370309531 +0800
 @@ -35,7 +35,7 @@
  #ifndef _H_CDF_
  #define _H_CDF_
@@ -852,8 +856,9 @@
  int cdf_read_header(const cdf_info_t *, cdf_header_t *);
  void cdf_swap_header(cdf_header_t *);
  void cdf_unpack_header(cdf_header_t *, char *);
---- libmagic.orig/cdf_time.c	Mon Apr  2 16:46:43 2012
-+++ libmagic/cdf_time.c	Wed Mar 28 15:35:25 2012
+diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
+--- libmagic.orig/cdf_time.c	2012-04-22 19:30:43.182305355 +0800
++++ libmagic/cdf_time.c	2012-04-22 19:28:57.326309537 +0800
 @@ -96,7 +96,7 @@
  }
  
@@ -910,8 +915,9 @@
  	static const cdf_timestamp_t tst = 0x01A5E403C2D59C00ULL;
  	static const char *ref = "Sat Apr 23 01:30:00 1977";
  	char *p, *q;
---- libmagic.orig/compress.c	Mon Apr  2 16:46:43 2012
-+++ libmagic/compress.c	Mon Apr  2 16:41:41 2012
+diff -u libmagic.orig/compress.c libmagic/compress.c
+--- libmagic.orig/compress.c	2012-04-22 19:30:43.182305355 +0800
++++ libmagic/compress.c	2012-04-22 19:28:57.314309548 +0800
 @@ -32,6 +32,7 @@
   *	uncompress(method, old, n, newch) - uncompress old into new, 
   *					    using method, return sizeof new
@@ -1072,8 +1078,9 @@
  }
 -#endif
 +#endif /* if PHP_FILEINFO_UNCOMPRESS */
---- libmagic.orig/file.h	Mon Apr  2 16:46:43 2012
-+++ libmagic/file.h	Mon Apr  2 16:41:41 2012
+diff -u libmagic.orig/file.h libmagic/file.h
+--- libmagic.orig/file.h	2012-04-22 19:30:43.186305188 +0800
++++ libmagic/file.h	2012-04-22 19:28:57.378309534 +0800
 @@ -33,11 +33,9 @@
  #ifndef __file_h__
  #define __file_h__
@@ -1225,23 +1232,22 @@
  size_t strlcat(char *dst, const char *src, size_t siz);
  #endif
  #ifndef HAVE_GETLINE
-@@ -498,6 +484,14 @@
- #endif
- #else
+@@ -500,4 +486,12 @@
  #define FILE_RCSID(id)
-+#endif
-+
+ #endif
+ 
 +#ifdef PHP_WIN32
 +#define FINFO_LSEEK_FUNC _lseek
 +#define FINFO_READ_FUNC _read
 +#else
 +#define FINFO_LSEEK_FUNC lseek
 +#define FINFO_READ_FUNC read
- #endif
- 
++#endif
++
  #endif /* __file_h__ */
---- libmagic.orig/fsmagic.c	Mon Apr  2 16:46:43 2012
-+++ libmagic/fsmagic.c	Wed Mar 28 15:35:26 2012
+diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
+--- libmagic.orig/fsmagic.c	2012-04-22 19:30:43.186305188 +0800
++++ libmagic/fsmagic.c	2012-04-22 19:28:57.298309521 +0800
 @@ -59,27 +59,21 @@
  # define minor(dev)  ((dev) & 0xff)
  #endif
@@ -1564,8 +1570,9 @@
  	}
  
  	/*
---- libmagic.orig/funcs.c	Mon Apr  2 16:46:43 2012
-+++ libmagic/funcs.c	Fri Mar 30 16:43:40 2012
+diff -u libmagic.orig/funcs.c libmagic/funcs.c
+--- libmagic.orig/funcs.c	2012-04-22 19:30:43.186305188 +0800
++++ libmagic/funcs.c	2012-04-22 19:28:57.370309531 +0800
 @@ -41,52 +41,42 @@
  #if defined(HAVE_WCTYPE_H)
  #include <wctype.h>
@@ -1803,7 +1810,7 @@
 +	pcre_cache_entry *pce;
 +	char *res;
 +	zval *repl;
-+	int res_len, rep_cnt;
++	int res_len, rep_cnt = 0;
 +	TSRMLS_FETCH();
 +
 +	MAKE_STD_ZVAL(patt);
@@ -1859,8 +1866,11 @@
 +	return rep_cnt;
  }
 +
---- libmagic.orig/magic.c	Mon Apr  2 16:46:43 2012
-+++ libmagic/magic.c	Mon Apr  2 12:38:04 2012
+Only in libmagic.orig: funcs.c.orig
+Only in libmagic.orig: funcs.c.rej
+diff -u libmagic.orig/magic.c libmagic/magic.c
+--- libmagic.orig/magic.c	2012-04-22 19:30:43.186305188 +0800
++++ libmagic/magic.c	2012-04-22 19:28:57.370309531 +0800
 @@ -25,11 +25,6 @@
   * SUCH DAMAGE.
   */
@@ -2236,8 +2246,9 @@
  
  public const char *
  magic_error(struct magic_set *ms)
---- libmagic.orig/magic.h	Mon Apr  2 16:46:43 2012
-+++ libmagic/magic.h	Wed Mar 28 15:35:26 2012
+diff -u libmagic.orig/magic.h libmagic/magic.h
+--- libmagic.orig/magic.h	2012-04-22 19:30:43.190305058 +0800
++++ libmagic/magic.h	2012-04-22 19:28:57.326309537 +0800
 @@ -85,6 +85,7 @@
  
  const char *magic_getpath(const char *, int);
@@ -2254,8 +2265,9 @@
  int magic_list(magic_t, const char *);
  int magic_errno(magic_t);
  
---- libmagic.orig/print.c	Mon Apr  2 16:46:43 2012
-+++ libmagic/print.c	Wed Mar 28 19:58:09 2012
+diff -u libmagic.orig/print.c libmagic/print.c
+--- libmagic.orig/print.c	2012-04-22 19:30:43.190305058 +0800
++++ libmagic/print.c	2012-04-22 19:28:57.326309537 +0800
 @@ -29,6 +29,9 @@
   * print.c - debugging printout routines
   */
@@ -2448,8 +2460,9 @@
  }
  
  protected const char *
---- libmagic.orig/readcdf.c	Mon Apr  2 16:46:43 2012
-+++ libmagic/readcdf.c	Wed Mar 28 15:35:26 2012
+diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
+--- libmagic.orig/readcdf.c	2012-04-22 19:30:43.190305058 +0800
++++ libmagic/readcdf.c	2012-04-22 19:28:57.326309537 +0800
 @@ -30,7 +30,11 @@
  #endif
  
@@ -2495,8 +2508,9 @@
                                          c = cdf_ctime(&ts.tv_sec);
                                          if ((ec = strchr(c, '\n')) != NULL)
                                                  *ec = '\0';
---- libmagic.orig/readelf.c	Mon Apr  2 16:46:43 2012
-+++ libmagic/readelf.c	Mon Apr  2 16:41:41 2012
+diff -u libmagic.orig/readelf.c libmagic/readelf.c
+--- libmagic.orig/readelf.c	2012-04-22 19:30:43.190305058 +0800
++++ libmagic/readelf.c	2012-04-22 19:28:57.378309534 +0800
 @@ -49,7 +49,7 @@
      off_t, int *, int);
  private int doshn(struct magic_set *, int, int, int, off_t, int, size_t,
@@ -2651,8 +2665,9 @@
  		fd = file_pipe2file(ms, fd, buf, nbytes);
  
  	if (fstat(fd, &st) == -1) {
---- libmagic.orig/softmagic.c	Mon Apr  2 16:46:43 2012
-+++ libmagic/softmagic.c	Wed Mar 28 15:35:26 2012
+diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
+--- libmagic.orig/softmagic.c	2012-04-22 19:30:43.194304945 +0800
++++ libmagic/softmagic.c	2012-04-22 19:28:57.286309597 +0800
 @@ -41,6 +41,11 @@
  #include <stdlib.h>
  #include <time.h>
diff --git a/ext/fileinfo/libmagic/funcs.c b/ext/fileinfo/libmagic/funcs.c
index 0fc9201..2b37929 100644
--- a/ext/fileinfo/libmagic/funcs.c
+++ b/ext/fileinfo/libmagic/funcs.c
@@ -438,7 +438,7 @@ file_replace(struct magic_set *ms, const char *pat, const char *rep)
 	pcre_cache_entry *pce;
 	char *res;
 	zval *repl;
-	int res_len, rep_cnt;
+	int res_len, rep_cnt = 0;
 	TSRMLS_FETCH();
 
 	MAKE_STD_ZVAL(patt);


commit a5710398700605d264a1bb27a6af9afef614ad12
Merge: bb2f806 9a22bc2
Author: Johannes Schlüter <johannes at php.net>
Date:   Sun Apr 22 02:26:07 2012 +0200

    Merge branch 'PHP-5.4' of git.php.net:/php-src into PHP-5.4
    
    * 'PHP-5.4' of git.php.net:/php-src:
      Fix test
      typo in test
      Make css string constant
      Fixed typo
      Improved performance while sending error page
      - BFN
      - BFN
      - Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename set to null) patch by ab at php.net
      - Fixed expected test result (patch by ab at php.net in #61769)
      - Fix test title
      add pg_escape_identifier/pg_escape_literal
      fix RCs
      Update to 5.4.2-dev
      Bug#59597 NumberFormatter::parse() with TYPE_INT64 results in a 32 bit integer



commit ca7b122c8ce050685fd4f0bbb3dad57e4d01741c
Merge: 5ffe5d4 bb2f806
Author: Johannes Schlüter <johannes at php.net>
Date:   Sun Apr 22 02:25:36 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix folding



commit bb2f8065344c8a7084ff9cccbbcb0321da08fb93
Author: Johannes Schlüter <johannes at php.net>
Date:   Sun Apr 22 02:25:02 2012 +0200

    Fix folding

diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c
index 61fdeac..797cadd 100644
--- a/ext/mysqlnd/mysqlnd.c
+++ b/ext/mysqlnd/mysqlnd.c
@@ -975,7 +975,7 @@ MYSQLND_METHOD(mysqlnd_conn, connect)(MYSQLND * conn_handle,
 	}
 	DBG_RETURN(ret);
 }
-
+/* }}} */
 
 /* {{{ mysqlnd_connect */
 PHPAPI MYSQLND * mysqlnd_connect(MYSQLND * conn_handle,


commit 5ffe5d471f12235712cfba3b6199856255aed656
Merge: 652fdbe 9a22bc2
Author: Xinchen Hui <laruence at php.net>
Date:   Sat Apr 21 16:03:53 2012 +0800

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix test
      - BFN



commit 9a22bc2662f82bceb94d01e016b6404ea62fa51c
Merge: 8d44b91 2e9eb5e
Author: Xinchen Hui <laruence at php.net>
Date:   Sat Apr 21 16:03:18 2012 +0800

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix test
      - BFN



commit 2e9eb5e32fb489d73cb336730104d507b20d9652
Author: Xinchen Hui <laruence at php.net>
Date:   Sat Apr 21 16:02:25 2012 +0800

    Fix test
    
    Reported by cjones

diff --git a/ext/standard/tests/streams/bug60106.phpt b/ext/standard/tests/streams/bug60106.phpt
index f96c5b4..1b36af1 100644
--- a/ext/standard/tests/streams/bug60106.phpt
+++ b/ext/standard/tests/streams/bug60106.phpt
@@ -7,12 +7,17 @@ if( substr(PHP_OS, 0, 3) == "WIN" )
 ?>
 --FILE--
 <?php
-	error_reporting(E_ALL | E_NOTICE);
-	stream_socket_server("unix:///tmp/" . str_repeat("a", 512));
+error_reporting(E_ALL | E_NOTICE);
+$socket_file = "/tmp/" . str_repeat("a", 512);
+function get_truncated_socket_filename($errno, $errmsg, $file, $line) {
+    global $socket_file;
+    print_r ($errmsg);
+    preg_match("#maximum allowed length of (\d+) bytes#", $errmsg, $matches);
+    $socket_file = substr($socket_file, 0, intval($matches[1]) - 1);
+}
+set_error_handler("get_truncated_socket_filename", E_NOTICE);
+stream_socket_server("unix://" . $socket_file);
+unlink($socket_file);
 ?>
-===DONE===
 --EXPECTF--
-Notice: stream_socket_server(): socket path exceeded the maximum allowed length of %d bytes and was truncated in %sbug60106.php on line %d
-
-Warning: stream_socket_server(): unable to connect to unix:///tmp/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa (Unknown error) in %sbug60106.php on line %d
-===DONE===
+stream_socket_server(): socket path exceeded the maximum allowed length of %d bytes and was truncated


commit 652fdbe7893d9feef6816702a6b446e065d8eb12
Merge: 303c52b 8d44b91
Author: Xinchen Hui <laruence at php.net>
Date:   Sat Apr 21 10:16:08 2012 +0800

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      typo in test



commit 8d44b91731582705a8be7012e92ddd02eb02af5d
Author: Xinchen Hui <laruence at php.net>
Date:   Sat Apr 21 10:15:35 2012 +0800

    typo in test

diff --git a/sapi/cli/tests/php_cli_server_016.phpt b/sapi/cli/tests/php_cli_server_016.phpt
index fc98d1a..f15aff12 100644
--- a/sapi/cli/tests/php_cli_server_016.phpt
+++ b/sapi/cli/tests/php_cli_server_016.phpt
@@ -1,7 +1,7 @@
 --TEST--
 Bug #60591 (Memory leak when access a non-exists file)
 --DESCRIPTION--
-this is an indirect test for bug 50691, since mem leak is reproted in the server side
+this is an indirect test for bug 60591, since mem leak is reproted in the server side
 and require php compiled with --enable-debug
 --SKIPIF--
 <?php


commit 303c52b54d19b75b33c1e919c68a0dfc6e336126
Merge: 465e9a1 b999e91
Author: Xinchen Hui <laruence at php.net>
Date:   Sat Apr 21 09:31:45 2012 +0800

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Make css string constant



commit b999e91f5bd0f366d67f18badc02c910729e8a08
Author: Xinchen Hui <laruence at php.net>
Date:   Sat Apr 21 09:31:00 2012 +0800

    Make css string constant

diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c
index 105fd60..a3ed390 100644
--- a/sapi/cli/php_cli_server.c
+++ b/sapi/cli/php_cli_server.c
@@ -276,7 +276,7 @@ ZEND_DECLARE_MODULE_GLOBALS(cli_server);
 /* {{{ static char php_cli_server_css[] 
  * copied from ext/standard/info.c
  */
-static char php_cli_server_css[] = "<style type=\"text/css\">\n" \
+static const char php_cli_server_css[] = "<style type=\"text/css\">\n" \
 								   "body {background-color: #ffffff; color: #000000;}\n" \
 								   "body, td, th, h1, h2 {font-family: sans-serif;}\n" \
 								   ".center {text-align: center;}\n" \


commit 465e9a1321593eee949f2cc6e05ade56e0119bb4
Merge: a9d54e7 da85337
Author: Xinchen Hui <laruence at php.net>
Date:   Sat Apr 21 00:12:10 2012 +0800

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fixed typo



commit da85337d13075885f165eeed820181be20d397b9
Author: Xinchen Hui <laruence at php.net>
Date:   Sat Apr 21 00:11:06 2012 +0800

    Fixed typo
    
    report by reeze.xia at gmail.com

diff --git a/sapi/cli/tests/php_cli_server_016.phpt b/sapi/cli/tests/php_cli_server_016.phpt
index 3fd065a..fc98d1a 100644
--- a/sapi/cli/tests/php_cli_server_016.phpt
+++ b/sapi/cli/tests/php_cli_server_016.phpt
@@ -1,7 +1,7 @@
 --TEST--
 Bug #60591 (Memory leak when access a non-exists file)
 --DESCRIPTION--
-this is a indirect test for bug 50691, since mem leak is reproted in the server side
+this is an indirect test for bug 50691, since mem leak is reproted in the server side
 and require php compiled with --enable-debug
 --SKIPIF--
 <?php


commit a9d54e77c61430b2f7a8736ef69e6f989cc18cba
Merge: 47cff26 cc58373
Author: Xinchen Hui <laruence at php.net>
Date:   Sat Apr 21 00:02:12 2012 +0800

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Improved performance while sending error page
      - BFN



commit cc58373d4d9b0b3d8b0e2cbf86dfee37da799c77
Author: Xinchen Hui <laruence at php.net>
Date:   Sat Apr 21 00:01:10 2012 +0800

    Improved performance while sending error page
    
    this also fixed bug #61785 (Memory leak when access a non-exists file without router)

diff --git a/NEWS b/NEWS
index b2c6a8d..b336316 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,9 @@ PHP                                                                        NEWS
 ?? ??? 2012, PHP 5.4.1 RC1
 
 - CLI Server:
+  . Improved performance while sending error page, this also fixed
+    bug #61785 (Memory leak when access a non-exists file without router).
+    (Laruence)
   . Fixed bug #61461 (missing checks around malloc() calls). (Ilia)
   . Implemented FR #60850 (Built in web server does not set 
     $_SERVER['SCRIPT_FILENAME'] when using router). (Laruence)
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c
index 79ccea3..105fd60 100644
--- a/sapi/cli/php_cli_server.c
+++ b/sapi/cli/php_cli_server.c
@@ -98,7 +98,6 @@
 #include "ext/standard/html.h"
 #include "ext/standard/url.h" /* for php_url_decode() */
 #include "ext/standard/php_string.h" /* for php_dirname() */
-#include "ext/standard/info.h" /* for php_info_print_style() */
 #include "php_network.h"
 
 #include "php_http_parser.h"
@@ -174,8 +173,6 @@ typedef struct php_cli_server_client {
 	php_cli_server_request request;
 	unsigned int content_sender_initialized:1;
 	php_cli_server_content_sender content_sender;
-	php_cli_server_buffer capture_buffer;
-	unsigned int capturing:1;
 	int file_fd;
 } php_cli_server_client;
 
@@ -276,6 +273,27 @@ static void php_cli_server_log_response(php_cli_server_client *client, int statu
 
 ZEND_DECLARE_MODULE_GLOBALS(cli_server);
 
+/* {{{ static char php_cli_server_css[] 
+ * copied from ext/standard/info.c
+ */
+static char php_cli_server_css[] = "<style type=\"text/css\">\n" \
+								   "body {background-color: #ffffff; color: #000000;}\n" \
+								   "body, td, th, h1, h2 {font-family: sans-serif;}\n" \
+								   ".center {text-align: center;}\n" \
+								   ".center table { margin-left: auto; margin-right: auto; text-align: left;}\n" \
+								   ".center th { text-align: center !important; }\n" \
+								   "h1 {font-size: 150%;}\n" \
+								   "h2 {font-size: 125%;}\n" \
+								   ".p {text-align: left;}\n" \
+								   ".e {background-color: #ccccff; font-weight: bold; color: #000000;}\n" \
+								   ".h {background-color: #9999cc; font-weight: bold; color: #000000;}\n" \
+								   ".v {background-color: #cccccc; color: #000000;}\n" \
+								   ".vr {background-color: #cccccc; text-align: right; color: #000000;}\n" \
+								   "img {float: right; border: 0px;}\n" \
+								   "hr {width: 600px; background-color: #cccccc; border: 0px; height: 1px; color: #000000;}\n" \
+								   "</style>\n";
+/* }}} */
+
 static void char_ptr_dtor_p(char **p) /* {{{ */
 {
 	pefree(*p, 1);
@@ -425,17 +443,7 @@ static int sapi_cli_server_ub_write(const char *str, uint str_length TSRMLS_DC)
 	if (!client) {
 		return 0;
 	}
-	if (client->capturing) {
-		php_cli_server_chunk *chunk = php_cli_server_chunk_heap_new_self_contained(str_length);
-		if (!chunk) {
-			zend_bailout();
-		}
-		memmove(chunk->data.heap.p, str, str_length);
-		php_cli_server_buffer_append(&client->capture_buffer, chunk);
-		return str_length;
-	} else {
-		return php_cli_server_client_send_through(client, str, str_length);
-	}
+	return php_cli_server_client_send_through(client, str, str_length);
 } /* }}} */
 
 static void sapi_cli_server_flush(void *server_context) /* {{{ */
@@ -470,7 +478,7 @@ static int sapi_cli_server_send_headers(sapi_headers_struct *sapi_headers TSRMLS
 	sapi_header_struct *h;
 	zend_llist_position pos;
 
-	if (client == NULL || client->capturing || SG(request_info).no_headers) {
+	if (client == NULL || SG(request_info).no_headers) {
 		return SAPI_HEADER_SENT_SUCCESSFULLY;
 	}
 
@@ -1677,18 +1685,6 @@ static void destroy_request_info(sapi_request_info *request_info) /* {{{ */
 {
 } /* }}} */
 
-static void php_cli_server_client_begin_capture(php_cli_server_client *client) /* {{{ */
-{
-	php_cli_server_buffer_ctor(&client->capture_buffer);
-	client->capturing = 1;
-} /* }}} */
-
-static void php_cli_server_client_end_capture(php_cli_server_client *client) /* {{{ */
-{
-	client->capturing = 0;
-	php_cli_server_buffer_dtor(&client->capture_buffer);
-} /* }}} */
-
 static int php_cli_server_client_ctor(php_cli_server_client *client, php_cli_server *server, int client_sock, struct sockaddr *addr, socklen_t addr_len TSRMLS_DC) /* {{{ */
 {
 	client->server = server;
@@ -1713,7 +1709,6 @@ static int php_cli_server_client_ctor(php_cli_server_client *client, php_cli_ser
 		return FAILURE;
 	}
 	client->content_sender_initialized = 0;
-	client->capturing = 0;
 	client->file_fd = -1;
 	return SUCCESS;
 } /* }}} */
@@ -1730,9 +1725,6 @@ static void php_cli_server_client_dtor(php_cli_server_client *client) /* {{{ */
 	if (client->content_sender_initialized) {
 		php_cli_server_content_sender_dtor(&client->content_sender);
 	}
-	if (client->capturing) {
-		php_cli_server_buffer_dtor(&client->capture_buffer);
-	}
 } /* }}} */
 
 static void php_cli_server_close_connection(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) /* {{{ */
@@ -1768,43 +1760,11 @@ static int php_cli_server_send_error_page(php_cli_server *server, php_cli_server
 		php_cli_server_buffer_append(&client->content_sender.buffer, chunk);
 	}
 	{
-		int err = 0;
-		zval *style = NULL; 
-		zend_try {
-			if (!SG(sapi_started)) {
-				php_output_activate(TSRMLS_C);
-			}
-			php_output_start_user(NULL, 0, PHP_OUTPUT_HANDLER_STDFLAGS TSRMLS_CC);
-			php_info_print_style(TSRMLS_C);
-			MAKE_STD_ZVAL(style);
-			php_output_get_contents(style TSRMLS_CC);
-			php_output_discard(TSRMLS_C);
-			if (!SG(sapi_started)) {
-				static int (*send_header_func)(sapi_headers_struct * TSRMLS_DC);
-				send_header_func = sapi_module.send_headers;
-				/* we don't want the header to be sent now */
-				sapi_module.send_headers = sapi_cli_server_discard_headers;
-				php_output_deactivate(TSRMLS_C);
-				sapi_module.send_headers = send_header_func;
-			}
-			if (style && Z_STRVAL_P(style)) {
-				char *block = pestrndup(Z_STRVAL_P(style), Z_STRLEN_P(style), 1);
-				php_cli_server_chunk *chunk = php_cli_server_chunk_heap_new(block, block, Z_STRLEN_P(style));
-				if (!chunk) {
-					zval_ptr_dtor(&style);
-					goto fail;
-				}
-				php_cli_server_buffer_append(&client->content_sender.buffer, chunk);
-				zval_ptr_dtor(&style);
-			} else {
-				err = 1;
-			}
-		} zend_catch {
-			err = 1;
-		} zend_end_try();
-		if (err) {
+		php_cli_server_chunk *chunk = php_cli_server_chunk_immortal_new(php_cli_server_css, sizeof(php_cli_server_css) - 1);
+		if (!chunk) {
 			goto fail;
 		}
+		php_cli_server_buffer_append(&client->content_sender.buffer, chunk);
 	}
 	{
 		static const char template[] = "</head><body>";
@@ -2052,10 +2012,13 @@ static int php_cli_server_dispatch(php_cli_server *server, php_cli_server_client
 		if (server->router) {
 			static int (*send_header_func)(sapi_headers_struct * TSRMLS_DC);
 			send_header_func = sapi_module.send_headers;
-			/* we don't want the header to be sent now */
+			/* do not generate default content type header */
+		    SG(sapi_headers).send_default_content_type = 0;
+			/* we don't want headers to be sent */
 			sapi_module.send_headers = sapi_cli_server_discard_headers;
 			php_request_shutdown(0);
 			sapi_module.send_headers = send_header_func;
+		    SG(sapi_headers).send_default_content_type = 1;
 			SG(rfc1867_uploaded_files) = NULL;
 		} 
 		if (SUCCESS != php_cli_server_begin_send_static(server, client TSRMLS_CC)) {


commit bca2d6b985dee0d120b0f14f088c1238f8eeef15
Author: Felipe Pena <felipensp at gmail.com>
Date:   Thu Apr 19 23:23:59 2012 -0300

    - BFN

diff --git a/NEWS b/NEWS
index e09e1ab..b2c6a8d 100644
--- a/NEWS
+++ b/NEWS
@@ -44,6 +44,8 @@ PHP                                                                        NEWS
   . Fixed bug #60573 (type hinting with "self" keyword causes weird errors).
     (Laruence)
   . Fixed bug #60569 (Nullbyte truncates Exception $message). (Ilia)
+  . Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename
+    set to null). (Anatoliy)
   . Fixed bug #52719 (array_walk_recursive crashes if third param of the
     function is by reference). (Nikita Popov)
   . Improve performance of set_exception_handler while doing reset (Laruence)


commit dd34fe52b93dd48b9667dd75f07d0a48681c3dca
Author: Felipe Pena <felipensp at gmail.com>
Date:   Thu Apr 19 23:23:46 2012 -0300

    - BFN

diff --git a/NEWS b/NEWS
index 5fe7245..79e9f7a 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,10 @@ PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 2012, PHP 5.3.12
 
+- Core:
+  . Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename
+   set to null). (Anatoliy)
+
 - JSON
   . Fixed bug #61537 (json_encode() incorrectly truncates/discards
     information). (Adam)


commit 47cff264dfc9b117c7fc1904da852c92f1db3260
Merge: 77f43a0 d2798c6
Author: Felipe Pena <felipensp at gmail.com>
Date:   Thu Apr 19 23:14:00 2012 -0300

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      - Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename set to null) patch by ab at php.net



commit d2798c6035faf1e2497a26964cb4b9672017e8d9
Merge: 0a46d63 c3b0fb4
Author: Felipe Pena <felipensp at gmail.com>
Date:   Thu Apr 19 23:13:37 2012 -0300

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      - Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename set to null) patch by ab at php.net



commit c3b0fb4fbe20e46266a792cb1f332d08ef40923b
Author: Felipe Pena <felipensp at gmail.com>
Date:   Thu Apr 19 23:12:47 2012 -0300

    - Fixed bug #54197 ([PATH=] sections incompatibility with user_ini.filename set to null) patch by ab at php.net

diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index dfd77e4..56c736f 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -848,12 +848,13 @@ static int sapi_cgi_activate(TSRMLS_D)
 				zend_str_tolower(doc_root, doc_root_len);
 #endif
 				php_cgi_ini_activate_user_config(path, path_len, doc_root, doc_root_len, doc_root_len - 1 TSRMLS_CC);
+				
+#ifdef PHP_WIN32
+				efree(doc_root);
+#endif
 			}
 		}
 
-#ifdef PHP_WIN32
-		efree(doc_root);
-#endif
 		efree(path);
 	}
 


commit 77f43a07709ce9279d90025bffb51aa2e0f862be
Merge: e104d3f 0a46d63
Author: Felipe Pena <felipensp at gmail.com>
Date:   Thu Apr 19 20:15:26 2012 -0300

    Merge branch 'PHP-5.4'



commit 0a46d63f7e763c28c61773239c3173b0c0f26309
Author: Felipe Pena <felipensp at gmail.com>
Date:   Thu Apr 19 20:15:11 2012 -0300

    - Fixed expected test result (patch by ab at php.net in #61769)

diff --git a/sapi/cli/tests/php_cli_server_017.phpt b/sapi/cli/tests/php_cli_server_017.phpt
index 6c414a1..73530af 100644
--- a/sapi/cli/tests/php_cli_server_017.phpt
+++ b/sapi/cli/tests/php_cli_server_017.phpt
@@ -41,4 +41,4 @@ Connection: close
 X-Powered-By: %s
 Content-type: text/html
 
-string(%d) "%s/tests/index.php"
+string(%d) "%sindex.php"


commit e104d3fb6eb390250597cd40d254cd5ffb9d3af8
Merge: c7e54d5 d5bd454
Author: Felipe Pena <felipensp at gmail.com>
Date:   Thu Apr 19 20:07:37 2012 -0300

    Merge branch 'PHP-5.4'



commit d5bd45429cfe5b50de1989d3fe4f90fc21869456
Author: Felipe Pena <felipensp at gmail.com>
Date:   Thu Apr 19 20:05:30 2012 -0300

    - Fix test title

diff --git a/sapi/cli/tests/php_cli_server_012.phpt b/sapi/cli/tests/php_cli_server_012.phpt
index a7d9081..9a1e60c 100644
--- a/sapi/cli/tests/php_cli_server_012.phpt
+++ b/sapi/cli/tests/php_cli_server_012.phpt
@@ -1,5 +1,5 @@
 --TEST--
-Bug #60159	(Router returns false, but POST is not passed to requested resource)
+Bug #60159 (Router returns false, but POST is not passed to requested resource)
 --SKIPIF--
 <?php
 include "skipif.inc"; 


commit c7e54d56ac68b1abe8dbba6e775537841ccce8ed
Merge: 71884b7 655245a
Author: Stanislav Malyshev <stas at php.net>
Date:   Thu Apr 19 13:40:36 2012 -0700

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      add pg_escape_identifier/pg_escape_literal



commit 655245afef75613551929610873d0ba09754777f
Author: Yasuo Ohgaki <yohgaki at php.net>
Date:   Fri Nov 25 02:21:01 2011 +0000

    add pg_escape_identifier/pg_escape_literal

diff --git a/ext/pgsql/config.m4 b/ext/pgsql/config.m4
index 2710796..bddb77a 100644
--- a/ext/pgsql/config.m4
+++ b/ext/pgsql/config.m4
@@ -94,6 +94,7 @@ if test "$PHP_PGSQL" != "no"; then
   AC_CHECK_LIB(pq, pg_encoding_to_char,AC_DEFINE(HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT,1,[Whether libpq is compiled with --enable-multibyte]))
   AC_CHECK_LIB(pq, lo_create, AC_DEFINE(HAVE_PG_LO_CREATE,1,[PostgreSQL 8.1 or later]))
   AC_CHECK_LIB(pq, lo_import_with_oid, AC_DEFINE(HAVE_PG_LO_IMPORT_WITH_OID,1,[PostgreSQL 8.4 or later]))
+  AC_CHECK_LIB(pq, PQescapeLiteral, AC_DEFINE(HAVE_PQESCAPELITERAL,1,[PostgreSQL 9.0 or later]))
   LIBS=$old_LIBS
   LDFLAGS=$old_LDFLAGS
 
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 54a86a8..ad66779 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -422,6 +422,17 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_unescape_bytea, 0, 0, 1)
 ZEND_END_ARG_INFO()
 #endif
 
+#if HAVE_PQESCAPE
+ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_escape_literal, 0, 0, 0)
+	ZEND_ARG_INFO(0, connection)
+	ZEND_ARG_INFO(0, data)
+ZEND_END_ARG_INFO()
+ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_escape_identifier, 0, 0, 0)
+	ZEND_ARG_INFO(0, connection)
+	ZEND_ARG_INFO(0, data)
+ZEND_END_ARG_INFO()
+#endif
+
 ZEND_BEGIN_ARG_INFO_EX(arginfo_pg_result_error, 0, 0, 1)
 	ZEND_ARG_INFO(0, result)
 ZEND_END_ARG_INFO()
@@ -652,6 +663,8 @@ const zend_function_entry pgsql_functions[] = {
 	PHP_FE(pg_escape_string,	arginfo_pg_escape_string)
 	PHP_FE(pg_escape_bytea, 	arginfo_pg_escape_bytea)
 	PHP_FE(pg_unescape_bytea, 	arginfo_pg_unescape_bytea)
+	PHP_FE(pg_escape_literal,	arginfo_pg_escape_literal)
+	PHP_FE(pg_escape_identifier,	arginfo_pg_escape_identifier)
 #endif
 #if HAVE_PQSETERRORVERBOSITY
 	PHP_FE(pg_set_error_verbosity,	arginfo_pg_set_error_verbosity)
@@ -815,7 +828,7 @@ static void _php_pgsql_notice_handler(void *resource_id, const char *message)
 	TSRMLS_FETCH();
 	if (! PGG(ignore_notices)) {
 		notice = (php_pgsql_notice *)emalloc(sizeof(php_pgsql_notice));
-		notice->message = _php_pgsql_trim_message(message, &notice->len);
+		notice->message = _php_pgsql_trim_message(message, (int *)&notice->len);
 		if (PGG(log_notices)) {
 			php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s", notice->message);
 		}
@@ -4206,6 +4219,130 @@ PHP_FUNCTION(pg_unescape_bytea)
 /* }}} */
 #endif
 
+#ifdef HAVE_PQESCAPE
+#if !HAVE_PQESCAPELITERAL
+/* emulate libpq's PQescapeInternal() 9.0 or later */
+static char* php_pgsql_PQescapeInternal(PGconn *conn, const char *str, size_t len, int escape_literal) {
+	char *result, *rp;
+	const char *s;
+	size_t tmp_len;
+	int input_len = len;
+	char quote_char = escape_literal ? '\'' : '"';
+
+	if (!conn) {
+		return NULL;
+	}
+
+	/*
+	 * NOTE: multibyte strings that could cointain slashes should be considered.
+	 * (e.g. SJIS, BIG5) However, it cannot be done without valid PGconn and mbstring. 
+	 * Therefore, this function does not support such encodings currently.
+	 * FIXME: add encoding check and skip multibyte char bytes if there is vaild PGconn.
+	 */
+
+	/* allocate enough memory */
+	rp = result = (char *)emalloc(len*2 + 5); /* leading " E" needs extra 2 bytes + quote_chars on both end for 2 bytes + NULL */
+
+	if (escape_literal) {
+		/* check backslashes */
+		tmp_len = strspn(str, "\\");
+		if (tmp_len != len) {
+			/* add " E" for escaping slashes */
+			*rp++ = ' ';
+			*rp++ = 'E';
+		}
+	}
+	/* open quote */
+	*rp++ = quote_char;
+	for (s = str; s - str < input_len; ++s) {
+		if (*s == quote_char || (escape_literal && *s == '\\')) {
+			*rp++ = *s;
+			*rp++ = *s;
+		} else {
+			*rp++ = *s;
+		}
+	}
+	*rp++ = quote_char;
+	*rp = '\0';
+	
+	return result;
+}
+#endif
+
+static void php_pgsql_escape_internal(INTERNAL_FUNCTION_PARAMETERS, int escape_literal) {
+	char *from = NULL, *to = NULL, *tmp = NULL;
+	zval *pgsql_link = NULL;
+	PGconn *pgsql;
+	int to_len;
+	int from_len;
+	int id = -1;
+
+	switch (ZEND_NUM_ARGS()) {
+		case 1:
+			if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &from, &from_len) == FAILURE) {
+				return;
+			}
+			pgsql_link = NULL;
+			id = PGG(default_link);
+			break;
+
+		default:
+			if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pgsql_link, &from, &from_len) == FAILURE) {
+				return;
+			}
+			break;
+	}
+
+	if (pgsql_link == NULL && id == -1) {
+		RETURN_FALSE;
+	}
+
+	ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink);
+	if (pgsql == NULL) {
+		php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot get default pgsql link");
+		RETURN_FALSE;
+	}
+#ifdef HAVE_PQESCAPELITERAL
+	if (escape_literal) {
+		tmp = PQescapeLiteral(pgsql, from, (size_t)from_len);
+	} else {
+		tmp = PQescapeIdentifier(pgsql, from, (size_t)from_len);
+	}
+	if (!tmp) {
+		php_error_docref(NULL TSRMLS_CC, E_WARNING,"Failed to escape");
+		RETURN_FALSE;
+	}
+	to = estrdup(tmp);
+	PQfreemem(tmp);
+#else 
+	to = php_pgsql_PQescapeInternal(pgsql, from, (size_t)from_len, escape_literal);
+	if (!to) {
+		php_error_docref(NULL TSRMLS_CC, E_WARNING,"Failed to escape");
+		RETURN_FALSE;
+	}
+#endif
+
+	RETURN_STRING(to, 0);
+}
+
+/* {{{ proto string pg_escape_literal([resource connection,] string data)
+   Escape parameter as string literal (i.e. parameter)	*/
+PHP_FUNCTION(pg_escape_literal)
+{
+	php_pgsql_escape_internal(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);
+}
+/* }}} */
+
+/* {{{ proto string pg_escape_identifier([resource connection,] string data)
+   Escape identifier (i.e. table name, field name)	*/
+PHP_FUNCTION(pg_escape_identifier)
+{
+	php_pgsql_escape_internal(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
+}
+/* }}} */
+#endif
+
+
 /* {{{ proto string pg_result_error(resource result)
    Get error message associated with result */
 PHP_FUNCTION(pg_result_error)
diff --git a/ext/pgsql/php_pgsql.h b/ext/pgsql/php_pgsql.h
index b247456..8b6abbf 100644
--- a/ext/pgsql/php_pgsql.h
+++ b/ext/pgsql/php_pgsql.h
@@ -172,6 +172,8 @@ PHP_FUNCTION(pg_set_error_verbosity);
 PHP_FUNCTION(pg_escape_string);
 PHP_FUNCTION(pg_escape_bytea);
 PHP_FUNCTION(pg_unescape_bytea);
+PHP_FUNCTION(pg_escape_literal);
+PHP_FUNCTION(pg_escape_identifier);
 #endif
 
 /* misc functions */
diff --git a/ext/pgsql/tests/08escape.phpt b/ext/pgsql/tests/08escape.phpt
index cf23b50..90b4ed8 100644
--- a/ext/pgsql/tests/08escape.phpt
+++ b/ext/pgsql/tests/08escape.phpt
@@ -11,8 +11,9 @@ define('FILE_NAME', dirname(__FILE__) . '/php.gif');
 // pg_escape_string() test
 $before = "ABC\\ABC\'";
 $expect  = "ABC\\\\ABC\\'";
+$expect2  = "ABC\\\\ABC\\\\''"; //the way escape string differs from PostgreSQL 9.0
 $after = pg_escape_string($before);
-if ($expect === $after) {
+if ($expect === $after || $expect2 === $after) {
 	echo "pg_escape_string() is Ok\n";
 }
 else {
@@ -58,11 +59,37 @@ else {
 	echo "pg_escape_bytea() is broken\n";
 }
 
+// pg_escape_literal/pg_escape_identifier
+$before = "ABC\\ABC\'";
+$expect	 = " E'ABC\\\\ABC\\\\'''";
+$after = pg_escape_literal($before);
+if ($expect === $after) {
+	echo "pg_escape_literal() is Ok\n";
+}
+else {
+	echo "pg_escape_literal() is NOT Ok\n";
+	var_dump($before);
+	var_dump($after);
+	var_dump($expect);
+}
+
+$before = "ABC\\ABC\'";
+$expect	 = "\"ABC\ABC\'\"";
+$after = pg_escape_identifier($before);
+if ($expect === $after) {
+	echo "pg_escape_identifier() is Ok\n";
+}
+else {
+	echo "pg_escape_identifier() is NOT Ok\n";
+	var_dump($before);
+	var_dump($after);
+	var_dump($expect);
+}
+
 ?>
 --EXPECT--
-pg_escape_string() is NOT Ok
-string(9) "ABC\ABC\'"
-string(12) "ABC\\ABC\\''"
-string(10) "ABC\\ABC\'"
+pg_escape_string() is Ok
 pg_escape_bytea() is Ok
 pg_escape_bytea() actually works with database
+pg_escape_literal() is Ok
+pg_escape_identifier() is Ok
\ No newline at end of file


commit 71884b702431150c8c9d5c2d79f8c2c10b40af75
Merge: e9a73a4 106e0a2
Author: Stanislav Malyshev <stas at php.net>
Date:   Thu Apr 19 11:37:55 2012 -0700

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Bug#59597 NumberFormatter::parse() with TYPE_INT64 results in a 32 bit integer



commit 106e0a2e688f3e5c97e49760b9c3c99eea714ae8
Merge: 2b8e943 5cbf2d6
Author: Stanislav Malyshev <stas at php.net>
Date:   Thu Apr 19 11:37:31 2012 -0700

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Bug#59597 NumberFormatter::parse() with TYPE_INT64 results in a 32 bit integer



commit 5cbf2d678505b6e4ab89bcfe04695e5da9dd2c0e
Merge: c06ec6b 2827324
Author: Stanislav Malyshev <stas at php.net>
Date:   Thu Apr 19 11:05:17 2012 -0700

    Merge branch 'pull-request/61' into PHP-5.3
    
    * pull-request/61:
      Bug#59597 NumberFormatter::parse() with TYPE_INT64 results in a 32 bit integer

diff --cc ext/intl/tests/bug59597_32.phpt
index 0000000,0000000..928a235
new file mode 100644
--- /dev/null
+++ b/ext/intl/tests/bug59597_32.phpt
@@@ -1,0 -1,0 +1,21 @@@
++--TEST--
++Bug#59597 NumberFormatter::parse() with TYPE_INT64 results in a 32 bit integer
++--SKIPIF--
++<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
++<?php echo PHP_INT_SIZE == 8 ? "skip 32-bit only" : "OK"; ?>
++--FILE--
++<?php
++
++$formatter = new \NumberFormatter('en', \NumberFormatter::DECIMAL);
++$value = $formatter->parse('2147483647', \NumberFormatter::TYPE_INT32);
++var_dump($value);
++
++$formatter = new \NumberFormatter('en', \NumberFormatter::DECIMAL);
++$value = $formatter->parse('2147483650', \NumberFormatter::TYPE_INT64);
++var_dump($value);
++
++?>
++--EXPECT--
++int(2147483647)
++float(2147483650)
++
diff --cc ext/intl/tests/bug59597_64.phpt
index 0000000,0000000..4b96bf7
new file mode 100644
--- /dev/null
+++ b/ext/intl/tests/bug59597_64.phpt
@@@ -1,0 -1,0 +1,21 @@@
++--TEST--
++Bug#59597 NumberFormatter::parse() with TYPE_INT64 results in a 32 bit integer
++--SKIPIF--
++<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
++<?php echo PHP_INT_SIZE != 8 ? "skip 64-bit only" : "OK"; ?>
++--FILE--
++<?php
++
++$formatter = new \NumberFormatter('en', \NumberFormatter::DECIMAL);
++$value = $formatter->parse('2147483647', \NumberFormatter::TYPE_INT32);
++var_dump($value);
++
++$formatter = new \NumberFormatter('en', \NumberFormatter::DECIMAL);
++$value = $formatter->parse('2147483650', \NumberFormatter::TYPE_INT64);
++var_dump($value);
++
++?>
++--EXPECTREGEX--
++int(2147483647)
++int(2147483650)
++


commit e9a73a4cf52abfba667a4125f259dc3275b35a78
Merge: d2718cb 2b8e943
Author: Stanislav Malyshev <stas at php.net>
Date:   Thu Apr 19 11:03:12 2012 -0700

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      fix RCs
      Update to 5.4.2-dev
    
    Conflicts:
    	main/php_version.h



commit 2b8e9430c89b7c3b711127a58b6904d52569d06a
Author: Stanislav Malyshev <stas at php.net>
Date:   Thu Apr 19 00:25:44 2012 -0700

    fix RCs

diff --git a/README.RELEASE_PROCESS b/README.RELEASE_PROCESS
index 6a6da62..a8e36c2 100644
--- a/README.RELEASE_PROCESS
+++ b/README.RELEASE_PROCESS
@@ -58,12 +58,12 @@ Do not use abbreviations for alpha and beta.
 5. Commit these changes to the branch with ``git commit -a``.
 
 6. Tag the repository with the version, e.g.: 
-``git tag -u YOURKEYID PHP-5.4.2-RC2``
+``git tag -u YOURKEYID php-5.4.2RC2``
 
 7. Push the changes to the main repo:
 ``git push --tags origin HEAD``
 
-8. run: ``./makedist 5.4.2-RC2``, this will export the tree, create configure
+8. run: ``./makedist 5.4.2RC2``, this will export the tree, create configure
 and build two tarballs (one gz and one bz2).
 
 9. Copy those two tarballs to www.php.net, in your homedir there should be a


commit 701332ce301f9ea9fa4d40eb945de0c1880dad8a
Author: Christopher Jones <sixd at php.net>
Date:   Mon Apr 16 13:43:41 2012 -0700

    Update to 5.4.2-dev
    
    After PHP-5.4.1 was branched, the PHP-5.4 branch should have been 5.4.2-dev.

diff --git a/main/php_version.h b/main/php_version.h
index b4c616f..13478d1 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 1
-#define PHP_EXTRA_VERSION "RC1-dev"
-#define PHP_VERSION "5.4.1RC1-dev"
-#define PHP_VERSION_ID 50401
+#define PHP_RELEASE_VERSION 2
+#define PHP_EXTRA_VERSION "-dev"
+#define PHP_VERSION "5.4.2-dev"
+#define PHP_VERSION_ID 50402


commit d2718cb9ffed2f8271e7c2c3c208f84b6feda1f7
Merge: 0e430c8 36a5565
Author: Johannes Schlüter <johannes at php.net>
Date:   Thu Apr 19 12:49:47 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Commit generated file
      Fix bug #61755 parsing bug can lead to access violations



commit 36a556546737c5218cd649c9a5ae8b1a10aa2d49
Merge: 0589b19 1f4b4c3
Author: Johannes Schlüter <johannes at php.net>
Date:   Thu Apr 19 12:48:18 2012 +0200

    Merge branch 'PHP-5.4' of git.php.net:/php-src into PHP-5.4
    
    * 'PHP-5.4' of git.php.net:/php-src:



commit 0589b19abfa5a0182b0ec4b486af0cafb359989f
Merge: ff7e1ff c06ec6b
Author: Johannes Schlüter <johannes at php.net>
Date:   Thu Apr 19 12:47:47 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Commit generated file
      Fix bug #61755 parsing bug can lead to access violations
      Fix bug 61671 ext\spl\tests\fileobject_003.phpt fails



commit c06ec6bde43a114af3bd84e986827839de1b1e4b
Author: Johannes Schlüter <johannes at php.net>
Date:   Thu Apr 19 12:47:09 2012 +0200

    Commit generated file

diff --git a/ext/pdo/pdo_sql_parser.c b/ext/pdo/pdo_sql_parser.c
index ed8af84..0267d15 100644
--- a/ext/pdo/pdo_sql_parser.c
+++ b/ext/pdo/pdo_sql_parser.c
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Wed Apr 18 22:30:06 2012 */
+/* Generated by re2c 0.13.5 on Thu Apr 19 12:42:11 2012 */
 #line 1 "ext/pdo/pdo_sql_parser.re"
 /*
   +----------------------------------------------------------------------+
@@ -34,12 +34,12 @@
 
 #define YYCTYPE         unsigned char
 #define YYCURSOR        cursor
-#define YYLIMIT         cursor
+#define YYLIMIT         s->end
 #define YYMARKER        s->ptr
-#define YYFILL(n)
+#define YYFILL(n)		{ RET(PDO_PARSER_EOI); }
 
 typedef struct Scanner {
-	char 	*ptr, *cur, *tok;
+	char 	*ptr, *cur, *tok, *end;
 } Scanner;
 
 static int scan(Scanner *s) 
@@ -47,7 +47,7 @@ static int scan(Scanner *s)
 	char *cursor = s->cur;
 
 	s->tok = cursor;
-	#line 56 "ext/pdo/pdo_sql_parser.re"
+	#line 55 "ext/pdo/pdo_sql_parser.re"
 
 
 	
@@ -59,29 +59,35 @@ static int scan(Scanner *s)
 	if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
 	yych = *YYCURSOR;
 	switch (yych) {
-	case 0x00:	goto yy13;
-	case '"':	goto yy2;
-	case '\'':	goto yy4;
-	case '-':	goto yy10;
-	case '/':	goto yy8;
-	case ':':	goto yy5;
-	case '?':	goto yy6;
-	default:	goto yy11;
+	case 0x00:	goto yy2;
+	case '"':	goto yy3;
+	case '\'':	goto yy5;
+	case '-':	goto yy11;
+	case '/':	goto yy9;
+	case ':':	goto yy6;
+	case '?':	goto yy7;
+	default:	goto yy12;
 	}
 yy2:
+	YYCURSOR = YYMARKER;
+	switch (yyaccept) {
+	case 0: 	goto yy4;
+	case 1: 	goto yy10;
+	}
+yy3:
 	yyaccept = 0;
 	yych = *(YYMARKER = ++YYCURSOR);
-	if (yych >= 0x01) goto yy43;
-yy3:
-#line 64 "ext/pdo/pdo_sql_parser.re"
-	{ SKIP_ONE(PDO_PARSER_TEXT); }
-#line 79 "ext/pdo/pdo_sql_parser.c"
+	if (yych >= 0x01) goto yy41;
 yy4:
+#line 63 "ext/pdo/pdo_sql_parser.re"
+	{ SKIP_ONE(PDO_PARSER_TEXT); }
+#line 85 "ext/pdo/pdo_sql_parser.c"
+yy5:
 	yyaccept = 0;
 	yych = *(YYMARKER = ++YYCURSOR);
-	if (yych <= 0x00) goto yy3;
-	goto yy37;
-yy5:
+	if (yych <= 0x00) goto yy4;
+	goto yy36;
+yy6:
 	yych = *++YYCURSOR;
 	switch (yych) {
 	case '0':
@@ -146,57 +152,52 @@ yy5:
 	case 'w':
 	case 'x':
 	case 'y':
-	case 'z':	goto yy33;
+	case 'z':	goto yy32;
 	case ':':
-	case '?':	goto yy30;
-	default:	goto yy3;
+	case '?':	goto yy29;
+	default:	goto yy4;
 	}
-yy6:
+yy7:
 	++YYCURSOR;
 	switch ((yych = *YYCURSOR)) {
 	case ':':
-	case '?':	goto yy30;
-	default:	goto yy7;
+	case '?':	goto yy29;
+	default:	goto yy8;
 	}
-yy7:
-#line 63 "ext/pdo/pdo_sql_parser.re"
-	{ RET(PDO_PARSER_BIND_POS); }
-#line 165 "ext/pdo/pdo_sql_parser.c"
 yy8:
+#line 62 "ext/pdo/pdo_sql_parser.re"
+	{ RET(PDO_PARSER_BIND_POS); }
+#line 171 "ext/pdo/pdo_sql_parser.c"
+yy9:
 	++YYCURSOR;
 	switch ((yych = *YYCURSOR)) {
-	case '*':	goto yy20;
-	default:	goto yy12;
+	case '*':	goto yy19;
+	default:	goto yy13;
 	}
-yy9:
-#line 66 "ext/pdo/pdo_sql_parser.re"
-	{ RET(PDO_PARSER_TEXT); }
-#line 175 "ext/pdo/pdo_sql_parser.c"
 yy10:
+#line 65 "ext/pdo/pdo_sql_parser.re"
+	{ RET(PDO_PARSER_TEXT); }
+#line 181 "ext/pdo/pdo_sql_parser.c"
+yy11:
 	yych = *++YYCURSOR;
 	switch (yych) {
-	case '-':	goto yy15;
-	default:	goto yy12;
+	case '-':	goto yy14;
+	default:	goto yy13;
 	}
-yy11:
+yy12:
 	++YYCURSOR;
 	if (YYLIMIT <= YYCURSOR) YYFILL(1);
 	yych = *YYCURSOR;
-yy12:
+yy13:
 	switch (yych) {
 	case 0x00:
 	case '"':
 	case '\'':
 	case ':':
-	case '?':	goto yy9;
-	default:	goto yy11;
+	case '?':	goto yy10;
+	default:	goto yy12;
 	}
-yy13:
-	++YYCURSOR;
-#line 67 "ext/pdo/pdo_sql_parser.re"
-	{ RET(PDO_PARSER_EOI); }
-#line 199 "ext/pdo/pdo_sql_parser.c"
-yy15:
+yy14:
 	++YYCURSOR;
 	if (YYLIMIT <= YYCURSOR) YYFILL(1);
 	yych = *YYCURSOR;
@@ -205,25 +206,25 @@ yy15:
 	case '"':
 	case '\'':
 	case ':':
-	case '?':	goto yy18;
+	case '?':	goto yy17;
 	case '\n':
-	case '\r':	goto yy11;
-	default:	goto yy15;
+	case '\r':	goto yy12;
+	default:	goto yy14;
 	}
-yy17:
-#line 65 "ext/pdo/pdo_sql_parser.re"
+yy16:
+#line 64 "ext/pdo/pdo_sql_parser.re"
 	{ RET(PDO_PARSER_TEXT); }
-#line 217 "ext/pdo/pdo_sql_parser.c"
-yy18:
+#line 218 "ext/pdo/pdo_sql_parser.c"
+yy17:
 	++YYCURSOR;
 	if (YYLIMIT <= YYCURSOR) YYFILL(1);
 	yych = *YYCURSOR;
 	switch (yych) {
 	case '\n':
-	case '\r':	goto yy17;
-	default:	goto yy18;
+	case '\r':	goto yy16;
+	default:	goto yy17;
 	}
-yy20:
+yy19:
 	yyaccept = 1;
 	YYMARKER = ++YYCURSOR;
 	if (YYLIMIT <= YYCURSOR) YYFILL(1);
@@ -233,19 +234,19 @@ yy20:
 	case '"':
 	case '\'':
 	case ':':
-	case '?':	goto yy22;
-	case '*':	goto yy24;
-	default:	goto yy20;
+	case '?':	goto yy21;
+	case '*':	goto yy23;
+	default:	goto yy19;
 	}
-yy22:
+yy21:
 	++YYCURSOR;
 	if (YYLIMIT <= YYCURSOR) YYFILL(1);
 	yych = *YYCURSOR;
 	switch (yych) {
-	case '*':	goto yy27;
-	default:	goto yy22;
+	case '*':	goto yy26;
+	default:	goto yy21;
 	}
-yy24:
+yy23:
 	yyaccept = 1;
 	YYMARKER = ++YYCURSOR;
 	if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
@@ -255,47 +256,47 @@ yy24:
 	case '"':
 	case '\'':
 	case ':':
-	case '?':	goto yy22;
-	case '*':	goto yy24;
-	case '/':	goto yy26;
-	default:	goto yy20;
+	case '?':	goto yy21;
+	case '*':	goto yy23;
+	case '/':	goto yy25;
+	default:	goto yy19;
 	}
-yy26:
+yy25:
 	yych = *++YYCURSOR;
 	switch (yych) {
 	case 0x00:
 	case '"':
 	case '\'':
 	case ':':
-	case '?':	goto yy17;
-	default:	goto yy11;
+	case '?':	goto yy16;
+	default:	goto yy12;
 	}
-yy27:
+yy26:
 	++YYCURSOR;
 	if (YYLIMIT <= YYCURSOR) YYFILL(1);
 	yych = *YYCURSOR;
 	switch (yych) {
-	case '*':	goto yy27;
-	case '/':	goto yy29;
-	default:	goto yy22;
+	case '*':	goto yy26;
+	case '/':	goto yy28;
+	default:	goto yy21;
 	}
-yy29:
+yy28:
 	yych = *++YYCURSOR;
-	goto yy17;
-yy30:
+	goto yy16;
+yy29:
 	++YYCURSOR;
 	if (YYLIMIT <= YYCURSOR) YYFILL(1);
 	yych = *YYCURSOR;
 	switch (yych) {
 	case ':':
-	case '?':	goto yy30;
-	default:	goto yy32;
+	case '?':	goto yy29;
+	default:	goto yy31;
 	}
-yy32:
-#line 61 "ext/pdo/pdo_sql_parser.re"
+yy31:
+#line 60 "ext/pdo/pdo_sql_parser.re"
 	{ RET(PDO_PARSER_TEXT); }
-#line 298 "ext/pdo/pdo_sql_parser.c"
-yy33:
+#line 299 "ext/pdo/pdo_sql_parser.c"
+yy32:
 	++YYCURSOR;
 	if (YYLIMIT <= YYCURSOR) YYFILL(1);
 	yych = *YYCURSOR;
@@ -362,65 +363,59 @@ yy33:
 	case 'w':
 	case 'x':
 	case 'y':
-	case 'z':	goto yy33;
-	default:	goto yy35;
+	case 'z':	goto yy32;
+	default:	goto yy34;
 	}
-yy35:
-#line 62 "ext/pdo/pdo_sql_parser.re"
+yy34:
+#line 61 "ext/pdo/pdo_sql_parser.re"
 	{ RET(PDO_PARSER_BIND); }
-#line 372 "ext/pdo/pdo_sql_parser.c"
-yy36:
+#line 373 "ext/pdo/pdo_sql_parser.c"
+yy35:
 	++YYCURSOR;
 	if (YYLIMIT <= YYCURSOR) YYFILL(1);
 	yych = *YYCURSOR;
-yy37:
+yy36:
 	switch (yych) {
-	case 0x00:	goto yy38;
-	case '\'':	goto yy40;
-	case '\\':	goto yy39;
-	default:	goto yy36;
-	}
-yy38:
-	YYCURSOR = YYMARKER;
-	switch (yyaccept) {
-	case 0: 	goto yy3;
-	case 1: 	goto yy9;
+	case 0x00:	goto yy2;
+	case '\'':	goto yy38;
+	case '\\':	goto yy37;
+	default:	goto yy35;
 	}
-yy39:
+yy37:
 	++YYCURSOR;
 	if (YYLIMIT <= YYCURSOR) YYFILL(1);
 	yych = *YYCURSOR;
-	if (yych <= 0x00) goto yy38;
-	goto yy36;
-yy40:
+	if (yych <= 0x00) goto yy2;
+	goto yy35;
+yy38:
 	++YYCURSOR;
-#line 60 "ext/pdo/pdo_sql_parser.re"
+#line 59 "ext/pdo/pdo_sql_parser.re"
 	{ RET(PDO_PARSER_TEXT); }
-#line 400 "ext/pdo/pdo_sql_parser.c"
-yy42:
+#line 395 "ext/pdo/pdo_sql_parser.c"
+yy40:
 	++YYCURSOR;
 	if (YYLIMIT <= YYCURSOR) YYFILL(1);
 	yych = *YYCURSOR;
-yy43:
+yy41:
 	switch (yych) {
-	case 0x00:	goto yy38;
-	case '"':	goto yy45;
-	case '\\':	goto yy44;
-	default:	goto yy42;
+	case 0x00:	goto yy2;
+	case '"':	goto yy43;
+	case '\\':	goto yy42;
+	default:	goto yy40;
 	}
-yy44:
+yy42:
 	++YYCURSOR;
 	if (YYLIMIT <= YYCURSOR) YYFILL(1);
 	yych = *YYCURSOR;
-	if (yych <= 0x00) goto yy38;
-	goto yy42;
-yy45:
+	if (yych <= 0x00) goto yy2;
+	goto yy40;
+yy43:
 	++YYCURSOR;
-#line 59 "ext/pdo/pdo_sql_parser.re"
+#line 58 "ext/pdo/pdo_sql_parser.re"
 	{ RET(PDO_PARSER_TEXT); }
-#line 422 "ext/pdo/pdo_sql_parser.c"
+#line 417 "ext/pdo/pdo_sql_parser.c"
 }
-#line 68 "ext/pdo/pdo_sql_parser.re"
+#line 66 "ext/pdo/pdo_sql_parser.re"
 	
 }
 
@@ -450,6 +445,7 @@ PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
 
 	ptr = *outquery;
 	s.cur = inquery;
+	s.end = inquery + inquery_len + 1;
 
 	/* phase 1: look for args */
 	while((t = scan(&s)) != PDO_PARSER_EOI) {


commit 1b78aef426a8f413ddd70854eb3fd5fbc95ef675
Author: Johannes Schlüter <johannes at php.net>
Date:   Thu Apr 19 12:46:02 2012 +0200

    Fix bug #61755 parsing bug can lead to access violations

diff --git a/NEWS b/NEWS
index 0cabd97..5fe7245 100644
--- a/NEWS
+++ b/NEWS
@@ -6,7 +6,10 @@ PHP                                                                        NEWS
   . Fixed bug #61537 (json_encode() incorrectly truncates/discards
     information). (Adam)
 
-?? ??? 2012, PHP 5.3.11
+- PDO:
+  . Fixed bug #61755 (A parsing bug in the prepared statements can lead to
+    access violations). (Johannes)
+
 - Iconv extension:
   . Fixed a bug that iconv extension fails to link to the correct library
     when another extension makes use of a library that links to the iconv
diff --git a/ext/pdo/pdo_sql_parser.re b/ext/pdo/pdo_sql_parser.re
index 8becef9..88f9400 100644
--- a/ext/pdo/pdo_sql_parser.re
+++ b/ext/pdo/pdo_sql_parser.re
@@ -32,12 +32,12 @@
 
 #define YYCTYPE         unsigned char
 #define YYCURSOR        cursor
-#define YYLIMIT         cursor
+#define YYLIMIT         s->end
 #define YYMARKER        s->ptr
-#define YYFILL(n)
+#define YYFILL(n)		{ RET(PDO_PARSER_EOI); }
 
 typedef struct Scanner {
-	char 	*ptr, *cur, *tok;
+	char 	*ptr, *cur, *tok, *end;
 } Scanner;
 
 static int scan(Scanner *s) 
@@ -51,7 +51,6 @@ static int scan(Scanner *s)
 	COMMENTS	= ("/*"([^*]+|[*]+[^/*])*[*]*"*/"|"--"[^\r\n]*);
 	SPECIALS	= [:?"'];
 	MULTICHAR	= [:?];
-	EOF			= [\000];
 	ANYNOEOF	= [\001-\377];
 	*/
 
@@ -64,7 +63,6 @@ static int scan(Scanner *s)
 		SPECIALS								{ SKIP_ONE(PDO_PARSER_TEXT); }
 		COMMENTS								{ RET(PDO_PARSER_TEXT); }
 		(ANYNOEOF\SPECIALS)+ 					{ RET(PDO_PARSER_TEXT); }
-		EOF										{ RET(PDO_PARSER_EOI); }
 	*/	
 }
 
@@ -94,6 +92,7 @@ PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
 
 	ptr = *outquery;
 	s.cur = inquery;
+	s.end = inquery + inquery_len + 1;
 
 	/* phase 1: look for args */
 	while((t = scan(&s)) != PDO_PARSER_EOI) {
diff --git a/ext/pdo_mysql/tests/bug_61755.phpt b/ext/pdo_mysql/tests/bug_61755.phpt
new file mode 100644
index 0000000..1d2b968
--- /dev/null
+++ b/ext/pdo_mysql/tests/bug_61755.phpt
@@ -0,0 +1,41 @@
+--TEST--
+Bug #61755 (A parsing bug in the prepared statements can lead to access violations)
+--SKIPIF--
+<?php
+if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
+require dirname(__FILE__) . '/config.inc';
+require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
+
+$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
+
+echo "NULL-Byte before first placeholder:\n";
+$s = $db->prepare("SELECT \"a\0b\", ?");
+$s->bindValue(1,"c");
+$s->execute();
+$r = $s->fetch();
+echo "Length of item 0: ".strlen($r[0]).", Value of item 1: ".$r[1]."\n";
+
+echo "\nOpen comment:\n";
+try {
+    $s = $db->prepare("SELECT /*");
+    $s->execute();
+} catch (Exception $e) {
+    echo "Error code: ".$e->getCode()."\n";
+}
+
+echo "\ndone!\n";
+?>
+--EXPECTF--
+NULL-Byte before first placeholder:
+Length of item 0: 3, Value of item 1: c
+
+Open comment:
+Error code: 42000
+
+done!


commit 0e430c8ded3cd32c07ceec783fd6e0c33b0473fa
Merge: 904ca2f 1f4b4c3
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu Apr 19 11:38:35 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug 61671 ext\spl\tests\fileobject_003.phpt fails



commit 1f4b4c384e9f6cc783a24c36ba16d864d919b229
Merge: ff7e1ff adfb4c6
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu Apr 19 11:36:50 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug 61671 ext\spl\tests\fileobject_003.phpt fails



commit adfb4c62b76ef241978814e10cae70498f52ea29
Author: Anatoliy Belsky <ab at php.net>
Date:   Thu Apr 19 11:20:16 2012 +0200

    Fix bug 61671 ext\spl\tests\fileobject_003.phpt fails
    
    The solution was already introduced in 5.4 by Etienne Kneuss and
    Pierre but wasn't merged back into 5.3 . SplFileObject should
    not be used with directories. So just putting together all the
    necessary pieces from 5.4

diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c
index 04da4e6..aaa256d 100755
--- a/ext/spl/spl_directory.c
+++ b/ext/spl/spl_directory.c
@@ -271,7 +271,18 @@ static void spl_filesystem_dir_open(spl_filesystem_object* intern, char *path TS
 
 static int spl_filesystem_file_open(spl_filesystem_object *intern, int use_include_path, int silent TSRMLS_DC) /* {{{ */
 {
+	zval  tmp;
+
 	intern->type = SPL_FS_FILE;
+
+	php_stat(intern->file_name, intern->file_name_len, FS_IS_DIR, &tmp TSRMLS_CC);
+	if (Z_LVAL(tmp)) {
+		intern->u.file.open_mode = NULL;
+		intern->file_name = NULL;
+		zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Cannot use SplFileObject with directories");
+		return FAILURE;
+	}
+
 	intern->u.file.context = php_stream_context_from_zval(intern->u.file.zcontext, 0);
 	intern->u.file.stream = php_stream_open_wrapper_ex(intern->file_name, intern->u.file.open_mode, (use_include_path ? USE_PATH : 0) | ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, intern->u.file.context);
 
diff --git a/ext/spl/tests/SplFileObject_fflush_basic_001.phpt b/ext/spl/tests/SplFileObject_fflush_basic_001.phpt
index baab156..2d8a9c8 100644
--- a/ext/spl/tests/SplFileObject_fflush_basic_001.phpt
+++ b/ext/spl/tests/SplFileObject_fflush_basic_001.phpt
@@ -17,9 +17,12 @@ class VariableStream {
     var $varname;
 
     function stream_open($path, $mode, $options, &$opened_path)
-    {  
+    {
         return true;
     }
+
+    function url_stat() {
+    }
 }
 stream_wrapper_register("SPLtest", "VariableStream");
 $ftruncate_test = "";
diff --git a/ext/spl/tests/SplFileObject_ftruncate_error_001.phpt b/ext/spl/tests/SplFileObject_ftruncate_error_001.phpt
index 90b27ec..a2eef60 100644
--- a/ext/spl/tests/SplFileObject_ftruncate_error_001.phpt
+++ b/ext/spl/tests/SplFileObject_ftruncate_error_001.phpt
@@ -12,6 +12,9 @@ class VariableStream {
     {
         return true;
     }
+
+    function url_stat() {
+    }
 }
 stream_wrapper_register("SPLtest", "VariableStream");
 $ftruncate_test = "";
diff --git a/ext/spl/tests/fileobject_003.phpt b/ext/spl/tests/fileobject_003.phpt
index 6679673..6cc650b 100755
--- a/ext/spl/tests/fileobject_003.phpt
+++ b/ext/spl/tests/fileobject_003.phpt
@@ -18,20 +18,27 @@ function test($name, $lc, $lp)
 	var_dump($o == $c);
 	var_dump($o->getPathname() == $c->getPathname());
 	
-	$f = new SplFileObject($name);
-	var_dump($name);
-	var_dump($f->getPathName());
-	$l = substr($f->getPathName(), -1);
-	var_dump($l != '/' && $l != '\\' && $l == $lc);
-	var_dump($f->getFileName());
-	$l = substr($f->getFileName(), -1);
-	var_dump($l != '/' && $l != '\\' && $l == $lc);
-	var_dump($f->getPath());
-	$l = substr($f->getPath(), -1);
-	var_dump($l != '/' && $l != '\\' && $l == $lp);
-
-	$fo = $o->openFile();
-	var_dump($fo->getPathName(), $fo->getFileName(), $fo->getPath());
+	try {
+		$f = new SplFileObject($name);
+		var_dump($name);
+		var_dump($f->getPathName());
+		$l = substr($f->getPathName(), -1);
+		var_dump($l != '/' && $l != '\\' && $l == $lc);
+		var_dump($f->getFileName());
+		$l = substr($f->getFileName(), -1);
+		var_dump($l != '/' && $l != '\\' && $l == $lc);
+		var_dump($f->getPath());
+		$l = substr($f->getPath(), -1);
+		var_dump($l != '/' && $l != '\\' && $l == $lp);
+	} catch (LogicException $e) {
+		echo "LogicException: ".$e->getMessage()."\n";
+	}
+	try {
+		$fo = $o->openFile();
+		var_dump($fo->getPathName(), $fo->getFileName(), $fo->getPath());
+	} catch (LogicException $e) {
+		echo "LogicException: ".$e->getMessage()."\n";
+	}
 }
 
 test(dirname(__FILE__) . '/' . 'fileobject_001a.txt', 't', substr(dirname(__FILE__),-1));
@@ -84,16 +91,8 @@ object(SplFileInfo)#%d (2) {
 bool(false)
 bool(true)
 bool(true)
-%s(%d) "%stests/"
-string(%d) "%stests"
-bool(true)
-string(5) "tests"
-bool(true)
-string(%d) "%sspl"
-bool(true)
-string(%d) "%stests"
-string(%d) "tests"
-string(%d) "%sspl"
+LogicException: Cannot use SplFileObject with directories
+LogicException: Cannot use SplFileObject with directories
 ===2===
 object(SplFileInfo)#%d (2) {
   ["pathName":"SplFileInfo":private]=>
@@ -110,14 +109,6 @@ object(SplFileInfo)#%d (2) {
 bool(false)
 bool(true)
 bool(true)
-%s(%d) "%stests"
-string(%d) "%stests"
-bool(true)
-string(%d) "tests"
-bool(true)
-string(%d) "%sspl"
-bool(true)
-string(%d) "%stests"
-string(5) "tests"
-string(%d) "%sspl"
+LogicException: Cannot use SplFileObject with directories
+LogicException: Cannot use SplFileObject with directories
 ===DONE===


commit 2827324c7cc4f3a28ad66cd2a3724165abac4941
Author: Sherif Ramadan <theanomaly.is at gmail.com>
Date:   Thu Apr 19 04:44:43 2012 -0400

    Bug#59597 NumberFormatter::parse() with TYPE_INT64 results in a 32 bit integer

diff --git a/ext/intl/formatter/formatter_parse.c b/ext/intl/formatter/formatter_parse.c
index cbdde85..6f3a3a1 100755
--- a/ext/intl/formatter/formatter_parse.c
+++ b/ext/intl/formatter/formatter_parse.c
@@ -83,11 +83,10 @@ PHP_FUNCTION( numfmt_parse )
 			break;
 		case FORMAT_TYPE_INT64:
 			val64 = unum_parseInt64(FORMATTER_OBJECT(nfo), sstr, sstr_len, position_p, &INTL_DATA_ERROR_CODE(nfo));
-			if(val64 > LONG_MAX || val64 < -LONG_MAX) {
+			if(val64 > LONG_MAX || val64 < LONG_MIN) {
 				RETVAL_DOUBLE(val64);
 			} else {
-				val32 = (int32_t)val64;
-				RETVAL_LONG(val32);
+				RETVAL_LONG((long)val64);
 			}
 			break;
 		case FORMAT_TYPE_DOUBLE:
diff --git a/ext/intl/tests/bug59597.phpt b/ext/intl/tests/bug59597.phpt
new file mode 100644
index 0000000..54c9b6d
--- /dev/null
+++ b/ext/intl/tests/bug59597.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Bug#59597 NumberFormatter::parse() with TYPE_INT64 results in a 32 bit integer
+--SKIPIF--
+<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+--FILE--
+<?php
+
+$formatter = new \NumberFormatter('en', \NumberFormatter::DECIMAL);
+$value = $formatter->parse('2147483647', \NumberFormatter::TYPE_INT32);
+var_dump($value);
+
+$formatter = new \NumberFormatter('en', \NumberFormatter::DECIMAL);
+$value = $formatter->parse('2147483650', \NumberFormatter::TYPE_INT64);
+var_dump($value);
+
+?>
+--EXPECTF--
+int(2147483647)
+int(2147483650)


commit 904ca2f0b3fd8d15e3742d1bb16eb272e1c9e279
Merge: 9ca4710 ff7e1ff
Author: Johannes Schlüter <johannes at php.net>
Date:   Thu Apr 19 00:30:58 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Drop old README



commit ff7e1ff677d3b903d96a374754b90d3f640345fc
Merge: cc85e7c 4650b21
Author: Johannes Schlüter <johannes at php.net>
Date:   Thu Apr 19 00:30:45 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Drop old README



commit 4650b2164b641ba3fd9d733e8cc82e386aa98772
Author: Johannes Schlüter <johannes at php.net>
Date:   Thu Apr 19 00:29:24 2012 +0200

    Drop old README

diff --git a/README.Zeus b/README.Zeus
deleted file mode 100644
index 7fecaf0..0000000
--- a/README.Zeus
+++ /dev/null
@@ -1,112 +0,0 @@
-Using PHP 5 with the Zeus Web Server
------------------------------------
-
-Zeus fully supports running PHP in combination with our
-webserver. There are three different interfaces that can be used to
-enable PHP:
-
-* CGI
-* ISAPI
-* FastCGI
-
-Of the three, we recommend using FastCGI, which has been tested and
-benchmarked as providing the best performance and reliability.
-
-Full details of how to install PHP are available from our
-website, at:
-
-http://support.zeus.com/products/php.html
-
-If you have any problems, please check the support site for more
-up-to-date information and advice.
-
-
-Quick guide to installing CGI/FastCGI with Zeus
------------------------------------------------
-
-Step 1 - Compile PHP as FastCGI.
-
-Compile as follows:
-        ./configure --enable-fastcgi
-        make
-
-Note that PHP has many options to the configure script -
-e.g. --with-mysql. You will probably want to select your usual options
-before compiling; the above is just a bare minimum, for illustration.
-
-After compilation finishes, you will be left with an executable
-program called 'php'. Copy this into your document root, under a
-dedicated FastCGI directory (e.g. $DOCROOT/fcgi-bin/php)
-
-
-Step 2 - configure Zeus
-
-Four stages:
-        -  enable FastCGI
-        -  configure FastCGI
-        -  setup alias for FastCGI
-        -  setup alias for PHP
-
-1) Using the admin server, go to the 'module configuration' page for
-your virtual server, and ensure that 'fastcgi' is enabled (select the
-tickbox to the left).
-
-2) While we can run FastCGI's locally, there are known problems with
-some OS's (specifically, the communication between web server and
-FastCGI happens over a unix domain socket, and some OS's have trouble
-sustaining high connection rates over these sockets). So instead, we
-are going to set up the PHP FastCGI to run 'remotely' over localhost
-(this uses TCP sockets, which do not suffer this problem). Go to the
-'fastcgi configuration' page, and under 'add remote fastcgi':
-        Add Remote FastCGI
-                Docroot path            /fcgi-bin/php
-                Remote machine          localhost:8002
-The first entry is where you saved PHP, above.
-The second entry is localhost:<any unused port>
-We will start the FastCGI listening on this port shortly.
-Click 'update' to commit these changes.
-
-3) Go to the path mapping module and add an alias for FastCGI:
-        Add Alias
-                Docroot path            /fcgi-bin
-                Filesystem directory    /path/to/docroot/fcgi-bin
-                Alias type              fastcgi
-Click 'update' to commit these changes
-
-4) Also on the path mapping module, add a handler for PHP:
-        Add handler
-                File extension          php
-                Handler                 /fcgi-bin/php
-Click 'update' to commit these changes
-
-Finally restart your virtual server for these changes to take effect.
-
-
-Step 3 - start PHP as a FastCGI runner
-
-When you start PHP, it will pre-fork a given number of child processes
-to handle incoming PHP requests. Each process will handle a given
-number of requests before exiting (and being replaced by a newly
-forked process). You can control these two parameters by setting the
-following environment variables BEFORE starting the FastCGI runner:
-
-PHP_FCGI_CHILDREN - the number of child processes to pre-fork. This
-variable MUST be set, if not then the PHP will not run as a FastCGI.
-We recommend a value of 8 for a fairly busy site. If you have many,
-long-running PHP scripts, then you may need to increase this further.
-
-PHP_FCGI_MAX_REQUESTS - the number of requests each PHP child process
-handles before exiting. If not set, defaults to 500.
-
-To start the FastCGI runner, execute '$ZEUSHOME/web/bin/fcgirunner
-8002 $DOCROOT/fcgi-bin/php'.  Substitute the appropriate values for
-$ZEUSHOME and $DOCROOT; also substitute for 8002 the port you chose,
-above.
-
-To stop the runner (e.g. to experiment with the above environment
-variables) you will need to manually stop and running PHP
-processes. (Use 'ps' and 'kill'). As it is PHP which is forking lots
-of children and not the runner, Zeus unfortunately cannot keep track
-of what processes are running, sorry. A typical command line may look
-like 'ps -efl | grep $DOCROOT/fcgi-bin/php | grep -v grep | awk
-'{print $4}' | xargs kill'


commit 9ca4710c9fb09bca31726e902e2eedab6c6abc94
Merge: f3b3450 cc85e7c
Author: Johannes Schlüter <johannes at php.net>
Date:   Thu Apr 19 00:08:42 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix slight grammar glitch (thanks Dan Brown)



commit cc85e7c31391de9acdd348c947c9165520a924a2
Merge: 900751e 710021d
Author: Johannes Schlüter <johannes at php.net>
Date:   Thu Apr 19 00:08:36 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix slight grammar glitch (thanks Dan Brown)



commit 710021d1d4a57941450b7ed482e3c19cfe62fecf
Author: Johannes Schlüter <johannes at php.net>
Date:   Thu Apr 19 00:07:40 2012 +0200

    Fix slight grammar glitch (thanks Dan Brown)

diff --git a/php.ini-development b/php.ini-development
index 7effd70..c198ccc 100644
--- a/php.ini-development
+++ b/php.ini-development
@@ -19,7 +19,7 @@
 ; See the PHP docs for more specific information.
 ; http://php.net/configuration.file
 
-; The syntax of the file is extremely simple.  Whitespace and Lines
+; The syntax of the file is extremely simple.  Whitespace and lines
 ; beginning with a semicolon are silently ignored (as you probably guessed).
 ; Section headers (e.g. [Foo]) are also silently ignored, even though
 ; they might mean something in the future.
diff --git a/php.ini-production b/php.ini-production
index 499807a..3c0ae21 100644
--- a/php.ini-production
+++ b/php.ini-production
@@ -19,7 +19,7 @@
 ; See the PHP docs for more specific information.
 ; http://php.net/configuration.file
 
-; The syntax of the file is extremely simple.  Whitespace and Lines
+; The syntax of the file is extremely simple.  Whitespace and lines
 ; beginning with a semicolon are silently ignored (as you probably guessed).
 ; Section headers (e.g. [Foo]) are also silently ignored, even though
 ; they might mean something in the future.


commit f3b3450f010a8368a142034cef56fbab7f26212e
Merge: 15f552d 140c8c1
Author: Johannes Schlüter <johannes at php.net>
Date:   Wed Apr 18 22:51:15 2012 +0200

    Merge branch 'master' of git.php.net:/php-src
    
    * 'master' of git.php.net:/php-src:



commit 15f552dbd0b6169a4d060b9649c5d2e21ac1e467
Merge: fcb63a8 900751e
Author: Johannes Schlüter <johannes at php.net>
Date:   Wed Apr 18 22:51:06 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Update generated file.
      Ensure the SQL parser is regenerated after changes.
      Fix NEWS, the previous wrong was introduced in commit cb2a1c71c96d7c9b2ee03d77beae0c8e0d385f1b
      update NEWS



commit 900751e8ae4ed2af3e63e7c355fac59f6f932254
Merge: 56d8d35 e946eac
Author: Johannes Schlüter <johannes at php.net>
Date:   Wed Apr 18 22:50:21 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Update generated file.
      Ensure the SQL parser is regenerated after changes.



commit e946eaca0bc747615fabd0fedb8a92ea800ed158
Author: Johannes Schlüter <johannes at php.net>
Date:   Wed Apr 18 22:47:14 2012 +0200

    Update generated file.

diff --git a/ext/pdo/pdo_sql_parser.c b/ext/pdo/pdo_sql_parser.c
index d67f0e0..ed8af84 100644
--- a/ext/pdo/pdo_sql_parser.c
+++ b/ext/pdo/pdo_sql_parser.c
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Sat Jun  4 18:42:25 2011 */
+/* Generated by re2c 0.13.5 on Wed Apr 18 22:30:06 2012 */
 #line 1 "ext/pdo/pdo_sql_parser.re"
 /*
   +----------------------------------------------------------------------+
@@ -569,7 +569,7 @@ safe:
 								param->param_type TSRMLS_CC)) {
 							/* bork */
 							ret = -1;
-							strcpy(stmt->error_code, stmt->dbh->error_code);
+							strncpy(stmt->error_code, stmt->dbh->error_code, 6);
 							if (buf) {
 								efree(buf);
 							}
@@ -592,6 +592,9 @@ safe:
 							plc->freeq = 0;
 							break;
 
+						case IS_BOOL:
+							convert_to_long(param->parameter);
+
 						case IS_LONG:
 						case IS_DOUBLE:
 							convert_to_string(param->parameter);
@@ -600,8 +603,6 @@ safe:
 							plc->freeq = 0;
 							break;
 
-						case IS_BOOL:
-							convert_to_long(param->parameter);
 						default:
 							convert_to_string(param->parameter);
 							if (!stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_P(param->parameter),
@@ -609,7 +610,7 @@ safe:
 									param->param_type TSRMLS_CC)) {
 								/* bork */
 								ret = -1;
-								strcpy(stmt->error_code, stmt->dbh->error_code);
+								strncpy(stmt->error_code, stmt->dbh->error_code, 6);
 								goto clean_up;
 							}
 							plc->freeq = 1;


commit dda60f3014743fcbfc1078a8e52b4d7b2e09b839
Author: Johannes Schlüter <johannes at php.net>
Date:   Wed Apr 18 22:45:59 2012 +0200

    Ensure the SQL parser is regenerated after changes.

diff --git a/ext/pdo/Makefile.frag b/ext/pdo/Makefile.frag
index 283a6e2..98f5c5f 100644
--- a/ext/pdo/Makefile.frag
+++ b/ext/pdo/Makefile.frag
@@ -4,6 +4,10 @@ PDO_HEADER_FILES= \
 	php_pdo.h \
 	php_pdo_driver.h
 
+
+$(srcdir)/pdo_sql_parser.c: $(srcdir)/pdo_sql_parser.re
+	(cd $(top_srcdir); $(RE2C) -o ext/pdo/pdo_sql_parser.c ext/pdo/pdo_sql_parser.re)
+
 install-pdo-headers:
 	@echo "Installing PDO headers:          $(INSTALL_ROOT)$(phpincludedir)/ext/pdo/"
 	@$(mkinstalldirs) $(INSTALL_ROOT)$(phpincludedir)/ext/pdo


commit 140c8c197593884a1746d8c1c59a71f9b4859943
Merge: fcb63a8 56d8d35
Author: Xinchen Hui <laruence at php.net>
Date:   Wed Apr 18 18:48:36 2012 +0800

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix NEWS, the previous wrong was introduced in commit cb2a1c71c96d7c9b2ee03d77beae0c8e0d385f1b
      update NEWS



commit 56d8d353009dbe9678fd292f205eaf32aca59b9e
Author: Xinchen Hui <laruence at php.net>
Date:   Wed Apr 18 18:43:46 2012 +0800

    Fix NEWS, the previous wrong was introduced in commit cb2a1c71c96d7c9b2ee03d77beae0c8e0d385f1b
    
    http://git.php.net/?p=php-src.git;a=commitdiff;h=cb2a1c71c96d7c9b2ee03d77beae0c8e0d385f1b

diff --git a/NEWS b/NEWS
index 94c75c8..e09e1ab 100644
--- a/NEWS
+++ b/NEWS
@@ -8,14 +8,6 @@ PHP                                                                        NEWS
     $_SERVER['SCRIPT_FILENAME'] when using router). (Laruence)
   . "Connection: close" instead of "Connection: closed" (Gustavo)
 
-- JSON
-  . Fixed bug #61537 (json_encode() incorrectly truncates/discards
-    information). (Adam)
-
-?? ??? 2012, PHP 5.3.11
-
-(merge after 5.3.11 release)
-
 - Core:
   . Fixed bug #61761 ('Overriding' a private static method with a different 
     signature causes crash). (Laruence)
@@ -71,6 +63,10 @@ PHP                                                                        NEWS
   . Fixed bug #61487 (Incorrent bounds checking in grapheme_strpos).
     (Stas)
 
+- JSON
+  . Fixed bug #61537 (json_encode() incorrectly truncates/discards
+    information). (Adam)
+
 - Libxml:
   . Fixed bug #61617 (Libxml tests failed(ht is already destroyed)).
     (Laruence)


commit 172aa3c6d77ab4af9439131e960307659e0195ef
Author: Xinchen Hui <laruence at php.net>
Date:   Wed Apr 18 18:42:39 2012 +0800

    update NEWS

diff --git a/NEWS b/NEWS
index c862a6f..94c75c8 100644
--- a/NEWS
+++ b/NEWS
@@ -17,7 +17,10 @@ PHP                                                                        NEWS
 (merge after 5.3.11 release)
 
 - Core:
-  . Fixed bug #61728 (PHP crash when calling ob_start in request_shutdown phase). (Laruence)
+  . Fixed bug #61761 ('Overriding' a private static method with a different 
+    signature causes crash). (Laruence)
+  . Fixed bug #61728 (PHP crash when calling ob_start in request_shutdown 
+    phase). (Laruence)
   . Fixed bug #61660 (bin2hex(hex2bin($data)) != $data). (Nikita Popov)
   . Fixed bug #61650 (ini parser crashes when using ${xxxx} ini variables
     (without apache2)). (Laruence)


commit fcb63a8396bbbb06cfe1ebf690d06d3ba8182e40
Merge: 6b9e88d 0618e33
Author: Johannes Schlüter <johannes at php.net>
Date:   Wed Apr 18 12:23:35 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Add NEWS
      Implement Request #47570	libpq's PG_VERSION should be exported to userland



commit 0618e33b5dbac73efc0893884051b5c24e7ab409
Merge: d6394e6 da6465a
Author: Johannes Schlüter <johannes at php.net>
Date:   Wed Apr 18 12:22:27 2012 +0200

    Merge branch 'PHP-5.4' of git.php.net:/php-src into PHP-5.4
    
    * 'PHP-5.4' of git.php.net:/php-src:
      Fixed bug #61761 ('Overriding' a private static method with a different signature causes crash)



commit d6394e66a31e788560e664d6823d30b2e759d7cb
Author: Yasuo Ohgaki <yohgaki at ohgaki.net>
Date:   Tue Apr 17 16:34:47 2012 +0900

    Add NEWS

diff --git a/NEWS b/NEWS
index 2eafb98..c862a6f 100644
--- a/NEWS
+++ b/NEWS
@@ -788,6 +788,7 @@ PHP                                                                        NEWS
 - Postgres:
   . Fixed bug #60244 (pg_fetch_* functions do not validate that row param 
     is >0). (Ilia)
+  . Added PGSQL_LIBPQ_VERSION/PGSQL_LIBPQ_VERSION_STR constants. (Yasuo)
 
 - Reflection:
   . Fixed bug #60367 (Reflection and Late Static Binding). (Laruence)


commit cce0f8e507c05ecc7c8222efa5005991f04ce4c0
Author: Yasuo Ohgaki <yohgaki at ohgaki.net>
Date:   Fri Mar 30 09:45:33 2012 +0900

    Implement Request #47570	libpq's PG_VERSION should be exported to userland

diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index d8127af..54a86a8 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -934,6 +934,11 @@ PHP_MINIT_FUNCTION(pgsql)
 	le_result = zend_register_list_destructors_ex(_free_result, NULL, "pgsql result", module_number);
 	le_lofp = zend_register_list_destructors_ex(_free_ptr, NULL, "pgsql large object", module_number);
 	le_string = zend_register_list_destructors_ex(_free_ptr, NULL, "pgsql string", module_number);
+#if HAVE_PG_CONFIG_H
+	/* PG_VERSION - libpq version */
+	REGISTER_STRING_CONSTANT("PGSQL_LIBPQ_VERSION", PG_VERSION, CONST_CS | CONST_PERSISTENT);
+	REGISTER_STRING_CONSTANT("PGSQL_LIBPQ_VERSION_STR", PG_VERSION_STR, CONST_CS | CONST_PERSISTENT);
+#endif
 	/* For connection option */
 	REGISTER_LONG_CONSTANT("PGSQL_CONNECT_FORCE_NEW", PGSQL_CONNECT_FORCE_NEW, CONST_CS | CONST_PERSISTENT);
 	/* For pg_fetch_array() */
@@ -1048,6 +1053,7 @@ PHP_MINFO_FUNCTION(pgsql)
 	php_info_print_table_header(2, "PostgreSQL Support", "enabled");
 #if HAVE_PG_CONFIG_H
 	php_info_print_table_row(2, "PostgreSQL(libpq) Version", PG_VERSION);
+	php_info_print_table_row(2, "PostgreSQL(libpq) ", PG_VERSION_STR);
 #ifdef HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT
 	php_info_print_table_row(2, "Multibyte character support", "enabled");
 #else


commit 6b9e88d9e6ed528d138dca815c8b5aff5b7f89c7
Merge: dbc5b42 da6465a
Author: Xinchen Hui <laruence at php.net>
Date:   Wed Apr 18 18:15:29 2012 +0800

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fixed bug #61761 ('Overriding' a private static method with a different signature causes crash)



commit da6465a268d9ece2ffd38447890b206dd94b3250
Author: Xinchen Hui <laruence at php.net>
Date:   Wed Apr 18 18:13:27 2012 +0800

    Fixed bug #61761 ('Overriding' a private static method with a different signature causes crash)

diff --git a/NEWS b/NEWS
index 2eafb98..1b0278c 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,10 @@ PHP                                                                        NEWS
     $_SERVER['SCRIPT_FILENAME'] when using router). (Laruence)
   . "Connection: close" instead of "Connection: closed" (Gustavo)
 
+- Core:
+  . Fixed bug #61761 ('Overriding' a private static method with a different 
+    signature causes crash). (Laruence)
+
 - JSON
   . Fixed bug #61537 (json_encode() incorrectly truncates/discards
     information). (Adam)
@@ -17,7 +21,8 @@ PHP                                                                        NEWS
 (merge after 5.3.11 release)
 
 - Core:
-  . Fixed bug #61728 (PHP crash when calling ob_start in request_shutdown phase). (Laruence)
+  . Fixed bug #61728 (PHP crash when calling ob_start in request_shutdown 
+    phase). (Laruence)
   . Fixed bug #61660 (bin2hex(hex2bin($data)) != $data). (Nikita Popov)
   . Fixed bug #61650 (ini parser crashes when using ${xxxx} ini variables
     (without apache2)). (Laruence)
diff --git a/Zend/tests/bug61761.phpt b/Zend/tests/bug61761.phpt
new file mode 100755
index 0000000..631f566
--- /dev/null
+++ b/Zend/tests/bug61761.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Bug #61761 ('Overriding' a private static method with a different signature causes crash)
+--FILE--
+<?php
+
+class A
+{
+        private static function test($a) { }
+}
+
+class B extends A
+{
+        private static function test($a, $b) { }
+}
+
+?>
+--EXPECTF--
+Strict Standards: Declaration of B::test() should be compatible with A::test($a) in %sbug61761.php on line %d
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index c3c35eb..602b600 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -3260,11 +3260,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 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)); 
 		}
 	} 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 TSRMLS_CC);
+			char *method_prototype = zend_get_function_declaration(child->common.prototype? child->common.prototype : 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);
 		}


commit dbc5b42435a1d5c72d569814bd36e08fef5f028a
Author: Gustavo André dos Santos Lopes <cataphract at php.net>
Date:   Tue Apr 17 22:18:48 2012 +0100

    pack() with new "Z" more in line with Perl.
    
    Made pack() with "Z" force NUL termination, even if it mean truncating input
    to less than the number of characters specified and if the number of
    characters is "*", the output will be one byte larger than the input.
    
    Improved tests.

diff --git a/ext/standard/pack.c b/ext/standard/pack.c
index c2fa28f..3cd6ee7 100644
--- a/ext/standard/pack.c
+++ b/ext/standard/pack.c
@@ -187,6 +187,12 @@ PHP_FUNCTION(pack)
 					}
 					convert_to_string_ex(argv[currentarg]);
 					arg = Z_STRLEN_PP(argv[currentarg]);
+					if (code == 'Z') {
+						/* add one because Z is always NUL-terminated:
+						 * pack("Z*", "aa") === "aa\0"
+						 * pack("Z2", "aa") === "a\0" */
+						arg++;
+					}
 				}
 
 				currentarg++;
@@ -317,7 +323,8 @@ PHP_FUNCTION(pack)
 		switch ((int) code) {
 			case 'a': 
 			case 'A': 
-			case 'Z': 
+			case 'Z': {
+				int arg_cp = (code != 'Z') ? arg : MAX(0, arg - 1);
 				memset(&output[outputpos], (code == 'a' || code == 'Z') ? '\0' : ' ', arg);
 				val = argv[currentarg++];
 				if (Z_ISREF_PP(val)) {
@@ -325,9 +332,10 @@ PHP_FUNCTION(pack)
 				}
 				convert_to_string_ex(val);
 				memcpy(&output[outputpos], Z_STRVAL_PP(val),
-					   (Z_STRLEN_PP(val) < arg) ? Z_STRLEN_PP(val) : arg);
+					   (Z_STRLEN_PP(val) < arg_cp) ? Z_STRLEN_PP(val) : arg_cp);
 				outputpos += arg;
 				break;
+			}
 
 			case 'h': 
 			case 'H': {
diff --git a/ext/standard/tests/strings/bug61038.phpt b/ext/standard/tests/strings/bug61038.phpt
index 10fcef8..7130804 100644
--- a/ext/standard/tests/strings/bug61038.phpt
+++ b/ext/standard/tests/strings/bug61038.phpt
@@ -1,37 +1,26 @@
 --TEST--
-BugFix #61038
+Bug #61038: unpack("a5", "str\0\0") does not work as expected
 --FILE--
 <?php
-	var_dump(unpack("Z4", pack("Z4", "foo")));
-	var_dump(unpack("a4", pack("a4", "foo")));
-	var_dump(unpack("A4", pack("A4", "foo")));
-	var_dump(unpack("a9", pack("a*", "foo\x00bar\x00 ")));
-	var_dump(unpack("A9", pack("a*", "foo\x00bar\x00 ")));
-	var_dump(unpack("Z9", pack("a*", "foo\x00bar\x00 ")));
+var_dump(unpack("a4", "str\0\0"));
+var_dump(unpack("a5", "str\0\0"));
+var_dump(unpack("a6", "str\0\0"));
+var_dump(unpack("a*", "str\0\0"));
 ?>
 --EXPECTF--
 array(1) {
   [1]=>
-  string(3) "foo"
+  string(4) "str%c"
 }
 array(1) {
   [1]=>
-  string(4) "foo%c"
-}
-array(1) {
-  [1]=>
-  string(3) "foo"
-}
-array(1) {
-  [1]=>
-  string(9) "foo%cbar%c "
-}
-array(1) {
-  [1]=>
-  string(7) "foo%cbar"
+  string(5) "str%c%c"
 }
+
+Warning: unpack(): Type a: not enough input, need 6, have 5 in %s on line %d
+bool(false)
 array(1) {
   [1]=>
-  string(3) "foo"
+  string(5) "str%c%c"
 }
 
diff --git a/ext/standard/tests/strings/pack_A.phpt b/ext/standard/tests/strings/pack_A.phpt
new file mode 100644
index 0000000..59fc22e
--- /dev/null
+++ b/ext/standard/tests/strings/pack_A.phpt
@@ -0,0 +1,25 @@
+--TEST--
+pack()/unpack(): "A" modifier
+--FILE--
+<?php
+var_dump(
+	pack("A5", "foo "),
+	pack("A4", "fooo"),
+	pack("A4", "foo"),
+	unpack("A*", "foo\0\rbar\0 \t\r\n"),
+	unpack("A4", "foo\0\rbar\0 \t\r\n")
+);
+?>
+--EXPECTF--
+string(5) "foo  "
+string(4) "fooo"
+string(4) "foo "
+array(1) {
+  [1]=>
+  string(8) "foo%c%cbar"
+}
+array(1) {
+  [1]=>
+  string(3) "foo"
+}
+
diff --git a/ext/standard/tests/strings/pack_Z.phpt b/ext/standard/tests/strings/pack_Z.phpt
new file mode 100644
index 0000000..8a2ee67
--- /dev/null
+++ b/ext/standard/tests/strings/pack_Z.phpt
@@ -0,0 +1,27 @@
+--TEST--
+pack()/unpack(): "Z" format
+--FILE--
+<?php
+var_dump(
+	pack("Z0", "f"),
+    pack("Z5", "foo\0"),
+    pack("Z4", "fooo"),
+    pack("Z4", "foo"),
+	pack("Z*", "foo"),
+    unpack("Z*", "foo\0\rbar\0 \t\r\n"),
+    unpack("Z9", "foo\0\rbar\0 \t\r\n")
+);
+--EXPECTF--
+string(0) ""
+string(5) "foo%c%c"
+string(4) "foo%c"
+string(4) "foo%c"
+string(4) "foo%c"
+array(1) {
+  [1]=>
+  string(3) "foo"
+}
+array(1) {
+  [1]=>
+  string(3) "foo"
+}


commit 4968fa644b0849321e1761e52b8db15dd46f9b75
Author: theanomaly.is at gmail.com <googleguy at googleguy-virtualbox.(none)>
Date:   Tue Apr 17 07:31:36 2012 -0400

    Fixed bug #61038; "Z" and better behavior for unpack()
    
    Added new "Z" argument to pack/unpack, now allowing "a" to return
    data without stripping, and "A" strips all trailing white space,
    while "Z" will strip everything after the first null.

diff --git a/NEWS b/NEWS
index ecfaa93..ff5a31d 100644
--- a/NEWS
+++ b/NEWS
@@ -9,9 +9,11 @@ PHP                                                                        NEWS
   . Support constant array/string dereferencing. (Laruence)
 
 - Core:
+  . Fixed bug #61681 (Malformed grammar). (Nikita Popov, Etienne, Laruence).
+  . Fixed bug #61038 (unpack("a5", "str\0\0") does not work as expected).
+    (srgoogleguy, Gustavo)
   . Implemented FR #60738 (Allow 'set_error_handler' to handle NULL).
     (Laruence, Nikita Popov)
-  . Fixed bug #61681 (Malformed grammar). (Nikita Popov, Etienne, Laruence).
 
 - cURL:
   . Added support for CURLOPT_FTP_RESPONSE_TIMEOUT, CURLOPT_APPEND, 
diff --git a/UPGRADING b/UPGRADING
index d6d6e9b..27d01cb 100755
--- a/UPGRADING
+++ b/UPGRADING
@@ -46,6 +46,12 @@ PHP X.Y UPGRADE NOTES
 4. Changed Functions
 ========================================
 
+- pack()/unpack() had the following changes, which bring it more in line
+  with Perl's behavior:
+  - Implemented format character "Z": NUL-padded string
+  - "a" now does not remove trailing NUL characters on unpack() anymore
+  - "A" will now strip all trailing ASCII whitespace on unpack() (it used to
+    remove only trailing spaces.
 
 ========================================
 5. New Functions
diff --git a/ext/standard/pack.c b/ext/standard/pack.c
index faf0a2b..c2fa28f 100644
--- a/ext/standard/pack.c
+++ b/ext/standard/pack.c
@@ -99,7 +99,7 @@ static void php_pack(zval **val, int size, int *map, char *output)
 /* }}} */
 
 /* pack() idea stolen from Perl (implemented formats behave the same as there)
- * Implemented formats are A, a, h, H, c, C, s, S, i, I, l, L, n, N, f, d, x, X, @.
+ * Implemented formats are Z, A, a, h, H, c, C, s, S, i, I, l, L, n, N, f, d, x, X, @.
  */
 /* {{{ proto string pack(string format, mixed arg1 [, mixed arg2 [, mixed ...]])
    Takes one or more arguments and packs them into a binary string according to the format argument */
@@ -170,6 +170,7 @@ PHP_FUNCTION(pack)
 			/* Always uses one arg */
 			case 'a': 
 			case 'A': 
+			case 'Z': 
 			case 'h': 
 			case 'H':
 				if (currentarg >= num_args) {
@@ -250,6 +251,7 @@ PHP_FUNCTION(pack)
 
 			case 'a': 
 			case 'A':
+			case 'Z':
 			case 'c': 
 			case 'C':
 			case 'x':
@@ -315,7 +317,8 @@ PHP_FUNCTION(pack)
 		switch ((int) code) {
 			case 'a': 
 			case 'A': 
-				memset(&output[outputpos], (code == 'a') ? '\0' : ' ', arg);
+			case 'Z': 
+				memset(&output[outputpos], (code == 'a' || code == 'Z') ? '\0' : ' ', arg);
 				val = argv[currentarg++];
 				if (Z_ISREF_PP(val)) {
 					SEPARATE_ZVAL(val);
@@ -511,7 +514,7 @@ static long php_unpack(char *data, int size, int issigned, int *map)
  * chars1, chars2, and ints.
  * Numeric pack types will return numbers, a and A will return strings,
  * f and d will return doubles.
- * Implemented formats are A, a, h, H, c, C, s, S, i, I, l, L, n, N, f, d, x, X, @.
+ * Implemented formats are Z, A, a, h, H, c, C, s, S, i, I, l, L, n, N, f, d, x, X, @.
  */
 /* {{{ proto array unpack(string format, string input)
    Unpack binary string into named array elements according to format argument */
@@ -586,6 +589,7 @@ PHP_FUNCTION(unpack)
 
 			case 'a': 
 			case 'A':
+			case 'Z':
 				size = arg;
 				arg = 1;
 				break;
@@ -662,9 +666,24 @@ PHP_FUNCTION(unpack)
 
 			if ((inputpos + size) <= inputlen) {
 				switch ((int) type) {
-					case 'a': 
+					case 'a': {
+						/* a will not strip any trailing whitespace or null padding */
+						char pad = ' ';
+						int len = inputlen - inputpos;	/* Remaining string */
+
+						/* If size was given take minimum of len and size */
+						if ((size >= 0) && (len > size)) {
+							len = size;
+						}
+
+						size = len;
+
+						add_assoc_stringl(return_value, n, &input[inputpos], len, 1);
+						break;
+					}
 					case 'A': {
-						char pad = (type == 'a') ? '\0' : ' ';
+						/* A will strip any trailing whitespace */
+						char padn = '\0'; char pads = ' '; char padt = '\t'; char padc = '\r'; char padl = '\n';
 						int len = inputlen - inputpos;	/* Remaining string */
 
 						/* If size was given take minimum of len and size */
@@ -674,15 +693,45 @@ PHP_FUNCTION(unpack)
 
 						size = len;
 
-						/* Remove padding chars from unpacked data */
+						/* Remove trailing white space and nulls chars from unpacked data */
 						while (--len >= 0) {
-							if (input[inputpos + len] != pad)
+							if (input[inputpos + len] != padn
+								&& input[inputpos + len] != pads
+								&& input[inputpos + len] != padt
+								&& input[inputpos + len] != padc
+								&& input[inputpos + len] != padl
+							)
 								break;
 						}
 
 						add_assoc_stringl(return_value, n, &input[inputpos], len + 1, 1);
 						break;
 					}
+					/* New option added for Z to remain in-line with the Perl implementation */
+					case 'Z': {
+						/* Z will strip everything after the first null character */
+						char pad = '\0';
+						int len = inputlen - inputpos;	/* Remaining string */
+
+						/* If size was given take minimum of len and size */
+						if ((size >= 0) && (len > size)) {
+							len = size;
+						}
+
+						size = len;
+
+						/* Remove everything after the first null */
+						int s = 0;
+						while (s++ <= len) {
+							if (input[inputpos + s] == pad)
+								break;
+						}
+						len = s;
+
+						add_assoc_stringl(return_value, n, &input[inputpos], len, 1);
+						break;
+					}
+
 					
 					case 'h': 
 					case 'H': {
diff --git a/ext/standard/tests/strings/bug61038.phpt b/ext/standard/tests/strings/bug61038.phpt
new file mode 100644
index 0000000..10fcef8
--- /dev/null
+++ b/ext/standard/tests/strings/bug61038.phpt
@@ -0,0 +1,37 @@
+--TEST--
+BugFix #61038
+--FILE--
+<?php
+	var_dump(unpack("Z4", pack("Z4", "foo")));
+	var_dump(unpack("a4", pack("a4", "foo")));
+	var_dump(unpack("A4", pack("A4", "foo")));
+	var_dump(unpack("a9", pack("a*", "foo\x00bar\x00 ")));
+	var_dump(unpack("A9", pack("a*", "foo\x00bar\x00 ")));
+	var_dump(unpack("Z9", pack("a*", "foo\x00bar\x00 ")));
+?>
+--EXPECTF--
+array(1) {
+  [1]=>
+  string(3) "foo"
+}
+array(1) {
+  [1]=>
+  string(4) "foo%c"
+}
+array(1) {
+  [1]=>
+  string(3) "foo"
+}
+array(1) {
+  [1]=>
+  string(9) "foo%cbar%c "
+}
+array(1) {
+  [1]=>
+  string(7) "foo%cbar"
+}
+array(1) {
+  [1]=>
+  string(3) "foo"
+}
+
diff --git a/ext/standard/tests/strings/unpack_error.phpt b/ext/standard/tests/strings/unpack_error.phpt
index 43b2df1..1ef97cc 100644
--- a/ext/standard/tests/strings/unpack_error.phpt
+++ b/ext/standard/tests/strings/unpack_error.phpt
@@ -19,7 +19,7 @@ var_dump(unpack("I", pack("I", 65534), $extra_arg));
 
 echo "\n-- Testing unpack() function with invalid format character --\n";
 $extra_arg = 10;
-var_dump(unpack("Z", pack("I", 65534)));
+var_dump(unpack("G", pack("I", 65534)));
 ?>
 ===DONE===
 --EXPECTF--
@@ -37,6 +37,6 @@ NULL
 
 -- Testing unpack() function with invalid format character --
 
-Warning: unpack(): Invalid format type Z in %s on line %d
+Warning: unpack(): Invalid format type G in %s on line %d
 bool(false)
 ===DONE===


commit 417e9cfe1b26249a49e5834d2ee7d495be1ad45e
Author: Yasuo Ohgaki <yohgaki at ohgaki.net>
Date:   Fri Mar 30 09:45:33 2012 +0900

    Implement Request #47570	libpq's PG_VERSION should be exported to userland

diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index e54b824..ad66779 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -947,6 +947,11 @@ PHP_MINIT_FUNCTION(pgsql)
 	le_result = zend_register_list_destructors_ex(_free_result, NULL, "pgsql result", module_number);
 	le_lofp = zend_register_list_destructors_ex(_free_ptr, NULL, "pgsql large object", module_number);
 	le_string = zend_register_list_destructors_ex(_free_ptr, NULL, "pgsql string", module_number);
+#if HAVE_PG_CONFIG_H
+	/* PG_VERSION - libpq version */
+	REGISTER_STRING_CONSTANT("PGSQL_LIBPQ_VERSION", PG_VERSION, CONST_CS | CONST_PERSISTENT);
+	REGISTER_STRING_CONSTANT("PGSQL_LIBPQ_VERSION_STR", PG_VERSION_STR, CONST_CS | CONST_PERSISTENT);
+#endif
 	/* For connection option */
 	REGISTER_LONG_CONSTANT("PGSQL_CONNECT_FORCE_NEW", PGSQL_CONNECT_FORCE_NEW, CONST_CS | CONST_PERSISTENT);
 	/* For pg_fetch_array() */
@@ -1061,6 +1066,7 @@ PHP_MINFO_FUNCTION(pgsql)
 	php_info_print_table_header(2, "PostgreSQL Support", "enabled");
 #if HAVE_PG_CONFIG_H
 	php_info_print_table_row(2, "PostgreSQL(libpq) Version", PG_VERSION);
+	php_info_print_table_row(2, "PostgreSQL(libpq) ", PG_VERSION_STR);
 #ifdef HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT
 	php_info_print_table_row(2, "Multibyte character support", "enabled");
 #else


commit 65062b47f35b858d6e6d0f91bacc929b470aa3a3
Author: Xinchen Hui <laruence at php.net>
Date:   Tue Apr 17 11:23:28 2012 +0800

    Fix bug #61430 for trunk

diff --git a/sapi/fpm/fpm/fpm_shm.c b/sapi/fpm/fpm/fpm_shm.c
index 6acbddf..9226adf 100644
--- a/sapi/fpm/fpm/fpm_shm.c
+++ b/sapi/fpm/fpm/fpm_shm.c
@@ -35,7 +35,7 @@ void *fpm_shm_alloc(size_t size) /* {{{ */
 		return NULL;
 	}
 
-	memset(mem, size, 0);
+	memset(mem, 0, size);
 	fpm_shm_size += size;
 	return mem;
 }


commit 565892d4c09ff39e96d1de16a22be21242bb83e9
Author: Xinchen Hui <laruence at php.net>
Date:   Sun Apr 15 11:40:38 2012 +0800

    Implement const array/string dereference
    
    RFC:https://wiki.php.net/rfc/constdereference

diff --git a/NEWS b/NEWS
index 6aa804c..ecfaa93 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ PHP                                                                        NEWS
   . Drop Windows XP and 2003 support. (Pierre)
   . World domination
   . Improve set_exception_handler while doing reset.(Laruence)
+  . Support constant array/string dereferencing. (Laruence)
 
 - Core:
   . Implemented FR #60738 (Allow 'set_error_handler' to handle NULL).
diff --git a/UPGRADING b/UPGRADING
index 575ff1b..d6d6e9b 100755
--- a/UPGRADING
+++ b/UPGRADING
@@ -26,6 +26,8 @@ PHP X.Y UPGRADE NOTES
 2. New Features
 ========================================
 
+- Support constant array/string dereferencing. (Laruence)
+  (https://wiki.php.net/rfc/constdereference)
 
 ========================================
 2. Changes in SAPI modules
diff --git a/Zend/tests/const_dereference_001.phpt b/Zend/tests/const_dereference_001.phpt
new file mode 100644
index 0000000..5fe6e4d
--- /dev/null
+++ b/Zend/tests/const_dereference_001.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Const array deference
+--FILE--
+<?php
+error_reporting(E_ALL);
+
+var_dump(array(1, 2, 3, 4,) [3]);
+var_dump(array(1, 2, 3, 4,) ['foo']);
+var_dump(array(array(1,2,3), array(4, 5, 6))[1][2]);
+
+foreach (array(array(1, 2, 3))[0] as $var) {
+     echo $var;
+}
+?>
+--EXPECTF--
+int(4)
+
+Notice: Undefined index: foo in %sconst_dereference_001.php on line %d
+NULL
+int(6)
+123
diff --git a/Zend/tests/const_dereference_002.phpt b/Zend/tests/const_dereference_002.phpt
new file mode 100644
index 0000000..ff89519
--- /dev/null
+++ b/Zend/tests/const_dereference_002.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Const string dereference
+--FILE--
+<?php
+error_reporting(E_ALL);
+
+var_dump("foobar"[3]);
+var_dump("foobar"[2][0]);
+var_dump("foobar"["foo"]["bar"]);
+
+--EXPECTF--
+string(1) "b"
+string(1) "o"
+
+Warning: Illegal string offset 'foo' in %sconst_dereference_002.php on line %d
+
+Warning: Illegal string offset 'bar' in %sconst_dereference_002.php on line %d
+string(1) "f"
diff --git a/Zend/tests/const_dereference_003.phpt b/Zend/tests/const_dereference_003.phpt
new file mode 100644
index 0000000..810ad14
--- /dev/null
+++ b/Zend/tests/const_dereference_003.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Const array deference
+--FILE--
+<?php
+error_reporting(E_ALL);
+
+var_dump([1, 2, 3, 4,][3]);
+var_dump([1, 2, 3, 4]['foo']);
+var_dump([array(1,2,3), [4, 5, 6]][1][2]);
+
+foreach (array([1, 2, 3])[0] as $var) {
+     echo $var;
+}
+?>
+--EXPECTF--
+int(4)
+
+Notice: Undefined index: foo in %sconst_dereference_003.php on line %d
+NULL
+int(6)
+123
diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y
index d0730b7..893e013 100644
--- a/Zend/zend_language_parser.y
+++ b/Zend/zend_language_parser.y
@@ -789,8 +789,8 @@ expr_without_variable:
 	|	T_EXIT exit_expr	{ zend_do_exit(&$$, &$2 TSRMLS_CC); }
 	|	'@' { zend_do_begin_silence(&$1 TSRMLS_CC); } expr { zend_do_end_silence(&$1 TSRMLS_CC); $$ = $3; }
 	|	scalar				{ $$ = $1; }
-	|	T_ARRAY '(' array_pair_list ')' { $$ = $3; }
- 	|	'[' array_pair_list ']' { $$ = $2; }
+	|	combined_scalar_offset { zend_do_end_variable_parse(&$1, BP_VAR_R, 0 TSRMLS_CC); }
+	|	combined_scalar { $$ = $1; }
 	|	'`' backticks_expr '`' { zend_do_shell_exec(&$$, &$2 TSRMLS_CC); }
 	|	T_PRINT expr  { zend_do_print(&$$, &$2 TSRMLS_CC); }
 	|	function is_reference '(' { zend_do_begin_lambda_function_declaration(&$$, &$1, $2.op_type, 0 TSRMLS_CC); }
@@ -799,6 +799,15 @@ expr_without_variable:
 			parameter_list ')' lexical_vars '{' inner_statement_list '}' {  zend_do_end_function_declaration(&$2 TSRMLS_CC); $$ = $5; }
 ;
 
+combined_scalar_offset:
+	  combined_scalar '[' dim_offset ']' { zend_do_begin_variable_parse(TSRMLS_C); fetch_array_dim(&$$, &$1, &$3 TSRMLS_CC); }
+	| combined_scalar_offset '[' dim_offset ']' { fetch_array_dim(&$$, &$1, &$3 TSRMLS_CC); }
+    | T_CONSTANT_ENCAPSED_STRING '[' dim_offset ']' { zend_do_begin_variable_parse(TSRMLS_C); fetch_array_dim(&$$, &$1, &$3 TSRMLS_CC); }
+
+combined_scalar:
+      T_ARRAY '(' array_pair_list ')' { $$ = $3; }
+    | '[' array_pair_list ']' { $$ = $2; }
+
 function:
 	T_FUNCTION { $$.u.op.opline_num = CG(zend_lineno); }
 ;
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 8cceb19..7b13b44 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -1174,7 +1174,7 @@ ZEND_VM_HANDLER(89, ZEND_FETCH_IS, CONST|TMP|VAR|CV, UNUSED|CONST|VAR)
 	ZEND_VM_DISPATCH_TO_HELPER_EX(zend_fetch_var_address_helper, type, BP_VAR_IS);
 }
 
-ZEND_VM_HANDLER(81, ZEND_FETCH_DIM_R, VAR|CV, CONST|TMP|VAR|CV)
+ZEND_VM_HANDLER(81, ZEND_FETCH_DIM_R, CONST|TMP|VAR|CV, CONST|TMP|VAR|CV)
 {
 	USE_OPLINE
 	zend_free_op free_op1, free_op2;
@@ -1187,10 +1187,19 @@ ZEND_VM_HANDLER(81, ZEND_FETCH_DIM_R, VAR|CV, CONST|TMP|VAR|CV)
 	    EX_T(opline->op1.var).var.ptr_ptr) {
 		PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
 	}
-	container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_R);
-	zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE, BP_VAR_R TSRMLS_CC);
-	FREE_OP2();
-	FREE_OP1_VAR_PTR();
+    
+    if (OP1_TYPE == IS_TMP_VAR || OP1_TYPE == IS_CONST) {
+        zval *container = GET_OP1_ZVAL_PTR(BP_VAR_R);
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE, BP_VAR_R TSRMLS_CC);
+        FREE_OP2();
+        FREE_OP1();
+    } else {
+        container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_R);
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE, BP_VAR_R TSRMLS_CC);
+        FREE_OP2();
+        FREE_OP1_VAR_PTR();
+    }
+
 	CHECK_EXCEPTION();
 	ZEND_VM_NEXT_OPCODE();
 }
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 68ba74b..2096c44 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -3374,6 +3374,36 @@ static int ZEND_FASTCALL  ZEND_FETCH_IS_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HAN
 	return zend_fetch_var_address_helper_SPEC_CONST_CONST(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
 }
 
+static int ZEND_FASTCALL  ZEND_FETCH_DIM_R_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+	USE_OPLINE
+
+	zval **container;
+
+	SAVE_OPLINE();
+
+	if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) &&
+	    IS_CONST != IS_CV &&
+	    EX_T(opline->op1.var).var.ptr_ptr) {
+		PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
+	}
+
+    if (IS_CONST == IS_TMP_VAR || IS_CONST == IS_CONST) {
+        zval *container = opline->op1.zv;
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC);
+
+
+    } else {
+        container = NULL;
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC);
+
+
+    }
+
+	CHECK_EXCEPTION();
+	ZEND_VM_NEXT_OPCODE();
+}
+
 static int ZEND_FASTCALL  ZEND_FETCH_DIM_TMP_VAR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
 {
 	USE_OPLINE
@@ -4200,6 +4230,36 @@ static int ZEND_FASTCALL  ZEND_BOOL_XOR_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDL
 	ZEND_VM_NEXT_OPCODE();
 }
 
+static int ZEND_FASTCALL  ZEND_FETCH_DIM_R_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+	USE_OPLINE
+	zend_free_op free_op2;
+	zval **container;
+
+	SAVE_OPLINE();
+
+	if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) &&
+	    IS_CONST != IS_CV &&
+	    EX_T(opline->op1.var).var.ptr_ptr) {
+		PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
+	}
+
+    if (IS_CONST == IS_TMP_VAR || IS_CONST == IS_CONST) {
+        zval *container = opline->op1.zv;
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC);
+        zval_dtor(free_op2.var);
+
+    } else {
+        container = NULL;
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC);
+        zval_dtor(free_op2.var);
+
+    }
+
+	CHECK_EXCEPTION();
+	ZEND_VM_NEXT_OPCODE();
+}
+
 static int ZEND_FASTCALL  ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
 {
 	USE_OPLINE
@@ -4874,6 +4934,36 @@ static int ZEND_FASTCALL  ZEND_FETCH_IS_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDL
 	return zend_fetch_var_address_helper_SPEC_CONST_VAR(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
 }
 
+static int ZEND_FASTCALL  ZEND_FETCH_DIM_R_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+	USE_OPLINE
+	zend_free_op free_op2;
+	zval **container;
+
+	SAVE_OPLINE();
+
+	if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) &&
+	    IS_CONST != IS_CV &&
+	    EX_T(opline->op1.var).var.ptr_ptr) {
+		PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
+	}
+
+    if (IS_CONST == IS_TMP_VAR || IS_CONST == IS_CONST) {
+        zval *container = opline->op1.zv;
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC);
+        if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+
+    } else {
+        container = NULL;
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC);
+        if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+
+    }
+
+	CHECK_EXCEPTION();
+	ZEND_VM_NEXT_OPCODE();
+}
+
 static int ZEND_FASTCALL  ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
 {
 	USE_OPLINE
@@ -6104,6 +6194,36 @@ static int ZEND_FASTCALL  ZEND_BOOL_XOR_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLE
 	ZEND_VM_NEXT_OPCODE();
 }
 
+static int ZEND_FASTCALL  ZEND_FETCH_DIM_R_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+	USE_OPLINE
+
+	zval **container;
+
+	SAVE_OPLINE();
+
+	if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) &&
+	    IS_CONST != IS_CV &&
+	    EX_T(opline->op1.var).var.ptr_ptr) {
+		PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
+	}
+
+    if (IS_CONST == IS_TMP_VAR || IS_CONST == IS_CONST) {
+        zval *container = opline->op1.zv;
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC);
+
+
+    } else {
+        container = NULL;
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC);
+
+
+    }
+
+	CHECK_EXCEPTION();
+	ZEND_VM_NEXT_OPCODE();
+}
+
 static int ZEND_FASTCALL  ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
 {
 	USE_OPLINE
@@ -7840,6 +7960,36 @@ static int ZEND_FASTCALL  ZEND_FETCH_IS_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDL
 	return zend_fetch_var_address_helper_SPEC_TMP_CONST(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
 }
 
+static int ZEND_FASTCALL  ZEND_FETCH_DIM_R_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+	USE_OPLINE
+	zend_free_op free_op1;
+	zval **container;
+
+	SAVE_OPLINE();
+
+	if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) &&
+	    IS_TMP_VAR != IS_CV &&
+	    EX_T(opline->op1.var).var.ptr_ptr) {
+		PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
+	}
+
+    if (IS_TMP_VAR == IS_TMP_VAR || IS_TMP_VAR == IS_CONST) {
+        zval *container = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC);
+
+        zval_dtor(free_op1.var);
+    } else {
+        container = NULL;
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC);
+
+
+    }
+
+	CHECK_EXCEPTION();
+	ZEND_VM_NEXT_OPCODE();
+}
+
 static int ZEND_FASTCALL  ZEND_FETCH_DIM_TMP_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
 {
 	USE_OPLINE
@@ -8534,6 +8684,36 @@ static int ZEND_FASTCALL  ZEND_BOOL_XOR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER
 	ZEND_VM_NEXT_OPCODE();
 }
 
+static int ZEND_FASTCALL  ZEND_FETCH_DIM_R_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+	USE_OPLINE
+	zend_free_op free_op1, free_op2;
+	zval **container;
+
+	SAVE_OPLINE();
+
+	if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) &&
+	    IS_TMP_VAR != IS_CV &&
+	    EX_T(opline->op1.var).var.ptr_ptr) {
+		PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
+	}
+
+    if (IS_TMP_VAR == IS_TMP_VAR || IS_TMP_VAR == IS_CONST) {
+        zval *container = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC);
+        zval_dtor(free_op2.var);
+        zval_dtor(free_op1.var);
+    } else {
+        container = NULL;
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC);
+        zval_dtor(free_op2.var);
+
+    }
+
+	CHECK_EXCEPTION();
+	ZEND_VM_NEXT_OPCODE();
+}
+
 static int ZEND_FASTCALL  ZEND_ADD_VAR_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
 {
 	USE_OPLINE
@@ -9208,6 +9388,36 @@ static int ZEND_FASTCALL  ZEND_FETCH_IS_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER
 	return zend_fetch_var_address_helper_SPEC_TMP_VAR(BP_VAR_IS, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
 }
 
+static int ZEND_FASTCALL  ZEND_FETCH_DIM_R_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+	USE_OPLINE
+	zend_free_op free_op1, free_op2;
+	zval **container;
+
+	SAVE_OPLINE();
+
+	if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) &&
+	    IS_TMP_VAR != IS_CV &&
+	    EX_T(opline->op1.var).var.ptr_ptr) {
+		PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
+	}
+
+    if (IS_TMP_VAR == IS_TMP_VAR || IS_TMP_VAR == IS_CONST) {
+        zval *container = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC);
+        if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+        zval_dtor(free_op1.var);
+    } else {
+        container = NULL;
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC);
+        if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+
+    }
+
+	CHECK_EXCEPTION();
+	ZEND_VM_NEXT_OPCODE();
+}
+
 static int ZEND_FASTCALL  ZEND_ADD_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
 {
 	USE_OPLINE
@@ -10304,6 +10514,36 @@ static int ZEND_FASTCALL  ZEND_BOOL_XOR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_
 	ZEND_VM_NEXT_OPCODE();
 }
 
+static int ZEND_FASTCALL  ZEND_FETCH_DIM_R_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+{
+	USE_OPLINE
+	zend_free_op free_op1;
+	zval **container;
+
+	SAVE_OPLINE();
+
+	if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) &&
+	    IS_TMP_VAR != IS_CV &&
+	    EX_T(opline->op1.var).var.ptr_ptr) {
+		PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
+	}
+
+    if (IS_TMP_VAR == IS_TMP_VAR || IS_TMP_VAR == IS_CONST) {
+        zval *container = _get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC);
+
+        zval_dtor(free_op1.var);
+    } else {
+        container = NULL;
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC);
+
+
+    }
+
+	CHECK_EXCEPTION();
+	ZEND_VM_NEXT_OPCODE();
+}
+
 static int ZEND_FASTCALL  ZEND_ADD_VAR_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
 {
 	USE_OPLINE
@@ -12858,10 +13098,19 @@ static int ZEND_FASTCALL  ZEND_FETCH_DIM_R_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HA
 	    EX_T(opline->op1.var).var.ptr_ptr) {
 		PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
 	}
-	container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
-	zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC);
 
-	if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+    if (IS_VAR == IS_TMP_VAR || IS_VAR == IS_CONST) {
+        zval *container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC);
+
+        if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+    } else {
+        container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC);
+
+        if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+    }
+
 	CHECK_EXCEPTION();
 	ZEND_VM_NEXT_OPCODE();
 }
@@ -15025,10 +15274,19 @@ static int ZEND_FASTCALL  ZEND_FETCH_DIM_R_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAND
 	    EX_T(opline->op1.var).var.ptr_ptr) {
 		PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
 	}
-	container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
-	zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC);
-	zval_dtor(free_op2.var);
-	if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+
+    if (IS_VAR == IS_TMP_VAR || IS_VAR == IS_CONST) {
+        zval *container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC);
+        zval_dtor(free_op2.var);
+        if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+    } else {
+        container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC);
+        zval_dtor(free_op2.var);
+        if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+    }
+
 	CHECK_EXCEPTION();
 	ZEND_VM_NEXT_OPCODE();
 }
@@ -17106,10 +17364,19 @@ static int ZEND_FASTCALL  ZEND_FETCH_DIM_R_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAND
 	    EX_T(opline->op1.var).var.ptr_ptr) {
 		PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
 	}
-	container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
-	zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC);
-	if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
-	if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+
+    if (IS_VAR == IS_TMP_VAR || IS_VAR == IS_CONST) {
+        zval *container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC);
+        if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+        if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+    } else {
+        container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC);
+        if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+        if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+    }
+
 	CHECK_EXCEPTION();
 	ZEND_VM_NEXT_OPCODE();
 }
@@ -20222,10 +20489,19 @@ static int ZEND_FASTCALL  ZEND_FETCH_DIM_R_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDL
 	    EX_T(opline->op1.var).var.ptr_ptr) {
 		PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
 	}
-	container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
-	zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC);
 
-	if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+    if (IS_VAR == IS_TMP_VAR || IS_VAR == IS_CONST) {
+        zval *container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC);
+
+        if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+    } else {
+        container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC);
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC);
+
+        if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+    }
+
 	CHECK_EXCEPTION();
 	ZEND_VM_NEXT_OPCODE();
 }
@@ -28655,10 +28931,19 @@ static int ZEND_FASTCALL  ZEND_FETCH_DIM_R_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAN
 	    EX_T(opline->op1.var).var.ptr_ptr) {
 		PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
 	}
-	container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
-	zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC);
+
+    if (IS_CV == IS_TMP_VAR || IS_CV == IS_CONST) {
+        zval *container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC);
+
+
+    } else {
+        container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC);
 
 
+    }
+
 	CHECK_EXCEPTION();
 	ZEND_VM_NEXT_OPCODE();
 }
@@ -30601,9 +30886,18 @@ static int ZEND_FASTCALL  ZEND_FETCH_DIM_R_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDL
 	    EX_T(opline->op1.var).var.ptr_ptr) {
 		PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
 	}
-	container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
-	zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC);
-	zval_dtor(free_op2.var);
+
+    if (IS_CV == IS_TMP_VAR || IS_CV == IS_CONST) {
+        zval *container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC);
+        zval_dtor(free_op2.var);
+
+    } else {
+        container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC);
+        zval_dtor(free_op2.var);
+
+    }
 
 	CHECK_EXCEPTION();
 	ZEND_VM_NEXT_OPCODE();
@@ -32553,9 +32847,18 @@ static int ZEND_FASTCALL  ZEND_FETCH_DIM_R_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDL
 	    EX_T(opline->op1.var).var.ptr_ptr) {
 		PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
 	}
-	container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
-	zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC);
-	if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+
+    if (IS_CV == IS_TMP_VAR || IS_CV == IS_CONST) {
+        zval *container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC);
+        if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+
+    } else {
+        container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC);
+        if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
+
+    }
 
 	CHECK_EXCEPTION();
 	ZEND_VM_NEXT_OPCODE();
@@ -35400,9 +35703,18 @@ static int ZEND_FASTCALL  ZEND_FETCH_DIM_R_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLE
 	    EX_T(opline->op1.var).var.ptr_ptr) {
 		PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
 	}
-	container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
-	zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC);
 
+    if (IS_CV == IS_TMP_VAR || IS_CV == IS_CONST) {
+        zval *container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), &container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC);
+
+
+    } else {
+        container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC);
+        zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC);
+
+
+    }
 
 	CHECK_EXCEPTION();
 	ZEND_VM_NEXT_OPCODE();
@@ -38520,16 +38832,16 @@ void zend_init_opcodes_handlers(void)
   	ZEND_FETCH_R_SPEC_CV_VAR_HANDLER,
   	ZEND_FETCH_R_SPEC_CV_UNUSED_HANDLER,
   	ZEND_NULL_HANDLER,
+  	ZEND_FETCH_DIM_R_SPEC_CONST_CONST_HANDLER,
+  	ZEND_FETCH_DIM_R_SPEC_CONST_TMP_HANDLER,
+  	ZEND_FETCH_DIM_R_SPEC_CONST_VAR_HANDLER,
   	ZEND_NULL_HANDLER,
+  	ZEND_FETCH_DIM_R_SPEC_CONST_CV_HANDLER,
+  	ZEND_FETCH_DIM_R_SPEC_TMP_CONST_HANDLER,
+  	ZEND_FETCH_DIM_R_SPEC_TMP_TMP_HANDLER,
+  	ZEND_FETCH_DIM_R_SPEC_TMP_VAR_HANDLER,
   	ZEND_NULL_HANDLER,
-  	ZEND_NULL_HANDLER,
-  	ZEND_NULL_HANDLER,
-  	ZEND_NULL_HANDLER,
-  	ZEND_NULL_HANDLER,
-  	ZEND_NULL_HANDLER,
-  	ZEND_NULL_HANDLER,
-  	ZEND_NULL_HANDLER,
-  	ZEND_NULL_HANDLER,
+  	ZEND_FETCH_DIM_R_SPEC_TMP_CV_HANDLER,
   	ZEND_FETCH_DIM_R_SPEC_VAR_CONST_HANDLER,
   	ZEND_FETCH_DIM_R_SPEC_VAR_TMP_HANDLER,
   	ZEND_FETCH_DIM_R_SPEC_VAR_VAR_HANDLER,


commit 739eda38cd7eee7a93ee49b8a91a96e8ee25bcc0
Merge: 80d692f d55afe4
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 16 17:07:52 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug 61746 Failing tests in ext/standard/tests/file/windows_links/*



commit d55afe4df63945a6e3abe9892ba7836f83c74265
Merge: 3d106ae f3d86b3
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 16 17:07:33 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug 61746 Failing tests in ext/standard/tests/file/windows_links/*



commit f3d86b314f4977f95844aa4eaa41759c8d71c247
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 16 17:06:30 2012 +0200

    Fix bug 61746 Failing tests in ext/standard/tests/file/windows_links/*

diff --git a/ext/standard/tests/file/windows_links/bug48746.phpt b/ext/standard/tests/file/windows_links/bug48746.phpt
index 6c88c63..a47b7cb 100644
--- a/ext/standard/tests/file/windows_links/bug48746.phpt
+++ b/ext/standard/tests/file/windows_links/bug48746.phpt
@@ -17,13 +17,14 @@ if (count($output) == 0) {
 ?>
 --FILE--
 <?php
+$mountvol = "c:\\Windows\\System32\\mountvol.exe";
 $old_dir = __DIR__;
 $dirname = __DIR__ . "\\mnt\\test\\directory";
 mkdir($dirname, 0700, true);
 chdir(__DIR__ . "\\mnt\\test");
 $drive = substr(__DIR__, 0, 2);
 $pathwithoutdrive = substr(__DIR__, 2);
-$ret = exec("mountvol " . $drive . " /L", $output, $ret_val);
+$ret = exec($mountvol . " " . $drive . " /L", $output, $ret_val);
 exec("mklink /j mounted_volume " . $ret, $output, $ret_val);
 $fullpath = "mounted_volume" . $pathwithoutdrive;
 exec("mklink /j mklink_junction directory", $output, $ret_val);
diff --git a/ext/standard/tests/file/windows_links/bug48746_1.phpt b/ext/standard/tests/file/windows_links/bug48746_1.phpt
index ca8450a..716c656 100644
--- a/ext/standard/tests/file/windows_links/bug48746_1.phpt
+++ b/ext/standard/tests/file/windows_links/bug48746_1.phpt
@@ -17,13 +17,14 @@ if (count($output) == 0) {
 ?>
 --FILE--
 <?php
+$mountvol = "c:\\Windows\\System32\\mountvol.exe";
 $old_dir = __DIR__;
 $dirname = __DIR__ . "\\mnt\\test\\directory";
 exec("mkdir " . $dirname, $output, $ret_val);
 chdir(__DIR__ . "\\mnt\\test");
 $drive = substr(__DIR__, 0, 2);
 $pathwithoutdrive = substr(__DIR__, 2);
-$ret = exec("mountvol " . $drive . " /L", $output, $ret_val);
+$ret = exec($mountvol . " " . $drive . " /L", $output, $ret_val);
 exec("mklink /j mounted_volume " . $ret, $output, $ret_val);
 $fullpath = "mounted_volume" . $pathwithoutdrive;
 exec("mklink /j mklink_junction directory", $output, $ret_val);
diff --git a/ext/standard/tests/file/windows_links/bug48746_2.phpt b/ext/standard/tests/file/windows_links/bug48746_2.phpt
index 7beed16..637152c 100644
--- a/ext/standard/tests/file/windows_links/bug48746_2.phpt
+++ b/ext/standard/tests/file/windows_links/bug48746_2.phpt
@@ -17,13 +17,14 @@ unlink('mklink bug48746_tmp.lnk');
 ?>
 --FILE--
 <?php
+$mountvol = "c:\\Windows\\System32\\mountvol.exe";
 $old_dir = __DIR__;
 $dirname = __DIR__ . "\\mnt\\test\\directory";
 exec("mkdir " . $dirname, $output, $ret_val);
 chdir(__DIR__ . "\\mnt\\test");
 $drive = substr(__DIR__, 0, 2);
 $pathwithoutdrive = substr(__DIR__, 2);
-$ret = exec("mountvol " . $drive . " /L", $output, $ret_val);
+$ret = exec($mountvol . " " . $drive . " /L", $output, $ret_val);
 exec("mklink /j mounted_volume " . $ret, $output, $ret_val);
 $fullpath = "mounted_volume" . $pathwithoutdrive;
 exec("mklink /j mklink_junction directory", $output, $ret_val);


commit 80d692f51d84ce2094c729b21f1dc5476342ca66
Merge: 27e1a36 3d106ae
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 16 15:46:24 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug 61720 ext\libxml\tests\bug61367-read.phpt fails



commit 3d106aeb0d9b1d2c03483f96e3250afa023c942d
Merge: 4ac6862 bceafee
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 16 15:46:02 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug 61720 ext\libxml\tests\bug61367-read.phpt fails



commit bceafee879785b176e6b4564908d0b2c82cb6a0b
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 16 15:45:03 2012 +0200

    Fix bug 61720 ext\libxml\tests\bug61367-read.phpt fails

diff --git a/ext/libxml/tests/bug61367-read.phpt b/ext/libxml/tests/bug61367-read.phpt
index 722b8e7..3deecfc 100644
--- a/ext/libxml/tests/bug61367-read.phpt
+++ b/ext/libxml/tests/bug61367-read.phpt
@@ -15,6 +15,7 @@ class StreamExploiter {
 		$doc->resolveExternals = true;
 		$doc->substituteEntities = true;
 		$dir = htmlspecialchars(dirname(getcwd()));
+		$dir = str_replace('\\', '/', $dir); // fix for windows
 		$doc->loadXML( <<<XML
 <!DOCTYPE doc [
 	<!ENTITY file SYSTEM "file:///$dir/bad">


commit 27e1a36d1930ac80ca48e75dda1cf63a5911b8f2
Merge: eaeeb0f 4ac6862
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 16 15:40:38 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug 61719 ext\soap\tests\bugs\bug31422.phpt fails



commit 4ac6862fc461ff475994a2c3f001cde353034ca3
Merge: 5d15650 9c8907e
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 16 15:40:10 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug 61719 ext\soap\tests\bugs\bug31422.phpt fails

diff --cc ext/soap/tests/bugs/bug31422.phpt
index c4cf7e9,40e8973..c8ddcfe
--- a/ext/soap/tests/bugs/bug31422.phpt
+++ b/ext/soap/tests/bugs/bug31422.phpt
@@@ -1,10 -1,14 +1,15 @@@
  --TEST--
  Bug #31422 (No Error-Logging on SoapServer-Side)
  --SKIPIF--
- <?php require_once('skipif.inc'); ?>
+ <?php
+ if (substr(PHP_OS, 0, 3) == 'WIN') {
+     die('skip not valid for windows');
+ }
+ require_once('skipif.inc');
+ ?>
  --INI--
  log_errors=1
 +error_log=
  --FILE--
  <?php
  function Add($x,$y) {


commit 9c8907ec10aa7af751c9717293c707fe717831e4
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 16 15:38:46 2012 +0200

    Fix bug 61719 ext\soap\tests\bugs\bug31422.phpt fails

diff --git a/ext/soap/tests/bugs/bug31422-win.phpt b/ext/soap/tests/bugs/bug31422-win.phpt
new file mode 100644
index 0000000..ba8df07
--- /dev/null
+++ b/ext/soap/tests/bugs/bug31422-win.phpt
@@ -0,0 +1,47 @@
+--TEST--
+Bug #31422 (No Error-Logging on SoapServer-Side)
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+    die('skip not valid for non windows');
+}
+require_once('skipif.inc');
+?>
+--INI--
+log_errors=1
+--FILE--
+<?php
+function Add($x,$y) {
+	fopen();
+	user_error("Hello", E_USER_ERROR);
+  return $x+$y;
+}
+
+$server = new SoapServer(null,array('uri'=>"http://testuri.org"));
+$server->addfunction("Add");
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xmlns:si="http://soapinterop.org/xsd">
+  <SOAP-ENV:Body>
+    <ns1:Add xmlns:ns1="http://testuri.org">
+      <x xsi:type="xsd:int">22</x>
+      <y xsi:type="xsd:int">33</y>
+    </ns1:Add>
+  </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Hello</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+PHP Warning:  fopen() expects at least 2 parameters, 0 given in %sbug31422-win.php on line %d
+PHP Fatal error:  Hello in %sbug31422-win.php on line %d
diff --git a/ext/soap/tests/bugs/bug31422.phpt b/ext/soap/tests/bugs/bug31422.phpt
index 459da78..40e8973 100644
--- a/ext/soap/tests/bugs/bug31422.phpt
+++ b/ext/soap/tests/bugs/bug31422.phpt
@@ -1,7 +1,12 @@
 --TEST--
 Bug #31422 (No Error-Logging on SoapServer-Side)
 --SKIPIF--
-<?php require_once('skipif.inc'); ?>
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+    die('skip not valid for windows');
+}
+require_once('skipif.inc');
+?>
 --INI--
 log_errors=1
 --FILE--


commit eaeeb0f5e88c7e68c6fc44abb597af10e7b925d7
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 16 15:35:47 2012 +0200

    Fix bug 61719 ext\soap\tests\bugs\bug31422.phpt fails

diff --git a/ext/soap/tests/bugs/bug31422-win.phpt b/ext/soap/tests/bugs/bug31422-win.phpt
new file mode 100644
index 0000000..ba8df07
--- /dev/null
+++ b/ext/soap/tests/bugs/bug31422-win.phpt
@@ -0,0 +1,47 @@
+--TEST--
+Bug #31422 (No Error-Logging on SoapServer-Side)
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+    die('skip not valid for non windows');
+}
+require_once('skipif.inc');
+?>
+--INI--
+log_errors=1
+--FILE--
+<?php
+function Add($x,$y) {
+	fopen();
+	user_error("Hello", E_USER_ERROR);
+  return $x+$y;
+}
+
+$server = new SoapServer(null,array('uri'=>"http://testuri.org"));
+$server->addfunction("Add");
+
+$HTTP_RAW_POST_DATA = <<<EOF
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<SOAP-ENV:Envelope
+  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
+  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
+  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xmlns:si="http://soapinterop.org/xsd">
+  <SOAP-ENV:Body>
+    <ns1:Add xmlns:ns1="http://testuri.org">
+      <x xsi:type="xsd:int">22</x>
+      <y xsi:type="xsd:int">33</y>
+    </ns1:Add>
+  </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+EOF;
+
+$server->handle($HTTP_RAW_POST_DATA);
+echo "ok\n";
+?>
+--EXPECTF--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Hello</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
+PHP Warning:  fopen() expects at least 2 parameters, 0 given in %sbug31422-win.php on line %d
+PHP Fatal error:  Hello in %sbug31422-win.php on line %d
diff --git a/ext/soap/tests/bugs/bug31422.phpt b/ext/soap/tests/bugs/bug31422.phpt
index c4cf7e9..c8ddcfe 100644
--- a/ext/soap/tests/bugs/bug31422.phpt
+++ b/ext/soap/tests/bugs/bug31422.phpt
@@ -1,7 +1,12 @@
 --TEST--
 Bug #31422 (No Error-Logging on SoapServer-Side)
 --SKIPIF--
-<?php require_once('skipif.inc'); ?>
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+    die('skip not valid for windows');
+}
+require_once('skipif.inc');
+?>
 --INI--
 log_errors=1
 error_log=


commit a688e69baed276ab65a0c96d7d5647dd0c4f3e37
Merge: 38d87ed 5d15650
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 16 15:27:20 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug 61718 ext\ldap\tests\ldap_set_rebind_proc_error.phpt fails



commit 5d1565088fe57c7d0dc711e7a1271bc7c8bd948a
Merge: 1a44faf 1c435ae
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 16 15:26:50 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug 61718 ext\ldap\tests\ldap_set_rebind_proc_error.phpt fails



commit 1c435ae498bb89c466e5c74e3be8c85cff17835a
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 16 15:25:20 2012 +0200

    Fix bug 61718 ext\ldap\tests\ldap_set_rebind_proc_error.phpt fails

diff --git a/ext/ldap/tests/ldap_set_rebind_proc_error.phpt b/ext/ldap/tests/ldap_set_rebind_proc_error.phpt
index 3b4cd69..966612f 100644
--- a/ext/ldap/tests/ldap_set_rebind_proc_error.phpt
+++ b/ext/ldap/tests/ldap_set_rebind_proc_error.phpt
@@ -5,6 +5,16 @@ Patrick Allaert <patrickallaert at php.net>
 # Belgian PHP Testfest 2009
 --SKIPIF--
 <?php require_once('skipif.inc'); ?>
+<?php
+	if (!function_exists("ldap_set_rebind_proc")) {
+		die("skip ldap_set_rebind_proc() does not exist");
+	}
+	require "connect.inc";
+	$link = fsockopen($host, $port);
+	if (!$link) {
+		die("skip no server listening");
+	}
+?>
 --FILE--
 <?php
 require "connect.inc";


commit 38d87ed3ba495497a3b39060b67ad169314d55b1
Merge: 7dda0d5 1a44faf
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 16 15:21:36 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug 61717 ext\ldap\tests\ldap_sasl_bind_basic.phpt fails



commit 1a44faf26458f03af896d6ac1da08eb128541ea3
Merge: 9f42c18 47e7755
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 16 15:21:04 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug 61717 ext\ldap\tests\ldap_sasl_bind_basic.phpt fails



commit 47e7755785e49836ca9b0e5376ec81fa209b9386
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 16 15:20:03 2012 +0200

    Fix bug 61717 ext\ldap\tests\ldap_sasl_bind_basic.phpt fails

diff --git a/ext/ldap/tests/ldap_sasl_bind_basic.phpt b/ext/ldap/tests/ldap_sasl_bind_basic.phpt
index 6ed14a5..efa1f82 100644
--- a/ext/ldap/tests/ldap_sasl_bind_basic.phpt
+++ b/ext/ldap/tests/ldap_sasl_bind_basic.phpt
@@ -6,6 +6,13 @@ Patrick Allaert <patrickallaert at php.net>
 --SKIPIF--
 <?php require_once('skipif.inc'); ?>
 <?php if (!function_exists("ldap_sasl_bind")) die("skip LDAP extension not compiled with SASL support"); ?>
+<?php
+	require "connect.inc";
+	$link = fsockopen($host, $port);
+	if (!$link) {
+		die("skip no server listening");
+	}
+?>
 --FILE--
 <?php
 require "connect.inc";


commit 7dda0d5f8d0e6f753a0bfa6be047ef6dae6b72f7
Merge: a6d8919 9f42c18
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 16 15:16:43 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug 61716 tests\basic\021.phpt fails



commit 9f42c1890b4e34922eade63a5eb95f1a25d20556
Merge: 45977c6 4fa1743
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 16 15:16:06 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug 61716 tests\basic\021.phpt fails



commit 4fa1743009888ab209539598a564ad0d8f5fc7cc
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 16 15:14:26 2012 +0200

    Fix bug 61716 tests\basic\021.phpt fails

diff --git a/tests/basic/021.phpt b/tests/basic/021.phpt
index e79ac7d..eeaf588 100644
--- a/tests/basic/021.phpt
+++ b/tests/basic/021.phpt
@@ -2,6 +2,7 @@
 Bug #37276 (problems witch $_POST array)
 --INI--
 file_uploads=1
+upload_tmp_dir=.
 --POST_RAW--
 Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
 -----------------------------20896060251896012921717172737


commit a6d8919a89e4b2e3ca150a7781fd14647afd2f55
Merge: f5d8e2b 45977c6
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 16 14:40:18 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug 61683 tests\basic\bug20539.phpt fails



commit 45977c6aae0814d51e8902d77e4ebe79a1ab78cf
Merge: d588d01 aaed0af
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 16 14:39:39 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug 61683 tests\basic\bug20539.phpt fails



commit aaed0af418e153de27d698b1a529914d86637d20
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 16 14:38:16 2012 +0200

    Fix bug 61683 tests\basic\bug20539.phpt fails

diff --git a/tests/basic/bug20539.phpt b/tests/basic/bug20539.phpt
index 67cef3a..1406ce0 100644
--- a/tests/basic/bug20539.phpt
+++ b/tests/basic/bug20539.phpt
@@ -11,7 +11,8 @@ session.save_path=./tests/basic/
 <?php
 	print "good :)\n";
 	$filename = __DIR__ . '/sess_' . session_id();
-	var_dump(unlink($filename));
+	var_dump(file_exists($filename));
+	@unlink($filename);
 ?>
 --EXPECT--
 good :)


commit f5d8e2b89637a27e167025f58e15250ebbc74b5e
Merge: b2c4278 d588d01
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 16 14:06:03 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug 61680 ext\zlib\tests\gzencode_variation1-win32.phpt fails



commit d588d01b7c6583fc7da2dfbbc67d2beef1070ef4
Merge: ede519d 163c1a3
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 16 14:05:32 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug 61680 ext\zlib\tests\gzencode_variation1-win32.phpt fails



commit 163c1a393f9163b1741f43dd0ab279c3c8c810ca
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 16 14:04:29 2012 +0200

    Fix bug 61680 ext\zlib\tests\gzencode_variation1-win32.phpt fails

diff --git a/ext/zlib/tests/gzencode_variation1-win32.phpt b/ext/zlib/tests/gzencode_variation1-win32.phpt
index efb223b..5ff5778 100644
--- a/ext/zlib/tests/gzencode_variation1-win32.phpt
+++ b/ext/zlib/tests/gzencode_variation1-win32.phpt
@@ -19,19 +19,28 @@ if (!extension_loaded("zlib")) {
  * Alias to functions: 
  */
 
+if(!function_exists("gzdecode")) {
+	function gzdecode($data) 
+	{ 
+	   return gzinflate(substr($data,10,-8)); 
+	}
+}
+
+
 include(dirname(__FILE__) . '/data.inc');
 
 echo "*** Testing gzencode() : variation ***\n";
 
 echo "\n-- Testing multiple compression --\n";
-$output = gzencode($data);
-var_dump(bin2hex(gzencode($output)));
+$output = gzencode(gzencode($data));
 
+$back = gzdecode(gzdecode($output));
+var_dump($data === $back);
 ?>
 ===Done===
 --EXPECT--
 *** Testing gzencode() : variation ***
 
 -- Testing multiple compression --
-string(3658) "1f8b080000000000000b010e07f1f81f8b080000000000000b6d574d6fe4c80dbdeb57d4ad2f3dfe01eb83e1ec22980e309b4562c067b64449159754dafab0b6e7d7e73d96da1e4c72184c4b2ab2c8f7c847fa25baabba98dc1a8b2b7c38bb324b713ee37f757f56cdc5c7f5b17b9d152f923b157c5ae335e0b75fedd0e2d781c6b98ea3a6ee05affe1dfc3a6527f8f09c52dcb38ba38bb5249934d6ecfe1e53a9ab76ff4c342cf2a64ed2028349fc9a8b139755685352acb82b9fbb67f8bade5cdcb698e1fcec94b7ceba3cb897e806cfc8114350dd1ebbdfa35b62d2478b0056d23ed809b9b95d696d91ce2aa97c911e3fa539c43f84c887554a4d125c9e63ff96711cc08c0866263cb37a0bbe2122ae8f6baecb2284abfb4ddf916db8354cddeef37c1afe5fa02fc7afb3db34f5b3acbdf2eb905490d8f38d7468d253a323d5ebb903760d7944d3b2024e834a99ddce77669bdd823cfbb8e899d4ad4c799677452e6029e80023a03b2374005590641f7d3877df2ad09f3c0e82a54d6a5644fd63049a37ed4bc362016fd9f51264f1e5c630727421ae930b7ed416e93e47b7c71a400390361ffbecb7561bb98f69b5da289e91becc27f08b3b724cb8704f9144d366431d0cb870c56b205deaa2e17636063761a911039fb7e4bf9f06c4f0aecd2ec80e8b41831
 ca7515e31286166458ea3ef71f2ce7cde2ae269c96d60525724a9c9170b713ed5750758f3cd2a361fc8b288fc92358ce884692e8ea0fe59bd969a0da2eed5831b715749eaae7178f3ebd30fb88c92105f367cce2c882955dc6bf8eca0d5d57540b3092894743ba0fd5b2dad021836191f1afc0bba14dde1642cb0b1aa6879c38907dcefa0720082b801bec61417469219175267dfa047df35b0bd1332001c28cdfafd3bcabe91e74368cdd8d8478e494c190e7ee90c67f2bde288e68ab6b15e883c995be4f8feb6c6dda4278e4f38578ddbdc7be36788daf0c3cb1d1819c73822f7000a0d1813fa94153b572315e51343b536bc64977dff163cebfd8418773261f524017e251fccc60ae29a5770ae097594d52e9c1229d87ce967a36401c46b69945afb249d101c9d420ffa9a123e232c20e76467d5d169202a2dd4c582949e013e745df7958d4b0cc4fd4377a737cd4feea7974070000f314d423e0634cb9a618fdf5dc64fd422181fd59c9230c9f6f9d18dc8fc23e9cccbc7188733b04aa57de83ebea0be3633cff5fa1ff83269be7f44f5a8d84550cc703255fd345dd402034d0b3e11a73ec6e3d4a77f4f685b614329f1b3132ae7af33d02e1e55e291fa6574b758d1f0200e7423dbc852211818043a7c9ce80aa9d59fce0401959f5ea2cf71fde90824f8c9192dbe9d329db1
 43794675ddcf257dd7755273b67340414e3ccad12e3f661f8aad9cf9957dc1275d10a51d3934fa81e68dc6768fb8ee23e373936c8e13feab8b0f50d227f7af76f561fb0950f3d099bbc316c3892a42fb36806d8660e800fa4f43fd4b962d2097d71933a54b77ff948677848eb17bb3a88b621682cfb3bbb49cf42fed6b3944124ad8358ca688aa44dd5f2144c7c9ab16f25b9aca9654ef357ec9ad55c40d324d6cc3d9e3920b863c231d31a95d937fb5520f9c816c79b7dcecc593fb9593cc05a51ebb1eeddd5b49eb437769738d0f64adc579d372b8b7f7c0208487ee3915ebf5766e148ebd77cf4e01f3ec285047011e55838968b6494d517fe29224777b24dd3ddf933101695b102e87db805eef291b74dcfd91628fb2a53f93dbd2968ef2e598746c9204f89fba1f0246fc671610a0591806e46a1346f77c40d910a47c5e20ffb23f003c04b648327a4ed98032c1965bd35bb0044f5344248f56fdb99aa61d6451d68e33489a83bffbe6573541b2da5f64681ea12090f778b2075374778810f73965fa3626a9d41f4df2f83f7c34658cec921b5a9bde49dd5007ec882b02adc514f81aa85898b5cc98e1b137733c0a8789b7f5648d2d231b80bf74978f25d61ce08a8abd11801fd8f995e066676307192ff7641f1cc6e0dee68565b8b22ac3889cd067bf732754a6b270af104
 4c6a8776811a4f6d8bd0477a9f516064201b920b92d7cd4dc7eee13e6b3eb3528a82f9abb3f388ebe6a8f871393461b73816ec54c99d604174bc5a6801de13908f86aea6a7d0fea107d682bcf1ec348b83872e6b8a316ecd02eb8f8dc86a609bf59a2dd03f1dfa4079436d55e24617be1a2854d008b2b2b1705e2078a7f3946318df1c24f6bf70d4b456eca286ec2b585b28262cc048a098c3e2d5f325a92bb36f691afdc14c822da1b116c9c1c07bb362eb0a04b78834c812134230ebf2044ac2e3c0e3ad00f848dc5010f3bf917ec2fc700b7bf26dacea8440620e04f90f4d97d6dd77cfde8a05c7d3930f1e5811fb8ec5c70964dcc8187ec90e32fdd6b64eec7586413b7d55bed65c4cce39a9b6c15e70e9da94e53fc904e6286f01f5b5562c94211befbc23507e01b2a3865e2f45b5d7b591f290087a5605b82495b4e393f31aa5b37211ec40241a746d903c5eebf117a4d3ddb0d000030e1f1820e070000"
+bool(true)
 ===Done===


commit b2c427838577c8829a53055e4c35e0d0afb5a00d
Merge: 6a48dc2 ede519d
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 16 13:44:00 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug 61676 ext\tidy\tests\bug54682.phpt fails



commit ede519d1d699dc638757f559f91a5dd93967d2b8
Merge: 948f361 c981016
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 16 13:42:52 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug 61676 ext\tidy\tests\bug54682.phpt fails
    
    Conflicts:
    	ext/tidy/tests/bug54682.phpt



commit c981016e416507134e5fa8469a08d31346ff19b5
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 16 13:38:13 2012 +0200

    Fix bug 61676 ext\tidy\tests\bug54682.phpt fails

diff --git a/ext/tidy/tests/bug54682.phpt b/ext/tidy/tests/bug54682.phpt
index 8244406..2bebe11 100644
--- a/ext/tidy/tests/bug54682.phpt
+++ b/ext/tidy/tests/bug54682.phpt
@@ -10,4 +10,4 @@ $nx->diagnose();
 
 ?>
 --EXPECTF--
-Warning: tidy::__construct(): Cannot Load '*' into memory in  %s on line %d
+Warning: tidy::__construct(): Cannot Load '*' into memory%win %s on line %d


commit 6a48dc2076fcbbe433a019356f1bbee553084134
Merge: f787776 948f361
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 16 13:35:15 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Fix bug 61743 tests in ext\standard\tests\file\windows_acls\* fail



commit 948f3619f689cfcc607579aa61ec3911b0a4f81d
Merge: ed09d26 9a4cb73
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 16 13:33:03 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Fix bug 61743 tests in ext\standard\tests\file\windows_acls\* fail



commit 9a4cb732ed15088fff7b2cbbb23ef955bbaaadb2
Author: Anatoliy Belsky <ab at php.net>
Date:   Mon Apr 16 13:30:58 2012 +0200

    Fix bug 61743 tests in ext\standard\tests\file\windows_acls\* fail

diff --git a/ext/standard/tests/file/windows_acls/common.inc b/ext/standard/tests/file/windows_acls/common.inc
index c427601..c9be2f1 100644
--- a/ext/standard/tests/file/windows_acls/common.inc
+++ b/ext/standard/tests/file/windows_acls/common.inc
@@ -19,7 +19,13 @@ function skipif() {
 }
 
 function get_username(){
-	return getenv('USERNAME');
+	$user = getenv('USERNAME');
+
+	if (!$user) {
+		$user = get_current_user();
+	}
+
+	return $user;
 }
 
 function get_domainname()
@@ -28,6 +34,7 @@ function get_domainname()
 }
 
 function icacls_set($path, $mode, $perm) {
+	$icacls = 'c:\\Windows\\System32\\icacls.exe';
 	$user = get_username();
 	$path_escaped =  '"' . $path . '"';
 	$perm_entry = array();
@@ -38,7 +45,7 @@ function icacls_set($path, $mode, $perm) {
 	if ($perm & PHPT_ACL_FULL) $perm_entry[]  = 'F';
 
 	// Deny all
-	$cmd = 'icacls ' . $path_escaped . ' /inheritance:r /deny ' . $user . ':(F,M,R,RX,W)';
+	$cmd = $icacls . ' ' . $path_escaped . ' /inheritance:r /deny ' . $user . ':(F,M,R,RX,W)';
 	exec($cmd);
 
 	if ($perm & PHPT_ACL_NONE) {
@@ -47,11 +54,9 @@ function icacls_set($path, $mode, $perm) {
 		 permission for the USER. Just granting permission doesn't
 		 remove the previously denied permission.
 		*/
-		$cmd = 'icacls ' . $path_escaped . ' /' . 'remove:d';
-		$cmd .= ' ' . $user;
+		$cmd = $icacls . ' ' . $path_escaped . ' /remove:d ' . $user;
 		exec($cmd);
-		$cmd = 'icacls ' . $path_escaped . ' /' . 'remove:g';
-		$cmd .= ' ' . $user;
+		$cmd = $icacls . ' ' . $path_escaped . ' /remove:g ' . $user;
 		exec($cmd);
 		return;
 	}
@@ -64,7 +69,7 @@ function icacls_set($path, $mode, $perm) {
 
 
 	// Deny all
-	$cmd = 'icacls ' . $path_escaped . ' /deny ' . $user . ':(F,M,R,RX,W)';
+	$cmd = $icacls . ' ' . $path_escaped . ' /deny ' . $user . ':(F,M,R,RX,W)';
 	exec($cmd);
 
 	/*
@@ -72,11 +77,9 @@ function icacls_set($path, $mode, $perm) {
 	 permission for the USER. Just granting permission doesn't
 	 remove the previously denied permission.
 	*/
-	$cmd = 'icacls ' . $path_escaped . ' /' . 'remove:d';
-	$cmd .= ' ' . $user;
+	$cmd = $icacls . ' ' . $path_escaped . ' /remove:d ' . $user;
 	exec($cmd);
-	$cmd = 'icacls ' . $path_escaped . ' /' . 'remove:g';
-	$cmd .= ' ' . $user;
+	$cmd = $icacls . ' ' . $path_escaped . ' /remove:g ' . $user;
 	exec($cmd);
 
 
@@ -91,15 +94,12 @@ function icacls_set($path, $mode, $perm) {
 		 permission for the USER. Just granting permission doesn't
 		 remove the previously denied permission.
 		*/
-		$cmd = 'icacls ' . $path_escaped . ' /' . 'remove:d';
-		$cmd .= ' ' . get_username();
+		$cmd = $icacls . ' ' . $path_escaped . ' /remove:d ' . $user;
 		exec($cmd);
-		$cmd = 'icacls ' . $path_escaped . ' /' . 'remove:g';
-		$cmd .= ' ' . get_username();
+		$cmd = $icacls . ' ' . $path_escaped . ' /remove:g ' . $user;
 		exec($cmd);
 
-		$cmd = 'icacls ' . $path_escaped . ' /' . $mode;
-		$cmd .= ' ' . get_username();
+		$cmd = $icacls . ' ' . $path_escaped . ' /' . $mode . ' ' . $user;
 		$cmd .= ':' . '(' . implode($perm_entry, ',') . ')';
 		exec($cmd);
 	}


commit f787776b2641d8b0f3a2955998a3015f69bcdc6e
Merge: 579d234 ed09d26
Author: Xinchen Hui <laruence at php.net>
Date:   Mon Apr 16 19:23:58 2012 +0800

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      change the bug summary



commit ed09d26f94ffb96dbaf6750cf19e5e1c5d34cd6a
Author: Xinchen Hui <laruence at php.net>
Date:   Mon Apr 16 19:23:12 2012 +0800

    change the bug summary

diff --git a/NEWS b/NEWS
index 2b65382..2eafb98 100644
--- a/NEWS
+++ b/NEWS
@@ -17,7 +17,7 @@ PHP                                                                        NEWS
 (merge after 5.3.11 release)
 
 - Core:
-  . Fixed bug #61728 (php-fpm SIGSEGV running friendica on nginx). (Laruence)
+  . Fixed bug #61728 (PHP crash when calling ob_start in request_shutdown phase). (Laruence)
   . Fixed bug #61660 (bin2hex(hex2bin($data)) != $data). (Nikita Popov)
   . Fixed bug #61650 (ini parser crashes when using ${xxxx} ini variables
     (without apache2)). (Laruence)
diff --git a/ext/session/tests/bug61728.phpt b/ext/session/tests/bug61728.phpt
index 30b876e..3f8dbeb 100644
--- a/ext/session/tests/bug61728.phpt
+++ b/ext/session/tests/bug61728.phpt
@@ -1,5 +1,5 @@
 --TEST--
-Bug #61728 (php-fpm SIGSEGV running friendica on nginx)
+Bug #61728 (PHP crash when calling ob_start in request_shutdown phase)
 --SKIPIF--
 <?php include('skipif.inc'); ?>
 --FILE--


commit 579d234f5078fc87b0b21a333a5fdfc60e9df124
Merge: c62a418 3b42f18
Author: Xinchen Hui <laruence at php.net>
Date:   Sun Apr 15 01:17:56 2012 +0800

    Merge branch 'PHP-5.4'



commit 3b42f184cdcf512fdc1f944052bfa296f17a035f
Author: Xinchen Hui <laruence at php.net>
Date:   Sun Apr 15 01:16:34 2012 +0800

    Fixed bug #61728 (php-fpm SIGSEGV running friendica on nginx)

diff --git a/NEWS b/NEWS
index 05cc254..2b65382 100644
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,7 @@ PHP                                                                        NEWS
 (merge after 5.3.11 release)
 
 - Core:
+  . Fixed bug #61728 (php-fpm SIGSEGV running friendica on nginx). (Laruence)
   . Fixed bug #61660 (bin2hex(hex2bin($data)) != $data). (Nikita Popov)
   . Fixed bug #61650 (ini parser crashes when using ${xxxx} ini variables
     (without apache2)). (Laruence)
diff --git a/ext/session/tests/bug61728.phpt b/ext/session/tests/bug61728.phpt
new file mode 100644
index 0000000..30b876e
--- /dev/null
+++ b/ext/session/tests/bug61728.phpt
@@ -0,0 +1,39 @@
+--TEST--
+Bug #61728 (php-fpm SIGSEGV running friendica on nginx)
+--SKIPIF--
+<?php include('skipif.inc'); ?>
+--FILE--
+<?php 
+function output_html($ext) {
+    return strlen($ext);
+}
+
+function open ($save_path, $session_name) { 
+    return true;
+} 
+
+function close() { 
+    return true;
+} 
+
+function read ($id) { 
+} 
+
+function write ($id, $sess_data) { 
+    ob_start("output_html");
+    echo "laruence";
+    ob_end_flush();
+    return true;
+} 
+
+function destroy ($id) { 
+} 
+
+function gc ($maxlifetime) { 
+    return true; 
+} 
+
+session_set_save_handler ("open", "close", "read", "write", "destroy", "gc"); 
+session_start();
+--EXPECTF--
+8
diff --git a/main/main.c b/main/main.c
index 6a04ddb..c34f952 100644
--- a/main/main.c
+++ b/main/main.c
@@ -1740,22 +1740,22 @@ void php_request_shutdown(void *dummy)
 		}
 	} zend_end_try();
 
-	/* 4. Shutdown output layer (send the set HTTP headers, cleanup output handlers, etc.) */
-	zend_try {
-		php_output_deactivate(TSRMLS_C);
-	} zend_end_try();
-
-	/* 5. Reset max_execution_time (no longer executing php code after response sent) */
+	/* 4. Reset max_execution_time (no longer executing php code after response sent) */
 	zend_try {
 		zend_unset_timeout(TSRMLS_C);
 	} zend_end_try();
 
-	/* 6. Call all extensions RSHUTDOWN functions */
+	/* 5. Call all extensions RSHUTDOWN functions */
 	if (PG(modules_activated)) {
 		zend_deactivate_modules(TSRMLS_C);
 		php_free_shutdown_functions(TSRMLS_C);
 	}
 
+	/* 6. Shutdown output layer (send the set HTTP headers, cleanup output handlers, etc.) */
+	zend_try {
+		php_output_deactivate(TSRMLS_C);
+	} zend_end_try();
+
 	/* 7. Destroy super-globals */
 	zend_try {
 		int i;


commit c62a41860e151b3c95ccd05d1ad7d25797219563
Merge: 30aee4b 6ecac26
Author: Johannes Schlüter <johannes at php.net>
Date:   Sat Apr 14 00:31:29 2012 +0200

    Merge branch 'PHP-5.4'
    
    * PHP-5.4:
      Rename README.SVN-RULES to README.GIT-RULES, here, too



commit 6ecac269728360180a2813e75dfbe8338a05a27a
Merge: de6dfe5 21d314a
Author: Johannes Schlüter <johannes at php.net>
Date:   Sat Apr 14 00:31:00 2012 +0200

    Merge branch 'PHP-5.3' into PHP-5.4
    
    * PHP-5.3:
      Rename README.SVN-RULES to README.GIT-RULES, here, too



commit 21d314a767561204cdeba896b85e61e1bb6cafac
Author: Johannes Schlüter <johannes at php.net>
Date:   Sat Apr 14 00:29:55 2012 +0200

    Rename README.SVN-RULES to README.GIT-RULES, here, too

diff --git a/win32/build/confutils.js b/win32/build/confutils.js
index a4ea2bf..d1f7eca 100644
--- a/win32/build/confutils.js
+++ b/win32/build/confutils.js
@@ -65,7 +65,7 @@ if (MODE_PHPIZE) {
 		WScript.Quit(10);
 	}
 } else {
-	if (!FSO.FileExists("README.SVN-RULES")) {
+	if (!FSO.FileExists("README.GIT-RULES")) {
 		STDERR.WriteLine("Must be run from the root of the php source");
 		WScript.Quit(10);
 	}
@@ -74,7 +74,7 @@ if (MODE_PHPIZE) {
 var CWD = WshShell.CurrentDirectory;
 
 if (typeof(CWD) == "undefined") {
-	CWD = FSO.GetParentFolderName(FSO.GetAbsolutePathName("README.SVN-RULES"));
+	CWD = FSO.GetParentFolderName(FSO.GetAbsolutePathName("README.GIT-RULES"));
 }
 
 /* defaults; we pick up the precise versions from configure.in */


commit 6712d0d20db546dc6bcba4b0c8db6c2e2ff816da
Author: reeze <reeze.xia at gmail.com>
Date:   Wed Apr 4 14:06:55 2012 +0800

    Fixed CODING_STANDARD and move parameter parse code

diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index ef1ed7e..406da93 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -1463,10 +1463,6 @@ static parameter_reference *_reflection_param_get_default_param(INTERNAL_FUNCTIO
 	reflection_object *intern;
 	parameter_reference *param;
 
-	if (zend_parse_parameters_none() == FAILURE) {
-		return NULL;
-	}
-
 	GET_REFLECTION_OBJECT_PTR(param);
 
 	if (param->fptr->type != ZEND_USER_FUNCTION)
@@ -1485,16 +1481,12 @@ static parameter_reference *_reflection_param_get_default_param(INTERNAL_FUNCTIO
 /* }}} */
 
 /* {{{ _reflection_param_get_default_precv */
-static zend_op *_reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAMETERS)
+static zend_op *_reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAMETERS, parameter_reference *param)
 {
 	zend_op *precv;
-	parameter_reference *param = _reflection_param_get_default_param(INTERNAL_FUNCTION_PARAM_PASSTHRU);
-
-	if (zend_parse_parameters_none() == FAILURE) {
-		return NULL;
-	}
 
-	if(!param) {
+	param = param ? param : _reflection_param_get_default_param(INTERNAL_FUNCTION_PARAM_PASSTHRU);
+	if (!param) {
 		return NULL;
 	}
 
@@ -2587,9 +2579,13 @@ ZEND_METHOD(reflection_parameter, isDefaultValueAvailable)
 ZEND_METHOD(reflection_parameter, getDefaultValue)
 {
 	parameter_reference *param =  _reflection_param_get_default_param(INTERNAL_FUNCTION_PARAM_PASSTHRU);
-	zend_op *precv = _reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAM_PASSTHRU);
+	zend_op *precv = _reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAM_PASSTHRU, param);
+
+	if (zend_parse_parameters_none() == FAILURE) {
+		return;
+	}
 
-	if(!(param && precv)) {
+	if (!(param && precv)) {
 		return;
 	}
 
@@ -2606,7 +2602,11 @@ ZEND_METHOD(reflection_parameter, getDefaultValue)
    Returns whether the default value of this parameter is constant */
 ZEND_METHOD(reflection_parameter, isDefaultValueConstant)
 {
-	zend_op *precv = _reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAM_PASSTHRU);
+	zend_op *precv = _reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAM_PASSTHRU, NULL);
+
+	if (zend_parse_parameters_none() == FAILURE) {
+		return;
+	}
 
 	if (precv && (Z_TYPE_P(precv->op2.zv) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) {
 		RETURN_TRUE;
@@ -2620,7 +2620,11 @@ ZEND_METHOD(reflection_parameter, isDefaultValueConstant)
    Returns the default value's constant name if default value is constant or false */
 ZEND_METHOD(reflection_parameter, getDefaultValueConstantName)
 {
-	zend_op *precv = _reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAM_PASSTHRU);
+	zend_op *precv = _reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAM_PASSTHRU, NULL);
+
+	if (zend_parse_parameters_none() == FAILURE) {
+		return;
+	}
 
 	if (precv && (Z_TYPE_P(precv->op2.zv) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) {
 		RETURN_STRING(Z_STRVAL_P(precv->op2.zv), 1);


commit 054f3e3ce5af13c2c3a6ccd54f7dc3e2f6cd4f74
Author: reeze <reeze.xia at gmail.com>
Date:   Tue Apr 3 13:47:16 2012 +0800

    Implemented FR #61602 Allow access to name of constant used as default value

diff --git a/NEWS b/NEWS
index 6fc9126..01eed64 100644
--- a/NEWS
+++ b/NEWS
@@ -100,6 +100,8 @@ PHP                                                                        NEWS
     bytes). (Nikita Popov)
 
 - Reflection:
+  . Implemented FR #61602 (Allow access to the name of constant
+    used as function/method parameter's default value). (reeze.xia at gmail.com)
   . Fixed bug #60968 (Late static binding doesn't work with 
     ReflectionMethod::invokeArgs()). (Laruence)
 
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 1cf65ce..ef1ed7e 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -1457,6 +1457,57 @@ static void _reflection_export(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *c
 }
 /* }}} */
 
+/* {{{ _reflection_param_get_default_param */
+static parameter_reference *_reflection_param_get_default_param(INTERNAL_FUNCTION_PARAMETERS)
+{
+	reflection_object *intern;
+	parameter_reference *param;
+
+	if (zend_parse_parameters_none() == FAILURE) {
+		return NULL;
+	}
+
+	GET_REFLECTION_OBJECT_PTR(param);
+
+	if (param->fptr->type != ZEND_USER_FUNCTION)
+	{
+		zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Cannot determine default value for internal functions");
+		return NULL;
+	}
+
+	if (param->offset < param->required) {
+		zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Parameter is not optional");
+		return NULL;
+	}
+
+	return param;
+}
+/* }}} */
+
+/* {{{ _reflection_param_get_default_precv */
+static zend_op *_reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAMETERS)
+{
+	zend_op *precv;
+	parameter_reference *param = _reflection_param_get_default_param(INTERNAL_FUNCTION_PARAM_PASSTHRU);
+
+	if (zend_parse_parameters_none() == FAILURE) {
+		return NULL;
+	}
+
+	if(!param) {
+		return NULL;
+	}
+
+	precv = _get_recv_op((zend_op_array*)param->fptr, param->offset);
+	if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2_type == IS_UNUSED) {
+		zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Internal error");
+		return NULL;
+	}
+
+	return precv;
+}
+/* }}} */
+
 /* {{{ Preventing __clone from being called */
 ZEND_METHOD(reflection, __clone)
 {
@@ -2535,27 +2586,10 @@ ZEND_METHOD(reflection_parameter, isDefaultValueAvailable)
    Returns the default value of this parameter or throws an exception */
 ZEND_METHOD(reflection_parameter, getDefaultValue)
 {
-	reflection_object *intern;
-	parameter_reference *param;
-	zend_op *precv;
+	parameter_reference *param =  _reflection_param_get_default_param(INTERNAL_FUNCTION_PARAM_PASSTHRU);
+	zend_op *precv = _reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAM_PASSTHRU);
 
-	if (zend_parse_parameters_none() == FAILURE) {
-		return;
-	}
-	GET_REFLECTION_OBJECT_PTR(param);
-
-	if (param->fptr->type != ZEND_USER_FUNCTION)
-	{
-		zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Cannot determine default value for internal functions");
-		return;
-	}
-	if (param->offset < param->required) {
-		zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Parameter is not optional");
-		return;
-	}
-	precv = _get_recv_op((zend_op_array*)param->fptr, param->offset);
-	if (!precv || precv->opcode != ZEND_RECV_INIT || precv->op2_type == IS_UNUSED) {
-		zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Internal error");
+	if(!(param && precv)) {
 		return;
 	}
 
@@ -2568,6 +2602,34 @@ ZEND_METHOD(reflection_parameter, getDefaultValue)
 }
 /* }}} */
 
+/* {{{ proto public bool ReflectionParameter::isDefaultValueConstant()
+   Returns whether the default value of this parameter is constant */
+ZEND_METHOD(reflection_parameter, isDefaultValueConstant)
+{
+	zend_op *precv = _reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAM_PASSTHRU);
+
+	if (precv && (Z_TYPE_P(precv->op2.zv) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) {
+		RETURN_TRUE;
+	}
+
+	RETURN_FALSE;
+}
+/* }}} */
+
+/* {{{ proto public mixed ReflectionParameter::getDefaultValueConstantName()
+   Returns the default value's constant name if default value is constant or false */
+ZEND_METHOD(reflection_parameter, getDefaultValueConstantName)
+{
+	zend_op *precv = _reflection_param_get_default_precv(INTERNAL_FUNCTION_PARAM_PASSTHRU);
+
+	if (precv && (Z_TYPE_P(precv->op2.zv) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) {
+		RETURN_STRING(Z_STRVAL_P(precv->op2.zv), 1);
+	}
+
+	RETURN_FALSE;
+}
+/* }}} */
+
 /* {{{ proto public static mixed ReflectionMethod::export(mixed class, string name [, bool return]) throws ReflectionException
    Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */
 ZEND_METHOD(reflection_method, export)
@@ -5903,6 +5965,8 @@ static const zend_function_entry reflection_parameter_functions[] = {
 	ZEND_ME(reflection_parameter, isOptional, arginfo_reflection__void, 0)
 	ZEND_ME(reflection_parameter, isDefaultValueAvailable, arginfo_reflection__void, 0)
 	ZEND_ME(reflection_parameter, getDefaultValue, arginfo_reflection__void, 0)
+	ZEND_ME(reflection_parameter, isDefaultValueConstant, arginfo_reflection__void, 0)
+	ZEND_ME(reflection_parameter, getDefaultValueConstantName, arginfo_reflection__void, 0)
 	PHP_FE_END
 };
 
diff --git a/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic1.phpt b/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic1.phpt
new file mode 100644
index 0000000..cdd00d2
--- /dev/null
+++ b/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic1.phpt
@@ -0,0 +1,52 @@
+--TEST--
+ReflectionParameter::isDefaultValueConstant() && getDefaultValueConstantName()
+--FILE--
+<?php
+
+define("CONST_TEST_1", "const1");
+
+function ReflectionParameterTest($test1=array(), $test2 = CONST_TEST_1) {
+	echo $test;
+}
+$reflect = new ReflectionFunction('ReflectionParameterTest');
+foreach($reflect->getParameters() as $param) {
+	if($param->getName() == 'test1') {
+		var_dump($param->isDefaultValueConstant());
+	}
+	if($param->getName() == 'test2') {
+		var_dump($param->isDefaultValueConstant());
+	}
+	if($param->isDefaultValueAvailable() && $param->isDefaultValueConstant()) {
+		var_dump($param->getDefaultValueConstantName());
+	}
+}
+
+class Foo2 {
+	const bar = 'Foo2::bar';
+}
+
+class Foo {
+	const bar = 'Foo::bar';
+
+	public function baz($param1 = self::bar, $param2=Foo2::bar, $param3=CONST_TEST_1) {
+	}
+}
+
+$method = new ReflectionMethod('Foo', 'baz');
+$params = $method->getParameters();
+
+foreach ($params as $param) {
+    if ($param->isDefaultValueConstant()) {
+        var_dump($param->getDefaultValueConstantName());
+    }
+}
+?>
+==DONE==
+--EXPECT--
+bool(false)
+bool(true)
+string(12) "CONST_TEST_1"
+string(9) "self::bar"
+string(9) "Foo2::bar"
+string(12) "CONST_TEST_1"
+==DONE==
diff --git a/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic2.phpt b/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic2.phpt
new file mode 100644
index 0000000..1ee9e93
--- /dev/null
+++ b/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic2.phpt
@@ -0,0 +1,30 @@
+--TEST--
+ReflectionParameter::isDefaultValueConstant() && getDefaultValueConstantName() for namespace
+--FILE--
+<?php
+
+namespace ReflectionTestNamespace {
+	CONST TEST_CONST_1 = "Test Const 1";
+
+	class TestClass {
+		const TEST_CONST_2 = "Test Const 2 in class";
+	}
+}
+
+namespace {
+	function ReflectionParameterTest($test=ReflectionTestNamespace\TestClass::TEST_CONST_2, $test2 = ReflectionTestNamespace\CONST_TEST_1) {
+		echo $test;
+	}
+	$reflect = new ReflectionFunction('ReflectionParameterTest');
+	foreach($reflect->getParameters() as $param) {
+		if($param->isDefaultValueAvailable() && $param->isDefaultValueConstant()) {
+			echo $param->getDefaultValueConstantName() . "\n";
+		}
+	}
+	echo "==DONE==";
+}
+?>
+--EXPECT--
+ReflectionTestNamespace\TestClass::TEST_CONST_2
+ReflectionTestNamespace\CONST_TEST_1
+==DONE==
diff --git a/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_error.phpt b/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_error.phpt
new file mode 100644
index 0000000..984b06e
--- /dev/null
+++ b/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_error.phpt
@@ -0,0 +1,25 @@
+--TEST--
+ReflectionParameter::getDefaultValueConstant() should raise exception on non optional parameter
+--FILE--
+<?php
+
+define("CONST_TEST_1", "const1");
+
+function ReflectionParameterTest($test, $test2 = CONST_TEST_1) {
+	echo $test;
+}
+$reflect = new ReflectionFunction('ReflectionParameterTest');
+foreach($reflect->getParameters() as $param) {
+	try {
+		echo $param->getDefaultValueConstantName() . "\n";
+	}
+	catch(ReflectionException $e) {
+		echo $e->getMessage() . "\n";
+	}
+}
+?>
+==DONE==
+--EXPECT--
+Parameter is not optional
+CONST_TEST_1
+==DONE==





More information about the commits mailing list