From ed1ed9feedfc5624ed49d221ca8f8e2a2e3a7713 Mon Sep 17 00:00:00 2001 From: NickSdot Date: Wed, 19 Aug 2026 13:27:32 +0000 Subject: [PATCH 1/3] ext/standard: applied fixers to improve test robustness --- .../tests/array/GHSA-h96m-rvf9-jgm2.phpt | 6 +- ext/standard/tests/array/array_chunk2.phpt | 12 +- .../tests/array/array_chunk_variation5.phpt | 24 +- ...rray_column_scalar_index_strict_types.phpt | 36 +-- .../array_column_scalar_index_weak_types.phpt | 28 +-- .../tests/array/array_combine_error2.phpt | 22 +- ext/standard/tests/array/array_diff_1.phpt | 6 +- .../array/array_diff_key_variation1.phpt | 112 ++++----- .../array/array_diff_key_variation2.phpt | 112 ++++----- .../array_diff_leak_custom_type_checks.phpt | 6 +- .../tests/array/array_diff_max_elements.phpt | 6 +- .../tests/array/array_diff_uassoc_error.phpt | 18 +- .../array/array_diff_uassoc_variation1.phpt | 56 ++--- .../array/array_diff_uassoc_variation2.phpt | 56 ++--- .../array/array_diff_ukey_variation1.phpt | 112 ++++----- .../array/array_diff_ukey_variation10.phpt | 12 +- .../array/array_diff_ukey_variation2.phpt | 112 ++++----- .../tests/array/array_fill_error.phpt | 6 +- .../tests/array/array_fill_error2.phpt | 6 +- .../tests/array/array_fill_variation6.phpt | 6 +- .../array/array_filter_invalid_mode.phpt | 2 +- .../tests/array/array_filter_variation10.phpt | 10 +- .../tests/array/array_filter_variation9.phpt | 12 +- .../array_intersect_assoc_variation1.phpt | 104 ++++----- .../array_intersect_assoc_variation2.phpt | 104 ++++----- .../array/array_intersect_key_variation1.phpt | 112 ++++----- .../array/array_intersect_key_variation2.phpt | 112 ++++----- .../array_intersect_uassoc_variation1.phpt | 112 ++++----- .../array_intersect_uassoc_variation2.phpt | 112 ++++----- .../array_intersect_ukey_variation1.phpt | 112 ++++----- .../array_intersect_ukey_variation2.phpt | 112 ++++----- .../array_intersect_ukey_variation8.phpt | 12 +- .../array/array_intersect_variation1.phpt | 104 ++++----- .../array/array_intersect_variation2.phpt | 104 ++++----- .../tests/array/array_key_exists.phpt | 12 +- .../array/array_key_exists_variation1.phpt | 8 +- .../array/array_key_exists_variation3.phpt | 4 +- ext/standard/tests/array/array_map_error.phpt | 8 +- .../tests/array/array_map_object1.phpt | 14 +- .../tests/array/array_map_object2.phpt | 12 +- .../tests/array/array_map_object3.phpt | 12 +- .../tests/array/array_map_variation10.phpt | 10 +- .../tests/array/array_map_variation12.phpt | 12 +- .../tests/array/array_map_variation14.phpt | 12 +- .../tests/array/array_map_variation15.phpt | 6 +- .../tests/array/array_map_variation16.phpt | 18 +- .../tests/array/array_map_variation17.phpt | 44 ++-- .../tests/array/array_map_variation9.phpt | 4 +- .../array_merge_recursive_variation1.phpt | 104 ++++----- .../array_merge_recursive_variation2.phpt | 52 ++--- .../tests/array/array_merge_variation2.phpt | 52 ++--- .../array/array_pad_too_large_padding.phpt | 8 +- .../tests/array/array_product_variation1.phpt | 1 - .../tests/array/array_product_variation5.phpt | 6 +- .../tests/array/array_push_error2.phpt | 6 +- ext/standard/tests/array/array_rand.phpt | 30 +-- .../tests/array/array_rand_variation5.phpt | 24 +- .../tests/array/array_reduce_variation1.phpt | 4 +- .../tests/array/array_search_variation3.phpt | 12 +- .../tests/array/array_slice_variation1.phpt | 12 +- .../tests/array/array_sum_variation8.phpt | 6 +- .../array/array_udiff_assoc_variation1.phpt | 54 ++--- .../array/array_udiff_assoc_variation2.phpt | 54 ++--- .../array/array_udiff_assoc_variation5.phpt | 4 +- .../array/array_udiff_uassoc_variation1.phpt | 54 ++--- .../array/array_udiff_uassoc_variation2.phpt | 54 ++--- .../array/array_udiff_uassoc_variation6.phpt | 4 +- .../tests/array/array_udiff_variation1.phpt | 54 ++--- .../tests/array/array_udiff_variation2.phpt | 54 ++--- .../tests/array/array_udiff_variation5.phpt | 4 +- .../array_uintersect_assoc_variation1.phpt | 54 ++--- .../array_uintersect_assoc_variation2.phpt | 54 ++--- .../array_uintersect_assoc_variation5.phpt | 5 +- .../array_uintersect_uassoc_variation1.phpt | 54 ++--- .../array_uintersect_uassoc_variation2.phpt | 54 ++--- .../array_uintersect_uassoc_variation6.phpt | 4 +- .../array/array_uintersect_variation1.phpt | 54 ++--- .../array/array_uintersect_variation2.phpt | 54 ++--- .../array/array_uintersect_variation5.phpt | 5 +- .../tests/array/array_walk/array_walk.phpt | 6 +- .../array/array_walk/array_walk_error2.phpt | 20 +- .../array/array_walk/array_walk_objects.phpt | 6 +- .../array_walk/array_walk_rec_objects.phpt | 6 +- .../array_walk/array_walk_recursive1.phpt | 6 +- .../array_walk_recursive_error2.phpt | 20 +- .../array_walk_recursive_variation8.phpt | 6 +- .../array_walk/array_walk_variation8.phpt | 6 +- .../tests/array/array_walk/bug30266.phpt | 6 +- .../tests/array/array_walk/bug70713.phpt | 6 +- .../tests/array/array_walk/bug79839.phpt | 6 +- ext/standard/tests/array/bug40191.phpt | 6 +- ext/standard/tests/array/bug42177.phpt | 6 +- ext/standard/tests/array/bug43495.phpt | 6 +- ext/standard/tests/array/bug61058.phpt | 6 +- ext/standard/tests/array/bug65251.phpt | 4 +- ext/standard/tests/array/bug68553.phpt | 12 +- ext/standard/tests/array/bug71220.phpt | 6 +- ext/standard/tests/array/bug74345.phpt | 18 +- ext/standard/tests/array/bug77135.phpt | 6 +- ext/standard/tests/array/bug77931.phpt | 18 +- .../tests/array/compact_variation1.phpt | 12 +- ext/standard/tests/array/count_invalid.phpt | 36 +-- .../tests/array/count_invalid_mode.phpt | 8 +- ext/standard/tests/array/extract_error.phpt | 18 +- .../tests/array/extract_error_variation1.phpt | 6 +- .../tests/array/extract_typed_ref.phpt | 4 +- ext/standard/tests/array/gh14775.phpt | 6 +- .../array_splice_uaf_add_elements.phpt | 6 +- .../array_splice_uaf_array_deallocated.phpt | 6 +- ...array_splice_uaf_complex_modification.phpt | 6 +- ...array_splice_uaf_multiple_destructors.phpt | 6 +- .../array_splice_uaf_original_case.phpt | 6 +- .../array_splice_uaf_packed_to_hash.phpt | 6 +- .../array_splice_with_replacement.phpt | 6 +- ext/standard/tests/array/gh19300_2.phpt | 12 +- ext/standard/tests/array/gh20043.phpt | 6 +- .../array/in_array/in_array_variation3.phpt | 12 +- ext/standard/tests/array/max.phpt | 18 +- ext/standard/tests/array/min.phpt | 18 +- .../tests/array/range/range_bug70239_0.phpt | 6 +- .../tests/array/range/range_bug70239_1.phpt | 6 +- .../tests/array/range/range_bug70239_2.phpt | 6 +- .../tests/array/range/range_bug70239_3.phpt | 6 +- .../range/range_inputs_float_NAN_values.phpt | 34 +-- ...ge_inputs_float_small_step_exhaustion.phpt | 12 +- .../tests/array/range/range_step_errors.phpt | 102 ++++---- ext/standard/tests/array/sizeof_object2.phpt | 42 ++-- .../array/sort/array_multisort_error.phpt | 12 +- .../sort/array_multisort_variation1.phpt | 54 ++--- .../sort/array_multisort_variation2.phpt | 56 ++--- .../sort/array_multisort_variation3.phpt | 54 ++--- .../tests/array/sort/asort_variation5.phpt | 2 +- ext/standard/tests/array/sort/bug77395.phpt | 6 +- ext/standard/tests/assert/assert_basic6.phpt | 12 +- .../tests/assert/assert_options_error.phpt | 6 +- .../tests/assert/assert_variation.phpt | 6 +- ext/standard/tests/assert/gh22290.phpt | 24 +- ext/standard/tests/assert/gh22291.phpt | 6 +- ext/standard/tests/assert/gh22292.phpt | 12 +- ext/standard/tests/assert/gh22373.phpt | 18 +- ext/standard/tests/assert/gh22387.phpt | 36 +-- .../get_class_methods_basic_001.phpt | 6 +- .../class_object/get_class_variation_001.phpt | 56 ++--- .../method_exists_variation_001.phpt | 48 ++-- .../class_object/property_exists_error.phpt | 6 +- .../constant_with_typed_class_constant.phpt | 6 +- ext/standard/tests/dir/bug41693.phpt | 6 +- .../tests/dir/closedir_variation2.phpt | 6 +- .../tests/dir/closedir_variation3.phpt | 6 +- .../tests/dir/closedir_without_arg.phpt | 6 +- ext/standard/tests/dir/dir_basic.phpt | 6 +- .../tests/dir/readdir_variation7.phpt | 6 +- .../tests/dir/rewinddir_variation2.phpt | 6 +- .../tests/dir/rewinddir_variation3.phpt | 6 +- .../tests/dir/scandir_invalid_flag.phpt | 6 +- ext/standard/tests/file/006_variation2.phpt | 24 +- ext/standard/tests/file/007_basic.phpt | 112 ++++----- ext/standard/tests/file/bug71882.phpt | 6 +- ext/standard/tests/file/chgrp.phpt | 4 +- .../tests/file/disk_free_space_variation.phpt | 24 +- .../file/disk_total_space_variation.phpt | 12 +- .../tests/file/fclose_variation1.phpt | 6 +- ext/standard/tests/file/feof_basic.phpt | 6 +- ext/standard/tests/file/fgetc_variation2.phpt | 6 +- .../tests/file/fgetcsv_error_conditions.phpt | 36 +-- .../tests/file/fgetcsv_variation12.phpt | 148 ++++++------ .../tests/file/fgetcsv_variation19.phpt | 154 ++++++------ ext/standard/tests/file/fgets_error.phpt | 12 +- ext/standard/tests/file/fgets_variation2.phpt | 12 +- ext/standard/tests/file/file_error.phpt | 8 +- .../tests/file/file_get_contents_error.phpt | 6 +- .../file/file_get_contents_error002.phpt | 6 +- ..._get_contents_file_put_contents_error.phpt | 6 +- .../file/file_get_contents_variation8.phpt | 4 +- ...e_get_contents_with_custom_uri_parser.phpt | 6 +- .../tests/file/file_put_contents.phpt | 12 +- .../file/file_put_contents_variation8.phpt | 4 +- ext/standard/tests/file/file_variation6.phpt | 38 +-- .../tests/file/filegroup_variation3.phpt | 4 +- .../tests/file/fileinode_variation3.phpt | 4 +- .../tests/file/fileowner_variation3.phpt | 4 +- .../tests/file/fileperms_variation3.phpt | 4 +- .../tests/file/filesize_variation3.phpt | 6 +- ext/standard/tests/file/flock.phpt | 12 +- ext/standard/tests/file/flock_error.phpt | 26 +-- .../tests/file/fnmatch_variation.phpt | 66 +++--- .../tests/file/fputcsv_variation13.phpt | 220 +++++++++--------- .../tests/file/fputcsv_variation17.phpt | 2 +- .../tests/file/fputcsv_variation9.phpt | 220 +++++++++--------- ext/standard/tests/file/fread_error.phpt | 12 +- ext/standard/tests/file/fscanf.phpt | 24 +- ext/standard/tests/file/fscanf_error.phpt | 24 +- .../tests/file/fscanf_variation10.phpt | 8 +- .../tests/file/fscanf_variation11.phpt | 28 +-- .../tests/file/fscanf_variation12.phpt | 40 ++-- .../tests/file/fscanf_variation13.phpt | 12 +- .../tests/file/fscanf_variation14.phpt | 52 ++--- .../tests/file/fscanf_variation15.phpt | 34 +-- .../tests/file/fscanf_variation16.phpt | 8 +- .../tests/file/fscanf_variation17.phpt | 28 +-- .../tests/file/fscanf_variation18.phpt | 40 ++-- .../tests/file/fscanf_variation19.phpt | 12 +- .../tests/file/fscanf_variation2.phpt | 40 ++-- .../tests/file/fscanf_variation20.phpt | 40 ++-- .../tests/file/fscanf_variation21.phpt | 34 +-- .../tests/file/fscanf_variation22.phpt | 8 +- .../tests/file/fscanf_variation23.phpt | 28 +-- .../tests/file/fscanf_variation24.phpt | 40 ++-- .../tests/file/fscanf_variation25.phpt | 12 +- .../tests/file/fscanf_variation26.phpt | 14 +- .../tests/file/fscanf_variation27.phpt | 40 ++-- .../tests/file/fscanf_variation28.phpt | 34 +-- .../tests/file/fscanf_variation29.phpt | 8 +- .../tests/file/fscanf_variation30.phpt | 28 +-- .../tests/file/fscanf_variation31.phpt | 40 ++-- .../tests/file/fscanf_variation32.phpt | 12 +- .../tests/file/fscanf_variation35.phpt | 8 +- .../tests/file/fscanf_variation36.phpt | 28 +-- .../tests/file/fscanf_variation37.phpt | 40 ++-- .../tests/file/fscanf_variation38.phpt | 12 +- .../tests/file/fscanf_variation4.phpt | 8 +- .../tests/file/fscanf_variation41.phpt | 8 +- .../tests/file/fscanf_variation42.phpt | 28 +-- .../tests/file/fscanf_variation43.phpt | 40 ++-- .../tests/file/fscanf_variation44.phpt | 12 +- .../tests/file/fscanf_variation45.phpt | 40 ++-- .../tests/file/fscanf_variation46.phpt | 34 +-- .../tests/file/fscanf_variation47.phpt | 8 +- .../tests/file/fscanf_variation48.phpt | 28 +-- .../tests/file/fscanf_variation49.phpt | 40 ++-- .../tests/file/fscanf_variation5.phpt | 28 +-- .../tests/file/fscanf_variation50.phpt | 12 +- .../tests/file/fscanf_variation6.phpt | 40 ++-- .../tests/file/fscanf_variation7.phpt | 12 +- .../tests/file/fscanf_variation8.phpt | 64 ++--- .../tests/file/fseek_ftell_rewind_error1.phpt | 6 +- .../tests/file/fseek_ftell_rewind_error2.phpt | 6 +- .../tests/file/fseek_ftell_rewind_error3.phpt | 6 +- ext/standard/tests/file/fstat.phpt | 6 +- ext/standard/tests/file/ftruncate.phpt | 6 +- ext/standard/tests/file/ftruncate_error.phpt | 6 +- .../tests/file/ftruncate_variation4.phpt | 100 ++++---- ext/standard/tests/file/fwrite_error.phpt | 6 +- ext/standard/tests/file/gh18212.phpt | 1 - ext/standard/tests/file/glob_variation.phpt | 12 +- .../tests/file/is_dir_variation4.phpt | 4 +- .../tests/file/is_executable_variation1.phpt | 4 +- .../tests/file/is_file_variation4.phpt | 4 +- .../tests/file/is_readable_variation1.phpt | 4 +- .../tests/file/is_writable_variation1.phpt | 8 +- .../tests/file/mkdir_rmdir_variation2.phpt | 12 +- .../tests/file/pathinfo_variation3.phpt | 36 +-- .../tests/file/popen_pclose_error.phpt | 18 +- .../proc_open_with_wrong_resource_type.phpt | 6 +- ext/standard/tests/file/readfile_error.phpt | 12 +- .../tests/file/readfile_variation10.phpt | 4 +- .../tests/file/stream_rfc2397_006.phpt | 8 +- .../tests/file/stream_supports_lock.phpt | 6 +- .../symlink_link_linkinfo_is_link_error1.phpt | 6 +- .../tests/file/tempnam_variation3.phpt | 8 +- .../tests/file/tempnam_variation7.phpt | 8 +- .../tests/file/tempnam_variation9.phpt | 4 +- ext/standard/tests/file/touch.phpt | 6 +- ext/standard/tests/file/userstreams.phpt | 6 +- ext/standard/tests/file/userstreams_002.phpt | 14 +- ext/standard/tests/file/userstreams_005.phpt | 6 +- ext/standard/tests/filters/bug54350.phpt | 6 +- ext/standard/tests/filters/bug77231.phpt | 2 +- ext/standard/tests/filters/bug79468.phpt | 4 +- .../tests/filters/object_init_failure.phpt | 6 +- .../tests/filters/object_init_failure_2.phpt | 6 +- .../filters/stream_filter_remove_error.phpt | 12 +- ext/standard/tests/general_functions/010.phpt | 6 +- .../tests/general_functions/bug25038.phpt | 12 +- .../tests/general_functions/bug31190.phpt | 13 +- .../tests/general_functions/bug32647.phpt | 48 ++-- .../tests/general_functions/bug41037.phpt | 8 +- .../tests/general_functions/bug41970.phpt | 12 +- .../tests/general_functions/bug44295.phpt | 6 +- .../tests/general_functions/bug47857.phpt | 12 +- .../tests/general_functions/bug72920.phpt | 6 +- .../general_functions/callbacks_001.phpt | 6 +- .../general_functions/callbacks_002.phpt | 18 +- .../general_functions/dl_null_bytes.phpt | 6 +- .../general_functions/error_get_last.phpt | 6 +- .../gettype_settype_basic.phpt | 32 +-- .../gettype_settype_error.phpt | 6 +- .../tests/general_functions/gh21058.phpt | 6 +- .../tests/general_functions/gh9905.phpt | 6 +- .../general_functions/ini_set_types.phpt | 6 +- .../is_countable_with_variables.phpt | 6 +- .../general_functions/proc_open_array.phpt | 24 +- .../proc_open_cwd_null_bytes.phpt | 6 +- .../general_functions/proc_open_pipes3.phpt | 6 +- .../general_functions/proc_open_redirect.phpt | 16 +- .../tests/general_functions/putenv.phpt | 12 +- .../putenv_and_getenv_reject_null_bytes.phpt | 16 +- .../register_tick_function_error.phpt | 6 +- .../settype_typed_property.phpt | 6 +- .../sleep_usleep_uint_overflow.phpt | 8 +- .../tests/general_functions/type.phpt | 26 +-- .../unregister_tick_function_error.phpt | 6 +- .../general_functions/var_export_basic2.phpt | 1 - .../general_functions/var_export_basic3.phpt | 1 - .../general_functions/var_export_basic4.phpt | 1 - .../general_functions/var_export_basic5.phpt | 1 - .../general_functions/var_export_basic7.phpt | 1 - ext/standard/tests/http/gh15650.phpt | 4 +- .../request_parse_body/invalid_boundary.phpt | 2 +- .../request_parse_body/multipart_garbled.phpt | 2 +- .../multipart_max_files.phpt | 2 +- .../multipart_max_input_vars.phpt | 2 +- .../multipart_max_parts.phpt | 2 +- .../multipart_missing_boundary.phpt | 2 +- .../multipart_options_invalid_key.phpt | 8 +- .../multipart_options_invalid_quantity.phpt | 2 +- .../multipart_options_invalid_value_type.phpt | 4 +- .../multipart_options_max_files.phpt | 2 +- .../multipart_options_max_input_vars.phpt | 2 +- .../multipart_options_max_parts.phpt | 2 +- .../multipart_options_post_max_size.phpt | 2 +- ...multipart_options_upload_max_filesize.phpt | 2 +- .../options_array_references.phpt | 4 +- .../unsupported_content_type.phpt | 2 +- ext/standard/tests/mail/gh13415.phpt | 19 +- ext/standard/tests/mail/gh7875.phpt | 6 +- ext/standard/tests/mail/mail_basic7.phpt | 96 ++++---- ext/standard/tests/mail/mail_null_bytes.phpt | 30 +-- ext/standard/tests/math/abs_variation.phpt | 20 +- .../tests/math/base_convert_error.phpt | 18 +- .../tests/math/base_convert_overflow.phpt | 2 +- .../tests/math/base_convert_variation1.phpt | 8 +- .../tests/math/bindec_variation1_64bit.phpt | 8 +- ext/standard/tests/math/ceil_variation1.phpt | 20 +- ext/standard/tests/math/clamp.phpt | 28 +-- ext/standard/tests/math/decbin_basic.phpt | 6 +- .../tests/math/decbin_basiclong_64bit.phpt | 6 +- .../tests/math/decbin_variation1_64bit.phpt | 12 +- ext/standard/tests/math/dechex_basic.phpt | 6 +- .../tests/math/dechex_basiclong_64bit.phpt | 6 +- .../tests/math/dechex_variation1_64bit.phpt | 12 +- ext/standard/tests/math/decoct_basic.phpt | 6 +- .../tests/math/decoct_basiclong_64bit.phpt | 6 +- .../tests/math/decoct_variation1_64bit.phpt | 12 +- ext/standard/tests/math/floor_variation1.phpt | 20 +- ext/standard/tests/math/gh17384.phpt | 12 +- .../tests/math/hexdec_variation1_64bit.phpt | 8 +- ext/standard/tests/math/intdiv.phpt | 8 +- ext/standard/tests/math/log_error.phpt | 6 +- .../tests/math/octdec_variation1.phpt | 8 +- ext/standard/tests/math/pow_basic_64bit.phpt | 1 - .../tests/math/pow_variation1_64bit.phpt | 14 +- ext/standard/tests/math/pow_variation2.phpt | 14 +- .../tests/math/round_valid_rounding_mode.phpt | 6 +- ext/standard/tests/math/round_variation1.phpt | 20 +- ext/standard/tests/misc/exec_basic1.phpt | 18 +- ext/standard/tests/misc/gh14774.phpt | 16 +- ext/standard/tests/network/bug69523.phpt | 6 +- ext/standard/tests/network/bug69948.phpt | 12 +- ext/standard/tests/network/bug79405.phpt | 12 +- .../dns_check_record_error_conditions.phpt | 12 +- .../dns_get_record_error_conditions.phpt | 18 +- .../tests/network/ghsa-www2-q4fc-65wf.phpt | 54 ++--- .../tests/network/openlog_null_bytes.phpt | 6 +- .../network/setcookie_array_option_error.phpt | 42 ++-- .../tests/network/setcookie_error.phpt | 28 +-- .../tests/network/setrawcookie_error.phpt | 30 +-- .../password/password_bcrypt_errors.phpt | 18 +- .../tests/password/password_hash_error.phpt | 30 +-- .../password/password_needs_rehash_error.phpt | 24 +- .../tests/password/password_verify_error.phpt | 6 +- ext/standard/tests/poll/gh22759.phpt | 6 +- .../tests/poll/poll_clone_not_allowed.phpt | 10 +- .../tests/poll/poll_ctx_backend_unix.phpt | 6 +- .../tests/poll/poll_double_construct.phpt | 12 +- .../poll/poll_stream_add_error_duplicate.phpt | 6 +- .../poll/poll_watcher_outlives_context.phpt | 12 +- .../tests/serialize/__serialize_002.phpt | 6 +- .../tests/serialize/__serialize_007.phpt | 6 +- ext/standard/tests/serialize/bug64354_1.phpt | 12 +- ext/standard/tests/serialize/bug64354_2.phpt | 6 +- ext/standard/tests/serialize/bug64354_3.phpt | 6 +- ext/standard/tests/serialize/bug73341.phpt | 16 +- ext/standard/tests/serialize/bug81111.phpt | 28 +-- ext/standard/tests/serialize/gh15169.phpt | 6 +- .../tests/serialize/incomplete_class.phpt | 6 +- ext/standard/tests/serialize/max_depth.phpt | 12 +- .../serialize/serialization_objects_005.phpt | 30 +-- .../serialize/serialization_objects_010.phpt | 6 +- .../splobjectstorage_negative_count.phpt | 6 +- ...typed_property_ref_assignment_failure.phpt | 6 +- .../tests/serialize/typed_property_refs.phpt | 30 +-- .../serialize/unserialize_abstract_class.phpt | 6 +- ..._allowed_classes_option_invalid_value.phpt | 18 +- .../non_existing.phpt | 6 +- .../tests/serialize/unserialize_leak.phpt | 6 +- .../tests/setcookie_samesite_validation.phpt | 18 +- ext/standard/tests/streams/bug44712.phpt | 6 +- ext/standard/tests/streams/bug54623.phpt | 6 +- ext/standard/tests/streams/bug61115.phpt | 6 +- ext/standard/tests/streams/bug67626.phpt | 14 +- ext/standard/tests/streams/bug71884.phpt | 6 +- ext/standard/tests/streams/bug74951.phpt | 2 +- ext/standard/tests/streams/bug76857.phpt | 2 +- ext/standard/tests/streams/gh14506.phpt | 12 +- ext/standard/tests/streams/gh14780.phpt | 24 +- ext/standard/tests/streams/gh15908.phpt | 6 +- .../tests/streams/non_finite_values.phpt | 24 +- .../streams/stream_context_create_error.phpt | 18 +- .../stream_context_set_option_error.phpt | 24 +- .../stream_context_set_options_error.phpt | 6 +- .../stream_context_tcp_nodelay_server.phpt | 1 - ...stream_errors_exception_mode_terminal.phpt | 6 +- .../stream_errors_mix_modes_storage.phpt | 6 +- ...ream_errors_set_default_context_error.phpt | 6 +- .../stream_get_contents_negative_length.phpt | 6 +- .../stream_get_meta_data_file_error.phpt | 6 +- .../streams/stream_read_object_return.phpt | 6 +- .../tests/streams/stream_set_chunk_size.phpt | 12 +- .../streams/stream_set_timeout_error.phpt | 6 +- ext/standard/tests/strings/bug33605.phpt | 6 +- ext/standard/tests/strings/bug36944.phpt | 12 +- ext/standard/tests/strings/bug40754.phpt | 60 ++--- ext/standard/tests/strings/bug54322.phpt | 6 +- ext/standard/tests/strings/bug67249.phpt | 6 +- ext/standard/tests/strings/bug69751.phpt | 18 +- ext/standard/tests/strings/bug78833.phpt | 6 +- ext/standard/tests/strings/chr_error.phpt | 12 +- .../tests/strings/chunk_split_variation5.phpt | 16 +- .../tests/strings/chunk_split_variation8.phpt | 16 +- .../tests/strings/count_chars_basic.phpt | 6 +- ext/standard/tests/strings/crypt.phpt | 6 +- ext/standard/tests/strings/dirname_error.phpt | 6 +- ext/standard/tests/strings/dirname_multi.phpt | 6 +- ext/standard/tests/strings/explode.phpt | 24 +- ext/standard/tests/strings/explode1.phpt | 40 ++-- ext/standard/tests/strings/fprintf_error.phpt | 18 +- ext/standard/tests/strings/gh11982.phpt | 1 - .../tests/strings/gh18823_strict.phpt | 12 +- ext/standard/tests/strings/gh18823_weak.phpt | 6 +- ext/standard/tests/strings/implode_error.phpt | 18 +- .../tests/strings/implode_variation.phpt | 22 +- ext/standard/tests/strings/join_error.phpt | 6 +- ext/standard/tests/strings/join_error1.phpt | 50 ++-- .../tests/strings/join_variation1.phpt | 16 +- .../tests/strings/join_variation4.phpt | 6 +- .../tests/strings/join_variation5.phpt | 6 +- .../strings/levenshtein_error_conditions.phpt | 8 +- ext/standard/tests/strings/md5_file.phpt | 6 +- ext/standard/tests/strings/metaphone.phpt | 6 +- .../tests/strings/parse_str_null_bytes.phpt | 6 +- ext/standard/tests/strings/pathinfo.phpt | 48 ++-- ext/standard/tests/strings/printf_64bit.phpt | 22 +- ext/standard/tests/strings/printf_error.phpt | 42 ++-- .../tests/strings/setlocale_null_byte.phpt | 24 +- ext/standard/tests/strings/sha1_file.phpt | 12 +- ext/standard/tests/strings/sprintf_error.phpt | 54 ++--- ext/standard/tests/strings/sprintf_star.phpt | 36 +-- .../tests/strings/sprintf_variation1.phpt | 48 ++-- .../strings/sprintf_variation4_64bit.phpt | 1 - .../tests/strings/sprintf_variation52.phpt | 6 +- .../tests/strings/sprintf_variation54.phpt | 6 +- ext/standard/tests/strings/sscanf_error.phpt | 6 +- .../tests/strings/str_decrement_errors.phpt | 32 +-- .../strings/str_decrement_underflow.phpt | 18 +- .../tests/strings/str_increment_errors.phpt | 32 +-- ext/standard/tests/strings/str_pad.phpt | 12 +- .../tests/strings/str_pad_variation1.phpt | 6 +- ext/standard/tests/strings/str_repeat.phpt | 6 +- .../tests/strings/str_replace_basic.phpt | 6 +- .../tests/strings/str_replace_variation3.phpt | 18 +- .../tests/strings/str_split_variation6.phpt | 10 +- .../tests/strings/str_split_variation7.phpt | 10 +- .../tests/strings/str_word_count.phpt | 24 +- .../tests/strings/str_word_count1.phpt | 12 +- .../tests/strings/strip_tags_variation2.phpt | 6 +- ext/standard/tests/strings/stripos_error.phpt | 12 +- .../tests/strings/stristr_variation2.phpt | 12 +- .../tests/strings/strncasecmp_error.phpt | 6 +- ext/standard/tests/strings/strncmp_error.phpt | 6 +- ext/standard/tests/strings/strpbrk_error.phpt | 6 +- ext/standard/tests/strings/strpos.phpt | 22 +- .../tests/strings/strripos_offset.phpt | 30 +-- .../strings/strrpos_negative_offset.phpt | 12 +- .../tests/strings/strrpos_offset.phpt | 30 +-- .../tests/strings/strrpos_variation7.phpt | 6 +- .../tests/strings/strtr_variation6.phpt | 12 +- .../tests/strings/strtr_variation8.phpt | 32 +-- ext/standard/tests/strings/strval_error.phpt | 6 +- .../tests/strings/substr_compare.phpt | 6 +- .../tests/strings/substr_count_basic.phpt | 12 +- .../tests/strings/substr_count_error.phpt | 24 +- .../tests/strings/substr_replace_error.phpt | 12 +- ext/standard/tests/strings/unpack_error.phpt | 6 +- ext/standard/tests/strings/unpack_offset.phpt | 12 +- .../tests/strings/vfprintf_error1.phpt | 12 +- .../tests/strings/vfprintf_error3.phpt | 18 +- .../tests/strings/vfprintf_error4.phpt | 12 +- .../tests/strings/vfprintf_variation1.phpt | 6 +- .../tests/strings/vprintf_variation2.phpt | 54 ++--- ext/standard/tests/strings/wordwrap.phpt | 6 +- .../tests/strings/wordwrap_error.phpt | 6 +- ext/standard/tests/time/bug60222.phpt | 12 +- .../tests/url/parse_url_error_002.phpt | 6 +- .../version_compare_invalid_operator.phpt | 6 +- 505 files changed, 4950 insertions(+), 4965 deletions(-) diff --git a/ext/standard/tests/array/GHSA-h96m-rvf9-jgm2.phpt b/ext/standard/tests/array/GHSA-h96m-rvf9-jgm2.phpt index 2e3e85357e13..1895562dc172 100644 --- a/ext/standard/tests/array/GHSA-h96m-rvf9-jgm2.phpt +++ b/ext/standard/tests/array/GHSA-h96m-rvf9-jgm2.phpt @@ -7,10 +7,10 @@ $power = 20; // Chosen to be well within a memory_limit $arr = range(0, 2**$power); try { array_merge(...array_fill(0, 2**(32-$power), $arr)); -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -The total number of elements must be lower than %d +Error: The total number of elements must be lower than %d diff --git a/ext/standard/tests/array/array_chunk2.phpt b/ext/standard/tests/array/array_chunk2.phpt index c83f051a271d..7aa51731559f 100644 --- a/ext/standard/tests/array/array_chunk2.phpt +++ b/ext/standard/tests/array/array_chunk2.phpt @@ -6,14 +6,14 @@ $input_array = array('a', 'b', 'c', 'd', 'e'); try { var_dump(array_chunk($input_array, 0)); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(array_chunk($input_array, 0, true)); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(array_chunk($input_array, 1)); @@ -24,8 +24,8 @@ var_dump(array_chunk($input_array, 10)); var_dump(array_chunk($input_array, 10, true)); ?> --EXPECT-- -array_chunk(): Argument #2 ($length) must be greater than 0 -array_chunk(): Argument #2 ($length) must be greater than 0 +ValueError: array_chunk(): Argument #2 ($length) must be greater than 0 +ValueError: array_chunk(): Argument #2 ($length) must be greater than 0 array(5) { [0]=> array(1) { diff --git a/ext/standard/tests/array/array_chunk_variation5.phpt b/ext/standard/tests/array/array_chunk_variation5.phpt index dfae48974d88..9b3ac0344efd 100644 --- a/ext/standard/tests/array/array_chunk_variation5.phpt +++ b/ext/standard/tests/array/array_chunk_variation5.phpt @@ -23,18 +23,18 @@ foreach ($sizes as $size){ echo "\n-- Testing array_chunk() when size = $size --\n"; try { var_dump( array_chunk($input_array, $size) ); - } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + } catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_chunk($input_array, $size, true) ); - } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + } catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_chunk($input_array, $size, false) ); - } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + } catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> @@ -42,9 +42,9 @@ foreach ($sizes as $size){ *** Testing array_chunk() : usage variations *** -- Testing array_chunk() when size = -1 -- -array_chunk(): Argument #2 ($length) must be greater than 0 -array_chunk(): Argument #2 ($length) must be greater than 0 -array_chunk(): Argument #2 ($length) must be greater than 0 +ValueError: array_chunk(): Argument #2 ($length) must be greater than 0 +ValueError: array_chunk(): Argument #2 ($length) must be greater than 0 +ValueError: array_chunk(): Argument #2 ($length) must be greater than 0 -- Testing array_chunk() when size = 4 -- array(1) { @@ -82,9 +82,9 @@ array(1) { } -- Testing array_chunk() when size = 0 -- -array_chunk(): Argument #2 ($length) must be greater than 0 -array_chunk(): Argument #2 ($length) must be greater than 0 -array_chunk(): Argument #2 ($length) must be greater than 0 +ValueError: array_chunk(): Argument #2 ($length) must be greater than 0 +ValueError: array_chunk(): Argument #2 ($length) must be greater than 0 +ValueError: array_chunk(): Argument #2 ($length) must be greater than 0 -- Testing array_chunk() when size = 1 -- array(3) { diff --git a/ext/standard/tests/array/array_column_scalar_index_strict_types.phpt b/ext/standard/tests/array/array_column_scalar_index_strict_types.phpt index 322cd1f0ab0b..f08c31df5324 100644 --- a/ext/standard/tests/array/array_column_scalar_index_strict_types.phpt +++ b/ext/standard/tests/array/array_column_scalar_index_strict_types.phpt @@ -7,39 +7,39 @@ declare(strict_types=1); echo "\n-- Testing array_column() column key parameter should be a string or an integer (testing bool) --\n"; try { var_dump(array_column([['php7', 'foo'], ['php8', 'bar']], false)); -} catch (\TypeError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(array_column([['php7', 'foo'], ['php8', 'bar']], true)); -} catch (\TypeError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing array_column() column key parameter should be a string or integer (testing array) --\n"; try { var_dump(array_column([['php7', 'foo'], ['php8', 'bar']], array())); -} catch (\TypeError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing array_column() index key parameter should be a string or an integer (testing bool) --\n"; try { var_dump(array_column([['php' => 7, 'foo'], ['php' => 8, 'bar']], 'php', false)); -} catch (\TypeError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(array_column([['php' => 7, 'foo'], ['php' => 8, 'bar']], 'php', true)); -} catch (\TypeError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing array_column() index key parameter should be a string or integer (testing array) --\n"; try { var_dump(array_column([['php' => 7, 'foo'], ['php' => 8, 'bar']], 'php', array())); -} catch (\TypeError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -47,17 +47,17 @@ try { DONE --EXPECT-- -- Testing array_column() column key parameter should be a string or an integer (testing bool) -- -array_column(): Argument #2 ($column_key) must be of type string|int|null, false given -array_column(): Argument #2 ($column_key) must be of type string|int|null, true given +TypeError: array_column(): Argument #2 ($column_key) must be of type string|int|null, false given +TypeError: array_column(): Argument #2 ($column_key) must be of type string|int|null, true given -- Testing array_column() column key parameter should be a string or integer (testing array) -- -array_column(): Argument #2 ($column_key) must be of type string|int|null, array given +TypeError: array_column(): Argument #2 ($column_key) must be of type string|int|null, array given -- Testing array_column() index key parameter should be a string or an integer (testing bool) -- -array_column(): Argument #3 ($index_key) must be of type string|int|null, false given -array_column(): Argument #3 ($index_key) must be of type string|int|null, true given +TypeError: array_column(): Argument #3 ($index_key) must be of type string|int|null, false given +TypeError: array_column(): Argument #3 ($index_key) must be of type string|int|null, true given -- Testing array_column() index key parameter should be a string or integer (testing array) -- -array_column(): Argument #3 ($index_key) must be of type string|int|null, array given +TypeError: array_column(): Argument #3 ($index_key) must be of type string|int|null, array given DONE diff --git a/ext/standard/tests/array/array_column_scalar_index_weak_types.phpt b/ext/standard/tests/array/array_column_scalar_index_weak_types.phpt index 42ca676ebfca..07416daede4c 100644 --- a/ext/standard/tests/array/array_column_scalar_index_weak_types.phpt +++ b/ext/standard/tests/array/array_column_scalar_index_weak_types.phpt @@ -5,39 +5,39 @@ Test array_column(): Index argument with various types in weak type mode echo "\n-- Testing array_column() column key parameter should be a string or an integer (testing bool) --\n"; try { var_dump(array_column([['php7', 'foo'], ['php8', 'bar']], false)); -} catch (\TypeError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(array_column([['php7', 'foo'], ['php8', 'bar']], true)); -} catch (\TypeError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing array_column() column key parameter should be a string or integer (testing array) --\n"; try { var_dump(array_column([['php7', 'foo'], ['php8', 'bar']], array())); -} catch (\TypeError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing array_column() index key parameter should be a string or an integer (testing bool) --\n"; try { var_dump(array_column([['php' => 7, 'foo'], ['php' => 8, 'bar']], 'php', false)); -} catch (\TypeError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(array_column([['php' => 7, 'foo'], ['php' => 8, 'bar']], 'php', true)); -} catch (\TypeError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing array_column() index key parameter should be a string or integer (testing array) --\n"; try { var_dump(array_column([['php' => 7, 'foo'], ['php' => 8, 'bar']], 'php', array())); -} catch (\TypeError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -59,7 +59,7 @@ array(2) { } -- Testing array_column() column key parameter should be a string or integer (testing array) -- -array_column(): Argument #2 ($column_key) must be of type string|int|null, array given +TypeError: array_column(): Argument #2 ($column_key) must be of type string|int|null, array given -- Testing array_column() index key parameter should be a string or an integer (testing bool) -- array(2) { @@ -76,6 +76,6 @@ array(2) { } -- Testing array_column() index key parameter should be a string or integer (testing array) -- -array_column(): Argument #3 ($index_key) must be of type string|int|null, array given +TypeError: array_column(): Argument #3 ($index_key) must be of type string|int|null, array given DONE diff --git a/ext/standard/tests/array/array_combine_error2.phpt b/ext/standard/tests/array/array_combine_error2.phpt index 8d3440eaac5d..bf26deb93526 100644 --- a/ext/standard/tests/array/array_combine_error2.phpt +++ b/ext/standard/tests/array/array_combine_error2.phpt @@ -12,24 +12,24 @@ var_dump( array_combine(array(), array()) ); echo "\n-- Testing array_combine() function with empty array for \$keys argument --\n"; try { var_dump( array_combine(array(), array(1, 2)) ); -} catch (\ValueError $e) { - echo $e->getMessage(); +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } // Testing array_combine by passing empty array to $values -echo "\n-- Testing array_combine() function with empty array for \$values argument --\n"; +echo "-- Testing array_combine() function with empty array for \$values argument --\n"; try { var_dump( array_combine(array(1, 2), array()) ); -} catch (\ValueError $e) { - echo $e->getMessage(); +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } // Testing array_combine with arrays having unequal number of elements -echo "\n-- Testing array_combine() function by passing array with unequal number of elements --\n"; +echo "-- Testing array_combine() function by passing array with unequal number of elements --\n"; try { var_dump( array_combine(array(1, 2), array(1, 2, 3)) ); -} catch (\ValueError $e) { - echo $e->getMessage(); +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -41,8 +41,8 @@ array(0) { } -- Testing array_combine() function with empty array for $keys argument -- -array_combine(): Argument #1 ($keys) and argument #2 ($values) must have the same number of elements +ValueError: array_combine(): Argument #1 ($keys) and argument #2 ($values) must have the same number of elements -- Testing array_combine() function with empty array for $values argument -- -array_combine(): Argument #1 ($keys) and argument #2 ($values) must have the same number of elements +ValueError: array_combine(): Argument #1 ($keys) and argument #2 ($values) must have the same number of elements -- Testing array_combine() function by passing array with unequal number of elements -- -array_combine(): Argument #1 ($keys) and argument #2 ($values) must have the same number of elements +ValueError: array_combine(): Argument #1 ($keys) and argument #2 ($values) must have the same number of elements diff --git a/ext/standard/tests/array/array_diff_1.phpt b/ext/standard/tests/array/array_diff_1.phpt index 7b58077e95af..9db019867fc5 100644 --- a/ext/standard/tests/array/array_diff_1.phpt +++ b/ext/standard/tests/array/array_diff_1.phpt @@ -8,12 +8,12 @@ $b = 3; $c = array(5); try { array_diff($a, $b, $c); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } //-=-=-=-=-=- echo "OK!"; ?> --EXPECT-- -array_diff(): Argument #2 must be of type array, int given +TypeError: array_diff(): Argument #2 must be of type array, int given OK! diff --git a/ext/standard/tests/array/array_diff_key_variation1.phpt b/ext/standard/tests/array/array_diff_key_variation1.phpt index 7b422153a0a0..f5cef4fe14dd 100644 --- a/ext/standard/tests/array/array_diff_key_variation1.phpt +++ b/ext/standard/tests/array/array_diff_key_variation1.phpt @@ -87,13 +87,13 @@ foreach($inputs as $key =>$value) { echo "\n--$key--\n"; try { var_dump( array_diff_key($value, $array2) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_diff_key($value, $array2, $array3) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -103,105 +103,105 @@ fclose($fp); *** Testing array_diff_key() : usage variation *** --int 0-- -array_diff_key(): Argument #1 ($array) must be of type array, int given -array_diff_key(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, int given --int 1-- -array_diff_key(): Argument #1 ($array) must be of type array, int given -array_diff_key(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, int given --int 12345-- -array_diff_key(): Argument #1 ($array) must be of type array, int given -array_diff_key(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, int given --int -12345-- -array_diff_key(): Argument #1 ($array) must be of type array, int given -array_diff_key(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, int given --float 10.5-- -array_diff_key(): Argument #1 ($array) must be of type array, float given -array_diff_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, float given --float -10.5-- -array_diff_key(): Argument #1 ($array) must be of type array, float given -array_diff_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, float given --float 12.3456789000e10-- -array_diff_key(): Argument #1 ($array) must be of type array, float given -array_diff_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, float given --float -12.3456789000e10-- -array_diff_key(): Argument #1 ($array) must be of type array, float given -array_diff_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, float given --float .5-- -array_diff_key(): Argument #1 ($array) must be of type array, float given -array_diff_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, float given --uppercase NULL-- -array_diff_key(): Argument #1 ($array) must be of type array, null given -array_diff_key(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, null given --lowercase null-- -array_diff_key(): Argument #1 ($array) must be of type array, null given -array_diff_key(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, null given --lowercase true-- -array_diff_key(): Argument #1 ($array) must be of type array, true given -array_diff_key(): Argument #1 ($array) must be of type array, true given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, true given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, true given --lowercase false-- -array_diff_key(): Argument #1 ($array) must be of type array, false given -array_diff_key(): Argument #1 ($array) must be of type array, false given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, false given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, false given --uppercase TRUE-- -array_diff_key(): Argument #1 ($array) must be of type array, true given -array_diff_key(): Argument #1 ($array) must be of type array, true given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, true given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, true given --uppercase FALSE-- -array_diff_key(): Argument #1 ($array) must be of type array, false given -array_diff_key(): Argument #1 ($array) must be of type array, false given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, false given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, false given --empty string DQ-- -array_diff_key(): Argument #1 ($array) must be of type array, string given -array_diff_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, string given --empty string SQ-- -array_diff_key(): Argument #1 ($array) must be of type array, string given -array_diff_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, string given --string DQ-- -array_diff_key(): Argument #1 ($array) must be of type array, string given -array_diff_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, string given --string SQ-- -array_diff_key(): Argument #1 ($array) must be of type array, string given -array_diff_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, string given --mixed case string-- -array_diff_key(): Argument #1 ($array) must be of type array, string given -array_diff_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, string given --heredoc-- -array_diff_key(): Argument #1 ($array) must be of type array, string given -array_diff_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, string given --instance of classWithToString-- -array_diff_key(): Argument #1 ($array) must be of type array, classWithToString given -array_diff_key(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, classWithToString given --instance of classWithoutToString-- -array_diff_key(): Argument #1 ($array) must be of type array, classWithoutToString given -array_diff_key(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, classWithoutToString given --undefined var-- -array_diff_key(): Argument #1 ($array) must be of type array, null given -array_diff_key(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, null given --unset var-- -array_diff_key(): Argument #1 ($array) must be of type array, null given -array_diff_key(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, null given --resource-- -array_diff_key(): Argument #1 ($array) must be of type array, resource given -array_diff_key(): Argument #1 ($array) must be of type array, resource given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, resource given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, resource given diff --git a/ext/standard/tests/array/array_diff_key_variation2.phpt b/ext/standard/tests/array/array_diff_key_variation2.phpt index b7093606c60a..a03ad95d54f0 100644 --- a/ext/standard/tests/array/array_diff_key_variation2.phpt +++ b/ext/standard/tests/array/array_diff_key_variation2.phpt @@ -88,13 +88,13 @@ foreach($inputs as $key =>$value) { echo "\n--$key--\n"; try { var_dump( array_diff_key($array1, $value) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_diff_key($array1, $value, $array3) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -104,105 +104,105 @@ fclose($fp); *** Testing array_diff_key() : usage variation *** --int 0-- -array_diff_key(): Argument #2 must be of type array, int given -array_diff_key(): Argument #2 must be of type array, int given +TypeError: array_diff_key(): Argument #2 must be of type array, int given +TypeError: array_diff_key(): Argument #2 must be of type array, int given --int 1-- -array_diff_key(): Argument #2 must be of type array, int given -array_diff_key(): Argument #2 must be of type array, int given +TypeError: array_diff_key(): Argument #2 must be of type array, int given +TypeError: array_diff_key(): Argument #2 must be of type array, int given --int 12345-- -array_diff_key(): Argument #2 must be of type array, int given -array_diff_key(): Argument #2 must be of type array, int given +TypeError: array_diff_key(): Argument #2 must be of type array, int given +TypeError: array_diff_key(): Argument #2 must be of type array, int given --int -12345-- -array_diff_key(): Argument #2 must be of type array, int given -array_diff_key(): Argument #2 must be of type array, int given +TypeError: array_diff_key(): Argument #2 must be of type array, int given +TypeError: array_diff_key(): Argument #2 must be of type array, int given --float 10.5-- -array_diff_key(): Argument #2 must be of type array, float given -array_diff_key(): Argument #2 must be of type array, float given +TypeError: array_diff_key(): Argument #2 must be of type array, float given +TypeError: array_diff_key(): Argument #2 must be of type array, float given --float -10.5-- -array_diff_key(): Argument #2 must be of type array, float given -array_diff_key(): Argument #2 must be of type array, float given +TypeError: array_diff_key(): Argument #2 must be of type array, float given +TypeError: array_diff_key(): Argument #2 must be of type array, float given --float 12.3456789000e10-- -array_diff_key(): Argument #2 must be of type array, float given -array_diff_key(): Argument #2 must be of type array, float given +TypeError: array_diff_key(): Argument #2 must be of type array, float given +TypeError: array_diff_key(): Argument #2 must be of type array, float given --float -12.3456789000e10-- -array_diff_key(): Argument #2 must be of type array, float given -array_diff_key(): Argument #2 must be of type array, float given +TypeError: array_diff_key(): Argument #2 must be of type array, float given +TypeError: array_diff_key(): Argument #2 must be of type array, float given --float .5-- -array_diff_key(): Argument #2 must be of type array, float given -array_diff_key(): Argument #2 must be of type array, float given +TypeError: array_diff_key(): Argument #2 must be of type array, float given +TypeError: array_diff_key(): Argument #2 must be of type array, float given --uppercase NULL-- -array_diff_key(): Argument #2 must be of type array, null given -array_diff_key(): Argument #2 must be of type array, null given +TypeError: array_diff_key(): Argument #2 must be of type array, null given +TypeError: array_diff_key(): Argument #2 must be of type array, null given --lowercase null-- -array_diff_key(): Argument #2 must be of type array, null given -array_diff_key(): Argument #2 must be of type array, null given +TypeError: array_diff_key(): Argument #2 must be of type array, null given +TypeError: array_diff_key(): Argument #2 must be of type array, null given --lowercase true-- -array_diff_key(): Argument #2 must be of type array, true given -array_diff_key(): Argument #2 must be of type array, true given +TypeError: array_diff_key(): Argument #2 must be of type array, true given +TypeError: array_diff_key(): Argument #2 must be of type array, true given --lowercase false-- -array_diff_key(): Argument #2 must be of type array, false given -array_diff_key(): Argument #2 must be of type array, false given +TypeError: array_diff_key(): Argument #2 must be of type array, false given +TypeError: array_diff_key(): Argument #2 must be of type array, false given --uppercase TRUE-- -array_diff_key(): Argument #2 must be of type array, true given -array_diff_key(): Argument #2 must be of type array, true given +TypeError: array_diff_key(): Argument #2 must be of type array, true given +TypeError: array_diff_key(): Argument #2 must be of type array, true given --uppercase FALSE-- -array_diff_key(): Argument #2 must be of type array, false given -array_diff_key(): Argument #2 must be of type array, false given +TypeError: array_diff_key(): Argument #2 must be of type array, false given +TypeError: array_diff_key(): Argument #2 must be of type array, false given --empty string DQ-- -array_diff_key(): Argument #2 must be of type array, string given -array_diff_key(): Argument #2 must be of type array, string given +TypeError: array_diff_key(): Argument #2 must be of type array, string given +TypeError: array_diff_key(): Argument #2 must be of type array, string given --empty string SQ-- -array_diff_key(): Argument #2 must be of type array, string given -array_diff_key(): Argument #2 must be of type array, string given +TypeError: array_diff_key(): Argument #2 must be of type array, string given +TypeError: array_diff_key(): Argument #2 must be of type array, string given --string DQ-- -array_diff_key(): Argument #2 must be of type array, string given -array_diff_key(): Argument #2 must be of type array, string given +TypeError: array_diff_key(): Argument #2 must be of type array, string given +TypeError: array_diff_key(): Argument #2 must be of type array, string given --string SQ-- -array_diff_key(): Argument #2 must be of type array, string given -array_diff_key(): Argument #2 must be of type array, string given +TypeError: array_diff_key(): Argument #2 must be of type array, string given +TypeError: array_diff_key(): Argument #2 must be of type array, string given --mixed case string-- -array_diff_key(): Argument #2 must be of type array, string given -array_diff_key(): Argument #2 must be of type array, string given +TypeError: array_diff_key(): Argument #2 must be of type array, string given +TypeError: array_diff_key(): Argument #2 must be of type array, string given --heredoc-- -array_diff_key(): Argument #2 must be of type array, string given -array_diff_key(): Argument #2 must be of type array, string given +TypeError: array_diff_key(): Argument #2 must be of type array, string given +TypeError: array_diff_key(): Argument #2 must be of type array, string given --instance of classWithToString-- -array_diff_key(): Argument #2 must be of type array, classWithToString given -array_diff_key(): Argument #2 must be of type array, classWithToString given +TypeError: array_diff_key(): Argument #2 must be of type array, classWithToString given +TypeError: array_diff_key(): Argument #2 must be of type array, classWithToString given --instance of classWithoutToString-- -array_diff_key(): Argument #2 must be of type array, classWithoutToString given -array_diff_key(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_diff_key(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_diff_key(): Argument #2 must be of type array, classWithoutToString given --undefined var-- -array_diff_key(): Argument #2 must be of type array, null given -array_diff_key(): Argument #2 must be of type array, null given +TypeError: array_diff_key(): Argument #2 must be of type array, null given +TypeError: array_diff_key(): Argument #2 must be of type array, null given --unset var-- -array_diff_key(): Argument #2 must be of type array, null given -array_diff_key(): Argument #2 must be of type array, null given +TypeError: array_diff_key(): Argument #2 must be of type array, null given +TypeError: array_diff_key(): Argument #2 must be of type array, null given --resource-- -array_diff_key(): Argument #2 must be of type array, resource given -array_diff_key(): Argument #2 must be of type array, resource given +TypeError: array_diff_key(): Argument #2 must be of type array, resource given +TypeError: array_diff_key(): Argument #2 must be of type array, resource given diff --git a/ext/standard/tests/array/array_diff_leak_custom_type_checks.phpt b/ext/standard/tests/array/array_diff_leak_custom_type_checks.phpt index 77aef0ccc08b..633a55200cd6 100644 --- a/ext/standard/tests/array/array_diff_leak_custom_type_checks.phpt +++ b/ext/standard/tests/array/array_diff_leak_custom_type_checks.phpt @@ -5,10 +5,10 @@ array_diff() memory leak with custom type checks try { array_diff([123], 'x'); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -array_diff(): Argument #2 must be of type array, string given +TypeError: array_diff(): Argument #2 must be of type array, string given diff --git a/ext/standard/tests/array/array_diff_max_elements.phpt b/ext/standard/tests/array/array_diff_max_elements.phpt index 4c65cd049b33..79386ef42c86 100644 --- a/ext/standard/tests/array/array_diff_max_elements.phpt +++ b/ext/standard/tests/array/array_diff_max_elements.phpt @@ -7,10 +7,10 @@ $power = 20; // Chosen to be well within a memory_limit $arr = range(0, 2**$power); try { array_diff(...array_fill(0, 2**(32-$power), $arr)); -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -The total number of elements must be lower than %d +Error: The total number of elements must be lower than %d diff --git a/ext/standard/tests/array/array_diff_uassoc_error.phpt b/ext/standard/tests/array/array_diff_uassoc_error.phpt index 1d158dc2d49c..227902bf12d0 100644 --- a/ext/standard/tests/array/array_diff_uassoc_error.phpt +++ b/ext/standard/tests/array/array_diff_uassoc_error.phpt @@ -23,21 +23,21 @@ function key_compare_func($a, $b) echo "\n-- Testing array_diff_uassoc() function with more than expected no. of arguments --\n"; try { var_dump( array_diff_uassoc($array1, $array2, "key_compare_func", $extra_arg) ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_diff_uassoc($array1, $array2, $array3, $array4, "key_compare_func", $extra_arg) ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } // Testing array_diff_uassoc with one less than the expected number of arguments echo "\n-- Testing array_diff_uassoc() function with less than expected no. of arguments --\n"; try { var_dump( array_diff_uassoc($array1, $array2) ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -45,8 +45,8 @@ try { *** Testing array_diff_uassoc() : error conditions *** -- Testing array_diff_uassoc() function with more than expected no. of arguments -- -array_diff_uassoc(): Argument #4 must be a valid callback, array callback must have exactly two members -array_diff_uassoc(): Argument #6 must be a valid callback, array callback must have exactly two members +TypeError: array_diff_uassoc(): Argument #4 must be a valid callback, array callback must have exactly two members +TypeError: array_diff_uassoc(): Argument #6 must be a valid callback, array callback must have exactly two members -- Testing array_diff_uassoc() function with less than expected no. of arguments -- -array_diff_uassoc(): Argument #2 must be a valid callback, array callback must have exactly two members +TypeError: array_diff_uassoc(): Argument #2 must be a valid callback, array callback must have exactly two members diff --git a/ext/standard/tests/array/array_diff_uassoc_variation1.phpt b/ext/standard/tests/array/array_diff_uassoc_variation1.phpt index 49d6903a90ea..b39222547ce1 100644 --- a/ext/standard/tests/array/array_diff_uassoc_variation1.phpt +++ b/ext/standard/tests/array/array_diff_uassoc_variation1.phpt @@ -99,8 +99,8 @@ foreach($inputs as $key =>$value) { echo "\n--$key--\n"; try { var_dump( array_diff_uassoc($value, $array2, "key_compare_func") ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -110,79 +110,79 @@ fclose($fp); *** Testing array_diff_uassoc() : usage variation *** --int 0-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, int given --int 1-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, int given --int 12345-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, int given --int -12345-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, int given --float 10.5-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, float given --float -10.5-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, float given --float 12.3456789000e10-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, float given --float -12.3456789000e10-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, float given --float .5-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, float given --uppercase NULL-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, null given --lowercase null-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, null given --lowercase true-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, true given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, true given --lowercase false-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, false given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, false given --uppercase TRUE-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, true given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, true given --uppercase FALSE-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, false given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, false given --empty string DQ-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, string given --empty string SQ-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, string given --string DQ-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, string given --string SQ-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, string given --mixed case string-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, string given --heredoc-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, string given --instance of classWithToString-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, classWithToString given --instance of classWithoutToString-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, classWithoutToString given --undefined var-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, null given --unset var-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, null given --resource-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, resource given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, resource given diff --git a/ext/standard/tests/array/array_diff_uassoc_variation2.phpt b/ext/standard/tests/array/array_diff_uassoc_variation2.phpt index 7466da23d426..a46aa05f7d2e 100644 --- a/ext/standard/tests/array/array_diff_uassoc_variation2.phpt +++ b/ext/standard/tests/array/array_diff_uassoc_variation2.phpt @@ -99,8 +99,8 @@ foreach($inputs as $key =>$value) { echo "\n--$key--\n"; try { var_dump( array_diff_uassoc($array1, $value, "key_compare_func") ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -110,79 +110,79 @@ fclose($fp); *** Testing array_diff_uassoc() : usage variation *** --int 0-- -array_diff_uassoc(): Argument #2 must be of type array, int given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, int given --int 1-- -array_diff_uassoc(): Argument #2 must be of type array, int given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, int given --int 12345-- -array_diff_uassoc(): Argument #2 must be of type array, int given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, int given --int -12345-- -array_diff_uassoc(): Argument #2 must be of type array, int given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, int given --float 10.5-- -array_diff_uassoc(): Argument #2 must be of type array, float given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, float given --float -10.5-- -array_diff_uassoc(): Argument #2 must be of type array, float given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, float given --float 12.3456789000e10-- -array_diff_uassoc(): Argument #2 must be of type array, float given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, float given --float -12.3456789000e10-- -array_diff_uassoc(): Argument #2 must be of type array, float given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, float given --float .5-- -array_diff_uassoc(): Argument #2 must be of type array, float given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, float given --uppercase NULL-- -array_diff_uassoc(): Argument #2 must be of type array, null given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, null given --lowercase null-- -array_diff_uassoc(): Argument #2 must be of type array, null given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, null given --lowercase true-- -array_diff_uassoc(): Argument #2 must be of type array, true given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, true given --lowercase false-- -array_diff_uassoc(): Argument #2 must be of type array, false given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, false given --uppercase TRUE-- -array_diff_uassoc(): Argument #2 must be of type array, true given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, true given --uppercase FALSE-- -array_diff_uassoc(): Argument #2 must be of type array, false given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, false given --empty string DQ-- -array_diff_uassoc(): Argument #2 must be of type array, string given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, string given --empty string SQ-- -array_diff_uassoc(): Argument #2 must be of type array, string given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, string given --string DQ-- -array_diff_uassoc(): Argument #2 must be of type array, string given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, string given --string SQ-- -array_diff_uassoc(): Argument #2 must be of type array, string given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, string given --mixed case string-- -array_diff_uassoc(): Argument #2 must be of type array, string given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, string given --heredoc-- -array_diff_uassoc(): Argument #2 must be of type array, string given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, string given --instance of classWithToString-- -array_diff_uassoc(): Argument #2 must be of type array, classWithToString given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, classWithToString given --instance of classWithoutToString-- -array_diff_uassoc(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, classWithoutToString given --undefined var-- -array_diff_uassoc(): Argument #2 must be of type array, null given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, null given --unset var-- -array_diff_uassoc(): Argument #2 must be of type array, null given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, null given --resource-- -array_diff_uassoc(): Argument #2 must be of type array, resource given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, resource given diff --git a/ext/standard/tests/array/array_diff_ukey_variation1.phpt b/ext/standard/tests/array/array_diff_ukey_variation1.phpt index 125406497eda..6643bde363e9 100644 --- a/ext/standard/tests/array/array_diff_ukey_variation1.phpt +++ b/ext/standard/tests/array/array_diff_ukey_variation1.phpt @@ -95,13 +95,13 @@ foreach($inputs as $key =>$value) { echo "\n--$key--\n"; try { var_dump( array_diff_ukey($value, $array2, 'key_compare_func') ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_diff_ukey($value, $array2, $array3, 'key_compare_func') ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -111,105 +111,105 @@ fclose($fp); *** Testing array_diff_ukey() : usage variation *** --int 0-- -array_diff_ukey(): Argument #1 ($array) must be of type array, int given -array_diff_ukey(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, int given --int 1-- -array_diff_ukey(): Argument #1 ($array) must be of type array, int given -array_diff_ukey(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, int given --int 12345-- -array_diff_ukey(): Argument #1 ($array) must be of type array, int given -array_diff_ukey(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, int given --int -12345-- -array_diff_ukey(): Argument #1 ($array) must be of type array, int given -array_diff_ukey(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, int given --float 10.5-- -array_diff_ukey(): Argument #1 ($array) must be of type array, float given -array_diff_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, float given --float -10.5-- -array_diff_ukey(): Argument #1 ($array) must be of type array, float given -array_diff_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, float given --float 12.3456789000e10-- -array_diff_ukey(): Argument #1 ($array) must be of type array, float given -array_diff_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, float given --float -12.3456789000e10-- -array_diff_ukey(): Argument #1 ($array) must be of type array, float given -array_diff_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, float given --float .5-- -array_diff_ukey(): Argument #1 ($array) must be of type array, float given -array_diff_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, float given --uppercase NULL-- -array_diff_ukey(): Argument #1 ($array) must be of type array, null given -array_diff_ukey(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, null given --lowercase null-- -array_diff_ukey(): Argument #1 ($array) must be of type array, null given -array_diff_ukey(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, null given --lowercase true-- -array_diff_ukey(): Argument #1 ($array) must be of type array, true given -array_diff_ukey(): Argument #1 ($array) must be of type array, true given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, true given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, true given --lowercase false-- -array_diff_ukey(): Argument #1 ($array) must be of type array, false given -array_diff_ukey(): Argument #1 ($array) must be of type array, false given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, false given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, false given --uppercase TRUE-- -array_diff_ukey(): Argument #1 ($array) must be of type array, true given -array_diff_ukey(): Argument #1 ($array) must be of type array, true given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, true given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, true given --uppercase FALSE-- -array_diff_ukey(): Argument #1 ($array) must be of type array, false given -array_diff_ukey(): Argument #1 ($array) must be of type array, false given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, false given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, false given --empty string DQ-- -array_diff_ukey(): Argument #1 ($array) must be of type array, string given -array_diff_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, string given --empty string SQ-- -array_diff_ukey(): Argument #1 ($array) must be of type array, string given -array_diff_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, string given --string DQ-- -array_diff_ukey(): Argument #1 ($array) must be of type array, string given -array_diff_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, string given --string SQ-- -array_diff_ukey(): Argument #1 ($array) must be of type array, string given -array_diff_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, string given --mixed case string-- -array_diff_ukey(): Argument #1 ($array) must be of type array, string given -array_diff_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, string given --heredoc-- -array_diff_ukey(): Argument #1 ($array) must be of type array, string given -array_diff_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, string given --instance of classWithToString-- -array_diff_ukey(): Argument #1 ($array) must be of type array, classWithToString given -array_diff_ukey(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, classWithToString given --instance of classWithoutToString-- -array_diff_ukey(): Argument #1 ($array) must be of type array, classWithoutToString given -array_diff_ukey(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, classWithoutToString given --undefined var-- -array_diff_ukey(): Argument #1 ($array) must be of type array, null given -array_diff_ukey(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, null given --unset var-- -array_diff_ukey(): Argument #1 ($array) must be of type array, null given -array_diff_ukey(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, null given --resource-- -array_diff_ukey(): Argument #1 ($array) must be of type array, resource given -array_diff_ukey(): Argument #1 ($array) must be of type array, resource given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, resource given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, resource given diff --git a/ext/standard/tests/array/array_diff_ukey_variation10.phpt b/ext/standard/tests/array/array_diff_ukey_variation10.phpt index b8dfb73873bb..fb3f6c6e6c3a 100644 --- a/ext/standard/tests/array/array_diff_ukey_variation10.phpt +++ b/ext/standard/tests/array/array_diff_ukey_variation10.phpt @@ -11,19 +11,19 @@ $array2 = array("a" => "green", "yellow", "red"); //function name within double quotes try { var_dump( array_diff_ukey($array1, $array1, "unknown_function") ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } //function name within single quotes try { var_dump( array_diff_ukey($array1, $array1, 'unknown_function') ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- *** Testing array_diff_ukey() : usage variation *** -array_diff_ukey(): Argument #3 must be a valid callback, function "unknown_function" not found or invalid function name -array_diff_ukey(): Argument #3 must be a valid callback, function "unknown_function" not found or invalid function name +TypeError: array_diff_ukey(): Argument #3 must be a valid callback, function "unknown_function" not found or invalid function name +TypeError: array_diff_ukey(): Argument #3 must be a valid callback, function "unknown_function" not found or invalid function name diff --git a/ext/standard/tests/array/array_diff_ukey_variation2.phpt b/ext/standard/tests/array/array_diff_ukey_variation2.phpt index cf71a26d22be..a6730cff161b 100644 --- a/ext/standard/tests/array/array_diff_ukey_variation2.phpt +++ b/ext/standard/tests/array/array_diff_ukey_variation2.phpt @@ -99,13 +99,13 @@ foreach($inputs as $key =>$value) { echo "\n--$key--\n"; try { var_dump( array_diff_ukey($array1, $value, 'key_compare_func') ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_diff_ukey($array1, $value, $array3, 'key_compare_func') ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -115,105 +115,105 @@ fclose($fp); *** Testing array_diff_ukey() : usage variation *** --int 0-- -array_diff_ukey(): Argument #2 must be of type array, int given -array_diff_ukey(): Argument #2 must be of type array, int given +TypeError: array_diff_ukey(): Argument #2 must be of type array, int given +TypeError: array_diff_ukey(): Argument #2 must be of type array, int given --int 1-- -array_diff_ukey(): Argument #2 must be of type array, int given -array_diff_ukey(): Argument #2 must be of type array, int given +TypeError: array_diff_ukey(): Argument #2 must be of type array, int given +TypeError: array_diff_ukey(): Argument #2 must be of type array, int given --int 12345-- -array_diff_ukey(): Argument #2 must be of type array, int given -array_diff_ukey(): Argument #2 must be of type array, int given +TypeError: array_diff_ukey(): Argument #2 must be of type array, int given +TypeError: array_diff_ukey(): Argument #2 must be of type array, int given --int -12345-- -array_diff_ukey(): Argument #2 must be of type array, int given -array_diff_ukey(): Argument #2 must be of type array, int given +TypeError: array_diff_ukey(): Argument #2 must be of type array, int given +TypeError: array_diff_ukey(): Argument #2 must be of type array, int given --float 10.5-- -array_diff_ukey(): Argument #2 must be of type array, float given -array_diff_ukey(): Argument #2 must be of type array, float given +TypeError: array_diff_ukey(): Argument #2 must be of type array, float given +TypeError: array_diff_ukey(): Argument #2 must be of type array, float given --float -10.5-- -array_diff_ukey(): Argument #2 must be of type array, float given -array_diff_ukey(): Argument #2 must be of type array, float given +TypeError: array_diff_ukey(): Argument #2 must be of type array, float given +TypeError: array_diff_ukey(): Argument #2 must be of type array, float given --float 12.3456789000e10-- -array_diff_ukey(): Argument #2 must be of type array, float given -array_diff_ukey(): Argument #2 must be of type array, float given +TypeError: array_diff_ukey(): Argument #2 must be of type array, float given +TypeError: array_diff_ukey(): Argument #2 must be of type array, float given --float -12.3456789000e10-- -array_diff_ukey(): Argument #2 must be of type array, float given -array_diff_ukey(): Argument #2 must be of type array, float given +TypeError: array_diff_ukey(): Argument #2 must be of type array, float given +TypeError: array_diff_ukey(): Argument #2 must be of type array, float given --float .5-- -array_diff_ukey(): Argument #2 must be of type array, float given -array_diff_ukey(): Argument #2 must be of type array, float given +TypeError: array_diff_ukey(): Argument #2 must be of type array, float given +TypeError: array_diff_ukey(): Argument #2 must be of type array, float given --uppercase NULL-- -array_diff_ukey(): Argument #2 must be of type array, null given -array_diff_ukey(): Argument #2 must be of type array, null given +TypeError: array_diff_ukey(): Argument #2 must be of type array, null given +TypeError: array_diff_ukey(): Argument #2 must be of type array, null given --lowercase null-- -array_diff_ukey(): Argument #2 must be of type array, null given -array_diff_ukey(): Argument #2 must be of type array, null given +TypeError: array_diff_ukey(): Argument #2 must be of type array, null given +TypeError: array_diff_ukey(): Argument #2 must be of type array, null given --lowercase true-- -array_diff_ukey(): Argument #2 must be of type array, true given -array_diff_ukey(): Argument #2 must be of type array, true given +TypeError: array_diff_ukey(): Argument #2 must be of type array, true given +TypeError: array_diff_ukey(): Argument #2 must be of type array, true given --lowercase false-- -array_diff_ukey(): Argument #2 must be of type array, false given -array_diff_ukey(): Argument #2 must be of type array, false given +TypeError: array_diff_ukey(): Argument #2 must be of type array, false given +TypeError: array_diff_ukey(): Argument #2 must be of type array, false given --uppercase TRUE-- -array_diff_ukey(): Argument #2 must be of type array, true given -array_diff_ukey(): Argument #2 must be of type array, true given +TypeError: array_diff_ukey(): Argument #2 must be of type array, true given +TypeError: array_diff_ukey(): Argument #2 must be of type array, true given --uppercase FALSE-- -array_diff_ukey(): Argument #2 must be of type array, false given -array_diff_ukey(): Argument #2 must be of type array, false given +TypeError: array_diff_ukey(): Argument #2 must be of type array, false given +TypeError: array_diff_ukey(): Argument #2 must be of type array, false given --empty string DQ-- -array_diff_ukey(): Argument #2 must be of type array, string given -array_diff_ukey(): Argument #2 must be of type array, string given +TypeError: array_diff_ukey(): Argument #2 must be of type array, string given +TypeError: array_diff_ukey(): Argument #2 must be of type array, string given --empty string SQ-- -array_diff_ukey(): Argument #2 must be of type array, string given -array_diff_ukey(): Argument #2 must be of type array, string given +TypeError: array_diff_ukey(): Argument #2 must be of type array, string given +TypeError: array_diff_ukey(): Argument #2 must be of type array, string given --string DQ-- -array_diff_ukey(): Argument #2 must be of type array, string given -array_diff_ukey(): Argument #2 must be of type array, string given +TypeError: array_diff_ukey(): Argument #2 must be of type array, string given +TypeError: array_diff_ukey(): Argument #2 must be of type array, string given --string SQ-- -array_diff_ukey(): Argument #2 must be of type array, string given -array_diff_ukey(): Argument #2 must be of type array, string given +TypeError: array_diff_ukey(): Argument #2 must be of type array, string given +TypeError: array_diff_ukey(): Argument #2 must be of type array, string given --mixed case string-- -array_diff_ukey(): Argument #2 must be of type array, string given -array_diff_ukey(): Argument #2 must be of type array, string given +TypeError: array_diff_ukey(): Argument #2 must be of type array, string given +TypeError: array_diff_ukey(): Argument #2 must be of type array, string given --heredoc-- -array_diff_ukey(): Argument #2 must be of type array, string given -array_diff_ukey(): Argument #2 must be of type array, string given +TypeError: array_diff_ukey(): Argument #2 must be of type array, string given +TypeError: array_diff_ukey(): Argument #2 must be of type array, string given --instance of classWithToString-- -array_diff_ukey(): Argument #2 must be of type array, classWithToString given -array_diff_ukey(): Argument #2 must be of type array, classWithToString given +TypeError: array_diff_ukey(): Argument #2 must be of type array, classWithToString given +TypeError: array_diff_ukey(): Argument #2 must be of type array, classWithToString given --instance of classWithoutToString-- -array_diff_ukey(): Argument #2 must be of type array, classWithoutToString given -array_diff_ukey(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_diff_ukey(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_diff_ukey(): Argument #2 must be of type array, classWithoutToString given --undefined var-- -array_diff_ukey(): Argument #2 must be of type array, null given -array_diff_ukey(): Argument #2 must be of type array, null given +TypeError: array_diff_ukey(): Argument #2 must be of type array, null given +TypeError: array_diff_ukey(): Argument #2 must be of type array, null given --unset var-- -array_diff_ukey(): Argument #2 must be of type array, null given -array_diff_ukey(): Argument #2 must be of type array, null given +TypeError: array_diff_ukey(): Argument #2 must be of type array, null given +TypeError: array_diff_ukey(): Argument #2 must be of type array, null given --resource-- -array_diff_ukey(): Argument #2 must be of type array, resource given -array_diff_ukey(): Argument #2 must be of type array, resource given +TypeError: array_diff_ukey(): Argument #2 must be of type array, resource given +TypeError: array_diff_ukey(): Argument #2 must be of type array, resource given diff --git a/ext/standard/tests/array/array_fill_error.phpt b/ext/standard/tests/array/array_fill_error.phpt index 9b04f7553944..74427d05de5a 100644 --- a/ext/standard/tests/array/array_fill_error.phpt +++ b/ext/standard/tests/array/array_fill_error.phpt @@ -11,11 +11,11 @@ $val = 1; try { var_dump( array_fill($start_key,$num,$val) ); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- *** Testing array_fill() : error conditions *** -array_fill(): Argument #2 ($count) must be greater than or equal to 0 +ValueError: array_fill(): Argument #2 ($count) must be greater than or equal to 0 diff --git a/ext/standard/tests/array/array_fill_error2.phpt b/ext/standard/tests/array/array_fill_error2.phpt index 1f8b841c8421..5e96c41bc68a 100644 --- a/ext/standard/tests/array/array_fill_error2.phpt +++ b/ext/standard/tests/array/array_fill_error2.phpt @@ -9,8 +9,8 @@ $intMax = 2147483647; // calling array_fill() with 'count' larger than INT_MAX try { $array = array_fill(0, $intMax+1, 1); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } // calling array_fill() with 'count' equals to INT_MAX @@ -18,6 +18,6 @@ $array = array_fill(0, $intMax, 1); ?> --EXPECTF-- -array_fill(): Argument #2 ($count) is too large +ValueError: array_fill(): Argument #2 ($count) is too large Fatal error: Possible integer overflow in memory allocation (%d * %d + %d) in %s on line %d diff --git a/ext/standard/tests/array/array_fill_variation6.phpt b/ext/standard/tests/array/array_fill_variation6.phpt index 60dcec7e231e..8c5415854769 100644 --- a/ext/standard/tests/array/array_fill_variation6.phpt +++ b/ext/standard/tests/array/array_fill_variation6.phpt @@ -9,11 +9,11 @@ var_dump( ); try { $a[] = "bar"; -} catch (Error $ex) { - echo $ex->getMessage(), PHP_EOL; +} catch (Throwable $ex) { + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECT-- int(1) bool(true) -Cannot add element to the array as the next element is already occupied +Error: Cannot add element to the array as the next element is already occupied diff --git a/ext/standard/tests/array/array_filter_invalid_mode.phpt b/ext/standard/tests/array/array_filter_invalid_mode.phpt index b312bcfe5a23..4994aa63a004 100644 --- a/ext/standard/tests/array/array_filter_invalid_mode.phpt +++ b/ext/standard/tests/array/array_filter_invalid_mode.phpt @@ -6,7 +6,7 @@ Test array_filter() function : usage variations - mode exception try { var_dump(array_filter([], mode: 999)); } catch (Throwable $e) { - echo $e::class . ': '.$e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done" diff --git a/ext/standard/tests/array/array_filter_variation10.phpt b/ext/standard/tests/array/array_filter_variation10.phpt index eef7b6462033..9e69da73f4ff 100644 --- a/ext/standard/tests/array/array_filter_variation10.phpt +++ b/ext/standard/tests/array/array_filter_variation10.phpt @@ -32,7 +32,7 @@ echo "*** Testing array_filter() : usage variations - 'callback' expecting secon try { var_dump( array_filter($small, 'dump', false) ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "*** Testing array_filter() with various use types ***\n"; @@ -45,8 +45,8 @@ var_dump(array_filter($mixed, 'is_numeric', 0)); try { var_dump(array_filter($mixed, 'is_numeric', ARRAY_FILTER_USE_BOTH)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done" @@ -73,7 +73,7 @@ array(3) { NULL } *** Testing array_filter() : usage variations - 'callback' expecting second argument *** -Exception: Too few arguments to function dump(), 1 passed and exactly 2 expected +ArgumentCountError: Too few arguments to function dump(), 1 passed and exactly 2 expected *** Testing array_filter() with various use types *** array(2) { [1]=> @@ -87,5 +87,5 @@ array(2) { ["b"]=> int(2) } -is_numeric() expects exactly 1 argument, 2 given +ArgumentCountError: is_numeric() expects exactly 1 argument, 2 given Done diff --git a/ext/standard/tests/array/array_filter_variation9.phpt b/ext/standard/tests/array/array_filter_variation9.phpt index 2e6efc0eda5d..43919b2542d6 100644 --- a/ext/standard/tests/array/array_filter_variation9.phpt +++ b/ext/standard/tests/array/array_filter_variation9.phpt @@ -19,15 +19,15 @@ var_dump( array_filter($input, 'chr') ); // using language construct 'echo' as 'callback' try { var_dump( array_filter($input, 'echo') ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } // using language construct 'isset' as 'callback' try { var_dump( array_filter($input, 'isset') ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done" @@ -54,6 +54,6 @@ array(4) { [3]=> int(100) } -array_filter(): Argument #2 ($callback) must be a valid callback or null, function "echo" not found or invalid function name -array_filter(): Argument #2 ($callback) must be a valid callback or null, function "isset" not found or invalid function name +TypeError: array_filter(): Argument #2 ($callback) must be a valid callback or null, function "echo" not found or invalid function name +TypeError: array_filter(): Argument #2 ($callback) must be a valid callback or null, function "isset" not found or invalid function name Done diff --git a/ext/standard/tests/array/array_intersect_assoc_variation1.phpt b/ext/standard/tests/array/array_intersect_assoc_variation1.phpt index 9c9cef73dd1f..db0f4f257eaa 100644 --- a/ext/standard/tests/array/array_intersect_assoc_variation1.phpt +++ b/ext/standard/tests/array/array_intersect_assoc_variation1.phpt @@ -92,15 +92,15 @@ foreach($arrays as $unexpected_value) { // Calling array_intersect_assoc() with default arguments try { var_dump( array_intersect_assoc($unexpected_value, $array2) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } // Calling array_intersect_assoc() with more arguments try { var_dump( array_intersect_assoc($unexpected_value, $array2, $arr3) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $iterator++; } @@ -113,75 +113,75 @@ echo "Done"; --EXPECT-- *** Testing array_intersect_assoc() : Passing non-array values to $array1 argument *** --- Iteration 1 --array_intersect_assoc(): Argument #1 ($array) must be of type array, int given -array_intersect_assoc(): Argument #1 ($array) must be of type array, int given +-- Iteration 1 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, int given --- Iteration 2 --array_intersect_assoc(): Argument #1 ($array) must be of type array, int given -array_intersect_assoc(): Argument #1 ($array) must be of type array, int given +-- Iteration 2 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, int given --- Iteration 3 --array_intersect_assoc(): Argument #1 ($array) must be of type array, int given -array_intersect_assoc(): Argument #1 ($array) must be of type array, int given +-- Iteration 3 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, int given --- Iteration 4 --array_intersect_assoc(): Argument #1 ($array) must be of type array, int given -array_intersect_assoc(): Argument #1 ($array) must be of type array, int given +-- Iteration 4 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, int given --- Iteration 5 --array_intersect_assoc(): Argument #1 ($array) must be of type array, float given -array_intersect_assoc(): Argument #1 ($array) must be of type array, float given +-- Iteration 5 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, float given --- Iteration 6 --array_intersect_assoc(): Argument #1 ($array) must be of type array, float given -array_intersect_assoc(): Argument #1 ($array) must be of type array, float given +-- Iteration 6 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, float given --- Iteration 7 --array_intersect_assoc(): Argument #1 ($array) must be of type array, float given -array_intersect_assoc(): Argument #1 ($array) must be of type array, float given +-- Iteration 7 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, float given --- Iteration 8 --array_intersect_assoc(): Argument #1 ($array) must be of type array, float given -array_intersect_assoc(): Argument #1 ($array) must be of type array, float given +-- Iteration 8 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, float given --- Iteration 9 --array_intersect_assoc(): Argument #1 ($array) must be of type array, float given -array_intersect_assoc(): Argument #1 ($array) must be of type array, float given +-- Iteration 9 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, float given --- Iteration 10 --array_intersect_assoc(): Argument #1 ($array) must be of type array, null given -array_intersect_assoc(): Argument #1 ($array) must be of type array, null given +-- Iteration 10 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, null given --- Iteration 11 --array_intersect_assoc(): Argument #1 ($array) must be of type array, null given -array_intersect_assoc(): Argument #1 ($array) must be of type array, null given +-- Iteration 11 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, null given --- Iteration 12 --array_intersect_assoc(): Argument #1 ($array) must be of type array, true given -array_intersect_assoc(): Argument #1 ($array) must be of type array, true given +-- Iteration 12 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, true given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, true given --- Iteration 13 --array_intersect_assoc(): Argument #1 ($array) must be of type array, false given -array_intersect_assoc(): Argument #1 ($array) must be of type array, false given +-- Iteration 13 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, false given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, false given --- Iteration 14 --array_intersect_assoc(): Argument #1 ($array) must be of type array, true given -array_intersect_assoc(): Argument #1 ($array) must be of type array, true given +-- Iteration 14 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, true given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, true given --- Iteration 15 --array_intersect_assoc(): Argument #1 ($array) must be of type array, false given -array_intersect_assoc(): Argument #1 ($array) must be of type array, false given +-- Iteration 15 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, false given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, false given --- Iteration 16 --array_intersect_assoc(): Argument #1 ($array) must be of type array, string given -array_intersect_assoc(): Argument #1 ($array) must be of type array, string given +-- Iteration 16 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, string given --- Iteration 17 --array_intersect_assoc(): Argument #1 ($array) must be of type array, string given -array_intersect_assoc(): Argument #1 ($array) must be of type array, string given +-- Iteration 17 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, string given --- Iteration 18 --array_intersect_assoc(): Argument #1 ($array) must be of type array, string given -array_intersect_assoc(): Argument #1 ($array) must be of type array, string given +-- Iteration 18 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, string given --- Iteration 19 --array_intersect_assoc(): Argument #1 ($array) must be of type array, string given -array_intersect_assoc(): Argument #1 ($array) must be of type array, string given +-- Iteration 19 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, string given --- Iteration 20 --array_intersect_assoc(): Argument #1 ($array) must be of type array, string given -array_intersect_assoc(): Argument #1 ($array) must be of type array, string given +-- Iteration 20 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, string given --- Iteration 21 --array_intersect_assoc(): Argument #1 ($array) must be of type array, classA given -array_intersect_assoc(): Argument #1 ($array) must be of type array, classA given +-- Iteration 21 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, classA given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, classA given --- Iteration 22 --array_intersect_assoc(): Argument #1 ($array) must be of type array, null given -array_intersect_assoc(): Argument #1 ($array) must be of type array, null given +-- Iteration 22 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, null given --- Iteration 23 --array_intersect_assoc(): Argument #1 ($array) must be of type array, null given -array_intersect_assoc(): Argument #1 ($array) must be of type array, null given +-- Iteration 23 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, null given --- Iteration 24 --array_intersect_assoc(): Argument #1 ($array) must be of type array, resource given -array_intersect_assoc(): Argument #1 ($array) must be of type array, resource given +-- Iteration 24 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, resource given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, resource given Done diff --git a/ext/standard/tests/array/array_intersect_assoc_variation2.phpt b/ext/standard/tests/array/array_intersect_assoc_variation2.phpt index 31b54469863a..6eb285e6844b 100644 --- a/ext/standard/tests/array/array_intersect_assoc_variation2.phpt +++ b/ext/standard/tests/array/array_intersect_assoc_variation2.phpt @@ -92,15 +92,15 @@ foreach($arrays as $unexpected_value) { // Calling array_intersect_assoc() with default arguments try { var_dump( array_intersect_assoc($array1,$unexpected_value) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } // Calling array_intersect_assoc() with more arguments try { var_dump( array_intersect_assoc($array1, $unexpected_value, $arr3) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $iterator++; @@ -114,75 +114,75 @@ echo "Done"; --EXPECT-- *** Testing array_intersect_assoc() : Passing non-array values to $array2 argument *** --- Iteration 1 --array_intersect_assoc(): Argument #2 must be of type array, int given -array_intersect_assoc(): Argument #2 must be of type array, int given +-- Iteration 1 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, int given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, int given --- Iteration 2 --array_intersect_assoc(): Argument #2 must be of type array, int given -array_intersect_assoc(): Argument #2 must be of type array, int given +-- Iteration 2 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, int given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, int given --- Iteration 3 --array_intersect_assoc(): Argument #2 must be of type array, int given -array_intersect_assoc(): Argument #2 must be of type array, int given +-- Iteration 3 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, int given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, int given --- Iteration 4 --array_intersect_assoc(): Argument #2 must be of type array, int given -array_intersect_assoc(): Argument #2 must be of type array, int given +-- Iteration 4 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, int given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, int given --- Iteration 5 --array_intersect_assoc(): Argument #2 must be of type array, float given -array_intersect_assoc(): Argument #2 must be of type array, float given +-- Iteration 5 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, float given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, float given --- Iteration 6 --array_intersect_assoc(): Argument #2 must be of type array, float given -array_intersect_assoc(): Argument #2 must be of type array, float given +-- Iteration 6 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, float given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, float given --- Iteration 7 --array_intersect_assoc(): Argument #2 must be of type array, float given -array_intersect_assoc(): Argument #2 must be of type array, float given +-- Iteration 7 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, float given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, float given --- Iteration 8 --array_intersect_assoc(): Argument #2 must be of type array, float given -array_intersect_assoc(): Argument #2 must be of type array, float given +-- Iteration 8 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, float given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, float given --- Iteration 9 --array_intersect_assoc(): Argument #2 must be of type array, float given -array_intersect_assoc(): Argument #2 must be of type array, float given +-- Iteration 9 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, float given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, float given --- Iteration 10 --array_intersect_assoc(): Argument #2 must be of type array, null given -array_intersect_assoc(): Argument #2 must be of type array, null given +-- Iteration 10 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, null given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, null given --- Iteration 11 --array_intersect_assoc(): Argument #2 must be of type array, null given -array_intersect_assoc(): Argument #2 must be of type array, null given +-- Iteration 11 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, null given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, null given --- Iteration 12 --array_intersect_assoc(): Argument #2 must be of type array, true given -array_intersect_assoc(): Argument #2 must be of type array, true given +-- Iteration 12 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, true given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, true given --- Iteration 13 --array_intersect_assoc(): Argument #2 must be of type array, false given -array_intersect_assoc(): Argument #2 must be of type array, false given +-- Iteration 13 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, false given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, false given --- Iteration 14 --array_intersect_assoc(): Argument #2 must be of type array, true given -array_intersect_assoc(): Argument #2 must be of type array, true given +-- Iteration 14 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, true given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, true given --- Iteration 15 --array_intersect_assoc(): Argument #2 must be of type array, false given -array_intersect_assoc(): Argument #2 must be of type array, false given +-- Iteration 15 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, false given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, false given --- Iteration 16 --array_intersect_assoc(): Argument #2 must be of type array, string given -array_intersect_assoc(): Argument #2 must be of type array, string given +-- Iteration 16 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, string given --- Iteration 17 --array_intersect_assoc(): Argument #2 must be of type array, string given -array_intersect_assoc(): Argument #2 must be of type array, string given +-- Iteration 17 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, string given --- Iteration 18 --array_intersect_assoc(): Argument #2 must be of type array, string given -array_intersect_assoc(): Argument #2 must be of type array, string given +-- Iteration 18 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, string given --- Iteration 19 --array_intersect_assoc(): Argument #2 must be of type array, string given -array_intersect_assoc(): Argument #2 must be of type array, string given +-- Iteration 19 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, string given --- Iteration 20 --array_intersect_assoc(): Argument #2 must be of type array, string given -array_intersect_assoc(): Argument #2 must be of type array, string given +-- Iteration 20 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, string given --- Iteration 21 --array_intersect_assoc(): Argument #2 must be of type array, classA given -array_intersect_assoc(): Argument #2 must be of type array, classA given +-- Iteration 21 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, classA given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, classA given --- Iteration 22 --array_intersect_assoc(): Argument #2 must be of type array, null given -array_intersect_assoc(): Argument #2 must be of type array, null given +-- Iteration 22 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, null given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, null given --- Iteration 23 --array_intersect_assoc(): Argument #2 must be of type array, null given -array_intersect_assoc(): Argument #2 must be of type array, null given +-- Iteration 23 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, null given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, null given --- Iteration 24 --array_intersect_assoc(): Argument #2 must be of type array, resource given -array_intersect_assoc(): Argument #2 must be of type array, resource given +-- Iteration 24 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, resource given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, resource given Done diff --git a/ext/standard/tests/array/array_intersect_key_variation1.phpt b/ext/standard/tests/array/array_intersect_key_variation1.phpt index ae11e0a2ec93..d512018e93c0 100644 --- a/ext/standard/tests/array/array_intersect_key_variation1.phpt +++ b/ext/standard/tests/array/array_intersect_key_variation1.phpt @@ -91,13 +91,13 @@ foreach($inputs as $key =>$value) { echo "\n--$key--\n"; try { var_dump( array_intersect_key($value, $array2) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_intersect_key($value, $array2, $array3) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -107,105 +107,105 @@ fclose($fp); *** Testing array_intersect_key() : usage variation *** --int 0-- -array_intersect_key(): Argument #1 ($array) must be of type array, int given -array_intersect_key(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, int given --int 1-- -array_intersect_key(): Argument #1 ($array) must be of type array, int given -array_intersect_key(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, int given --int 12345-- -array_intersect_key(): Argument #1 ($array) must be of type array, int given -array_intersect_key(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, int given --int -12345-- -array_intersect_key(): Argument #1 ($array) must be of type array, int given -array_intersect_key(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, int given --float 10.5-- -array_intersect_key(): Argument #1 ($array) must be of type array, float given -array_intersect_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, float given --float -10.5-- -array_intersect_key(): Argument #1 ($array) must be of type array, float given -array_intersect_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, float given --float 12.3456789000e10-- -array_intersect_key(): Argument #1 ($array) must be of type array, float given -array_intersect_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, float given --float -12.3456789000e10-- -array_intersect_key(): Argument #1 ($array) must be of type array, float given -array_intersect_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, float given --float .5-- -array_intersect_key(): Argument #1 ($array) must be of type array, float given -array_intersect_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, float given --uppercase NULL-- -array_intersect_key(): Argument #1 ($array) must be of type array, null given -array_intersect_key(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, null given --lowercase null-- -array_intersect_key(): Argument #1 ($array) must be of type array, null given -array_intersect_key(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, null given --lowercase true-- -array_intersect_key(): Argument #1 ($array) must be of type array, true given -array_intersect_key(): Argument #1 ($array) must be of type array, true given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, true given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, true given --lowercase false-- -array_intersect_key(): Argument #1 ($array) must be of type array, false given -array_intersect_key(): Argument #1 ($array) must be of type array, false given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, false given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, false given --uppercase TRUE-- -array_intersect_key(): Argument #1 ($array) must be of type array, true given -array_intersect_key(): Argument #1 ($array) must be of type array, true given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, true given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, true given --uppercase FALSE-- -array_intersect_key(): Argument #1 ($array) must be of type array, false given -array_intersect_key(): Argument #1 ($array) must be of type array, false given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, false given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, false given --empty string DQ-- -array_intersect_key(): Argument #1 ($array) must be of type array, string given -array_intersect_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, string given --empty string SQ-- -array_intersect_key(): Argument #1 ($array) must be of type array, string given -array_intersect_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, string given --string DQ-- -array_intersect_key(): Argument #1 ($array) must be of type array, string given -array_intersect_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, string given --string SQ-- -array_intersect_key(): Argument #1 ($array) must be of type array, string given -array_intersect_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, string given --mixed case string-- -array_intersect_key(): Argument #1 ($array) must be of type array, string given -array_intersect_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, string given --heredoc-- -array_intersect_key(): Argument #1 ($array) must be of type array, string given -array_intersect_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, string given --instance of classWithToString-- -array_intersect_key(): Argument #1 ($array) must be of type array, classWithToString given -array_intersect_key(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, classWithToString given --instance of classWithoutToString-- -array_intersect_key(): Argument #1 ($array) must be of type array, classWithoutToString given -array_intersect_key(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, classWithoutToString given --undefined var-- -array_intersect_key(): Argument #1 ($array) must be of type array, null given -array_intersect_key(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, null given --unset var-- -array_intersect_key(): Argument #1 ($array) must be of type array, null given -array_intersect_key(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, null given --resource var-- -array_intersect_key(): Argument #1 ($array) must be of type array, resource given -array_intersect_key(): Argument #1 ($array) must be of type array, resource given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, resource given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, resource given diff --git a/ext/standard/tests/array/array_intersect_key_variation2.phpt b/ext/standard/tests/array/array_intersect_key_variation2.phpt index d2a8672e284c..faebe41bd129 100644 --- a/ext/standard/tests/array/array_intersect_key_variation2.phpt +++ b/ext/standard/tests/array/array_intersect_key_variation2.phpt @@ -92,13 +92,13 @@ foreach($inputs as $key =>$value) { echo "\n--$key--\n"; try { var_dump( array_intersect_key($array1, $value) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_intersect_key($array1, $value, $array3) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -108,105 +108,105 @@ fclose($fp); *** Testing array_intersect_key() : usage variation *** --int 0-- -array_intersect_key(): Argument #2 must be of type array, int given -array_intersect_key(): Argument #2 must be of type array, int given +TypeError: array_intersect_key(): Argument #2 must be of type array, int given +TypeError: array_intersect_key(): Argument #2 must be of type array, int given --int 1-- -array_intersect_key(): Argument #2 must be of type array, int given -array_intersect_key(): Argument #2 must be of type array, int given +TypeError: array_intersect_key(): Argument #2 must be of type array, int given +TypeError: array_intersect_key(): Argument #2 must be of type array, int given --int 12345-- -array_intersect_key(): Argument #2 must be of type array, int given -array_intersect_key(): Argument #2 must be of type array, int given +TypeError: array_intersect_key(): Argument #2 must be of type array, int given +TypeError: array_intersect_key(): Argument #2 must be of type array, int given --int -12345-- -array_intersect_key(): Argument #2 must be of type array, int given -array_intersect_key(): Argument #2 must be of type array, int given +TypeError: array_intersect_key(): Argument #2 must be of type array, int given +TypeError: array_intersect_key(): Argument #2 must be of type array, int given --float 10.5-- -array_intersect_key(): Argument #2 must be of type array, float given -array_intersect_key(): Argument #2 must be of type array, float given +TypeError: array_intersect_key(): Argument #2 must be of type array, float given +TypeError: array_intersect_key(): Argument #2 must be of type array, float given --float -10.5-- -array_intersect_key(): Argument #2 must be of type array, float given -array_intersect_key(): Argument #2 must be of type array, float given +TypeError: array_intersect_key(): Argument #2 must be of type array, float given +TypeError: array_intersect_key(): Argument #2 must be of type array, float given --float 12.3456789000e10-- -array_intersect_key(): Argument #2 must be of type array, float given -array_intersect_key(): Argument #2 must be of type array, float given +TypeError: array_intersect_key(): Argument #2 must be of type array, float given +TypeError: array_intersect_key(): Argument #2 must be of type array, float given --float -12.3456789000e10-- -array_intersect_key(): Argument #2 must be of type array, float given -array_intersect_key(): Argument #2 must be of type array, float given +TypeError: array_intersect_key(): Argument #2 must be of type array, float given +TypeError: array_intersect_key(): Argument #2 must be of type array, float given --float .5-- -array_intersect_key(): Argument #2 must be of type array, float given -array_intersect_key(): Argument #2 must be of type array, float given +TypeError: array_intersect_key(): Argument #2 must be of type array, float given +TypeError: array_intersect_key(): Argument #2 must be of type array, float given --uppercase NULL-- -array_intersect_key(): Argument #2 must be of type array, null given -array_intersect_key(): Argument #2 must be of type array, null given +TypeError: array_intersect_key(): Argument #2 must be of type array, null given +TypeError: array_intersect_key(): Argument #2 must be of type array, null given --lowercase null-- -array_intersect_key(): Argument #2 must be of type array, null given -array_intersect_key(): Argument #2 must be of type array, null given +TypeError: array_intersect_key(): Argument #2 must be of type array, null given +TypeError: array_intersect_key(): Argument #2 must be of type array, null given --lowercase true-- -array_intersect_key(): Argument #2 must be of type array, true given -array_intersect_key(): Argument #2 must be of type array, true given +TypeError: array_intersect_key(): Argument #2 must be of type array, true given +TypeError: array_intersect_key(): Argument #2 must be of type array, true given --lowercase false-- -array_intersect_key(): Argument #2 must be of type array, false given -array_intersect_key(): Argument #2 must be of type array, false given +TypeError: array_intersect_key(): Argument #2 must be of type array, false given +TypeError: array_intersect_key(): Argument #2 must be of type array, false given --uppercase TRUE-- -array_intersect_key(): Argument #2 must be of type array, true given -array_intersect_key(): Argument #2 must be of type array, true given +TypeError: array_intersect_key(): Argument #2 must be of type array, true given +TypeError: array_intersect_key(): Argument #2 must be of type array, true given --uppercase FALSE-- -array_intersect_key(): Argument #2 must be of type array, false given -array_intersect_key(): Argument #2 must be of type array, false given +TypeError: array_intersect_key(): Argument #2 must be of type array, false given +TypeError: array_intersect_key(): Argument #2 must be of type array, false given --empty string DQ-- -array_intersect_key(): Argument #2 must be of type array, string given -array_intersect_key(): Argument #2 must be of type array, string given +TypeError: array_intersect_key(): Argument #2 must be of type array, string given +TypeError: array_intersect_key(): Argument #2 must be of type array, string given --empty string SQ-- -array_intersect_key(): Argument #2 must be of type array, string given -array_intersect_key(): Argument #2 must be of type array, string given +TypeError: array_intersect_key(): Argument #2 must be of type array, string given +TypeError: array_intersect_key(): Argument #2 must be of type array, string given --string DQ-- -array_intersect_key(): Argument #2 must be of type array, string given -array_intersect_key(): Argument #2 must be of type array, string given +TypeError: array_intersect_key(): Argument #2 must be of type array, string given +TypeError: array_intersect_key(): Argument #2 must be of type array, string given --string SQ-- -array_intersect_key(): Argument #2 must be of type array, string given -array_intersect_key(): Argument #2 must be of type array, string given +TypeError: array_intersect_key(): Argument #2 must be of type array, string given +TypeError: array_intersect_key(): Argument #2 must be of type array, string given --mixed case string-- -array_intersect_key(): Argument #2 must be of type array, string given -array_intersect_key(): Argument #2 must be of type array, string given +TypeError: array_intersect_key(): Argument #2 must be of type array, string given +TypeError: array_intersect_key(): Argument #2 must be of type array, string given --heredoc-- -array_intersect_key(): Argument #2 must be of type array, string given -array_intersect_key(): Argument #2 must be of type array, string given +TypeError: array_intersect_key(): Argument #2 must be of type array, string given +TypeError: array_intersect_key(): Argument #2 must be of type array, string given --instance of classWithToString-- -array_intersect_key(): Argument #2 must be of type array, classWithToString given -array_intersect_key(): Argument #2 must be of type array, classWithToString given +TypeError: array_intersect_key(): Argument #2 must be of type array, classWithToString given +TypeError: array_intersect_key(): Argument #2 must be of type array, classWithToString given --instance of classWithoutToString-- -array_intersect_key(): Argument #2 must be of type array, classWithoutToString given -array_intersect_key(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_intersect_key(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_intersect_key(): Argument #2 must be of type array, classWithoutToString given --undefined var-- -array_intersect_key(): Argument #2 must be of type array, null given -array_intersect_key(): Argument #2 must be of type array, null given +TypeError: array_intersect_key(): Argument #2 must be of type array, null given +TypeError: array_intersect_key(): Argument #2 must be of type array, null given --unset var-- -array_intersect_key(): Argument #2 must be of type array, null given -array_intersect_key(): Argument #2 must be of type array, null given +TypeError: array_intersect_key(): Argument #2 must be of type array, null given +TypeError: array_intersect_key(): Argument #2 must be of type array, null given --resource var-- -array_intersect_key(): Argument #2 must be of type array, resource given -array_intersect_key(): Argument #2 must be of type array, resource given +TypeError: array_intersect_key(): Argument #2 must be of type array, resource given +TypeError: array_intersect_key(): Argument #2 must be of type array, resource given diff --git a/ext/standard/tests/array/array_intersect_uassoc_variation1.phpt b/ext/standard/tests/array/array_intersect_uassoc_variation1.phpt index ea6ce6a1a5a1..21e59e3b91f0 100644 --- a/ext/standard/tests/array/array_intersect_uassoc_variation1.phpt +++ b/ext/standard/tests/array/array_intersect_uassoc_variation1.phpt @@ -99,13 +99,13 @@ foreach($inputs as $key =>$value) { echo "\n--$key--\n"; try { var_dump( array_intersect_uassoc($value, $array2, 'key_compare_func') ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_intersect_uassoc($value, $array2, $array3, 'key_compare_func') ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -115,105 +115,105 @@ fclose($fp); *** Testing array_intersect_uassoc() : usage variation *** --int 0-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, int given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, int given --int 1-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, int given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, int given --int 12345-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, int given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, int given --int -12345-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, int given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, int given --float 10.5-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given --float -10.5-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given --float 12.3456789000e10-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given --float -12.3456789000e10-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given --float .5-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given --uppercase NULL-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, null given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, null given --lowercase null-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, null given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, null given --lowercase true-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, true given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, true given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, true given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, true given --lowercase false-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, false given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, false given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, false given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, false given --uppercase TRUE-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, true given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, true given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, true given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, true given --uppercase FALSE-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, false given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, false given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, false given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, false given --empty string DQ-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given --empty string SQ-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given --string DQ-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given --string SQ-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given --mixed case string-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given --heredoc-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given --instance of classWithToString-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, classWithToString given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, classWithToString given --instance of classWithoutToString-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, classWithoutToString given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, classWithoutToString given --undefined var-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, null given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, null given --unset var-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, null given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, null given --resource-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, resource given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, resource given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, resource given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, resource given diff --git a/ext/standard/tests/array/array_intersect_uassoc_variation2.phpt b/ext/standard/tests/array/array_intersect_uassoc_variation2.phpt index 03a7dc8d07e5..f95aab723942 100644 --- a/ext/standard/tests/array/array_intersect_uassoc_variation2.phpt +++ b/ext/standard/tests/array/array_intersect_uassoc_variation2.phpt @@ -99,13 +99,13 @@ foreach($inputs as $key =>$value) { echo "\n--$key--\n"; try { var_dump( array_intersect_uassoc($array1, $value, 'key_compare_func') ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_intersect_uassoc($array1, $value, $array3, 'key_compare_func') ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -115,105 +115,105 @@ fclose($fp); *** Testing array_intersect_uassoc() : usage variation *** --int 0-- -array_intersect_uassoc(): Argument #2 must be of type array, int given -array_intersect_uassoc(): Argument #2 must be of type array, int given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, int given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, int given --int 1-- -array_intersect_uassoc(): Argument #2 must be of type array, int given -array_intersect_uassoc(): Argument #2 must be of type array, int given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, int given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, int given --int 12345-- -array_intersect_uassoc(): Argument #2 must be of type array, int given -array_intersect_uassoc(): Argument #2 must be of type array, int given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, int given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, int given --int -12345-- -array_intersect_uassoc(): Argument #2 must be of type array, int given -array_intersect_uassoc(): Argument #2 must be of type array, int given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, int given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, int given --float 10.5-- -array_intersect_uassoc(): Argument #2 must be of type array, float given -array_intersect_uassoc(): Argument #2 must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, float given --float -10.5-- -array_intersect_uassoc(): Argument #2 must be of type array, float given -array_intersect_uassoc(): Argument #2 must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, float given --float 12.3456789000e10-- -array_intersect_uassoc(): Argument #2 must be of type array, float given -array_intersect_uassoc(): Argument #2 must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, float given --float -12.3456789000e10-- -array_intersect_uassoc(): Argument #2 must be of type array, float given -array_intersect_uassoc(): Argument #2 must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, float given --float .5-- -array_intersect_uassoc(): Argument #2 must be of type array, float given -array_intersect_uassoc(): Argument #2 must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, float given --uppercase NULL-- -array_intersect_uassoc(): Argument #2 must be of type array, null given -array_intersect_uassoc(): Argument #2 must be of type array, null given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, null given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, null given --lowercase null-- -array_intersect_uassoc(): Argument #2 must be of type array, null given -array_intersect_uassoc(): Argument #2 must be of type array, null given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, null given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, null given --lowercase true-- -array_intersect_uassoc(): Argument #2 must be of type array, true given -array_intersect_uassoc(): Argument #2 must be of type array, true given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, true given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, true given --lowercase false-- -array_intersect_uassoc(): Argument #2 must be of type array, false given -array_intersect_uassoc(): Argument #2 must be of type array, false given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, false given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, false given --uppercase TRUE-- -array_intersect_uassoc(): Argument #2 must be of type array, true given -array_intersect_uassoc(): Argument #2 must be of type array, true given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, true given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, true given --uppercase FALSE-- -array_intersect_uassoc(): Argument #2 must be of type array, false given -array_intersect_uassoc(): Argument #2 must be of type array, false given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, false given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, false given --empty string DQ-- -array_intersect_uassoc(): Argument #2 must be of type array, string given -array_intersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, string given --empty string SQ-- -array_intersect_uassoc(): Argument #2 must be of type array, string given -array_intersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, string given --string DQ-- -array_intersect_uassoc(): Argument #2 must be of type array, string given -array_intersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, string given --string SQ-- -array_intersect_uassoc(): Argument #2 must be of type array, string given -array_intersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, string given --mixed case string-- -array_intersect_uassoc(): Argument #2 must be of type array, string given -array_intersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, string given --heredoc-- -array_intersect_uassoc(): Argument #2 must be of type array, string given -array_intersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, string given --instance of classWithToString-- -array_intersect_uassoc(): Argument #2 must be of type array, classWithToString given -array_intersect_uassoc(): Argument #2 must be of type array, classWithToString given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, classWithToString given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, classWithToString given --instance of classWithoutToString-- -array_intersect_uassoc(): Argument #2 must be of type array, classWithoutToString given -array_intersect_uassoc(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, classWithoutToString given --undefined var-- -array_intersect_uassoc(): Argument #2 must be of type array, null given -array_intersect_uassoc(): Argument #2 must be of type array, null given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, null given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, null given --unset var-- -array_intersect_uassoc(): Argument #2 must be of type array, null given -array_intersect_uassoc(): Argument #2 must be of type array, null given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, null given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, null given --resource-- -array_intersect_uassoc(): Argument #2 must be of type array, resource given -array_intersect_uassoc(): Argument #2 must be of type array, resource given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, resource given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, resource given diff --git a/ext/standard/tests/array/array_intersect_ukey_variation1.phpt b/ext/standard/tests/array/array_intersect_ukey_variation1.phpt index 8195d45c294e..ab64cdd55efc 100644 --- a/ext/standard/tests/array/array_intersect_ukey_variation1.phpt +++ b/ext/standard/tests/array/array_intersect_ukey_variation1.phpt @@ -97,13 +97,13 @@ foreach($inputs as $key =>$value) { echo "\n--$key--\n"; try { var_dump( array_intersect_ukey($value, $array2, 'key_compare_func') ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_intersect_ukey($value, $array2, $array3, 'key_compare_func') ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -113,105 +113,105 @@ fclose($fp); *** Testing array_intersect_ukey() : usage variation *** --int 0-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, int given -array_intersect_ukey(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, int given --int 1-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, int given -array_intersect_ukey(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, int given --int 12345-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, int given -array_intersect_ukey(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, int given --int -12345-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, int given -array_intersect_ukey(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, int given --float 10.5-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, float given -array_intersect_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, float given --float -10.5-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, float given -array_intersect_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, float given --float 12.3456789000e10-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, float given -array_intersect_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, float given --float -12.3456789000e10-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, float given -array_intersect_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, float given --float .5-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, float given -array_intersect_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, float given --uppercase NULL-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, null given -array_intersect_ukey(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, null given --lowercase null-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, null given -array_intersect_ukey(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, null given --lowercase true-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, true given -array_intersect_ukey(): Argument #1 ($array) must be of type array, true given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, true given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, true given --lowercase false-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, false given -array_intersect_ukey(): Argument #1 ($array) must be of type array, false given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, false given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, false given --uppercase TRUE-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, true given -array_intersect_ukey(): Argument #1 ($array) must be of type array, true given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, true given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, true given --uppercase FALSE-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, false given -array_intersect_ukey(): Argument #1 ($array) must be of type array, false given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, false given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, false given --empty string DQ-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, string given -array_intersect_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, string given --empty string SQ-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, string given -array_intersect_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, string given --string DQ-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, string given -array_intersect_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, string given --string SQ-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, string given -array_intersect_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, string given --mixed case string-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, string given -array_intersect_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, string given --heredoc-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, string given -array_intersect_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, string given --instance of classWithToString-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, classWithToString given -array_intersect_ukey(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, classWithToString given --instance of classWithoutToString-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, classWithoutToString given -array_intersect_ukey(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, classWithoutToString given --undefined var-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, null given -array_intersect_ukey(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, null given --unset var-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, null given -array_intersect_ukey(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, null given --resource var-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, resource given -array_intersect_ukey(): Argument #1 ($array) must be of type array, resource given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, resource given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, resource given diff --git a/ext/standard/tests/array/array_intersect_ukey_variation2.phpt b/ext/standard/tests/array/array_intersect_ukey_variation2.phpt index d32c0632ca5e..849cfa3435bd 100644 --- a/ext/standard/tests/array/array_intersect_ukey_variation2.phpt +++ b/ext/standard/tests/array/array_intersect_ukey_variation2.phpt @@ -97,13 +97,13 @@ foreach($inputs as $key =>$value) { echo "\n--$key--\n"; try { var_dump( array_intersect_ukey($array1, $value, 'key_compare_func') ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_intersect_ukey($array1, $value, $array3, 'key_compare_func') ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -113,105 +113,105 @@ fclose($fp); *** Testing array_intersect_ukey() : usage variation *** --int 0-- -array_intersect_ukey(): Argument #2 must be of type array, int given -array_intersect_ukey(): Argument #2 must be of type array, int given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, int given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, int given --int 1-- -array_intersect_ukey(): Argument #2 must be of type array, int given -array_intersect_ukey(): Argument #2 must be of type array, int given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, int given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, int given --int 12345-- -array_intersect_ukey(): Argument #2 must be of type array, int given -array_intersect_ukey(): Argument #2 must be of type array, int given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, int given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, int given --int -12345-- -array_intersect_ukey(): Argument #2 must be of type array, int given -array_intersect_ukey(): Argument #2 must be of type array, int given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, int given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, int given --float 10.5-- -array_intersect_ukey(): Argument #2 must be of type array, float given -array_intersect_ukey(): Argument #2 must be of type array, float given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, float given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, float given --float -10.5-- -array_intersect_ukey(): Argument #2 must be of type array, float given -array_intersect_ukey(): Argument #2 must be of type array, float given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, float given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, float given --float 12.3456789000e10-- -array_intersect_ukey(): Argument #2 must be of type array, float given -array_intersect_ukey(): Argument #2 must be of type array, float given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, float given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, float given --float -12.3456789000e10-- -array_intersect_ukey(): Argument #2 must be of type array, float given -array_intersect_ukey(): Argument #2 must be of type array, float given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, float given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, float given --float .5-- -array_intersect_ukey(): Argument #2 must be of type array, float given -array_intersect_ukey(): Argument #2 must be of type array, float given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, float given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, float given --uppercase NULL-- -array_intersect_ukey(): Argument #2 must be of type array, null given -array_intersect_ukey(): Argument #2 must be of type array, null given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, null given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, null given --lowercase null-- -array_intersect_ukey(): Argument #2 must be of type array, null given -array_intersect_ukey(): Argument #2 must be of type array, null given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, null given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, null given --lowercase true-- -array_intersect_ukey(): Argument #2 must be of type array, true given -array_intersect_ukey(): Argument #2 must be of type array, true given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, true given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, true given --lowercase false-- -array_intersect_ukey(): Argument #2 must be of type array, false given -array_intersect_ukey(): Argument #2 must be of type array, false given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, false given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, false given --uppercase TRUE-- -array_intersect_ukey(): Argument #2 must be of type array, true given -array_intersect_ukey(): Argument #2 must be of type array, true given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, true given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, true given --uppercase FALSE-- -array_intersect_ukey(): Argument #2 must be of type array, false given -array_intersect_ukey(): Argument #2 must be of type array, false given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, false given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, false given --empty string DQ-- -array_intersect_ukey(): Argument #2 must be of type array, string given -array_intersect_ukey(): Argument #2 must be of type array, string given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, string given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, string given --empty string SQ-- -array_intersect_ukey(): Argument #2 must be of type array, string given -array_intersect_ukey(): Argument #2 must be of type array, string given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, string given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, string given --string DQ-- -array_intersect_ukey(): Argument #2 must be of type array, string given -array_intersect_ukey(): Argument #2 must be of type array, string given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, string given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, string given --string SQ-- -array_intersect_ukey(): Argument #2 must be of type array, string given -array_intersect_ukey(): Argument #2 must be of type array, string given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, string given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, string given --mixed case string-- -array_intersect_ukey(): Argument #2 must be of type array, string given -array_intersect_ukey(): Argument #2 must be of type array, string given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, string given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, string given --heredoc-- -array_intersect_ukey(): Argument #2 must be of type array, string given -array_intersect_ukey(): Argument #2 must be of type array, string given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, string given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, string given --instance of classWithToString-- -array_intersect_ukey(): Argument #2 must be of type array, classWithToString given -array_intersect_ukey(): Argument #2 must be of type array, classWithToString given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, classWithToString given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, classWithToString given --instance of classWithoutToString-- -array_intersect_ukey(): Argument #2 must be of type array, classWithoutToString given -array_intersect_ukey(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, classWithoutToString given --undefined var-- -array_intersect_ukey(): Argument #2 must be of type array, null given -array_intersect_ukey(): Argument #2 must be of type array, null given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, null given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, null given --unset var-- -array_intersect_ukey(): Argument #2 must be of type array, null given -array_intersect_ukey(): Argument #2 must be of type array, null given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, null given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, null given --resource var-- -array_intersect_ukey(): Argument #2 must be of type array, resource given -array_intersect_ukey(): Argument #2 must be of type array, resource given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, resource given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, resource given diff --git a/ext/standard/tests/array/array_intersect_ukey_variation8.phpt b/ext/standard/tests/array/array_intersect_ukey_variation8.phpt index 71126a1eddfa..c9c396cb7f14 100644 --- a/ext/standard/tests/array/array_intersect_ukey_variation8.phpt +++ b/ext/standard/tests/array/array_intersect_ukey_variation8.phpt @@ -11,19 +11,19 @@ $array2 = array('green' => 5, 'blue' => 6, 'yellow' => 7, 'cyan' => 8); //function name within double quotes try { var_dump( array_intersect_ukey($array1, $array2, "unknown_function") ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } //function name within single quotes try { var_dump( array_intersect_ukey($array1, $array2, 'unknown_function') ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- *** Testing array_intersect_ukey() : usage variation *** -array_intersect_ukey(): Argument #3 must be a valid callback, function "unknown_function" not found or invalid function name -array_intersect_ukey(): Argument #3 must be a valid callback, function "unknown_function" not found or invalid function name +TypeError: array_intersect_ukey(): Argument #3 must be a valid callback, function "unknown_function" not found or invalid function name +TypeError: array_intersect_ukey(): Argument #3 must be a valid callback, function "unknown_function" not found or invalid function name diff --git a/ext/standard/tests/array/array_intersect_variation1.phpt b/ext/standard/tests/array/array_intersect_variation1.phpt index 733250b69f70..34d11d5a9677 100644 --- a/ext/standard/tests/array/array_intersect_variation1.phpt +++ b/ext/standard/tests/array/array_intersect_variation1.phpt @@ -92,15 +92,15 @@ foreach($arrays as $unexpected_value) { // Calling array_intersect() with default arguments try { var_dump( array_intersect($unexpected_value,$array2) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } // Calling array_intersect() with more arguments try { var_dump( array_intersect($unexpected_value, $array2, $arr3) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $iterator++; } @@ -113,75 +113,75 @@ echo "Done"; --EXPECT-- *** Testing array_intersect() : Passing non-array values to $array1 argument *** --- Iterator 1 --array_intersect(): Argument #1 ($array) must be of type array, int given -array_intersect(): Argument #1 ($array) must be of type array, int given +-- Iterator 1 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, int given --- Iterator 2 --array_intersect(): Argument #1 ($array) must be of type array, int given -array_intersect(): Argument #1 ($array) must be of type array, int given +-- Iterator 2 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, int given --- Iterator 3 --array_intersect(): Argument #1 ($array) must be of type array, int given -array_intersect(): Argument #1 ($array) must be of type array, int given +-- Iterator 3 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, int given --- Iterator 4 --array_intersect(): Argument #1 ($array) must be of type array, int given -array_intersect(): Argument #1 ($array) must be of type array, int given +-- Iterator 4 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, int given --- Iterator 5 --array_intersect(): Argument #1 ($array) must be of type array, float given -array_intersect(): Argument #1 ($array) must be of type array, float given +-- Iterator 5 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, float given --- Iterator 6 --array_intersect(): Argument #1 ($array) must be of type array, float given -array_intersect(): Argument #1 ($array) must be of type array, float given +-- Iterator 6 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, float given --- Iterator 7 --array_intersect(): Argument #1 ($array) must be of type array, float given -array_intersect(): Argument #1 ($array) must be of type array, float given +-- Iterator 7 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, float given --- Iterator 8 --array_intersect(): Argument #1 ($array) must be of type array, float given -array_intersect(): Argument #1 ($array) must be of type array, float given +-- Iterator 8 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, float given --- Iterator 9 --array_intersect(): Argument #1 ($array) must be of type array, float given -array_intersect(): Argument #1 ($array) must be of type array, float given +-- Iterator 9 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, float given --- Iterator 10 --array_intersect(): Argument #1 ($array) must be of type array, null given -array_intersect(): Argument #1 ($array) must be of type array, null given +-- Iterator 10 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, null given --- Iterator 11 --array_intersect(): Argument #1 ($array) must be of type array, null given -array_intersect(): Argument #1 ($array) must be of type array, null given +-- Iterator 11 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, null given --- Iterator 12 --array_intersect(): Argument #1 ($array) must be of type array, true given -array_intersect(): Argument #1 ($array) must be of type array, true given +-- Iterator 12 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, true given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, true given --- Iterator 13 --array_intersect(): Argument #1 ($array) must be of type array, false given -array_intersect(): Argument #1 ($array) must be of type array, false given +-- Iterator 13 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, false given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, false given --- Iterator 14 --array_intersect(): Argument #1 ($array) must be of type array, true given -array_intersect(): Argument #1 ($array) must be of type array, true given +-- Iterator 14 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, true given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, true given --- Iterator 15 --array_intersect(): Argument #1 ($array) must be of type array, false given -array_intersect(): Argument #1 ($array) must be of type array, false given +-- Iterator 15 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, false given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, false given --- Iterator 16 --array_intersect(): Argument #1 ($array) must be of type array, string given -array_intersect(): Argument #1 ($array) must be of type array, string given +-- Iterator 16 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, string given --- Iterator 17 --array_intersect(): Argument #1 ($array) must be of type array, string given -array_intersect(): Argument #1 ($array) must be of type array, string given +-- Iterator 17 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, string given --- Iterator 18 --array_intersect(): Argument #1 ($array) must be of type array, string given -array_intersect(): Argument #1 ($array) must be of type array, string given +-- Iterator 18 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, string given --- Iterator 19 --array_intersect(): Argument #1 ($array) must be of type array, string given -array_intersect(): Argument #1 ($array) must be of type array, string given +-- Iterator 19 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, string given --- Iterator 20 --array_intersect(): Argument #1 ($array) must be of type array, string given -array_intersect(): Argument #1 ($array) must be of type array, string given +-- Iterator 20 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, string given --- Iterator 21 --array_intersect(): Argument #1 ($array) must be of type array, classA given -array_intersect(): Argument #1 ($array) must be of type array, classA given +-- Iterator 21 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, classA given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, classA given --- Iterator 22 --array_intersect(): Argument #1 ($array) must be of type array, null given -array_intersect(): Argument #1 ($array) must be of type array, null given +-- Iterator 22 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, null given --- Iterator 23 --array_intersect(): Argument #1 ($array) must be of type array, null given -array_intersect(): Argument #1 ($array) must be of type array, null given +-- Iterator 23 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, null given --- Iterator 24 --array_intersect(): Argument #1 ($array) must be of type array, resource given -array_intersect(): Argument #1 ($array) must be of type array, resource given +-- Iterator 24 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, resource given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, resource given Done diff --git a/ext/standard/tests/array/array_intersect_variation2.phpt b/ext/standard/tests/array/array_intersect_variation2.phpt index b09683446b87..08a689685bb7 100644 --- a/ext/standard/tests/array/array_intersect_variation2.phpt +++ b/ext/standard/tests/array/array_intersect_variation2.phpt @@ -92,15 +92,15 @@ foreach($arrays as $unexpected_value) { // Calling array_intersect() with default arguments try { var_dump( array_intersect($array1,$unexpected_value) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } // Calling array_intersect() with more arguments try { var_dump( array_intersect($array1, $unexpected_value, $arr3) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $iterator++; @@ -114,75 +114,75 @@ echo "Done"; --EXPECT-- *** Testing array_intersect() : Passing non-array values to $array2 argument *** --- Iterator 1 --array_intersect(): Argument #2 must be of type array, int given -array_intersect(): Argument #2 must be of type array, int given +-- Iterator 1 --TypeError: array_intersect(): Argument #2 must be of type array, int given +TypeError: array_intersect(): Argument #2 must be of type array, int given --- Iterator 2 --array_intersect(): Argument #2 must be of type array, int given -array_intersect(): Argument #2 must be of type array, int given +-- Iterator 2 --TypeError: array_intersect(): Argument #2 must be of type array, int given +TypeError: array_intersect(): Argument #2 must be of type array, int given --- Iterator 3 --array_intersect(): Argument #2 must be of type array, int given -array_intersect(): Argument #2 must be of type array, int given +-- Iterator 3 --TypeError: array_intersect(): Argument #2 must be of type array, int given +TypeError: array_intersect(): Argument #2 must be of type array, int given --- Iterator 4 --array_intersect(): Argument #2 must be of type array, int given -array_intersect(): Argument #2 must be of type array, int given +-- Iterator 4 --TypeError: array_intersect(): Argument #2 must be of type array, int given +TypeError: array_intersect(): Argument #2 must be of type array, int given --- Iterator 5 --array_intersect(): Argument #2 must be of type array, float given -array_intersect(): Argument #2 must be of type array, float given +-- Iterator 5 --TypeError: array_intersect(): Argument #2 must be of type array, float given +TypeError: array_intersect(): Argument #2 must be of type array, float given --- Iterator 6 --array_intersect(): Argument #2 must be of type array, float given -array_intersect(): Argument #2 must be of type array, float given +-- Iterator 6 --TypeError: array_intersect(): Argument #2 must be of type array, float given +TypeError: array_intersect(): Argument #2 must be of type array, float given --- Iterator 7 --array_intersect(): Argument #2 must be of type array, float given -array_intersect(): Argument #2 must be of type array, float given +-- Iterator 7 --TypeError: array_intersect(): Argument #2 must be of type array, float given +TypeError: array_intersect(): Argument #2 must be of type array, float given --- Iterator 8 --array_intersect(): Argument #2 must be of type array, float given -array_intersect(): Argument #2 must be of type array, float given +-- Iterator 8 --TypeError: array_intersect(): Argument #2 must be of type array, float given +TypeError: array_intersect(): Argument #2 must be of type array, float given --- Iterator 9 --array_intersect(): Argument #2 must be of type array, float given -array_intersect(): Argument #2 must be of type array, float given +-- Iterator 9 --TypeError: array_intersect(): Argument #2 must be of type array, float given +TypeError: array_intersect(): Argument #2 must be of type array, float given --- Iterator 10 --array_intersect(): Argument #2 must be of type array, null given -array_intersect(): Argument #2 must be of type array, null given +-- Iterator 10 --TypeError: array_intersect(): Argument #2 must be of type array, null given +TypeError: array_intersect(): Argument #2 must be of type array, null given --- Iterator 11 --array_intersect(): Argument #2 must be of type array, null given -array_intersect(): Argument #2 must be of type array, null given +-- Iterator 11 --TypeError: array_intersect(): Argument #2 must be of type array, null given +TypeError: array_intersect(): Argument #2 must be of type array, null given --- Iterator 12 --array_intersect(): Argument #2 must be of type array, true given -array_intersect(): Argument #2 must be of type array, true given +-- Iterator 12 --TypeError: array_intersect(): Argument #2 must be of type array, true given +TypeError: array_intersect(): Argument #2 must be of type array, true given --- Iterator 13 --array_intersect(): Argument #2 must be of type array, false given -array_intersect(): Argument #2 must be of type array, false given +-- Iterator 13 --TypeError: array_intersect(): Argument #2 must be of type array, false given +TypeError: array_intersect(): Argument #2 must be of type array, false given --- Iterator 14 --array_intersect(): Argument #2 must be of type array, true given -array_intersect(): Argument #2 must be of type array, true given +-- Iterator 14 --TypeError: array_intersect(): Argument #2 must be of type array, true given +TypeError: array_intersect(): Argument #2 must be of type array, true given --- Iterator 15 --array_intersect(): Argument #2 must be of type array, false given -array_intersect(): Argument #2 must be of type array, false given +-- Iterator 15 --TypeError: array_intersect(): Argument #2 must be of type array, false given +TypeError: array_intersect(): Argument #2 must be of type array, false given --- Iterator 16 --array_intersect(): Argument #2 must be of type array, string given -array_intersect(): Argument #2 must be of type array, string given +-- Iterator 16 --TypeError: array_intersect(): Argument #2 must be of type array, string given +TypeError: array_intersect(): Argument #2 must be of type array, string given --- Iterator 17 --array_intersect(): Argument #2 must be of type array, string given -array_intersect(): Argument #2 must be of type array, string given +-- Iterator 17 --TypeError: array_intersect(): Argument #2 must be of type array, string given +TypeError: array_intersect(): Argument #2 must be of type array, string given --- Iterator 18 --array_intersect(): Argument #2 must be of type array, string given -array_intersect(): Argument #2 must be of type array, string given +-- Iterator 18 --TypeError: array_intersect(): Argument #2 must be of type array, string given +TypeError: array_intersect(): Argument #2 must be of type array, string given --- Iterator 19 --array_intersect(): Argument #2 must be of type array, string given -array_intersect(): Argument #2 must be of type array, string given +-- Iterator 19 --TypeError: array_intersect(): Argument #2 must be of type array, string given +TypeError: array_intersect(): Argument #2 must be of type array, string given --- Iterator 20 --array_intersect(): Argument #2 must be of type array, string given -array_intersect(): Argument #2 must be of type array, string given +-- Iterator 20 --TypeError: array_intersect(): Argument #2 must be of type array, string given +TypeError: array_intersect(): Argument #2 must be of type array, string given --- Iterator 21 --array_intersect(): Argument #2 must be of type array, classA given -array_intersect(): Argument #2 must be of type array, classA given +-- Iterator 21 --TypeError: array_intersect(): Argument #2 must be of type array, classA given +TypeError: array_intersect(): Argument #2 must be of type array, classA given --- Iterator 22 --array_intersect(): Argument #2 must be of type array, null given -array_intersect(): Argument #2 must be of type array, null given +-- Iterator 22 --TypeError: array_intersect(): Argument #2 must be of type array, null given +TypeError: array_intersect(): Argument #2 must be of type array, null given --- Iterator 23 --array_intersect(): Argument #2 must be of type array, null given -array_intersect(): Argument #2 must be of type array, null given +-- Iterator 23 --TypeError: array_intersect(): Argument #2 must be of type array, null given +TypeError: array_intersect(): Argument #2 must be of type array, null given --- Iterator 24 --array_intersect(): Argument #2 must be of type array, resource given -array_intersect(): Argument #2 must be of type array, resource given +-- Iterator 24 --TypeError: array_intersect(): Argument #2 must be of type array, resource given +TypeError: array_intersect(): Argument #2 must be of type array, resource given Done diff --git a/ext/standard/tests/array/array_key_exists.phpt b/ext/standard/tests/array/array_key_exists.phpt index 92373b04bb45..0960bf765843 100644 --- a/ext/standard/tests/array/array_key_exists.phpt +++ b/ext/standard/tests/array/array_key_exists.phpt @@ -63,8 +63,8 @@ echo "\n*** Testing error conditions ***\n"; // first args as array try { array_key_exists(array(), array()); -} catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\n*** Testing operation on objects ***\n"; @@ -76,8 +76,8 @@ class key_check $key_check_obj = new key_check; //new object try { var_dump(array_key_exists("public_var", $key_check_obj)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -250,8 +250,8 @@ bool(false) bool(true) *** Testing error conditions *** -Cannot access offset of type array on array +TypeError: Cannot access offset of type array on array *** Testing operation on objects *** -array_key_exists(): Argument #2 ($array) must be of type array, key_check given +TypeError: array_key_exists(): Argument #2 ($array) must be of type array, key_check given Done diff --git a/ext/standard/tests/array/array_key_exists_variation1.phpt b/ext/standard/tests/array/array_key_exists_variation1.phpt index d12fbc839b79..366171d4cbbd 100644 --- a/ext/standard/tests/array/array_key_exists_variation1.phpt +++ b/ext/standard/tests/array/array_key_exists_variation1.phpt @@ -79,8 +79,8 @@ foreach($inputs as $input) { echo "\n-- Iteration $iterator --\n"; try { var_dump( array_key_exists($input, $search) ); - } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $iterator++; }; @@ -133,7 +133,7 @@ bool(false) bool(false) -- Iteration 13 -- -Cannot access offset of type array on array +TypeError: Cannot access offset of type array on array -- Iteration 14 -- bool(true) @@ -145,7 +145,7 @@ bool(true) bool(true) -- Iteration 17 -- -Cannot access offset of type classA on array +TypeError: Cannot access offset of type classA on array -- Iteration 18 -- diff --git a/ext/standard/tests/array/array_key_exists_variation3.phpt b/ext/standard/tests/array/array_key_exists_variation3.phpt index 5abff19378fd..6cdfbd4a4dbd 100644 --- a/ext/standard/tests/array/array_key_exists_variation3.phpt +++ b/ext/standard/tests/array/array_key_exists_variation3.phpt @@ -19,8 +19,8 @@ foreach($keys as $key) { echo "Pass float as \$key:\n"; try { var_dump(array_key_exists($key, $search)); - } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Cast float to int:\n"; var_dump(array_key_exists((int)$key, $search)); diff --git a/ext/standard/tests/array/array_map_error.phpt b/ext/standard/tests/array/array_map_error.phpt index 7d1d6986aba5..e95984697381 100644 --- a/ext/standard/tests/array/array_map_error.phpt +++ b/ext/standard/tests/array/array_map_error.phpt @@ -12,7 +12,7 @@ function callback1() { try { var_dump( array_map('callback1') ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing array_map() function with less no. of arrays than callback function arguments --\n"; @@ -23,7 +23,7 @@ function callback2($p, $q) { try { var_dump( array_map('callback2', $arr1) ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing array_map() function with more no. of arrays than callback function arguments --\n"; @@ -37,10 +37,10 @@ echo "Done"; *** Testing array_map() : error conditions *** -- Testing array_map() function with one less than expected no. of arguments -- -Exception: array_map() expects at least 2 arguments, 1 given +ArgumentCountError: array_map() expects at least 2 arguments, 1 given -- Testing array_map() function with less no. of arrays than callback function arguments -- -Exception: Too few arguments to function callback2(), 1 passed and exactly 2 expected +ArgumentCountError: Too few arguments to function callback2(), 1 passed and exactly 2 expected -- Testing array_map() function with more no. of arrays than callback function arguments -- array(2) { diff --git a/ext/standard/tests/array/array_map_object1.phpt b/ext/standard/tests/array/array_map_object1.phpt index d86919bf9c4e..2923d7384153 100644 --- a/ext/standard/tests/array/array_map_object1.phpt +++ b/ext/standard/tests/array/array_map_object1.phpt @@ -25,8 +25,8 @@ function test($cb, $args) { echo join('::', $cb) . "\n"; try { var_dump(array_map($cb, $args)); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } test(array('SimpleClass', 'square'), array(1, 2)); @@ -132,15 +132,15 @@ array(2) { -- simple class with private variable and method -- SimpleClassPri::add -array_map(): Argument #1 ($callback) must be a valid callback or null, cannot access private method SimpleClassPri::add() +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, cannot access private method SimpleClassPri::add() -- simple class with protected variable and method -- SimpleClassPro::mul -array_map(): Argument #1 ($callback) must be a valid callback or null, cannot access protected method SimpleClassPro::mul() +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, cannot access protected method SimpleClassPro::mul() -- class without members -- EmptyClass -array_map(): Argument #1 ($callback) must be a valid callback or null, array callback must have exactly two members +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, array callback must have exactly two members -- abstract class -- ChildClass::emptyFunction @@ -173,9 +173,9 @@ array(2) { int(4) } StaticClass::cube -array_map(): Argument #1 ($callback) must be a valid callback or null, cannot access private method StaticClass::cube() +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, cannot access private method StaticClass::cube() StaticClass::retVal -array_map(): Argument #1 ($callback) must be a valid callback or null, cannot access protected method StaticClass::retVal() +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, cannot access protected method StaticClass::retVal() -- class implementing an interface -- InterClass::square array(2) { diff --git a/ext/standard/tests/array/array_map_object2.phpt b/ext/standard/tests/array/array_map_object2.phpt index 3b9666ce50ac..ef87cadf9258 100644 --- a/ext/standard/tests/array/array_map_object2.phpt +++ b/ext/standard/tests/array/array_map_object2.phpt @@ -23,15 +23,15 @@ class SimpleClass echo "-- with non-existent class --\n"; try { var_dump( array_map(array('non-existent', 'square'), array(1, 2)) ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- with existent class and non-existent method --\n"; try { var_dump( array_map(array('SimpleClass', 'non-existent'), array(1, 2)) ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done"; @@ -39,7 +39,7 @@ echo "Done"; --EXPECT-- *** Testing array_map() : with non-existent class and method *** -- with non-existent class -- -array_map(): Argument #1 ($callback) must be a valid callback or null, class "non-existent" not found +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, class "non-existent" not found -- with existent class and non-existent method -- -array_map(): Argument #1 ($callback) must be a valid callback or null, class SimpleClass does not have a method "non-existent" +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, class SimpleClass does not have a method "non-existent" Done diff --git a/ext/standard/tests/array/array_map_object3.phpt b/ext/standard/tests/array/array_map_object3.phpt index 55a97a317f2a..019b53fb2399 100644 --- a/ext/standard/tests/array/array_map_object3.phpt +++ b/ext/standard/tests/array/array_map_object3.phpt @@ -48,8 +48,8 @@ var_dump( array_map(array('ChildClass', 'staticParent1'), $arr1) ); echo "-- accessing child method from parent class --\n"; try { var_dump( array_map(array('ParentClass', 'staticChild'), $arr1) ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- accessing parent method using child class object --\n"; @@ -58,8 +58,8 @@ var_dump( array_map(array($childobj, 'staticParent1'), $arr1) ); echo "-- accessing child method using parent class object --\n"; try { var_dump( array_map(array($parentobj, 'staticChild'), $arr1) ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done"; @@ -76,7 +76,7 @@ array(3) { int(7) } -- accessing child method from parent class -- -array_map(): Argument #1 ($callback) must be a valid callback or null, class ParentClass does not have a method "staticChild" +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, class ParentClass does not have a method "staticChild" -- accessing parent method using child class object -- array(3) { [0]=> @@ -87,5 +87,5 @@ array(3) { int(7) } -- accessing child method using parent class object -- -array_map(): Argument #1 ($callback) must be a valid callback or null, class ParentClass does not have a method "staticChild" +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, class ParentClass does not have a method "staticChild" Done diff --git a/ext/standard/tests/array/array_map_variation10.phpt b/ext/standard/tests/array/array_map_variation10.phpt index 2f7bac4c9146..abd6d53063a9 100644 --- a/ext/standard/tests/array/array_map_variation10.phpt +++ b/ext/standard/tests/array/array_map_variation10.phpt @@ -18,7 +18,7 @@ echo "-- anonymous function with two parameters and passing one array --\n"; try { var_dump( array_map( function($a, $b) { return array($a, $b); }, $array1)); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- anonymous function with NULL parameter --\n"; @@ -30,8 +30,8 @@ var_dump( array_map( function($a) { }, $array1)); echo "-- passing NULL as 'array1' --\n"; try { var_dump( array_map( function($a) { return array($a); }, NULL)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done"; @@ -63,7 +63,7 @@ array(3) { } } -- anonymous function with two parameters and passing one array -- -Exception: Too few arguments to function {closure:%s:%d}(), 1 passed and exactly 2 expected +ArgumentCountError: Too few arguments to function {closure:%s:%d}(), 1 passed and exactly 2 expected -- anonymous function with NULL parameter -- array(3) { [0]=> @@ -83,5 +83,5 @@ array(3) { NULL } -- passing NULL as 'array1' -- -array_map(): Argument #2 ($array) must be of type array, null given +TypeError: array_map(): Argument #2 ($array) must be of type array, null given Done diff --git a/ext/standard/tests/array/array_map_variation12.phpt b/ext/standard/tests/array/array_map_variation12.phpt index d3fa62e93d67..df8aba9d7017 100644 --- a/ext/standard/tests/array/array_map_variation12.phpt +++ b/ext/standard/tests/array/array_map_variation12.phpt @@ -17,15 +17,15 @@ var_dump( array_map('pow', $array1, $array2)); echo "-- with built-in function 'pow' and one parameter --\n"; try { var_dump( array_map('pow', $array1)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- with language construct --\n"; try { var_dump( array_map('echo', $array1)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done"; @@ -42,7 +42,7 @@ array(3) { int(243) } -- with built-in function 'pow' and one parameter -- -pow() expects exactly 2 arguments, 1 given +ArgumentCountError: pow() expects exactly 2 arguments, 1 given -- with language construct -- -array_map(): Argument #1 ($callback) must be a valid callback or null, function "echo" not found or invalid function name +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "echo" not found or invalid function name Done diff --git a/ext/standard/tests/array/array_map_variation14.phpt b/ext/standard/tests/array/array_map_variation14.phpt index d8977e73acd4..22d59c70a572 100644 --- a/ext/standard/tests/array/array_map_variation14.phpt +++ b/ext/standard/tests/array/array_map_variation14.phpt @@ -33,15 +33,15 @@ var_dump( array_map(@$undefined_var, $arr1) ); echo "-- with empty string --\n"; try { var_dump( array_map("", $arr1, $arr2) ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- with empty array --\n"; try { var_dump( array_map(array(), $arr1, $arr2) ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done"; @@ -118,7 +118,7 @@ array(2) { int(2) } -- with empty string -- -array_map(): Argument #1 ($callback) must be a valid callback or null, function "" not found or invalid function name +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "" not found or invalid function name -- with empty array -- -array_map(): Argument #1 ($callback) must be a valid callback or null, array callback must have exactly two members +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, array callback must have exactly two members Done diff --git a/ext/standard/tests/array/array_map_variation15.phpt b/ext/standard/tests/array/array_map_variation15.phpt index d053a7204639..d9da6ed4290c 100644 --- a/ext/standard/tests/array/array_map_variation15.phpt +++ b/ext/standard/tests/array/array_map_variation15.phpt @@ -15,13 +15,13 @@ $arr3 = array(1.1, 2.2); try { var_dump( array_map('non_existent', $arr1, $arr2, $arr3) ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done"; ?> --EXPECT-- *** Testing array_map() : non existent 'callback' function *** -array_map(): Argument #1 ($callback) must be a valid callback or null, function "non_existent" not found or invalid function name +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "non_existent" not found or invalid function name Done diff --git a/ext/standard/tests/array/array_map_variation16.phpt b/ext/standard/tests/array/array_map_variation16.phpt index 7ee1f04967c5..e355f796ebcf 100644 --- a/ext/standard/tests/array/array_map_variation16.phpt +++ b/ext/standard/tests/array/array_map_variation16.phpt @@ -20,19 +20,19 @@ foreach($callbacks as $callback) { try { var_dump( array_map($callback, $arg) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } echo "Done"; ?> --EXPECT-- -array_map(): Argument #1 ($callback) must be a valid callback or null, function "echo" not found or invalid function name -array_map(): Argument #1 ($callback) must be a valid callback or null, function "array" not found or invalid function name -array_map(): Argument #1 ($callback) must be a valid callback or null, function "empty" not found or invalid function name -array_map(): Argument #1 ($callback) must be a valid callback or null, function "eval" not found or invalid function name -array_map(): Argument #1 ($callback) must be a valid callback or null, function "isset" not found or invalid function name -array_map(): Argument #1 ($callback) must be a valid callback or null, function "list" not found or invalid function name -array_map(): Argument #1 ($callback) must be a valid callback or null, function "print" not found or invalid function name +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "echo" not found or invalid function name +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "array" not found or invalid function name +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "empty" not found or invalid function name +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "eval" not found or invalid function name +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "isset" not found or invalid function name +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "list" not found or invalid function name +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "print" not found or invalid function name Done diff --git a/ext/standard/tests/array/array_map_variation17.phpt b/ext/standard/tests/array/array_map_variation17.phpt index 751167baa04a..b885a3152c37 100644 --- a/ext/standard/tests/array/array_map_variation17.phpt +++ b/ext/standard/tests/array/array_map_variation17.phpt @@ -64,8 +64,8 @@ for($count = 0; $count < count($unexpected_callbacks); $count++) { echo "\n-- Iteration ".($count + 1)." --\n"; try { var_dump( array_map($unexpected_callbacks[$count], $arr1)); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -76,62 +76,62 @@ echo "Done"; *** Testing array_map() : unexpected values for 'callback' argument *** -- Iteration 1 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given -- Iteration 2 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given -- Iteration 3 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given -- Iteration 4 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given -- Iteration 5 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given -- Iteration 6 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given -- Iteration 7 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given -- Iteration 8 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given -- Iteration 9 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given -- Iteration 10 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given -- Iteration 11 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given -- Iteration 12 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given -- Iteration 13 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given -- Iteration 14 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, function "" not found or invalid function name +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "" not found or invalid function name -- Iteration 15 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, function "" not found or invalid function name +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "" not found or invalid function name -- Iteration 16 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, array callback must have exactly two members +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, array callback must have exactly two members -- Iteration 17 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, first array member is not a valid class name or object +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, first array member is not a valid class name or object -- Iteration 18 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, first array member is not a valid class name or object +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, first array member is not a valid class name or object -- Iteration 19 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given -- Iteration 20 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given Done diff --git a/ext/standard/tests/array/array_map_variation9.phpt b/ext/standard/tests/array/array_map_variation9.phpt index eb4d400aad48..f452bfb3eb2d 100644 --- a/ext/standard/tests/array/array_map_variation9.phpt +++ b/ext/standard/tests/array/array_map_variation9.phpt @@ -27,7 +27,7 @@ echo "-- checking binary safe array with two parameter callback function --\n"; try { var_dump( array_map(b"callback2", $arr1) ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done"; @@ -46,5 +46,5 @@ array(4) { string(5) "22.22" } -- checking binary safe array with two parameter callback function -- -Exception: Too few arguments to function callback2(), 1 passed and exactly 2 expected +ArgumentCountError: Too few arguments to function callback2(), 1 passed and exactly 2 expected Done diff --git a/ext/standard/tests/array/array_merge_recursive_variation1.phpt b/ext/standard/tests/array/array_merge_recursive_variation1.phpt index 121f7969d43c..f3999c4a5ab7 100644 --- a/ext/standard/tests/array/array_merge_recursive_variation1.phpt +++ b/ext/standard/tests/array/array_merge_recursive_variation1.phpt @@ -89,16 +89,16 @@ foreach($arrays as $arr1) { echo "\n-- With default argument --"; try { var_dump( array_merge_recursive($arr1) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } // with more arguments echo "-- With more arguments --"; try { var_dump( array_merge_recursive($arr1, $arr2) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $iterator++; @@ -113,98 +113,98 @@ echo "Done"; *** Testing array_merge_recursive() : Passing non array values to $arr1 argument *** -- Iteration 1 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, int given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, int given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, int given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, int given -- Iteration 2 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, int given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, int given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, int given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, int given -- Iteration 3 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, int given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, int given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, int given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, int given -- Iteration 4 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, int given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, int given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, int given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, int given -- Iteration 5 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, float given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, float given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, float given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, float given -- Iteration 6 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, float given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, float given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, float given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, float given -- Iteration 7 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, float given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, float given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, float given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, float given -- Iteration 8 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, float given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, float given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, float given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, float given -- Iteration 9 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, float given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, float given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, float given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, float given -- Iteration 10 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, null given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, null given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, null given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, null given -- Iteration 11 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, null given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, null given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, null given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, null given -- Iteration 12 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, true given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, true given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, true given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, true given -- Iteration 13 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, false given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, false given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, false given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, false given -- Iteration 14 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, true given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, true given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, true given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, true given -- Iteration 15 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, false given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, false given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, false given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, false given -- Iteration 16 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, string given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, string given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, string given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, string given -- Iteration 17 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, string given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, string given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, string given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, string given -- Iteration 18 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, string given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, string given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, string given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, string given -- Iteration 19 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, string given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, string given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, string given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, string given -- Iteration 20 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, string given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, string given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, string given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, string given -- Iteration 21 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, null given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, null given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, null given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, null given -- Iteration 22 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, null given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, null given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, null given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, null given -- Iteration 23 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, resource given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, resource given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, resource given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, resource given -- Iteration 24 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, A given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, A given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, A given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, A given Done diff --git a/ext/standard/tests/array/array_merge_recursive_variation2.phpt b/ext/standard/tests/array/array_merge_recursive_variation2.phpt index 4588d8d160aa..04933b175228 100644 --- a/ext/standard/tests/array/array_merge_recursive_variation2.phpt +++ b/ext/standard/tests/array/array_merge_recursive_variation2.phpt @@ -86,8 +86,8 @@ foreach($arrays as $arr2) { echo "\n-- Iteration $iterator --"; try { var_dump( array_merge_recursive($arr1, $arr2) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $iterator++; } @@ -100,51 +100,51 @@ echo "Done"; --EXPECT-- *** Testing array_merge_recursive() : Passing non array values to $arr2 argument *** --- Iteration 1 --array_merge_recursive(): Argument #2 must be of type array, int given +-- Iteration 1 --TypeError: array_merge_recursive(): Argument #2 must be of type array, int given --- Iteration 2 --array_merge_recursive(): Argument #2 must be of type array, int given +-- Iteration 2 --TypeError: array_merge_recursive(): Argument #2 must be of type array, int given --- Iteration 3 --array_merge_recursive(): Argument #2 must be of type array, int given +-- Iteration 3 --TypeError: array_merge_recursive(): Argument #2 must be of type array, int given --- Iteration 4 --array_merge_recursive(): Argument #2 must be of type array, int given +-- Iteration 4 --TypeError: array_merge_recursive(): Argument #2 must be of type array, int given --- Iteration 5 --array_merge_recursive(): Argument #2 must be of type array, float given +-- Iteration 5 --TypeError: array_merge_recursive(): Argument #2 must be of type array, float given --- Iteration 6 --array_merge_recursive(): Argument #2 must be of type array, float given +-- Iteration 6 --TypeError: array_merge_recursive(): Argument #2 must be of type array, float given --- Iteration 7 --array_merge_recursive(): Argument #2 must be of type array, float given +-- Iteration 7 --TypeError: array_merge_recursive(): Argument #2 must be of type array, float given --- Iteration 8 --array_merge_recursive(): Argument #2 must be of type array, float given +-- Iteration 8 --TypeError: array_merge_recursive(): Argument #2 must be of type array, float given --- Iteration 9 --array_merge_recursive(): Argument #2 must be of type array, float given +-- Iteration 9 --TypeError: array_merge_recursive(): Argument #2 must be of type array, float given --- Iteration 10 --array_merge_recursive(): Argument #2 must be of type array, null given +-- Iteration 10 --TypeError: array_merge_recursive(): Argument #2 must be of type array, null given --- Iteration 11 --array_merge_recursive(): Argument #2 must be of type array, null given +-- Iteration 11 --TypeError: array_merge_recursive(): Argument #2 must be of type array, null given --- Iteration 12 --array_merge_recursive(): Argument #2 must be of type array, true given +-- Iteration 12 --TypeError: array_merge_recursive(): Argument #2 must be of type array, true given --- Iteration 13 --array_merge_recursive(): Argument #2 must be of type array, false given +-- Iteration 13 --TypeError: array_merge_recursive(): Argument #2 must be of type array, false given --- Iteration 14 --array_merge_recursive(): Argument #2 must be of type array, true given +-- Iteration 14 --TypeError: array_merge_recursive(): Argument #2 must be of type array, true given --- Iteration 15 --array_merge_recursive(): Argument #2 must be of type array, false given +-- Iteration 15 --TypeError: array_merge_recursive(): Argument #2 must be of type array, false given --- Iteration 16 --array_merge_recursive(): Argument #2 must be of type array, string given +-- Iteration 16 --TypeError: array_merge_recursive(): Argument #2 must be of type array, string given --- Iteration 17 --array_merge_recursive(): Argument #2 must be of type array, string given +-- Iteration 17 --TypeError: array_merge_recursive(): Argument #2 must be of type array, string given --- Iteration 18 --array_merge_recursive(): Argument #2 must be of type array, string given +-- Iteration 18 --TypeError: array_merge_recursive(): Argument #2 must be of type array, string given --- Iteration 19 --array_merge_recursive(): Argument #2 must be of type array, string given +-- Iteration 19 --TypeError: array_merge_recursive(): Argument #2 must be of type array, string given --- Iteration 20 --array_merge_recursive(): Argument #2 must be of type array, string given +-- Iteration 20 --TypeError: array_merge_recursive(): Argument #2 must be of type array, string given --- Iteration 21 --array_merge_recursive(): Argument #2 must be of type array, null given +-- Iteration 21 --TypeError: array_merge_recursive(): Argument #2 must be of type array, null given --- Iteration 22 --array_merge_recursive(): Argument #2 must be of type array, null given +-- Iteration 22 --TypeError: array_merge_recursive(): Argument #2 must be of type array, null given --- Iteration 23 --array_merge_recursive(): Argument #2 must be of type array, resource given +-- Iteration 23 --TypeError: array_merge_recursive(): Argument #2 must be of type array, resource given --- Iteration 24 --array_merge_recursive(): Argument #2 must be of type array, A given +-- Iteration 24 --TypeError: array_merge_recursive(): Argument #2 must be of type array, A given Done diff --git a/ext/standard/tests/array/array_merge_variation2.phpt b/ext/standard/tests/array/array_merge_variation2.phpt index 2ef55565742f..280fc298583f 100644 --- a/ext/standard/tests/array/array_merge_variation2.phpt +++ b/ext/standard/tests/array/array_merge_variation2.phpt @@ -86,8 +86,8 @@ foreach($inputs as $input) { echo "\n-- Iteration $iterator --\n"; try { var_dump( array_merge($arr1, $input) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $iterator++; }; @@ -100,55 +100,55 @@ echo "Done"; *** Testing array_merge() : usage variations *** -- Iteration 1 -- -array_merge(): Argument #2 must be of type array, int given +TypeError: array_merge(): Argument #2 must be of type array, int given -- Iteration 2 -- -array_merge(): Argument #2 must be of type array, int given +TypeError: array_merge(): Argument #2 must be of type array, int given -- Iteration 3 -- -array_merge(): Argument #2 must be of type array, int given +TypeError: array_merge(): Argument #2 must be of type array, int given -- Iteration 4 -- -array_merge(): Argument #2 must be of type array, int given +TypeError: array_merge(): Argument #2 must be of type array, int given -- Iteration 5 -- -array_merge(): Argument #2 must be of type array, float given +TypeError: array_merge(): Argument #2 must be of type array, float given -- Iteration 6 -- -array_merge(): Argument #2 must be of type array, float given +TypeError: array_merge(): Argument #2 must be of type array, float given -- Iteration 7 -- -array_merge(): Argument #2 must be of type array, float given +TypeError: array_merge(): Argument #2 must be of type array, float given -- Iteration 8 -- -array_merge(): Argument #2 must be of type array, float given +TypeError: array_merge(): Argument #2 must be of type array, float given -- Iteration 9 -- -array_merge(): Argument #2 must be of type array, float given +TypeError: array_merge(): Argument #2 must be of type array, float given -- Iteration 10 -- -array_merge(): Argument #2 must be of type array, null given +TypeError: array_merge(): Argument #2 must be of type array, null given -- Iteration 11 -- -array_merge(): Argument #2 must be of type array, null given +TypeError: array_merge(): Argument #2 must be of type array, null given -- Iteration 12 -- -array_merge(): Argument #2 must be of type array, true given +TypeError: array_merge(): Argument #2 must be of type array, true given -- Iteration 13 -- -array_merge(): Argument #2 must be of type array, false given +TypeError: array_merge(): Argument #2 must be of type array, false given -- Iteration 14 -- -array_merge(): Argument #2 must be of type array, true given +TypeError: array_merge(): Argument #2 must be of type array, true given -- Iteration 15 -- -array_merge(): Argument #2 must be of type array, false given +TypeError: array_merge(): Argument #2 must be of type array, false given -- Iteration 16 -- -array_merge(): Argument #2 must be of type array, string given +TypeError: array_merge(): Argument #2 must be of type array, string given -- Iteration 17 -- -array_merge(): Argument #2 must be of type array, string given +TypeError: array_merge(): Argument #2 must be of type array, string given -- Iteration 18 -- array(2) { @@ -159,23 +159,23 @@ array(2) { } -- Iteration 19 -- -array_merge(): Argument #2 must be of type array, string given +TypeError: array_merge(): Argument #2 must be of type array, string given -- Iteration 20 -- -array_merge(): Argument #2 must be of type array, string given +TypeError: array_merge(): Argument #2 must be of type array, string given -- Iteration 21 -- -array_merge(): Argument #2 must be of type array, string given +TypeError: array_merge(): Argument #2 must be of type array, string given -- Iteration 22 -- -array_merge(): Argument #2 must be of type array, classA given +TypeError: array_merge(): Argument #2 must be of type array, classA given -- Iteration 23 -- -array_merge(): Argument #2 must be of type array, null given +TypeError: array_merge(): Argument #2 must be of type array, null given -- Iteration 24 -- -array_merge(): Argument #2 must be of type array, null given +TypeError: array_merge(): Argument #2 must be of type array, null given -- Iteration 25 -- -array_merge(): Argument #2 must be of type array, resource given +TypeError: array_merge(): Argument #2 must be of type array, resource given Done diff --git a/ext/standard/tests/array/array_pad_too_large_padding.phpt b/ext/standard/tests/array/array_pad_too_large_padding.phpt index 3a45e834f9a0..b44dad17db5b 100644 --- a/ext/standard/tests/array/array_pad_too_large_padding.phpt +++ b/ext/standard/tests/array/array_pad_too_large_padding.phpt @@ -6,8 +6,8 @@ array_pad() with too large padding should fail function test($length) { try { var_dump(array_pad(array("", -1, 2.0), $length, 0)); - } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + } catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -16,5 +16,5 @@ test(PHP_INT_MAX); ?> --EXPECT-- -array_pad(): Argument #2 ($length) must not exceed the maximum allowed array size -array_pad(): Argument #2 ($length) must not exceed the maximum allowed array size +ValueError: array_pad(): Argument #2 ($length) must not exceed the maximum allowed array size +ValueError: array_pad(): Argument #2 ($length) must not exceed the maximum allowed array size diff --git a/ext/standard/tests/array/array_product_variation1.phpt b/ext/standard/tests/array/array_product_variation1.phpt index 330479f4ef8b..b84471f00fc4 100644 --- a/ext/standard/tests/array/array_product_variation1.phpt +++ b/ext/standard/tests/array/array_product_variation1.phpt @@ -53,4 +53,3 @@ array Warning: array_product(): Multiplication is not supported on type array in %s on line %d int(1) - diff --git a/ext/standard/tests/array/array_product_variation5.phpt b/ext/standard/tests/array/array_product_variation5.phpt index 525b6a52bd14..a2ab9cf4144a 100644 --- a/ext/standard/tests/array/array_product_variation5.phpt +++ b/ext/standard/tests/array/array_product_variation5.phpt @@ -10,8 +10,8 @@ var_dump(array_product($input)); echo "array_reduce() version:\n"; try { var_dump(array_reduce($input, fn($carry, $value) => $carry * $value, 1)); -} catch (TypeError $e) { - echo $e->getMessage(); +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- @@ -20,4 +20,4 @@ array_product() version: Warning: array_product(): Multiplication is not supported on type resource in %s on line %d int(30) array_reduce() version: -Unsupported operand types: int * resource +TypeError: Unsupported operand types: int * resource diff --git a/ext/standard/tests/array/array_push_error2.phpt b/ext/standard/tests/array/array_push_error2.phpt index 0ed0af6e1b4a..4fa4831bc6a6 100644 --- a/ext/standard/tests/array/array_push_error2.phpt +++ b/ext/standard/tests/array/array_push_error2.phpt @@ -12,15 +12,15 @@ echo "*** Testing array_push() : error conditions ***\n"; $array = array(PHP_INT_MAX => 'max'); try { var_dump(array_push($array, 'new')); -} catch (\Error $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($array); ?> --EXPECTF-- *** Testing array_push() : error conditions *** -Cannot add element to the array as the next element is already occupied +Error: Cannot add element to the array as the next element is already occupied array(1) { [%d]=> string(3) "max" diff --git a/ext/standard/tests/array/array_rand.phpt b/ext/standard/tests/array/array_rand.phpt index 24f6966bb085..e6c2f3f99ba3 100644 --- a/ext/standard/tests/array/array_rand.phpt +++ b/ext/standard/tests/array/array_rand.phpt @@ -5,32 +5,32 @@ array_rand() tests try { var_dump(array_rand(array())); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(array_rand(array(), 0)); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(array_rand(array(1,2,3), 0)); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(array_rand(array(1,2,3), -1)); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(array_rand(array(1,2,3), 10)); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(array_rand(array(1,2,3), 3)); @@ -38,11 +38,11 @@ var_dump(array_rand(array(1,2,3), 2)); ?> --EXPECTF-- -array_rand(): Argument #1 ($array) must not be empty -array_rand(): Argument #1 ($array) must not be empty -array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) -array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) -array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) +ValueError: array_rand(): Argument #1 ($array) must not be empty +ValueError: array_rand(): Argument #1 ($array) must not be empty +ValueError: array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) +ValueError: array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) +ValueError: array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) array(3) { [0]=> int(%d) diff --git a/ext/standard/tests/array/array_rand_variation5.phpt b/ext/standard/tests/array/array_rand_variation5.phpt index 57f5ee03af99..87546677a347 100644 --- a/ext/standard/tests/array/array_rand_variation5.phpt +++ b/ext/standard/tests/array/array_rand_variation5.phpt @@ -28,29 +28,29 @@ var_dump( array_rand($input, 1) ); // with valid $num_req value echo"\n-- With num_req = 0 --\n"; try { var_dump( array_rand($input, 0) ); // with $num_req=0 -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo"\n-- With num_req = -1 --\n"; try { var_dump( array_rand($input, -1) ); // with $num_req=-1 -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo"\n-- With num_req = -2 --\n"; try { var_dump( array_rand($input, -2) ); // with $num_req=-2 -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo"\n-- With num_req more than number of members in 'input' array --\n"; try { var_dump( array_rand($input, 13) ); // with $num_req=13 -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -64,13 +64,13 @@ int(%d) int(%d) -- With num_req = 0 -- -array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) +ValueError: array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) -- With num_req = -1 -- -array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) +ValueError: array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) -- With num_req = -2 -- -array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) +ValueError: array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) -- With num_req more than number of members in 'input' array -- -array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) +ValueError: array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) diff --git a/ext/standard/tests/array/array_reduce_variation1.phpt b/ext/standard/tests/array/array_reduce_variation1.phpt index d1b6bf204d68..84dc3d4f8e1b 100644 --- a/ext/standard/tests/array/array_reduce_variation1.phpt +++ b/ext/standard/tests/array/array_reduce_variation1.phpt @@ -22,7 +22,7 @@ echo "\n--- Testing with a callback with too many parameters ---\n"; try { var_dump(array_reduce($array, "threeArgs", 2)); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -33,4 +33,4 @@ try { int(2) --- Testing with a callback with too many parameters --- -Exception: Too few arguments to function threeArgs(), 2 passed and exactly 3 expected +ArgumentCountError: Too few arguments to function threeArgs(), 2 passed and exactly 3 expected diff --git a/ext/standard/tests/array/array_search_variation3.phpt b/ext/standard/tests/array/array_search_variation3.phpt index 36a405175e22..01a4a874c09a 100644 --- a/ext/standard/tests/array/array_search_variation3.phpt +++ b/ext/standard/tests/array/array_search_variation3.phpt @@ -29,14 +29,14 @@ $array_search_obj = new array_search_check(); //creating new object //error: as wrong datatype for second argument try { var_dump( array_search("array_var", $array_search_obj) ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } //error: as wrong datatype for second argument try { var_dump( array_search("foo", $array_search_obj) ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } //element found as "one" exists in array $array_var var_dump( array_search("one", $array_search_obj->array_var) ); @@ -50,7 +50,7 @@ string(5) "three" int(5) *** Testing objects with array_search() *** -array_search(): Argument #2 ($haystack) must be of type array, array_search_check given -array_search(): Argument #2 ($haystack) must be of type array, array_search_check given +TypeError: array_search(): Argument #2 ($haystack) must be of type array, array_search_check given +TypeError: array_search(): Argument #2 ($haystack) must be of type array, array_search_check given int(1) Done diff --git a/ext/standard/tests/array/array_slice_variation1.phpt b/ext/standard/tests/array/array_slice_variation1.phpt index b1d80d3f5229..b82ab59c2ae0 100644 --- a/ext/standard/tests/array/array_slice_variation1.phpt +++ b/ext/standard/tests/array/array_slice_variation1.phpt @@ -17,13 +17,13 @@ var_dump(array_slice(range(1, 3), -1, NULL, 1)); $a = 'foo'; try { var_dump(array_slice(range(1, 3), 0, $a)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(array_slice(range(1, 3), 0, $a)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($a); @@ -61,6 +61,6 @@ array(1) { [2]=> int(3) } -array_slice(): Argument #3 ($length) must be of type ?int, string given -array_slice(): Argument #3 ($length) must be of type ?int, string given +TypeError: array_slice(): Argument #3 ($length) must be of type ?int, string given +TypeError: array_slice(): Argument #3 ($length) must be of type ?int, string given string(3) "foo" diff --git a/ext/standard/tests/array/array_sum_variation8.phpt b/ext/standard/tests/array/array_sum_variation8.phpt index 017b1b8b44b1..e1e3b3f85974 100644 --- a/ext/standard/tests/array/array_sum_variation8.phpt +++ b/ext/standard/tests/array/array_sum_variation8.phpt @@ -10,8 +10,8 @@ var_dump(array_sum($input)); echo "array_reduce() version:\n"; try { var_dump(array_reduce($input, fn($carry, $value) => $carry + $value, 0)); -} catch (TypeError $e) { - echo $e->getMessage(); +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- @@ -20,4 +20,4 @@ array_sum() version: Warning: array_sum(): Addition is not supported on type resource in %s on line %d int(13) array_reduce() version: -Unsupported operand types: int + resource +TypeError: Unsupported operand types: int + resource diff --git a/ext/standard/tests/array/array_udiff_assoc_variation1.phpt b/ext/standard/tests/array/array_udiff_assoc_variation1.phpt index 3cc54bdc4e78..fe5c3318a477 100644 --- a/ext/standard/tests/array/array_udiff_assoc_variation1.phpt +++ b/ext/standard/tests/array/array_udiff_assoc_variation1.phpt @@ -88,8 +88,8 @@ foreach($inputs as $key =>$value) { echo "\n--$key--\n"; try { var_dump( array_udiff_assoc($value, $array2, $key_comp_func) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -98,76 +98,76 @@ foreach($inputs as $key =>$value) { *** Testing array_udiff_assoc() : usage variation *** --int 0-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, int given --int 1-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, int given --int 12345-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, int given --int -12345-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, int given --float 10.5-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, float given --float -10.5-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, float given --float 12.3456789000e10-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, float given --float -12.3456789000e10-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, float given --float .5-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, float given --uppercase NULL-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, null given --lowercase null-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, null given --lowercase true-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, true given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, true given --lowercase false-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, false given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, false given --uppercase TRUE-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, true given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, true given --uppercase FALSE-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, false given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, false given --empty string DQ-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, string given --empty string SQ-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, string given --string DQ-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, string given --string SQ-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, string given --mixed case string-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, string given --heredoc-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, string given --instance of classWithToString-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, classWithToString given --instance of classWithoutToString-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, classWithoutToString given --undefined var-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, null given --unset var-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, null given diff --git a/ext/standard/tests/array/array_udiff_assoc_variation2.phpt b/ext/standard/tests/array/array_udiff_assoc_variation2.phpt index 9e5c796484ae..71745920e447 100644 --- a/ext/standard/tests/array/array_udiff_assoc_variation2.phpt +++ b/ext/standard/tests/array/array_udiff_assoc_variation2.phpt @@ -88,8 +88,8 @@ foreach($inputs as $key =>$value) { echo "\n--$key--\n"; try { var_dump( array_udiff_assoc($array1, $value, $key_comp_func) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -98,76 +98,76 @@ foreach($inputs as $key =>$value) { *** Testing array_udiff_assoc() : usage variation *** --int 0-- -array_udiff_assoc(): Argument #2 must be of type array, int given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, int given --int 1-- -array_udiff_assoc(): Argument #2 must be of type array, int given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, int given --int 12345-- -array_udiff_assoc(): Argument #2 must be of type array, int given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, int given --int -12345-- -array_udiff_assoc(): Argument #2 must be of type array, int given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, int given --float 10.5-- -array_udiff_assoc(): Argument #2 must be of type array, float given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, float given --float -10.5-- -array_udiff_assoc(): Argument #2 must be of type array, float given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, float given --float 12.3456789000e10-- -array_udiff_assoc(): Argument #2 must be of type array, float given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, float given --float -12.3456789000e10-- -array_udiff_assoc(): Argument #2 must be of type array, float given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, float given --float .5-- -array_udiff_assoc(): Argument #2 must be of type array, float given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, float given --uppercase NULL-- -array_udiff_assoc(): Argument #2 must be of type array, null given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, null given --lowercase null-- -array_udiff_assoc(): Argument #2 must be of type array, null given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, null given --lowercase true-- -array_udiff_assoc(): Argument #2 must be of type array, true given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, true given --lowercase false-- -array_udiff_assoc(): Argument #2 must be of type array, false given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, false given --uppercase TRUE-- -array_udiff_assoc(): Argument #2 must be of type array, true given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, true given --uppercase FALSE-- -array_udiff_assoc(): Argument #2 must be of type array, false given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, false given --empty string DQ-- -array_udiff_assoc(): Argument #2 must be of type array, string given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, string given --empty string SQ-- -array_udiff_assoc(): Argument #2 must be of type array, string given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, string given --string DQ-- -array_udiff_assoc(): Argument #2 must be of type array, string given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, string given --string SQ-- -array_udiff_assoc(): Argument #2 must be of type array, string given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, string given --mixed case string-- -array_udiff_assoc(): Argument #2 must be of type array, string given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, string given --heredoc-- -array_udiff_assoc(): Argument #2 must be of type array, string given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, string given --instance of classWithToString-- -array_udiff_assoc(): Argument #2 must be of type array, classWithToString given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, classWithToString given --instance of classWithoutToString-- -array_udiff_assoc(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, classWithoutToString given --undefined var-- -array_udiff_assoc(): Argument #2 must be of type array, null given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, null given --unset var-- -array_udiff_assoc(): Argument #2 must be of type array, null given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, null given diff --git a/ext/standard/tests/array/array_udiff_assoc_variation5.phpt b/ext/standard/tests/array/array_udiff_assoc_variation5.phpt index ea63891067f8..a5144564a840 100644 --- a/ext/standard/tests/array/array_udiff_assoc_variation5.phpt +++ b/ext/standard/tests/array/array_udiff_assoc_variation5.phpt @@ -20,7 +20,7 @@ function too_many_parameters ($val1, $val2, $val3) { try { var_dump(array_udiff_assoc($arr1, $arr2, 'too_many_parameters')); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- comparison function taking too few parameters --\n"; @@ -40,7 +40,7 @@ array(1) { } -- comparison function taking too many parameters -- -Exception: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected +ArgumentCountError: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected -- comparison function taking too few parameters -- array(1) { diff --git a/ext/standard/tests/array/array_udiff_uassoc_variation1.phpt b/ext/standard/tests/array/array_udiff_uassoc_variation1.phpt index 4bf85a3c2098..7f306fbc9826 100644 --- a/ext/standard/tests/array/array_udiff_uassoc_variation1.phpt +++ b/ext/standard/tests/array/array_udiff_uassoc_variation1.phpt @@ -89,8 +89,8 @@ foreach($inputs as $key =>$value) { echo "\n--$key--\n"; try { var_dump( array_udiff_uassoc($value, $array2, $data_comp_func, $key_comp_func) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -99,76 +99,76 @@ foreach($inputs as $key =>$value) { *** Testing array_udiff_uassoc() : usage variation *** --int 0-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, int given --int 1-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, int given --int 12345-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, int given --int -12345-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, int given --float 10.5-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, float given --float -10.5-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, float given --float 12.3456789000e10-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, float given --float -12.3456789000e10-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, float given --float .5-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, float given --uppercase NULL-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, null given --lowercase null-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, null given --lowercase true-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, true given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, true given --lowercase false-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, false given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, false given --uppercase TRUE-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, true given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, true given --uppercase FALSE-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, false given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, false given --empty string DQ-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, string given --empty string SQ-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, string given --string DQ-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, string given --string SQ-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, string given --mixed case string-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, string given --heredoc-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, string given --instance of classWithToString-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, classWithToString given --instance of classWithoutToString-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, classWithoutToString given --undefined var-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, null given --unset var-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, null given diff --git a/ext/standard/tests/array/array_udiff_uassoc_variation2.phpt b/ext/standard/tests/array/array_udiff_uassoc_variation2.phpt index 765e159bab54..aea5a316e10a 100644 --- a/ext/standard/tests/array/array_udiff_uassoc_variation2.phpt +++ b/ext/standard/tests/array/array_udiff_uassoc_variation2.phpt @@ -89,8 +89,8 @@ foreach($inputs as $key =>$value) { echo "\n--$key--\n"; try { var_dump( array_udiff_uassoc($array1, $value, $data_comp_func, $key_comp_func) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -99,76 +99,76 @@ foreach($inputs as $key =>$value) { *** Testing array_udiff_uassoc() : usage variation *** --int 0-- -array_udiff_uassoc(): Argument #2 must be of type array, int given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, int given --int 1-- -array_udiff_uassoc(): Argument #2 must be of type array, int given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, int given --int 12345-- -array_udiff_uassoc(): Argument #2 must be of type array, int given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, int given --int -12345-- -array_udiff_uassoc(): Argument #2 must be of type array, int given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, int given --float 10.5-- -array_udiff_uassoc(): Argument #2 must be of type array, float given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, float given --float -10.5-- -array_udiff_uassoc(): Argument #2 must be of type array, float given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, float given --float 12.3456789000e10-- -array_udiff_uassoc(): Argument #2 must be of type array, float given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, float given --float -12.3456789000e10-- -array_udiff_uassoc(): Argument #2 must be of type array, float given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, float given --float .5-- -array_udiff_uassoc(): Argument #2 must be of type array, float given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, float given --uppercase NULL-- -array_udiff_uassoc(): Argument #2 must be of type array, null given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, null given --lowercase null-- -array_udiff_uassoc(): Argument #2 must be of type array, null given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, null given --lowercase true-- -array_udiff_uassoc(): Argument #2 must be of type array, true given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, true given --lowercase false-- -array_udiff_uassoc(): Argument #2 must be of type array, false given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, false given --uppercase TRUE-- -array_udiff_uassoc(): Argument #2 must be of type array, true given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, true given --uppercase FALSE-- -array_udiff_uassoc(): Argument #2 must be of type array, false given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, false given --empty string DQ-- -array_udiff_uassoc(): Argument #2 must be of type array, string given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, string given --empty string SQ-- -array_udiff_uassoc(): Argument #2 must be of type array, string given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, string given --string DQ-- -array_udiff_uassoc(): Argument #2 must be of type array, string given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, string given --string SQ-- -array_udiff_uassoc(): Argument #2 must be of type array, string given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, string given --mixed case string-- -array_udiff_uassoc(): Argument #2 must be of type array, string given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, string given --heredoc-- -array_udiff_uassoc(): Argument #2 must be of type array, string given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, string given --instance of classWithToString-- -array_udiff_uassoc(): Argument #2 must be of type array, classWithToString given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, classWithToString given --instance of classWithoutToString-- -array_udiff_uassoc(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, classWithoutToString given --undefined var-- -array_udiff_uassoc(): Argument #2 must be of type array, null given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, null given --unset var-- -array_udiff_uassoc(): Argument #2 must be of type array, null given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, null given diff --git a/ext/standard/tests/array/array_udiff_uassoc_variation6.phpt b/ext/standard/tests/array/array_udiff_uassoc_variation6.phpt index 90e3af153339..468ffd7504eb 100644 --- a/ext/standard/tests/array/array_udiff_uassoc_variation6.phpt +++ b/ext/standard/tests/array/array_udiff_uassoc_variation6.phpt @@ -20,7 +20,7 @@ function too_many_parameters ($val1, $val2, $val3) { try { var_dump(array_udiff_uassoc($arr1, $arr2, 'too_many_parameters', 'too_many_parameters')); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- comparison function taking too few parameters --\n"; @@ -40,7 +40,7 @@ array(1) { } -- comparison function taking too many parameters -- -Exception: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected +ArgumentCountError: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected -- comparison function taking too few parameters -- array(1) { diff --git a/ext/standard/tests/array/array_udiff_variation1.phpt b/ext/standard/tests/array/array_udiff_variation1.phpt index 59cfca596864..deff7276f282 100644 --- a/ext/standard/tests/array/array_udiff_variation1.phpt +++ b/ext/standard/tests/array/array_udiff_variation1.phpt @@ -88,8 +88,8 @@ foreach($inputs as $key =>$value) { echo "\n--$key--\n"; try { var_dump( array_udiff($value, $array2, $data_comp_func) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -98,76 +98,76 @@ foreach($inputs as $key =>$value) { *** Testing array_udiff() : usage variation *** --int 0-- -array_udiff(): Argument #1 ($array) must be of type array, int given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, int given --int 1-- -array_udiff(): Argument #1 ($array) must be of type array, int given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, int given --int 12345-- -array_udiff(): Argument #1 ($array) must be of type array, int given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, int given --int -12345-- -array_udiff(): Argument #1 ($array) must be of type array, int given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, int given --float 10.5-- -array_udiff(): Argument #1 ($array) must be of type array, float given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, float given --float -10.5-- -array_udiff(): Argument #1 ($array) must be of type array, float given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, float given --float 12.3456789000e10-- -array_udiff(): Argument #1 ($array) must be of type array, float given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, float given --float -12.3456789000e10-- -array_udiff(): Argument #1 ($array) must be of type array, float given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, float given --float .5-- -array_udiff(): Argument #1 ($array) must be of type array, float given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, float given --uppercase NULL-- -array_udiff(): Argument #1 ($array) must be of type array, null given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, null given --lowercase null-- -array_udiff(): Argument #1 ($array) must be of type array, null given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, null given --lowercase true-- -array_udiff(): Argument #1 ($array) must be of type array, true given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, true given --lowercase false-- -array_udiff(): Argument #1 ($array) must be of type array, false given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, false given --uppercase TRUE-- -array_udiff(): Argument #1 ($array) must be of type array, true given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, true given --uppercase FALSE-- -array_udiff(): Argument #1 ($array) must be of type array, false given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, false given --empty string DQ-- -array_udiff(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, string given --empty string SQ-- -array_udiff(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, string given --string DQ-- -array_udiff(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, string given --string SQ-- -array_udiff(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, string given --mixed case string-- -array_udiff(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, string given --heredoc-- -array_udiff(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, string given --instance of classWithToString-- -array_udiff(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, classWithToString given --instance of classWithoutToString-- -array_udiff(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, classWithoutToString given --undefined var-- -array_udiff(): Argument #1 ($array) must be of type array, null given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, null given --unset var-- -array_udiff(): Argument #1 ($array) must be of type array, null given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, null given diff --git a/ext/standard/tests/array/array_udiff_variation2.phpt b/ext/standard/tests/array/array_udiff_variation2.phpt index 6637692e0b25..a670b88e65e5 100644 --- a/ext/standard/tests/array/array_udiff_variation2.phpt +++ b/ext/standard/tests/array/array_udiff_variation2.phpt @@ -88,8 +88,8 @@ foreach($inputs as $key =>$value) { echo "\n--$key--\n"; try { var_dump( array_udiff($array1, $value, $data_comp_func) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -98,76 +98,76 @@ foreach($inputs as $key =>$value) { *** Testing array_udiff() : usage variation *** --int 0-- -array_udiff(): Argument #2 must be of type array, int given +TypeError: array_udiff(): Argument #2 must be of type array, int given --int 1-- -array_udiff(): Argument #2 must be of type array, int given +TypeError: array_udiff(): Argument #2 must be of type array, int given --int 12345-- -array_udiff(): Argument #2 must be of type array, int given +TypeError: array_udiff(): Argument #2 must be of type array, int given --int -12345-- -array_udiff(): Argument #2 must be of type array, int given +TypeError: array_udiff(): Argument #2 must be of type array, int given --float 10.5-- -array_udiff(): Argument #2 must be of type array, float given +TypeError: array_udiff(): Argument #2 must be of type array, float given --float -10.5-- -array_udiff(): Argument #2 must be of type array, float given +TypeError: array_udiff(): Argument #2 must be of type array, float given --float 12.3456789000e10-- -array_udiff(): Argument #2 must be of type array, float given +TypeError: array_udiff(): Argument #2 must be of type array, float given --float -12.3456789000e10-- -array_udiff(): Argument #2 must be of type array, float given +TypeError: array_udiff(): Argument #2 must be of type array, float given --float .5-- -array_udiff(): Argument #2 must be of type array, float given +TypeError: array_udiff(): Argument #2 must be of type array, float given --uppercase NULL-- -array_udiff(): Argument #2 must be of type array, null given +TypeError: array_udiff(): Argument #2 must be of type array, null given --lowercase null-- -array_udiff(): Argument #2 must be of type array, null given +TypeError: array_udiff(): Argument #2 must be of type array, null given --lowercase true-- -array_udiff(): Argument #2 must be of type array, true given +TypeError: array_udiff(): Argument #2 must be of type array, true given --lowercase false-- -array_udiff(): Argument #2 must be of type array, false given +TypeError: array_udiff(): Argument #2 must be of type array, false given --uppercase TRUE-- -array_udiff(): Argument #2 must be of type array, true given +TypeError: array_udiff(): Argument #2 must be of type array, true given --uppercase FALSE-- -array_udiff(): Argument #2 must be of type array, false given +TypeError: array_udiff(): Argument #2 must be of type array, false given --empty string DQ-- -array_udiff(): Argument #2 must be of type array, string given +TypeError: array_udiff(): Argument #2 must be of type array, string given --empty string SQ-- -array_udiff(): Argument #2 must be of type array, string given +TypeError: array_udiff(): Argument #2 must be of type array, string given --string DQ-- -array_udiff(): Argument #2 must be of type array, string given +TypeError: array_udiff(): Argument #2 must be of type array, string given --string SQ-- -array_udiff(): Argument #2 must be of type array, string given +TypeError: array_udiff(): Argument #2 must be of type array, string given --mixed case string-- -array_udiff(): Argument #2 must be of type array, string given +TypeError: array_udiff(): Argument #2 must be of type array, string given --heredoc-- -array_udiff(): Argument #2 must be of type array, string given +TypeError: array_udiff(): Argument #2 must be of type array, string given --instance of classWithToString-- -array_udiff(): Argument #2 must be of type array, classWithToString given +TypeError: array_udiff(): Argument #2 must be of type array, classWithToString given --instance of classWithoutToString-- -array_udiff(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_udiff(): Argument #2 must be of type array, classWithoutToString given --undefined var-- -array_udiff(): Argument #2 must be of type array, null given +TypeError: array_udiff(): Argument #2 must be of type array, null given --unset var-- -array_udiff(): Argument #2 must be of type array, null given +TypeError: array_udiff(): Argument #2 must be of type array, null given diff --git a/ext/standard/tests/array/array_udiff_variation5.phpt b/ext/standard/tests/array/array_udiff_variation5.phpt index ee5ad82d677e..c789ca645987 100644 --- a/ext/standard/tests/array/array_udiff_variation5.phpt +++ b/ext/standard/tests/array/array_udiff_variation5.phpt @@ -21,7 +21,7 @@ function too_many_parameters ($val1, $val2, $val3) { try { var_dump(array_udiff($arr1, $arr2, 'too_many_parameters')); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- comparison function taking too few parameters --\n"; @@ -41,7 +41,7 @@ array(1) { } -- comparison function taking too many parameters -- -Exception: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected +ArgumentCountError: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected -- comparison function taking too few parameters -- array(0) { diff --git a/ext/standard/tests/array/array_uintersect_assoc_variation1.phpt b/ext/standard/tests/array/array_uintersect_assoc_variation1.phpt index 64e21a30d1ae..35b415f8700a 100644 --- a/ext/standard/tests/array/array_uintersect_assoc_variation1.phpt +++ b/ext/standard/tests/array/array_uintersect_assoc_variation1.phpt @@ -88,8 +88,8 @@ foreach($inputs as $key =>$value) { echo "\n--$key--\n"; try { var_dump( array_uintersect_assoc($value, $array2, $data_compare_function) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -98,76 +98,76 @@ foreach($inputs as $key =>$value) { *** Testing array_uintersect_assoc() : usage variation *** --int 0-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, int given --int 1-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, int given --int 12345-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, int given --int -12345-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, int given --float 10.5-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, float given --float -10.5-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, float given --float 12.3456789000e10-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, float given --float -12.3456789000e10-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, float given --float .5-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, float given --uppercase NULL-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, null given --lowercase null-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, null given --lowercase true-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, true given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, true given --lowercase false-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, false given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, false given --uppercase TRUE-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, true given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, true given --uppercase FALSE-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, false given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, false given --empty string DQ-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, string given --empty string SQ-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, string given --string DQ-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, string given --string SQ-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, string given --mixed case string-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, string given --heredoc-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, string given --instance of classWithToString-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, classWithToString given --instance of classWithoutToString-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, classWithoutToString given --undefined var-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, null given --unset var-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, null given diff --git a/ext/standard/tests/array/array_uintersect_assoc_variation2.phpt b/ext/standard/tests/array/array_uintersect_assoc_variation2.phpt index 4078bec27dcc..e480abbb8222 100644 --- a/ext/standard/tests/array/array_uintersect_assoc_variation2.phpt +++ b/ext/standard/tests/array/array_uintersect_assoc_variation2.phpt @@ -88,8 +88,8 @@ foreach($inputs as $key =>$value) { echo "\n--$key--\n"; try { var_dump( array_uintersect_assoc($array1, $value, $data_compare_function) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -98,76 +98,76 @@ foreach($inputs as $key =>$value) { *** Testing array_uintersect_assoc() : usage variation *** --int 0-- -array_uintersect_assoc(): Argument #2 must be of type array, int given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, int given --int 1-- -array_uintersect_assoc(): Argument #2 must be of type array, int given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, int given --int 12345-- -array_uintersect_assoc(): Argument #2 must be of type array, int given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, int given --int -12345-- -array_uintersect_assoc(): Argument #2 must be of type array, int given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, int given --float 10.5-- -array_uintersect_assoc(): Argument #2 must be of type array, float given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, float given --float -10.5-- -array_uintersect_assoc(): Argument #2 must be of type array, float given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, float given --float 12.3456789000e10-- -array_uintersect_assoc(): Argument #2 must be of type array, float given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, float given --float -12.3456789000e10-- -array_uintersect_assoc(): Argument #2 must be of type array, float given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, float given --float .5-- -array_uintersect_assoc(): Argument #2 must be of type array, float given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, float given --uppercase NULL-- -array_uintersect_assoc(): Argument #2 must be of type array, null given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, null given --lowercase null-- -array_uintersect_assoc(): Argument #2 must be of type array, null given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, null given --lowercase true-- -array_uintersect_assoc(): Argument #2 must be of type array, true given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, true given --lowercase false-- -array_uintersect_assoc(): Argument #2 must be of type array, false given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, false given --uppercase TRUE-- -array_uintersect_assoc(): Argument #2 must be of type array, true given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, true given --uppercase FALSE-- -array_uintersect_assoc(): Argument #2 must be of type array, false given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, false given --empty string DQ-- -array_uintersect_assoc(): Argument #2 must be of type array, string given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, string given --empty string SQ-- -array_uintersect_assoc(): Argument #2 must be of type array, string given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, string given --string DQ-- -array_uintersect_assoc(): Argument #2 must be of type array, string given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, string given --string SQ-- -array_uintersect_assoc(): Argument #2 must be of type array, string given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, string given --mixed case string-- -array_uintersect_assoc(): Argument #2 must be of type array, string given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, string given --heredoc-- -array_uintersect_assoc(): Argument #2 must be of type array, string given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, string given --instance of classWithToString-- -array_uintersect_assoc(): Argument #2 must be of type array, classWithToString given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, classWithToString given --instance of classWithoutToString-- -array_uintersect_assoc(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, classWithoutToString given --undefined var-- -array_uintersect_assoc(): Argument #2 must be of type array, null given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, null given --unset var-- -array_uintersect_assoc(): Argument #2 must be of type array, null given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, null given diff --git a/ext/standard/tests/array/array_uintersect_assoc_variation5.phpt b/ext/standard/tests/array/array_uintersect_assoc_variation5.phpt index ed71142170d3..9386afeeee73 100644 --- a/ext/standard/tests/array/array_uintersect_assoc_variation5.phpt +++ b/ext/standard/tests/array/array_uintersect_assoc_variation5.phpt @@ -20,7 +20,7 @@ function too_many_parameters ($val1, $val2, $val3) { try { var_dump(array_uintersect_assoc($arr1, $arr2, 'too_many_parameters')); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- comparison function taking too few parameters --\n"; @@ -38,9 +38,8 @@ array(0) { } -- comparison function taking too many parameters -- -Exception: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected +ArgumentCountError: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected -- comparison function taking too few parameters -- array(0) { } - diff --git a/ext/standard/tests/array/array_uintersect_uassoc_variation1.phpt b/ext/standard/tests/array/array_uintersect_uassoc_variation1.phpt index 651e78e62855..4e5beaab0ccc 100644 --- a/ext/standard/tests/array/array_uintersect_uassoc_variation1.phpt +++ b/ext/standard/tests/array/array_uintersect_uassoc_variation1.phpt @@ -89,8 +89,8 @@ foreach($inputs as $key =>$value) { echo "\n--$key--\n"; try { var_dump( array_uintersect_uassoc($value, $array2, $data_compare_func, $key_compare_func) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -99,76 +99,76 @@ foreach($inputs as $key =>$value) { *** Testing array_uintersect_uassoc() : usage variation *** --int 0-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, int given --int 1-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, int given --int 12345-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, int given --int -12345-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, int given --float 10.5-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, float given --float -10.5-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, float given --float 12.3456789000e10-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, float given --float -12.3456789000e10-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, float given --float .5-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, float given --uppercase NULL-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, null given --lowercase null-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, null given --lowercase true-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, true given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, true given --lowercase false-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, false given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, false given --uppercase TRUE-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, true given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, true given --uppercase FALSE-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, false given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, false given --empty string DQ-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, string given --empty string SQ-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, string given --string DQ-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, string given --string SQ-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, string given --mixed case string-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, string given --heredoc-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, string given --instance of classWithToString-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, classWithToString given --instance of classWithoutToString-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, classWithoutToString given --undefined var-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, null given --unset var-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, null given diff --git a/ext/standard/tests/array/array_uintersect_uassoc_variation2.phpt b/ext/standard/tests/array/array_uintersect_uassoc_variation2.phpt index e01d3b4e9572..edf9f399b4dc 100644 --- a/ext/standard/tests/array/array_uintersect_uassoc_variation2.phpt +++ b/ext/standard/tests/array/array_uintersect_uassoc_variation2.phpt @@ -89,8 +89,8 @@ foreach($inputs as $key =>$value) { echo "\n--$key--\n"; try { var_dump( array_uintersect_uassoc($array1, $value, $data_compare_func, $key_compare_func) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -99,76 +99,76 @@ foreach($inputs as $key =>$value) { *** Testing array_uintersect_uassoc() : usage variation *** --int 0-- -array_uintersect_uassoc(): Argument #2 must be of type array, int given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, int given --int 1-- -array_uintersect_uassoc(): Argument #2 must be of type array, int given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, int given --int 12345-- -array_uintersect_uassoc(): Argument #2 must be of type array, int given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, int given --int -12345-- -array_uintersect_uassoc(): Argument #2 must be of type array, int given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, int given --float 10.5-- -array_uintersect_uassoc(): Argument #2 must be of type array, float given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, float given --float -10.5-- -array_uintersect_uassoc(): Argument #2 must be of type array, float given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, float given --float 12.3456789000e10-- -array_uintersect_uassoc(): Argument #2 must be of type array, float given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, float given --float -12.3456789000e10-- -array_uintersect_uassoc(): Argument #2 must be of type array, float given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, float given --float .5-- -array_uintersect_uassoc(): Argument #2 must be of type array, float given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, float given --uppercase NULL-- -array_uintersect_uassoc(): Argument #2 must be of type array, null given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, null given --lowercase null-- -array_uintersect_uassoc(): Argument #2 must be of type array, null given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, null given --lowercase true-- -array_uintersect_uassoc(): Argument #2 must be of type array, true given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, true given --lowercase false-- -array_uintersect_uassoc(): Argument #2 must be of type array, false given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, false given --uppercase TRUE-- -array_uintersect_uassoc(): Argument #2 must be of type array, true given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, true given --uppercase FALSE-- -array_uintersect_uassoc(): Argument #2 must be of type array, false given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, false given --empty string DQ-- -array_uintersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, string given --empty string SQ-- -array_uintersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, string given --string DQ-- -array_uintersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, string given --string SQ-- -array_uintersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, string given --mixed case string-- -array_uintersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, string given --heredoc-- -array_uintersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, string given --instance of classWithToString-- -array_uintersect_uassoc(): Argument #2 must be of type array, classWithToString given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, classWithToString given --instance of classWithoutToString-- -array_uintersect_uassoc(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, classWithoutToString given --undefined var-- -array_uintersect_uassoc(): Argument #2 must be of type array, null given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, null given --unset var-- -array_uintersect_uassoc(): Argument #2 must be of type array, null given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, null given diff --git a/ext/standard/tests/array/array_uintersect_uassoc_variation6.phpt b/ext/standard/tests/array/array_uintersect_uassoc_variation6.phpt index 7574bc119f7e..2199f7b00279 100644 --- a/ext/standard/tests/array/array_uintersect_uassoc_variation6.phpt +++ b/ext/standard/tests/array/array_uintersect_uassoc_variation6.phpt @@ -20,7 +20,7 @@ function too_many_parameters ($val1, $val2, $val3) { try { var_dump(array_uintersect_uassoc($arr1, $arr2, 'too_many_parameters', 'too_many_parameters')); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- comparison function taking too few parameters --\n"; @@ -38,7 +38,7 @@ array(0) { } -- comparison function taking too many parameters -- -Exception: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected +ArgumentCountError: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected -- comparison function taking too few parameters -- array(0) { diff --git a/ext/standard/tests/array/array_uintersect_variation1.phpt b/ext/standard/tests/array/array_uintersect_variation1.phpt index 390fc6137401..a4a0caccb395 100644 --- a/ext/standard/tests/array/array_uintersect_variation1.phpt +++ b/ext/standard/tests/array/array_uintersect_variation1.phpt @@ -88,8 +88,8 @@ foreach($inputs as $key =>$value) { echo "\n--$key--\n"; try { var_dump( array_uintersect($value, $array2, $data_compare_function) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -98,76 +98,76 @@ foreach($inputs as $key =>$value) { *** Testing array_uintersect() : usage variation *** --int 0-- -array_uintersect(): Argument #1 ($array) must be of type array, int given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, int given --int 1-- -array_uintersect(): Argument #1 ($array) must be of type array, int given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, int given --int 12345-- -array_uintersect(): Argument #1 ($array) must be of type array, int given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, int given --int -12345-- -array_uintersect(): Argument #1 ($array) must be of type array, int given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, int given --float 10.5-- -array_uintersect(): Argument #1 ($array) must be of type array, float given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, float given --float -10.5-- -array_uintersect(): Argument #1 ($array) must be of type array, float given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, float given --float 12.3456789000e10-- -array_uintersect(): Argument #1 ($array) must be of type array, float given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, float given --float -12.3456789000e10-- -array_uintersect(): Argument #1 ($array) must be of type array, float given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, float given --float .5-- -array_uintersect(): Argument #1 ($array) must be of type array, float given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, float given --uppercase NULL-- -array_uintersect(): Argument #1 ($array) must be of type array, null given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, null given --lowercase null-- -array_uintersect(): Argument #1 ($array) must be of type array, null given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, null given --lowercase true-- -array_uintersect(): Argument #1 ($array) must be of type array, true given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, true given --lowercase false-- -array_uintersect(): Argument #1 ($array) must be of type array, false given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, false given --uppercase TRUE-- -array_uintersect(): Argument #1 ($array) must be of type array, true given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, true given --uppercase FALSE-- -array_uintersect(): Argument #1 ($array) must be of type array, false given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, false given --empty string DQ-- -array_uintersect(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, string given --empty string SQ-- -array_uintersect(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, string given --string DQ-- -array_uintersect(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, string given --string SQ-- -array_uintersect(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, string given --mixed case string-- -array_uintersect(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, string given --heredoc-- -array_uintersect(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, string given --instance of classWithToString-- -array_uintersect(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, classWithToString given --instance of classWithoutToString-- -array_uintersect(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, classWithoutToString given --undefined var-- -array_uintersect(): Argument #1 ($array) must be of type array, null given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, null given --unset var-- -array_uintersect(): Argument #1 ($array) must be of type array, null given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, null given diff --git a/ext/standard/tests/array/array_uintersect_variation2.phpt b/ext/standard/tests/array/array_uintersect_variation2.phpt index ca3a4bff3a90..30aa9cda8595 100644 --- a/ext/standard/tests/array/array_uintersect_variation2.phpt +++ b/ext/standard/tests/array/array_uintersect_variation2.phpt @@ -88,8 +88,8 @@ foreach($inputs as $key =>$value) { echo "\n--$key--\n"; try { var_dump( array_uintersect($array1, $value, $data_compare_function) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -98,76 +98,76 @@ foreach($inputs as $key =>$value) { *** Testing array_uintersect() : usage variation *** --int 0-- -array_uintersect(): Argument #2 must be of type array, int given +TypeError: array_uintersect(): Argument #2 must be of type array, int given --int 1-- -array_uintersect(): Argument #2 must be of type array, int given +TypeError: array_uintersect(): Argument #2 must be of type array, int given --int 12345-- -array_uintersect(): Argument #2 must be of type array, int given +TypeError: array_uintersect(): Argument #2 must be of type array, int given --int -12345-- -array_uintersect(): Argument #2 must be of type array, int given +TypeError: array_uintersect(): Argument #2 must be of type array, int given --float 10.5-- -array_uintersect(): Argument #2 must be of type array, float given +TypeError: array_uintersect(): Argument #2 must be of type array, float given --float -10.5-- -array_uintersect(): Argument #2 must be of type array, float given +TypeError: array_uintersect(): Argument #2 must be of type array, float given --float 12.3456789000e10-- -array_uintersect(): Argument #2 must be of type array, float given +TypeError: array_uintersect(): Argument #2 must be of type array, float given --float -12.3456789000e10-- -array_uintersect(): Argument #2 must be of type array, float given +TypeError: array_uintersect(): Argument #2 must be of type array, float given --float .5-- -array_uintersect(): Argument #2 must be of type array, float given +TypeError: array_uintersect(): Argument #2 must be of type array, float given --uppercase NULL-- -array_uintersect(): Argument #2 must be of type array, null given +TypeError: array_uintersect(): Argument #2 must be of type array, null given --lowercase null-- -array_uintersect(): Argument #2 must be of type array, null given +TypeError: array_uintersect(): Argument #2 must be of type array, null given --lowercase true-- -array_uintersect(): Argument #2 must be of type array, true given +TypeError: array_uintersect(): Argument #2 must be of type array, true given --lowercase false-- -array_uintersect(): Argument #2 must be of type array, false given +TypeError: array_uintersect(): Argument #2 must be of type array, false given --uppercase TRUE-- -array_uintersect(): Argument #2 must be of type array, true given +TypeError: array_uintersect(): Argument #2 must be of type array, true given --uppercase FALSE-- -array_uintersect(): Argument #2 must be of type array, false given +TypeError: array_uintersect(): Argument #2 must be of type array, false given --empty string DQ-- -array_uintersect(): Argument #2 must be of type array, string given +TypeError: array_uintersect(): Argument #2 must be of type array, string given --empty string SQ-- -array_uintersect(): Argument #2 must be of type array, string given +TypeError: array_uintersect(): Argument #2 must be of type array, string given --string DQ-- -array_uintersect(): Argument #2 must be of type array, string given +TypeError: array_uintersect(): Argument #2 must be of type array, string given --string SQ-- -array_uintersect(): Argument #2 must be of type array, string given +TypeError: array_uintersect(): Argument #2 must be of type array, string given --mixed case string-- -array_uintersect(): Argument #2 must be of type array, string given +TypeError: array_uintersect(): Argument #2 must be of type array, string given --heredoc-- -array_uintersect(): Argument #2 must be of type array, string given +TypeError: array_uintersect(): Argument #2 must be of type array, string given --instance of classWithToString-- -array_uintersect(): Argument #2 must be of type array, classWithToString given +TypeError: array_uintersect(): Argument #2 must be of type array, classWithToString given --instance of classWithoutToString-- -array_uintersect(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_uintersect(): Argument #2 must be of type array, classWithoutToString given --undefined var-- -array_uintersect(): Argument #2 must be of type array, null given +TypeError: array_uintersect(): Argument #2 must be of type array, null given --unset var-- -array_uintersect(): Argument #2 must be of type array, null given +TypeError: array_uintersect(): Argument #2 must be of type array, null given diff --git a/ext/standard/tests/array/array_uintersect_variation5.phpt b/ext/standard/tests/array/array_uintersect_variation5.phpt index 836bb80cc268..f95184011125 100644 --- a/ext/standard/tests/array/array_uintersect_variation5.phpt +++ b/ext/standard/tests/array/array_uintersect_variation5.phpt @@ -20,7 +20,7 @@ function too_many_parameters ($val1, $val2, $val3) { try { var_dump(array_uintersect($arr1, $arr2, 'too_many_parameters')); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- comparison function taking too few parameters --\n"; @@ -38,9 +38,8 @@ array(0) { } -- comparison function taking too many parameters -- -Exception: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected +ArgumentCountError: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected -- comparison function taking too few parameters -- array(0) { } - diff --git a/ext/standard/tests/array/array_walk/array_walk.phpt b/ext/standard/tests/array/array_walk/array_walk.phpt index 151c9c70d043..7e8617a39031 100644 --- a/ext/standard/tests/array/array_walk/array_walk.phpt +++ b/ext/standard/tests/array/array_walk/array_walk.phpt @@ -18,8 +18,8 @@ function foo2($v1, $v2, $v3) { try { var_dump(array_walk($var,"foo2", "data")); -} catch (Exception $e) { - var_dump($e->getMessage()); +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -32,5 +32,5 @@ int(2) int(1) string(4) "data" bool(true) -string(4) "data" +Exception: data Done diff --git a/ext/standard/tests/array/array_walk/array_walk_error2.phpt b/ext/standard/tests/array/array_walk/array_walk_error2.phpt index 57b082db95af..d537953a3db6 100644 --- a/ext/standard/tests/array/array_walk/array_walk_error2.phpt +++ b/ext/standard/tests/array/array_walk/array_walk_error2.phpt @@ -20,41 +20,41 @@ echo "*** Testing array_walk() : error conditions - callback parameters ***\n"; try { var_dump( array_walk($input, "callback1") ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_walk($input, "callback2", 4) ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // expected: Warning is suppressed try { var_dump( @array_walk($input, "callback1") ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( @array_walk($input, "callback2", 4) ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- Testing array_walk() function with too many callback parameters --\n"; try { var_dump( array_walk($input, "callback1", 20, 10) ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done"; ?> --EXPECT-- *** Testing array_walk() : error conditions - callback parameters *** -Exception: Too few arguments to function callback1(), 2 passed and exactly 3 expected -Exception: Too few arguments to function callback2(), 3 passed and exactly 4 expected -Exception: Too few arguments to function callback1(), 2 passed and exactly 3 expected -Exception: Too few arguments to function callback2(), 3 passed and exactly 4 expected +ArgumentCountError: Too few arguments to function callback1(), 2 passed and exactly 3 expected +ArgumentCountError: Too few arguments to function callback2(), 3 passed and exactly 4 expected +ArgumentCountError: Too few arguments to function callback1(), 2 passed and exactly 3 expected +ArgumentCountError: Too few arguments to function callback2(), 3 passed and exactly 4 expected -- Testing array_walk() function with too many callback parameters -- -Exception: array_walk() expects at most 3 arguments, 4 given +ArgumentCountError: array_walk() expects at most 3 arguments, 4 given Done diff --git a/ext/standard/tests/array/array_walk/array_walk_objects.phpt b/ext/standard/tests/array/array_walk/array_walk_objects.phpt index cc50ad38b9c2..4637d6b075d6 100644 --- a/ext/standard/tests/array/array_walk/array_walk_objects.phpt +++ b/ext/standard/tests/array/array_walk/array_walk_objects.phpt @@ -26,8 +26,8 @@ array_walk($var, "walk"); $var = ""; try { array_walk($var, "walk"); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -46,5 +46,5 @@ string(10) "%r\0%r*%r\0%rvar_pro" string(14) "test_protected" string(7) "var_pub" string(11) "test_public" -array_walk(): Argument #1 ($array) must be of type array, string given +TypeError: array_walk(): Argument #1 ($array) must be of type array, string given Done diff --git a/ext/standard/tests/array/array_walk/array_walk_rec_objects.phpt b/ext/standard/tests/array/array_walk/array_walk_rec_objects.phpt index 26082134f632..492f3253a1e1 100644 --- a/ext/standard/tests/array/array_walk/array_walk_rec_objects.phpt +++ b/ext/standard/tests/array/array_walk/array_walk_rec_objects.phpt @@ -26,8 +26,8 @@ array_walk_recursive($var, "walk"); $var = ""; try { array_walk_recursive($var, "walk"); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -46,5 +46,5 @@ string(10) "%0*%0var_pro" string(14) "test_protected" string(7) "var_pub" string(11) "test_public" -array_walk_recursive(): Argument #1 ($array) must be of type array, string given +TypeError: array_walk_recursive(): Argument #1 ($array) must be of type array, string given Done diff --git a/ext/standard/tests/array/array_walk/array_walk_recursive1.phpt b/ext/standard/tests/array/array_walk/array_walk_recursive1.phpt index d4d3e7d8eb26..aabf23fe2d6a 100644 --- a/ext/standard/tests/array/array_walk/array_walk_recursive1.phpt +++ b/ext/standard/tests/array/array_walk/array_walk_recursive1.phpt @@ -18,8 +18,8 @@ function foo2($v1, $v2, $v3) { try { var_dump(array_walk_recursive($var,"foo2", "data")); -} catch (Exception $e) { - var_dump($e->getMessage()); +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -38,5 +38,5 @@ int(3) int(1) string(4) "data" bool(true) -string(4) "data" +Exception: data Done diff --git a/ext/standard/tests/array/array_walk/array_walk_recursive_error2.phpt b/ext/standard/tests/array/array_walk/array_walk_recursive_error2.phpt index fa5161e5c1bd..44e59692e669 100644 --- a/ext/standard/tests/array/array_walk/array_walk_recursive_error2.phpt +++ b/ext/standard/tests/array/array_walk/array_walk_recursive_error2.phpt @@ -20,41 +20,41 @@ echo "*** Testing array_walk_recursive() : error conditions - callback parameter try { var_dump( array_walk_recursive($input, "callback1") ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_walk_recursive($input, "callback2", 4) ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // expected: Warning is suppressed try { var_dump( @array_walk_recursive($input, "callback1") ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( @array_walk_recursive($input, "callback2", 4) ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- Testing array_walk_recursive() function with too many callback parameters --\n"; try { var_dump( array_walk_recursive($input, "callback1", 20, 10) ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done"; ?> --EXPECT-- *** Testing array_walk_recursive() : error conditions - callback parameters *** -Exception: Too few arguments to function callback1(), 2 passed and exactly 3 expected -Exception: Too few arguments to function callback2(), 3 passed and exactly 4 expected -Exception: Too few arguments to function callback1(), 2 passed and exactly 3 expected -Exception: Too few arguments to function callback2(), 3 passed and exactly 4 expected +ArgumentCountError: Too few arguments to function callback1(), 2 passed and exactly 3 expected +ArgumentCountError: Too few arguments to function callback2(), 3 passed and exactly 4 expected +ArgumentCountError: Too few arguments to function callback1(), 2 passed and exactly 3 expected +ArgumentCountError: Too few arguments to function callback2(), 3 passed and exactly 4 expected -- Testing array_walk_recursive() function with too many callback parameters -- -Exception: array_walk_recursive() expects at most 3 arguments, 4 given +ArgumentCountError: array_walk_recursive() expects at most 3 arguments, 4 given Done diff --git a/ext/standard/tests/array/array_walk/array_walk_recursive_variation8.phpt b/ext/standard/tests/array/array_walk/array_walk_recursive_variation8.phpt index aafa158d6c73..db8feaf3bedc 100644 --- a/ext/standard/tests/array/array_walk/array_walk_recursive_variation8.phpt +++ b/ext/standard/tests/array/array_walk/array_walk_recursive_variation8.phpt @@ -22,8 +22,8 @@ var_dump( array_walk_recursive($input, "min")); echo "-- With 'echo' language construct --\n"; try { var_dump( array_walk_recursive($input, "echo")); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done" @@ -35,5 +35,5 @@ bool(true) -- With 'min' built-in function -- bool(true) -- With 'echo' language construct -- -array_walk_recursive(): Argument #2 ($callback) must be a valid callback, function "echo" not found or invalid function name +TypeError: array_walk_recursive(): Argument #2 ($callback) must be a valid callback, function "echo" not found or invalid function name Done diff --git a/ext/standard/tests/array/array_walk/array_walk_variation8.phpt b/ext/standard/tests/array/array_walk/array_walk_variation8.phpt index a4dae8a7e184..11ad5496d430 100644 --- a/ext/standard/tests/array/array_walk/array_walk_variation8.phpt +++ b/ext/standard/tests/array/array_walk/array_walk_variation8.phpt @@ -22,8 +22,8 @@ var_dump( array_walk($input, "min")); echo "-- With 'echo' language construct --\n"; try { var_dump( array_walk($input, "echo")); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done" @@ -35,5 +35,5 @@ bool(true) -- With 'min' built-in function -- bool(true) -- With 'echo' language construct -- -array_walk(): Argument #2 ($callback) must be a valid callback, function "echo" not found or invalid function name +TypeError: array_walk(): Argument #2 ($callback) must be a valid callback, function "echo" not found or invalid function name Done diff --git a/ext/standard/tests/array/array_walk/bug30266.phpt b/ext/standard/tests/array/array_walk/bug30266.phpt index 2579714ae70f..2909971f22f6 100644 --- a/ext/standard/tests/array/array_walk/bug30266.phpt +++ b/ext/standard/tests/array/array_walk/bug30266.phpt @@ -26,10 +26,10 @@ try { array_walk($fruits, 'test', $myobj); } -catch(Exception $e) +catch(Throwable $e) { - echo "Caught: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Caught: Error +Exception: Error diff --git a/ext/standard/tests/array/array_walk/bug70713.phpt b/ext/standard/tests/array/array_walk/bug70713.phpt index fab1661e84e0..bccade4cecce 100644 --- a/ext/standard/tests/array/array_walk/bug70713.phpt +++ b/ext/standard/tests/array/array_walk/bug70713.phpt @@ -22,10 +22,10 @@ $arr = array('string' => new obj); try { array_walk_recursive($arr, 'settype'); -} catch (\TypeError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Iterated value is no longer an array or object +TypeError: Iterated value is no longer an array or object diff --git a/ext/standard/tests/array/array_walk/bug79839.phpt b/ext/standard/tests/array/array_walk/bug79839.phpt index fe7db73c4683..fa2727abe6b6 100644 --- a/ext/standard/tests/array/array_walk/bug79839.phpt +++ b/ext/standard/tests/array/array_walk/bug79839.phpt @@ -12,15 +12,15 @@ try { array_walk($test, function(&$ref) { $ref = []; // Should throw }); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test); ?> --EXPECTF-- Deprecated: array_walk(): Passing an object for argument #1 $array to array_walk() is deprecated, call get_object_vars() first instead in %s on line %d -Cannot assign array to reference held by property Test::$prop of type int +TypeError: Cannot assign array to reference held by property Test::$prop of type int object(Test)#1 (1) { ["prop"]=> int(42) diff --git a/ext/standard/tests/array/bug40191.phpt b/ext/standard/tests/array/bug40191.phpt index c1a0d6b6c367..128cd4b19954 100644 --- a/ext/standard/tests/array/bug40191.phpt +++ b/ext/standard/tests/array/bug40191.phpt @@ -10,12 +10,12 @@ $arrObj->append('foo'); try { $arr = array_unique($arrObj); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; ?> --EXPECT-- -array_unique(): Argument #1 ($array) must be of type array, ArrayObject given +TypeError: array_unique(): Argument #1 ($array) must be of type array, ArrayObject given Done diff --git a/ext/standard/tests/array/bug42177.phpt b/ext/standard/tests/array/bug42177.phpt index dc5297b30204..2308824b3515 100644 --- a/ext/standard/tests/array/bug42177.phpt +++ b/ext/standard/tests/array/bug42177.phpt @@ -20,8 +20,8 @@ $a2 = array( 'key1' => &$a1 ); $a1 = array_merge_recursive( $a1, $a2 ); try { $a1 = array_merge_recursive( $a1, $a2 ); -} catch (\Error $e) { - echo $e->getMessage() . " on line " . $e->getLine() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), ' on line ', $e->getLine(), "\n"; } unset( $a1, $a2 ); @@ -35,4 +35,4 @@ unset( $a1, $a2 ); ?> --EXPECT-- -Recursion detected on line 19 +Error: Recursion detected on line 19 diff --git a/ext/standard/tests/array/bug43495.phpt b/ext/standard/tests/array/bug43495.phpt index 37c4f6b604ba..21140d68c0b7 100644 --- a/ext/standard/tests/array/bug43495.phpt +++ b/ext/standard/tests/array/bug43495.phpt @@ -11,8 +11,8 @@ $b["key1"]["key2"]["key3"]=&$b; try { array_merge_recursive($a,$b); -} catch (\Error $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } /* Break recursion */ @@ -21,4 +21,4 @@ $b["key1"]["key2"]["key3"] = null; ?> --EXPECT-- -Recursion detected +Error: Recursion detected diff --git a/ext/standard/tests/array/bug61058.phpt b/ext/standard/tests/array/bug61058.phpt index 6e78b357117e..d7a5e6252c51 100644 --- a/ext/standard/tests/array/bug61058.phpt +++ b/ext/standard/tests/array/bug61058.phpt @@ -5,9 +5,9 @@ Bug #61058 (array_fill leaks if start index is PHP_INT_MAX) try { array_fill(PHP_INT_MAX, 2, '*'); -} catch (\Error $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot add element to the array as the next element is already occupied +Error: Cannot add element to the array as the next element is already occupied diff --git a/ext/standard/tests/array/bug65251.phpt b/ext/standard/tests/array/bug65251.phpt index 6d9cded21c84..31c73223d8ed 100644 --- a/ext/standard/tests/array/bug65251.phpt +++ b/ext/standard/tests/array/bug65251.phpt @@ -6,8 +6,8 @@ Bug #65251: array_merge_recursive() recursion detection broken /* This no longer involves any recursion. */ try { array_merge_recursive($GLOBALS, $GLOBALS); -} catch (\Error $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/ext/standard/tests/array/bug68553.phpt b/ext/standard/tests/array/bug68553.phpt index d309171096c9..2f172ba5861d 100644 --- a/ext/standard/tests/array/bug68553.phpt +++ b/ext/standard/tests/array/bug68553.phpt @@ -24,13 +24,13 @@ var_dump(array_column($a, null, 'a')); try { var_dump(array_column([['a' => new stdClass]], null, 'a')); -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(array_column([['a' => []]], null, 'a')); -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- @@ -83,5 +83,5 @@ array(8) { NULL } } -Cannot access offset of type stdClass on array -Cannot access offset of type array on array +TypeError: Cannot access offset of type stdClass on array +TypeError: Cannot access offset of type array on array diff --git a/ext/standard/tests/array/bug71220.phpt b/ext/standard/tests/array/bug71220.phpt index 5c5f43eeea89..bf31603d1e74 100644 --- a/ext/standard/tests/array/bug71220.phpt +++ b/ext/standard/tests/array/bug71220.phpt @@ -5,9 +5,9 @@ Bug #71220 (Null pointer deref (segfault) in compact via ob_start) ob_start("compact"); try { ob_end_clean(); -} catch (\Error $e) { - echo $e->getMessage(); +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot call compact() dynamically +Error: Cannot call compact() dynamically diff --git a/ext/standard/tests/array/bug74345.phpt b/ext/standard/tests/array/bug74345.phpt index 64942f126e7b..f612a4e6119e 100644 --- a/ext/standard/tests/array/bug74345.phpt +++ b/ext/standard/tests/array/bug74345.phpt @@ -15,13 +15,13 @@ array_map($cb, []); array_map($cb, [], []); try { array_map($cb, null); -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { array_map($cb, null, null); -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } array_filter([], $cb); array_reduce([], $cb); @@ -33,14 +33,14 @@ usort($array, $cb); try { preg_replace_callback('/./', $cb, new stdClass); -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> ===DONE=== --EXPECT-- -array_map(): Argument #2 ($array) must be of type array, null given -array_map(): Argument #2 ($array) must be of type array, null given -preg_replace_callback(): Argument #3 ($subject) must be of type array|string, stdClass given +TypeError: array_map(): Argument #2 ($array) must be of type array, null given +TypeError: array_map(): Argument #2 ($array) must be of type array, null given +TypeError: preg_replace_callback(): Argument #3 ($subject) must be of type array|string, stdClass given ===DONE=== diff --git a/ext/standard/tests/array/bug77135.phpt b/ext/standard/tests/array/bug77135.phpt index 0b23d6276626..ba559103a900 100644 --- a/ext/standard/tests/array/bug77135.phpt +++ b/ext/standard/tests/array/bug77135.phpt @@ -37,7 +37,7 @@ class Extract echo " \$this = " . get_class($this) . "\n"; echo " \$v_this = " . (isset($x_this) ? $x_this : "NULL") . "\n"; } catch (\Throwable $e) { - echo " Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } @@ -47,8 +47,8 @@ class Extract ?> --EXPECT-- EXTR_OVERWRITE - Exception: Cannot re-assign $this - Exception: Cannot re-assign $this +Error: Cannot re-assign $this +Error: Cannot re-assign $this EXTR_SKIP extract() = 0 diff --git a/ext/standard/tests/array/bug77931.phpt b/ext/standard/tests/array/bug77931.phpt index d876d4b01c6a..b6b42067beed 100644 --- a/ext/standard/tests/array/bug77931.phpt +++ b/ext/standard/tests/array/bug77931.phpt @@ -5,22 +5,22 @@ Bug #77931: Warning for array_map mentions wrong type try { array_map('trim', array(), 1); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { array_map('trim', array(), array(), true); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { array_map('trim', array(), array(), array(), null); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -array_map(): Argument #3 must be of type array, int given -array_map(): Argument #4 must be of type array, true given -array_map(): Argument #5 must be of type array, null given +TypeError: array_map(): Argument #3 must be of type array, int given +TypeError: array_map(): Argument #4 must be of type array, true given +TypeError: array_map(): Argument #5 must be of type array, null given diff --git a/ext/standard/tests/array/compact_variation1.phpt b/ext/standard/tests/array/compact_variation1.phpt index afc290ed6246..1f5f8b809f89 100644 --- a/ext/standard/tests/array/compact_variation1.phpt +++ b/ext/standard/tests/array/compact_variation1.phpt @@ -18,14 +18,14 @@ $arr3 = array(&$string); try { var_dump(compact($arr1)); -} catch (Error $e) { - echo $e->getMessage() . "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(compact($arr2)); -} catch (Error $e) { - echo $e->getMessage() . "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(compact($arr3)); @@ -33,8 +33,8 @@ var_dump(compact($arr3)); ?> --EXPECT-- *** Testing compact() : usage variations - arrays containing references *** -Recursion detected -Recursion detected +Error: Recursion detected +Error: Recursion detected array(1) { ["c"]=> int(3) diff --git a/ext/standard/tests/array/count_invalid.phpt b/ext/standard/tests/array/count_invalid.phpt index d05c6a1961ee..35353ebeb96d 100644 --- a/ext/standard/tests/array/count_invalid.phpt +++ b/ext/standard/tests/array/count_invalid.phpt @@ -6,50 +6,50 @@ Only arrays and countable objects can be counted try { $result = count(null); var_dump($result); -} catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $result = count("string"); var_dump($result); -} catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $result = count(123); var_dump($result); -} catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $result = count(true); var_dump($result); -} catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $result = count(false); var_dump($result); -} catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $result = count((object) []); var_dump($result); -} catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -count(): Argument #1 ($value) must be of type Countable|array, null given -count(): Argument #1 ($value) must be of type Countable|array, string given -count(): Argument #1 ($value) must be of type Countable|array, int given -count(): Argument #1 ($value) must be of type Countable|array, true given -count(): Argument #1 ($value) must be of type Countable|array, false given -count(): Argument #1 ($value) must be of type Countable|array, stdClass given +TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given +TypeError: count(): Argument #1 ($value) must be of type Countable|array, string given +TypeError: count(): Argument #1 ($value) must be of type Countable|array, int given +TypeError: count(): Argument #1 ($value) must be of type Countable|array, true given +TypeError: count(): Argument #1 ($value) must be of type Countable|array, false given +TypeError: count(): Argument #1 ($value) must be of type Countable|array, stdClass given diff --git a/ext/standard/tests/array/count_invalid_mode.phpt b/ext/standard/tests/array/count_invalid_mode.phpt index be39690e856b..8a778f0380e2 100644 --- a/ext/standard/tests/array/count_invalid_mode.phpt +++ b/ext/standard/tests/array/count_invalid_mode.phpt @@ -17,8 +17,8 @@ $modes = [ foreach ($modes as $mode) { try { var_dump(count([], $mode)); - } catch (\ValueError $error) { - echo $error->getMessage() . \PHP_EOL; + } catch (\Throwable $error) { + echo $error::class, ': ', $error->getMessage(), "\n"; } } ?> @@ -27,7 +27,7 @@ int(0) int(0) int(0) int(0) -count(): Argument #2 ($mode) must be either COUNT_NORMAL or COUNT_RECURSIVE -count(): Argument #2 ($mode) must be either COUNT_NORMAL or COUNT_RECURSIVE +ValueError: count(): Argument #2 ($mode) must be either COUNT_NORMAL or COUNT_RECURSIVE +ValueError: count(): Argument #2 ($mode) must be either COUNT_NORMAL or COUNT_RECURSIVE int(0) int(0) diff --git a/ext/standard/tests/array/extract_error.phpt b/ext/standard/tests/array/extract_error.phpt index f2b0cfa69c7e..b36b5274826e 100644 --- a/ext/standard/tests/array/extract_error.phpt +++ b/ext/standard/tests/array/extract_error.phpt @@ -11,26 +11,26 @@ $arr = array(1); try { var_dump( extract($arr, -1) ); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( extract($arr, 7 , "wddr") ); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } /* Two Arguments, second as prefix but without prefix string as third argument */ try { var_dump( extract($arr,EXTR_PREFIX_IF_EXISTS) ); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- *** Testing Error Conditions *** -extract(): Argument #2 ($flags) must be a valid extract type -extract(): Argument #2 ($flags) must be a valid extract type -extract(): Argument #3 ($prefix) is required when using this extract type +ValueError: extract(): Argument #2 ($flags) must be a valid extract type +ValueError: extract(): Argument #2 ($flags) must be a valid extract type +ValueError: extract(): Argument #3 ($prefix) is required when using this extract type diff --git a/ext/standard/tests/array/extract_error_variation1.phpt b/ext/standard/tests/array/extract_error_variation1.phpt index a8fe2fa85007..ebec02cc29d1 100644 --- a/ext/standard/tests/array/extract_error_variation1.phpt +++ b/ext/standard/tests/array/extract_error_variation1.phpt @@ -6,9 +6,9 @@ $a = ["1" => "one", "2" => "two", "3" => "three", "4" => "four", "5" => "five"]; try { extract($a, EXTR_PREFIX_ALL, '85bogus'); -} catch (\ValueError $e) { - echo $e->getMessage(); +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -extract(): Argument #3 ($prefix) must be a valid identifier +ValueError: extract(): Argument #3 ($prefix) must be a valid identifier diff --git a/ext/standard/tests/array/extract_typed_ref.phpt b/ext/standard/tests/array/extract_typed_ref.phpt index 6d2a5a9272d7..8dc4794ca636 100644 --- a/ext/standard/tests/array/extract_typed_ref.phpt +++ b/ext/standard/tests/array/extract_typed_ref.phpt @@ -13,11 +13,11 @@ $i =& $test->i; $s =& $test->s; try { extract(['i' => 'foo', 's' => 42]); -} catch (TypeError $e) { echo $e->getMessage(), "\n"; } +} catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test->i, $test->s); ?> --EXPECT-- -Cannot assign string to reference held by property Test::$i of type int +TypeError: Cannot assign string to reference held by property Test::$i of type int int(0) string(0) "" diff --git a/ext/standard/tests/array/gh14775.phpt b/ext/standard/tests/array/gh14775.phpt index df4db76031ec..1d0c3e779f8e 100644 --- a/ext/standard/tests/array/gh14775.phpt +++ b/ext/standard/tests/array/gh14775.phpt @@ -5,8 +5,8 @@ GH-14775: Range negative step overflow $var = -PHP_INT_MAX - 1; try { range($var,1,$var); -} catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } --EXPECTF-- -range(): Argument #3 ($step) must be greater than %s +ValueError: range(): Argument #3 ($step) must be greater than %s diff --git a/ext/standard/tests/array/gh16649/array_splice_uaf_add_elements.phpt b/ext/standard/tests/array/gh16649/array_splice_uaf_add_elements.phpt index f5e538122f41..04f926d63359 100644 --- a/ext/standard/tests/array/gh16649/array_splice_uaf_add_elements.phpt +++ b/ext/standard/tests/array/gh16649/array_splice_uaf_add_elements.phpt @@ -14,9 +14,9 @@ $arr = ["1", new C, "2"]; try { array_splice($arr, 1, 2); echo "ERROR: Should have thrown exception\n"; -} catch (Error $e) { - echo "Exception caught: " . $e->getMessage() . "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Exception caught: Array was modified during array_splice operation +Error: Array was modified during array_splice operation diff --git a/ext/standard/tests/array/gh16649/array_splice_uaf_array_deallocated.phpt b/ext/standard/tests/array/gh16649/array_splice_uaf_array_deallocated.phpt index 1874ddad8934..3c6f2fdb5987 100644 --- a/ext/standard/tests/array/gh16649/array_splice_uaf_array_deallocated.phpt +++ b/ext/standard/tests/array/gh16649/array_splice_uaf_array_deallocated.phpt @@ -14,9 +14,9 @@ $arr = ["1", new C, "2"]; try { array_splice($arr, 1, 2); echo "ERROR: Should have thrown exception\n"; -} catch (Error $e) { - echo "Exception caught: " . $e->getMessage() . "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Exception caught: Array was modified during array_splice operation +Error: Array was modified during array_splice operation diff --git a/ext/standard/tests/array/gh16649/array_splice_uaf_complex_modification.phpt b/ext/standard/tests/array/gh16649/array_splice_uaf_complex_modification.phpt index 8ad4133300ec..0d50989f6b62 100644 --- a/ext/standard/tests/array/gh16649/array_splice_uaf_complex_modification.phpt +++ b/ext/standard/tests/array/gh16649/array_splice_uaf_complex_modification.phpt @@ -17,9 +17,9 @@ $arr = ["first", new ComplexModifier, "last"]; try { array_splice($arr, 1, 1, ["replacement"]); echo "ERROR: Should have thrown exception\n"; -} catch (Error $e) { - echo "Exception caught: " . $e->getMessage() . "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Exception caught: Array was modified during array_splice operation +Error: Array was modified during array_splice operation diff --git a/ext/standard/tests/array/gh16649/array_splice_uaf_multiple_destructors.phpt b/ext/standard/tests/array/gh16649/array_splice_uaf_multiple_destructors.phpt index 9e2c6cf8fc71..2b7b85f849da 100644 --- a/ext/standard/tests/array/gh16649/array_splice_uaf_multiple_destructors.phpt +++ b/ext/standard/tests/array/gh16649/array_splice_uaf_multiple_destructors.phpt @@ -23,11 +23,11 @@ $arr = ["start", new MultiDestructor(1), new MultiDestructor(2), "end"]; try { array_splice($arr, 1, 2); echo "ERROR: Should have thrown exception\n"; -} catch (Error $e) { - echo "Exception caught: " . $e->getMessage() . "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- Destructor 1 called Destructor 2 called -Exception caught: Array was modified during array_splice operation +Error: Array was modified during array_splice operation diff --git a/ext/standard/tests/array/gh16649/array_splice_uaf_original_case.phpt b/ext/standard/tests/array/gh16649/array_splice_uaf_original_case.phpt index dcfa8f2e759c..ae9b27034026 100644 --- a/ext/standard/tests/array/gh16649/array_splice_uaf_original_case.phpt +++ b/ext/standard/tests/array/gh16649/array_splice_uaf_original_case.phpt @@ -21,10 +21,10 @@ $arr = ["a" => "1", "3" => new C, "2" => "2"]; try { array_splice($arr, 1, 2); echo "ERROR: Should have thrown exception\n"; -} catch (Error $e) { - echo "Exception caught: " . $e->getMessage() . "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Deprecated: Returning a value from a destructor is deprecated in %s on line %d -Exception caught: Array was modified during array_splice operation +Error: Array was modified during array_splice operation diff --git a/ext/standard/tests/array/gh16649/array_splice_uaf_packed_to_hash.phpt b/ext/standard/tests/array/gh16649/array_splice_uaf_packed_to_hash.phpt index bd8f511b6253..139c9dab8b28 100644 --- a/ext/standard/tests/array/gh16649/array_splice_uaf_packed_to_hash.phpt +++ b/ext/standard/tests/array/gh16649/array_splice_uaf_packed_to_hash.phpt @@ -15,9 +15,9 @@ $arr = ["1", new C, "2"]; try { array_splice($arr, 1, 2); echo "ERROR: Should have thrown exception\n"; -} catch (Error $e) { - echo "Exception caught: " . $e->getMessage() . "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Exception caught: Array was modified during array_splice operation +Error: Array was modified during array_splice operation diff --git a/ext/standard/tests/array/gh16649/array_splice_with_replacement.phpt b/ext/standard/tests/array/gh16649/array_splice_with_replacement.phpt index 8754a913a24e..ad0d73258e79 100644 --- a/ext/standard/tests/array/gh16649/array_splice_with_replacement.phpt +++ b/ext/standard/tests/array/gh16649/array_splice_with_replacement.phpt @@ -15,9 +15,9 @@ $replacement = ["replacement1", "replacement2"]; try { array_splice($arr, 1, 1, $replacement); echo "ERROR: Should have thrown exception\n"; -} catch (Error $e) { - echo "Exception caught: " . $e->getMessage() . "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Exception caught: Array was modified during array_splice operation +Error: Array was modified during array_splice operation diff --git a/ext/standard/tests/array/gh19300_2.phpt b/ext/standard/tests/array/gh19300_2.phpt index 41ae7e82bb79..7b6c061423ad 100644 --- a/ext/standard/tests/array/gh19300_2.phpt +++ b/ext/standard/tests/array/gh19300_2.phpt @@ -6,8 +6,8 @@ GH-19300 (Nested array_multisort invocation with error breaks) - error variation function error_handle($level, $message, $file = '', $line = 0){ try { array_multisort($a, SORT_ASC); // Trigger multisort abort - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } set_error_handler('error_handle'); @@ -22,10 +22,10 @@ var_dump(array_multisort($inputs, SORT_NUMERIC)); var_dump($inputs); ?> --EXPECT-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag -array_multisort(): Argument #1 ($array) must be an array or a sort flag -array_multisort(): Argument #1 ($array) must be an array or a sort flag -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag bool(true) array(3) { [0]=> diff --git a/ext/standard/tests/array/gh20043.phpt b/ext/standard/tests/array/gh20043.phpt index d5c7e06417f1..b7a4390db268 100644 --- a/ext/standard/tests/array/gh20043.phpt +++ b/ext/standard/tests/array/gh20043.phpt @@ -4,9 +4,9 @@ GH-20043 (array_unique assertion failure with RC1 array causing an exception on getMessage(); +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string diff --git a/ext/standard/tests/array/in_array/in_array_variation3.phpt b/ext/standard/tests/array/in_array/in_array_variation3.phpt index 95617e945f38..ef020dea6f07 100644 --- a/ext/standard/tests/array/in_array/in_array_variation3.phpt +++ b/ext/standard/tests/array/in_array/in_array_variation3.phpt @@ -31,14 +31,14 @@ $in_array_obj = new in_array_check(); //creating new object //error: as wrong datatype for second argument try { var_dump( in_array("array_var", $in_array_obj) ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } //error: as wrong datatype for second argument try { var_dump( in_array("foo", $in_array_obj) ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } //element found as "one" exists in array $array_var var_dump( in_array("one", $in_array_obj->array_var) ); @@ -52,7 +52,7 @@ bool(true) bool(true) *** Testing objects with in_array() *** -in_array(): Argument #2 ($haystack) must be of type array, in_array_check given -in_array(): Argument #2 ($haystack) must be of type array, in_array_check given +TypeError: in_array(): Argument #2 ($haystack) must be of type array, in_array_check given +TypeError: in_array(): Argument #2 ($haystack) must be of type array, in_array_check given bool(true) Done diff --git a/ext/standard/tests/array/max.phpt b/ext/standard/tests/array/max.phpt index 065461001690..83d1ae31ae99 100644 --- a/ext/standard/tests/array/max.phpt +++ b/ext/standard/tests/array/max.phpt @@ -7,20 +7,20 @@ precision=14 try { var_dump(max(1)); -} catch (\TypeError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(max(array())); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(max(new stdclass)); -} catch (\TypeError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(max(2,1,2)); @@ -33,9 +33,9 @@ var_dump(max(0, true, false, true)); ?> --EXPECT-- -max(): Argument #1 ($value) must be of type array, int given -max(): Argument #1 ($value) must contain at least one element -max(): Argument #1 ($value) must be of type array, stdClass given +TypeError: max(): Argument #1 ($value) must be of type array, int given +ValueError: max(): Argument #1 ($value) must contain at least one element +TypeError: max(): Argument #1 ($value) must be of type array, stdClass given int(2) float(2.11) string(1) "t" diff --git a/ext/standard/tests/array/min.phpt b/ext/standard/tests/array/min.phpt index 97be4ad6828e..79decb4866db 100644 --- a/ext/standard/tests/array/min.phpt +++ b/ext/standard/tests/array/min.phpt @@ -7,20 +7,20 @@ precision=14 try { var_dump(min(1)); -} catch (\TypeError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(min(array())); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(min(new stdclass)); -} catch (\TypeError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(min(2,1,2)); @@ -33,9 +33,9 @@ var_dump(min(0, true, false, true)); ?> --EXPECT-- -min(): Argument #1 ($value) must be of type array, int given -min(): Argument #1 ($value) must contain at least one element -min(): Argument #1 ($value) must be of type array, stdClass given +TypeError: min(): Argument #1 ($value) must be of type array, int given +ValueError: min(): Argument #1 ($value) must contain at least one element +TypeError: min(): Argument #1 ($value) must be of type array, stdClass given int(1) float(2.09) string(0) "" diff --git a/ext/standard/tests/array/range/range_bug70239_0.phpt b/ext/standard/tests/array/range/range_bug70239_0.phpt index 52f046a7e473..d378b9aec6be 100644 --- a/ext/standard/tests/array/range/range_bug70239_0.phpt +++ b/ext/standard/tests/array/range/range_bug70239_0.phpt @@ -4,9 +4,9 @@ Bug #70239 Creating a huge array doesn't result in exhausted, but segfault, var getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -range(): Argument #2 ($end) must be a finite number, INF provided +ValueError: range(): Argument #2 ($end) must be a finite number, INF provided diff --git a/ext/standard/tests/array/range/range_bug70239_1.phpt b/ext/standard/tests/array/range/range_bug70239_1.phpt index 681d594a74dc..e772fe8c4d08 100644 --- a/ext/standard/tests/array/range/range_bug70239_1.phpt +++ b/ext/standard/tests/array/range/range_bug70239_1.phpt @@ -4,9 +4,9 @@ Bug #70239 Creating a huge array doesn't result in exhausted, but segfault, var getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -range(): Argument #1 ($start) must be a finite number, INF provided +ValueError: range(): Argument #1 ($start) must be a finite number, INF provided diff --git a/ext/standard/tests/array/range/range_bug70239_2.phpt b/ext/standard/tests/array/range/range_bug70239_2.phpt index b20f360dba18..75e98cd0cc04 100644 --- a/ext/standard/tests/array/range/range_bug70239_2.phpt +++ b/ext/standard/tests/array/range/range_bug70239_2.phpt @@ -4,9 +4,9 @@ Bug #70239 Creating a huge array doesn't result in exhausted, but segfault, var getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -The supplied range exceeds the maximum array size by %d elements: start=0, end=%d, step=1. Calculated size: %d. Maximum size: %d. +ValueError: The supplied range exceeds the maximum array size by %d elements: start=0, end=%d, step=1. Calculated size: %d. Maximum size: %d. diff --git a/ext/standard/tests/array/range/range_bug70239_3.phpt b/ext/standard/tests/array/range/range_bug70239_3.phpt index 6307927438df..82ac1d959832 100644 --- a/ext/standard/tests/array/range/range_bug70239_3.phpt +++ b/ext/standard/tests/array/range/range_bug70239_3.phpt @@ -4,9 +4,9 @@ Bug #70239 Creating a huge array doesn't result in exhausted, but segfault, var getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -The supplied range exceeds the maximum array size by %d elements: start=-%d, end=0, step=1. Calculated size: %d. Maximum size: %d. +ValueError: The supplied range exceeds the maximum array size by %d elements: start=-%d, end=0, step=1. Calculated size: %d. Maximum size: %d. diff --git a/ext/standard/tests/array/range/range_inputs_float_NAN_values.phpt b/ext/standard/tests/array/range/range_inputs_float_NAN_values.phpt index cbfd2e914413..9aa736187f92 100644 --- a/ext/standard/tests/array/range/range_inputs_float_NAN_values.phpt +++ b/ext/standard/tests/array/range/range_inputs_float_NAN_values.phpt @@ -28,8 +28,8 @@ foreach ($fs as $s) { echo 'range(', safe_to_string($s), ', ', safe_to_string($e), ");\n"; try { var_dump( range($s, $e) ); - } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + } catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } } @@ -40,35 +40,35 @@ float(NAN) float(NAN) float(NAN) range(NAN, NAN); -range(): Argument #1 ($start) must be a finite number, NAN provided +ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided range(NAN, NAN); -range(): Argument #1 ($start) must be a finite number, NAN provided +ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided range(NAN, NAN); -range(): Argument #1 ($start) must be a finite number, NAN provided +ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided range(NAN, 5.5); -range(): Argument #1 ($start) must be a finite number, NAN provided +ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided range(NAN, NAN); -range(): Argument #1 ($start) must be a finite number, NAN provided +ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided range(NAN, NAN); -range(): Argument #1 ($start) must be a finite number, NAN provided +ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided range(NAN, NAN); -range(): Argument #1 ($start) must be a finite number, NAN provided +ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided range(NAN, 5.5); -range(): Argument #1 ($start) must be a finite number, NAN provided +ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided range(NAN, NAN); -range(): Argument #1 ($start) must be a finite number, NAN provided +ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided range(NAN, NAN); -range(): Argument #1 ($start) must be a finite number, NAN provided +ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided range(NAN, NAN); -range(): Argument #1 ($start) must be a finite number, NAN provided +ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided range(NAN, 5.5); -range(): Argument #1 ($start) must be a finite number, NAN provided +ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided range(5.5, NAN); -range(): Argument #2 ($end) must be a finite number, NAN provided +ValueError: range(): Argument #2 ($end) must be a finite number, NAN provided range(5.5, NAN); -range(): Argument #2 ($end) must be a finite number, NAN provided +ValueError: range(): Argument #2 ($end) must be a finite number, NAN provided range(5.5, NAN); -range(): Argument #2 ($end) must be a finite number, NAN provided +ValueError: range(): Argument #2 ($end) must be a finite number, NAN provided range(5.5, 5.5); array(1) { [0]=> diff --git a/ext/standard/tests/array/range/range_inputs_float_small_step_exhaustion.phpt b/ext/standard/tests/array/range/range_inputs_float_small_step_exhaustion.phpt index 41ae4ef995bf..848f7ea51b33 100644 --- a/ext/standard/tests/array/range/range_inputs_float_small_step_exhaustion.phpt +++ b/ext/standard/tests/array/range/range_inputs_float_small_step_exhaustion.phpt @@ -4,15 +4,15 @@ Creating a range that exceeds the maximum array size getMessage(), \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(range(PHP_INT_MIN, PHP_INT_MAX, 1)); -} catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -The supplied range exceeds the maximum array size by %f elements: start=0.0, end=%f, step=0.1. Max size: %d -The supplied range exceeds the maximum array size by %d elements: start=-%d, end=%d, step=1. Calculated size: %d. Maximum size: %d. +ValueError: The supplied range exceeds the maximum array size by %f elements: start=0.0, end=%f, step=0.1. Max size: %d +ValueError: The supplied range exceeds the maximum array size by %d elements: start=-%d, end=%d, step=1. Calculated size: %d. Maximum size: %d. diff --git a/ext/standard/tests/array/range/range_step_errors.phpt b/ext/standard/tests/array/range/range_step_errors.phpt index e950c527863e..a47a0e5359f4 100644 --- a/ext/standard/tests/array/range/range_step_errors.phpt +++ b/ext/standard/tests/array/range/range_step_errors.phpt @@ -7,128 +7,128 @@ precision=14 echo "Step cannot be 0\n"; try { var_dump( range(1.0, 7.0, 0.0) ); -} catch (\ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( range(1, 7, 0) ); -} catch (\ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( range('A', 'H', 0) ); -} catch (\ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( range('A', 'H', 0.0) ); -} catch (\ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Step cannot be INF\n"; try { var_dump( range(1.0, 7.0, 10.0**400) ); -} catch (\ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( range(1, 7, 10.0**400) ); -} catch (\ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( range('A', 'H', 10.0**400) ); -} catch (\ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Step cannot be NAN\n"; try { var_dump( range(1.0, 7.0, fdiv(0, 0)) ); -} catch (\ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( range(1, 7, fdiv(0, 0)) ); -} catch (\ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( range('A', 'H', fdiv(0, 0)) ); -} catch (\ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Step must be within the range of input parameters\n"; echo "-- Testing ( (low < high) && (high-low < step) ) --\n"; try { var_dump( range(1.0, 7.0, 6.5) ); -} catch (\ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- Testing ( (low > high) && (low-high < step) ) --\n"; try { var_dump( range(7.0, 1.0, 6.5) ); -} catch (\ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- Testing ( (low < high) && (high-low < step) ) for characters --\n"; try { var_dump(range('a', 'z', 100)); -} catch (\ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- Testing ( (low > high) && (low-high < step) ) for characters --\n"; try { var_dump(range('z', 'a', 100)); -} catch (\ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Step must not be negative for increasing ranges\n"; try { var_dump(range('a', 'c', -1)); -} catch (\ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(range(1, 3, -1)); -} catch (\ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(range(1.5, 3.5, -1.5)); -} catch (\ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Step cannot be 0 -range(): Argument #3 ($step) cannot be 0 -range(): Argument #3 ($step) cannot be 0 -range(): Argument #3 ($step) cannot be 0 -range(): Argument #3 ($step) cannot be 0 +ValueError: range(): Argument #3 ($step) cannot be 0 +ValueError: range(): Argument #3 ($step) cannot be 0 +ValueError: range(): Argument #3 ($step) cannot be 0 +ValueError: range(): Argument #3 ($step) cannot be 0 Step cannot be INF -range(): Argument #3 ($step) must be a finite number, INF provided -range(): Argument #3 ($step) must be a finite number, INF provided -range(): Argument #3 ($step) must be a finite number, INF provided +ValueError: range(): Argument #3 ($step) must be a finite number, INF provided +ValueError: range(): Argument #3 ($step) must be a finite number, INF provided +ValueError: range(): Argument #3 ($step) must be a finite number, INF provided Step cannot be NAN -range(): Argument #3 ($step) must be a finite number, NAN provided -range(): Argument #3 ($step) must be a finite number, NAN provided -range(): Argument #3 ($step) must be a finite number, NAN provided +ValueError: range(): Argument #3 ($step) must be a finite number, NAN provided +ValueError: range(): Argument #3 ($step) must be a finite number, NAN provided +ValueError: range(): Argument #3 ($step) must be a finite number, NAN provided Step must be within the range of input parameters -- Testing ( (low < high) && (high-low < step) ) -- -range(): Argument #3 ($step) must be less than the range spanned by argument #1 ($start) and argument #2 ($end) +ValueError: range(): Argument #3 ($step) must be less than the range spanned by argument #1 ($start) and argument #2 ($end) -- Testing ( (low > high) && (low-high < step) ) -- -range(): Argument #3 ($step) must be less than the range spanned by argument #1 ($start) and argument #2 ($end) +ValueError: range(): Argument #3 ($step) must be less than the range spanned by argument #1 ($start) and argument #2 ($end) -- Testing ( (low < high) && (high-low < step) ) for characters -- -range(): Argument #3 ($step) must be less than the range spanned by argument #1 ($start) and argument #2 ($end) +ValueError: range(): Argument #3 ($step) must be less than the range spanned by argument #1 ($start) and argument #2 ($end) -- Testing ( (low > high) && (low-high < step) ) for characters -- -range(): Argument #3 ($step) must be less than the range spanned by argument #1 ($start) and argument #2 ($end) +ValueError: range(): Argument #3 ($step) must be less than the range spanned by argument #1 ($start) and argument #2 ($end) Step must not be negative for increasing ranges -range(): Argument #3 ($step) must be greater than 0 for increasing ranges -range(): Argument #3 ($step) must be greater than 0 for increasing ranges -range(): Argument #3 ($step) must be greater than 0 for increasing ranges +ValueError: range(): Argument #3 ($step) must be greater than 0 for increasing ranges +ValueError: range(): Argument #3 ($step) must be greater than 0 for increasing ranges +ValueError: range(): Argument #3 ($step) must be greater than 0 for increasing ranges diff --git a/ext/standard/tests/array/sizeof_object2.phpt b/ext/standard/tests/array/sizeof_object2.phpt index 115283d66130..b6cde4793399 100644 --- a/ext/standard/tests/array/sizeof_object2.phpt +++ b/ext/standard/tests/array/sizeof_object2.phpt @@ -76,22 +76,22 @@ for($i = 0; $i < count($objects); $i++) echo "Default Mode: "; try { var_dump( sizeof($var) ); - } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + } catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "COUNT_NORMAL Mode: "; try { var_dump( sizeof($var, COUNT_NORMAL) ); - } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + } catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "COUNT_RECURSIVE Mode: "; try { var_dump( sizeof($var, COUNT_RECURSIVE) ); - } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + } catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $counter++; @@ -103,23 +103,23 @@ echo "Done"; *** Testing sizeof() : object functionality *** --- Testing sizeof() with objects which doesn't implement Countable interface --- -- Iteration 1 -- -Default Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test given -COUNT_NORMAL Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test given -COUNT_RECURSIVE Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test given +Default Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, test given +COUNT_NORMAL Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, test given +COUNT_RECURSIVE Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, test given -- Iteration 2 -- -Default Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test1 given -COUNT_NORMAL Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test1 given -COUNT_RECURSIVE Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test1 given +Default Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, test1 given +COUNT_NORMAL Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, test1 given +COUNT_RECURSIVE Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, test1 given -- Iteration 3 -- -Default Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test2 given -COUNT_NORMAL Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test2 given -COUNT_RECURSIVE Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test2 given +Default Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, test2 given +COUNT_NORMAL Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, test2 given +COUNT_RECURSIVE Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, test2 given -- Iteration 4 -- -Default Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, child_test2 given -COUNT_NORMAL Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, child_test2 given -COUNT_RECURSIVE Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, child_test2 given +Default Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, child_test2 given +COUNT_NORMAL Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, child_test2 given +COUNT_RECURSIVE Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, child_test2 given -- Iteration 5 -- -Default Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, concrete_class given -COUNT_NORMAL Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, concrete_class given -COUNT_RECURSIVE Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, concrete_class given +Default Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, concrete_class given +COUNT_NORMAL Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, concrete_class given +COUNT_RECURSIVE Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, concrete_class given Done diff --git a/ext/standard/tests/array/sort/array_multisort_error.phpt b/ext/standard/tests/array/sort/array_multisort_error.phpt index 4f2d979f71d2..5d124ad455fb 100644 --- a/ext/standard/tests/array/sort/array_multisort_error.phpt +++ b/ext/standard/tests/array/sort/array_multisort_error.phpt @@ -8,16 +8,16 @@ echo "\n-- Testing array_multisort() function with repeated flags --\n"; $ar1 = array(1); try { var_dump( array_multisort($ar1, SORT_ASC, SORT_ASC) ); -} catch (\TypeError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing array_multisort() function with repeated flags --\n"; $ar1 = array(1); try { var_dump( array_multisort($ar1, SORT_STRING, SORT_NUMERIC) ); -} catch (\TypeError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -25,7 +25,7 @@ try { *** Testing array_multisort() : error conditions *** -- Testing array_multisort() function with repeated flags -- -array_multisort(): Argument #3 must be an array or a sort flag that has not already been specified +TypeError: array_multisort(): Argument #3 must be an array or a sort flag that has not already been specified -- Testing array_multisort() function with repeated flags -- -array_multisort(): Argument #3 must be an array or a sort flag that has not already been specified +TypeError: array_multisort(): Argument #3 must be an array or a sort flag that has not already been specified diff --git a/ext/standard/tests/array/sort/array_multisort_variation1.phpt b/ext/standard/tests/array/sort/array_multisort_variation1.phpt index c6cb286231e4..10d90f81f5d2 100644 --- a/ext/standard/tests/array/sort/array_multisort_variation1.phpt +++ b/ext/standard/tests/array/sort/array_multisort_variation1.phpt @@ -93,8 +93,8 @@ foreach($inputs as $key =>$value) { echo "\n--$key--\n"; try { var_dump( array_multisort($value)); - } catch (\ValueError | \TypeError $e) { - echo $e->getMessage() . "\n"; + } catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -103,76 +103,76 @@ foreach($inputs as $key =>$value) { *** Testing array_multisort() : usage variation *** --int 0-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag that has not already been specified +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag that has not already been specified --int 1-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag that has not already been specified +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag that has not already been specified --int 12345-- -array_multisort(): Argument #1 ($array) must be a valid sort flag +ValueError: array_multisort(): Argument #1 ($array) must be a valid sort flag --int -12345-- -array_multisort(): Argument #1 ($array) must be a valid sort flag +ValueError: array_multisort(): Argument #1 ($array) must be a valid sort flag --float 10.5-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --float -10.5-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --float 12.3456789000e10-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --float -12.3456789000e10-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --float .5-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --uppercase NULL-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --lowercase null-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --lowercase true-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --lowercase false-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --uppercase TRUE-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --uppercase FALSE-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --empty string DQ-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --empty string SQ-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --string DQ-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --string SQ-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --mixed case string-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --heredoc-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --instance of classWithToString-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --instance of classWithoutToString-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --undefined var-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --unset var-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag diff --git a/ext/standard/tests/array/sort/array_multisort_variation2.phpt b/ext/standard/tests/array/sort/array_multisort_variation2.phpt index b491b87bfda8..547b071237c8 100644 --- a/ext/standard/tests/array/sort/array_multisort_variation2.phpt +++ b/ext/standard/tests/array/sort/array_multisort_variation2.phpt @@ -101,8 +101,8 @@ foreach($inputs as $key =>$value) { echo "\n--$key--\n"; try { var_dump( array_multisort($ar1, $value) ); - } catch (\ValueError | \TypeError $e) { - echo $e->getMessage() . "\n"; + } catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -117,82 +117,82 @@ bool(true) bool(true) --int 12345-- -array_multisort(): Argument #2 must be a valid sort flag +ValueError: array_multisort(): Argument #2 must be a valid sort flag --int -12345-- -array_multisort(): Argument #2 must be a valid sort flag +ValueError: array_multisort(): Argument #2 must be a valid sort flag --float 10.5-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --float -10.5-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --float 12.3456789000e10-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --float -12.3456789000e10-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --float .5-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --empty array-- -Array sizes are inconsistent +ValueError: Array sizes are inconsistent --int indexed array-- -Array sizes are inconsistent +ValueError: Array sizes are inconsistent --associative array-- bool(true) --nested arrays-- -Array sizes are inconsistent +ValueError: Array sizes are inconsistent --uppercase NULL-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --lowercase null-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --lowercase true-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --lowercase false-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --uppercase TRUE-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --uppercase FALSE-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --empty string DQ-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --empty string SQ-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --string DQ-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --string SQ-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --mixed case string-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --heredoc-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --instance of classWithToString-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --instance of classWithoutToString-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --undefined var-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --unset var-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag diff --git a/ext/standard/tests/array/sort/array_multisort_variation3.phpt b/ext/standard/tests/array/sort/array_multisort_variation3.phpt index 71f837acd865..fa7789037cd4 100644 --- a/ext/standard/tests/array/sort/array_multisort_variation3.phpt +++ b/ext/standard/tests/array/sort/array_multisort_variation3.phpt @@ -93,8 +93,8 @@ foreach($inputs as $key =>$value) { echo "\n--$key--\n"; try { var_dump( array_multisort($ar1, SORT_REGULAR, $value) ); - } catch (\ValueError | \TypeError $e) { - echo $e->getMessage() . "\n"; + } catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -103,76 +103,76 @@ foreach($inputs as $key =>$value) { *** Testing array_multisort() : usage variation *** --int 0-- -array_multisort(): Argument #3 must be an array or a sort flag that has not already been specified +TypeError: array_multisort(): Argument #3 must be an array or a sort flag that has not already been specified --int 1-- -array_multisort(): Argument #3 must be an array or a sort flag that has not already been specified +TypeError: array_multisort(): Argument #3 must be an array or a sort flag that has not already been specified --int 12345-- -array_multisort(): Argument #3 must be a valid sort flag +ValueError: array_multisort(): Argument #3 must be a valid sort flag --int -12345-- -array_multisort(): Argument #3 must be a valid sort flag +ValueError: array_multisort(): Argument #3 must be a valid sort flag --float 10.5-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --float -10.5-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --float 12.3456789000e10-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --float -12.3456789000e10-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --float .5-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --uppercase NULL-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --lowercase null-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --lowercase true-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --lowercase false-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --uppercase TRUE-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --uppercase FALSE-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --empty string DQ-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --empty string SQ-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --string DQ-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --string SQ-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --mixed case string-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --heredoc-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --instance of classWithToString-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --instance of classWithoutToString-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --undefined var-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --unset var-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag diff --git a/ext/standard/tests/array/sort/asort_variation5.phpt b/ext/standard/tests/array/sort/asort_variation5.phpt index d5a8930f090c..766832a3a551 100644 --- a/ext/standard/tests/array/sort/asort_variation5.phpt +++ b/ext/standard/tests/array/sort/asort_variation5.phpt @@ -118,4 +118,4 @@ array(12) { string(2) "ww" ["x"]=> string(1) "x" -} \ No newline at end of file +} diff --git a/ext/standard/tests/array/sort/bug77395.phpt b/ext/standard/tests/array/sort/bug77395.phpt index a4a79f5e2f54..bea7219f2677 100644 --- a/ext/standard/tests/array/sort/bug77395.phpt +++ b/ext/standard/tests/array/sort/bug77395.phpt @@ -13,9 +13,9 @@ $data = [['aa'=> 'bb',], ['aa'=> 'bb',],]; try { array_multisort(array_column($data, 'bb'),SORT_DESC, $data); // PHP Warning error -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Array sizes are inconsistent +ValueError: Array sizes are inconsistent diff --git a/ext/standard/tests/assert/assert_basic6.phpt b/ext/standard/tests/assert/assert_basic6.phpt index b531425912c2..a3214a9df165 100644 --- a/ext/standard/tests/assert/assert_basic6.phpt +++ b/ext/standard/tests/assert/assert_basic6.phpt @@ -15,8 +15,8 @@ var_dump(assert_options(ASSERT_CALLBACK)); try { assert(false); -} catch (AssertionError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\n"; @@ -26,8 +26,8 @@ var_dump(assert_options(ASSERT_CALLBACK)); try { assert(false); -} catch (AssertionError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> @@ -41,7 +41,7 @@ Deprecated: Constant ASSERT_CALLBACK is deprecated since 8.3, as assert_options( Deprecated: Function assert_options() is deprecated since 8.3 in %s on line %d string(2) "f1" foo -assert(false) +AssertionError: assert(false) Deprecated: Constant ASSERT_CALLBACK is deprecated since 8.3, as assert_options() is deprecated in %s on line %d @@ -52,4 +52,4 @@ Deprecated: Constant ASSERT_CALLBACK is deprecated since 8.3, as assert_options( Deprecated: Function assert_options() is deprecated since 8.3 in %s on line %d NULL -assert(false) +AssertionError: assert(false) diff --git a/ext/standard/tests/assert/assert_options_error.phpt b/ext/standard/tests/assert/assert_options_error.phpt index d3b055e65f9a..8d2e9150a6ff 100644 --- a/ext/standard/tests/assert/assert_options_error.phpt +++ b/ext/standard/tests/assert/assert_options_error.phpt @@ -5,10 +5,10 @@ assert_options() - unknown assert option. getMessage(); +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Deprecated: Function assert_options() is deprecated since 8.3 in %s on line %d -assert_options(): Argument #1 ($option) must be an ASSERT_* constant +ValueError: assert_options(): Argument #1 ($option) must be an ASSERT_* constant diff --git a/ext/standard/tests/assert/assert_variation.phpt b/ext/standard/tests/assert/assert_variation.phpt index 6824f7246d5b..6889e46e24c3 100644 --- a/ext/standard/tests/assert/assert_variation.phpt +++ b/ext/standard/tests/assert/assert_variation.phpt @@ -53,8 +53,8 @@ echo "assert_options(ASSERT_CALLBACK) => [".assert_options(ASSERT_CALLBACK)."]\n echo "ini.get(\"assert.callback\") => [".ini_get("assert.callback")."]\n"; try { var_dump($r2=assert(0 != 0)); -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo"\n"; @@ -133,7 +133,7 @@ Deprecated: Constant ASSERT_CALLBACK is deprecated since 8.3, as assert_options( Deprecated: Function assert_options() is deprecated since 8.3 in %s on line %d assert_options(ASSERT_CALLBACK) => [c1] ini.get("assert.callback") => [f2] -Invalid callback c1, function "c1" not found or invalid function name +Error: Invalid callback c1, function "c1" not found or invalid function name Reset callback options to use a class method diff --git a/ext/standard/tests/assert/gh22290.phpt b/ext/standard/tests/assert/gh22290.phpt index e519a60f5572..d2b57779e1b4 100644 --- a/ext/standard/tests/assert/gh22290.phpt +++ b/ext/standard/tests/assert/gh22290.phpt @@ -9,31 +9,31 @@ assert.exception=1 try { $string = "Foo\x00bar"; assert(!str_contains($string, "\x00")); -} catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { assert(["a\x00b" => 1] === []); -} catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { assert("tab\there" === ""); -} catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { assert(str_contains("plain", "zzz")); -} catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -assert(!str_contains($string, "\000")) -assert(["a\000b" => 1] === []) -assert("tab\there" === '') -assert(str_contains('plain', 'zzz')) +AssertionError: assert(!str_contains($string, "\000")) +AssertionError: assert(["a\000b" => 1] === []) +AssertionError: assert("tab\there" === '') +AssertionError: assert(str_contains('plain', 'zzz')) diff --git a/ext/standard/tests/assert/gh22291.phpt b/ext/standard/tests/assert/gh22291.phpt index a50bd5861f05..01453159579a 100644 --- a/ext/standard/tests/assert/gh22291.phpt +++ b/ext/standard/tests/assert/gh22291.phpt @@ -8,12 +8,12 @@ try { var_dump("{{$foo}}"); var_dump("{$foo}"); assert(!"{{$foo}}"); -} catch (Error $e) { - echo $e->getMessage(), PHP_EOL; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- string(5) "{abc}" string(3) "abc" -assert(!"{{$foo}}") +AssertionError: assert(!"{{$foo}}") diff --git a/ext/standard/tests/assert/gh22292.phpt b/ext/standard/tests/assert/gh22292.phpt index e3aa72bf231a..97c742a981db 100644 --- a/ext/standard/tests/assert/gh22292.phpt +++ b/ext/standard/tests/assert/gh22292.phpt @@ -11,21 +11,21 @@ try { ${'---'} = 'abc'; var_dump(${'---'}); assert(!${'---'}); -} catch (Error $e) { - echo $e->getMessage(), PHP_EOL; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $f = new Foo(); var_dump($f->{'---'}); assert(!$f->{'---'}); -} catch (Error $e) { - echo $e->getMessage(), PHP_EOL; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- string(3) "abc" -assert(!${'---'}) +AssertionError: assert(!${'---'}) string(3) "---" -assert(!$f->{'---'}) +AssertionError: assert(!$f->{'---'}) diff --git a/ext/standard/tests/assert/gh22373.phpt b/ext/standard/tests/assert/gh22373.phpt index 8c26f77f490b..2d9fe9f5e793 100644 --- a/ext/standard/tests/assert/gh22373.phpt +++ b/ext/standard/tests/assert/gh22373.phpt @@ -11,18 +11,18 @@ class Foo { ) { try { assert(($this->f)('abc') !== 'cba'); - } catch (Error $e) { - echo $e->getMessage(), PHP_EOL; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { assert(($this?->f)('abc') !== 'cba'); - } catch (Error $e) { - echo $e->getMessage(), PHP_EOL; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { assert((self::$sf)('abc') !== 'cba'); - } catch (Error $e) { - echo $e->getMessage(), PHP_EOL; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } } @@ -31,6 +31,6 @@ new Foo(); ?> --EXPECT-- -assert(($this->f)('abc') !== 'cba') -assert(($this?->f)('abc') !== 'cba') -assert((self::$sf)('abc') !== 'cba') +AssertionError: assert(($this->f)('abc') !== 'cba') +AssertionError: assert(($this?->f)('abc') !== 'cba') +AssertionError: assert((self::$sf)('abc') !== 'cba') diff --git a/ext/standard/tests/assert/gh22387.phpt b/ext/standard/tests/assert/gh22387.phpt index 38c93921608a..deb66b94aa50 100644 --- a/ext/standard/tests/assert/gh22387.phpt +++ b/ext/standard/tests/assert/gh22387.phpt @@ -18,45 +18,45 @@ const baz = new stdClass(); try { assert(!$foo instanceof (bar)); -} catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { assert(!new (bar)()); -} catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { assert(!(bar)::m()); -} catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { assert(!(bar)::$p); -} catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { assert(!(bar)::C); -} catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { assert((baz)::class !== 'stdClass'); -} catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -assert(!$foo instanceof (bar)) -assert(!new (bar)()) -assert(!(bar)::m()) -assert(!(bar)::$p) -assert(!(bar)::C) -assert((baz)::class !== 'stdClass') +AssertionError: assert(!$foo instanceof (bar)) +AssertionError: assert(!new (bar)()) +AssertionError: assert(!(bar)::m()) +AssertionError: assert(!(bar)::$p) +AssertionError: assert(!(bar)::C) +AssertionError: assert((baz)::class !== 'stdClass') diff --git a/ext/standard/tests/class_object/get_class_methods_basic_001.phpt b/ext/standard/tests/class_object/get_class_methods_basic_001.phpt index fdfaf232ee00..27f36f0e8676 100644 --- a/ext/standard/tests/class_object/get_class_methods_basic_001.phpt +++ b/ext/standard/tests/class_object/get_class_methods_basic_001.phpt @@ -27,8 +27,8 @@ var_dump( get_class_methods("D") ); echo "Argument is non existent class:\n"; try { var_dump( get_class_methods("NonExistent") ); -} catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Done"; @@ -57,5 +57,5 @@ Argument is name of class which has no methods: array(0) { } Argument is non existent class: -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, "NonExistent" given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, "NonExistent" given Done diff --git a/ext/standard/tests/class_object/get_class_variation_001.phpt b/ext/standard/tests/class_object/get_class_variation_001.phpt index 09f995c21fb6..d44f6b65ed7a 100644 --- a/ext/standard/tests/class_object/get_class_variation_001.phpt +++ b/ext/standard/tests/class_object/get_class_variation_001.phpt @@ -64,8 +64,8 @@ foreach($values as $value) { echo @"\nArg value: $value (type: " . gettype($value) . ")\n"; try { var_dump( get_class($value) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -79,80 +79,80 @@ Warning: Undefined variable $undefined_var in %s on line %d Warning: Undefined variable $unset_var in %s on line %d Arg value: 0 (type: integer) -get_class(): Argument #1 ($object) must be of type object, int given +TypeError: get_class(): Argument #1 ($object) must be of type object, int given Arg value: 1 (type: integer) -get_class(): Argument #1 ($object) must be of type object, int given +TypeError: get_class(): Argument #1 ($object) must be of type object, int given Arg value: 12345 (type: integer) -get_class(): Argument #1 ($object) must be of type object, int given +TypeError: get_class(): Argument #1 ($object) must be of type object, int given Arg value: -2345 (type: integer) -get_class(): Argument #1 ($object) must be of type object, int given +TypeError: get_class(): Argument #1 ($object) must be of type object, int given Arg value: 10.5 (type: double) -get_class(): Argument #1 ($object) must be of type object, float given +TypeError: get_class(): Argument #1 ($object) must be of type object, float given Arg value: -10.5 (type: double) -get_class(): Argument #1 ($object) must be of type object, float given +TypeError: get_class(): Argument #1 ($object) must be of type object, float given Arg value: 101234567000 (type: double) -get_class(): Argument #1 ($object) must be of type object, float given +TypeError: get_class(): Argument #1 ($object) must be of type object, float given Arg value: 1.07654321E-9 (type: double) -get_class(): Argument #1 ($object) must be of type object, float given +TypeError: get_class(): Argument #1 ($object) must be of type object, float given Arg value: 0.5 (type: double) -get_class(): Argument #1 ($object) must be of type object, float given +TypeError: get_class(): Argument #1 ($object) must be of type object, float given Arg value: Array (type: array) -get_class(): Argument #1 ($object) must be of type object, array given +TypeError: get_class(): Argument #1 ($object) must be of type object, array given Arg value: Array (type: array) -get_class(): Argument #1 ($object) must be of type object, array given +TypeError: get_class(): Argument #1 ($object) must be of type object, array given Arg value: Array (type: array) -get_class(): Argument #1 ($object) must be of type object, array given +TypeError: get_class(): Argument #1 ($object) must be of type object, array given Arg value: Array (type: array) -get_class(): Argument #1 ($object) must be of type object, array given +TypeError: get_class(): Argument #1 ($object) must be of type object, array given Arg value: Array (type: array) -get_class(): Argument #1 ($object) must be of type object, array given +TypeError: get_class(): Argument #1 ($object) must be of type object, array given Arg value: (type: NULL) -get_class(): Argument #1 ($object) must be of type object, null given +TypeError: get_class(): Argument #1 ($object) must be of type object, null given Arg value: (type: NULL) -get_class(): Argument #1 ($object) must be of type object, null given +TypeError: get_class(): Argument #1 ($object) must be of type object, null given Arg value: 1 (type: boolean) -get_class(): Argument #1 ($object) must be of type object, true given +TypeError: get_class(): Argument #1 ($object) must be of type object, true given Arg value: (type: boolean) -get_class(): Argument #1 ($object) must be of type object, false given +TypeError: get_class(): Argument #1 ($object) must be of type object, false given Arg value: 1 (type: boolean) -get_class(): Argument #1 ($object) must be of type object, true given +TypeError: get_class(): Argument #1 ($object) must be of type object, true given Arg value: (type: boolean) -get_class(): Argument #1 ($object) must be of type object, false given +TypeError: get_class(): Argument #1 ($object) must be of type object, false given Arg value: (type: string) -get_class(): Argument #1 ($object) must be of type object, string given +TypeError: get_class(): Argument #1 ($object) must be of type object, string given Arg value: (type: string) -get_class(): Argument #1 ($object) must be of type object, string given +TypeError: get_class(): Argument #1 ($object) must be of type object, string given Arg value: string (type: string) -get_class(): Argument #1 ($object) must be of type object, string given +TypeError: get_class(): Argument #1 ($object) must be of type object, string given Arg value: string (type: string) -get_class(): Argument #1 ($object) must be of type object, string given +TypeError: get_class(): Argument #1 ($object) must be of type object, string given Arg value: (type: NULL) -get_class(): Argument #1 ($object) must be of type object, null given +TypeError: get_class(): Argument #1 ($object) must be of type object, null given Arg value: (type: NULL) -get_class(): Argument #1 ($object) must be of type object, null given +TypeError: get_class(): Argument #1 ($object) must be of type object, null given Done diff --git a/ext/standard/tests/class_object/method_exists_variation_001.phpt b/ext/standard/tests/class_object/method_exists_variation_001.phpt index d45d2652d11c..c021fc75b022 100644 --- a/ext/standard/tests/class_object/method_exists_variation_001.phpt +++ b/ext/standard/tests/class_object/method_exists_variation_001.phpt @@ -74,8 +74,8 @@ foreach($values as $value) { echo "\nArg value $value \n"; try { var_dump( method_exists($value, $method) ); - } catch (TypeError $e) { - echo $e->getMessage(), PHP_EOL; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -87,69 +87,69 @@ Error: 2 - Undefined variable $undefined_var Error: 2 - Undefined variable $unset_var Arg value 0 -method_exists(): Argument #1 ($object_or_class) must be of type object|string, int given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, int given Arg value 1 -method_exists(): Argument #1 ($object_or_class) must be of type object|string, int given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, int given Arg value 12345 -method_exists(): Argument #1 ($object_or_class) must be of type object|string, int given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, int given Arg value -2345 -method_exists(): Argument #1 ($object_or_class) must be of type object|string, int given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, int given Arg value 10.5 -method_exists(): Argument #1 ($object_or_class) must be of type object|string, float given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, float given Arg value -10.5 -method_exists(): Argument #1 ($object_or_class) must be of type object|string, float given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, float given Arg value 101234567000 -method_exists(): Argument #1 ($object_or_class) must be of type object|string, float given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, float given Arg value 1.07654321E-9 -method_exists(): Argument #1 ($object_or_class) must be of type object|string, float given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, float given Arg value 0.5 -method_exists(): Argument #1 ($object_or_class) must be of type object|string, float given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, float given Error: 2 - Array to string conversion Arg value Array -method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given Error: 2 - Array to string conversion Arg value Array -method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given Error: 2 - Array to string conversion Arg value Array -method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given Error: 2 - Array to string conversion Arg value Array -method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given Error: 2 - Array to string conversion Arg value Array -method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given Arg value -method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given Arg value -method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given Arg value 1 -method_exists(): Argument #1 ($object_or_class) must be of type object|string, true given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, true given Arg value -method_exists(): Argument #1 ($object_or_class) must be of type object|string, false given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, false given Arg value 1 -method_exists(): Argument #1 ($object_or_class) must be of type object|string, true given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, true given Arg value -method_exists(): Argument #1 ($object_or_class) must be of type object|string, false given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, false given Arg value bool(false) @@ -166,8 +166,8 @@ In autoload(String) bool(false) Arg value -method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given Arg value -method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given Done diff --git a/ext/standard/tests/class_object/property_exists_error.phpt b/ext/standard/tests/class_object/property_exists_error.phpt index 3d8927882c60..690464c9afe9 100644 --- a/ext/standard/tests/class_object/property_exists_error.phpt +++ b/ext/standard/tests/class_object/property_exists_error.phpt @@ -9,8 +9,8 @@ $property_name = 'string_val'; try { var_dump( property_exists(10, $property_name) ); -} catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -18,4 +18,4 @@ try { *** Testing property_exists() : error conditions *** -- Testing property_exists() function with incorrect arguments -- -property_exists(): Argument #1 ($object_or_class) must be of type object|string, int given +TypeError: property_exists(): Argument #1 ($object_or_class) must be of type object|string, int given diff --git a/ext/standard/tests/constant_with_typed_class_constant.phpt b/ext/standard/tests/constant_with_typed_class_constant.phpt index 87a1c006426d..767f91f5f75e 100644 --- a/ext/standard/tests/constant_with_typed_class_constant.phpt +++ b/ext/standard/tests/constant_with_typed_class_constant.phpt @@ -14,12 +14,12 @@ var_dump(constant("FOO::CONST1")); try { constant("FOO::CONST2"); -} catch (TypeError $e) { - echo $e->getMessage() . "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- object(stdClass)#1 (0) { } -Cannot assign stdClass to class constant Foo::CONST2 of type array +TypeError: Cannot assign stdClass to class constant Foo::CONST2 of type array diff --git a/ext/standard/tests/dir/bug41693.phpt b/ext/standard/tests/dir/bug41693.phpt index 05722b9558d2..9ba849427137 100644 --- a/ext/standard/tests/dir/bug41693.phpt +++ b/ext/standard/tests/dir/bug41693.phpt @@ -5,10 +5,10 @@ Bug #41693 (scandir() allows empty directory names) try { var_dump(scandir('')); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -scandir(): Argument #1 ($directory) must not be empty +ValueError: scandir(): Argument #1 ($directory) must not be empty diff --git a/ext/standard/tests/dir/closedir_variation2.phpt b/ext/standard/tests/dir/closedir_variation2.phpt index 7898c9ae0ff1..c210f6dfd6bb 100644 --- a/ext/standard/tests/dir/closedir_variation2.phpt +++ b/ext/standard/tests/dir/closedir_variation2.phpt @@ -22,8 +22,8 @@ var_dump($dh); echo "\n-- Close directory handle second time: --\n"; try { var_dump(closedir($dh)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Directory Handle: "; var_dump($dh); @@ -41,5 +41,5 @@ NULL Directory Handle: resource(%d) of type (Unknown) -- Close directory handle second time: -- -closedir(): Argument #1 ($dir_handle) must be an open stream resource +TypeError: closedir(): Argument #1 ($dir_handle) must be an open stream resource Directory Handle: resource(%d) of type (Unknown) diff --git a/ext/standard/tests/dir/closedir_variation3.phpt b/ext/standard/tests/dir/closedir_variation3.phpt index 053c8a947eb7..f4c2ff7973b3 100644 --- a/ext/standard/tests/dir/closedir_variation3.phpt +++ b/ext/standard/tests/dir/closedir_variation3.phpt @@ -14,8 +14,8 @@ var_dump($fp = fopen(__FILE__, 'r')); echo "\n-- Try to close the file pointer using closedir() --\n"; try { var_dump(closedir($fp)); -} catch (\TypeError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Check file pointer: --\n"; var_dump($fp); @@ -31,7 +31,7 @@ if(is_resource($fp)) { resource(%d) of type (stream) -- Try to close the file pointer using closedir() -- -closedir(): Argument #1 ($dir_handle) must be a valid Directory resource +TypeError: closedir(): Argument #1 ($dir_handle) must be a valid Directory resource -- Check file pointer: -- resource(%d) of type (stream) diff --git a/ext/standard/tests/dir/closedir_without_arg.phpt b/ext/standard/tests/dir/closedir_without_arg.phpt index f248764ed2a6..79ce1dc3e584 100644 --- a/ext/standard/tests/dir/closedir_without_arg.phpt +++ b/ext/standard/tests/dir/closedir_without_arg.phpt @@ -4,10 +4,10 @@ Calling closedir() without argument and without opening a directory beforehand getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Deprecated: closedir(): Passing null is deprecated, instead the last opened directory stream should be provided in %s on line %d -No resource supplied +TypeError: No resource supplied diff --git a/ext/standard/tests/dir/dir_basic.phpt b/ext/standard/tests/dir/dir_basic.phpt index 17a2b42bcdae..9a530120da60 100644 --- a/ext/standard/tests/dir/dir_basic.phpt +++ b/ext/standard/tests/dir/dir_basic.phpt @@ -35,8 +35,8 @@ var_dump( $d ); echo "\nTest read after closing the dir:\n"; try { var_dump( $d->read() ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } // delete temp files @@ -79,5 +79,5 @@ object(Directory)#%d (2) { } Test read after closing the dir: -Directory::read(): cannot use Directory resource after it has been closed +TypeError: Directory::read(): cannot use Directory resource after it has been closed Done diff --git a/ext/standard/tests/dir/readdir_variation7.phpt b/ext/standard/tests/dir/readdir_variation7.phpt index b3e3d88ccd59..ab7174c1c15b 100644 --- a/ext/standard/tests/dir/readdir_variation7.phpt +++ b/ext/standard/tests/dir/readdir_variation7.phpt @@ -12,12 +12,12 @@ echo "*** Testing readdir() : usage variations ***\n"; var_dump($fp = fopen(__FILE__, "r")); try { var_dump( readdir($fp) ); -} catch (\TypeError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- *** Testing readdir() : usage variations *** resource(%d) of type (stream) -readdir(): Argument #1 ($dir_handle) must be a valid Directory resource +TypeError: readdir(): Argument #1 ($dir_handle) must be a valid Directory resource diff --git a/ext/standard/tests/dir/rewinddir_variation2.phpt b/ext/standard/tests/dir/rewinddir_variation2.phpt index 7ce3c522352d..400d22ed9c82 100644 --- a/ext/standard/tests/dir/rewinddir_variation2.phpt +++ b/ext/standard/tests/dir/rewinddir_variation2.phpt @@ -19,8 +19,8 @@ closedir($dir_handle); echo "\n-- Call to rewinddir() --\n"; try { var_dump(rewinddir($dir_handle)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -36,4 +36,4 @@ resource(%d) of type (stream) string(%d) "%s" -- Call to rewinddir() -- -rewinddir(): Argument #1 ($dir_handle) must be an open stream resource +TypeError: rewinddir(): Argument #1 ($dir_handle) must be an open stream resource diff --git a/ext/standard/tests/dir/rewinddir_variation3.phpt b/ext/standard/tests/dir/rewinddir_variation3.phpt index 21bddca1036a..8279a95391a8 100644 --- a/ext/standard/tests/dir/rewinddir_variation3.phpt +++ b/ext/standard/tests/dir/rewinddir_variation3.phpt @@ -15,8 +15,8 @@ $result1 = fread($fp, 5); try { var_dump(rewinddir($fp)); -} catch (\TypeError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $result2 = fread($fp, 5); @@ -32,7 +32,7 @@ if ($result1 === $result2) { -- Open a file using fopen -- resource(%d) of type (stream) -rewinddir(): Argument #1 ($dir_handle) must be a valid Directory resource +TypeError: rewinddir(): Argument #1 ($dir_handle) must be a valid Directory resource -- Check if rewinddir() has repositioned the file pointer -- rewinddir() does not work on file pointers diff --git a/ext/standard/tests/dir/scandir_invalid_flag.phpt b/ext/standard/tests/dir/scandir_invalid_flag.phpt index 76838dc869b8..81ffbdbe66f5 100644 --- a/ext/standard/tests/dir/scandir_invalid_flag.phpt +++ b/ext/standard/tests/dir/scandir_invalid_flag.phpt @@ -4,9 +4,9 @@ Provide wrong flags to scandir() getMessage() . "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -scandir(): Argument #2 ($sorting_order) must be one of the SCANDIR_SORT_ASCENDING, SCANDIR_SORT_DESCENDING, or SCANDIR_SORT_NONE constants +ValueError: scandir(): Argument #2 ($sorting_order) must be one of the SCANDIR_SORT_ASCENDING, SCANDIR_SORT_DESCENDING, or SCANDIR_SORT_NONE constants diff --git a/ext/standard/tests/file/006_variation2.phpt b/ext/standard/tests/file/006_variation2.phpt index 6b32f2246f12..aa30c545ec03 100644 --- a/ext/standard/tests/file/006_variation2.phpt +++ b/ext/standard/tests/file/006_variation2.phpt @@ -54,8 +54,8 @@ foreach($perms_array as $permission) { printf("%o", fileperms($file_name) ); echo "\n"; clearstatcache(); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -63,8 +63,8 @@ foreach($perms_array as $permission) { printf("%o", fileperms($dir_name) ); echo "\n"; clearstatcache(); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $count++; } @@ -137,15 +137,15 @@ bool(true) bool(true) 43567 -- Iteration 12 -- -chmod(): Argument #2 ($permissions) must be of type int, string given -chmod(): Argument #2 ($permissions) must be of type int, string given +TypeError: chmod(): Argument #2 ($permissions) must be of type int, string given +TypeError: chmod(): Argument #2 ($permissions) must be of type int, string given -- Iteration 13 -- -chmod(): Argument #2 ($permissions) must be of type int, string given -chmod(): Argument #2 ($permissions) must be of type int, string given +TypeError: chmod(): Argument #2 ($permissions) must be of type int, string given +TypeError: chmod(): Argument #2 ($permissions) must be of type int, string given -- Iteration 14 -- -chmod(): Argument #2 ($permissions) must be of type int, string given -chmod(): Argument #2 ($permissions) must be of type int, string given +TypeError: chmod(): Argument #2 ($permissions) must be of type int, string given +TypeError: chmod(): Argument #2 ($permissions) must be of type int, string given -- Iteration 15 -- -chmod(): Argument #2 ($permissions) must be of type int, string given -chmod(): Argument #2 ($permissions) must be of type int, string given +TypeError: chmod(): Argument #2 ($permissions) must be of type int, string given +TypeError: chmod(): Argument #2 ($permissions) must be of type int, string given *** Done *** diff --git a/ext/standard/tests/file/007_basic.phpt b/ext/standard/tests/file/007_basic.phpt index 6a0c918ea39c..503b34f64438 100644 --- a/ext/standard/tests/file/007_basic.phpt +++ b/ext/standard/tests/file/007_basic.phpt @@ -42,13 +42,13 @@ for( $i=0; $igetMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( feof($handle) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -77,13 +77,13 @@ for( $i=0; $igetMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( feof($handle) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump( $handle ); @@ -102,8 +102,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'wb' -- resource(%d) of type (stream) @@ -111,8 +111,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'wt' -- resource(%d) of type (stream) @@ -120,8 +120,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'w+' -- resource(%d) of type (stream) @@ -129,8 +129,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'w+b' -- resource(%d) of type (stream) @@ -138,8 +138,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'w+t' -- resource(%d) of type (stream) @@ -147,8 +147,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'r' -- resource(%d) of type (stream) @@ -156,8 +156,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'rb' -- resource(%d) of type (stream) @@ -165,8 +165,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'rt' -- resource(%d) of type (stream) @@ -174,8 +174,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'r+' -- resource(%d) of type (stream) @@ -183,8 +183,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'r+b' -- resource(%d) of type (stream) @@ -192,8 +192,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'r+t' -- resource(%d) of type (stream) @@ -201,8 +201,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'a' -- resource(%d) of type (stream) @@ -210,8 +210,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'ab' -- resource(%d) of type (stream) @@ -219,8 +219,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'at' -- resource(%d) of type (stream) @@ -228,8 +228,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'a+' -- resource(%d) of type (stream) @@ -237,8 +237,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'a+t' -- resource(%d) of type (stream) @@ -246,8 +246,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'a+b' -- resource(%d) of type (stream) @@ -255,8 +255,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'x' -- resource(%d) of type (stream) @@ -264,8 +264,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource resource(%d) of type (Unknown) -- Iteration with mode 'xb' -- @@ -274,8 +274,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource resource(%d) of type (Unknown) -- Iteration with mode 'xt' -- @@ -284,8 +284,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource resource(%d) of type (Unknown) -- Iteration with mode 'x+' -- @@ -294,8 +294,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource resource(%d) of type (Unknown) -- Iteration with mode 'x+b' -- @@ -304,8 +304,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource resource(%d) of type (Unknown) -- Iteration with mode 'x+t' -- @@ -314,8 +314,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource resource(%d) of type (Unknown) *** Done *** diff --git a/ext/standard/tests/file/bug71882.phpt b/ext/standard/tests/file/bug71882.phpt index 68f98f19b6a8..3c398172018f 100644 --- a/ext/standard/tests/file/bug71882.phpt +++ b/ext/standard/tests/file/bug71882.phpt @@ -5,9 +5,9 @@ Bug #71882 (Negative ftruncate() on php://memory exhausts memory) $fd = fopen("php://memory", "w+"); try { var_dump(ftruncate($fd, -1)); -} catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 diff --git a/ext/standard/tests/file/chgrp.phpt b/ext/standard/tests/file/chgrp.phpt index 1e4899e46574..2d4726642c84 100644 --- a/ext/standard/tests/file/chgrp.phpt +++ b/ext/standard/tests/file/chgrp.phpt @@ -9,8 +9,8 @@ if(substr(PHP_OS, 0, 3) == "WIN") getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECTF-- diff --git a/ext/standard/tests/file/disk_free_space_variation.phpt b/ext/standard/tests/file/disk_free_space_variation.phpt index aaeae022af4b..1395c6d67a4a 100644 --- a/ext/standard/tests/file/disk_free_space_variation.phpt +++ b/ext/standard/tests/file/disk_free_space_variation.phpt @@ -43,13 +43,13 @@ foreach($dirs_arr as $dir1) { echo "\n-- Iteration $count --\n"; try { var_dump( disk_free_space( $dir1 ) ); - } catch (Error $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( diskfreespace( $dir1 ) ); - } catch (Error $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $count++; } @@ -103,19 +103,19 @@ float(%f) float(%f) -- Iteration 9 -- -disk_free_space(): Argument #1 ($directory) must not contain any null bytes -diskfreespace(): Argument #1 ($directory) must not contain any null bytes +ValueError: disk_free_space(): Argument #1 ($directory) must not contain any null bytes +ValueError: diskfreespace(): Argument #1 ($directory) must not contain any null bytes -- Iteration 10 -- -disk_free_space(): Argument #1 ($directory) must not contain any null bytes -diskfreespace(): Argument #1 ($directory) must not contain any null bytes +ValueError: disk_free_space(): Argument #1 ($directory) must not contain any null bytes +ValueError: diskfreespace(): Argument #1 ($directory) must not contain any null bytes -- Iteration 11 -- -disk_free_space(): Argument #1 ($directory) must not contain any null bytes -diskfreespace(): Argument #1 ($directory) must not contain any null bytes +ValueError: disk_free_space(): Argument #1 ($directory) must not contain any null bytes +ValueError: diskfreespace(): Argument #1 ($directory) must not contain any null bytes -- Iteration 12 -- -disk_free_space(): Argument #1 ($directory) must not contain any null bytes -diskfreespace(): Argument #1 ($directory) must not contain any null bytes +ValueError: disk_free_space(): Argument #1 ($directory) must not contain any null bytes +ValueError: diskfreespace(): Argument #1 ($directory) must not contain any null bytes --- Done --- diff --git a/ext/standard/tests/file/disk_total_space_variation.phpt b/ext/standard/tests/file/disk_total_space_variation.phpt index 25d7e5a1c7df..d9b8bbe875e4 100644 --- a/ext/standard/tests/file/disk_total_space_variation.phpt +++ b/ext/standard/tests/file/disk_total_space_variation.phpt @@ -46,8 +46,8 @@ foreach($dirs_arr as $dir1) { echo "\n-- Iteration $count --\n"; try { var_dump( disk_total_space( $dir1 ) ); - } catch (Error $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $count++; } @@ -95,16 +95,16 @@ float(%f) float(%f) -- Iteration 9 -- -disk_total_space(): Argument #1 ($directory) must not contain any null bytes +ValueError: disk_total_space(): Argument #1 ($directory) must not contain any null bytes -- Iteration 10 -- -disk_total_space(): Argument #1 ($directory) must not contain any null bytes +ValueError: disk_total_space(): Argument #1 ($directory) must not contain any null bytes -- Iteration 11 -- -disk_total_space(): Argument #1 ($directory) must not contain any null bytes +ValueError: disk_total_space(): Argument #1 ($directory) must not contain any null bytes -- Iteration 12 -- -disk_total_space(): Argument #1 ($directory) must not contain any null bytes +ValueError: disk_total_space(): Argument #1 ($directory) must not contain any null bytes *** Testing with Binary Input *** float(%s) diff --git a/ext/standard/tests/file/fclose_variation1.phpt b/ext/standard/tests/file/fclose_variation1.phpt index 56a6d4bd4c1c..9195c60f786b 100644 --- a/ext/standard/tests/file/fclose_variation1.phpt +++ b/ext/standard/tests/file/fclose_variation1.phpt @@ -9,12 +9,12 @@ separate_zval($s2); fclose($s); try { echo fread($s2, strlen("getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\nDone.\n"; ?> --EXPECT-- -fread(): Argument #1 ($stream) must be an open stream resource +TypeError: fread(): Argument #1 ($stream) must be an open stream resource Done. diff --git a/ext/standard/tests/file/feof_basic.phpt b/ext/standard/tests/file/feof_basic.phpt index 943af213e39a..4ffb2994b08e 100644 --- a/ext/standard/tests/file/feof_basic.phpt +++ b/ext/standard/tests/file/feof_basic.phpt @@ -60,8 +60,8 @@ echo "*** closing file, testing eof ***\n"; fclose($h); try { feof($h); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } unlink($tmpFile1); unlink($tmpFile2); @@ -94,5 +94,5 @@ bool(false) *** testing feof after a seek passed the end *** bool(false) *** closing file, testing eof *** -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource Done diff --git a/ext/standard/tests/file/fgetc_variation2.phpt b/ext/standard/tests/file/fgetc_variation2.phpt index 89161d088190..2852576959de 100644 --- a/ext/standard/tests/file/fgetc_variation2.phpt +++ b/ext/standard/tests/file/fgetc_variation2.phpt @@ -21,8 +21,8 @@ fclose($file_handle); // read from closed file try { var_dump( fgetc($file_handle) ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done"; @@ -30,5 +30,5 @@ echo "Done"; --EXPECT-- *** Testing fgetc() : usage variations *** -- Testing fgetc() with closed handle -- -fgetc(): Argument #1 ($stream) must be an open stream resource +TypeError: fgetc(): Argument #1 ($stream) must be an open stream resource Done diff --git a/ext/standard/tests/file/fgetcsv_error_conditions.phpt b/ext/standard/tests/file/fgetcsv_error_conditions.phpt index 3c1353cb3c20..cc71dfed168a 100644 --- a/ext/standard/tests/file/fgetcsv_error_conditions.phpt +++ b/ext/standard/tests/file/fgetcsv_error_conditions.phpt @@ -13,49 +13,49 @@ $enclosure = '"'; echo 'fgetcsv() with negative length' . \PHP_EOL; try { var_dump( fgetcsv($file_handle, -10, escape: "\\") ); -} catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( fgetcsv($file_handle, -10, $delimiter, escape: "\\") ); -} catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( fgetcsv($file_handle, -10, $delimiter, $enclosure, escape: "\\") ); -} catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo 'fgetcsv() with delimiter as empty string' . \PHP_EOL; try { var_dump( fgetcsv($file_handle, $length, '', $enclosure, escape: "\\") ); -} catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo 'fgetcsv() with enclosure as empty string' . \PHP_EOL; try { var_dump( fgetcsv($file_handle, $length, $delimiter, '', escape: "\\") ); -} catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo 'fgetcsv() with delimiter & enclosure as empty string' . \PHP_EOL; try { var_dump( fgetcsv($file_handle, $length, '', '', escape: "\\") ); -} catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- fgetcsv() with negative length -fgetcsv(): Argument #2 ($length) must be between 0 and %d -fgetcsv(): Argument #2 ($length) must be between 0 and %d -fgetcsv(): Argument #2 ($length) must be between 0 and %d +ValueError: fgetcsv(): Argument #2 ($length) must be between 0 and %d +ValueError: fgetcsv(): Argument #2 ($length) must be between 0 and %d +ValueError: fgetcsv(): Argument #2 ($length) must be between 0 and %d fgetcsv() with delimiter as empty string -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character fgetcsv() with enclosure as empty string -fgetcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fgetcsv(): Argument #4 ($enclosure) must be a single character fgetcsv() with delimiter & enclosure as empty string -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character diff --git a/ext/standard/tests/file/fgetcsv_variation12.phpt b/ext/standard/tests/file/fgetcsv_variation12.phpt index b2297668e7bf..56210dbd2714 100644 --- a/ext/standard/tests/file/fgetcsv_variation12.phpt +++ b/ext/standard/tests/file/fgetcsv_variation12.phpt @@ -71,8 +71,8 @@ foreach ($csv_lists as $csv_list) { $enc = "%%"; try { var_dump( fgetcsv($file_handle, 1024, $del, $enc) ); - } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } // check the file pointer position and if eof var_dump( ftell($file_handle) ); @@ -91,362 +91,362 @@ echo "Done\n"; *** Testing fgetcsv() : with two chars as enclosure & delimiter *** -- Testing fgetcsv() with file opened using r mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) Done diff --git a/ext/standard/tests/file/fgetcsv_variation19.phpt b/ext/standard/tests/file/fgetcsv_variation19.phpt index 0451e21447fe..0bdf329bfd20 100644 --- a/ext/standard/tests/file/fgetcsv_variation19.phpt +++ b/ext/standard/tests/file/fgetcsv_variation19.phpt @@ -69,8 +69,8 @@ foreach ($csv_lists as $csv_list) { $del = "++"; try { var_dump( fgetcsv($file_handle, 1024, $del, escape: "\\") ); - } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } // check the file pointer position and if eof var_dump( ftell($file_handle) ); @@ -89,377 +89,377 @@ echo "Done\n"; *** Testing fgetcsv() : with default enclosure & delimiter of two chars *** -- Testing fgetcsv() with file opened using r mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using w+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using w+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using w+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using x+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using x+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using x+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using w+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using w+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using w+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using x+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using x+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using x+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using w+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using w+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using w+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using x+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using x+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using x+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using w+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using w+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using w+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using x+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using x+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using x+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using w+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using w+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using w+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using x+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using x+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using x+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) Done diff --git a/ext/standard/tests/file/fgets_error.phpt b/ext/standard/tests/file/fgets_error.phpt index fefbd723bc58..7e34fe5a0d9b 100644 --- a/ext/standard/tests/file/fgets_error.phpt +++ b/ext/standard/tests/file/fgets_error.phpt @@ -11,15 +11,15 @@ echo "-- Testing fgets() with invalid length arguments --\n"; $len = 0; try { var_dump( fgets($fp, $len) ); -} catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $len = -10; try { var_dump( fgets($fp, $len) ); -} catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $len = 1; var_dump( fgets($fp, $len) ); // return length - 1 always, expect false @@ -28,6 +28,6 @@ var_dump( fgets($fp, $len) ); // return length - 1 always, expect false --EXPECT-- *** Testing error conditions *** -- Testing fgets() with invalid length arguments -- -fgets(): Argument #2 ($length) must be greater than 0 -fgets(): Argument #2 ($length) must be greater than 0 +ValueError: fgets(): Argument #2 ($length) must be greater than 0 +ValueError: fgets(): Argument #2 ($length) must be greater than 0 bool(false) diff --git a/ext/standard/tests/file/fgets_variation2.phpt b/ext/standard/tests/file/fgets_variation2.phpt index 5d262cde295b..acdf6699e181 100644 --- a/ext/standard/tests/file/fgets_variation2.phpt +++ b/ext/standard/tests/file/fgets_variation2.phpt @@ -21,13 +21,13 @@ fclose($file_handle); // read from closed file try { var_dump( fgets($file_handle) ); // default length -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( fgets($file_handle, 10) ); // with specific length -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done"; @@ -35,6 +35,6 @@ echo "Done"; --EXPECT-- *** Testing fgets() : usage variations *** -- Testing fgets() with closed handle -- -fgets(): Argument #1 ($stream) must be an open stream resource -fgets(): Argument #1 ($stream) must be an open stream resource +TypeError: fgets(): Argument #1 ($stream) must be an open stream resource +TypeError: fgets(): Argument #1 ($stream) must be an open stream resource Done diff --git a/ext/standard/tests/file/file_error.phpt b/ext/standard/tests/file/file_error.phpt index fffad3c59b64..c26aec9072ce 100644 --- a/ext/standard/tests/file/file_error.phpt +++ b/ext/standard/tests/file/file_error.phpt @@ -9,13 +9,13 @@ $file_handle = fopen($file_path."/file.tmp", "w"); $filename = $file_path."/file.tmp"; try { var_dump( file($filename, 10, NULL) ); // Incorrect flag -} catch(ValueError $e) { - echo "ValueError: " . $e->getMessage() . "\n"; +} catch(Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( file($filename, FILE_APPEND) ); // Incorrect flag -} catch(ValueError $e) { - echo "ValueError: " . $e->getMessage() . "\n"; +} catch(Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump( file("temp.tmp") ); // non existing filename fclose($file_handle); diff --git a/ext/standard/tests/file/file_get_contents_error.phpt b/ext/standard/tests/file/file_get_contents_error.phpt index add7831ef390..747e99f59102 100644 --- a/ext/standard/tests/file/file_get_contents_error.phpt +++ b/ext/standard/tests/file/file_get_contents_error.phpt @@ -19,8 +19,8 @@ $file_handle = fopen($file_path."/file_put_contents_error.tmp", "w"); echo "\n-- Testing for invalid negative maxlen values --\n"; try { file_get_contents($file_path."/file_get_contents_error1.tmp", FALSE, $file_handle, 0, -5); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } delete_files($file_path, 1, "file_get_contents_error", 1); @@ -48,6 +48,6 @@ Warning: file_get_contents(): Failed to open stream: No such file or directory i bool(false) -- Testing for invalid negative maxlen values -- -file_get_contents(): Argument #5 ($length) must be greater than or equal to 0 +ValueError: file_get_contents(): Argument #5 ($length) must be greater than or equal to 0 *** Done *** diff --git a/ext/standard/tests/file/file_get_contents_error002.phpt b/ext/standard/tests/file/file_get_contents_error002.phpt index d47efa26a1b9..d38ede46e1da 100644 --- a/ext/standard/tests/file/file_get_contents_error002.phpt +++ b/ext/standard/tests/file/file_get_contents_error002.phpt @@ -9,9 +9,9 @@ display_errors=false getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -file_get_contents(): Argument #5 ($length) must be greater than or equal to 0 +ValueError: file_get_contents(): Argument #5 ($length) must be greater than or equal to 0 diff --git a/ext/standard/tests/file/file_get_contents_file_put_contents_error.phpt b/ext/standard/tests/file/file_get_contents_file_put_contents_error.phpt index 7133ae766d68..72c7395d0664 100644 --- a/ext/standard/tests/file/file_get_contents_file_put_contents_error.phpt +++ b/ext/standard/tests/file/file_get_contents_file_put_contents_error.phpt @@ -14,8 +14,8 @@ echo "\n-- Testing for invalid negative maxlen values --\n"; file_put_contents($file_path."/file_put_contents_error1.tmp", "Garbage data in the file"); try { file_get_contents($file_path."/file_put_contents_error1.tmp", FALSE, NULL, 0, -5); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\n*** Done ***\n"; @@ -34,6 +34,6 @@ unlink($file_path."/file_put_contents_error1.tmp"); Warning: file_get_contents(): Failed to open stream: No such file or directory in %s on line %d -- Testing for invalid negative maxlen values -- -file_get_contents(): Argument #5 ($length) must be greater than or equal to 0 +ValueError: file_get_contents(): Argument #5 ($length) must be greater than or equal to 0 *** Done *** diff --git a/ext/standard/tests/file/file_get_contents_variation8.phpt b/ext/standard/tests/file/file_get_contents_variation8.phpt index 94d3a31c775e..1be33b1168ee 100644 --- a/ext/standard/tests/file/file_get_contents_variation8.phpt +++ b/ext/standard/tests/file/file_get_contents_variation8.phpt @@ -34,8 +34,8 @@ for( $i=0; $igetMessage(), "\n"; + } catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } diff --git a/ext/standard/tests/file/file_get_contents_with_custom_uri_parser.phpt b/ext/standard/tests/file/file_get_contents_with_custom_uri_parser.phpt index 01ee940d9531..73122d3502bc 100644 --- a/ext/standard/tests/file/file_get_contents_with_custom_uri_parser.phpt +++ b/ext/standard/tests/file/file_get_contents_with_custom_uri_parser.phpt @@ -10,8 +10,8 @@ try { ], ]); var_dump(file_get_contents("http://example.com", context: $context)); -} catch (Error $e) { - echo $e->getMessage() . "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $context = stream_context_create([ @@ -37,7 +37,7 @@ var_dump(file_get_contents("http://exa%23mple.org", context: $context)); // inva ?> --EXPECTF-- -file_get_contents(): Provided stream context has invalid value for the "uri_parser_class" option +ValueError: file_get_contents(): Provided stream context has invalid value for the "uri_parser_class" option Warning: file_get_contents(): Failed to open stream: operation failed in %s on line %d bool(false) diff --git a/ext/standard/tests/file/file_put_contents.phpt b/ext/standard/tests/file/file_put_contents.phpt index 97094e92d0ef..0db4fc52aae3 100644 --- a/ext/standard/tests/file/file_put_contents.phpt +++ b/ext/standard/tests/file/file_put_contents.phpt @@ -13,16 +13,16 @@ $context = stream_context_create(); try { var_dump(file_put_contents($file, $context)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(file_put_contents($file, new stdClass)); var_dump(file_put_contents($file, new foo)); $fp = fopen($file, "r"); try { var_dump(file_put_contents($file, "string", 0, $fp)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -33,8 +33,8 @@ $file = __DIR__."/file_put_contents.txt"; unlink($file); ?> --EXPECT-- -file_put_contents(): supplied resource is not a valid stream resource +TypeError: file_put_contents(): supplied resource is not a valid stream resource bool(false) int(15) -file_put_contents(): supplied resource is not a valid Stream-Context resource +TypeError: file_put_contents(): supplied resource is not a valid Stream-Context resource Done diff --git a/ext/standard/tests/file/file_put_contents_variation8.phpt b/ext/standard/tests/file/file_put_contents_variation8.phpt index 12ae8379f699..085e6a428943 100644 --- a/ext/standard/tests/file/file_put_contents_variation8.phpt +++ b/ext/standard/tests/file/file_put_contents_variation8.phpt @@ -44,8 +44,8 @@ for( $i=0; $igetMessage(), "\n"; + } catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } diff --git a/ext/standard/tests/file/file_variation6.phpt b/ext/standard/tests/file/file_variation6.phpt index 9bd91cfd40de..98b7c0e427d9 100644 --- a/ext/standard/tests/file/file_variation6.phpt +++ b/ext/standard/tests/file/file_variation6.phpt @@ -11,8 +11,8 @@ fclose($fd); for ($flags = 0; $flags <= 32; $flags++) { try { var_dump(file($filepath, $flags)); - } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + } catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -95,14 +95,14 @@ array(3) { [2]=> string(6) "Line 3" } -file(): Argument #2 ($flags) must be a valid flag value -file(): Argument #2 ($flags) must be a valid flag value -file(): Argument #2 ($flags) must be a valid flag value -file(): Argument #2 ($flags) must be a valid flag value -file(): Argument #2 ($flags) must be a valid flag value -file(): Argument #2 ($flags) must be a valid flag value -file(): Argument #2 ($flags) must be a valid flag value -file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value array(3) { [0]=> string(7) "Line 1 @@ -175,12 +175,12 @@ array(3) { [2]=> string(6) "Line 3" } -file(): Argument #2 ($flags) must be a valid flag value -file(): Argument #2 ($flags) must be a valid flag value -file(): Argument #2 ($flags) must be a valid flag value -file(): Argument #2 ($flags) must be a valid flag value -file(): Argument #2 ($flags) must be a valid flag value -file(): Argument #2 ($flags) must be a valid flag value -file(): Argument #2 ($flags) must be a valid flag value -file(): Argument #2 ($flags) must be a valid flag value -file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value diff --git a/ext/standard/tests/file/filegroup_variation3.phpt b/ext/standard/tests/file/filegroup_variation3.phpt index 94562850f58d..fbee0d01734a 100644 --- a/ext/standard/tests/file/filegroup_variation3.phpt +++ b/ext/standard/tests/file/filegroup_variation3.phpt @@ -34,8 +34,8 @@ foreach($files_arr as $file) { echo "- Iteration $count -\n"; try { var_dump( filegroup( $file_path."/".$file ) ); - } catch (Error $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } clearstatcache(); $count++; diff --git a/ext/standard/tests/file/fileinode_variation3.phpt b/ext/standard/tests/file/fileinode_variation3.phpt index 506984d41775..a90120bbec61 100644 --- a/ext/standard/tests/file/fileinode_variation3.phpt +++ b/ext/standard/tests/file/fileinode_variation3.phpt @@ -33,8 +33,8 @@ foreach($files_arr as $file) { echo "- Iteration $count -\n"; try { var_dump( fileinode( $file_path."/".$file ) ); - } catch (Error $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } clearstatcache(); $count++; diff --git a/ext/standard/tests/file/fileowner_variation3.phpt b/ext/standard/tests/file/fileowner_variation3.phpt index e6360b475713..a3906bf54e5d 100644 --- a/ext/standard/tests/file/fileowner_variation3.phpt +++ b/ext/standard/tests/file/fileowner_variation3.phpt @@ -34,8 +34,8 @@ foreach($files_arr as $file) { echo "- Iteration $count -\n"; try { var_dump( fileowner( $file_path."/".$file ) ); - } catch (Error $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } clearstatcache(); $count++; diff --git a/ext/standard/tests/file/fileperms_variation3.phpt b/ext/standard/tests/file/fileperms_variation3.phpt index 6c1da17d6bfd..dcce3e5937a5 100644 --- a/ext/standard/tests/file/fileperms_variation3.phpt +++ b/ext/standard/tests/file/fileperms_variation3.phpt @@ -33,8 +33,8 @@ foreach($files_arr as $file) { echo "- Iteration $count -\n"; try { var_dump( fileperms( $file_path."/".$file ) ); - } catch (Error $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } clearstatcache(); $count++; diff --git a/ext/standard/tests/file/filesize_variation3.phpt b/ext/standard/tests/file/filesize_variation3.phpt index bf27c893b6ee..d9aa17d353a9 100644 --- a/ext/standard/tests/file/filesize_variation3.phpt +++ b/ext/standard/tests/file/filesize_variation3.phpt @@ -18,8 +18,8 @@ for($size = filesize($filename); $size>=-1200; $size-=1200) { $file_handle = fopen($filename, "r+"); try { var_dump( ftruncate($file_handle, $size) ); - } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + } catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } fclose($file_handle); var_dump( filesize($filename) ); @@ -57,5 +57,5 @@ bool(true) int(1200) bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) diff --git a/ext/standard/tests/file/flock.phpt b/ext/standard/tests/file/flock.phpt index 0e07114f9cd4..3e9ff953bd23 100644 --- a/ext/standard/tests/file/flock.phpt +++ b/ext/standard/tests/file/flock.phpt @@ -10,8 +10,8 @@ fclose($fp); try { var_dump(flock($fp, LOCK_SH|LOCK_NB)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } /* @@ -41,8 +41,8 @@ var_dump(flock($fp, -1)); try { var_dump(flock($fp, 0)); -} catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -52,7 +52,7 @@ $file = __DIR__."/flock.dat"; unlink($file); ?> --EXPECT-- -flock(): Argument #1 ($stream) must be an open stream resource +TypeError: flock(): Argument #1 ($stream) must be an open stream resource bool(true) bool(true) bool(true) @@ -66,4 +66,4 @@ int(0) bool(true) int(0) bool(true) -flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN +ValueError: flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN diff --git a/ext/standard/tests/file/flock_error.phpt b/ext/standard/tests/file/flock_error.phpt index 2ca20c3436ab..0e68b60993ff 100644 --- a/ext/standard/tests/file/flock_error.phpt +++ b/ext/standard/tests/file/flock_error.phpt @@ -31,8 +31,8 @@ foreach($operations as $operation) { echo "--- Iteration $i ---" . \PHP_EOL; try { var_dump(flock($fp, $operation)); - } catch (\TypeError|\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + } catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $i++; } @@ -43,8 +43,8 @@ $fp = fopen($file, "w"); fclose($fp); try { var_dump(flock($fp, LOCK_SH|LOCK_NB)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -55,19 +55,19 @@ unlink($file); --EXPECT-- *** Testing error conditions *** --- Iteration 0 --- -flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN +ValueError: flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN --- Iteration 1 --- -flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN +ValueError: flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN --- Iteration 2 --- -flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN +ValueError: flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN --- Iteration 3 --- -flock(): Argument #2 ($operation) must be of type int, array given +TypeError: flock(): Argument #2 ($operation) must be of type int, array given --- Iteration 4 --- -flock(): Argument #2 ($operation) must be of type int, array given +TypeError: flock(): Argument #2 ($operation) must be of type int, array given --- Iteration 5 --- -flock(): Argument #2 ($operation) must be of type int, string given +TypeError: flock(): Argument #2 ($operation) must be of type int, string given --- Iteration 6 --- -flock(): Argument #2 ($operation) must be of type int, string given +TypeError: flock(): Argument #2 ($operation) must be of type int, string given --- Iteration 7 --- -flock(): Argument #2 ($operation) must be of type int, string given -flock(): Argument #1 ($stream) must be an open stream resource +TypeError: flock(): Argument #2 ($operation) must be of type int, string given +TypeError: flock(): Argument #1 ($stream) must be an open stream resource diff --git a/ext/standard/tests/file/fnmatch_variation.phpt b/ext/standard/tests/file/fnmatch_variation.phpt index 3413c3e6f76c..8f1e92eb5d1c 100644 --- a/ext/standard/tests/file/fnmatch_variation.phpt +++ b/ext/standard/tests/file/fnmatch_variation.phpt @@ -64,8 +64,8 @@ for( $i = 0; $igetMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } unlink($file_name); @@ -80,8 +80,8 @@ function match_( $pattern, $string ) { for( $j = 0; $jgetMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } } @@ -185,9 +185,9 @@ bool(false) -- Iteration 22 -- bool(false) -- Iteration 23 -- -fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes -- Iteration 24 -- -fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes -- Iteration 25 -- bool(false) -- Iteration 26 -- @@ -261,44 +261,44 @@ bool(true) --- With Strings --- -- Iteration 0 -- bool(true) -fnmatch(): Argument #2 ($filename) must not contain any null bytes +ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes bool(true) -fnmatch(): Argument #2 ($filename) must not contain any null bytes +ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes bool(false) bool(true) -- Iteration 1 -- -fnmatch(): Argument #1 ($pattern) must not contain any null bytes -fnmatch(): Argument #1 ($pattern) must not contain any null bytes -fnmatch(): Argument #1 ($pattern) must not contain any null bytes -fnmatch(): Argument #1 ($pattern) must not contain any null bytes -fnmatch(): Argument #1 ($pattern) must not contain any null bytes -fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes -- Iteration 2 -- bool(true) -fnmatch(): Argument #2 ($filename) must not contain any null bytes +ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes bool(true) -fnmatch(): Argument #2 ($filename) must not contain any null bytes +ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes bool(false) bool(true) -- Iteration 3 -- -fnmatch(): Argument #1 ($pattern) must not contain any null bytes -fnmatch(): Argument #1 ($pattern) must not contain any null bytes -fnmatch(): Argument #1 ($pattern) must not contain any null bytes -fnmatch(): Argument #1 ($pattern) must not contain any null bytes -fnmatch(): Argument #1 ($pattern) must not contain any null bytes -fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes -- Iteration 4 -- bool(false) -fnmatch(): Argument #2 ($filename) must not contain any null bytes +ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes bool(false) -fnmatch(): Argument #2 ($filename) must not contain any null bytes +ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes bool(true) bool(false) -- Iteration 5 -- bool(true) -fnmatch(): Argument #2 ($filename) must not contain any null bytes +ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes bool(true) -fnmatch(): Argument #2 ($filename) must not contain any null bytes +ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes bool(false) bool(true) @@ -397,22 +397,22 @@ bool(true) --- With NULL --- -- Iteration 0 -- bool(true) -fnmatch(): Argument #2 ($filename) must not contain any null bytes +ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes bool(false) bool(false) -- Iteration 1 -- -fnmatch(): Argument #1 ($pattern) must not contain any null bytes -fnmatch(): Argument #1 ($pattern) must not contain any null bytes -fnmatch(): Argument #1 ($pattern) must not contain any null bytes -fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes -- Iteration 2 -- bool(false) -fnmatch(): Argument #2 ($filename) must not contain any null bytes +ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes bool(true) bool(false) -- Iteration 3 -- bool(false) -fnmatch(): Argument #2 ($filename) must not contain any null bytes +ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes bool(false) bool(true) diff --git a/ext/standard/tests/file/fputcsv_variation13.phpt b/ext/standard/tests/file/fputcsv_variation13.phpt index 2a2e1ef0470d..ef3a1984a478 100644 --- a/ext/standard/tests/file/fputcsv_variation13.phpt +++ b/ext/standard/tests/file/fputcsv_variation13.phpt @@ -53,8 +53,8 @@ foreach ($csv_lists as $csv_list) { // write to a file in csv format try { var_dump( fputcsv($file_handle, $csv_field, '+', '%%', escape: "\\") ); - } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } // check the file pointer position and eof var_dump( ftell($file_handle) ); @@ -76,649 +76,649 @@ echo "Done\n"; *** Testing fputcsv() : with default enclosure & delimiter of two chars *** -- file opened in r+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" diff --git a/ext/standard/tests/file/fputcsv_variation17.phpt b/ext/standard/tests/file/fputcsv_variation17.phpt index 786b06494679..f96fe0720c78 100644 --- a/ext/standard/tests/file/fputcsv_variation17.phpt +++ b/ext/standard/tests/file/fputcsv_variation17.phpt @@ -28,4 +28,4 @@ aaa,bbb,ccc,dddd 123,456,789 """aaa""","""bbb""" -aaa,bbb,ccc,dddd%0123,456,789%0"""aaa""","""bbb""" \ No newline at end of file +aaa,bbb,ccc,dddd%0123,456,789%0"""aaa""","""bbb""" diff --git a/ext/standard/tests/file/fputcsv_variation9.phpt b/ext/standard/tests/file/fputcsv_variation9.phpt index b2bc895cd870..4becae1b1e85 100644 --- a/ext/standard/tests/file/fputcsv_variation9.phpt +++ b/ext/standard/tests/file/fputcsv_variation9.phpt @@ -52,8 +52,8 @@ foreach ($csv_lists as $csv_list) { // write to a file in csv format try { var_dump( fputcsv($file_handle, $csv_field, '++', '%%') ); - } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } // check the file pointer position and eof var_dump( ftell($file_handle) ); @@ -75,649 +75,649 @@ echo "Done\n"; *** Testing fputcsv() : with two chars as enclosure & delimiter *** -- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" diff --git a/ext/standard/tests/file/fread_error.phpt b/ext/standard/tests/file/fread_error.phpt index b89369e288e9..4e3ffcbaef4b 100644 --- a/ext/standard/tests/file/fread_error.phpt +++ b/ext/standard/tests/file/fread_error.phpt @@ -11,20 +11,20 @@ echo "-- Testing fread() with invalid length arguments --\n"; $len = 0; try { var_dump( fread($file_handle, $len) ); -} catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $len = -10; try { var_dump( fread($file_handle, $len) ); -} catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- *** Testing error conditions *** -- Testing fread() with invalid length arguments -- -fread(): Argument #2 ($length) must be greater than 0 -fread(): Argument #2 ($length) must be greater than 0 +ValueError: fread(): Argument #2 ($length) must be greater than 0 +ValueError: fread(): Argument #2 ($length) must be greater than 0 diff --git a/ext/standard/tests/file/fscanf.phpt b/ext/standard/tests/file/fscanf.phpt index 4acadc6169b0..e081bfb36194 100644 --- a/ext/standard/tests/file/fscanf.phpt +++ b/ext/standard/tests/file/fscanf.phpt @@ -20,8 +20,8 @@ fclose($fp); $fp = fopen($filename, "rt"); try { fscanf($fp, "%s", $v, $v1); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump($v); var_dump($v1); @@ -32,8 +32,8 @@ $v1 = array(); $fp = fopen($filename, "rt"); try { fscanf($fp, "", $v, $v1); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump($v); var_dump($v1); @@ -44,8 +44,8 @@ $v1 = array(); $fp = fopen($filename, "rt"); try { fscanf($fp, "%.a", $v, $v1); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump($v); var_dump($v1); @@ -64,8 +64,8 @@ file_put_contents($filename, "data"); $fp = fopen($filename, "rt"); try { var_dump(fscanf($fp, "%s%d", $v)); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Done\n"; @@ -80,15 +80,15 @@ int(0) NULL int(1) string(4) "data" -Variable is not assigned by any conversion specifiers +ValueError: Variable is not assigned by any conversion specifiers string(4) "data" NULL -Variable is not assigned by any conversion specifiers +ValueError: Variable is not assigned by any conversion specifiers array(0) { } array(0) { } -Bad scan conversion character "." +ValueError: Bad scan conversion character "." array(0) { } array(0) { @@ -96,5 +96,5 @@ array(0) { bool(false) array(0) { } -Different numbers of variable names and field specifiers +ValueError: Different numbers of variable names and field specifiers Done diff --git a/ext/standard/tests/file/fscanf_error.phpt b/ext/standard/tests/file/fscanf_error.phpt index da586555be06..fe30b36b4a53 100644 --- a/ext/standard/tests/file/fscanf_error.phpt +++ b/ext/standard/tests/file/fscanf_error.phpt @@ -15,8 +15,8 @@ fclose($file_handle); // invalid file handle try { fscanf($file_handle, "%s"); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } // number of formats in format strings not matching the no of variables @@ -25,8 +25,8 @@ if ($file_handle == false) exit("Error:failed to open file $filename"); try { fscanf($file_handle, "%d%s%f", $int_var, $string_var); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } fclose($file_handle); @@ -41,8 +41,8 @@ foreach($invalid_formats as $format) { exit("Error:failed to open file $filename"); try { var_dump(fscanf($file_handle, $format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } fclose($file_handle); } @@ -57,13 +57,13 @@ unlink($filename); ?> --EXPECT-- *** Testing fscanf() for error conditions *** -fscanf(): supplied resource is not a valid File-Handle resource -Different numbers of variable names and field specifiers +TypeError: fscanf(): supplied resource is not a valid File-Handle resource +ValueError: Different numbers of variable names and field specifiers array(0) { } -Bad scan conversion character " -Bad scan conversion character " -Bad scan conversion character "." -Bad scan conversion character "m" +ValueError: Bad scan conversion character " +ValueError: Bad scan conversion character " +ValueError: Bad scan conversion character "." +ValueError: Bad scan conversion character "m" *** Done *** diff --git a/ext/standard/tests/file/fscanf_variation10.phpt b/ext/standard/tests/file/fscanf_variation10.phpt index 1de7d25ffd90..ec9e0785051d 100644 --- a/ext/standard/tests/file/fscanf_variation10.phpt +++ b/ext/standard/tests/file/fscanf_variation10.phpt @@ -58,8 +58,8 @@ foreach($float_formats as $float_format) { while( !feof($file_handle) ) { try { var_dump( fscanf($file_handle,$float_format) ); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -147,8 +147,8 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation11.phpt b/ext/standard/tests/file/fscanf_variation11.phpt index 40560cfb39d9..af1516d8063b 100644 --- a/ext/standard/tests/file/fscanf_variation11.phpt +++ b/ext/standard/tests/file/fscanf_variation11.phpt @@ -63,8 +63,8 @@ foreach($float_formats as $float_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$float_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -388,18 +388,18 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation12.phpt b/ext/standard/tests/file/fscanf_variation12.phpt index 0969d05febce..875935ad949f 100644 --- a/ext/standard/tests/file/fscanf_variation12.phpt +++ b/ext/standard/tests/file/fscanf_variation12.phpt @@ -64,8 +64,8 @@ foreach($float_formats as $float_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$float_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -497,24 +497,24 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation13.phpt b/ext/standard/tests/file/fscanf_variation13.phpt index 73806dc6e488..7dbff56b5c1f 100644 --- a/ext/standard/tests/file/fscanf_variation13.phpt +++ b/ext/standard/tests/file/fscanf_variation13.phpt @@ -50,8 +50,8 @@ foreach($float_formats as $float_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$float_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -147,10 +147,10 @@ NULL bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation14.phpt b/ext/standard/tests/file/fscanf_variation14.phpt index 97a07a98f2e1..7f1546eefa4d 100644 --- a/ext/standard/tests/file/fscanf_variation14.phpt +++ b/ext/standard/tests/file/fscanf_variation14.phpt @@ -96,8 +96,8 @@ foreach($string_formats as $string_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$string_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -565,30 +565,30 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation15.phpt b/ext/standard/tests/file/fscanf_variation15.phpt index b35bb1bebe25..54a0540413ec 100644 --- a/ext/standard/tests/file/fscanf_variation15.phpt +++ b/ext/standard/tests/file/fscanf_variation15.phpt @@ -66,8 +66,8 @@ foreach($string_formats as $string_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$string_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -463,21 +463,21 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation16.phpt b/ext/standard/tests/file/fscanf_variation16.phpt index 199db82a026e..89158474c09b 100644 --- a/ext/standard/tests/file/fscanf_variation16.phpt +++ b/ext/standard/tests/file/fscanf_variation16.phpt @@ -57,8 +57,8 @@ foreach($string_formats as $string_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$string_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -146,8 +146,8 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation17.phpt b/ext/standard/tests/file/fscanf_variation17.phpt index 64080a1a83b9..d88d758c905a 100644 --- a/ext/standard/tests/file/fscanf_variation17.phpt +++ b/ext/standard/tests/file/fscanf_variation17.phpt @@ -62,8 +62,8 @@ foreach($string_formats as $string_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$string_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -387,18 +387,18 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation18.phpt b/ext/standard/tests/file/fscanf_variation18.phpt index eef94173c583..d785c34c81bd 100644 --- a/ext/standard/tests/file/fscanf_variation18.phpt +++ b/ext/standard/tests/file/fscanf_variation18.phpt @@ -70,8 +70,8 @@ foreach($string_formats as $string_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$string_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -539,24 +539,24 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation19.phpt b/ext/standard/tests/file/fscanf_variation19.phpt index f5bc3f19e386..00d60ee31ce5 100644 --- a/ext/standard/tests/file/fscanf_variation19.phpt +++ b/ext/standard/tests/file/fscanf_variation19.phpt @@ -54,8 +54,8 @@ foreach($string_formats as $string_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$string_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -151,10 +151,10 @@ NULL bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation2.phpt b/ext/standard/tests/file/fscanf_variation2.phpt index f2c5593c3ee6..bf1d280d685b 100644 --- a/ext/standard/tests/file/fscanf_variation2.phpt +++ b/ext/standard/tests/file/fscanf_variation2.phpt @@ -64,8 +64,8 @@ foreach($int_formats as $int_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$int_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -533,24 +533,24 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation20.phpt b/ext/standard/tests/file/fscanf_variation20.phpt index 70b13dd55c90..22b1edf0c9e9 100644 --- a/ext/standard/tests/file/fscanf_variation20.phpt +++ b/ext/standard/tests/file/fscanf_variation20.phpt @@ -68,8 +68,8 @@ foreach($char_formats as $char_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$char_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -537,24 +537,24 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation21.phpt b/ext/standard/tests/file/fscanf_variation21.phpt index 86968ddd1177..7d6e8bfbfee2 100644 --- a/ext/standard/tests/file/fscanf_variation21.phpt +++ b/ext/standard/tests/file/fscanf_variation21.phpt @@ -66,8 +66,8 @@ foreach($char_formats as $char_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$char_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -463,21 +463,21 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation22.phpt b/ext/standard/tests/file/fscanf_variation22.phpt index 87a5fe21bc27..be049ca06c24 100644 --- a/ext/standard/tests/file/fscanf_variation22.phpt +++ b/ext/standard/tests/file/fscanf_variation22.phpt @@ -57,8 +57,8 @@ foreach($char_formats as $char_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$char_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -146,8 +146,8 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation23.phpt b/ext/standard/tests/file/fscanf_variation23.phpt index f7bb4ee55201..f96278d7e176 100644 --- a/ext/standard/tests/file/fscanf_variation23.phpt +++ b/ext/standard/tests/file/fscanf_variation23.phpt @@ -62,8 +62,8 @@ foreach($char_formats as $char_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$char_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -387,18 +387,18 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation24.phpt b/ext/standard/tests/file/fscanf_variation24.phpt index 4c46cf58dad1..9f41f68cba1d 100644 --- a/ext/standard/tests/file/fscanf_variation24.phpt +++ b/ext/standard/tests/file/fscanf_variation24.phpt @@ -68,8 +68,8 @@ foreach($char_formats as $char_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$char_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -531,24 +531,24 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation25.phpt b/ext/standard/tests/file/fscanf_variation25.phpt index dc9d9936022f..1a2b9f2a3d05 100644 --- a/ext/standard/tests/file/fscanf_variation25.phpt +++ b/ext/standard/tests/file/fscanf_variation25.phpt @@ -54,8 +54,8 @@ foreach($char_formats as $char_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$char_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -181,10 +181,10 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation26.phpt b/ext/standard/tests/file/fscanf_variation26.phpt index 19db8f45abfd..c91fba1aee27 100644 --- a/ext/standard/tests/file/fscanf_variation26.phpt +++ b/ext/standard/tests/file/fscanf_variation26.phpt @@ -49,8 +49,8 @@ foreach($char_formats as $char_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$char_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -206,11 +206,11 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation27.phpt b/ext/standard/tests/file/fscanf_variation27.phpt index a9560e042505..dd34a100e9ed 100644 --- a/ext/standard/tests/file/fscanf_variation27.phpt +++ b/ext/standard/tests/file/fscanf_variation27.phpt @@ -69,8 +69,8 @@ foreach($octal_formats as $octal_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$octal_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -538,24 +538,24 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation28.phpt b/ext/standard/tests/file/fscanf_variation28.phpt index 18c9726f8536..b327d0a70598 100644 --- a/ext/standard/tests/file/fscanf_variation28.phpt +++ b/ext/standard/tests/file/fscanf_variation28.phpt @@ -67,8 +67,8 @@ foreach($octal_formats as $octal_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$octal_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -464,21 +464,21 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation29.phpt b/ext/standard/tests/file/fscanf_variation29.phpt index a35d782fcd45..af3ec2ebaba6 100644 --- a/ext/standard/tests/file/fscanf_variation29.phpt +++ b/ext/standard/tests/file/fscanf_variation29.phpt @@ -58,8 +58,8 @@ foreach($octal_formats as $octal_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$octal_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -147,8 +147,8 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation30.phpt b/ext/standard/tests/file/fscanf_variation30.phpt index 9afde0f093ac..0fa139cd0d2a 100644 --- a/ext/standard/tests/file/fscanf_variation30.phpt +++ b/ext/standard/tests/file/fscanf_variation30.phpt @@ -63,8 +63,8 @@ foreach($octal_formats as $octal_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$octal_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -388,18 +388,18 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation31.phpt b/ext/standard/tests/file/fscanf_variation31.phpt index a9e2c8b26865..905d4b049794 100644 --- a/ext/standard/tests/file/fscanf_variation31.phpt +++ b/ext/standard/tests/file/fscanf_variation31.phpt @@ -64,8 +64,8 @@ foreach($octal_formats as $octal_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$octal_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -497,24 +497,24 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation32.phpt b/ext/standard/tests/file/fscanf_variation32.phpt index df393f9d8398..0b0351c10f2a 100644 --- a/ext/standard/tests/file/fscanf_variation32.phpt +++ b/ext/standard/tests/file/fscanf_variation32.phpt @@ -55,8 +55,8 @@ foreach($octal_formats as $octal_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$octal_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -152,10 +152,10 @@ NULL bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation35.phpt b/ext/standard/tests/file/fscanf_variation35.phpt index 61b939d32122..03b672d97578 100644 --- a/ext/standard/tests/file/fscanf_variation35.phpt +++ b/ext/standard/tests/file/fscanf_variation35.phpt @@ -53,8 +53,8 @@ foreach($hexa_formats as $hexa_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$hexa_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -142,8 +142,8 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation36.phpt b/ext/standard/tests/file/fscanf_variation36.phpt index 61571f6c6cb0..cfd5b95efb93 100644 --- a/ext/standard/tests/file/fscanf_variation36.phpt +++ b/ext/standard/tests/file/fscanf_variation36.phpt @@ -58,8 +58,8 @@ foreach($hexa_formats as $hexa_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$hexa_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -383,18 +383,18 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation37.phpt b/ext/standard/tests/file/fscanf_variation37.phpt index d597ebe307c6..9f7d299df2a1 100644 --- a/ext/standard/tests/file/fscanf_variation37.phpt +++ b/ext/standard/tests/file/fscanf_variation37.phpt @@ -64,8 +64,8 @@ foreach($hexa_formats as $hexa_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$hexa_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -497,24 +497,24 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation38.phpt b/ext/standard/tests/file/fscanf_variation38.phpt index 236d547f6b78..28563727effd 100644 --- a/ext/standard/tests/file/fscanf_variation38.phpt +++ b/ext/standard/tests/file/fscanf_variation38.phpt @@ -50,8 +50,8 @@ foreach($hexa_formats as $hexa_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$hexa_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -147,10 +147,10 @@ NULL bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation4.phpt b/ext/standard/tests/file/fscanf_variation4.phpt index 45a3b5702b1f..96c9cbb0f5f8 100644 --- a/ext/standard/tests/file/fscanf_variation4.phpt +++ b/ext/standard/tests/file/fscanf_variation4.phpt @@ -54,8 +54,8 @@ foreach($int_formats as $int_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$int_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -143,8 +143,8 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation41.phpt b/ext/standard/tests/file/fscanf_variation41.phpt index 4c993bbeec5a..0747c25a5db8 100644 --- a/ext/standard/tests/file/fscanf_variation41.phpt +++ b/ext/standard/tests/file/fscanf_variation41.phpt @@ -53,8 +53,8 @@ foreach($unsigned_formats as $unsigned_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$unsigned_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -142,8 +142,8 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation42.phpt b/ext/standard/tests/file/fscanf_variation42.phpt index 90436ff12490..be126b8b36f0 100644 --- a/ext/standard/tests/file/fscanf_variation42.phpt +++ b/ext/standard/tests/file/fscanf_variation42.phpt @@ -58,8 +58,8 @@ foreach($unsigned_formats as $unsigned_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$unsigned_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -383,18 +383,18 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation43.phpt b/ext/standard/tests/file/fscanf_variation43.phpt index 72afbba0c386..5341f6eff5ac 100644 --- a/ext/standard/tests/file/fscanf_variation43.phpt +++ b/ext/standard/tests/file/fscanf_variation43.phpt @@ -64,8 +64,8 @@ foreach($unsigned_formats as $unsigned_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$unsigned_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -497,24 +497,24 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation44.phpt b/ext/standard/tests/file/fscanf_variation44.phpt index 3dfd5d6d7bda..5e58ad2df68a 100644 --- a/ext/standard/tests/file/fscanf_variation44.phpt +++ b/ext/standard/tests/file/fscanf_variation44.phpt @@ -50,8 +50,8 @@ foreach($unsigned_formats as $unsigned_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$unsigned_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -147,10 +147,10 @@ NULL bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation45.phpt b/ext/standard/tests/file/fscanf_variation45.phpt index b694da0e555c..0d8ef5a1b531 100644 --- a/ext/standard/tests/file/fscanf_variation45.phpt +++ b/ext/standard/tests/file/fscanf_variation45.phpt @@ -64,8 +64,8 @@ foreach($scientific_formats as $scientific_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$scientific_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -533,24 +533,24 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation46.phpt b/ext/standard/tests/file/fscanf_variation46.phpt index bc96af6dbe37..26e71d4a9d88 100644 --- a/ext/standard/tests/file/fscanf_variation46.phpt +++ b/ext/standard/tests/file/fscanf_variation46.phpt @@ -62,8 +62,8 @@ foreach($scientific_formats as $scientific_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$scientific_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -459,21 +459,21 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation47.phpt b/ext/standard/tests/file/fscanf_variation47.phpt index 04b92b7e9f78..9d77347bac44 100644 --- a/ext/standard/tests/file/fscanf_variation47.phpt +++ b/ext/standard/tests/file/fscanf_variation47.phpt @@ -53,8 +53,8 @@ foreach($scientific_formats as $scientific_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$scientific_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -142,8 +142,8 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation48.phpt b/ext/standard/tests/file/fscanf_variation48.phpt index aa717bd83e0d..08baeea192e4 100644 --- a/ext/standard/tests/file/fscanf_variation48.phpt +++ b/ext/standard/tests/file/fscanf_variation48.phpt @@ -58,8 +58,8 @@ foreach($scientific_formats as $scientific_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$scientific_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -383,18 +383,18 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation49.phpt b/ext/standard/tests/file/fscanf_variation49.phpt index 43505fc24917..ca1c86f92849 100644 --- a/ext/standard/tests/file/fscanf_variation49.phpt +++ b/ext/standard/tests/file/fscanf_variation49.phpt @@ -64,8 +64,8 @@ foreach($scientific_formats as $scientific_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$scientific_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -497,24 +497,24 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation5.phpt b/ext/standard/tests/file/fscanf_variation5.phpt index 7ccdbf6402e4..b6b9a8d7fcce 100644 --- a/ext/standard/tests/file/fscanf_variation5.phpt +++ b/ext/standard/tests/file/fscanf_variation5.phpt @@ -58,8 +58,8 @@ foreach($int_formats as $int_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$int_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -383,18 +383,18 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation50.phpt b/ext/standard/tests/file/fscanf_variation50.phpt index 1e6ecb865e94..c52f5a571d73 100644 --- a/ext/standard/tests/file/fscanf_variation50.phpt +++ b/ext/standard/tests/file/fscanf_variation50.phpt @@ -50,8 +50,8 @@ foreach($scientific_formats as $scientific_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$scientific_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -147,10 +147,10 @@ NULL bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation6.phpt b/ext/standard/tests/file/fscanf_variation6.phpt index 577477e5de60..1b1f3eadbedc 100644 --- a/ext/standard/tests/file/fscanf_variation6.phpt +++ b/ext/standard/tests/file/fscanf_variation6.phpt @@ -64,8 +64,8 @@ foreach($int_formats as $int_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$int_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -497,24 +497,24 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation7.phpt b/ext/standard/tests/file/fscanf_variation7.phpt index 42e2455eea80..36af4e193da7 100644 --- a/ext/standard/tests/file/fscanf_variation7.phpt +++ b/ext/standard/tests/file/fscanf_variation7.phpt @@ -50,8 +50,8 @@ foreach($int_formats as $int_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$int_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -147,10 +147,10 @@ NULL bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation8.phpt b/ext/standard/tests/file/fscanf_variation8.phpt index 2851d7c02773..38b93abdd53e 100644 --- a/ext/standard/tests/file/fscanf_variation8.phpt +++ b/ext/standard/tests/file/fscanf_variation8.phpt @@ -82,8 +82,8 @@ foreach($float_formats as $float_format) { while( !feof($file_handle) ) { try { var_dump(fscanf($file_handle,$float_format)); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -839,36 +839,36 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt b/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt index c38f7905399b..8f123b2fb719 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt @@ -11,8 +11,8 @@ $fp = fopen(__FILE__, "r"); fclose($fp); try { var_dump(fseek($fp,10)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -20,5 +20,5 @@ echo "Done\n"; --EXPECT-- *** Testing fseek() : error conditions *** -- Testing fseek() with closed/unset file handle -- -fseek(): Argument #1 ($stream) must be an open stream resource +TypeError: fseek(): Argument #1 ($stream) must be an open stream resource Done diff --git a/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt b/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt index 58c3b5330d87..ae2ccd73be54 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt @@ -11,8 +11,8 @@ $fp = fopen(__FILE__, "r"); fclose($fp); try { var_dump(ftell($fp)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -20,5 +20,5 @@ echo "Done\n"; --EXPECT-- *** Testing ftell() : error conditions *** -- Testing ftell with closed/unset file handle -- -ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource Done diff --git a/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt b/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt index ad50244edb3e..d9c188ea4bac 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt @@ -11,8 +11,8 @@ $fp = fopen(__FILE__, "r"); fclose($fp); try { var_dump(rewind($fp)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -20,5 +20,5 @@ echo "Done\n"; --EXPECT-- *** Testing rewind() : error conditions *** -- Testing rewind() with closed/unset file handle -- -rewind(): Argument #1 ($stream) must be an open stream resource +TypeError: rewind(): Argument #1 ($stream) must be an open stream resource Done diff --git a/ext/standard/tests/file/fstat.phpt b/ext/standard/tests/file/fstat.phpt index 86d1453f1b72..5199a556288d 100644 --- a/ext/standard/tests/file/fstat.phpt +++ b/ext/standard/tests/file/fstat.phpt @@ -10,8 +10,8 @@ var_dump(fstat($fp)); fclose($fp); try { var_dump(fstat($fp)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } @unlink($filename); @@ -72,5 +72,5 @@ array(26) { ["blocks"]=> int(%i) } -fstat(): Argument #1 ($stream) must be an open stream resource +TypeError: fstat(): Argument #1 ($stream) must be an open stream resource Done diff --git a/ext/standard/tests/file/ftruncate.phpt b/ext/standard/tests/file/ftruncate.phpt index 2bdefefaaf1d..127f564fe61e 100644 --- a/ext/standard/tests/file/ftruncate.phpt +++ b/ext/standard/tests/file/ftruncate.phpt @@ -34,8 +34,8 @@ file_put_contents($filename, "some test data inside"); $fp = fopen($filename, "a"); try { var_dump(ftruncate($fp, -1000000000)); -} catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } fclose($fp); var_dump(file_get_contents($filename)); @@ -52,5 +52,5 @@ bool(true) string(10) "some test " bool(true) string(0) "" -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 string(21) "some test data inside" diff --git a/ext/standard/tests/file/ftruncate_error.phpt b/ext/standard/tests/file/ftruncate_error.phpt index 3397fc25f44a..9783dca116da 100644 --- a/ext/standard/tests/file/ftruncate_error.phpt +++ b/ext/standard/tests/file/ftruncate_error.phpt @@ -17,8 +17,8 @@ echo "-- Testing ftruncate() with closed/unset file handle --\n"; fclose($file_handle); try { var_dump( ftruncate($file_handle,10) ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } // check the first size var_dump( filesize($filename) ); @@ -35,6 +35,6 @@ unlink( $filename ); Initial file size = 36 -- Testing ftruncate() with closed/unset file handle -- -ftruncate(): Argument #1 ($stream) must be an open stream resource +TypeError: ftruncate(): Argument #1 ($stream) must be an open stream resource int(36) Done diff --git a/ext/standard/tests/file/ftruncate_variation4.phpt b/ext/standard/tests/file/ftruncate_variation4.phpt index 865b6ff902a2..29ffeb01638f 100644 --- a/ext/standard/tests/file/ftruncate_variation4.phpt +++ b/ext/standard/tests/file/ftruncate_variation4.phpt @@ -48,8 +48,8 @@ foreach($file_content_types as $file_content_type) { var_dump( ftell($file_handle) ); try { var_dump( ftruncate($file_handle, $new_size) ); // truncate it - } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + } catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump( ftell($file_handle) ); var_dump( feof($file_handle) ); @@ -72,7 +72,7 @@ echo "Done\n"; -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -80,7 +80,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -88,7 +88,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -96,7 +96,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -104,7 +104,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -112,7 +112,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -120,7 +120,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -128,7 +128,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -136,7 +136,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -144,7 +144,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -152,7 +152,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -160,7 +160,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -168,7 +168,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -176,7 +176,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -184,7 +184,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -192,7 +192,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -200,7 +200,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -208,7 +208,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -216,7 +216,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -224,7 +224,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -232,7 +232,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -240,7 +240,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -248,7 +248,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -256,7 +256,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -266,7 +266,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -274,7 +274,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -282,7 +282,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -290,7 +290,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -298,7 +298,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -306,7 +306,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -314,7 +314,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -322,7 +322,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -330,7 +330,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -338,7 +338,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -346,7 +346,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -354,7 +354,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -362,7 +362,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -370,7 +370,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -378,7 +378,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -386,7 +386,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -394,7 +394,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -402,7 +402,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -410,7 +410,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -418,7 +418,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -426,7 +426,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -434,7 +434,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -442,7 +442,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -450,7 +450,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) diff --git a/ext/standard/tests/file/fwrite_error.phpt b/ext/standard/tests/file/fwrite_error.phpt index 62ec928a29df..0ffda1c7595d 100644 --- a/ext/standard/tests/file/fwrite_error.phpt +++ b/ext/standard/tests/file/fwrite_error.phpt @@ -23,8 +23,8 @@ echo "-- Testing fwrite() with closed/unset file handle --\n"; fclose($file_handle); try { var_dump(fwrite($file_handle,"data")); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -40,5 +40,5 @@ unlink( $filename ); int(0) int(0) -- Testing fwrite() with closed/unset file handle -- -fwrite(): Argument #1 ($stream) must be an open stream resource +TypeError: fwrite(): Argument #1 ($stream) must be an open stream resource Done diff --git a/ext/standard/tests/file/gh18212.phpt b/ext/standard/tests/file/gh18212.phpt index 6e4d8ad9bd32..07f5780d66c6 100644 --- a/ext/standard/tests/file/gh18212.phpt +++ b/ext/standard/tests/file/gh18212.phpt @@ -10,4 +10,3 @@ fclose($fp); --EXPECT-- int(-1) int(-1) - diff --git a/ext/standard/tests/file/glob_variation.phpt b/ext/standard/tests/file/glob_variation.phpt index 4fc1c240b4d4..b36793d3f3e0 100644 --- a/ext/standard/tests/file/glob_variation.phpt +++ b/ext/standard/tests/file/glob_variation.phpt @@ -51,8 +51,8 @@ foreach($patterns as $pattern) { var_dump( glob($pattern, GLOB_NOCHECK) ); var_dump( glob($pattern, GLOB_NOESCAPE) ); var_dump( glob($pattern, GLOB_ERR) ); - } catch (Error $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $counter++; } @@ -77,8 +77,8 @@ foreach($patterns as $pattern) { echo "-- Iteration $counter --\n"; try { var_dump( glob($pattern, GLOB_ONLYDIR) ); - } catch (Error $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $counter++; } @@ -332,7 +332,7 @@ array(0) { } -- Iteration 8 -- -glob(): Argument #1 ($pattern) must not contain any null bytes +ValueError: glob(): Argument #1 ($pattern) must not contain any null bytes -- Iteration 9 -- array(0) { @@ -435,7 +435,7 @@ array(1) { array(0) { } -- Iteration 8 -- -glob(): Argument #1 ($pattern) must not contain any null bytes +ValueError: glob(): Argument #1 ($pattern) must not contain any null bytes -- Iteration 9 -- array(0) { } diff --git a/ext/standard/tests/file/is_dir_variation4.phpt b/ext/standard/tests/file/is_dir_variation4.phpt index 30285804a33c..4dd3aca9c2e2 100644 --- a/ext/standard/tests/file/is_dir_variation4.phpt +++ b/ext/standard/tests/file/is_dir_variation4.phpt @@ -31,8 +31,8 @@ foreach($dirs_arr as $dir) { echo "\n-- Iteration $count --\n"; try { var_dump( is_dir($file_path."/".$dir ) ); - } catch (Error $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $count++; } diff --git a/ext/standard/tests/file/is_executable_variation1.phpt b/ext/standard/tests/file/is_executable_variation1.phpt index 289abb1a265f..153fad15d351 100644 --- a/ext/standard/tests/file/is_executable_variation1.phpt +++ b/ext/standard/tests/file/is_executable_variation1.phpt @@ -44,8 +44,8 @@ foreach($files_arr as $file) { echo "-- Iteration $counter --\n"; try { var_dump( is_executable($file) ); - } catch (Error $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $counter++; clearstatcache(); diff --git a/ext/standard/tests/file/is_file_variation4.phpt b/ext/standard/tests/file/is_file_variation4.phpt index 9d98b7fd90d7..a69d62e5280f 100644 --- a/ext/standard/tests/file/is_file_variation4.phpt +++ b/ext/standard/tests/file/is_file_variation4.phpt @@ -31,8 +31,8 @@ foreach($files_arr as $file) { echo "- Iteration $count -\n"; try { var_dump( is_file( $file_path."/".$file ) ); - } catch (Error $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } clearstatcache(); $count++; diff --git a/ext/standard/tests/file/is_readable_variation1.phpt b/ext/standard/tests/file/is_readable_variation1.phpt index 8548a840ccbe..ca697320eeb9 100644 --- a/ext/standard/tests/file/is_readable_variation1.phpt +++ b/ext/standard/tests/file/is_readable_variation1.phpt @@ -43,8 +43,8 @@ foreach($files_arr as $file) { echo "-- Iteration $counter --\n"; try { var_dump( is_readable($file) ); - } catch (Error $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $counter++; clearstatcache(); diff --git a/ext/standard/tests/file/is_writable_variation1.phpt b/ext/standard/tests/file/is_writable_variation1.phpt index 181b1ba4e268..337e3e5986f6 100644 --- a/ext/standard/tests/file/is_writable_variation1.phpt +++ b/ext/standard/tests/file/is_writable_variation1.phpt @@ -42,13 +42,13 @@ foreach($files_arr as $file) { echo "-- Iteration $counter --\n"; try { var_dump( is_writable($file) ); - } catch (Error $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( is_writeable($file) ); - } catch (Error $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $counter++; clearstatcache(); diff --git a/ext/standard/tests/file/mkdir_rmdir_variation2.phpt b/ext/standard/tests/file/mkdir_rmdir_variation2.phpt index 831cb0c95662..0c63c2874634 100644 --- a/ext/standard/tests/file/mkdir_rmdir_variation2.phpt +++ b/ext/standard/tests/file/mkdir_rmdir_variation2.phpt @@ -25,13 +25,13 @@ var_dump( rmdir("$file_path/mkdir_variation2/") ); echo "\n*** Testing mkdir() and rmdir() for binary safe functionality ***\n"; try { var_dump( mkdir("$file_path/temp".chr(0)."/") ); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( rmdir("$file_path/temp".chr(0)."/") ); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n*** Testing mkdir() with miscellaneous input ***\n"; @@ -60,8 +60,8 @@ Warning: rmdir(): %s on line %d bool(false) *** Testing mkdir() and rmdir() for binary safe functionality *** -mkdir(): Argument #1 ($directory) must not contain any null bytes -rmdir(): Argument #1 ($directory) must not contain any null bytes +ValueError: mkdir(): Argument #1 ($directory) must not contain any null bytes +ValueError: rmdir(): Argument #1 ($directory) must not contain any null bytes *** Testing mkdir() with miscellaneous input *** bool(true) diff --git a/ext/standard/tests/file/pathinfo_variation3.phpt b/ext/standard/tests/file/pathinfo_variation3.phpt index 86f88677d813..7d2f62a97cd8 100644 --- a/ext/standard/tests/file/pathinfo_variation3.phpt +++ b/ext/standard/tests/file/pathinfo_variation3.phpt @@ -18,33 +18,33 @@ var_dump(pathinfo($testfile, PATHINFO_DIRNAME)); try { pathinfo($testfile, PATHINFO_EXTENSION|PATHINFO_FILENAME|PATHINFO_DIRNAME); -} catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { pathinfo($testfile, PATHINFO_EXTENSION|PATHINFO_FILENAME); -} catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { pathinfo($testfile, PATHINFO_EXTENSION|PATHINFO_DIRNAME); -} catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { pathinfo($testfile, PATHINFO_FILENAME|PATHINFO_BASENAME); -} catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { pathinfo($testfile, PATHINFO_DIRNAME|PATHINFO_EXTENSION); -} catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { pathinfo($testfile, PATHINFO_DIRNAME|PATHINFO_BASENAME); -} catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -84,9 +84,9 @@ string(6) "inet.h" string(4) "inet" string(1) "h" string(17) "/usr/include/arpa" -pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants -pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants -pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants -pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants -pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants -pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants diff --git a/ext/standard/tests/file/popen_pclose_error.phpt b/ext/standard/tests/file/popen_pclose_error.phpt index 6c92708dddb7..9258e2c80928 100644 --- a/ext/standard/tests/file/popen_pclose_error.phpt +++ b/ext/standard/tests/file/popen_pclose_error.phpt @@ -5,24 +5,24 @@ Test popen() and pclose function: error conditions try { popen("abc.txt", "x"); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { popen("abc.txt", "rw"); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { popen("abc.txt", "rwb"); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -popen(): Argument #2 ($mode) must be one of "r", "rb", "w", or "wb" -popen(): Argument #2 ($mode) must be one of "r", "rb", "w", or "wb" -popen(): Argument #2 ($mode) must be one of "r", "rb", "w", or "wb" +ValueError: popen(): Argument #2 ($mode) must be one of "r", "rb", "w", or "wb" +ValueError: popen(): Argument #2 ($mode) must be one of "r", "rb", "w", or "wb" +ValueError: popen(): Argument #2 ($mode) must be one of "r", "rb", "w", or "wb" diff --git a/ext/standard/tests/file/proc_open_with_wrong_resource_type.phpt b/ext/standard/tests/file/proc_open_with_wrong_resource_type.phpt index f48c7b872003..00488b9d1c60 100644 --- a/ext/standard/tests/file/proc_open_with_wrong_resource_type.phpt +++ b/ext/standard/tests/file/proc_open_with_wrong_resource_type.phpt @@ -6,9 +6,9 @@ proc_open does not leak memory when called with wrong resource type in descripto try { proc_open('not_a_real_command_but_I_dont_care', array(0 => $context), $pipes); echo "Not reached"; - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -proc_open(): supplied resource is not a valid stream resource +TypeError: proc_open(): supplied resource is not a valid stream resource diff --git a/ext/standard/tests/file/readfile_error.phpt b/ext/standard/tests/file/readfile_error.phpt index d21554296a15..07d2a447d9f7 100644 --- a/ext/standard/tests/file/readfile_error.phpt +++ b/ext/standard/tests/file/readfile_error.phpt @@ -10,13 +10,13 @@ echo "\n-- Testing readfile() with invalid arguments --\n"; // invalid arguments try { var_dump( readfile('') ); // empty string as $filename -} catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( readfile(false) ); // boolean false as $filename -} catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing readfile() with non-existent file --\n"; @@ -29,8 +29,8 @@ echo "Done\n"; *** Test readfile(): error conditions *** -- Testing readfile() with invalid arguments -- -Path must not be empty -Path must not be empty +ValueError: Path must not be empty +ValueError: Path must not be empty -- Testing readfile() with non-existent file -- diff --git a/ext/standard/tests/file/readfile_variation10.phpt b/ext/standard/tests/file/readfile_variation10.phpt index 3782f7384515..2c0f356c2db1 100644 --- a/ext/standard/tests/file/readfile_variation10.phpt +++ b/ext/standard/tests/file/readfile_variation10.phpt @@ -35,8 +35,8 @@ for( $i=0; $igetMessage(), "\n"; + } catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> diff --git a/ext/standard/tests/file/stream_rfc2397_006.phpt b/ext/standard/tests/file/stream_rfc2397_006.phpt index bde1d4e0cebe..39184320e77a 100644 --- a/ext/standard/tests/file/stream_rfc2397_006.phpt +++ b/ext/standard/tests/file/stream_rfc2397_006.phpt @@ -16,15 +16,15 @@ foreach($streams as $stream) { try { var_dump(file_get_contents($stream)); - } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> --EXPECTF-- -file_get_contents(): Argument #1 ($filename) must not contain any null bytes -file_get_contents(): Argument #1 ($filename) must not contain any null bytes +ValueError: file_get_contents(): Argument #1 ($filename) must not contain any null bytes +ValueError: file_get_contents(): Argument #1 ($filename) must not contain any null bytes Warning: file_get_contents(): Failed to open stream: rfc2397: unable to decode in %sstream_rfc2397_006.php on line %d bool(false) diff --git a/ext/standard/tests/file/stream_supports_lock.phpt b/ext/standard/tests/file/stream_supports_lock.phpt index 76249e9106ee..6225000392bd 100644 --- a/ext/standard/tests/file/stream_supports_lock.phpt +++ b/ext/standard/tests/file/stream_supports_lock.phpt @@ -28,8 +28,8 @@ $sock = stream_context_create(); var_dump($sock); try { var_dump(stream_supports_lock($sock)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -44,5 +44,5 @@ bool(false) resource(%d) of type (stream) bool(false) resource(%d) of type (stream-context) -stream_supports_lock(): Argument #1 ($stream) must be an open stream resource +TypeError: stream_supports_lock(): Argument #1 ($stream) must be an open stream resource Done diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_error1.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_error1.phpt index c8420ea86fb2..a247967823c3 100644 --- a/ext/standard/tests/file/symlink_link_linkinfo_is_link_error1.phpt +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_error1.phpt @@ -29,8 +29,8 @@ echo "\n*** Testing linkinfo() for error conditions ***\n"; //invalid arguments try { var_dump(linkinfo('')); // empty string as linkname -} catch (ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -56,5 +56,5 @@ Warning: symlink(): %s in %s on line %d bool(false) *** Testing linkinfo() for error conditions *** -linkinfo(): Argument #1 ($path) must not be empty +ValueError: linkinfo(): Argument #1 ($path) must not be empty Done diff --git a/ext/standard/tests/file/tempnam_variation3.phpt b/ext/standard/tests/file/tempnam_variation3.phpt index 6f20ec140ef4..008b7f6dc468 100644 --- a/ext/standard/tests/file/tempnam_variation3.phpt +++ b/ext/standard/tests/file/tempnam_variation3.phpt @@ -36,8 +36,8 @@ for( $i=0; $igetMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; continue; } @@ -97,9 +97,9 @@ File name is => %s/%s File permissions are => 100600 File created in => directory specified -- Iteration 5 -- -tempnam(): Argument #2 ($prefix) must not contain any null bytes +ValueError: tempnam(): Argument #2 ($prefix) must not contain any null bytes -- Iteration 6 -- -tempnam(): Argument #2 ($prefix) must be of type string, array given +TypeError: tempnam(): Argument #2 ($prefix) must be of type string, array given -- Iteration 7 -- File name is => %s/dir%s File permissions are => 100600 diff --git a/ext/standard/tests/file/tempnam_variation7.phpt b/ext/standard/tests/file/tempnam_variation7.phpt index 1928da4f8962..6e8baec0d66a 100644 --- a/ext/standard/tests/file/tempnam_variation7.phpt +++ b/ext/standard/tests/file/tempnam_variation7.phpt @@ -34,8 +34,8 @@ for( $i=0; $igetMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; continue; } @@ -96,9 +96,9 @@ File name is => %s%etempnam_variation3.tmp%s File permissions are => 100600 File created in => temp dir -- Iteration 5 -- -tempnam(): Argument #1 ($directory) must not contain any null bytes +ValueError: tempnam(): Argument #1 ($directory) must not contain any null bytes -- Iteration 6 -- -tempnam(): Argument #1 ($directory) must be of type string, array given +TypeError: tempnam(): Argument #1 ($directory) must be of type string, array given -- Iteration 7 -- Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation7.php on line %d diff --git a/ext/standard/tests/file/tempnam_variation9.phpt b/ext/standard/tests/file/tempnam_variation9.phpt index 61178a022ce3..8696eeba1d60 100644 --- a/ext/standard/tests/file/tempnam_variation9.phpt +++ b/ext/standard/tests/file/tempnam_variation9.phpt @@ -30,8 +30,8 @@ foreach($names_arr as $i=>$prefix) { echo "-- Iteration $i --\n"; try { $file_name = tempnam("$file_path", $prefix); - } catch (Error $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; continue; } diff --git a/ext/standard/tests/file/touch.phpt b/ext/standard/tests/file/touch.phpt index 9e3972631aa6..93df50282cbc 100644 --- a/ext/standard/tests/file/touch.phpt +++ b/ext/standard/tests/file/touch.phpt @@ -37,8 +37,8 @@ var_dump(touch("/no/such/file/or/directory")); try { touch("/no/such/file/or/directory", null, 1599492068); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Done\n"; @@ -57,5 +57,5 @@ int(100) Warning: touch(): Unable to create file /no/such/file/or/directory because %s in %s on line %d bool(false) -touch(): Argument #2 ($mtime) cannot be null when argument #3 ($atime) is an integer +ValueError: touch(): Argument #2 ($mtime) cannot be null when argument #3 ($atime) is an integer Done diff --git a/ext/standard/tests/file/userstreams.phpt b/ext/standard/tests/file/userstreams.phpt index 6ed35e1871f1..69a8e7620709 100644 --- a/ext/standard/tests/file/userstreams.phpt +++ b/ext/standard/tests/file/userstreams.phpt @@ -160,8 +160,8 @@ class mystream try { stream_wrapper_register("bogus", "class_not_exist"); die("Registered a non-existent class!!!???"); -} catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Not Registered\n"; @@ -319,7 +319,7 @@ echo $data . "\n"; ?> --EXPECT-- -stream_wrapper_register(): Argument #2 ($class) must be a valid class name, "class_not_exist" given +TypeError: stream_wrapper_register(): Argument #2 ($class) must be a valid class name, "class_not_exist" given Not Registered Registered Registered diff --git a/ext/standard/tests/file/userstreams_002.phpt b/ext/standard/tests/file/userstreams_002.phpt index ec16ed432079..47d0b922cd1d 100644 --- a/ext/standard/tests/file/userstreams_002.phpt +++ b/ext/standard/tests/file/userstreams_002.phpt @@ -25,8 +25,8 @@ function test($name, $fd, $return_value) { $w = $e = null; try { var_dump(stream_select($r, $w, $e, 0) !== false); - } catch (TypeError|ValueError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -56,26 +56,26 @@ bool(true) Warning: stream_select(): test_wrapper_base::stream_cast is not implemented! in %s Warning: stream_select(): Cannot represent a stream of type user-space as a select()able descriptor in %s -No stream arrays were passed +ValueError: No stream arrays were passed ------ return value is false: ------- Warning: stream_select(): Cannot represent a stream of type user-space as a select()able descriptor in %s -No stream arrays were passed +ValueError: No stream arrays were passed ------ return value not a stream resource: ------- Warning: stream_select(): test_wrapper::stream_cast must return a stream resource in %s Warning: stream_select(): Cannot represent a stream of type user-space as a select()able descriptor in %s -No stream arrays were passed +ValueError: No stream arrays were passed ------ return value is stream itself: ------- Warning: stream_select(): test_wrapper::stream_cast must not return itself in %s Warning: stream_select(): Cannot represent a stream of type user-space as a select()able descriptor in %s -No stream arrays were passed +ValueError: No stream arrays were passed ------ return value cannot be casted: ------- @@ -84,4 +84,4 @@ Warning: stream_select(): test_wrapper_base::stream_cast is not implemented! in Warning: stream_select(): Cannot represent a stream of type user-space as a select()able descriptor in %s Warning: stream_select(): Cannot represent a stream of type user-space as a select()able descriptor in %s -No stream arrays were passed +ValueError: No stream arrays were passed diff --git a/ext/standard/tests/file/userstreams_005.phpt b/ext/standard/tests/file/userstreams_005.phpt index 11dc8d45b0cd..717944951394 100644 --- a/ext/standard/tests/file/userstreams_005.phpt +++ b/ext/standard/tests/file/userstreams_005.phpt @@ -41,8 +41,8 @@ test("stream_truncate size 0", $fd, 0); test("stream_truncate size 10", $fd, 10); try { test("stream_truncate negative size", $fd, -1); -} catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } test("stream_truncate bad return", $fd3, 0); ?> @@ -61,7 +61,7 @@ bool(true) truncation with new_size=10 bool(true) ------ stream_truncate negative size: ------- -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 ------ stream_truncate bad return: ------- truncation with new_size=0 diff --git a/ext/standard/tests/filters/bug54350.phpt b/ext/standard/tests/filters/bug54350.phpt index ec3cd857f1a0..3a03e839489e 100644 --- a/ext/standard/tests/filters/bug54350.phpt +++ b/ext/standard/tests/filters/bug54350.phpt @@ -9,8 +9,8 @@ class user_filter extends php_user_filter { } try { fclose($this->stream); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } return 0; } @@ -23,4 +23,4 @@ fwrite($fd, "foo"); ?> --EXPECTF-- Warning: fclose(): cannot close the provided stream, as it must not be manually closed in %s on line %d -fclose(): Argument #1 ($stream) must be of type resource, null given +TypeError: fclose(): Argument #1 ($stream) must be of type resource, null given diff --git a/ext/standard/tests/filters/bug77231.phpt b/ext/standard/tests/filters/bug77231.phpt index 17967ee80fc5..b499e4b4eb60 100644 --- a/ext/standard/tests/filters/bug77231.phpt +++ b/ext/standard/tests/filters/bug77231.phpt @@ -8,4 +8,4 @@ var_dump(file(urldecode('php://filter/convert.quoted-printable-encode/resource=d array(1) { [0]=> string(74) "=BFAAAAAAAAFAAAAAAAAAAAAAA=FF=FF=FF=FF=FF=FF=FF=FFAAAAAAAAAAAAAAAAAAAAAAAA" -} \ No newline at end of file +} diff --git a/ext/standard/tests/filters/bug79468.phpt b/ext/standard/tests/filters/bug79468.phpt index 0373f317102e..3599d89a5aba 100644 --- a/ext/standard/tests/filters/bug79468.phpt +++ b/ext/standard/tests/filters/bug79468.phpt @@ -14,8 +14,8 @@ fclose($fp); try { stream_filter_remove($rot13_filter); } catch (\Throwable $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -string(79) "stream_filter_remove(): supplied resource is not a valid stream filter resource" +TypeError: stream_filter_remove(): supplied resource is not a valid stream filter resource diff --git a/ext/standard/tests/filters/object_init_failure.phpt b/ext/standard/tests/filters/object_init_failure.phpt index 3a88d87ccab0..8c06a5d5078d 100644 --- a/ext/standard/tests/filters/object_init_failure.phpt +++ b/ext/standard/tests/filters/object_init_failure.phpt @@ -8,12 +8,12 @@ class SampleFilter extends php_user_filter { stream_filter_register('sample.filter', SampleFilter::class); try { var_dump(file_get_contents('php://filter/read=sample.filter/resource='. __FILE__)); -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Warning: file_get_contents(): Unable to create or locate filter "sample.filter" in %s on line %d Warning: file_get_contents(): Unable to create filter (sample.filter) in %s on line %d -Undefined constant "FOO" +Error: Undefined constant "FOO" diff --git a/ext/standard/tests/filters/object_init_failure_2.phpt b/ext/standard/tests/filters/object_init_failure_2.phpt index 32473bc83127..69ceeae41922 100644 --- a/ext/standard/tests/filters/object_init_failure_2.phpt +++ b/ext/standard/tests/filters/object_init_failure_2.phpt @@ -8,12 +8,12 @@ class SampleFilter extends php_user_filter { stream_filter_register('sample.filter', SampleFilter::class); try { include 'php://filter/read=sample.filter/resource='. __FILE__; -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Warning: main(): Unable to create or locate filter "sample.filter" in %s on line %d Warning: main(): Unable to create filter (sample.filter) in %s on line %d -Undefined constant "FOO" +Error: Undefined constant "FOO" diff --git a/ext/standard/tests/filters/stream_filter_remove_error.phpt b/ext/standard/tests/filters/stream_filter_remove_error.phpt index c16614f59417..b00c94d2ca6a 100644 --- a/ext/standard/tests/filters/stream_filter_remove_error.phpt +++ b/ext/standard/tests/filters/stream_filter_remove_error.phpt @@ -17,8 +17,8 @@ echo "*** Testing stream_filter_remove() : error conditions ***\n"; echo "\n-- Testing stream_filter_remove() function with bad resource --\n"; try { stream_filter_remove($fp); -} catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\n-- Testing stream_filter_remove() function with an already removed filter --\n"; @@ -26,8 +26,8 @@ echo "\n-- Testing stream_filter_remove() function with an already removed filte var_dump(stream_filter_remove( $filter )); try { stream_filter_remove($filter); -} catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } fclose( $fp ); @@ -42,8 +42,8 @@ $file = __DIR__ . DIRECTORY_SEPARATOR . 'streamfilterTestErrors.txt'; *** Testing stream_filter_remove() : error conditions *** -- Testing stream_filter_remove() function with bad resource -- -stream_filter_remove(): supplied resource is not a valid stream filter resource +TypeError: stream_filter_remove(): supplied resource is not a valid stream filter resource -- Testing stream_filter_remove() function with an already removed filter -- bool(true) -stream_filter_remove(): supplied resource is not a valid stream filter resource +TypeError: stream_filter_remove(): supplied resource is not a valid stream filter resource diff --git a/ext/standard/tests/general_functions/010.phpt b/ext/standard/tests/general_functions/010.phpt index 08c941331f54..063e465dfaf9 100644 --- a/ext/standard/tests/general_functions/010.phpt +++ b/ext/standard/tests/general_functions/010.phpt @@ -13,12 +13,12 @@ class test { try { var_dump(register_shutdown_function(array("test","__call"))); -} catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Done\n"; ?> --EXPECT-- -register_shutdown_function(): Argument #1 ($callback) must be a valid callback, non-static method test::__call() cannot be called statically +TypeError: register_shutdown_function(): Argument #1 ($callback) must be a valid callback, non-static method test::__call() cannot be called statically Done diff --git a/ext/standard/tests/general_functions/bug25038.phpt b/ext/standard/tests/general_functions/bug25038.phpt index 58acf1c977c0..6a8c777686f4 100644 --- a/ext/standard/tests/general_functions/bug25038.phpt +++ b/ext/standard/tests/general_functions/bug25038.phpt @@ -11,20 +11,20 @@ try { bar('first try'); } -catch (Exception $e) +catch (Throwable $e) { - print $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { call_user_func('bar','second try'); } -catch (Exception $e) +catch (Throwable $e) { - print $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -This is an exception from bar(first try). -This is an exception from bar(second try). +Exception: This is an exception from bar(first try). +Exception: This is an exception from bar(second try). diff --git a/ext/standard/tests/general_functions/bug31190.phpt b/ext/standard/tests/general_functions/bug31190.phpt index 1a7917d47e4c..1a277f15c6e1 100644 --- a/ext/standard/tests/general_functions/bug31190.phpt +++ b/ext/standard/tests/general_functions/bug31190.phpt @@ -10,16 +10,17 @@ class test { $array = array(new test(), 'throwException'); try { call_user_func($array, 1, 2); -} catch (Exception $e) { - echo $e->getMessage(); +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { call_user_func_array($array, array(1, 2)); -} catch (Exception $e) { - echo $e->getMessage(); +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Hello World! -Hello World! +Exception: Hello World! + +Exception: Hello World! diff --git a/ext/standard/tests/general_functions/bug32647.phpt b/ext/standard/tests/general_functions/bug32647.phpt index 2e388d474206..e3ece8ef5fe9 100644 --- a/ext/standard/tests/general_functions/bug32647.phpt +++ b/ext/standard/tests/general_functions/bug32647.phpt @@ -18,54 +18,54 @@ unset($obj); try { register_shutdown_function(array($obj,"")); -} catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { register_shutdown_function(array($obj,"some string")); -} catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { register_shutdown_function(array(0,"")); -} catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { register_shutdown_function(array('bar','foo')); -} catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { register_shutdown_function(array(0,"some string")); -} catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { register_shutdown_function('bar'); -} catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } register_shutdown_function('foo'); try { register_shutdown_function(array('bar','barfoo')); -} catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $obj = new bar; try { register_shutdown_function(array($obj,'foobar')); -} catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } register_shutdown_function(array($obj,'barfoo')); @@ -73,15 +73,15 @@ register_shutdown_function(array($obj,'barfoo')); ?> --EXPECTF-- Warning: Undefined variable $obj in %s on line %d -register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object +TypeError: register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object Warning: Undefined variable $obj in %s on line %d -register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object -register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object -register_shutdown_function(): Argument #1 ($callback) must be a valid callback, class bar does not have a method "foo" -register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object -register_shutdown_function(): Argument #1 ($callback) must be a valid callback, function "bar" not found or invalid function name -register_shutdown_function(): Argument #1 ($callback) must be a valid callback, non-static method bar::barfoo() cannot be called statically -register_shutdown_function(): Argument #1 ($callback) must be a valid callback, class bar does not have a method "foobar" +TypeError: register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object +TypeError: register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object +TypeError: register_shutdown_function(): Argument #1 ($callback) must be a valid callback, class bar does not have a method "foo" +TypeError: register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object +TypeError: register_shutdown_function(): Argument #1 ($callback) must be a valid callback, function "bar" not found or invalid function name +TypeError: register_shutdown_function(): Argument #1 ($callback) must be a valid callback, non-static method bar::barfoo() cannot be called statically +TypeError: register_shutdown_function(): Argument #1 ($callback) must be a valid callback, class bar does not have a method "foobar" foo! bar! diff --git a/ext/standard/tests/general_functions/bug41037.phpt b/ext/standard/tests/general_functions/bug41037.phpt index 683b18ec2515..64ef9ccce5c6 100644 --- a/ext/standard/tests/general_functions/bug41037.phpt +++ b/ext/standard/tests/general_functions/bug41037.phpt @@ -7,8 +7,8 @@ function a() { echo "hello\n"; try { unregister_tick_function('a'); - } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -20,7 +20,7 @@ declare (ticks=1) { ?> --EXPECT-- hello -Registered tick function cannot be unregistered while it is being executed +Error: Registered tick function cannot be unregistered while it is being executed Done hello -Registered tick function cannot be unregistered while it is being executed +Error: Registered tick function cannot be unregistered while it is being executed diff --git a/ext/standard/tests/general_functions/bug41970.phpt b/ext/standard/tests/general_functions/bug41970.phpt index 4d7826120858..80868e6447ac 100644 --- a/ext/standard/tests/general_functions/bug41970.phpt +++ b/ext/standard/tests/general_functions/bug41970.phpt @@ -8,14 +8,14 @@ $a = array(4,3,2); var_dump(call_user_func_array("sort", array($a))); try { var_dump(call_user_func_array("strlen", array($a))); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(call_user_func("sort", $a)); try { var_dump(call_user_func("strlen", $a)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -23,9 +23,9 @@ echo "Done\n"; --EXPECTF-- Warning: sort(): Argument #1 ($array) must be passed by reference, value given in %s on line %d bool(true) -strlen(): Argument #1 ($string) must be of type string, array given +TypeError: strlen(): Argument #1 ($string) must be of type string, array given Warning: sort(): Argument #1 ($array) must be passed by reference, value given in %s on line %d bool(true) -strlen(): Argument #1 ($string) must be of type string, array given +TypeError: strlen(): Argument #1 ($string) must be of type string, array given Done diff --git a/ext/standard/tests/general_functions/bug44295.phpt b/ext/standard/tests/general_functions/bug44295.phpt index 131f6496b7b4..f715b63ea2d6 100644 --- a/ext/standard/tests/general_functions/bug44295.phpt +++ b/ext/standard/tests/general_functions/bug44295.phpt @@ -17,13 +17,13 @@ try { $iter = new DirectoryIterator($dir); print get_class($iter) . "\n"; print "after\n"; -} catch (Exception $e) { - print "in catch: ".$e->getMessage()."\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> ==DONE== --EXPECT-- before -in catch: DirectoryIterator::__construct(): Failed to open directory: No such file or directory +UnexpectedValueException: DirectoryIterator::__construct(): Failed to open directory: No such file or directory ==DONE== diff --git a/ext/standard/tests/general_functions/bug47857.phpt b/ext/standard/tests/general_functions/bug47857.phpt index 0d2b35b09f78..eb5fc0955fe9 100644 --- a/ext/standard/tests/general_functions/bug47857.phpt +++ b/ext/standard/tests/general_functions/bug47857.phpt @@ -10,18 +10,18 @@ class foo { var_dump(is_callable(array('foo','bar'))); try { foo::bar(); -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(is_callable(array('Exception','getMessage'))); try { Exception::getMessage(); -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- bool(false) -Non-static method foo::bar() cannot be called statically +Error: Non-static method foo::bar() cannot be called statically bool(false) -Non-static method Exception::getMessage() cannot be called statically +Error: Non-static method Exception::getMessage() cannot be called statically diff --git a/ext/standard/tests/general_functions/bug72920.phpt b/ext/standard/tests/general_functions/bug72920.phpt index cee43561de91..8e3d6558398f 100644 --- a/ext/standard/tests/general_functions/bug72920.phpt +++ b/ext/standard/tests/general_functions/bug72920.phpt @@ -8,9 +8,9 @@ class Foo { try { var_dump(constant('Foo::C1')); -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot access private constant Foo::C1 +Error: Cannot access private constant Foo::C1 diff --git a/ext/standard/tests/general_functions/callbacks_001.phpt b/ext/standard/tests/general_functions/callbacks_001.phpt index f173ca851613..4b745c0d5bd2 100644 --- a/ext/standard/tests/general_functions/callbacks_001.phpt +++ b/ext/standard/tests/general_functions/callbacks_001.phpt @@ -71,8 +71,8 @@ class P extends O { $this->call(array($this, 'O::who')); try { $this->call(array($this, 'B::who')); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } } @@ -120,4 +120,4 @@ $this|O::who Deprecated: Callables of the form ["P", "O::who"] are deprecated in %s on line %d O $this|B::who -call_user_func(): Argument #1 ($callback) must be a valid callback, class P is not a subclass of B +TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, class P is not a subclass of B diff --git a/ext/standard/tests/general_functions/callbacks_002.phpt b/ext/standard/tests/general_functions/callbacks_002.phpt index 11d8d9a690ed..43ad00bf9224 100644 --- a/ext/standard/tests/general_functions/callbacks_002.phpt +++ b/ext/standard/tests/general_functions/callbacks_002.phpt @@ -5,22 +5,22 @@ call_user_func(): Wrong parameters try { call_user_func(array('Foo', 'bar')); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { call_user_func(array(NULL, 'bar')); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { call_user_func(array('stdclass', NULL)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -call_user_func(): Argument #1 ($callback) must be a valid callback, class "Foo" not found -call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object -call_user_func(): Argument #1 ($callback) must be a valid callback, second array member is not a valid method +TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, class "Foo" not found +TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object +TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, second array member is not a valid method diff --git a/ext/standard/tests/general_functions/dl_null_bytes.phpt b/ext/standard/tests/general_functions/dl_null_bytes.phpt index 7f251393ba3b..3ee035b92945 100644 --- a/ext/standard/tests/general_functions/dl_null_bytes.phpt +++ b/ext/standard/tests/general_functions/dl_null_bytes.phpt @@ -5,10 +5,10 @@ dl() rejects null bytes in extension filename try { dl("foo\0bar"); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -dl(): Argument #1 ($extension_filename) must not contain any null bytes +ValueError: dl(): Argument #1 ($extension_filename) must not contain any null bytes diff --git a/ext/standard/tests/general_functions/error_get_last.phpt b/ext/standard/tests/general_functions/error_get_last.phpt index 1e7516970ef0..478c52e4fa5d 100644 --- a/ext/standard/tests/general_functions/error_get_last.phpt +++ b/ext/standard/tests/general_functions/error_get_last.phpt @@ -6,8 +6,8 @@ error_get_last() tests var_dump(error_get_last()); try { var_dump(error_get_last(true)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(error_get_last()); @@ -19,7 +19,7 @@ echo "Done\n"; ?> --EXPECTF-- NULL -error_get_last() expects exactly 0 arguments, 1 given +ArgumentCountError: error_get_last() expects exactly 0 arguments, 1 given NULL Warning: Undefined variable $b in %s on line %d diff --git a/ext/standard/tests/general_functions/gettype_settype_basic.phpt b/ext/standard/tests/general_functions/gettype_settype_basic.phpt index a5e1a0b5bf3c..3f6c5ca3c3f9 100644 --- a/ext/standard/tests/general_functions/gettype_settype_basic.phpt +++ b/ext/standard/tests/general_functions/gettype_settype_basic.phpt @@ -96,8 +96,8 @@ foreach ($types as $type) { // check the new type var_dump( gettype($var) ); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } } @@ -537,33 +537,33 @@ string(7) "boolean" -- Setting type of data to resource -- -- Iteration 1 -- -Cannot convert to resource type +ValueError: Cannot convert to resource type -- Iteration 2 -- -Cannot convert to resource type +ValueError: Cannot convert to resource type -- Iteration 3 -- -Cannot convert to resource type +ValueError: Cannot convert to resource type -- Iteration 4 -- -Cannot convert to resource type +ValueError: Cannot convert to resource type -- Iteration 5 -- -Cannot convert to resource type +ValueError: Cannot convert to resource type -- Iteration 6 -- -Cannot convert to resource type +ValueError: Cannot convert to resource type -- Iteration 7 -- -Cannot convert to resource type +ValueError: Cannot convert to resource type -- Iteration 8 -- -Cannot convert to resource type +ValueError: Cannot convert to resource type -- Iteration 9 -- -Cannot convert to resource type +ValueError: Cannot convert to resource type -- Iteration 10 -- -Cannot convert to resource type +ValueError: Cannot convert to resource type -- Iteration 11 -- -Cannot convert to resource type +ValueError: Cannot convert to resource type -- Iteration 12 -- -Cannot convert to resource type +ValueError: Cannot convert to resource type -- Iteration 13 -- -Cannot convert to resource type +ValueError: Cannot convert to resource type -- Iteration 14 -- -Cannot convert to resource type +ValueError: Cannot convert to resource type -- Setting type of data to array -- -- Iteration 1 -- diff --git a/ext/standard/tests/general_functions/gettype_settype_error.phpt b/ext/standard/tests/general_functions/gettype_settype_error.phpt index a495ff6c2917..b0271ac47fcc 100644 --- a/ext/standard/tests/general_functions/gettype_settype_error.phpt +++ b/ext/standard/tests/general_functions/gettype_settype_error.phpt @@ -11,8 +11,8 @@ echo "\n*** Testing settype(): error conditions ***\n"; // passing an invalid type to set try { settype( $var, "unknown" ); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Done\n"; @@ -21,5 +21,5 @@ echo "Done\n"; **** Testing gettype() and settype() functions **** *** Testing settype(): error conditions *** -settype(): Argument #2 ($type) must be a valid type +ValueError: settype(): Argument #2 ($type) must be a valid type Done diff --git a/ext/standard/tests/general_functions/gh21058.phpt b/ext/standard/tests/general_functions/gh21058.phpt index 598625a2017e..2cca0d76bc5d 100644 --- a/ext/standard/tests/general_functions/gh21058.phpt +++ b/ext/standard/tests/general_functions/gh21058.phpt @@ -5,9 +5,9 @@ GH-21058 (error_log() crash with null destination and message type 3) try { error_log("test", 3, null); -} catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Path must not be empty +ValueError: Path must not be empty diff --git a/ext/standard/tests/general_functions/gh9905.phpt b/ext/standard/tests/general_functions/gh9905.phpt index 33d2f4f73702..5884f23a3adb 100644 --- a/ext/standard/tests/general_functions/gh9905.phpt +++ b/ext/standard/tests/general_functions/gh9905.phpt @@ -4,9 +4,9 @@ GH-9905 (constant() behaves inconsistent when class is undefined) getMessage()); +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Class "NonExistantClass" not found +Error: Class "NonExistantClass" not found diff --git a/ext/standard/tests/general_functions/ini_set_types.phpt b/ext/standard/tests/general_functions/ini_set_types.phpt index 16def381db8c..0c6466c4a5fa 100644 --- a/ext/standard/tests/general_functions/ini_set_types.phpt +++ b/ext/standard/tests/general_functions/ini_set_types.phpt @@ -20,8 +20,8 @@ var_dump(ini_get('user_agent')); try { ini_set('foo', []); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -31,4 +31,4 @@ string(1) "1" string(0) "" string(1) "6" string(4) "3.14" -ini_set(): Argument #2 ($value) must be of type string|int|float|bool|null +TypeError: ini_set(): Argument #2 ($value) must be of type string|int|float|bool|null diff --git a/ext/standard/tests/general_functions/is_countable_with_variables.phpt b/ext/standard/tests/general_functions/is_countable_with_variables.phpt index e2711a8c54d6..582b525f435e 100644 --- a/ext/standard/tests/general_functions/is_countable_with_variables.phpt +++ b/ext/standard/tests/general_functions/is_countable_with_variables.phpt @@ -18,8 +18,8 @@ $bar = null; if (!is_countable($bar)) { try { count($bar); - } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + } catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> @@ -28,4 +28,4 @@ bool(true) bool(true) bool(false) int(2) -count(): Argument #1 ($value) must be of type Countable|array, null given +TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given diff --git a/ext/standard/tests/general_functions/proc_open_array.phpt b/ext/standard/tests/general_functions/proc_open_array.phpt index a76f1111ef26..6a970ea75541 100644 --- a/ext/standard/tests/general_functions/proc_open_array.phpt +++ b/ext/standard/tests/general_functions/proc_open_array.phpt @@ -13,29 +13,29 @@ $ds = [ echo "Empty command array:\n"; try { proc_open([], $ds, $pipes); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\nNul byte in program name:\n"; try { proc_open(["php\0oops"], $ds, $pipes); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\nNul byte in argument:\n"; try { proc_open(["php", "array\0oops"], $ds, $pipes); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\nEmpty program name:\n"; try { proc_open([""], $ds, $pipes); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\nBasic usage:\n"; @@ -76,16 +76,16 @@ proc_close($proc); ?> --EXPECT-- Empty command array: -proc_open(): Argument #1 ($command) must not be empty +ValueError: proc_open(): Argument #1 ($command) must not be empty Nul byte in program name: -Command array element 1 contains a null byte +ValueError: Command array element 1 contains a null byte Nul byte in argument: -Command array element 2 contains a null byte +ValueError: Command array element 2 contains a null byte Empty program name: -First element must contain a non-empty program name +ValueError: First element must contain a non-empty program name Basic usage: Hello World! diff --git a/ext/standard/tests/general_functions/proc_open_cwd_null_bytes.phpt b/ext/standard/tests/general_functions/proc_open_cwd_null_bytes.phpt index faa86c824177..967c1f335752 100644 --- a/ext/standard/tests/general_functions/proc_open_cwd_null_bytes.phpt +++ b/ext/standard/tests/general_functions/proc_open_cwd_null_bytes.phpt @@ -9,10 +9,10 @@ if (!function_exists("proc_open")) echo "skip proc_open() is not available"; try { proc_open("does_not_matter", [], $pipes, "foo\0bar"); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -proc_open(): Argument #4 ($cwd) must not contain any null bytes +ValueError: proc_open(): Argument #4 ($cwd) must not contain any null bytes diff --git a/ext/standard/tests/general_functions/proc_open_pipes3.phpt b/ext/standard/tests/general_functions/proc_open_pipes3.phpt index 8f065401eb14..5101793eb063 100644 --- a/ext/standard/tests/general_functions/proc_open_pipes3.phpt +++ b/ext/standard/tests/general_functions/proc_open_pipes3.phpt @@ -17,8 +17,8 @@ proc_open("$php -n $callee_escaped", $spec, $pipes); $spec[$i] = 1; try { proc_open("$php -n $callee_escaped", $spec, $pipes); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $spec[$i] = array('pipe', "test"); @@ -33,7 +33,7 @@ echo "END\n"; ?> --EXPECTF-- Warning: proc_open(): pi is not a valid descriptor spec/mode in %s on line %d -proc_open(): Argument #2 ($descriptor_spec) must only contain arrays and streams +ValueError: proc_open(): Argument #2 ($descriptor_spec) must only contain arrays and streams array(4) { [3]=> resource(%d) of type (Unknown) diff --git a/ext/standard/tests/general_functions/proc_open_redirect.phpt b/ext/standard/tests/general_functions/proc_open_redirect.phpt index 76940b715d8b..a3d185d04f75 100644 --- a/ext/standard/tests/general_functions/proc_open_redirect.phpt +++ b/ext/standard/tests/general_functions/proc_open_redirect.phpt @@ -6,20 +6,20 @@ Redirection support in proc_open $php = getenv('TEST_PHP_EXECUTABLE'); try { proc_open([$php], [['redirect']], $pipes); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { proc_open([$php], [['redirect', 'foo']], $pipes); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { proc_open([$php], [['redirect', 42]], $pipes); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\nWith pipe:\n"; @@ -52,8 +52,8 @@ proc_close($proc); ?> --EXPECTF-- -Missing redirection target -Redirection target must be of type int, string given +ValueError: Missing redirection target +ValueError: Redirection target must be of type int, string given Warning: proc_open(): Redirection target 42 not found in %s diff --git a/ext/standard/tests/general_functions/putenv.phpt b/ext/standard/tests/general_functions/putenv.phpt index 40799b25790f..4a3fd2e6b86d 100644 --- a/ext/standard/tests/general_functions/putenv.phpt +++ b/ext/standard/tests/general_functions/putenv.phpt @@ -17,14 +17,14 @@ var_dump(getenv($var_name)); try { putenv("=123"); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { putenv(""); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Done\n"; @@ -37,6 +37,6 @@ bool(true) string(0) "" bool(true) bool(false) -putenv(): Argument #1 ($assignment) must have a valid syntax -putenv(): Argument #1 ($assignment) must have a valid syntax +ValueError: putenv(): Argument #1 ($assignment) must have a valid syntax +ValueError: putenv(): Argument #1 ($assignment) must have a valid syntax Done diff --git a/ext/standard/tests/general_functions/putenv_and_getenv_reject_null_bytes.phpt b/ext/standard/tests/general_functions/putenv_and_getenv_reject_null_bytes.phpt index 28a346237338..0870a6154d3f 100644 --- a/ext/standard/tests/general_functions/putenv_and_getenv_reject_null_bytes.phpt +++ b/ext/standard/tests/general_functions/putenv_and_getenv_reject_null_bytes.phpt @@ -6,8 +6,8 @@ getenv() and putenv() reject null bytes foreach ([false, true] as $local_only) { try { getenv("PHP_GETENV_NUL_TEST\0SUFFIX", $local_only); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -19,8 +19,8 @@ foreach ([ ] as $assignment) { try { putenv($assignment); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -28,8 +28,8 @@ var_dump(getenv($var_name)); ?> --EXPECT-- -getenv(): Argument #1 ($name) must not contain any null bytes -getenv(): Argument #1 ($name) must not contain any null bytes -putenv(): Argument #1 ($assignment) must not contain any null bytes -putenv(): Argument #1 ($assignment) must not contain any null bytes +ValueError: getenv(): Argument #1 ($name) must not contain any null bytes +ValueError: getenv(): Argument #1 ($name) must not contain any null bytes +ValueError: putenv(): Argument #1 ($assignment) must not contain any null bytes +ValueError: putenv(): Argument #1 ($assignment) must not contain any null bytes bool(false) diff --git a/ext/standard/tests/general_functions/register_tick_function_error.phpt b/ext/standard/tests/general_functions/register_tick_function_error.phpt index 9eae12c5b692..6b530ad2599b 100644 --- a/ext/standard/tests/general_functions/register_tick_function_error.phpt +++ b/ext/standard/tests/general_functions/register_tick_function_error.phpt @@ -6,9 +6,9 @@ declare(ticks=1); try { register_tick_function("a"); -} catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -register_tick_function(): Argument #1 ($callback) must be a valid callback, function "a" not found or invalid function name +TypeError: register_tick_function(): Argument #1 ($callback) must be a valid callback, function "a" not found or invalid function name diff --git a/ext/standard/tests/general_functions/settype_typed_property.phpt b/ext/standard/tests/general_functions/settype_typed_property.phpt index a206a4ba41b2..c8f027ae5db0 100644 --- a/ext/standard/tests/general_functions/settype_typed_property.phpt +++ b/ext/standard/tests/general_functions/settype_typed_property.phpt @@ -16,13 +16,13 @@ var_dump($test->x); try { settype($test->x, 'array'); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test->x); ?> --EXPECT-- int(42) -Cannot assign array to reference held by property Test::$x of type int +TypeError: Cannot assign array to reference held by property Test::$x of type int int(42) diff --git a/ext/standard/tests/general_functions/sleep_usleep_uint_overflow.phpt b/ext/standard/tests/general_functions/sleep_usleep_uint_overflow.phpt index 6f0a7b3fa9e8..f7a5bc018460 100644 --- a/ext/standard/tests/general_functions/sleep_usleep_uint_overflow.phpt +++ b/ext/standard/tests/general_functions/sleep_usleep_uint_overflow.phpt @@ -13,13 +13,13 @@ echo "usleep(0) ok\n"; foreach (['sleep', 'usleep'] as $function) { try { $function(4294967296); - } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> --EXPECTF-- int(0) usleep(0) ok -sleep(): Argument #1 ($seconds) must be between 0 and %d -usleep(): Argument #1 ($microseconds) must be between 0 and 4294967295 +ValueError: sleep(): Argument #1 ($seconds) must be between 0 and %d +ValueError: usleep(): Argument #1 ($microseconds) must be between 0 and 4294967295 diff --git a/ext/standard/tests/general_functions/type.phpt b/ext/standard/tests/general_functions/type.phpt index a43640f09eba..51fd42aca443 100644 --- a/ext/standard/tests/general_functions/type.phpt +++ b/ext/standard/tests/general_functions/type.phpt @@ -49,8 +49,8 @@ foreach ($types as $type) { foreach ($array as $var) { try { var_dump(settype($var, $type)); - } catch (Error $e) { - echo "Error: ", $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($var); } @@ -160,7 +160,7 @@ bool(true) bool(true) bool(true) bool(true) -Error: Cannot convert to resource type +ValueError: Cannot convert to resource type array(3) { [0]=> int(1) @@ -169,9 +169,9 @@ array(3) { [2]=> int(3) } -Error: Cannot convert to resource type +ValueError: Cannot convert to resource type string(14) "another string" -Error: Cannot convert to resource type +ValueError: Cannot convert to resource type array(3) { [0]=> int(2) @@ -180,21 +180,21 @@ array(3) { [2]=> int(4) } -Error: Cannot convert to resource type +ValueError: Cannot convert to resource type int(1) -Error: Cannot convert to resource type +ValueError: Cannot convert to resource type float(2) -Error: Cannot convert to resource type +ValueError: Cannot convert to resource type NULL -Error: Cannot convert to resource type +ValueError: Cannot convert to resource type bool(false) -Error: Cannot convert to resource type +ValueError: Cannot convert to resource type string(11) "some string" -Error: Cannot convert to resource type +ValueError: Cannot convert to resource type resource(%d) of type (Unknown) -Error: Cannot convert to resource type +ValueError: Cannot convert to resource type resource(%d) of type (stream) -Error: Cannot convert to resource type +ValueError: Cannot convert to resource type object(stdClass)#%d (0) { } bool(true) diff --git a/ext/standard/tests/general_functions/unregister_tick_function_error.phpt b/ext/standard/tests/general_functions/unregister_tick_function_error.phpt index fd96a4658faa..08e38f75e9cf 100644 --- a/ext/standard/tests/general_functions/unregister_tick_function_error.phpt +++ b/ext/standard/tests/general_functions/unregister_tick_function_error.phpt @@ -6,9 +6,9 @@ declare(ticks=1); try { unregister_tick_function("a"); -} catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -unregister_tick_function(): Argument #1 ($callback) must be a valid callback, function "a" not found or invalid function name +TypeError: unregister_tick_function(): Argument #1 ($callback) must be a valid callback, function "a" not found or invalid function name diff --git a/ext/standard/tests/general_functions/var_export_basic2.phpt b/ext/standard/tests/general_functions/var_export_basic2.phpt index b5895f805da3..f9387b5a6afb 100644 --- a/ext/standard/tests/general_functions/var_export_basic2.phpt +++ b/ext/standard/tests/general_functions/var_export_basic2.phpt @@ -65,4 +65,3 @@ string(5) "false" false false string(5) "false" - diff --git a/ext/standard/tests/general_functions/var_export_basic3.phpt b/ext/standard/tests/general_functions/var_export_basic3.phpt index 66e87f093ace..51a30a92171b 100644 --- a/ext/standard/tests/general_functions/var_export_basic3.phpt +++ b/ext/standard/tests/general_functions/var_export_basic3.phpt @@ -164,4 +164,3 @@ string(22) "5.0000000000000001E+42" 3.4000000000000001E-33 3.4000000000000001E-33 string(22) "3.4000000000000001E-33" - diff --git a/ext/standard/tests/general_functions/var_export_basic4.phpt b/ext/standard/tests/general_functions/var_export_basic4.phpt index 4d41d2f38d01..193e5ea10e6a 100644 --- a/ext/standard/tests/general_functions/var_export_basic4.phpt +++ b/ext/standard/tests/general_functions/var_export_basic4.phpt @@ -135,4 +135,3 @@ string(7) "'\\060'" '8' '8' string(3) "'8'" - diff --git a/ext/standard/tests/general_functions/var_export_basic5.phpt b/ext/standard/tests/general_functions/var_export_basic5.phpt index 4712ba37a904..5b1a137eea93 100644 --- a/ext/standard/tests/general_functions/var_export_basic5.phpt +++ b/ext/standard/tests/general_functions/var_export_basic5.phpt @@ -267,4 +267,3 @@ string(41) "array ( 0 => 'string', 1 => 'test', )" - diff --git a/ext/standard/tests/general_functions/var_export_basic7.phpt b/ext/standard/tests/general_functions/var_export_basic7.phpt index 01ffd5fbe535..8ae608441010 100644 --- a/ext/standard/tests/general_functions/var_export_basic7.phpt +++ b/ext/standard/tests/general_functions/var_export_basic7.phpt @@ -48,4 +48,3 @@ string(4) "NULL" NULL NULL string(4) "NULL" - diff --git a/ext/standard/tests/http/gh15650.phpt b/ext/standard/tests/http/gh15650.phpt index 69655ce407ea..9cea248b667e 100644 --- a/ext/standard/tests/http/gh15650.phpt +++ b/ext/standard/tests/http/gh15650.phpt @@ -20,13 +20,13 @@ echo http_build_query(['e1' => E1::C, 'e2' => E2::C]), "\n"; try { echo http_build_query(['e3' => E3::C]); } catch (Throwable $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { echo http_build_query(E1::C); } catch (Throwable $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/ext/standard/tests/http/request_parse_body/invalid_boundary.phpt b/ext/standard/tests/http/request_parse_body/invalid_boundary.phpt index 980b44e94899..39e6bd291485 100644 --- a/ext/standard/tests/http/request_parse_body/invalid_boundary.phpt +++ b/ext/standard/tests/http/request_parse_body/invalid_boundary.phpt @@ -11,7 +11,7 @@ empty try { [$_POST, $_FILES] = request_parse_body(); } catch (Throwable $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($_POST, $_FILES); diff --git a/ext/standard/tests/http/request_parse_body/multipart_garbled.phpt b/ext/standard/tests/http/request_parse_body/multipart_garbled.phpt index 521de0805bf4..b22d57bccf9e 100644 --- a/ext/standard/tests/http/request_parse_body/multipart_garbled.phpt +++ b/ext/standard/tests/http/request_parse_body/multipart_garbled.phpt @@ -18,7 +18,7 @@ post field data try { [$_POST, $_FILES] = request_parse_body(); } catch (Throwable $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($_POST, $_FILES); diff --git a/ext/standard/tests/http/request_parse_body/multipart_max_files.phpt b/ext/standard/tests/http/request_parse_body/multipart_max_files.phpt index 9c4fe6c3cd7b..0a6fec7e430c 100644 --- a/ext/standard/tests/http/request_parse_body/multipart_max_files.phpt +++ b/ext/standard/tests/http/request_parse_body/multipart_max_files.phpt @@ -23,7 +23,7 @@ file data try { [$_POST, $_FILES] = request_parse_body(); } catch (Throwable $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($_POST, $_FILES); diff --git a/ext/standard/tests/http/request_parse_body/multipart_max_input_vars.phpt b/ext/standard/tests/http/request_parse_body/multipart_max_input_vars.phpt index 384344e6c176..4747a7da6917 100644 --- a/ext/standard/tests/http/request_parse_body/multipart_max_input_vars.phpt +++ b/ext/standard/tests/http/request_parse_body/multipart_max_input_vars.phpt @@ -21,7 +21,7 @@ post field data try { [$_POST, $_FILES] = request_parse_body(); } catch (Throwable $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($_POST, $_FILES); diff --git a/ext/standard/tests/http/request_parse_body/multipart_max_parts.phpt b/ext/standard/tests/http/request_parse_body/multipart_max_parts.phpt index 776741003037..96fb2a4470ed 100644 --- a/ext/standard/tests/http/request_parse_body/multipart_max_parts.phpt +++ b/ext/standard/tests/http/request_parse_body/multipart_max_parts.phpt @@ -22,7 +22,7 @@ file data try { [$_POST, $_FILES] = request_parse_body(); } catch (Throwable $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($_POST, $_FILES); diff --git a/ext/standard/tests/http/request_parse_body/multipart_missing_boundary.phpt b/ext/standard/tests/http/request_parse_body/multipart_missing_boundary.phpt index 9656071c765b..70403fe66975 100644 --- a/ext/standard/tests/http/request_parse_body/multipart_missing_boundary.phpt +++ b/ext/standard/tests/http/request_parse_body/multipart_missing_boundary.phpt @@ -13,7 +13,7 @@ $stream = fopen('php://memory','r+'); try { [$_POST, $_FILES] = request_parse_body(); } catch (Throwable $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($_POST, $_FILES); diff --git a/ext/standard/tests/http/request_parse_body/multipart_options_invalid_key.phpt b/ext/standard/tests/http/request_parse_body/multipart_options_invalid_key.phpt index acad79c9e338..0e0efa446e1e 100644 --- a/ext/standard/tests/http/request_parse_body/multipart_options_invalid_key.phpt +++ b/ext/standard/tests/http/request_parse_body/multipart_options_invalid_key.phpt @@ -5,14 +5,14 @@ request_parse_body() invalid key try { request_parse_body(options: ['foo' => 1]); -} catch (Error $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { request_parse_body(options: [42 => 1]); -} catch (Error $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/ext/standard/tests/http/request_parse_body/multipart_options_invalid_quantity.phpt b/ext/standard/tests/http/request_parse_body/multipart_options_invalid_quantity.phpt index b1efa0dbc91a..6a081ae3def9 100644 --- a/ext/standard/tests/http/request_parse_body/multipart_options_invalid_quantity.phpt +++ b/ext/standard/tests/http/request_parse_body/multipart_options_invalid_quantity.phpt @@ -8,7 +8,7 @@ try { 'upload_max_filesize' => '1GB', ]); } catch (Throwable $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/ext/standard/tests/http/request_parse_body/multipart_options_invalid_value_type.phpt b/ext/standard/tests/http/request_parse_body/multipart_options_invalid_value_type.phpt index b61416cdf13d..3e6debbfcf3e 100644 --- a/ext/standard/tests/http/request_parse_body/multipart_options_invalid_value_type.phpt +++ b/ext/standard/tests/http/request_parse_body/multipart_options_invalid_value_type.phpt @@ -7,8 +7,8 @@ try { request_parse_body(options: [ 'max_input_vars' => [], ]); -} catch (Error $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/ext/standard/tests/http/request_parse_body/multipart_options_max_files.phpt b/ext/standard/tests/http/request_parse_body/multipart_options_max_files.phpt index ad0c2a906237..f8a0ab49b500 100644 --- a/ext/standard/tests/http/request_parse_body/multipart_options_max_files.phpt +++ b/ext/standard/tests/http/request_parse_body/multipart_options_max_files.phpt @@ -25,7 +25,7 @@ try { 'max_file_uploads' => 1, ]); } catch (Throwable $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($_POST, $_FILES); diff --git a/ext/standard/tests/http/request_parse_body/multipart_options_max_input_vars.phpt b/ext/standard/tests/http/request_parse_body/multipart_options_max_input_vars.phpt index 990102abd853..d52cf1f4c304 100644 --- a/ext/standard/tests/http/request_parse_body/multipart_options_max_input_vars.phpt +++ b/ext/standard/tests/http/request_parse_body/multipart_options_max_input_vars.phpt @@ -23,7 +23,7 @@ try { 'max_input_vars' => 1, ]); } catch (Throwable $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($_POST, $_FILES); diff --git a/ext/standard/tests/http/request_parse_body/multipart_options_max_parts.phpt b/ext/standard/tests/http/request_parse_body/multipart_options_max_parts.phpt index e9d8d51b2428..8a2065e8f138 100644 --- a/ext/standard/tests/http/request_parse_body/multipart_options_max_parts.phpt +++ b/ext/standard/tests/http/request_parse_body/multipart_options_max_parts.phpt @@ -24,7 +24,7 @@ try { 'max_multipart_body_parts' => 1, ]); } catch (Throwable $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($_POST, $_FILES); diff --git a/ext/standard/tests/http/request_parse_body/multipart_options_post_max_size.phpt b/ext/standard/tests/http/request_parse_body/multipart_options_post_max_size.phpt index 7a66faa7dba4..564277c7e37b 100644 --- a/ext/standard/tests/http/request_parse_body/multipart_options_post_max_size.phpt +++ b/ext/standard/tests/http/request_parse_body/multipart_options_post_max_size.phpt @@ -23,7 +23,7 @@ try { 'post_max_size' => '302', ]); } catch (Throwable $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($_POST, $_FILES); diff --git a/ext/standard/tests/http/request_parse_body/multipart_options_upload_max_filesize.phpt b/ext/standard/tests/http/request_parse_body/multipart_options_upload_max_filesize.phpt index 981a1d6799d1..2e5cd9675663 100644 --- a/ext/standard/tests/http/request_parse_body/multipart_options_upload_max_filesize.phpt +++ b/ext/standard/tests/http/request_parse_body/multipart_options_upload_max_filesize.phpt @@ -19,7 +19,7 @@ try { 'upload_max_filesize' => '128', ]); } catch (Throwable $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($_POST, $_FILES); diff --git a/ext/standard/tests/http/request_parse_body/options_array_references.phpt b/ext/standard/tests/http/request_parse_body/options_array_references.phpt index 6c6c0c157651..19c0d91d9b06 100644 --- a/ext/standard/tests/http/request_parse_body/options_array_references.phpt +++ b/ext/standard/tests/http/request_parse_body/options_array_references.phpt @@ -7,8 +7,8 @@ foreach ($options as $k => &$v) {} try { request_parse_body($options); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Request does not provide a content type +RequestParseBodyException: Request does not provide a content type diff --git a/ext/standard/tests/http/request_parse_body/unsupported_content_type.phpt b/ext/standard/tests/http/request_parse_body/unsupported_content_type.phpt index 087b11841cab..9eb4f739b03b 100644 --- a/ext/standard/tests/http/request_parse_body/unsupported_content_type.phpt +++ b/ext/standard/tests/http/request_parse_body/unsupported_content_type.phpt @@ -13,7 +13,7 @@ Content-Type: application/json try { [$_POST, $_FILES] = request_parse_body(); } catch (Throwable $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($_POST, $_FILES); diff --git a/ext/standard/tests/mail/gh13415.phpt b/ext/standard/tests/mail/gh13415.phpt index f507259a8e26..6dac8c527b0b 100644 --- a/ext/standard/tests/mail/gh13415.phpt +++ b/ext/standard/tests/mail/gh13415.phpt @@ -8,28 +8,28 @@ echo "LF only:\n"; try { mail('to@example.com', 'Test Subject', 'A Message', ['Reply-To' => "foo@example.com \nCc: hacker@example.com"]); } catch (Throwable $e) { - echo $e->getMessage()."\n\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "CR only:\n"; try { mail('to@example.com', 'Test Subject', 'A Message', ['Reply-To' => "foo@example.com \rCc: hacker@example.com"]); } catch (Throwable $e) { - echo $e->getMessage()."\n\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "CRLF:\n"; try { mail('to@example.com', 'Test Subject', 'A Message', ['Reply-To' => "foo@example.com \r\nCc: hacker@example.com"]); } catch (Throwable $e) { - echo $e->getMessage()."\n\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "NULL:\n"; try { mail('to@example.com', 'Test Subject', 'A Message', ['Reply-To' => "foo@example.com \0Cc: hacker@example.com"]); } catch (Throwable $e) { - echo $e->getMessage()."\n\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -40,13 +40,10 @@ if (file_exists('gh13415.out')) { ?> --EXPECTF-- LF only: -Header "Reply-To" contains LF character that is not allowed in the header - +ValueError: Header "Reply-To" contains LF character that is not allowed in the header CR only: -Header "Reply-To" contains CR character that is not allowed in the header - +ValueError: Header "Reply-To" contains CR character that is not allowed in the header CRLF: -Header "Reply-To" contains CRLF characters that are used as a line separator and are not allowed in the header - +ValueError: Header "Reply-To" contains CRLF characters that are used as a line separator and are not allowed in the header NULL: -Header "Reply-To" contains NULL character that is not allowed in the header +ValueError: Header "Reply-To" contains NULL character that is not allowed in the header diff --git a/ext/standard/tests/mail/gh7875.phpt b/ext/standard/tests/mail/gh7875.phpt index 1f8346a0715d..40ff04496c67 100644 --- a/ext/standard/tests/mail/gh7875.phpt +++ b/ext/standard/tests/mail/gh7875.phpt @@ -34,8 +34,8 @@ chmod(__DIR__ . "/gh7875.mail.log", 0444); try { mail('recipient@example.com', 'Subject', 'Body', []); echo 'Not Reached'; -} catch (\Exception $e) { - echo $e->getMessage(), PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; var_dump(file_exists(__DIR__ . "/gh7875.mail.out")); } ?> @@ -46,5 +46,5 @@ try { @unlink(__DIR__ . "/gh7875.mail.out"); ?> --EXPECTF-- -mail(): Failed to open stream: Permission denied +ErrorException: mail(): Failed to open stream: Permission denied bool(false) diff --git a/ext/standard/tests/mail/mail_basic7.phpt b/ext/standard/tests/mail/mail_basic7.phpt index ffc3fd241f00..6663acdfa774 100644 --- a/ext/standard/tests/mail/mail_basic7.phpt +++ b/ext/standard/tests/mail/mail_basic7.phpt @@ -43,50 +43,50 @@ $message = 'A Message'; try { mail($to, $subject, $message, ['orig-date' => array('foo1')]); -} catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['from' => array('foo2')]); -} catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['sender' => array('foo3')]); -} catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['reply-to' => array('foo4')]); -} catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['to' => array('foo5')]); -} catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['bcc' => array('foo6')]); -} catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['message-id' => array('foo7')]); -} catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['in-reply-to'=> array('foo8')]); -} catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\n\n************* TEST ******************\n"; @@ -98,44 +98,44 @@ $message = 'A Message'; try { mail($to, $subject, $message, ['foo1' => array('foo2'=>'bar1')]); -} catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['foo2' => array('foo2', array('foo3'))]); -} catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['foo3' => array(123)]); -} catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['foo4' => array(123.456)]); -} catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['foo5' => array(FALSE)]); -} catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['foo6' => array(NULL)]); -} catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['foo7' => array(new StdClass)]); -} catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\n\n************* TEST ******************\n"; @@ -150,50 +150,50 @@ $outFile = "mailBasic7.out"; try { mail($to, $subject, $message, ['*:foo1' => array('bar1')]); -} catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['foo2:::' => array('bar1')]); -} catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['foo3()' => array('bar1')]); -} catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['foo4@' => array('bar1')]); -} catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['foo5|' => array('bar1')]); -} catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ["\0foo6" => array('bar1')]); -} catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ["foo7\0" => array('bar1')]); -} catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ["foo8" => array()]); -} catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump(mail($to, $subject, $message, ["foo9" => '%&$#!'])); @@ -202,8 +202,8 @@ unlink($outFile); try { mail($to, $subject, $message, ["foo10" => "abc\0\tdef"]); -} catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> diff --git a/ext/standard/tests/mail/mail_null_bytes.phpt b/ext/standard/tests/mail/mail_null_bytes.phpt index 2254b7b8fff3..3ddaee73b776 100644 --- a/ext/standard/tests/mail/mail_null_bytes.phpt +++ b/ext/standard/tests/mail/mail_null_bytes.phpt @@ -5,34 +5,34 @@ mail() with null bytes in arguments try { mail("foo\0bar", "x", "y"); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { mail("x", "foo\0bar", "y"); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { mail("x", "y", "foo\0bar"); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { mail("x", "y", "z", "foo\0bar"); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { mail("x", "y", "z", "q", "foo\0bar"); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -mail(): Argument #1 ($to) must not contain any null bytes -mail(): Argument #2 ($subject) must not contain any null bytes -mail(): Argument #3 ($message) must not contain any null bytes -mail(): Argument #4 ($additional_headers) must not contain any null bytes -mail(): Argument #5 ($additional_params) must not contain any null bytes +ValueError: mail(): Argument #1 ($to) must not contain any null bytes +ValueError: mail(): Argument #2 ($subject) must not contain any null bytes +ValueError: mail(): Argument #3 ($message) must not contain any null bytes +ValueError: mail(): Argument #4 ($additional_headers) must not contain any null bytes +ValueError: mail(): Argument #5 ($additional_params) must not contain any null bytes diff --git a/ext/standard/tests/math/abs_variation.phpt b/ext/standard/tests/math/abs_variation.phpt index d7f878bc01bb..4c44989c0945 100644 --- a/ext/standard/tests/math/abs_variation.phpt +++ b/ext/standard/tests/math/abs_variation.phpt @@ -70,8 +70,8 @@ foreach($inputs as $input) { echo "\n-- Iteration $iterator --\n"; try { var_dump(abs($input)); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $iterator++; }; @@ -104,25 +104,25 @@ int(1) int(0) -- Iteration 7 -- -abs(): Argument #1 ($num) must be of type int|float, string given +TypeError: abs(): Argument #1 ($num) must be of type int|float, string given -- Iteration 8 -- -abs(): Argument #1 ($num) must be of type int|float, string given +TypeError: abs(): Argument #1 ($num) must be of type int|float, string given -- Iteration 9 -- -abs(): Argument #1 ($num) must be of type int|float, array given +TypeError: abs(): Argument #1 ($num) must be of type int|float, array given -- Iteration 10 -- -abs(): Argument #1 ($num) must be of type int|float, string given +TypeError: abs(): Argument #1 ($num) must be of type int|float, string given -- Iteration 11 -- -abs(): Argument #1 ($num) must be of type int|float, string given +TypeError: abs(): Argument #1 ($num) must be of type int|float, string given -- Iteration 12 -- -abs(): Argument #1 ($num) must be of type int|float, string given +TypeError: abs(): Argument #1 ($num) must be of type int|float, string given -- Iteration 13 -- -abs(): Argument #1 ($num) must be of type int|float, classA given +TypeError: abs(): Argument #1 ($num) must be of type int|float, classA given -- Iteration 14 -- @@ -135,4 +135,4 @@ Deprecated: abs(): Passing null to parameter #1 ($num) of type int|float is depr int(0) -- Iteration 16 -- -abs(): Argument #1 ($num) must be of type int|float, resource given +TypeError: abs(): Argument #1 ($num) must be of type int|float, resource given diff --git a/ext/standard/tests/math/base_convert_error.phpt b/ext/standard/tests/math/base_convert_error.phpt index 3d253606e034..3a0ee83a8565 100644 --- a/ext/standard/tests/math/base_convert_error.phpt +++ b/ext/standard/tests/math/base_convert_error.phpt @@ -11,24 +11,24 @@ class classA try { base_convert(1234, 1, 10); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { base_convert(1234, 10, 37); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { base_convert(new classA(), 8, 10); -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- *** Testing base_convert() : error conditions *** -base_convert(): Argument #2 ($from_base) must be between 2 and 36 (inclusive) -base_convert(): Argument #3 ($to_base) must be between 2 and 36 (inclusive) -base_convert(): Argument #1 ($num) must be of type string, classA given +ValueError: base_convert(): Argument #2 ($from_base) must be between 2 and 36 (inclusive) +ValueError: base_convert(): Argument #3 ($to_base) must be between 2 and 36 (inclusive) +TypeError: base_convert(): Argument #1 ($num) must be of type string, classA given diff --git a/ext/standard/tests/math/base_convert_overflow.phpt b/ext/standard/tests/math/base_convert_overflow.phpt index 0f74bdc76a63..5e32ca25fc69 100644 --- a/ext/standard/tests/math/base_convert_overflow.phpt +++ b/ext/standard/tests/math/base_convert_overflow.phpt @@ -7,4 +7,4 @@ var_dump(base_convert('fffffffffffffffff', 16, 15)); --EXPECTF-- Notice: Input number is larger than PHP_INT_MAX, precision has been lost in conversion in %s on line %d -string(18) "2ee03c32ad644bd1e1" \ No newline at end of file +string(18) "2ee03c32ad644bd1e1" diff --git a/ext/standard/tests/math/base_convert_variation1.phpt b/ext/standard/tests/math/base_convert_variation1.phpt index fd06465ab574..f4b00e9293d0 100644 --- a/ext/standard/tests/math/base_convert_variation1.phpt +++ b/ext/standard/tests/math/base_convert_variation1.phpt @@ -54,8 +54,8 @@ foreach($inputs as $input) { echo "\n-- Iteration $iterator --\n"; try { var_dump(base_convert($input, 10, 8)); - } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $iterator++; } @@ -125,7 +125,7 @@ string(1) "0" string(1) "0" -- Iteration 17 -- -base_convert(): Argument #1 ($num) must be of type string, array given +TypeError: base_convert(): Argument #1 ($num) must be of type string, array given -- Iteration 18 -- @@ -143,4 +143,4 @@ Deprecated: Invalid characters passed for attempted conversion, these have been string(1) "0" -- Iteration 21 -- -base_convert(): Argument #1 ($num) must be of type string, resource given +TypeError: base_convert(): Argument #1 ($num) must be of type string, resource given diff --git a/ext/standard/tests/math/bindec_variation1_64bit.phpt b/ext/standard/tests/math/bindec_variation1_64bit.phpt index 56bbbd35649b..25f2ec9c7db0 100644 --- a/ext/standard/tests/math/bindec_variation1_64bit.phpt +++ b/ext/standard/tests/math/bindec_variation1_64bit.phpt @@ -57,8 +57,8 @@ foreach($inputs as $input) { echo "\n-- Iteration $iterator --\n"; try { var_dump(bindec($input)); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $iterator++; }; @@ -127,7 +127,7 @@ int(0) int(0) -- Iteration 16 -- -bindec(): Argument #1 ($binary_string) must be of type string, array given +TypeError: bindec(): Argument #1 ($binary_string) must be of type string, array given -- Iteration 17 -- @@ -145,4 +145,4 @@ Deprecated: Invalid characters passed for attempted conversion, these have been int(0) -- Iteration 20 -- -bindec(): Argument #1 ($binary_string) must be of type string, resource given +TypeError: bindec(): Argument #1 ($binary_string) must be of type string, resource given diff --git a/ext/standard/tests/math/ceil_variation1.phpt b/ext/standard/tests/math/ceil_variation1.phpt index 7751946ea954..3df628d67fca 100644 --- a/ext/standard/tests/math/ceil_variation1.phpt +++ b/ext/standard/tests/math/ceil_variation1.phpt @@ -64,8 +64,8 @@ foreach($inputs as $input) { echo "\n-- Iteration $iterator --\n"; try { var_dump(ceil($input)); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $iterator++; }; @@ -97,25 +97,25 @@ float(1) float(0) -- Iteration 7 -- -ceil(): Argument #1 ($num) must be of type int|float, string given +TypeError: ceil(): Argument #1 ($num) must be of type int|float, string given -- Iteration 8 -- -ceil(): Argument #1 ($num) must be of type int|float, string given +TypeError: ceil(): Argument #1 ($num) must be of type int|float, string given -- Iteration 9 -- -ceil(): Argument #1 ($num) must be of type int|float, array given +TypeError: ceil(): Argument #1 ($num) must be of type int|float, array given -- Iteration 10 -- -ceil(): Argument #1 ($num) must be of type int|float, string given +TypeError: ceil(): Argument #1 ($num) must be of type int|float, string given -- Iteration 11 -- -ceil(): Argument #1 ($num) must be of type int|float, string given +TypeError: ceil(): Argument #1 ($num) must be of type int|float, string given -- Iteration 12 -- -ceil(): Argument #1 ($num) must be of type int|float, string given +TypeError: ceil(): Argument #1 ($num) must be of type int|float, string given -- Iteration 13 -- -ceil(): Argument #1 ($num) must be of type int|float, classA given +TypeError: ceil(): Argument #1 ($num) must be of type int|float, classA given -- Iteration 14 -- @@ -128,4 +128,4 @@ Deprecated: ceil(): Passing null to parameter #1 ($num) of type int|float is dep float(0) -- Iteration 16 -- -ceil(): Argument #1 ($num) must be of type int|float, resource given +TypeError: ceil(): Argument #1 ($num) must be of type int|float, resource given diff --git a/ext/standard/tests/math/clamp.phpt b/ext/standard/tests/math/clamp.phpt index beb4c8d53148..aeaadeb8492e 100644 --- a/ext/standard/tests/math/clamp.phpt +++ b/ext/standard/tests/math/clamp.phpt @@ -22,14 +22,14 @@ function check_clamp_result($value, $min, $max) { function check_clamp_exception($value, $min, $max) { try { var_dump(clamp($value, $min, $max)); - } catch (ValueError $error) { - echo $error->getMessage(), "\n"; + } catch (Throwable $error) { + echo $error::class, ': ', $error->getMessage(), "\n"; } try { var_dump(make_clamp_fcc()($value, $min, $max)); - } catch (ValueError $error) { - echo $error->getMessage(), "\n"; + } catch (Throwable $error) { + echo $error::class, ': ', $error->getMessage(), "\n"; } } @@ -92,13 +92,13 @@ int(10) InvalidArgumentException RuntimeException LogicException -clamp(): Argument #2 ($min) must not be NAN -clamp(): Argument #2 ($min) must not be NAN -clamp(): Argument #3 ($max) must not be NAN -clamp(): Argument #3 ($max) must not be NAN -clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max) -clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max) -clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max) -clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max) -clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max) -clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max) +ValueError: clamp(): Argument #2 ($min) must not be NAN +ValueError: clamp(): Argument #2 ($min) must not be NAN +ValueError: clamp(): Argument #3 ($max) must not be NAN +ValueError: clamp(): Argument #3 ($max) must not be NAN +ValueError: clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max) +ValueError: clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max) +ValueError: clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max) +ValueError: clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max) +ValueError: clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max) +ValueError: clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max) diff --git a/ext/standard/tests/math/decbin_basic.phpt b/ext/standard/tests/math/decbin_basic.phpt index aaeb58e000ad..26e1dd2f1c55 100644 --- a/ext/standard/tests/math/decbin_basic.phpt +++ b/ext/standard/tests/math/decbin_basic.phpt @@ -19,8 +19,8 @@ $values = array(10, foreach ($values as $value) { try { var_dump(decbin($value)); - } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -43,6 +43,6 @@ string(12) "111101101110" Deprecated: Implicit conversion from float-string "3.9505e3" to int loses precision in %s on line %d string(12) "111101101110" string(6) "100111" -decbin(): Argument #1 ($num) must be of type int, string given +TypeError: decbin(): Argument #1 ($num) must be of type int, string given string(1) "1" string(1) "0" diff --git a/ext/standard/tests/math/decbin_basiclong_64bit.phpt b/ext/standard/tests/math/decbin_basiclong_64bit.phpt index 16fd6b97b803..1740af170312 100644 --- a/ext/standard/tests/math/decbin_basiclong_64bit.phpt +++ b/ext/standard/tests/math/decbin_basiclong_64bit.phpt @@ -23,8 +23,8 @@ foreach ($longVals as $longVal) { echo "--- testing: $longVal ---\n"; try { var_dump(decbin($longVal)); - } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -55,7 +55,7 @@ string(32) "11111111111111111111111111111101" --- testing: 9223372036854775806 --- string(63) "111111111111111111111111111111111111111111111111111111111111110" --- testing: 9.2233720368548E+18 --- -decbin(): Argument #1 ($num) must be of type int, float given +TypeError: decbin(): Argument #1 ($num) must be of type int, float given --- testing: -9223372036854775807 --- string(64) "1000000000000000000000000000000000000000000000000000000000000001" --- testing: -9.2233720368548E+18 --- diff --git a/ext/standard/tests/math/decbin_variation1_64bit.phpt b/ext/standard/tests/math/decbin_variation1_64bit.phpt index 0d4e18307eab..46b6e4af9fbc 100644 --- a/ext/standard/tests/math/decbin_variation1_64bit.phpt +++ b/ext/standard/tests/math/decbin_variation1_64bit.phpt @@ -39,8 +39,8 @@ foreach ($inputs as $i => $input) { echo "\n-- Iteration $iterator --\n"; try { var_dump(decbin($input)); - } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -61,10 +61,10 @@ string(14) "11000000111001" string(64) "1111111111111111111111111111111111111111111111111111011011010111" -- Iteration 5 -- -decbin(): Argument #1 ($num) must be of type int, float given +TypeError: decbin(): Argument #1 ($num) must be of type int, float given -- Iteration 6 -- -decbin(): Argument #1 ($num) must be of type int, float given +TypeError: decbin(): Argument #1 ($num) must be of type int, float given -- Iteration 7 -- string(37) "1110010111110100110010001101000001000" @@ -82,7 +82,7 @@ string(1) "1" string(1) "0" -- Iteration 12 -- -decbin(): Argument #1 ($num) must be of type int, string given +TypeError: decbin(): Argument #1 ($num) must be of type int, string given -- Iteration 13 -- -decbin(): Argument #1 ($num) must be of type int, string given +TypeError: decbin(): Argument #1 ($num) must be of type int, string given diff --git a/ext/standard/tests/math/dechex_basic.phpt b/ext/standard/tests/math/dechex_basic.phpt index 04c1d393e700..61f3b6a85857 100644 --- a/ext/standard/tests/math/dechex_basic.phpt +++ b/ext/standard/tests/math/dechex_basic.phpt @@ -19,8 +19,8 @@ $values = array(10, foreach ($values as $value) { try { var_dump(dechex($value)); - } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -43,6 +43,6 @@ string(3) "f6e" Deprecated: Implicit conversion from float-string "3.9505e3" to int loses precision in %s on line %d string(3) "f6e" string(2) "27" -dechex(): Argument #1 ($num) must be of type int, string given +TypeError: dechex(): Argument #1 ($num) must be of type int, string given string(1) "1" string(1) "0" diff --git a/ext/standard/tests/math/dechex_basiclong_64bit.phpt b/ext/standard/tests/math/dechex_basiclong_64bit.phpt index 85051ea4567b..19301f38546b 100644 --- a/ext/standard/tests/math/dechex_basiclong_64bit.phpt +++ b/ext/standard/tests/math/dechex_basiclong_64bit.phpt @@ -23,8 +23,8 @@ foreach ($longVals as $longVal) { echo "--- testing: $longVal ---\n"; try { var_dump(dechex($longVal)); - } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -55,7 +55,7 @@ string(8) "fffffffd" --- testing: 9223372036854775806 --- string(16) "7ffffffffffffffe" --- testing: 9.2233720368548E+18 --- -dechex(): Argument #1 ($num) must be of type int, float given +TypeError: dechex(): Argument #1 ($num) must be of type int, float given --- testing: -9223372036854775807 --- string(16) "8000000000000001" --- testing: -9.2233720368548E+18 --- diff --git a/ext/standard/tests/math/dechex_variation1_64bit.phpt b/ext/standard/tests/math/dechex_variation1_64bit.phpt index bd597b2f996a..6f63d31dde57 100644 --- a/ext/standard/tests/math/dechex_variation1_64bit.phpt +++ b/ext/standard/tests/math/dechex_variation1_64bit.phpt @@ -39,8 +39,8 @@ foreach ($inputs as $i => $input) { echo "\n-- Iteration $iterator --\n"; try { var_dump(dechex($input)); - } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -61,10 +61,10 @@ string(4) "3039" string(16) "fffffffffffff6d7" -- Iteration 5 -- -dechex(): Argument #1 ($num) must be of type int, float given +TypeError: dechex(): Argument #1 ($num) must be of type int, float given -- Iteration 6 -- -dechex(): Argument #1 ($num) must be of type int, float given +TypeError: dechex(): Argument #1 ($num) must be of type int, float given -- Iteration 7 -- string(10) "1cbe991a08" @@ -82,7 +82,7 @@ string(1) "1" string(1) "0" -- Iteration 12 -- -dechex(): Argument #1 ($num) must be of type int, string given +TypeError: dechex(): Argument #1 ($num) must be of type int, string given -- Iteration 13 -- -dechex(): Argument #1 ($num) must be of type int, string given +TypeError: dechex(): Argument #1 ($num) must be of type int, string given diff --git a/ext/standard/tests/math/decoct_basic.phpt b/ext/standard/tests/math/decoct_basic.phpt index 30d6712bb47c..31bfa96a49f5 100644 --- a/ext/standard/tests/math/decoct_basic.phpt +++ b/ext/standard/tests/math/decoct_basic.phpt @@ -19,8 +19,8 @@ $values = array(10, foreach ($values as $value) { try { var_dump(decoct($value)); - } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -43,6 +43,6 @@ string(4) "7556" Deprecated: Implicit conversion from float-string "3.9505e3" to int loses precision in %s on line %d string(4) "7556" string(2) "47" -decoct(): Argument #1 ($num) must be of type int, string given +TypeError: decoct(): Argument #1 ($num) must be of type int, string given string(1) "1" string(1) "0" diff --git a/ext/standard/tests/math/decoct_basiclong_64bit.phpt b/ext/standard/tests/math/decoct_basiclong_64bit.phpt index a4e951176cd0..d958db52e320 100644 --- a/ext/standard/tests/math/decoct_basiclong_64bit.phpt +++ b/ext/standard/tests/math/decoct_basiclong_64bit.phpt @@ -23,8 +23,8 @@ foreach ($longVals as $longVal) { echo "--- testing: $longVal ---\n"; try { var_dump(decoct($longVal)); - } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -55,7 +55,7 @@ string(11) "37777777775" --- testing: 9223372036854775806 --- string(21) "777777777777777777776" --- testing: 9.2233720368548E+18 --- -decoct(): Argument #1 ($num) must be of type int, float given +TypeError: decoct(): Argument #1 ($num) must be of type int, float given --- testing: -9223372036854775807 --- string(22) "1000000000000000000001" --- testing: -9.2233720368548E+18 --- diff --git a/ext/standard/tests/math/decoct_variation1_64bit.phpt b/ext/standard/tests/math/decoct_variation1_64bit.phpt index cc4b69f07560..56e468a72ef5 100644 --- a/ext/standard/tests/math/decoct_variation1_64bit.phpt +++ b/ext/standard/tests/math/decoct_variation1_64bit.phpt @@ -39,8 +39,8 @@ foreach ($inputs as $i => $input) { echo "\n-- Iteration $iterator --\n"; try { var_dump(decoct($input)); - } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -61,10 +61,10 @@ string(5) "30071" string(22) "1777777777777777773327" -- Iteration 5 -- -decoct(): Argument #1 ($num) must be of type int, float given +TypeError: decoct(): Argument #1 ($num) must be of type int, float given -- Iteration 6 -- -decoct(): Argument #1 ($num) must be of type int, float given +TypeError: decoct(): Argument #1 ($num) must be of type int, float given -- Iteration 7 -- string(13) "1627646215010" @@ -82,7 +82,7 @@ string(1) "1" string(1) "0" -- Iteration 12 -- -decoct(): Argument #1 ($num) must be of type int, string given +TypeError: decoct(): Argument #1 ($num) must be of type int, string given -- Iteration 13 -- -decoct(): Argument #1 ($num) must be of type int, string given +TypeError: decoct(): Argument #1 ($num) must be of type int, string given diff --git a/ext/standard/tests/math/floor_variation1.phpt b/ext/standard/tests/math/floor_variation1.phpt index c9ec5e710c51..bfa5a7666bd6 100644 --- a/ext/standard/tests/math/floor_variation1.phpt +++ b/ext/standard/tests/math/floor_variation1.phpt @@ -64,8 +64,8 @@ foreach($inputs as $input) { echo "\n-- Iteration $iterator --\n"; try { var_dump(floor($input)); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $iterator++; }; @@ -97,25 +97,25 @@ float(1) float(0) -- Iteration 7 -- -floor(): Argument #1 ($num) must be of type int|float, string given +TypeError: floor(): Argument #1 ($num) must be of type int|float, string given -- Iteration 8 -- -floor(): Argument #1 ($num) must be of type int|float, string given +TypeError: floor(): Argument #1 ($num) must be of type int|float, string given -- Iteration 9 -- -floor(): Argument #1 ($num) must be of type int|float, array given +TypeError: floor(): Argument #1 ($num) must be of type int|float, array given -- Iteration 10 -- -floor(): Argument #1 ($num) must be of type int|float, string given +TypeError: floor(): Argument #1 ($num) must be of type int|float, string given -- Iteration 11 -- -floor(): Argument #1 ($num) must be of type int|float, string given +TypeError: floor(): Argument #1 ($num) must be of type int|float, string given -- Iteration 12 -- -floor(): Argument #1 ($num) must be of type int|float, string given +TypeError: floor(): Argument #1 ($num) must be of type int|float, string given -- Iteration 13 -- -floor(): Argument #1 ($num) must be of type int|float, classA given +TypeError: floor(): Argument #1 ($num) must be of type int|float, classA given -- Iteration 14 -- @@ -128,4 +128,4 @@ Deprecated: floor(): Passing null to parameter #1 ($num) of type int|float is de float(0) -- Iteration 16 -- -floor(): Argument #1 ($num) must be of type int|float, resource given +TypeError: floor(): Argument #1 ($num) must be of type int|float, resource given diff --git a/ext/standard/tests/math/gh17384.phpt b/ext/standard/tests/math/gh17384.phpt index eff207a906a6..77165bc50e3c 100644 --- a/ext/standard/tests/math/gh17384.phpt +++ b/ext/standard/tests/math/gh17384.phpt @@ -11,15 +11,15 @@ foreach ([1.23456, 1] as $number) { foreach ([9876543210, -9876543210] as $decimals) { try { number_format($number, $decimals); - } catch (ValueError $exception) { - echo $exception->getMessage(), "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } } ?> --EXPECT-- -number_format(): Argument #2 ($decimals) must be between -2147483648 and 2147483647 -number_format(): Argument #2 ($decimals) must be between -2147483648 and 2147483647 -number_format(): Argument #2 ($decimals) must be between -2147483648 and 2147483647 -number_format(): Argument #2 ($decimals) must be between -2147483648 and 2147483647 +ValueError: number_format(): Argument #2 ($decimals) must be between -2147483648 and 2147483647 +ValueError: number_format(): Argument #2 ($decimals) must be between -2147483648 and 2147483647 +ValueError: number_format(): Argument #2 ($decimals) must be between -2147483648 and 2147483647 +ValueError: number_format(): Argument #2 ($decimals) must be between -2147483648 and 2147483647 diff --git a/ext/standard/tests/math/hexdec_variation1_64bit.phpt b/ext/standard/tests/math/hexdec_variation1_64bit.phpt index c892b8049fc9..c4c2a716d3f6 100644 --- a/ext/standard/tests/math/hexdec_variation1_64bit.phpt +++ b/ext/standard/tests/math/hexdec_variation1_64bit.phpt @@ -61,8 +61,8 @@ foreach($inputs as $input) { echo "\n-- Iteration $iterator --\n"; try { var_dump(hexdec($input)); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $iterator++; }; @@ -133,7 +133,7 @@ int(0) int(0) -- Iteration 18 -- -hexdec(): Argument #1 ($hex_string) must be of type string, array given +TypeError: hexdec(): Argument #1 ($hex_string) must be of type string, array given -- Iteration 19 -- @@ -151,4 +151,4 @@ Deprecated: Invalid characters passed for attempted conversion, these have been int(2748) -- Iteration 22 -- -hexdec(): Argument #1 ($hex_string) must be of type string, resource given +TypeError: hexdec(): Argument #1 ($hex_string) must be of type string, resource given diff --git a/ext/standard/tests/math/intdiv.phpt b/ext/standard/tests/math/intdiv.phpt index b441cb0a8680..4bc58c573ab7 100644 --- a/ext/standard/tests/math/intdiv.phpt +++ b/ext/standard/tests/math/intdiv.phpt @@ -11,12 +11,12 @@ var_dump(intdiv(PHP_INT_MIN, PHP_INT_MIN)); try { var_dump(intdiv(PHP_INT_MIN, -1)); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(intdiv(1, 0)); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -27,5 +27,5 @@ int(-1) int(1) int(1) int(1) -Exception: Division of PHP_INT_MIN by -1 is not an integer -Exception: Division by zero +ArithmeticError: Division of PHP_INT_MIN by -1 is not an integer +DivisionByZeroError: Division by zero diff --git a/ext/standard/tests/math/log_error.phpt b/ext/standard/tests/math/log_error.phpt index 4c90c20a2052..85e9baba3f2c 100644 --- a/ext/standard/tests/math/log_error.phpt +++ b/ext/standard/tests/math/log_error.phpt @@ -6,9 +6,9 @@ precision=14 getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -log(): Argument #2 ($base) must be greater than 0 +ValueError: log(): Argument #2 ($base) must be greater than 0 diff --git a/ext/standard/tests/math/octdec_variation1.phpt b/ext/standard/tests/math/octdec_variation1.phpt index c24d2e8e6bea..214875b7638d 100644 --- a/ext/standard/tests/math/octdec_variation1.phpt +++ b/ext/standard/tests/math/octdec_variation1.phpt @@ -57,8 +57,8 @@ foreach($inputs as $input) { echo "\n-- Iteration $iterator --\n"; try { var_dump(octdec($input)); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $iterator++; }; @@ -136,7 +136,7 @@ int(0) int(0) -- Iteration 18 -- -octdec(): Argument #1 ($octal_string) must be of type string, array given +TypeError: octdec(): Argument #1 ($octal_string) must be of type string, array given -- Iteration 19 -- @@ -154,5 +154,5 @@ Deprecated: Invalid characters passed for attempted conversion, these have been int(0) -- Iteration 22 -- -octdec(): Argument #1 ($octal_string) must be of type string, resource given +TypeError: octdec(): Argument #1 ($octal_string) must be of type string, resource given ---Done--- diff --git a/ext/standard/tests/math/pow_basic_64bit.phpt b/ext/standard/tests/math/pow_basic_64bit.phpt index 7496c2d1b52a..83cd9670f34b 100644 --- a/ext/standard/tests/math/pow_basic_64bit.phpt +++ b/ext/standard/tests/math/pow_basic_64bit.phpt @@ -276,4 +276,3 @@ Base = -9223372036854775808 ..... Exponent = -500 Result = 0 ..... Exponent = 2147483647 Result = -INF ..... Exponent = -2147483648 Result = 0 - diff --git a/ext/standard/tests/math/pow_variation1_64bit.phpt b/ext/standard/tests/math/pow_variation1_64bit.phpt index debc8b16d2b0..a7c85cbaa570 100644 --- a/ext/standard/tests/math/pow_variation1_64bit.phpt +++ b/ext/standard/tests/math/pow_variation1_64bit.phpt @@ -58,8 +58,8 @@ $inputs = [ foreach ($inputs as $input) { try { var_dump(pow($input, 3)); - } catch (Error $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } fclose($fp); @@ -78,11 +78,11 @@ float(0.125) int(0) int(1) int(0) -Unsupported operand types: string ** int -Unsupported operand types: array ** int -Unsupported operand types: string ** int +TypeError: Unsupported operand types: string ** int +TypeError: Unsupported operand types: array ** int +TypeError: Unsupported operand types: string ** int float(1157.625) int(8) float(0.000250047) -Unsupported operand types: classA ** int -Unsupported operand types: resource ** int +TypeError: Unsupported operand types: classA ** int +TypeError: Unsupported operand types: resource ** int diff --git a/ext/standard/tests/math/pow_variation2.phpt b/ext/standard/tests/math/pow_variation2.phpt index 47a4845faade..5b96e9ca3e48 100644 --- a/ext/standard/tests/math/pow_variation2.phpt +++ b/ext/standard/tests/math/pow_variation2.phpt @@ -54,8 +54,8 @@ $inputs = [ foreach ($inputs as $input) { try { var_dump(pow(20.3, $input)); - } catch (Error $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } fclose($fp); @@ -74,11 +74,11 @@ float(4.5055521304275) float(1) float(20.3) float(1) -Unsupported operand types: float ** string -Unsupported operand types: float ** array -Unsupported operand types: float ** string +TypeError: Unsupported operand types: float ** string +TypeError: Unsupported operand types: float ** array +TypeError: Unsupported operand types: float ** string float(15532029.564086) float(412.09) float(1.2088495422866) -Unsupported operand types: float ** classA -Unsupported operand types: float ** resource +TypeError: Unsupported operand types: float ** classA +TypeError: Unsupported operand types: float ** resource diff --git a/ext/standard/tests/math/round_valid_rounding_mode.phpt b/ext/standard/tests/math/round_valid_rounding_mode.phpt index d7e4655a2985..009e21cd94fb 100644 --- a/ext/standard/tests/math/round_valid_rounding_mode.phpt +++ b/ext/standard/tests/math/round_valid_rounding_mode.phpt @@ -4,9 +4,9 @@ round() rejects invalid rounding modes. getMessage(), PHP_EOL; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -round(): Argument #3 ($mode) must be a valid rounding mode (RoundingMode::*) +ValueError: round(): Argument #3 ($mode) must be a valid rounding mode (RoundingMode::*) diff --git a/ext/standard/tests/math/round_variation1.phpt b/ext/standard/tests/math/round_variation1.phpt index 2a2adf27cae0..eb988408b9c6 100644 --- a/ext/standard/tests/math/round_variation1.phpt +++ b/ext/standard/tests/math/round_variation1.phpt @@ -78,8 +78,8 @@ foreach($inputs as $input) { echo "\n-- Iteration $iterator --\n"; try { var_dump(round($input, 14)); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $iterator++; }; @@ -141,25 +141,25 @@ float(1) float(0) -- Iteration 17 -- -round(): Argument #1 ($num) must be of type int|float, string given +TypeError: round(): Argument #1 ($num) must be of type int|float, string given -- Iteration 18 -- -round(): Argument #1 ($num) must be of type int|float, string given +TypeError: round(): Argument #1 ($num) must be of type int|float, string given -- Iteration 19 -- -round(): Argument #1 ($num) must be of type int|float, array given +TypeError: round(): Argument #1 ($num) must be of type int|float, array given -- Iteration 20 -- -round(): Argument #1 ($num) must be of type int|float, string given +TypeError: round(): Argument #1 ($num) must be of type int|float, string given -- Iteration 21 -- -round(): Argument #1 ($num) must be of type int|float, string given +TypeError: round(): Argument #1 ($num) must be of type int|float, string given -- Iteration 22 -- -round(): Argument #1 ($num) must be of type int|float, string given +TypeError: round(): Argument #1 ($num) must be of type int|float, string given -- Iteration 23 -- -round(): Argument #1 ($num) must be of type int|float, classA given +TypeError: round(): Argument #1 ($num) must be of type int|float, classA given -- Iteration 24 -- @@ -172,4 +172,4 @@ Deprecated: round(): Passing null to parameter #1 ($num) of type int|float is de float(0) -- Iteration 26 -- -round(): Argument #1 ($num) must be of type int|float, resource given +TypeError: round(): Argument #1 ($num) must be of type int|float, resource given diff --git a/ext/standard/tests/misc/exec_basic1.phpt b/ext/standard/tests/misc/exec_basic1.phpt index e08d6a938991..2c2731fd07d3 100644 --- a/ext/standard/tests/misc/exec_basic1.phpt +++ b/ext/standard/tests/misc/exec_basic1.phpt @@ -10,21 +10,21 @@ exec, system, passthru — Basic command execution functions $cmd = "echo abc\n\0command"; try { var_dump(exec($cmd, $output)); -} catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(system($cmd, $output)); -} catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(passthru($cmd, $output)); -} catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -exec(): Argument #1 ($command) must not contain any null bytes -system(): Argument #1 ($command) must not contain any null bytes -passthru(): Argument #1 ($command) must not contain any null bytes +ValueError: exec(): Argument #1 ($command) must not contain any null bytes +ValueError: system(): Argument #1 ($command) must not contain any null bytes +ValueError: passthru(): Argument #1 ($command) must not contain any null bytes diff --git a/ext/standard/tests/misc/gh14774.phpt b/ext/standard/tests/misc/gh14774.phpt index 1f9cd921e03a..7ed69a3b2120 100644 --- a/ext/standard/tests/misc/gh14774.phpt +++ b/ext/standard/tests/misc/gh14774.phpt @@ -9,15 +9,15 @@ if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); foreach([INF, -INF, 10e300, -10e300, NAN, -NAN] as $var) { try { time_sleep_until($var); - } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + } catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> --EXPECTF-- -time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d -time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d -time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d -time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d -time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d -time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d +ValueError: time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d +ValueError: time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d +ValueError: time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d +ValueError: time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d +ValueError: time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d +ValueError: time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d diff --git a/ext/standard/tests/network/bug69523.phpt b/ext/standard/tests/network/bug69523.phpt index 5552ca2afdf8..438b1ed8d748 100644 --- a/ext/standard/tests/network/bug69523.phpt +++ b/ext/standard/tests/network/bug69523.phpt @@ -4,9 +4,9 @@ setcookie() allows empty cookie name getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -setcookie(): Argument #1 ($name) must not be empty +ValueError: setcookie(): Argument #1 ($name) must not be empty diff --git a/ext/standard/tests/network/bug69948.phpt b/ext/standard/tests/network/bug69948.phpt index c2a72aac8720..9efdb4ea4b99 100644 --- a/ext/standard/tests/network/bug69948.phpt +++ b/ext/standard/tests/network/bug69948.phpt @@ -4,19 +4,19 @@ Bug #69948 (path/domain are not sanitized for special characters in setcookie) getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(setcookie('foo', 'bar', 0, '/', 'foobar; secure')); -} catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> ===DONE=== --EXPECTHEADERS-- --EXPECT-- -setcookie(): "path" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" -setcookie(): "domain" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" +ValueError: setcookie(): "path" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" +ValueError: setcookie(): "domain" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" ===DONE=== diff --git a/ext/standard/tests/network/bug79405.phpt b/ext/standard/tests/network/bug79405.phpt index ca1f7b0f3f28..101a1c9aa12c 100644 --- a/ext/standard/tests/network/bug79405.phpt +++ b/ext/standard/tests/network/bug79405.phpt @@ -5,15 +5,15 @@ Bug #79405 - gethostbyname() silently truncates after a null byte $host = "localhost\0.example.com"; try { var_dump(gethostbyname($host)); -} catch(Error $e) { - print $e->getMessage()."\n"; +} catch(Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(gethostbynamel($host)); -} catch(Error $e) { - print $e->getMessage()."\n"; +} catch(Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -gethostbyname(): Argument #1 ($hostname) must not contain any null bytes -gethostbynamel(): Argument #1 ($hostname) must not contain any null bytes \ No newline at end of file +ValueError: gethostbyname(): Argument #1 ($hostname) must not contain any null bytes +ValueError: gethostbynamel(): Argument #1 ($hostname) must not contain any null bytes diff --git a/ext/standard/tests/network/dns_check_record_error_conditions.phpt b/ext/standard/tests/network/dns_check_record_error_conditions.phpt index de33d74bce63..e399e171e04c 100644 --- a/ext/standard/tests/network/dns_check_record_error_conditions.phpt +++ b/ext/standard/tests/network/dns_check_record_error_conditions.phpt @@ -4,16 +4,16 @@ dns_check_record() error conditions getMessage() . "\n"; +} catch (\Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { // A random DNS Mode dns_check_record('php.net', 15263480); -} catch (\ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (\Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -dns_check_record(): Argument #1 ($hostname) must not be empty -dns_check_record(): Argument #2 ($type) must be a valid DNS record type +ValueError: dns_check_record(): Argument #1 ($hostname) must not be empty +ValueError: dns_check_record(): Argument #2 ($type) must be a valid DNS record type diff --git a/ext/standard/tests/network/dns_get_record_error_conditions.phpt b/ext/standard/tests/network/dns_get_record_error_conditions.phpt index 6506aca4108e..c3c147463c16 100644 --- a/ext/standard/tests/network/dns_get_record_error_conditions.phpt +++ b/ext/standard/tests/network/dns_get_record_error_conditions.phpt @@ -5,27 +5,27 @@ dns_get_record() error conditions try { // A random DNS Mode dns_get_record('php.net', 15263480); -} catch (\ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (\Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { // DNS Mode 0 $auth = []; $additional = []; dns_get_record('php.net', 0, $auth, $additional, true); -} catch (\ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (\Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { // A random DNS Mode $auth = []; $additional = []; dns_get_record('php.net', 15263480, $auth, $additional, true); -} catch (\ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (\Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -dns_get_record(): Argument #2 ($type) must be a DNS_* constant -dns_get_record(): Argument #2 ($type) must be between 1 and 65535 when argument #5 ($raw) is true -dns_get_record(): Argument #2 ($type) must be between 1 and 65535 when argument #5 ($raw) is true +ValueError: dns_get_record(): Argument #2 ($type) must be a DNS_* constant +ValueError: dns_get_record(): Argument #2 ($type) must be between 1 and 65535 when argument #5 ($raw) is true +ValueError: dns_get_record(): Argument #2 ($type) must be between 1 and 65535 when argument #5 ($raw) is true diff --git a/ext/standard/tests/network/ghsa-www2-q4fc-65wf.phpt b/ext/standard/tests/network/ghsa-www2-q4fc-65wf.phpt index 3d082c8e9522..5f835329e33e 100644 --- a/ext/standard/tests/network/ghsa-www2-q4fc-65wf.phpt +++ b/ext/standard/tests/network/ghsa-www2-q4fc-65wf.phpt @@ -6,57 +6,57 @@ This is a ZPP test but *keep* this as it is security-sensitive! getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { dns_get_mx("\0", $out); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { dns_get_record("\0"); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { getprotobyname("\0"); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { getservbyname("\0", "tcp"); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { getservbyname("x", "tcp\0"); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { getservbyport(0, "tcp\0"); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { inet_pton("\0"); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { ip2long("\0"); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -dns_check_record(): Argument #1 ($hostname) must not contain any null bytes -dns_get_mx(): Argument #1 ($hostname) must not contain any null bytes -dns_get_record(): Argument #1 ($hostname) must not contain any null bytes -getprotobyname(): Argument #1 ($protocol) must not contain any null bytes -getservbyname(): Argument #1 ($service) must not contain any null bytes -getservbyname(): Argument #2 ($protocol) must not contain any null bytes -getservbyport(): Argument #2 ($protocol) must not contain any null bytes -inet_pton(): Argument #1 ($ip) must not contain any null bytes -ip2long(): Argument #1 ($ip) must not contain any null bytes +ValueError: dns_check_record(): Argument #1 ($hostname) must not contain any null bytes +ValueError: dns_get_mx(): Argument #1 ($hostname) must not contain any null bytes +ValueError: dns_get_record(): Argument #1 ($hostname) must not contain any null bytes +ValueError: getprotobyname(): Argument #1 ($protocol) must not contain any null bytes +ValueError: getservbyname(): Argument #1 ($service) must not contain any null bytes +ValueError: getservbyname(): Argument #2 ($protocol) must not contain any null bytes +ValueError: getservbyport(): Argument #2 ($protocol) must not contain any null bytes +ValueError: inet_pton(): Argument #1 ($ip) must not contain any null bytes +ValueError: ip2long(): Argument #1 ($ip) must not contain any null bytes diff --git a/ext/standard/tests/network/openlog_null_bytes.phpt b/ext/standard/tests/network/openlog_null_bytes.phpt index 6d3274227815..80cc1301b6bd 100644 --- a/ext/standard/tests/network/openlog_null_bytes.phpt +++ b/ext/standard/tests/network/openlog_null_bytes.phpt @@ -8,9 +8,9 @@ if (!function_exists("openlog")) die("skip openlog() is not available"); getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -openlog(): Argument #1 ($prefix) must not contain any null bytes +ValueError: openlog(): Argument #1 ($prefix) must not contain any null bytes diff --git a/ext/standard/tests/network/setcookie_array_option_error.phpt b/ext/standard/tests/network/setcookie_array_option_error.phpt index 0fb2ae011c31..f834d1e0eb71 100644 --- a/ext/standard/tests/network/setcookie_array_option_error.phpt +++ b/ext/standard/tests/network/setcookie_array_option_error.phpt @@ -10,45 +10,45 @@ ob_start(); // Unrecognized key and no valid keys try { setcookie('name', 'value', ['unknown_key' => 'only']); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } // Numeric key and no valid keys try { setcookie('name2', 'value2', [0 => 'numeric_key']); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } // Unrecognized key try { setcookie('name3', 'value3', ['path' => '/path/', 'foo' => 'bar']); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } // Invalid path key content try { setcookie('name', 'value', ['path' => '/;/']); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } // Invalid domain key content try { setcookie('name', 'value', ['path' => '/path/', 'domain' => 'ba;r']); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } // Partitioned without secure try { setcookie('name', 'value', ['partitioned' => true]); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } // Arguments after options array (will not be set) try { setcookie('name4', 'value4', [], "path", "domain.tld", true, true); -} catch (\ArgumentCountError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } if (PHP_INT_SIZE == 8) { @@ -67,13 +67,13 @@ var_dump(headers_list()); --EXPECTHEADERS-- --EXPECTF-- -setcookie(): option "unknown_key" is invalid -setcookie(): option array cannot have numeric keys -setcookie(): option "foo" is invalid -setcookie(): "path" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" -setcookie(): "domain" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" -setcookie(): "partitioned" option cannot be used without "secure" option -setcookie(): Expects exactly 3 arguments when argument #3 ($expires_or_options) is an array +ValueError: setcookie(): option "unknown_key" is invalid +ValueError: setcookie(): option array cannot have numeric keys +ValueError: setcookie(): option "foo" is invalid +ValueError: setcookie(): "path" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" +ValueError: setcookie(): "domain" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" +ValueError: setcookie(): "partitioned" option cannot be used without "secure" option +ArgumentCountError: setcookie(): Expects exactly 3 arguments when argument #3 ($expires_or_options) is an array bool(true) array(1) { [0]=> diff --git a/ext/standard/tests/network/setcookie_error.phpt b/ext/standard/tests/network/setcookie_error.phpt index 90177c714e58..b9cf2d6968b9 100644 --- a/ext/standard/tests/network/setcookie_error.phpt +++ b/ext/standard/tests/network/setcookie_error.phpt @@ -9,28 +9,28 @@ ob_start(); try { setcookie(''); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setcookie('invalid='); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setcookie('name', 'invalid;'); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setcookie('name', 'value', 100, 'invalid;'); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setcookie('name', 'value', 100, 'path', 'invalid;'); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } if (PHP_INT_SIZE == 8) { @@ -50,10 +50,10 @@ var_dump(headers_list()); --EXPECTHEADERS-- --EXPECTF-- -setcookie(): Argument #1 ($name) must not be empty -setcookie(): Argument #1 ($name) cannot contain "=", ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" -setcookie(): "path" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" -setcookie(): "domain" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" +ValueError: setcookie(): Argument #1 ($name) must not be empty +ValueError: setcookie(): Argument #1 ($name) cannot contain "=", ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" +ValueError: setcookie(): "path" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" +ValueError: setcookie(): "domain" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" bool(true) array(2) { [0]=> diff --git a/ext/standard/tests/network/setrawcookie_error.phpt b/ext/standard/tests/network/setrawcookie_error.phpt index 9aae95673df0..0d7a488b7e5a 100644 --- a/ext/standard/tests/network/setrawcookie_error.phpt +++ b/ext/standard/tests/network/setrawcookie_error.phpt @@ -9,28 +9,28 @@ ob_start(); try { setrawcookie(''); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setrawcookie('invalid='); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setrawcookie('name', 'invalid;'); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setrawcookie('name', 'value', 100, 'invalid;'); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setrawcookie('name', 'value', 100, 'path', 'invalid;'); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } if (PHP_INT_SIZE == 8) { @@ -50,11 +50,11 @@ var_dump(headers_list()); --EXPECTHEADERS-- --EXPECTF-- -setrawcookie(): Argument #1 ($name) must not be empty -setrawcookie(): Argument #1 ($name) cannot contain "=", ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" -setrawcookie(): Argument #2 ($value) cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" -setrawcookie(): "path" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" -setrawcookie(): "domain" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" +ValueError: setrawcookie(): Argument #1 ($name) must not be empty +ValueError: setrawcookie(): Argument #1 ($name) cannot contain "=", ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" +ValueError: setrawcookie(): Argument #2 ($value) cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" +ValueError: setrawcookie(): "path" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" +ValueError: setrawcookie(): "domain" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" bool(true) array(1) { [0]=> diff --git a/ext/standard/tests/password/password_bcrypt_errors.phpt b/ext/standard/tests/password/password_bcrypt_errors.phpt index 5d823cba0217..0bf136da9cc0 100644 --- a/ext/standard/tests/password/password_bcrypt_errors.phpt +++ b/ext/standard/tests/password/password_bcrypt_errors.phpt @@ -5,23 +5,23 @@ Test error operation of password_hash() with bcrypt hashing //-=-=-=- try { password_hash("foo", PASSWORD_BCRYPT, array("cost" => 3)); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { var_dump(password_hash("foo", PASSWORD_BCRYPT, array("cost" => 32))); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { var_dump(password_hash("null\0password", PASSWORD_BCRYPT)); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Invalid bcrypt cost parameter specified: 3 -Invalid bcrypt cost parameter specified: 32 -Bcrypt password must not contain null character +ValueError: Invalid bcrypt cost parameter specified: 3 +ValueError: Invalid bcrypt cost parameter specified: 32 +ValueError: Bcrypt password must not contain null character diff --git a/ext/standard/tests/password/password_hash_error.phpt b/ext/standard/tests/password/password_hash_error.phpt index a9e26f091675..818a3284fbda 100644 --- a/ext/standard/tests/password/password_hash_error.phpt +++ b/ext/standard/tests/password/password_hash_error.phpt @@ -6,38 +6,38 @@ Test error operation of password_hash() try { var_dump(password_hash("foo")); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { password_hash("foo", array()); -} catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { var_dump(password_hash("foo", 19, new StdClass)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(password_hash("foo", PASSWORD_BCRYPT, "baz")); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(password_hash(array(), PASSWORD_BCRYPT)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -password_hash() expects at least 2 arguments, 1 given -password_hash(): Argument #2 ($algo) must be of type string|int|null, array given -password_hash(): Argument #3 ($options) must be of type array, stdClass given -password_hash(): Argument #3 ($options) must be of type array, string given -password_hash(): Argument #1 ($password) must be of type string, array given +ArgumentCountError: password_hash() expects at least 2 arguments, 1 given +TypeError: password_hash(): Argument #2 ($algo) must be of type string|int|null, array given +TypeError: password_hash(): Argument #3 ($options) must be of type array, stdClass given +TypeError: password_hash(): Argument #3 ($options) must be of type array, string given +TypeError: password_hash(): Argument #1 ($password) must be of type string, array given diff --git a/ext/standard/tests/password/password_needs_rehash_error.phpt b/ext/standard/tests/password/password_needs_rehash_error.phpt index 283a6b5387e0..530e92762a29 100644 --- a/ext/standard/tests/password/password_needs_rehash_error.phpt +++ b/ext/standard/tests/password/password_needs_rehash_error.phpt @@ -5,33 +5,33 @@ Test error operation of password_needs_rehash() try { var_dump(password_needs_rehash('')); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(password_needs_rehash('', [])); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(password_needs_rehash(array(), PASSWORD_BCRYPT)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(password_needs_rehash("", PASSWORD_BCRYPT, "foo")); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "OK!"; ?> --EXPECT-- -password_needs_rehash() expects at least 2 arguments, 1 given -password_needs_rehash(): Argument #2 ($algo) must be of type string|int|null, array given -password_needs_rehash(): Argument #1 ($hash) must be of type string, array given -password_needs_rehash(): Argument #3 ($options) must be of type array, string given +ArgumentCountError: password_needs_rehash() expects at least 2 arguments, 1 given +TypeError: password_needs_rehash(): Argument #2 ($algo) must be of type string|int|null, array given +TypeError: password_needs_rehash(): Argument #1 ($hash) must be of type string, array given +TypeError: password_needs_rehash(): Argument #3 ($options) must be of type array, string given OK! diff --git a/ext/standard/tests/password/password_verify_error.phpt b/ext/standard/tests/password/password_verify_error.phpt index 76c4f6dcb65e..c59f231da043 100644 --- a/ext/standard/tests/password/password_verify_error.phpt +++ b/ext/standard/tests/password/password_verify_error.phpt @@ -6,10 +6,10 @@ Test error operation of password_verify() try { var_dump(password_verify("foo")); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -password_verify() expects exactly 2 arguments, 1 given +ArgumentCountError: password_verify() expects exactly 2 arguments, 1 given diff --git a/ext/standard/tests/poll/gh22759.phpt b/ext/standard/tests/poll/gh22759.phpt index 3df68c4f1314..c1ad108bed8c 100644 --- a/ext/standard/tests/poll/gh22759.phpt +++ b/ext/standard/tests/poll/gh22759.phpt @@ -25,8 +25,8 @@ var_dump($second->isActive()); try { $second->remove(); -} catch (Io\Poll\InactiveWatcherException $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "done\n"; @@ -34,5 +34,5 @@ echo "done\n"; --EXPECT-- NULL bool(false) -Cannot remove inactive watcher +Io\Poll\InactiveWatcherException: Cannot remove inactive watcher done diff --git a/ext/standard/tests/poll/poll_clone_not_allowed.phpt b/ext/standard/tests/poll/poll_clone_not_allowed.phpt index f31c4c2ecd7f..00befedb4d04 100644 --- a/ext/standard/tests/poll/poll_clone_not_allowed.phpt +++ b/ext/standard/tests/poll/poll_clone_not_allowed.phpt @@ -12,15 +12,15 @@ $watcher = $ctx->add($handle, [Io\Poll\Event::Read]); foreach ([$ctx, $handle, $watcher] as $obj) { try { clone $obj; - } catch (Error $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } echo "done\n"; ?> --EXPECT-- -Trying to clone an uncloneable object of class Io\Poll\Context -Trying to clone an uncloneable object of class StreamPollHandle -Trying to clone an uncloneable object of class Io\Poll\Watcher +Error: Trying to clone an uncloneable object of class Io\Poll\Context +Error: Trying to clone an uncloneable object of class StreamPollHandle +Error: Trying to clone an uncloneable object of class Io\Poll\Watcher done diff --git a/ext/standard/tests/poll/poll_ctx_backend_unix.phpt b/ext/standard/tests/poll/poll_ctx_backend_unix.phpt index 89f4f3eea10a..35007cec6e9a 100644 --- a/ext/standard/tests/poll/poll_ctx_backend_unix.phpt +++ b/ext/standard/tests/poll/poll_ctx_backend_unix.phpt @@ -18,11 +18,11 @@ $backend = $poll_ctx->getBackend(); var_dump($backend->name); try { new Io\Poll\Context(Io\Poll\Backend::WSAPoll); -} catch (\Io\Poll\BackendUnavailableException $e) { - var_dump($e->getMessage()); +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- enum(Io\Poll\Backend::%s) string(4) "Poll" -string(29) "Backend WSAPoll not available" +Io\Poll\BackendUnavailableException: Backend WSAPoll not available diff --git a/ext/standard/tests/poll/poll_double_construct.phpt b/ext/standard/tests/poll/poll_double_construct.phpt index 1fa5b65db38d..9378da372cfe 100644 --- a/ext/standard/tests/poll/poll_double_construct.phpt +++ b/ext/standard/tests/poll/poll_double_construct.phpt @@ -9,20 +9,20 @@ list($r, $w) = pt_new_socket_pair(); $handle = new StreamPollHandle($r); try { $handle->__construct($r); -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $ctx = pt_new_stream_poll(); try { $ctx->__construct(); -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "done\n"; ?> --EXPECT-- -StreamPollHandle object is already constructed -Io\Poll\Context object is already constructed +Error: StreamPollHandle object is already constructed +Error: Io\Poll\Context object is already constructed done diff --git a/ext/standard/tests/poll/poll_stream_add_error_duplicate.phpt b/ext/standard/tests/poll/poll_stream_add_error_duplicate.phpt index 8753cad7eb8e..f1c588379a35 100644 --- a/ext/standard/tests/poll/poll_stream_add_error_duplicate.phpt +++ b/ext/standard/tests/poll/poll_stream_add_error_duplicate.phpt @@ -11,9 +11,9 @@ pt_stream_poll_add($poll_ctx, $socket1w, [Io\Poll\Event::Write], "socket2_data") try { pt_stream_poll_add($poll_ctx, $socket1w, [Io\Poll\Event::Write], "socket2_data"); -} catch (Io\Poll\HandleAlreadyWatchedException $e) { - echo "ERROR: " . $e->getMessage() . "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -ERROR: Handle already added +Io\Poll\HandleAlreadyWatchedException: Handle already added diff --git a/ext/standard/tests/poll/poll_watcher_outlives_context.phpt b/ext/standard/tests/poll/poll_watcher_outlives_context.phpt index 2c058d5b8966..897f606f1b11 100644 --- a/ext/standard/tests/poll/poll_watcher_outlives_context.phpt +++ b/ext/standard/tests/poll/poll_watcher_outlives_context.phpt @@ -16,20 +16,20 @@ var_dump($watcher->isActive()); try { $watcher->remove(); -} catch (Io\Poll\InactiveWatcherException $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $watcher->modifyEvents([Io\Poll\Event::Write]); -} catch (Io\Poll\InactiveWatcherException $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "done\n"; ?> --EXPECT-- bool(false) -Cannot remove inactive watcher -Cannot modify inactive watcher +Io\Poll\InactiveWatcherException: Cannot remove inactive watcher +Io\Poll\InactiveWatcherException: Cannot modify inactive watcher done diff --git a/ext/standard/tests/serialize/__serialize_002.phpt b/ext/standard/tests/serialize/__serialize_002.phpt index 72851eed4bc9..c72466bab422 100644 --- a/ext/standard/tests/serialize/__serialize_002.phpt +++ b/ext/standard/tests/serialize/__serialize_002.phpt @@ -11,10 +11,10 @@ class Test { try { serialize(new Test); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Test::__serialize() must return an array +TypeError: Test::__serialize() must return an array diff --git a/ext/standard/tests/serialize/__serialize_007.phpt b/ext/standard/tests/serialize/__serialize_007.phpt index 32cad44dba9e..7e20a17c6494 100644 --- a/ext/standard/tests/serialize/__serialize_007.phpt +++ b/ext/standard/tests/serialize/__serialize_007.phpt @@ -6,10 +6,10 @@ No packed -> mixed reallocation while populating __unserialize() array $payload = 'O:13:"ArrayIterator":2:{i:0;i:0;s:1:"x";R:2;}'; try { var_dump(unserialize($payload)); -} catch (Exception $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Incomplete or ill-typed serialization data +UnexpectedValueException: Incomplete or ill-typed serialization data diff --git a/ext/standard/tests/serialize/bug64354_1.phpt b/ext/standard/tests/serialize/bug64354_1.phpt index 499b66466f03..82ade85ea122 100644 --- a/ext/standard/tests/serialize/bug64354_1.phpt +++ b/ext/standard/tests/serialize/bug64354_1.phpt @@ -10,16 +10,16 @@ spl_autoload_register( try { var_dump(unserialize('O:1:"A":0:{}')); -} catch (Exception $e) { - var_dump($e->getMessage()); +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(unserialize('a:2:{i:0;O:1:"A":0:{}i:1;O:1:"A":0:{}}')); -} catch (Exception $e) { - var_dump($e->getMessage()); +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -string(6) "Failed" -string(6) "Failed" +Exception: Failed +Exception: Failed diff --git a/ext/standard/tests/serialize/bug64354_2.phpt b/ext/standard/tests/serialize/bug64354_2.phpt index 675305132157..ed183ee869a4 100644 --- a/ext/standard/tests/serialize/bug64354_2.phpt +++ b/ext/standard/tests/serialize/bug64354_2.phpt @@ -16,9 +16,9 @@ spl_autoload_register( try { var_dump(unserialize('a:2:{i:0;O:1:"A":0:{}i:1;O:1:"B":0:{}}')); -} catch (Exception $e) { - var_dump($e->getMessage()); +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -string(6) "Failed" +Exception: Failed diff --git a/ext/standard/tests/serialize/bug64354_3.phpt b/ext/standard/tests/serialize/bug64354_3.phpt index e3832e653bbf..0f6ae36e422b 100644 --- a/ext/standard/tests/serialize/bug64354_3.phpt +++ b/ext/standard/tests/serialize/bug64354_3.phpt @@ -21,10 +21,10 @@ $data = array(new A, new B); try { serialize($data); -} catch (Exception $e) { - var_dump($e->getMessage()); +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Deprecated: %s implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d -string(6) "Failed" +Exception: Failed diff --git a/ext/standard/tests/serialize/bug73341.phpt b/ext/standard/tests/serialize/bug73341.phpt index 460575c0a065..d9f7bb886379 100644 --- a/ext/standard/tests/serialize/bug73341.phpt +++ b/ext/standard/tests/serialize/bug73341.phpt @@ -5,29 +5,29 @@ Bug #73144 (Use-afte-free in ArrayObject Deserialization) try { $token = 'a:2:{i:0;O:1:"0":2:{s:1:"0";i:0;s:1:"0";a:1:{i:0;C:11:"ArrayObject":7:{x:i:0;r}'; $obj = unserialize($token); -} catch(Exception $e) { - echo $e->getMessage()."\n"; +} catch(Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $token = 'a:2:{i:0;O:1:"0":2:0s:1:"0";i:0;s:1:"0";a:1:{i:0;C:11:"ArrayObject":7:{x:i:0;r}'; $obj = unserialize($token); -} catch(Exception $e) { - echo $e->getMessage()."\n"; +} catch(Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $inner = 'x:i:1;O:8:"stdClass":1:{};m:a:0:{}'; $exploit = 'C:11:"ArrayObject":'.strlen($inner).':{'.$inner.'}'; unserialize($exploit); -} catch(Exception $e) { - echo $e->getMessage()."\n"; +} catch(Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -Error at offset 6 of 7 bytes +UnexpectedValueException: Error at offset 6 of 7 bytes Warning: unserialize(): Error at offset 19 of 79 bytes in %s on line %d Warning: ArrayObject::unserialize(): Unexpected end of serialized data in %sbug73341.php on line %d -Error at offset 24 of 34 bytes +UnexpectedValueException: Error at offset 24 of 34 bytes diff --git a/ext/standard/tests/serialize/bug81111.phpt b/ext/standard/tests/serialize/bug81111.phpt index aa5002eaf704..5a004476abb9 100644 --- a/ext/standard/tests/serialize/bug81111.phpt +++ b/ext/standard/tests/serialize/bug81111.phpt @@ -10,8 +10,8 @@ class MySplFileInfo extends SplFileInfo { try { serialize(new MySplFileInfo(__FILE__)); -} catch (Exception $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $anon = new class () { @@ -21,33 +21,33 @@ $anon = new class () { try { serialize($anon); -} catch (Exception $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize("O:13:\"MySplFileInfo\":0:{}"); -} catch (Exception $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize("C:13:\"MySplFileInfo\":0:{}"); -} catch (Exception $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $name = $anon::class; try { unserialize("O:" . strlen($name) . ":\"" . $name . "\":0:{}"); -} catch (Exception $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -Serialization of 'MySplFileInfo' is not allowed -Serialization of 'class@anonymous' is not allowed -Unserialization of 'MySplFileInfo' is not allowed -Unserialization of 'MySplFileInfo' is not allowed +Exception: Serialization of 'MySplFileInfo' is not allowed +Exception: Serialization of 'class@anonymous' is not allowed +Exception: Unserialization of 'MySplFileInfo' is not allowed +Exception: Unserialization of 'MySplFileInfo' is not allowed Warning: unserialize(): Error at offset 0 of %d bytes in %s on line %d diff --git a/ext/standard/tests/serialize/gh15169.phpt b/ext/standard/tests/serialize/gh15169.phpt index 19c1415b05c8..8f1135b7e379 100644 --- a/ext/standard/tests/serialize/gh15169.phpt +++ b/ext/standard/tests/serialize/gh15169.phpt @@ -27,8 +27,8 @@ for ($i = 0; $i < 30000; $i++) { try { serialize($firstNode); -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } while ($next = $firstNode->next) { @@ -37,4 +37,4 @@ while ($next = $firstNode->next) { ?> --EXPECTF-- -Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? +Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? diff --git a/ext/standard/tests/serialize/incomplete_class.phpt b/ext/standard/tests/serialize/incomplete_class.phpt index 2ead760508cf..57f2b413cb64 100644 --- a/ext/standard/tests/serialize/incomplete_class.phpt +++ b/ext/standard/tests/serialize/incomplete_class.phpt @@ -9,8 +9,8 @@ var_dump($o); try { $o->test = "a"; -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($o->test); var_dump($o->test2); @@ -20,7 +20,7 @@ echo "Done\n"; --EXPECTF-- object(__PHP_Incomplete_Class)#%d (0) { } -The script tried to modify a property on an incomplete object. Please ensure that the class definition "unknown" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition +Error: The script tried to modify a property on an incomplete object. Please ensure that the class definition "unknown" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "unknown" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d NULL diff --git a/ext/standard/tests/serialize/max_depth.phpt b/ext/standard/tests/serialize/max_depth.phpt index 09418e5c61da..2a26a095d0db 100644 --- a/ext/standard/tests/serialize/max_depth.phpt +++ b/ext/standard/tests/serialize/max_depth.phpt @@ -14,14 +14,14 @@ function create_nested_data($depth, $prefix, $suffix, $inner = 'i:0;') { echo "Invalid max_depth:\n"; try { unserialize('i:0;', ['max_depth' => 'foo']); -} catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { unserialize('i:0;', ['max_depth' => -1]); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Array:\n"; @@ -108,8 +108,8 @@ var_dump(is_array(unserialize( ?> --EXPECTF-- Invalid max_depth: -unserialize(): Option "max_depth" must be of type int, string given -unserialize(): Option "max_depth" must be greater than or equal to 0 +TypeError: unserialize(): Option "max_depth" must be of type int, string given +ValueError: unserialize(): Option "max_depth" must be greater than or equal to 0 Array: bool(true) diff --git a/ext/standard/tests/serialize/serialization_objects_005.phpt b/ext/standard/tests/serialize/serialization_objects_005.phpt index e38ead00695c..839e2f74f808 100644 --- a/ext/standard/tests/serialize/serialization_objects_005.phpt +++ b/ext/standard/tests/serialize/serialization_objects_005.phpt @@ -37,37 +37,37 @@ var_dump($incomplete->p); try { $ref2 = "ref1.original"; $incomplete->p = &$ref2; -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($incomplete->p); $ref2 = "ref1.changed"; var_dump($incomplete->p); try { $incomplete->p = "p.changed"; -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($ref1); var_dump(isset($incomplete->x)); try { $incomplete->x = "x.new"; -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(isset($incomplete->x)); try { unset($incomplete->x); -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($incomplete->x); try { $incomplete->f(); -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done"; @@ -101,25 +101,25 @@ bool(true) Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d NULL -The script tried to modify a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition +Error: The script tried to modify a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d NULL Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d NULL -The script tried to modify a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition +Error: The script tried to modify a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition string(9) "p.changed" Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d bool(false) -The script tried to modify a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition +Error: The script tried to modify a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d bool(false) -The script tried to modify a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition +Error: The script tried to modify a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d NULL -The script tried to call a method on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition +Error: The script tried to call a method on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition Done diff --git a/ext/standard/tests/serialize/serialization_objects_010.phpt b/ext/standard/tests/serialize/serialization_objects_010.phpt index bf980325945e..35e5fff0e92d 100644 --- a/ext/standard/tests/serialize/serialization_objects_010.phpt +++ b/ext/standard/tests/serialize/serialization_objects_010.phpt @@ -13,13 +13,13 @@ Class C implements Serializable { try { var_dump(serialize(new C)); -} catch (Exception $e) { - echo $e->getMessage(). "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done"; ?> --EXPECTF-- Deprecated: %s implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d -C::serialize() must return a string or NULL +Exception: C::serialize() must return a string or NULL Done diff --git a/ext/standard/tests/serialize/splobjectstorage_negative_count.phpt b/ext/standard/tests/serialize/splobjectstorage_negative_count.phpt index ef2f575d5814..800687152221 100644 --- a/ext/standard/tests/serialize/splobjectstorage_negative_count.phpt +++ b/ext/standard/tests/serialize/splobjectstorage_negative_count.phpt @@ -8,10 +8,10 @@ OSS-Fuzz: Unserializing SplObjectStorage with negative number of elements $str = 'C:16:"SplObjectStorage":25:{x:i:-9223372036854775808;}'; try { var_dump(unserialize($str)); -} catch (Exception $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Error at offset 24 of 25 bytes +UnexpectedValueException: Error at offset 24 of 25 bytes diff --git a/ext/standard/tests/serialize/typed_property_ref_assignment_failure.phpt b/ext/standard/tests/serialize/typed_property_ref_assignment_failure.phpt index 0e41ee82a5f5..dbfe89c2354e 100644 --- a/ext/standard/tests/serialize/typed_property_ref_assignment_failure.phpt +++ b/ext/standard/tests/serialize/typed_property_ref_assignment_failure.phpt @@ -12,8 +12,8 @@ O:4:"Test":1:{s:4:"prop";O:8:"stdClass":1:{s:1:"y";R:2;}} STR; try { var_dump(unserialize($s)); -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $s = <<<'STR' @@ -23,7 +23,7 @@ var_dump(unserialize($s)); ?> --EXPECTF-- -Cannot assign stdClass to property Test::$prop of type int +TypeError: Cannot assign stdClass to property Test::$prop of type int Warning: unserialize(): Error at offset 38 of 38 bytes in %s on line %d bool(false) diff --git a/ext/standard/tests/serialize/typed_property_refs.phpt b/ext/standard/tests/serialize/typed_property_refs.phpt index 9c71d460c2cc..e40c33bbafe1 100644 --- a/ext/standard/tests/serialize/typed_property_refs.phpt +++ b/ext/standard/tests/serialize/typed_property_refs.phpt @@ -34,28 +34,28 @@ var_dump(unserialize('O:1:"E":2:{s:1:"a";i:1;s:1:"b";R:2;}')); try { var_dump(unserialize('O:1:"A":2:{s:1:"a";N;s:1:"b";R:2;}')); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(unserialize('O:1:"B":2:{s:1:"a";N;s:1:"b";R:2;}')); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(unserialize('O:1:"C":2:{s:1:"a";i:1;s:1:"b";R:2;}')); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(unserialize('O:1:"C":2:{s:1:"b";s:1:"x";s:1:"a";R:2;}')); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(unserialize('O:1:"D":2:{s:1:"a";i:1;s:1:"b";R:2;}')); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -78,8 +78,8 @@ object(E)#1 (2) { ["b"]=> &int(1) } -Cannot assign null to property A::$a of type int -Cannot assign null to property B::$b of type int -Cannot assign int to property C::$b of type string -Cannot assign string to property C::$a of type int -Reference with value of type int held by property D::$a of type int is not compatible with property D::$b of type float +TypeError: Cannot assign null to property A::$a of type int +TypeError: Cannot assign null to property B::$b of type int +TypeError: Cannot assign int to property C::$b of type string +TypeError: Cannot assign string to property C::$a of type int +TypeError: Reference with value of type int held by property D::$a of type int is not compatible with property D::$b of type float diff --git a/ext/standard/tests/serialize/unserialize_abstract_class.phpt b/ext/standard/tests/serialize/unserialize_abstract_class.phpt index e835e5046693..e32d49315b16 100644 --- a/ext/standard/tests/serialize/unserialize_abstract_class.phpt +++ b/ext/standard/tests/serialize/unserialize_abstract_class.phpt @@ -6,10 +6,10 @@ Unserializing an abstract class should fail $payload = 'O:23:"RecursiveFilterIterator":0:{}'; try { var_dump(unserialize($payload)); -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot instantiate abstract class RecursiveFilterIterator +Error: Cannot instantiate abstract class RecursiveFilterIterator diff --git a/ext/standard/tests/serialize/unserialize_allowed_classes_option_invalid_value.phpt b/ext/standard/tests/serialize/unserialize_allowed_classes_option_invalid_value.phpt index f390c36a78fe..cd1404099f45 100644 --- a/ext/standard/tests/serialize/unserialize_allowed_classes_option_invalid_value.phpt +++ b/ext/standard/tests/serialize/unserialize_allowed_classes_option_invalid_value.phpt @@ -10,25 +10,25 @@ $s = serialize($z); try { unserialize($s, ["allowed_classes" => null]); -} catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { unserialize($s, ["allowed_classes" => 0]); -} catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { unserialize($s, ["allowed_classes" => 1]); -} catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -unserialize(): Option "allowed_classes" must be of type array|bool, null given -unserialize(): Option "allowed_classes" must be of type array|bool, int given -unserialize(): Option "allowed_classes" must be of type array|bool, int given +TypeError: unserialize(): Option "allowed_classes" must be of type array|bool, null given +TypeError: unserialize(): Option "allowed_classes" must be of type array|bool, int given +TypeError: unserialize(): Option "allowed_classes" must be of type array|bool, int given diff --git a/ext/standard/tests/serialize/unserialize_callback_func/non_existing.phpt b/ext/standard/tests/serialize/unserialize_callback_func/non_existing.phpt index 650ba56330d4..7f5964c5c39a 100644 --- a/ext/standard/tests/serialize/unserialize_callback_func/non_existing.phpt +++ b/ext/standard/tests/serialize/unserialize_callback_func/non_existing.phpt @@ -5,9 +5,9 @@ Bad unserialize_callback_func ini_set('unserialize_callback_func','Nonexistent'); try { unserialize('O:3:"FOO":0:{}'); -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Invalid callback Nonexistent, function "Nonexistent" not found or invalid function name +Error: Invalid callback Nonexistent, function "Nonexistent" not found or invalid function name diff --git a/ext/standard/tests/serialize/unserialize_leak.phpt b/ext/standard/tests/serialize/unserialize_leak.phpt index bbc4bb6facae..d58ebba301f6 100644 --- a/ext/standard/tests/serialize/unserialize_leak.phpt +++ b/ext/standard/tests/serialize/unserialize_leak.phpt @@ -6,11 +6,11 @@ Unserialize leak in SplObjectStorage $payload = 'C:16:"SplObjectStorage":113:{x:i:2;O:8:"stdClass":1:{},a:2:{s:4:"prev";i:2;s:4:"next";O:8:"stdClass":0:{}};r:7;,R:2;s:4:"next";;r:3;};m:a:0:{}}'; try { var_dump(unserialize($payload)); -} catch (Exception $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Warning: SplObjectStorage::unserialize(): Unexpected end of serialized data in %s on line %d -Error at offset 24 of 113 bytes +UnexpectedValueException: Error at offset 24 of 113 bytes diff --git a/ext/standard/tests/setcookie_samesite_validation.phpt b/ext/standard/tests/setcookie_samesite_validation.phpt index 3827f04fe8d4..4dc2be18b6ce 100644 --- a/ext/standard/tests/setcookie_samesite_validation.phpt +++ b/ext/standard/tests/setcookie_samesite_validation.phpt @@ -21,20 +21,20 @@ var_dump(setrawcookie('test', 'value', ['samesite' => 'Lax'])); // Invalid values try { setcookie('test', 'value', ['samesite' => 'Invalid']); -} catch (ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setcookie('test', 'value', ['samesite' => "Strict\r\nX-Injected: evil"]); -} catch (ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setrawcookie('test', 'value', ['samesite' => 'Invalid']); -} catch (ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -47,6 +47,6 @@ bool(true) bool(true) bool(true) bool(true) -setcookie(): "samesite" option must be "Strict", "Lax", "None", or "" -setcookie(): "samesite" option must be "Strict", "Lax", "None", or "" -setrawcookie(): "samesite" option must be "Strict", "Lax", "None", or "" +ValueError: setcookie(): "samesite" option must be "Strict", "Lax", "None", or "" +ValueError: setcookie(): "samesite" option must be "Strict", "Lax", "None", or "" +ValueError: setrawcookie(): "samesite" option must be "Strict", "Lax", "None", or "" diff --git a/ext/standard/tests/streams/bug44712.phpt b/ext/standard/tests/streams/bug44712.phpt index 04b7e5ce4092..94ba0e55e015 100644 --- a/ext/standard/tests/streams/bug44712.phpt +++ b/ext/standard/tests/streams/bug44712.phpt @@ -5,9 +5,9 @@ bug#44712 (stream_context_set_params segfaults on invalid arguments) $ctx = stream_context_get_default(); try { stream_context_set_params($ctx, array("options" => 1)); -} catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Invalid stream/context parameter +TypeError: Invalid stream/context parameter diff --git a/ext/standard/tests/streams/bug54623.phpt b/ext/standard/tests/streams/bug54623.phpt index d7383fcc8f7e..c1ca5ee0972e 100644 --- a/ext/standard/tests/streams/bug54623.phpt +++ b/ext/standard/tests/streams/bug54623.phpt @@ -11,11 +11,11 @@ var_dump((int)$sock2); fclose($sock2); try { fwrite($sock, "3"); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- int(%d) int(%d) -fwrite(): Argument #1 ($stream) must be an open stream resource +TypeError: fwrite(): Argument #1 ($stream) must be an open stream resource diff --git a/ext/standard/tests/streams/bug61115.phpt b/ext/standard/tests/streams/bug61115.phpt index 9dfc27a9438d..b268df4a1456 100644 --- a/ext/standard/tests/streams/bug61115.phpt +++ b/ext/standard/tests/streams/bug61115.phpt @@ -9,9 +9,9 @@ $resourceFileTemp = fopen('php://temp', 'r+'); stream_context_set_params($resourceFileTemp, array()); try { preg_replace('', function() {}, $resourceFileTemp); -} catch (\TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -preg_replace(): Argument #2 ($replacement) must be of type array|string, Closure given +TypeError: preg_replace(): Argument #2 ($replacement) must be of type array|string, Closure given diff --git a/ext/standard/tests/streams/bug67626.phpt b/ext/standard/tests/streams/bug67626.phpt index 54be1b51130e..c7e5764977f5 100644 --- a/ext/standard/tests/streams/bug67626.phpt +++ b/ext/standard/tests/streams/bug67626.phpt @@ -32,16 +32,16 @@ $fp = fopen('my://foobar', 'r+'); try { fread($fp, 42); -} catch (Exception $e) { - echo $e->getMessage(); +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } -echo "\n"; + try { fwrite($fp, 'foobar'); -} catch (Exception $e) { - echo $e->getMessage(); +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -stream_read_exception -stream_write_exception +Exception: stream_read_exception +Exception: stream_write_exception diff --git a/ext/standard/tests/streams/bug71884.phpt b/ext/standard/tests/streams/bug71884.phpt index 3c5f841b3d3d..32a457d56d90 100644 --- a/ext/standard/tests/streams/bug71884.phpt +++ b/ext/standard/tests/streams/bug71884.phpt @@ -6,9 +6,9 @@ $arr=array(); $arr[0]['A']=0; try { stream_context_get_default($arr); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Options should have the form ["wrappername"]["optionname"] = $value +ValueError: Options should have the form ["wrappername"]["optionname"] = $value diff --git a/ext/standard/tests/streams/bug74951.phpt b/ext/standard/tests/streams/bug74951.phpt index 2668f541fb3c..b982e5af49ea 100644 --- a/ext/standard/tests/streams/bug74951.phpt +++ b/ext/standard/tests/streams/bug74951.phpt @@ -10,7 +10,7 @@ trait Stream00ploiter{ try { stream_wrapper_register('e0ploit','Stream00ploiter'); } catch (\Throwable $e) { - echo $e::class, ': ', $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/streams/bug76857.phpt b/ext/standard/tests/streams/bug76857.phpt index efc549e683a9..6f4e10515b12 100644 --- a/ext/standard/tests/streams/bug76857.phpt +++ b/ext/standard/tests/streams/bug76857.phpt @@ -17,4 +17,4 @@ string(9) "test data" --CLEAN-- \ No newline at end of file +?> diff --git a/ext/standard/tests/streams/gh14506.phpt b/ext/standard/tests/streams/gh14506.phpt index 3d82350221d5..76d4701160fa 100644 --- a/ext/standard/tests/streams/gh14506.phpt +++ b/ext/standard/tests/streams/gh14506.phpt @@ -64,14 +64,14 @@ $streams = [$readStream]; $empty = []; try { stream_select($streams, $streams,$empty, 0); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } fflush($readStream); try { fclose($readStream); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -91,5 +91,5 @@ Warning: fclose(): cannot close the provided stream, as it must not be manually Warning: stream_select(): Cannot represent a stream of type user-space as a select()able descriptor in %s on line %d Warning: stream_select(): Cannot represent a stream of type user-space as a select()able descriptor in %s on line %d -No stream arrays were passed -fclose(): Argument #1 ($stream) must be an open stream resource +ValueError: No stream arrays were passed +TypeError: fclose(): Argument #1 ($stream) must be an open stream resource diff --git a/ext/standard/tests/streams/gh14780.phpt b/ext/standard/tests/streams/gh14780.phpt index 064e496b1753..b04f3c2bfde4 100644 --- a/ext/standard/tests/streams/gh14780.phpt +++ b/ext/standard/tests/streams/gh14780.phpt @@ -10,29 +10,29 @@ $code = null; $err = null; try { pfsockopen('udp://127.0.0.1', '63844', $code, $err, (PHP_INT_MAX/100000)+1); -} catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { pfsockopen('udp://127.0.0.1', '63844', $code, $err, (PHP_INT_MIN/100000)-1); -} catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(pfsockopen('udp://127.0.0.1', '63844', $code, $err, -1)); try { pfsockopen('udp://127.0.0.1', '63844', $code, $err, NAN); -} catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { pfsockopen('udp://127.0.0.1', '63844', $code, $err, INF); -} catch (\ValueError $e) { - echo $e->getMessage(); +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -pfsockopen(): Argument #6 must be -1 or between 0 and %s -pfsockopen(): Argument #6 must be -1 or between 0 and %s +ValueError: pfsockopen(): Argument #6 must be -1 or between 0 and %s +ValueError: pfsockopen(): Argument #6 must be -1 or between 0 and %s resource(%d) of type (persistent stream) -pfsockopen(): Argument #6 must be -1 or between 0 and %s -pfsockopen(): Argument #6 must be -1 or between 0 and %s +ValueError: pfsockopen(): Argument #6 must be -1 or between 0 and %s +ValueError: pfsockopen(): Argument #6 must be -1 or between 0 and %s diff --git a/ext/standard/tests/streams/gh15908.phpt b/ext/standard/tests/streams/gh15908.phpt index 31714b20530a..38c01727b796 100644 --- a/ext/standard/tests/streams/gh15908.phpt +++ b/ext/standard/tests/streams/gh15908.phpt @@ -26,8 +26,8 @@ stream_wrapper_register("test", "TestStream"); $f = fopen("test://", "r"); try { file_put_contents(__DIR__."/gh15908.tmp", $f, FILE_USE_INCLUDE_PATH, $f); -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -35,4 +35,4 @@ try { @unlink(__DIR__."/gh15908.tmp"); ?> --EXPECT-- -file_put_contents(): supplied resource is not a valid Stream-Context resource +TypeError: file_put_contents(): supplied resource is not a valid Stream-Context resource diff --git a/ext/standard/tests/streams/non_finite_values.phpt b/ext/standard/tests/streams/non_finite_values.phpt index 5dba0d3b4826..76a66878a4ab 100644 --- a/ext/standard/tests/streams/non_finite_values.phpt +++ b/ext/standard/tests/streams/non_finite_values.phpt @@ -6,8 +6,8 @@ $socket = stream_socket_server("tcp://0.0.0.0:14781", $errno, $errstr); foreach ([NAN, -NAN, INF, -INF] as $value) { try { stream_socket_accept($socket, $value); - } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } fclose($socket); @@ -15,17 +15,17 @@ fclose($socket); foreach ([NAN, -NAN, INF, -INF] as $value) { try { stream_socket_client("tcp://0.0.0.0:14781", timeout: $value); - } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> --EXPECT-- -stream_socket_accept(): Argument #2 ($timeout) must be a finite value -stream_socket_accept(): Argument #2 ($timeout) must be a finite value -stream_socket_accept(): Argument #2 ($timeout) must be a finite value -stream_socket_accept(): Argument #2 ($timeout) must be a finite value -stream_socket_client(): Argument #4 ($timeout) must be a finite value -stream_socket_client(): Argument #4 ($timeout) must be a finite value -stream_socket_client(): Argument #4 ($timeout) must be a finite value -stream_socket_client(): Argument #4 ($timeout) must be a finite value +ValueError: stream_socket_accept(): Argument #2 ($timeout) must be a finite value +ValueError: stream_socket_accept(): Argument #2 ($timeout) must be a finite value +ValueError: stream_socket_accept(): Argument #2 ($timeout) must be a finite value +ValueError: stream_socket_accept(): Argument #2 ($timeout) must be a finite value +ValueError: stream_socket_client(): Argument #4 ($timeout) must be a finite value +ValueError: stream_socket_client(): Argument #4 ($timeout) must be a finite value +ValueError: stream_socket_client(): Argument #4 ($timeout) must be a finite value +ValueError: stream_socket_client(): Argument #4 ($timeout) must be a finite value diff --git a/ext/standard/tests/streams/stream_context_create_error.phpt b/ext/standard/tests/streams/stream_context_create_error.phpt index 0789fa34869b..871f9dd10b01 100644 --- a/ext/standard/tests/streams/stream_context_create_error.phpt +++ b/ext/standard/tests/streams/stream_context_create_error.phpt @@ -4,23 +4,23 @@ Test the error cases of stream_context_create() "abc"]); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { stream_context_create(['ssl' => ['verify_peer'=> false]], ["options" => ['ssl' => "abc"]]); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { stream_context_create(['ssl' => ['verify_peer'=> false]], ["options" => false]); -} catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Options should have the form ["wrappername"]["optionname"] = $value -Options should have the form ["wrappername"]["optionname"] = $value -Invalid stream/context parameter +ValueError: Options should have the form ["wrappername"]["optionname"] = $value +ValueError: Options should have the form ["wrappername"]["optionname"] = $value +TypeError: Invalid stream/context parameter diff --git a/ext/standard/tests/streams/stream_context_set_option_error.phpt b/ext/standard/tests/streams/stream_context_set_option_error.phpt index e52bb882f662..23f12f7a84c4 100644 --- a/ext/standard/tests/streams/stream_context_set_option_error.phpt +++ b/ext/standard/tests/streams/stream_context_set_option_error.phpt @@ -6,30 +6,30 @@ stream_context_set_option() error conditions $ctx = stream_context_create(); try { stream_context_set_option($ctx, [], "x"); -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { stream_context_set_option($ctx, [], null, "x"); -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { stream_context_set_option($ctx, "x"); -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { stream_context_set_option($ctx, "x", "y"); -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -stream_context_set_option(): Argument #3 ($option_name) must be null when argument #2 ($wrapper_or_options) is an array -stream_context_set_option(): Argument #4 ($value) cannot be provided when argument #2 ($wrapper_or_options) is an array +ValueError: stream_context_set_option(): Argument #3 ($option_name) must be null when argument #2 ($wrapper_or_options) is an array +ValueError: stream_context_set_option(): Argument #4 ($value) cannot be provided when argument #2 ($wrapper_or_options) is an array Deprecated: Calling stream_context_set_option() with 2 arguments is deprecated, use stream_context_set_options() instead in %s on line %d -stream_context_set_option(): Argument #3 ($option_name) cannot be null when argument #2 ($wrapper_or_options) is a string -stream_context_set_option(): Argument #4 ($value) must be provided when argument #2 ($wrapper_or_options) is a string +ValueError: stream_context_set_option(): Argument #3 ($option_name) cannot be null when argument #2 ($wrapper_or_options) is a string +ValueError: stream_context_set_option(): Argument #4 ($value) must be provided when argument #2 ($wrapper_or_options) is a string diff --git a/ext/standard/tests/streams/stream_context_set_options_error.phpt b/ext/standard/tests/streams/stream_context_set_options_error.phpt index b047e14f1336..3fbdb92dec65 100644 --- a/ext/standard/tests/streams/stream_context_set_options_error.phpt +++ b/ext/standard/tests/streams/stream_context_set_options_error.phpt @@ -13,9 +13,9 @@ $process = proc_open('nothing', $description, $pipes); try { stream_context_set_options($process, []); -} catch (TypeError $e) { - echo $e->getMessage(); +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -stream_context_set_options(): Argument #1 ($context) must be a valid stream/context +TypeError: stream_context_set_options(): Argument #1 ($context) must be a valid stream/context diff --git a/ext/standard/tests/streams/stream_context_tcp_nodelay_server.phpt b/ext/standard/tests/streams/stream_context_tcp_nodelay_server.phpt index e20e294180cc..d25223b34db2 100644 --- a/ext/standard/tests/streams/stream_context_tcp_nodelay_server.phpt +++ b/ext/standard/tests/streams/stream_context_tcp_nodelay_server.phpt @@ -37,4 +37,3 @@ ServerClientTestCase::getInstance()->run($clientCode, $serverCode); ?> --EXPECTF-- server-delay:conn-nodelay - diff --git a/ext/standard/tests/streams/stream_errors_exception_mode_terminal.phpt b/ext/standard/tests/streams/stream_errors_exception_mode_terminal.phpt index 6f470c61d1a1..f4d7b745c64d 100644 --- a/ext/standard/tests/streams/stream_errors_exception_mode_terminal.phpt +++ b/ext/standard/tests/streams/stream_errors_exception_mode_terminal.phpt @@ -11,8 +11,8 @@ $context = stream_context_create([ try { $stream = fopen('php://nonexistent', 'r', false, $context); -} catch (StreamException $e) { - echo "Caught: " . $e->getMessage() . "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; echo "Code: " . $e->getCode() . "\n"; $errors = $e->getErrors(); @@ -25,7 +25,7 @@ try { ?> --EXPECTF-- -Caught: Failed to open stream: operation failed +StreamException: Failed to open stream: operation failed Code: 21 Wrapper: PHP Error code name: OpenFailed diff --git a/ext/standard/tests/streams/stream_errors_mix_modes_storage.phpt b/ext/standard/tests/streams/stream_errors_mix_modes_storage.phpt index 49c18616dad3..ea68cc0c52df 100644 --- a/ext/standard/tests/streams/stream_errors_mix_modes_storage.phpt +++ b/ext/standard/tests/streams/stream_errors_mix_modes_storage.phpt @@ -40,8 +40,8 @@ function stream_test_errors($title, $contextOptions) { $write = NULL; $except = NULL; stream_select($read, $write, $except, 0, 0, $context); - } catch (StreamException $e) { - echo 'EXCEPTION: ' . $e->getMessage() . "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $errors = stream_last_errors(); @@ -130,7 +130,7 @@ Error details: [1] CastNotSupported: Cannot represent a stream of type user-space as a select()able descriptor AUTO EXCEPTION -EXCEPTION: TestStream::stream_cast is not implemented! +StreamException: TestStream::stream_cast is not implemented! Error details: - Message: TestStream::stream_read - read 10 bytes more data than requested (8202 read, 8192 max) - excess data will be lost - Code: UserspaceInvalidReturn diff --git a/ext/standard/tests/streams/stream_errors_set_default_context_error.phpt b/ext/standard/tests/streams/stream_errors_set_default_context_error.phpt index 46fc0f7fd34b..c76897b00aff 100644 --- a/ext/standard/tests/streams/stream_errors_set_default_context_error.phpt +++ b/ext/standard/tests/streams/stream_errors_set_default_context_error.phpt @@ -9,10 +9,10 @@ try { 'error_mode' => StreamErrorMode::Exception, ] ]); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Stream error handling options cannot be set on the default context +ValueError: Stream error handling options cannot be set on the default context diff --git a/ext/standard/tests/streams/stream_get_contents_negative_length.phpt b/ext/standard/tests/streams/stream_get_contents_negative_length.phpt index a12b98422c30..7930b8f92984 100644 --- a/ext/standard/tests/streams/stream_get_contents_negative_length.phpt +++ b/ext/standard/tests/streams/stream_get_contents_negative_length.phpt @@ -9,11 +9,11 @@ var_dump(stream_get_contents($tmp, 2, 1)); try { stream_get_contents($tmp, -2); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- string(2) "bc" -stream_get_contents(): Argument #2 ($length) must be greater than or equal to -1 +ValueError: stream_get_contents(): Argument #2 ($length) must be greater than or equal to -1 diff --git a/ext/standard/tests/streams/stream_get_meta_data_file_error.phpt b/ext/standard/tests/streams/stream_get_meta_data_file_error.phpt index 55bdd1860a47..8a61a9fdd8f3 100644 --- a/ext/standard/tests/streams/stream_get_meta_data_file_error.phpt +++ b/ext/standard/tests/streams/stream_get_meta_data_file_error.phpt @@ -9,8 +9,8 @@ $fp = fopen(__FILE__, 'r'); fclose($fp); try { var_dump(stream_get_meta_data($fp)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done"; @@ -19,5 +19,5 @@ echo "Done"; *** Testing stream_get_meta_data() : error conditions *** -- Testing stream_get_meta_data() function with closed stream resource -- -stream_get_meta_data(): Argument #1 ($stream) must be an open stream resource +TypeError: stream_get_meta_data(): Argument #1 ($stream) must be an open stream resource Done diff --git a/ext/standard/tests/streams/stream_read_object_return.phpt b/ext/standard/tests/streams/stream_read_object_return.phpt index 08555bcc3a98..01733f31fc16 100644 --- a/ext/standard/tests/streams/stream_read_object_return.phpt +++ b/ext/standard/tests/streams/stream_read_object_return.phpt @@ -17,9 +17,9 @@ class MyStream { stream_wrapper_register('mystream', MyStream::class); try { var_dump(file_get_contents('mystream://')); -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string diff --git a/ext/standard/tests/streams/stream_set_chunk_size.phpt b/ext/standard/tests/streams/stream_set_chunk_size.phpt index 8bb5b46b7f94..4a6749b2de99 100644 --- a/ext/standard/tests/streams/stream_set_chunk_size.phpt +++ b/ext/standard/tests/streams/stream_set_chunk_size.phpt @@ -52,13 +52,13 @@ var_dump(strlen(fwrite($f, str_repeat('b', 250)))); echo "\nerror conditions\n"; try { stream_set_chunk_size($f, 0); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { stream_set_chunk_size($f, -1); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- @@ -90,5 +90,5 @@ write with size: 50 int(3) error conditions -stream_set_chunk_size(): Argument #2 ($size) must be greater than 0 -stream_set_chunk_size(): Argument #2 ($size) must be greater than 0 +ValueError: stream_set_chunk_size(): Argument #2 ($size) must be greater than 0 +ValueError: stream_set_chunk_size(): Argument #2 ($size) must be greater than 0 diff --git a/ext/standard/tests/streams/stream_set_timeout_error.phpt b/ext/standard/tests/streams/stream_set_timeout_error.phpt index 5567cb159914..ef0577eb4963 100644 --- a/ext/standard/tests/streams/stream_set_timeout_error.phpt +++ b/ext/standard/tests/streams/stream_set_timeout_error.phpt @@ -22,8 +22,8 @@ echo "\n-- Testing stream_set_timeout() function with a closed socket --\n"; fclose($client); try { var_dump( stream_set_timeout($client, $seconds) ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing stream_set_timeout() function with a stream that does not support timeouts --\n"; @@ -39,7 +39,7 @@ echo "Done"; *** Testing stream_set_timeout() : error conditions *** -- Testing stream_set_timeout() function with a closed socket -- -stream_set_timeout(): Argument #1 ($stream) must be an open stream resource +TypeError: stream_set_timeout(): Argument #1 ($stream) must be an open stream resource -- Testing stream_set_timeout() function with a stream that does not support timeouts -- bool(false) diff --git a/ext/standard/tests/strings/bug33605.phpt b/ext/standard/tests/strings/bug33605.phpt index 94b57b20dcd0..4c2439a8716b 100644 --- a/ext/standard/tests/strings/bug33605.phpt +++ b/ext/standard/tests/strings/bug33605.phpt @@ -4,10 +4,10 @@ Bug #33605 (substr_compare crashes) getMessage(); +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -substr_compare(): Argument #4 ($length) must be greater than or equal to 0 +ValueError: substr_compare(): Argument #4 ($length) must be greater than or equal to 0 diff --git a/ext/standard/tests/strings/bug36944.phpt b/ext/standard/tests/strings/bug36944.phpt index d77561249857..fe061a0ab871 100644 --- a/ext/standard/tests/strings/bug36944.phpt +++ b/ext/standard/tests/strings/bug36944.phpt @@ -5,25 +5,25 @@ Bug #36944 (strncmp & strncasecmp do not return false on negative string length) try { var_dump(strncmp("test ", "e", -1)); -} catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(strncmp("test ", "e", 10)); var_dump(strncmp("test ", "e", 0)); try { var_dump(strncasecmp("test ", "E", -1)); -} catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(strncasecmp("test ", "E", 10)); var_dump(strncasecmp("test ", "E", 0)); ?> --EXPECTF-- -strncmp(): Argument #3 ($length) must be greater than or equal to 0 +ValueError: strncmp(): Argument #3 ($length) must be greater than or equal to 0 int(%d) int(0) -strncasecmp(): Argument #3 ($length) must be greater than or equal to 0 +ValueError: strncasecmp(): Argument #3 ($length) must be greater than or equal to 0 int(%d) int(0) diff --git a/ext/standard/tests/strings/bug40754.phpt b/ext/standard/tests/strings/bug40754.phpt index 41032a9405f1..12ecc5c02e37 100644 --- a/ext/standard/tests/strings/bug40754.phpt +++ b/ext/standard/tests/strings/bug40754.phpt @@ -12,62 +12,62 @@ var_dump(strcspn("abcde", "abc", $v, $v)); try { var_dump(substr_count("abcde", "abc", $v, $v)); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { substr_compare("abcde", "abc", $v, $v); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { stripos("abcde", "abc", $v); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { substr_count("abcde", "abc", $v, 1); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { substr_count("abcde", "abc", 1, $v); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strpos("abcde", "abc", $v); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { stripos("abcde", "abc", $v); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strrpos("abcde", "abc", $v); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strripos("abcde", "abc", $v); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strripos("abcde", "abc", $v); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump(strncmp("abcde", "abc", $v)); @@ -80,16 +80,16 @@ string(4) "bcde" string(6) "abcdex" int(0) int(0) -substr_count(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -substr_compare(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -substr_count(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -substr_count(): Argument #4 ($length) must be contained in argument #1 ($haystack) -strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: substr_count(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: substr_compare(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: substr_count(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: substr_count(): Argument #4 ($length) must be contained in argument #1 ($haystack) +ValueError: strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) int(1) string(8) "abcdeabc" string(0) "" diff --git a/ext/standard/tests/strings/bug54322.phpt b/ext/standard/tests/strings/bug54322.phpt index 8f12cd80f7f8..69da00906bbd 100644 --- a/ext/standard/tests/strings/bug54322.phpt +++ b/ext/standard/tests/strings/bug54322.phpt @@ -4,9 +4,9 @@ Bug #54322: Null pointer deref in get_html_translation_table due to information 0); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -get_html_translation_table(): Argument #1 ($table) must be of type int, float given +TypeError: get_html_translation_table(): Argument #1 ($table) must be of type int, float given diff --git a/ext/standard/tests/strings/bug67249.phpt b/ext/standard/tests/strings/bug67249.phpt index a0e0843f4b19..2a68656e8711 100644 --- a/ext/standard/tests/strings/bug67249.phpt +++ b/ext/standard/tests/strings/bug67249.phpt @@ -4,9 +4,9 @@ Bug #67249 (printf out-of-bounds read) getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Missing padding character +ValueError: Missing padding character diff --git a/ext/standard/tests/strings/bug69751.phpt b/ext/standard/tests/strings/bug69751.phpt index f75af897e0e5..90dadeb33e0b 100644 --- a/ext/standard/tests/strings/bug69751.phpt +++ b/ext/standard/tests/strings/bug69751.phpt @@ -5,24 +5,24 @@ Bug #69751: Change Error message of sprintf/printf for missing/typo position spe try { sprintf('%$s, %2$s %1$s', "a", "b"); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { sprintf('%3$s, %2$s %1$s', "a", "b"); -} catch (ArgumentCountError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { sprintf('%2147483648$s, %2$s %1$s', "a", "b"); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -Argument number specifier must be greater than zero and less than %d -4 arguments are required, 3 given -Argument number specifier must be greater than zero and less than %d +ValueError: Argument number specifier must be greater than zero and less than %d +ArgumentCountError: 4 arguments are required, 3 given +ValueError: Argument number specifier must be greater than zero and less than %d diff --git a/ext/standard/tests/strings/bug78833.phpt b/ext/standard/tests/strings/bug78833.phpt index 7712e133face..d5eeb99013e6 100644 --- a/ext/standard/tests/strings/bug78833.phpt +++ b/ext/standard/tests/strings/bug78833.phpt @@ -4,9 +4,9 @@ Bug #78833 (Integer overflow in pack causes out-of-bound access) getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Type E: too few arguments +ValueError: Type E: too few arguments diff --git a/ext/standard/tests/strings/chr_error.phpt b/ext/standard/tests/strings/chr_error.phpt index aee28604d5b8..1585acff87a3 100644 --- a/ext/standard/tests/strings/chr_error.phpt +++ b/ext/standard/tests/strings/chr_error.phpt @@ -8,16 +8,16 @@ echo "*** Testing chr() : error conditions ***\n"; echo "\n-- Testing chr() function with no arguments --\n"; try { var_dump( chr() ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing chr() function with more than expected no. of arguments --\n"; $extra_arg = 10; try { var_dump( chr(72, $extra_arg) ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -25,7 +25,7 @@ try { *** Testing chr() : error conditions *** -- Testing chr() function with no arguments -- -chr() expects exactly 1 argument, 0 given +ArgumentCountError: chr() expects exactly 1 argument, 0 given -- Testing chr() function with more than expected no. of arguments -- -chr() expects exactly 1 argument, 2 given +ArgumentCountError: chr() expects exactly 1 argument, 2 given diff --git a/ext/standard/tests/strings/chunk_split_variation5.phpt b/ext/standard/tests/strings/chunk_split_variation5.phpt index 8f51c001eecf..e51e7d617a34 100644 --- a/ext/standard/tests/strings/chunk_split_variation5.phpt +++ b/ext/standard/tests/strings/chunk_split_variation5.phpt @@ -34,10 +34,10 @@ for($count = 0; $count < count($values); $count++) { echo "-- Iteration $count --\n"; try { var_dump( chunk_split($str, $values[$count], $ending) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -45,12 +45,12 @@ for($count = 0; $count < count($values); $count++) { --EXPECTF-- *** Testing chunk_split() : different integer values for 'chunklen' *** -- Iteration 0 -- -chunk_split(): Argument #2 ($length) must be greater than 0 +ValueError: chunk_split(): Argument #2 ($length) must be greater than 0 -- Iteration 1 -- string(213) "T||h||i||s|| ||c||o||n||t||a||i||n||s|| ||a||n||d|| ||s||p||e||c||i||a||l|| ||c||h||a||r|| ||&|| ||n||u||m||b||e||r||s|| ||1||2||3||.|| ||I||t|| ||a||l||s||o|| ||c||h||e||c||k||s|| ||f||o||r|| ||%0|| ||c||h||a||r||" -- Iteration 2 -- -chunk_split(): Argument #2 ($length) must be greater than 0 +ValueError: chunk_split(): Argument #2 ($length) must be greater than 0 -- Iteration 3 -- string(73) "This contains and special char & numbers 123. It also checks for %0 char||" @@ -61,6 +61,6 @@ It als||o checks for %0 char||" string(73) "This contains and special char & numbers 123. It also checks for %0 char||" -- Iteration 6 -- -chunk_split(): Argument #2 ($length) must be of type int, float given +TypeError: chunk_split(): Argument #2 ($length) must be of type int, float given -- Iteration 7 -- -chunk_split(): Argument #2 ($length) must be greater than 0 +ValueError: chunk_split(): Argument #2 ($length) must be greater than 0 diff --git a/ext/standard/tests/strings/chunk_split_variation8.phpt b/ext/standard/tests/strings/chunk_split_variation8.phpt index b0c889494e40..d808ec1bcee1 100644 --- a/ext/standard/tests/strings/chunk_split_variation8.phpt +++ b/ext/standard/tests/strings/chunk_split_variation8.phpt @@ -42,10 +42,10 @@ for($count = 0; $count < count($values); $count++) { echo "-- Iteration ".($count+1). " --\n"; try { var_dump( chunk_split($heredoc_str, $values[$count], $ending) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -53,14 +53,14 @@ for($count = 0; $count < count($values); $count++) { --EXPECT-- *** Testing chunk_split() : different 'chunklen' with heredoc 'str' *** -- Iteration 1 -- -chunk_split(): Argument #2 ($length) must be greater than 0 +ValueError: chunk_split(): Argument #2 ($length) must be greater than 0 -- Iteration 2 -- string(504) "T:::h:::i:::s:::':::s::: :::h:::e:::r:::e:::d:::o:::c::: :::s:::t:::r:::i:::n:::g::: :::w:::i:::t:::h::: ::: ::: :::a:::n:::d::: ::: ::: :::w:::h:::i:::t:::e::: :::s:::p:::a:::c:::e::: :::c:::h:::a:::r:::.::: :::I:::t::: :::h:::a:::s::: :::_:::s:::p:::e:::c:::i:::@:::l::: :::c:::h:::@:::r:::$::: :::2:::2:::2:::2::: :::!:::!:::!:::N:::o:::w::: :::\:::k::: :::a:::s::: :::e:::s:::c:::a:::p:::e::: :::c:::h:::a:::r::: :::t:::o::: :::t:::e:::s:::t::: :::c:::h:::u:::n:::k:::_:::s:::p:::l:::i:::t:::(:::):::" -- Iteration 3 -- -chunk_split(): Argument #2 ($length) must be greater than 0 +ValueError: chunk_split(): Argument #2 ($length) must be greater than 0 -- Iteration 4 -- string(129) "This's heredoc string with and white space char. @@ -77,6 +77,6 @@ string(129) "This's heredoc string with and It has _speci@l ch@r$ 2222 !!!Now \k as escape char to test chunk_split():::" -- Iteration 7 -- -chunk_split(): Argument #2 ($length) must be of type int, float given +TypeError: chunk_split(): Argument #2 ($length) must be of type int, float given -- Iteration 8 -- -chunk_split(): Argument #2 ($length) must be greater than 0 +ValueError: chunk_split(): Argument #2 ($length) must be greater than 0 diff --git a/ext/standard/tests/strings/count_chars_basic.phpt b/ext/standard/tests/strings/count_chars_basic.phpt index ccf8cd47ac04..8d541b2fb0cc 100644 --- a/ext/standard/tests/strings/count_chars_basic.phpt +++ b/ext/standard/tests/strings/count_chars_basic.phpt @@ -16,8 +16,8 @@ var_dump(bin2hex(count_chars($string, 4))); try { count_chars($string, 5); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -1569,4 +1569,4 @@ array(238) { } string(18) " Rabcdefghimnorstu" string(476) "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f2122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f5051535455565758595a5b5c5d5e5f606a6b6c7071767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff" -count_chars(): Argument #2 ($mode) must be between 0 and 4 (inclusive) +ValueError: count_chars(): Argument #2 ($mode) must be between 0 and 4 (inclusive) diff --git a/ext/standard/tests/strings/crypt.phpt b/ext/standard/tests/strings/crypt.phpt index 1d2365655533..75e3a62adaf7 100644 --- a/ext/standard/tests/strings/crypt.phpt +++ b/ext/standard/tests/strings/crypt.phpt @@ -20,8 +20,8 @@ echo (CRYPT_BLOWFISH) ? ((crypt($str, $salt4) === $res_4) ? 'BLO' : 'BLO - ERROR try { var_dump(crypt($str)); -} catch (ArgumentCountError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -30,4 +30,4 @@ STD EXT MD5 BLO -crypt() expects exactly 2 arguments, 1 given +ArgumentCountError: crypt() expects exactly 2 arguments, 1 given diff --git a/ext/standard/tests/strings/dirname_error.phpt b/ext/standard/tests/strings/dirname_error.phpt index 16b0e94939d3..da9a8927d055 100644 --- a/ext/standard/tests/strings/dirname_error.phpt +++ b/ext/standard/tests/strings/dirname_error.phpt @@ -7,11 +7,11 @@ echo "*** Testing error conditions ***\n"; // Bad arg try { dirname("/var/tmp/bar.gz", 0); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- *** Testing error conditions *** -dirname(): Argument #2 ($levels) must be greater than or equal to 1 +ValueError: dirname(): Argument #2 ($levels) must be greater than or equal to 1 diff --git a/ext/standard/tests/strings/dirname_multi.phpt b/ext/standard/tests/strings/dirname_multi.phpt index 1c7875ad1569..119613297cc0 100644 --- a/ext/standard/tests/strings/dirname_multi.phpt +++ b/ext/standard/tests/strings/dirname_multi.phpt @@ -10,14 +10,14 @@ if((substr(PHP_OS, 0, 3) == "WIN")) for ($i=0 ; $i<5 ; $i++) { try { var_dump(dirname("/foo/bar/baz", $i)); - } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + } catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } var_dump(dirname("/foo/bar/baz", PHP_INT_MAX)); ?> --EXPECT-- -dirname(): Argument #2 ($levels) must be greater than or equal to 1 +ValueError: dirname(): Argument #2 ($levels) must be greater than or equal to 1 string(8) "/foo/bar" string(4) "/foo" string(1) "/" diff --git a/ext/standard/tests/strings/explode.phpt b/ext/standard/tests/strings/explode.phpt index 248fade7605c..dd1fc97da9e0 100644 --- a/ext/standard/tests/strings/explode.phpt +++ b/ext/standard/tests/strings/explode.phpt @@ -16,18 +16,18 @@ echo "\n"; try { var_dump(explode("", "")); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(explode("", NULL)); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(explode(NULL, "")); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(explode("a", "")); @@ -35,8 +35,8 @@ var_dump(explode("a", "a")); var_dump(explode("a", NULL)); try { var_dump(explode(NULL, "a")); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(explode("abc", "acb")); var_dump(explode("somestring", "otherstring")); @@ -62,9 +62,9 @@ array ( 4 => 'd', ) d6bee42a771449205344c0938ad4f035 -explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters -explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters -explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters +ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters +ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters +ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters array(1) { [0]=> string(0) "" @@ -79,7 +79,7 @@ array(1) { [0]=> string(0) "" } -explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters +ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters array(1) { [0]=> string(3) "acb" diff --git a/ext/standard/tests/strings/explode1.phpt b/ext/standard/tests/strings/explode1.phpt index 022654a57643..19187f879982 100644 --- a/ext/standard/tests/strings/explode1.phpt +++ b/ext/standard/tests/strings/explode1.phpt @@ -29,23 +29,23 @@ foreach($delimiters as $delimiter) { try { var_dump( explode($delimiter, $string, -1) ); - } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + } catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( explode($delimiter, $string, 0) ); - } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + } catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( explode($delimiter, $string, 1) ); - } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + } catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( explode($delimiter, $string, 2) ); - } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + } catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $counter++; } @@ -91,15 +91,15 @@ var_dump( explode("b", $obj) ); --EXPECT-- *** Testing explode() for basic operations *** -- Iteration 1 -- -explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters -explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters -explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters -explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters +ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters +ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters +ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters +ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters -- Iteration 2 -- -explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters -explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters -explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters -explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters +ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters +ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters +ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters +ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters -- Iteration 3 -- array(1) { [0]=> @@ -201,10 +201,10 @@ array(2) { string(56) "234NULL23abcd00000TRUEFALSE-11.234444true-11.24%PHP%ZEND" } -- Iteration 7 -- -explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters -explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters -explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters -explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters +ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters +ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters +ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters +ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters -- Iteration 8 -- array(2) { [0]=> diff --git a/ext/standard/tests/strings/fprintf_error.phpt b/ext/standard/tests/strings/fprintf_error.phpt index 39bc3ebff3be..8cc0060bcf97 100644 --- a/ext/standard/tests/strings/fprintf_error.phpt +++ b/ext/standard/tests/strings/fprintf_error.phpt @@ -9,29 +9,29 @@ echo "*** Testing Error Conditions ***\n"; /* zero argument */ try { var_dump( fprintf() ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } /* scalar argument */ try { var_dump( fprintf(3) ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } /* NULL argument */ try { var_dump( fprintf(NULL) ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; ?> --EXPECT-- *** Testing Error Conditions *** -fprintf() expects at least 2 arguments, 0 given -fprintf() expects at least 2 arguments, 1 given -fprintf() expects at least 2 arguments, 1 given +ArgumentCountError: fprintf() expects at least 2 arguments, 0 given +ArgumentCountError: fprintf() expects at least 2 arguments, 1 given +ArgumentCountError: fprintf() expects at least 2 arguments, 1 given Done diff --git a/ext/standard/tests/strings/gh11982.phpt b/ext/standard/tests/strings/gh11982.phpt index e5e45e7e1968..48993697f855 100644 --- a/ext/standard/tests/strings/gh11982.phpt +++ b/ext/standard/tests/strings/gh11982.phpt @@ -23,4 +23,3 @@ array(2) { [1]=> string(1) "a" } - diff --git a/ext/standard/tests/strings/gh18823_strict.phpt b/ext/standard/tests/strings/gh18823_strict.phpt index 39ae11ef61bc..469cdeb92791 100644 --- a/ext/standard/tests/strings/gh18823_strict.phpt +++ b/ext/standard/tests/strings/gh18823_strict.phpt @@ -5,15 +5,15 @@ GH-18823 (setlocale's 2nd and 3rd argument ignores strict_types) - strict mode declare(strict_types=1); try { setlocale(LC_ALL, 0, "0"); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setlocale(LC_ALL, "0", 0); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -setlocale(): Argument #2 ($locales) must be of type array|string|null, int given -setlocale(): Argument #3 must be of type ?string, int given +TypeError: setlocale(): Argument #2 ($locales) must be of type array|string|null, int given +TypeError: setlocale(): Argument #3 must be of type ?string, int given diff --git a/ext/standard/tests/strings/gh18823_weak.phpt b/ext/standard/tests/strings/gh18823_weak.phpt index 2a2b82d9aaa3..13d70e571f18 100644 --- a/ext/standard/tests/strings/gh18823_weak.phpt +++ b/ext/standard/tests/strings/gh18823_weak.phpt @@ -23,9 +23,9 @@ setlocale(LC_ALL, new MyStringable); try { setlocale(LC_ALL, new MyStringableThrow); -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -no +Error: no diff --git a/ext/standard/tests/strings/implode_error.phpt b/ext/standard/tests/strings/implode_error.phpt index 417b3591e0dd..762e8bf1ab5c 100644 --- a/ext/standard/tests/strings/implode_error.phpt +++ b/ext/standard/tests/strings/implode_error.phpt @@ -5,25 +5,25 @@ Test implode() function: error conditions /* only glue */ try { var_dump(implode("glue")); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } /* NULL as pieces */ try { var_dump(implode("glue", NULL)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } /* integer as glue */ try { var_dump(implode(12, "pieces")); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -implode(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given -implode(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given -implode(): Argument #2 ($array) must be of type ?array, string given +TypeError: implode(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given +TypeError: implode(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given +TypeError: implode(): Argument #2 ($array) must be of type ?array, string given diff --git a/ext/standard/tests/strings/implode_variation.phpt b/ext/standard/tests/strings/implode_variation.phpt index 2cc0870f39f4..e721447c2eb0 100644 --- a/ext/standard/tests/strings/implode_variation.phpt +++ b/ext/standard/tests/strings/implode_variation.phpt @@ -49,8 +49,8 @@ foreach($glues as $glue) { echo "-- Iteration $counter --\n"; try { var_dump(implode($glue, $pieces)); - } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $counter++; } @@ -59,8 +59,8 @@ foreach($glues as $glue) { echo "\n*** Testing implode() on empty string ***\n"; try { implode(""); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } /* checking sub-arrays */ @@ -69,13 +69,13 @@ $sub_array = array(array(1,2,3,4), array(1 => "one", 2 => "two"), "PHP", 50); var_dump(implode("TEST", $sub_array)); try { var_dump(implode(array(1, 2, 3, 4), $sub_array)); -} catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { var_dump(implode(2, $sub_array)); -} catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\n*** Testing implode() on objects ***\n"; @@ -185,7 +185,7 @@ string(35) "2101-639111PHP111 1string%0with%0...%0" -- Iteration 3 -- string(27) "20-6391PHP string%0with%0...%0" -- Iteration 4 -- -implode(): Argument #1 ($separator) must be of type string, array given +TypeError: implode(): Argument #1 ($separator) must be of type string, array given -- Iteration 5 -- string(27) "20-6391PHP string%0with%0...%0" -- Iteration 6 -- @@ -198,7 +198,7 @@ string(35) "2000-639010PHP000 0string%0with%0...%0" string(43) "2\00\0-639\01\0PHP\0\0\0 \0string%0with%0...%0" *** Testing implode() on empty string *** -implode(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given +TypeError: implode(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given *** Testing implode() on sub-arrays *** @@ -206,7 +206,7 @@ Warning: Array to string conversion in %s on line %d Warning: Array to string conversion in %s on line %d string(27) "ArrayTESTArrayTESTPHPTEST50" -implode(): Argument #1 ($separator) must be of type string, array given +TypeError: implode(): Argument #1 ($separator) must be of type string, array given Warning: Array to string conversion in %s diff --git a/ext/standard/tests/strings/join_error.phpt b/ext/standard/tests/strings/join_error.phpt index 0029bcc34b08..1a7ede606b7c 100644 --- a/ext/standard/tests/strings/join_error.phpt +++ b/ext/standard/tests/strings/join_error.phpt @@ -10,8 +10,8 @@ $glue = 'string_val'; try { var_dump(join($glue)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -20,5 +20,5 @@ echo "Done\n"; *** Testing join() : error conditions *** -- Testing join() with less than expected no. of arguments -- -join(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given +TypeError: join(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given Done diff --git a/ext/standard/tests/strings/join_error1.phpt b/ext/standard/tests/strings/join_error1.phpt index 0bb451a73d98..07bfda9221bd 100644 --- a/ext/standard/tests/strings/join_error1.phpt +++ b/ext/standard/tests/strings/join_error1.phpt @@ -84,8 +84,8 @@ for($index = 0; $index < count($values); $index ++) { try { var_dump(join($glue, $pieces)); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $counter ++; @@ -101,49 +101,49 @@ echo "Done\n"; --- Testing join() by supplying different values for 'pieces' argument --- -- Iteration 1 -- -join(): Argument #2 ($array) must be of type ?array, int given +TypeError: join(): Argument #2 ($array) must be of type ?array, int given -- Iteration 2 -- -join(): Argument #2 ($array) must be of type ?array, int given +TypeError: join(): Argument #2 ($array) must be of type ?array, int given -- Iteration 3 -- -join(): Argument #2 ($array) must be of type ?array, int given +TypeError: join(): Argument #2 ($array) must be of type ?array, int given -- Iteration 4 -- -join(): Argument #2 ($array) must be of type ?array, int given +TypeError: join(): Argument #2 ($array) must be of type ?array, int given -- Iteration 5 -- -join(): Argument #2 ($array) must be of type ?array, float given +TypeError: join(): Argument #2 ($array) must be of type ?array, float given -- Iteration 6 -- -join(): Argument #2 ($array) must be of type ?array, float given +TypeError: join(): Argument #2 ($array) must be of type ?array, float given -- Iteration 7 -- -join(): Argument #2 ($array) must be of type ?array, float given +TypeError: join(): Argument #2 ($array) must be of type ?array, float given -- Iteration 8 -- -join(): Argument #2 ($array) must be of type ?array, float given +TypeError: join(): Argument #2 ($array) must be of type ?array, float given -- Iteration 9 -- -join(): Argument #2 ($array) must be of type ?array, float given +TypeError: join(): Argument #2 ($array) must be of type ?array, float given -- Iteration 10 -- -join(): Argument #2 ($array) must be of type ?array, true given +TypeError: join(): Argument #2 ($array) must be of type ?array, true given -- Iteration 11 -- -join(): Argument #2 ($array) must be of type ?array, false given +TypeError: join(): Argument #2 ($array) must be of type ?array, false given -- Iteration 12 -- -join(): Argument #2 ($array) must be of type ?array, true given +TypeError: join(): Argument #2 ($array) must be of type ?array, true given -- Iteration 13 -- -join(): Argument #2 ($array) must be of type ?array, false given +TypeError: join(): Argument #2 ($array) must be of type ?array, false given -- Iteration 14 -- -join(): Argument #2 ($array) must be of type ?array, string given +TypeError: join(): Argument #2 ($array) must be of type ?array, string given -- Iteration 15 -- -join(): Argument #2 ($array) must be of type ?array, string given +TypeError: join(): Argument #2 ($array) must be of type ?array, string given -- Iteration 16 -- -join(): Argument #2 ($array) must be of type ?array, test given +TypeError: join(): Argument #2 ($array) must be of type ?array, test given -- Iteration 17 -- -join(): Argument #2 ($array) must be of type ?array, string given +TypeError: join(): Argument #2 ($array) must be of type ?array, string given -- Iteration 18 -- -join(): Argument #2 ($array) must be of type ?array, string given +TypeError: join(): Argument #2 ($array) must be of type ?array, string given -- Iteration 19 -- -join(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given +TypeError: join(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given -- Iteration 20 -- -join(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given +TypeError: join(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given -- Iteration 21 -- -join(): Argument #2 ($array) must be of type ?array, resource given +TypeError: join(): Argument #2 ($array) must be of type ?array, resource given -- Iteration 22 -- -join(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given +TypeError: join(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given -- Iteration 23 -- -join(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given +TypeError: join(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given Done diff --git a/ext/standard/tests/strings/join_variation1.phpt b/ext/standard/tests/strings/join_variation1.phpt index 256f361460b2..07be57057714 100644 --- a/ext/standard/tests/strings/join_variation1.phpt +++ b/ext/standard/tests/strings/join_variation1.phpt @@ -73,8 +73,8 @@ for($index = 0; $index < count($values); $index ++) { try { var_dump(join($glue, $pieces)); - } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $counter++; @@ -105,15 +105,15 @@ string(29) "element11.07654321E-9element2" -- Iteration 9 -- string(19) "element10.5element2" -- Iteration 10 -- -join(): Argument #1 ($separator) must be of type string, array given +TypeError: join(): Argument #1 ($separator) must be of type string, array given -- Iteration 11 -- -join(): Argument #1 ($separator) must be of type string, array given +TypeError: join(): Argument #1 ($separator) must be of type string, array given -- Iteration 12 -- -join(): Argument #1 ($separator) must be of type string, array given +TypeError: join(): Argument #1 ($separator) must be of type string, array given -- Iteration 13 -- -join(): Argument #1 ($separator) must be of type string, array given +TypeError: join(): Argument #1 ($separator) must be of type string, array given -- Iteration 14 -- -join(): Argument #1 ($separator) must be of type string, array given +TypeError: join(): Argument #1 ($separator) must be of type string, array given -- Iteration 15 -- string(17) "element11element2" -- Iteration 16 -- @@ -129,5 +129,5 @@ string(16) "element1element2" -- Iteration 21 -- string(16) "element1element2" -- Iteration 22 -- -join(): Argument #1 ($separator) must be of type array|string, resource given +TypeError: join(): Argument #1 ($separator) must be of type array|string, resource given Done diff --git a/ext/standard/tests/strings/join_variation4.phpt b/ext/standard/tests/strings/join_variation4.phpt index 21774b4bca2e..786047b602e3 100644 --- a/ext/standard/tests/strings/join_variation4.phpt +++ b/ext/standard/tests/strings/join_variation4.phpt @@ -40,8 +40,8 @@ for($index = 0; $index < count($glues); $index ++) { echo "-- Iteration $counter --\n"; try { var_dump(join($glues[$index], $pieces)); - } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $counter++; } @@ -57,7 +57,7 @@ string(57) "2101-6391-1.3444111PHP111 16999.999999991string%0with%0...%0" -- Iteration 3 -- string(47) "20-639-1.34441PHP 6999.99999999string%0with%0...%0" -- Iteration 4 -- -join(): Argument #1 ($separator) must be of type string, array given +TypeError: join(): Argument #1 ($separator) must be of type string, array given -- Iteration 5 -- string(47) "20-639-1.34441PHP 6999.99999999string%0with%0...%0" -- Iteration 6 -- diff --git a/ext/standard/tests/strings/join_variation5.phpt b/ext/standard/tests/strings/join_variation5.phpt index 9e5898d8c107..d4d1e4d9f679 100644 --- a/ext/standard/tests/strings/join_variation5.phpt +++ b/ext/standard/tests/strings/join_variation5.phpt @@ -15,8 +15,8 @@ var_dump(join("TEST", $sub_array)); // glue as array & pieces as array containing sub array try { var_dump(join(array(1, 2, 3, 4), $sub_array)); -} catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } // numeric value as glue, pieces as array containing sub array @@ -35,7 +35,7 @@ Warning: Array to string conversion in %s on line %d Warning: Array to string conversion in %s on line %d string(27) "ArrayTESTArrayTESTPHPTEST50" -join(): Argument #1 ($separator) must be of type string, array given +TypeError: join(): Argument #1 ($separator) must be of type string, array given Warning: Array to string conversion in %s on line %d diff --git a/ext/standard/tests/strings/levenshtein_error_conditions.phpt b/ext/standard/tests/strings/levenshtein_error_conditions.phpt index 55e144b3b25b..5a6ef2d439a1 100644 --- a/ext/standard/tests/strings/levenshtein_error_conditions.phpt +++ b/ext/standard/tests/strings/levenshtein_error_conditions.phpt @@ -9,15 +9,15 @@ echo '--- String 1 ---' . \PHP_EOL; var_dump(levenshtein('AbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsu', 'A')); try { var_dump(levenshtein('AbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuv', 'A')); -} catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo '--- String 2 ---' . \PHP_EOL; var_dump(levenshtein('A', 'AbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsu')); try { var_dump(levenshtein('A', 'AbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuv')); -} catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } // TODO ValueError for negative costs? diff --git a/ext/standard/tests/strings/md5_file.phpt b/ext/standard/tests/strings/md5_file.phpt index a6fba9ea0384..a96219723ef3 100644 --- a/ext/standard/tests/strings/md5_file.phpt +++ b/ext/standard/tests/strings/md5_file.phpt @@ -31,8 +31,8 @@ echo "\n*** Testing for error conditions ***\n"; /* No filename */ try { var_dump( md5_file("") ); -} catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } /* invalid filename */ var_dump( md5_file("aZrq16u") ); @@ -64,7 +64,7 @@ echo "\nDone"; ?> --EXPECTF-- *** Testing for error conditions *** -Path must not be empty +ValueError: Path must not be empty Warning: md5_file(): Failed to open stream: No such file or directory in %s on line %d bool(false) diff --git a/ext/standard/tests/strings/metaphone.phpt b/ext/standard/tests/strings/metaphone.phpt index bb2d30adf946..0fc4bb81ce45 100644 --- a/ext/standard/tests/strings/metaphone.phpt +++ b/ext/standard/tests/strings/metaphone.phpt @@ -8,8 +8,8 @@ var_dump(metaphone(-1)); try { var_dump(metaphone("valid phrase", -1)); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(metaphone("valid phrase", 0)); var_dump(metaphone("valid phrase", 10000)); @@ -35,7 +35,7 @@ Deprecated: Function metaphone() is deprecated since 8.6, use a userland phoneti string(0) "" Deprecated: Function metaphone() is deprecated since 8.6, use a userland phonetic matching library instead in %s on line %d -metaphone(): Argument #2 ($max_phonemes) must be greater than or equal to 0 +ValueError: metaphone(): Argument #2 ($max_phonemes) must be greater than or equal to 0 Deprecated: Function metaphone() is deprecated since 8.6, use a userland phonetic matching library instead in %s on line %d string(6) "FLTFRS" diff --git a/ext/standard/tests/strings/parse_str_null_bytes.phpt b/ext/standard/tests/strings/parse_str_null_bytes.phpt index fd0d94bb0fc8..d5bfd7b4eaa9 100644 --- a/ext/standard/tests/strings/parse_str_null_bytes.phpt +++ b/ext/standard/tests/strings/parse_str_null_bytes.phpt @@ -5,10 +5,10 @@ parse_str() rejects null bytes try { parse_str("a=1\0&b=2", $result); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -parse_str(): Argument #1 ($string) must not contain any null bytes +ValueError: parse_str(): Argument #1 ($string) must not contain any null bytes diff --git a/ext/standard/tests/strings/pathinfo.phpt b/ext/standard/tests/strings/pathinfo.phpt index 1ff42a66121c..ec21db43934e 100644 --- a/ext/standard/tests/strings/pathinfo.phpt +++ b/ext/standard/tests/strings/pathinfo.phpt @@ -17,44 +17,44 @@ var_dump(pathinfo(__FILE__, PATHINFO_DIRNAME)); try { pathinfo(__FILE__, PATHINFO_EXTENSION|PATHINFO_FILENAME|PATHINFO_DIRNAME); -} catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { pathinfo(__FILE__, PATHINFO_EXTENSION|PATHINFO_FILENAME); -} catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { pathinfo(__FILE__, PATHINFO_EXTENSION|PATHINFO_DIRNAME); -} catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { pathinfo(__FILE__, PATHINFO_FILENAME|PATHINFO_BASENAME); -} catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { pathinfo(__FILE__, PATHINFO_DIRNAME|PATHINFO_EXTENSION); -} catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { pathinfo(__FILE__, PATHINFO_DIRNAME|PATHINFO_BASENAME); -} catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { pathinfo(__FILE__, PATHINFO_DIRNAME-1); -} catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { pathinfo(__FILE__, PATHINFO_ALL+1); -} catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -128,12 +128,12 @@ string(12) "pathinfo.php" string(8) "pathinfo" string(3) "php" string(%d) "%s%estrings" -pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants -pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants -pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants -pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants -pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants -pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants -pathinfo(): Argument #2 ($flags) must be one of the PATHINFO_* constants -pathinfo(): Argument #2 ($flags) must be one of the PATHINFO_* constants +ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +ValueError: pathinfo(): Argument #2 ($flags) must be one of the PATHINFO_* constants +ValueError: pathinfo(): Argument #2 ($flags) must be one of the PATHINFO_* constants Done diff --git a/ext/standard/tests/strings/printf_64bit.phpt b/ext/standard/tests/strings/printf_64bit.phpt index 083b7b2979db..88c60a392728 100644 --- a/ext/standard/tests/strings/printf_64bit.phpt +++ b/ext/standard/tests/strings/printf_64bit.phpt @@ -30,8 +30,8 @@ $strings = array( NULL, "abc", 'aaa' ); echo "\n*** Output for zero argument ***\n"; try { printf(); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } /* Number of arguments not matching as specified in format field */ @@ -41,13 +41,13 @@ $nbr = 5; $name = "voudras"; try { printf("%d $string %s", $nbr, $name); -} catch (\ArgumentCountError $e) { - print('Error found: '.$e->getMessage()); +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } /* Scalar argument */ -echo "\n*** Output for scalar argument ***\n"; +echo "*** Output for scalar argument ***\n"; printf(3); /* Float type variations */ @@ -204,11 +204,11 @@ printf("%.988f",1.23456789e10); echo"\n\n*** Output for invalid width(-15) specifier ***\n"; try { printf("%030.-15s", $tempstring); -} catch (ValueError $e) { - echo $e->getMessage(); +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } -echo"\n\n*** Output for '%F' as the format parameter ***\n"; +echo "\n*** Output for '%F' as the format parameter ***\n"; printf("%F",1.23456789e10); echo"\n\n*** Output for '%X' as the format parameter ***\n"; @@ -233,10 +233,10 @@ printf("%d", $tempstring); ?> --EXPECTF-- *** Output for zero argument *** -printf() expects at least 1 argument, 0 given +ArgumentCountError: printf() expects at least 1 argument, 0 given *** Output for insufficient number of arguments *** -Error found: 5 arguments are required, 3 given +ArgumentCountError: 5 arguments are required, 3 given *** Output for scalar argument *** 3 @@ -676,7 +676,7 @@ Notice: printf(): Requested precision of 988 digits was truncated to PHP maximum 12345678900.0000000000%d *** Output for invalid width(-15) specifier *** -Unknown format specifier "-" +ValueError: Unknown format specifier "-" *** Output for '%F' as the format parameter *** 12345678900.000000 diff --git a/ext/standard/tests/strings/printf_error.phpt b/ext/standard/tests/strings/printf_error.phpt index 2842f5cea124..31f82ab08a0b 100644 --- a/ext/standard/tests/strings/printf_error.phpt +++ b/ext/standard/tests/strings/printf_error.phpt @@ -8,8 +8,8 @@ echo "*** Testing printf() : error conditions ***\n"; echo "\n-- Testing printf() function with Zero arguments --\n"; try { var_dump( printf() ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing printf() function with less than expected no. of arguments --\n"; @@ -22,37 +22,37 @@ $arg2 = 'two'; echo "\n-- Call printf with one argument less than expected --\n"; try { var_dump( printf($format1) ); -} catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( printf($format2,$arg1) ); -} catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( printf($format3,$arg1,$arg2) ); -} catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Call printf with two argument less than expected --\n"; try { var_dump( printf($format2) ); -} catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( printf($format3,$arg1) ); -} catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Call printf with three argument less than expected --\n"; try { var_dump( printf($format3) ); -} catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -60,18 +60,18 @@ try { *** Testing printf() : error conditions *** -- Testing printf() function with Zero arguments -- -printf() expects at least 1 argument, 0 given +ArgumentCountError: printf() expects at least 1 argument, 0 given -- Testing printf() function with less than expected no. of arguments -- -- Call printf with one argument less than expected -- -2 arguments are required, 1 given -3 arguments are required, 2 given -4 arguments are required, 3 given +ArgumentCountError: 2 arguments are required, 1 given +ArgumentCountError: 3 arguments are required, 2 given +ArgumentCountError: 4 arguments are required, 3 given -- Call printf with two argument less than expected -- -3 arguments are required, 1 given -4 arguments are required, 2 given +ArgumentCountError: 3 arguments are required, 1 given +ArgumentCountError: 4 arguments are required, 2 given -- Call printf with three argument less than expected -- -4 arguments are required, 1 given +ArgumentCountError: 4 arguments are required, 1 given diff --git a/ext/standard/tests/strings/setlocale_null_byte.phpt b/ext/standard/tests/strings/setlocale_null_byte.phpt index 85663b98a71a..5fc0d84c082a 100644 --- a/ext/standard/tests/strings/setlocale_null_byte.phpt +++ b/ext/standard/tests/strings/setlocale_null_byte.phpt @@ -10,38 +10,38 @@ class NullByteStringable { try { var_dump(setlocale(LC_ALL, "C\0locale")); -} catch (ValueError $e) { - echo $e::class, ": ", $e->getMessage(), \PHP_EOL; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(setlocale(LC_ALL, ["locale\0name", "C"])); -} catch (ValueError $e) { - echo $e::class, ": ", $e->getMessage(), \PHP_EOL; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(@setlocale(LC_ALL, [str_repeat("x", 255), "C\0locale"])); -} catch (ValueError $e) { - echo $e::class, ": ", $e->getMessage(), \PHP_EOL; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(setlocale(LC_ALL, "zz_ZZ.nope", ["C\0locale"])); -} catch (TypeError $e) { - echo $e::class, ": ", $e->getMessage(), \PHP_EOL; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(setlocale(LC_ALL, "zz_ZZ.nope", new NullByteStringable())); -} catch (ValueError $e) { - echo $e::class, ": ", $e->getMessage(), \PHP_EOL; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(setlocale(LC_ALL, [], new NullByteStringable())); -} catch (ArgumentCountError $e) { - echo $e::class, ": ", $e->getMessage(), \PHP_EOL; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/strings/sha1_file.phpt b/ext/standard/tests/strings/sha1_file.phpt index 2014eabb98f5..71062ae91ea0 100644 --- a/ext/standard/tests/strings/sha1_file.phpt +++ b/ext/standard/tests/strings/sha1_file.phpt @@ -34,8 +34,8 @@ echo "\n*** Testing for error conditions ***\n"; echo "\n-- No filename --\n"; try { var_dump( sha1_file("") ); -} catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- invalid filename --\n"; @@ -47,8 +47,8 @@ var_dump( sha1_file(12) ); echo "\n-- NULL as filename --\n"; try { var_dump( sha1_file(NULL) ); -} catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Hexadecimal Output for Empty file as Argument --\n"; @@ -74,7 +74,7 @@ unlink("EmptyFileSHA1.txt"); *** Testing for error conditions *** -- No filename -- -Path must not be empty +ValueError: Path must not be empty -- invalid filename -- @@ -89,7 +89,7 @@ bool(false) -- NULL as filename -- Deprecated: sha1_file(): Passing null to parameter #1 ($filename) of type string is deprecated in %s on line %d -Path must not be empty +ValueError: Path must not be empty -- Hexadecimal Output for Empty file as Argument -- string(40) "da39a3ee5e6b4b0d3255bfef95601890afd80709" diff --git a/ext/standard/tests/strings/sprintf_error.phpt b/ext/standard/tests/strings/sprintf_error.phpt index bab3fabae31c..2640a330b717 100644 --- a/ext/standard/tests/strings/sprintf_error.phpt +++ b/ext/standard/tests/strings/sprintf_error.phpt @@ -8,8 +8,8 @@ echo "*** Testing sprintf() : error conditions ***\n"; echo "\n-- Testing sprintf() function with Zero arguments --\n"; try { var_dump( sprintf() ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing sprintf() function with less than expected no. of arguments --\n"; @@ -22,49 +22,49 @@ $arg2 = 'two'; // with one argument less than expected try { var_dump( sprintf($format1) ); -} catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( sprintf($format2,$arg1) ); -} catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( sprintf($format3,$arg1,$arg2) ); -} catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } // with two argument less than expected try { var_dump( sprintf($format2) ); -} catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( sprintf($format3,$arg1) ); -} catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } // with three argument less than expected try { var_dump( sprintf($format3) ); -} catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(sprintf('%100$d %d')); -} catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(sprintf("foo %", 42)); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done"; @@ -73,15 +73,15 @@ echo "Done"; *** Testing sprintf() : error conditions *** -- Testing sprintf() function with Zero arguments -- -sprintf() expects at least 1 argument, 0 given +ArgumentCountError: sprintf() expects at least 1 argument, 0 given -- Testing sprintf() function with less than expected no. of arguments -- -2 arguments are required, 1 given -3 arguments are required, 2 given -4 arguments are required, 3 given -3 arguments are required, 1 given -4 arguments are required, 2 given -4 arguments are required, 1 given -101 arguments are required, 1 given -Missing format specifier at end of string +ArgumentCountError: 2 arguments are required, 1 given +ArgumentCountError: 3 arguments are required, 2 given +ArgumentCountError: 4 arguments are required, 3 given +ArgumentCountError: 3 arguments are required, 1 given +ArgumentCountError: 4 arguments are required, 2 given +ArgumentCountError: 4 arguments are required, 1 given +ArgumentCountError: 101 arguments are required, 1 given +ValueError: Missing format specifier at end of string Done diff --git a/ext/standard/tests/strings/sprintf_star.phpt b/ext/standard/tests/strings/sprintf_star.phpt index 0c8a211e5c43..8e7e0f1b8b1e 100644 --- a/ext/standard/tests/strings/sprintf_star.phpt +++ b/ext/standard/tests/strings/sprintf_star.phpt @@ -40,38 +40,38 @@ echo "\n"; try { printf("%.*G\n", "foo", 1.5); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { printf("%.*G\n", -100, 1.5); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { printf("%.*s\n", -1, "Foo"); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { printf("%*G\n", -1, $f); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { printf("%9999999999999999999999.f\n", $f); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { printf("%.9999999999999999999999f\n", $f); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -104,9 +104,9 @@ foo 1.235 1.235 -Precision must be an integer -Precision must be between -1 and 2147483647 -Precision -1 is only supported for %g, %G, %h and %H -Width must be between 0 and 2147483647 -Width must be between 0 and 2147483647 -Precision must be between 0 and 2147483647 +ValueError: Precision must be an integer +ValueError: Precision must be between -1 and 2147483647 +ValueError: Precision -1 is only supported for %g, %G, %h and %H +ValueError: Width must be between 0 and 2147483647 +ValueError: Width must be between 0 and 2147483647 +ValueError: Precision must be between 0 and 2147483647 diff --git a/ext/standard/tests/strings/sprintf_variation1.phpt b/ext/standard/tests/strings/sprintf_variation1.phpt index 6b9430e38666..83d25aab0d6e 100644 --- a/ext/standard/tests/strings/sprintf_variation1.phpt +++ b/ext/standard/tests/strings/sprintf_variation1.phpt @@ -72,22 +72,22 @@ foreach($values as $value) { // with default argument try { var_dump(sprintf($value)); - } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } // with two arguments try { var_dump(sprintf($value, $arg1)); - } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } // with three arguments try { var_dump(sprintf($value, $arg1, $arg2)); - } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $count++; @@ -147,29 +147,29 @@ string(3) "0.5" string(3) "0.5" -- Iteration 10 -- -sprintf(): Argument #1 ($format) must be of type string, array given -sprintf(): Argument #1 ($format) must be of type string, array given -sprintf(): Argument #1 ($format) must be of type string, array given +TypeError: sprintf(): Argument #1 ($format) must be of type string, array given +TypeError: sprintf(): Argument #1 ($format) must be of type string, array given +TypeError: sprintf(): Argument #1 ($format) must be of type string, array given -- Iteration 11 -- -sprintf(): Argument #1 ($format) must be of type string, array given -sprintf(): Argument #1 ($format) must be of type string, array given -sprintf(): Argument #1 ($format) must be of type string, array given +TypeError: sprintf(): Argument #1 ($format) must be of type string, array given +TypeError: sprintf(): Argument #1 ($format) must be of type string, array given +TypeError: sprintf(): Argument #1 ($format) must be of type string, array given -- Iteration 12 -- -sprintf(): Argument #1 ($format) must be of type string, array given -sprintf(): Argument #1 ($format) must be of type string, array given -sprintf(): Argument #1 ($format) must be of type string, array given +TypeError: sprintf(): Argument #1 ($format) must be of type string, array given +TypeError: sprintf(): Argument #1 ($format) must be of type string, array given +TypeError: sprintf(): Argument #1 ($format) must be of type string, array given -- Iteration 13 -- -sprintf(): Argument #1 ($format) must be of type string, array given -sprintf(): Argument #1 ($format) must be of type string, array given -sprintf(): Argument #1 ($format) must be of type string, array given +TypeError: sprintf(): Argument #1 ($format) must be of type string, array given +TypeError: sprintf(): Argument #1 ($format) must be of type string, array given +TypeError: sprintf(): Argument #1 ($format) must be of type string, array given -- Iteration 14 -- -sprintf(): Argument #1 ($format) must be of type string, array given -sprintf(): Argument #1 ($format) must be of type string, array given -sprintf(): Argument #1 ($format) must be of type string, array given +TypeError: sprintf(): Argument #1 ($format) must be of type string, array given +TypeError: sprintf(): Argument #1 ($format) must be of type string, array given +TypeError: sprintf(): Argument #1 ($format) must be of type string, array given -- Iteration 15 -- string(1) "1" @@ -207,7 +207,7 @@ string(6) "Object" string(6) "Object" -- Iteration 22 -- -sprintf(): Argument #1 ($format) must be of type string, resource given -sprintf(): Argument #1 ($format) must be of type string, resource given -sprintf(): Argument #1 ($format) must be of type string, resource given +TypeError: sprintf(): Argument #1 ($format) must be of type string, resource given +TypeError: sprintf(): Argument #1 ($format) must be of type string, resource given +TypeError: sprintf(): Argument #1 ($format) must be of type string, resource given Done diff --git a/ext/standard/tests/strings/sprintf_variation4_64bit.phpt b/ext/standard/tests/strings/sprintf_variation4_64bit.phpt index 57d9931648a7..fb23322f1094 100644 --- a/ext/standard/tests/strings/sprintf_variation4_64bit.phpt +++ b/ext/standard/tests/strings/sprintf_variation4_64bit.phpt @@ -21,4 +21,3 @@ var_dump(sprintf("%%u = '%u'", $u)); // unsigned integer representation of a neg --EXPECT-- string(15) "%u = '43951789'" string(27) "%u = '18446744073665599827'" - diff --git a/ext/standard/tests/strings/sprintf_variation52.phpt b/ext/standard/tests/strings/sprintf_variation52.phpt index e7e022a6fae6..a31d09962173 100644 --- a/ext/standard/tests/strings/sprintf_variation52.phpt +++ b/ext/standard/tests/strings/sprintf_variation52.phpt @@ -20,8 +20,8 @@ var_dump(sprintf("%.988f", 1.23456789e10)); echo"\n-- Testing for invalid width(-15) specifier --\n"; try { var_dump(sprintf("%030.-15s", $tempstring)); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo"\n-- Testing for '%X' as the format parameter --\n"; @@ -50,7 +50,7 @@ Notice: sprintf(): Requested precision of 988 digits was truncated to PHP maximu string(65) "12345678900.00000000000000000000000000000000000000000000000000000" -- Testing for invalid width(-15) specifier -- -Unknown format specifier "-" +ValueError: Unknown format specifier "-" -- Testing for '%X' as the format parameter -- string(1) "C" diff --git a/ext/standard/tests/strings/sprintf_variation54.phpt b/ext/standard/tests/strings/sprintf_variation54.phpt index e925293ceef7..7593f3106310 100644 --- a/ext/standard/tests/strings/sprintf_variation54.phpt +++ b/ext/standard/tests/strings/sprintf_variation54.phpt @@ -11,8 +11,8 @@ foreach ($formats as $format) { echo "$format with " . (is_resource($value) ? "resource" : json_encode($value)) . ":\n"; try { echo sprintf("%" . $format, $value), "\n"; - } catch (Error $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n"; } @@ -52,7 +52,7 @@ Array Resource id #%d %s with {}: -Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string d with null: 0 diff --git a/ext/standard/tests/strings/sscanf_error.phpt b/ext/standard/tests/strings/sscanf_error.phpt index e04b5e2cbb62..e3c2e222df5c 100644 --- a/ext/standard/tests/strings/sscanf_error.phpt +++ b/ext/standard/tests/strings/sscanf_error.phpt @@ -12,12 +12,12 @@ echo "\n-- Testing sscanf() function with more than expected no. of arguments -- try { sscanf($str, $format, $str1, $str2, $extra_str); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- *** Testing sscanf() : error conditions *** -- Testing sscanf() function with more than expected no. of arguments -- -Variable is not assigned by any conversion specifiers +ValueError: Variable is not assigned by any conversion specifiers diff --git a/ext/standard/tests/strings/str_decrement_errors.phpt b/ext/standard/tests/strings/str_decrement_errors.phpt index 3186d24b81ed..69d69c3c41e1 100644 --- a/ext/standard/tests/strings/str_decrement_errors.phpt +++ b/ext/standard/tests/strings/str_decrement_errors.phpt @@ -30,24 +30,24 @@ $strings = [ foreach ($strings as $s) { try { var_dump(str_decrement($s)); - } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> --EXPECT-- -str_decrement(): Argument #1 ($string) must not be empty -str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_decrement(): Argument #1 ($string) must not be empty +ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters diff --git a/ext/standard/tests/strings/str_decrement_underflow.phpt b/ext/standard/tests/strings/str_decrement_underflow.phpt index 0521497713a1..6c120c3ab3d4 100644 --- a/ext/standard/tests/strings/str_decrement_underflow.phpt +++ b/ext/standard/tests/strings/str_decrement_underflow.phpt @@ -16,17 +16,17 @@ $strings = [ foreach ($strings as $s) { try { var_dump(str_decrement($s)); - } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> --EXPECT-- -str_decrement(): Argument #1 ($string) must not be empty -str_decrement(): Argument #1 ($string) "0" is out of decrement range -str_decrement(): Argument #1 ($string) "a" is out of decrement range -str_decrement(): Argument #1 ($string) "A" is out of decrement range -str_decrement(): Argument #1 ($string) "00" is out of decrement range -str_decrement(): Argument #1 ($string) "0a" is out of decrement range -str_decrement(): Argument #1 ($string) "0A" is out of decrement range +ValueError: str_decrement(): Argument #1 ($string) must not be empty +ValueError: str_decrement(): Argument #1 ($string) "0" is out of decrement range +ValueError: str_decrement(): Argument #1 ($string) "a" is out of decrement range +ValueError: str_decrement(): Argument #1 ($string) "A" is out of decrement range +ValueError: str_decrement(): Argument #1 ($string) "00" is out of decrement range +ValueError: str_decrement(): Argument #1 ($string) "0a" is out of decrement range +ValueError: str_decrement(): Argument #1 ($string) "0A" is out of decrement range diff --git a/ext/standard/tests/strings/str_increment_errors.phpt b/ext/standard/tests/strings/str_increment_errors.phpt index e06d7e4bba86..ba2174e95923 100644 --- a/ext/standard/tests/strings/str_increment_errors.phpt +++ b/ext/standard/tests/strings/str_increment_errors.phpt @@ -30,24 +30,24 @@ $strings = [ foreach ($strings as $s) { try { var_dump(str_increment($s)); - } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> --EXPECT-- -str_increment(): Argument #1 ($string) must not be empty -str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_increment(): Argument #1 ($string) must not be empty +ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters diff --git a/ext/standard/tests/strings/str_pad.phpt b/ext/standard/tests/strings/str_pad.phpt index c7b11e4ac0ce..5e83def1fb92 100644 --- a/ext/standard/tests/strings/str_pad.phpt +++ b/ext/standard/tests/strings/str_pad.phpt @@ -66,16 +66,16 @@ echo "\n--- empty padding string ---\n"; try { str_pad($input_string, 12, ""); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } /* bad pad_type - passing an undefined one */ try { str_pad($input_string, $pad_length, "+", 15); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -302,5 +302,5 @@ string(16) "\t\variation\t\t" #### error conditions #### --- empty padding string --- -str_pad(): Argument #3 ($pad_string) must not be empty -str_pad(): Argument #4 ($pad_type) must be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH +ValueError: str_pad(): Argument #3 ($pad_string) must not be empty +ValueError: str_pad(): Argument #4 ($pad_type) must be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH diff --git a/ext/standard/tests/strings/str_pad_variation1.phpt b/ext/standard/tests/strings/str_pad_variation1.phpt index cb71e61156fc..9a14cda353a8 100644 --- a/ext/standard/tests/strings/str_pad_variation1.phpt +++ b/ext/standard/tests/strings/str_pad_variation1.phpt @@ -20,8 +20,8 @@ $input = "Test string"; $extra_large_pad_length = PHP_INT_MAX*5; try { var_dump( str_pad($input, $extra_large_pad_length) ); -} catch (\TypeError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $php_int_max_pad_length = PHP_INT_MAX; @@ -31,6 +31,6 @@ var_dump( str_pad($input, $php_int_max_pad_length) ); ?> --EXPECTF-- *** Testing str_pad() function: with large value for for 'pad_length' argument *** -str_pad(): Argument #2 ($length) must be of type int, float given +TypeError: str_pad(): Argument #2 ($length) must be of type int, float given Fatal error: Allowed memory size of %d bytes exhausted%s(tried to allocate %d bytes) in %s on line %d diff --git a/ext/standard/tests/strings/str_repeat.phpt b/ext/standard/tests/strings/str_repeat.phpt index 3351e7f87133..8c3225f0f320 100644 --- a/ext/standard/tests/strings/str_repeat.phpt +++ b/ext/standard/tests/strings/str_repeat.phpt @@ -30,8 +30,8 @@ foreach($variations as $input) { echo "\n\n*** Testing error conditions ***\n"; try { str_repeat($input[0], -1); // Invalid arg for multiplier -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -100,4 +100,4 @@ try { *** Testing error conditions *** -str_repeat(): Argument #2 ($times) must be greater than or equal to 0 +ValueError: str_repeat(): Argument #2 ($times) must be greater than or equal to 0 diff --git a/ext/standard/tests/strings/str_replace_basic.phpt b/ext/standard/tests/strings/str_replace_basic.phpt index 4dfbd098efc6..3139b594fad0 100644 --- a/ext/standard/tests/strings/str_replace_basic.phpt +++ b/ext/standard/tests/strings/str_replace_basic.phpt @@ -23,8 +23,8 @@ $fp = fopen( __FILE__, "r" ); $fp_copy = $fp; try { var_dump( str_replace($fp_copy, $fp_copy, $fp_copy, $fp_copy) ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump( $fp_copy ); fclose($fp); @@ -40,5 +40,5 @@ string(1) "q" int(1) string(0) "" int(0) -str_replace(): Argument #1 ($search) must be of type array|string, resource given +TypeError: str_replace(): Argument #1 ($search) must be of type array|string, resource given resource(%d) of type (stream) diff --git a/ext/standard/tests/strings/str_replace_variation3.phpt b/ext/standard/tests/strings/str_replace_variation3.phpt index 07c6ef7da346..71370f437d2c 100644 --- a/ext/standard/tests/strings/str_replace_variation3.phpt +++ b/ext/standard/tests/strings/str_replace_variation3.phpt @@ -82,8 +82,8 @@ var_dump($count); try { str_replace("a", array("q", "q", "c"), array("aaa"), $count); -} catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump(str_replace("a", 1, array("aaa", "bbb"), $count)); @@ -98,13 +98,13 @@ $resource1 = fopen( __FILE__, "r" ); $resource2 = opendir( "." ); try { var_dump(str_replace("stream", "FOUND", $resource1, $count)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(str_replace("stream", "FOUND", $resource2, $count)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } @@ -180,7 +180,7 @@ array(2) { string(3) "ccc" } int(6) -str_replace(): Argument #2 ($replace) must be of type string when argument #1 ($search) is a string +TypeError: str_replace(): Argument #2 ($replace) must be of type string when argument #1 ($search) is a string array(2) { [0]=> string(3) "111" @@ -197,8 +197,8 @@ array(2) { int(1) -- Testing Resources -- -str_replace(): Argument #3 ($subject) must be of type array|string, resource given -str_replace(): Argument #3 ($subject) must be of type array|string, resource given +TypeError: str_replace(): Argument #3 ($subject) must be of type array|string, resource given +TypeError: str_replace(): Argument #3 ($subject) must be of type array|string, resource given -- Testing a longer and heredoc string -- string(623) "FOUNDghijklmnopqrstuvwxyz0123456789FOUNDghijklmnopqrstuvwxyz0123456789 diff --git a/ext/standard/tests/strings/str_split_variation6.phpt b/ext/standard/tests/strings/str_split_variation6.phpt index a8c1bbf1a927..0117a882b101 100644 --- a/ext/standard/tests/strings/str_split_variation6.phpt +++ b/ext/standard/tests/strings/str_split_variation6.phpt @@ -27,15 +27,15 @@ for($count = 0; $count < count($values); $count++) { try { var_dump( str_split($str, $values[$count]) ); - } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + } catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> --EXPECT-- *** Testing str_split() : different integer values for 'split_length' *** -- Iteration 1 -- -str_split(): Argument #2 ($length) must be greater than 0 +ValueError: str_split(): Argument #2 ($length) must be greater than 0 -- Iteration 2 -- array(42) { [0]=> @@ -124,7 +124,7 @@ array(42) { string(1) "t" } -- Iteration 3 -- -str_split(): Argument #2 ($length) must be greater than 0 +ValueError: str_split(): Argument #2 ($length) must be greater than 0 -- Iteration 4 -- array(1) { [0]=> @@ -143,4 +143,4 @@ array(1) { string(42) "This is a string with 123 & escape char \t" } -- Iteration 7 -- -str_split(): Argument #2 ($length) must be greater than 0 +ValueError: str_split(): Argument #2 ($length) must be greater than 0 diff --git a/ext/standard/tests/strings/str_split_variation7.phpt b/ext/standard/tests/strings/str_split_variation7.phpt index 17e802b2406e..ca3d5eeccfdc 100644 --- a/ext/standard/tests/strings/str_split_variation7.phpt +++ b/ext/standard/tests/strings/str_split_variation7.phpt @@ -29,15 +29,15 @@ for($count = 0; $count < count($values); $count++) { try { var_dump( str_split($str, $values[$count]) ); - } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + } catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> --EXPECT-- *** Testing str_split() : different integer values for 'split_length' with heredoc 'str' *** -- Iteration 1 -- -str_split(): Argument #2 ($length) must be greater than 0 +ValueError: str_split(): Argument #2 ($length) must be greater than 0 -- Iteration 2 -- array(30) { [0]=> @@ -102,7 +102,7 @@ array(30) { string(1) "." } -- Iteration 3 -- -str_split(): Argument #2 ($length) must be greater than 0 +ValueError: str_split(): Argument #2 ($length) must be greater than 0 -- Iteration 4 -- array(1) { [0]=> @@ -121,4 +121,4 @@ array(1) { string(30) "string with 123,escape char ." } -- Iteration 7 -- -str_split(): Argument #2 ($length) must be greater than 0 +ValueError: str_split(): Argument #2 ($length) must be greater than 0 diff --git a/ext/standard/tests/strings/str_word_count.phpt b/ext/standard/tests/strings/str_word_count.phpt index a8c2af9255f0..097cbb958e70 100644 --- a/ext/standard/tests/strings/str_word_count.phpt +++ b/ext/standard/tests/strings/str_word_count.phpt @@ -11,26 +11,26 @@ var_dump(str_word_count($str)); try { var_dump(str_word_count($str, 3)); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(str_word_count($str, 123)); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(str_word_count($str, -1)); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(str_word_count($str, 999999999)); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($str); @@ -87,10 +87,10 @@ array(6) { string(5) "today" } int(6) -str_word_count(): Argument #2 ($format) must be a valid format value -str_word_count(): Argument #2 ($format) must be a valid format value -str_word_count(): Argument #2 ($format) must be a valid format value -str_word_count(): Argument #2 ($format) must be a valid format value +ValueError: str_word_count(): Argument #2 ($format) must be a valid format value +ValueError: str_word_count(): Argument #2 ($format) must be a valid format value +ValueError: str_word_count(): Argument #2 ($format) must be a valid format value +ValueError: str_word_count(): Argument #2 ($format) must be a valid format value string(53) "Hello friend, you're looking good today!" int(5) diff --git a/ext/standard/tests/strings/str_word_count1.phpt b/ext/standard/tests/strings/str_word_count1.phpt index c4f8ecf40a0f..d02c1b0b547b 100644 --- a/ext/standard/tests/strings/str_word_count1.phpt +++ b/ext/standard/tests/strings/str_word_count1.phpt @@ -7,24 +7,24 @@ var_dump(str_word_count("")); try { var_dump(str_word_count("", -1)); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(str_word_count("", -1, $a)); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($a); ?> --EXPECTF-- int(0) -str_word_count(): Argument #2 ($format) must be a valid format value +ValueError: str_word_count(): Argument #2 ($format) must be a valid format value Warning: Undefined variable $a in %s on line %d -str_word_count(): Argument #2 ($format) must be a valid format value +ValueError: str_word_count(): Argument #2 ($format) must be a valid format value Warning: Undefined variable $a in %s on line %d NULL diff --git a/ext/standard/tests/strings/strip_tags_variation2.phpt b/ext/standard/tests/strings/strip_tags_variation2.phpt index 421f8a62ae4e..2bf2de0ac825 100644 --- a/ext/standard/tests/strings/strip_tags_variation2.phpt +++ b/ext/standard/tests/strings/strip_tags_variation2.phpt @@ -74,8 +74,8 @@ foreach($values as $value) { echo "-- Iteration $iterator --\n"; try { var_dump(strip_tags($string, $value)); - } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $iterator++; }; @@ -125,5 +125,5 @@ string(10) "helloworld" -- Iteration 20 -- string(10) "helloworld" -- Iteration 21 -- -strip_tags(): Argument #2 ($allowed_tags) must be of type array|string|null, resource given +TypeError: strip_tags(): Argument #2 ($allowed_tags) must be of type array|string|null, resource given Done diff --git a/ext/standard/tests/strings/stripos_error.phpt b/ext/standard/tests/strings/stripos_error.phpt index a3e805a709f9..f04799519d01 100644 --- a/ext/standard/tests/strings/stripos_error.phpt +++ b/ext/standard/tests/strings/stripos_error.phpt @@ -7,15 +7,15 @@ echo "*** Testing stripos() function: error conditions ***\n"; echo "\n-- Offset beyond the end of the string --\n"; try { stripos("Hello World", "o", 12); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\n-- Offset before the start of the string --\n"; try { stripos("Hello World", "o", -12); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "*** Done ***"; @@ -24,8 +24,8 @@ echo "*** Done ***"; *** Testing stripos() function: error conditions *** -- Offset beyond the end of the string -- -stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -- Offset before the start of the string -- -stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) *** Done *** diff --git a/ext/standard/tests/strings/stristr_variation2.phpt b/ext/standard/tests/strings/stristr_variation2.phpt index 72d5a93df8a6..d5c77a6c5d2b 100644 --- a/ext/standard/tests/strings/stristr_variation2.phpt +++ b/ext/standard/tests/strings/stristr_variation2.phpt @@ -56,8 +56,8 @@ foreach($inputs as $input) { echo "-- Iteration $count --\n"; try { var_dump( stristr("Hello World", $input) ); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $count ++; } @@ -82,11 +82,11 @@ bool(false) -- Iteration 7 -- bool(false) -- Iteration 8 -- -stristr(): Argument #2 ($needle) must be of type string, array given +TypeError: stristr(): Argument #2 ($needle) must be of type string, array given -- Iteration 9 -- -stristr(): Argument #2 ($needle) must be of type string, array given +TypeError: stristr(): Argument #2 ($needle) must be of type string, array given -- Iteration 10 -- -stristr(): Argument #2 ($needle) must be of type string, array given +TypeError: stristr(): Argument #2 ($needle) must be of type string, array given -- Iteration 11 -- bool(false) -- Iteration 12 -- @@ -98,4 +98,4 @@ string(11) "Hello World" -- Iteration 15 -- bool(false) -- Iteration 16 -- -stristr(): Argument #2 ($needle) must be of type string, resource given +TypeError: stristr(): Argument #2 ($needle) must be of type string, resource given diff --git a/ext/standard/tests/strings/strncasecmp_error.phpt b/ext/standard/tests/strings/strncasecmp_error.phpt index 46bbdbe3b0e5..5ad38f8bded4 100644 --- a/ext/standard/tests/strings/strncasecmp_error.phpt +++ b/ext/standard/tests/strings/strncasecmp_error.phpt @@ -11,12 +11,12 @@ $len = -10; try { var_dump( strncasecmp($str1, $str2, $len) ); -} catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- *** Testing strncasecmp() function: error conditions *** -- Testing strncasecmp() function with invalid argument -- -strncasecmp(): Argument #3 ($length) must be greater than or equal to 0 +ValueError: strncasecmp(): Argument #3 ($length) must be greater than or equal to 0 diff --git a/ext/standard/tests/strings/strncmp_error.phpt b/ext/standard/tests/strings/strncmp_error.phpt index ed83651072c0..047f28d2e51f 100644 --- a/ext/standard/tests/strings/strncmp_error.phpt +++ b/ext/standard/tests/strings/strncmp_error.phpt @@ -13,11 +13,11 @@ $len = -10; try { var_dump( strncmp($str1, $str2, $len) ); -} catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- *** Testing strncmp() function: error conditions *** -strncmp(): Argument #3 ($length) must be greater than or equal to 0 +ValueError: strncmp(): Argument #3 ($length) must be greater than or equal to 0 diff --git a/ext/standard/tests/strings/strpbrk_error.phpt b/ext/standard/tests/strings/strpbrk_error.phpt index 3d7f84e948bf..502210833017 100644 --- a/ext/standard/tests/strings/strpbrk_error.phpt +++ b/ext/standard/tests/strings/strpbrk_error.phpt @@ -7,11 +7,11 @@ $haystack = 'This is a Simple text.'; echo "-- Testing strpbrk() function with empty second argument --\n"; try { strpbrk($haystack, ''); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -- Testing strpbrk() function with empty second argument -- -strpbrk(): Argument #2 ($characters) must be a non-empty string +ValueError: strpbrk(): Argument #2 ($characters) must be a non-empty string diff --git a/ext/standard/tests/strings/strpos.phpt b/ext/standard/tests/strings/strpos.phpt index 05913cc1f03b..c3dde30ae69c 100644 --- a/ext/standard/tests/strings/strpos.phpt +++ b/ext/standard/tests/strings/strpos.phpt @@ -83,8 +83,8 @@ for( $i = 0; $i < count( $offset_values ); $i++ ) { echo "Position of 'Hello' with offset '$offset_values[$i]' is => "; try { var_dump( strpos($string, "Hello", $offset_values[$i]) ); - } catch (TypeError $e) { - echo "\n", $e->getMessage(), "\n"; + } catch (Throwable $e) { + echo "\n", $e::class, ': ', $e->getMessage(), "\n"; } } @@ -161,14 +161,14 @@ echo "\n*** Testing error conditions ***\n"; var_dump( strpos($string, "") ); try { strpos($string, "test", strlen($string)+1); // offset > strlen() -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strpos($string, "test", -strlen($string)-1); // offset before start -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> @@ -227,14 +227,14 @@ abcd$:Hello world' is => int(0) *** Testing strpos() with possible variations in offset *** Position of 'Hello' with offset '1' is => int(74) Position of 'Hello' with offset 'string' is => -strpos(): Argument #3 ($offset) must be of type int, string given +TypeError: strpos(): Argument #3 ($offset) must be of type int, string given Position of 'Hello' with offset '' is => -strpos(): Argument #3 ($offset) must be of type int, string given +TypeError: strpos(): Argument #3 ($offset) must be of type int, string given Position of 'Hello' with offset '0' is => int(0) Position of 'Hello' with offset '1' is => int(74) Position of 'Hello' with offset '' is => int(0) Position of 'Hello' with offset 'string12' is => -strpos(): Argument #3 ($offset) must be of type int, string given +TypeError: strpos(): Argument #3 ($offset) must be of type int, string given Position of 'Hello' with offset '-10' is => bool(false) Position of 'Hello' with offset '-15' is => int(74) Position of 'Hello' with offset '-85' is => int(0) @@ -278,7 +278,7 @@ int(7) *** Testing error conditions *** int(0) -strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) DONE diff --git a/ext/standard/tests/strings/strripos_offset.phpt b/ext/standard/tests/strings/strripos_offset.phpt index 59b5374caec7..22d5b59aa735 100644 --- a/ext/standard/tests/strings/strripos_offset.phpt +++ b/ext/standard/tests/strings/strripos_offset.phpt @@ -5,40 +5,40 @@ strripos() offset integer overflow try { var_dump(strripos("t", "t", PHP_INT_MAX+1)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { strripos(1024, 1024, -PHP_INT_MAX); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strripos(1024, "te", -PHP_INT_MAX); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strripos(1024, 1024, -PHP_INT_MAX-1); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strripos(1024, "te", -PHP_INT_MAX-1); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Done\n"; ?> --EXPECT-- -strripos(): Argument #3 ($offset) must be of type int, float given -strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +TypeError: strripos(): Argument #3 ($offset) must be of type int, float given +ValueError: strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) Done diff --git a/ext/standard/tests/strings/strrpos_negative_offset.phpt b/ext/standard/tests/strings/strrpos_negative_offset.phpt index e4ac469ba4b8..0783f566a831 100644 --- a/ext/standard/tests/strings/strrpos_negative_offset.phpt +++ b/ext/standard/tests/strings/strrpos_negative_offset.phpt @@ -10,8 +10,8 @@ strr[i]pos() function with negative offset var_dump(strrpos("haystack", 'a', -4)); try { strrpos("haystack", 'h', -9); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump(strripos("HAYSTHACk", 'ha', -9)); var_dump(strripos("HAYSTACK", 'h', -8)); @@ -21,8 +21,8 @@ strr[i]pos() function with negative offset var_dump(strripos("HAYSTACK", 'a', -4)); try { strripos("HAYSTACK", 'h', -9); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- @@ -32,11 +32,11 @@ int(7) bool(false) int(5) int(1) -strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) int(0) int(0) int(7) bool(false) int(5) int(1) -strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) diff --git a/ext/standard/tests/strings/strrpos_offset.phpt b/ext/standard/tests/strings/strrpos_offset.phpt index 46b37955e4ab..2d77fa43fb59 100644 --- a/ext/standard/tests/strings/strrpos_offset.phpt +++ b/ext/standard/tests/strings/strrpos_offset.phpt @@ -5,40 +5,40 @@ strrpos() offset integer overflow try { var_dump(strrpos("t", "t", PHP_INT_MAX+1)); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { strrpos(1024, 1024, -PHP_INT_MAX); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strrpos(1024, "te", -PHP_INT_MAX); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strrpos(1024, 1024, -PHP_INT_MAX-1); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strrpos(1024, "te", -PHP_INT_MAX-1); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Done\n"; ?> --EXPECT-- -strrpos(): Argument #3 ($offset) must be of type int, float given -strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +TypeError: strrpos(): Argument #3 ($offset) must be of type int, float given +ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) Done diff --git a/ext/standard/tests/strings/strrpos_variation7.phpt b/ext/standard/tests/strings/strrpos_variation7.phpt index f73d4129d5c4..01d8996b57b2 100644 --- a/ext/standard/tests/strings/strrpos_variation7.phpt +++ b/ext/standard/tests/strings/strrpos_variation7.phpt @@ -13,8 +13,8 @@ EOD; var_dump( strrpos($empty_string, "") ); try { strrpos($empty_string, "", 1); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump( strrpos($empty_string, FALSE) ); @@ -24,6 +24,6 @@ echo "*** Done ***"; *** Testing strrpos() function: with heredoc strings *** -- With empty heredoc string -- int(0) -strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) int(0) *** Done *** diff --git a/ext/standard/tests/strings/strtr_variation6.phpt b/ext/standard/tests/strings/strtr_variation6.phpt index a43bbd24583a..a1597e24574e 100644 --- a/ext/standard/tests/strings/strtr_variation6.phpt +++ b/ext/standard/tests/strings/strtr_variation6.phpt @@ -66,8 +66,8 @@ for($index = 0; $index < count($from_arr); $index++) { $from = $from_arr[$index]; try { var_dump(strtr($str, $from, $to)); - } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $count++; } @@ -89,11 +89,11 @@ string(6) "m1tatm" -- Iteration 6 -- string(6) "tm0atm" -- Iteration 7 -- -strtr(): Argument #2 ($from) must be of type string, array given +TypeError: strtr(): Argument #2 ($from) must be of type string, array given -- Iteration 8 -- -strtr(): Argument #2 ($from) must be of type string, array given +TypeError: strtr(): Argument #2 ($from) must be of type string, array given -- Iteration 9 -- -strtr(): Argument #2 ($from) must be of type string, array given +TypeError: strtr(): Argument #2 ($from) must be of type string, array given -- Iteration 10 -- string(6) "0a2atm" -- Iteration 11 -- @@ -113,4 +113,4 @@ string(6) "012atm" -- Iteration 16 -- string(6) "012ttm" -- Iteration 17 -- -strtr(): Argument #2 ($from) must be of type string, resource given +TypeError: strtr(): Argument #2 ($from) must be of type string, resource given diff --git a/ext/standard/tests/strings/strtr_variation8.phpt b/ext/standard/tests/strings/strtr_variation8.phpt index 31e41ae9e263..aee2fe6a3566 100644 --- a/ext/standard/tests/strings/strtr_variation8.phpt +++ b/ext/standard/tests/strings/strtr_variation8.phpt @@ -63,8 +63,8 @@ for($index = 0; $index < count($replace_pairs_arr); $index++) { $replace_pairs = $replace_pairs_arr[$index]; try { var_dump(strtr($str, $replace_pairs)); - } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + } catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $count ++; @@ -78,22 +78,22 @@ echo "*** Done ***"; *** Testing strtr() function: with unexpected inputs for 'replace_pairs' *** -- Iteration 1 -- -strtr(): Argument #2 ($from) must be of type array, int given +TypeError: strtr(): Argument #2 ($from) must be of type array, int given -- Iteration 2 -- -strtr(): Argument #2 ($from) must be of type array, int given +TypeError: strtr(): Argument #2 ($from) must be of type array, int given -- Iteration 3 -- -strtr(): Argument #2 ($from) must be of type array, int given +TypeError: strtr(): Argument #2 ($from) must be of type array, int given -- Iteration 4 -- -strtr(): Argument #2 ($from) must be of type array, float given +TypeError: strtr(): Argument #2 ($from) must be of type array, float given -- Iteration 5 -- -strtr(): Argument #2 ($from) must be of type array, float given +TypeError: strtr(): Argument #2 ($from) must be of type array, float given -- Iteration 6 -- -strtr(): Argument #2 ($from) must be of type array, float given +TypeError: strtr(): Argument #2 ($from) must be of type array, float given -- Iteration 7 -- string(6) "012atm" @@ -105,26 +105,26 @@ string(6) "012atm" string(6) "122atm" -- Iteration 10 -- -strtr(): Argument #2 ($from) must be of type array, true given +TypeError: strtr(): Argument #2 ($from) must be of type array, true given -- Iteration 11 -- -strtr(): Argument #2 ($from) must be of type array, false given +TypeError: strtr(): Argument #2 ($from) must be of type array, false given -- Iteration 12 -- -strtr(): Argument #2 ($from) must be of type array, true given +TypeError: strtr(): Argument #2 ($from) must be of type array, true given -- Iteration 13 -- -strtr(): Argument #2 ($from) must be of type array, false given +TypeError: strtr(): Argument #2 ($from) must be of type array, false given -- Iteration 14 -- -strtr(): Argument #2 ($from) must be of type array, null given +TypeError: strtr(): Argument #2 ($from) must be of type array, null given -- Iteration 15 -- -strtr(): Argument #2 ($from) must be of type array, null given +TypeError: strtr(): Argument #2 ($from) must be of type array, null given -- Iteration 16 -- -strtr(): Argument #2 ($from) must be of type array, sample given +TypeError: strtr(): Argument #2 ($from) must be of type array, sample given -- Iteration 17 -- -strtr(): Argument #2 ($from) must be of type array, resource given +TypeError: strtr(): Argument #2 ($from) must be of type array, resource given *** Done *** diff --git a/ext/standard/tests/strings/strval_error.phpt b/ext/standard/tests/strings/strval_error.phpt index 8ec78f080f20..ef9fb3eacb76 100644 --- a/ext/standard/tests/strings/strval_error.phpt +++ b/ext/standard/tests/strings/strval_error.phpt @@ -15,8 +15,8 @@ class MyClass echo "\n-- Testing strval() function with object which has not toString() method --\n"; try { var_dump( strval(new MyClass()) ); -} catch (Error $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -24,4 +24,4 @@ try { *** Testing strval() : error conditions *** -- Testing strval() function with object which has not toString() method -- -Object of class MyClass could not be converted to string +Error: Object of class MyClass could not be converted to string diff --git a/ext/standard/tests/strings/substr_compare.phpt b/ext/standard/tests/strings/substr_compare.phpt index 51d093a65fa2..650deae6217f 100644 --- a/ext/standard/tests/strings/substr_compare.phpt +++ b/ext/standard/tests/strings/substr_compare.phpt @@ -17,8 +17,8 @@ echo "Test\n"; try { substr_compare("abcde", "abc", 0, -1); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(substr_compare("abcde", "abc", -1, NULL, -5) > 0); ?> @@ -34,5 +34,5 @@ int(-1) bool(true) int(0) Test -substr_compare(): Argument #4 ($length) must be greater than or equal to 0 +ValueError: substr_compare(): Argument #4 ($length) must be greater than or equal to 0 bool(true) diff --git a/ext/standard/tests/strings/substr_count_basic.phpt b/ext/standard/tests/strings/substr_count_basic.phpt index efb5806d1621..4dee85a6133f 100644 --- a/ext/standard/tests/strings/substr_count_basic.phpt +++ b/ext/standard/tests/strings/substr_count_basic.phpt @@ -6,13 +6,13 @@ Test substr_count() function (basic) echo "***Testing basic operations ***\n"; try { substr_count("", ""); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { substr_count("a", ""); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(substr_count("", "a")); var_dump(substr_count("", "a")); @@ -34,8 +34,8 @@ var_dump(substr_count($a, "bca", -200, -50)); ?> --EXPECT-- ***Testing basic operations *** -substr_count(): Argument #2 ($needle) must not be empty -substr_count(): Argument #2 ($needle) must not be empty +ValueError: substr_count(): Argument #2 ($needle) must not be empty +ValueError: substr_count(): Argument #2 ($needle) must not be empty int(0) int(0) int(0) diff --git a/ext/standard/tests/strings/substr_count_error.phpt b/ext/standard/tests/strings/substr_count_error.phpt index dc0d3d9834eb..132edc6dbc01 100644 --- a/ext/standard/tests/strings/substr_count_error.phpt +++ b/ext/standard/tests/strings/substr_count_error.phpt @@ -9,30 +9,30 @@ $str = 'abcdefghik'; /* offset before start */ try { substr_count($str, "t", -20); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } /* offset > size of the string */ try { substr_count($str, "t", 25); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } /* Using offset and length to go beyond the size of the string: Exception is expected, as length+offset > length of string */ try { substr_count($str, "i", 5, 7); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } /* length too small */ try { substr_count($str, "t", 2, -20); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Done\n"; @@ -40,8 +40,8 @@ echo "Done\n"; ?> --EXPECT-- *** Testing error conditions *** -substr_count(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -substr_count(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -substr_count(): Argument #4 ($length) must be contained in argument #1 ($haystack) -substr_count(): Argument #4 ($length) must be contained in argument #1 ($haystack) +ValueError: substr_count(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: substr_count(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: substr_count(): Argument #4 ($length) must be contained in argument #1 ($haystack) +ValueError: substr_count(): Argument #4 ($length) must be contained in argument #1 ($haystack) Done diff --git a/ext/standard/tests/strings/substr_replace_error.phpt b/ext/standard/tests/strings/substr_replace_error.phpt index 165cc1e6913d..935d07c1ffb5 100644 --- a/ext/standard/tests/strings/substr_replace_error.phpt +++ b/ext/standard/tests/strings/substr_replace_error.phpt @@ -13,13 +13,13 @@ $s1 = "Good morning"; echo "\n-- Testing substr_replace() function with start and length as arrays but string not--\n"; try { var_dump(substr_replace($s1, "evening", array(5))); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(substr_replace($s1, "evening", 5, array(1))); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -27,5 +27,5 @@ try { *** Testing substr_replace() : error conditions *** -- Testing substr_replace() function with start and length as arrays but string not-- -substr_replace(): Argument #3 ($offset) cannot be an array when working on a single string -substr_replace(): Argument #4 ($length) cannot be an array when working on a single string +TypeError: substr_replace(): Argument #3 ($offset) cannot be an array when working on a single string +TypeError: substr_replace(): Argument #4 ($length) cannot be an array when working on a single string diff --git a/ext/standard/tests/strings/unpack_error.phpt b/ext/standard/tests/strings/unpack_error.phpt index c41185b23ace..afeab26e2bcf 100644 --- a/ext/standard/tests/strings/unpack_error.phpt +++ b/ext/standard/tests/strings/unpack_error.phpt @@ -5,10 +5,10 @@ Test unpack() function : error conditions try { var_dump(unpack("B", pack("I", 65534))); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Invalid format type B +ValueError: Invalid format type B diff --git a/ext/standard/tests/strings/unpack_offset.phpt b/ext/standard/tests/strings/unpack_offset.phpt index bd787859c11a..a3046c32d6f9 100644 --- a/ext/standard/tests/strings/unpack_offset.phpt +++ b/ext/standard/tests/strings/unpack_offset.phpt @@ -13,17 +13,17 @@ printf("0x%08x 0x%08x\n", try { unpack("l", "foo", 10); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unpack("l", "foo", -1); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- 0x01020304 0x05060708 0x01020304 0x05060708 -unpack(): Argument #3 ($offset) must be contained in argument #2 ($data) -unpack(): Argument #3 ($offset) must be contained in argument #2 ($data) +ValueError: unpack(): Argument #3 ($offset) must be contained in argument #2 ($data) +ValueError: unpack(): Argument #3 ($offset) must be contained in argument #2 ($data) diff --git a/ext/standard/tests/strings/vfprintf_error1.phpt b/ext/standard/tests/strings/vfprintf_error1.phpt index 1c114daee42d..c9fc11f6fb2a 100644 --- a/ext/standard/tests/strings/vfprintf_error1.phpt +++ b/ext/standard/tests/strings/vfprintf_error1.phpt @@ -16,13 +16,13 @@ $args = array( 1, 2 ); $extra_arg = 10; try { var_dump( vfprintf( $fp, $format, $args, $extra_arg ) ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( vfprintf( $fp, "Foo %d", array(6), "bar" ) ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } // Close handle @@ -38,5 +38,5 @@ unlink( $file ); ?> --EXPECT-- -- Testing vfprintf() function with more than expected no. of arguments -- -vfprintf() expects exactly 3 arguments, 4 given -vfprintf() expects exactly 3 arguments, 4 given +ArgumentCountError: vfprintf() expects exactly 3 arguments, 4 given +ArgumentCountError: vfprintf() expects exactly 3 arguments, 4 given diff --git a/ext/standard/tests/strings/vfprintf_error3.phpt b/ext/standard/tests/strings/vfprintf_error3.phpt index 24991552e0a3..4d567ae9a33b 100644 --- a/ext/standard/tests/strings/vfprintf_error3.phpt +++ b/ext/standard/tests/strings/vfprintf_error3.phpt @@ -13,20 +13,20 @@ $fp = fopen( $file, "a+" ); echo "\n-- Testing vfprintf() function with wrong variable types as argument --\n"; try { vfprintf($fp, array( 'foo %d', 'bar %s' ), 3.55552); -} catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { vfprintf($fp, "Foo: %s", "not available"); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { vfprintf($fp, "Foo %y fake", ["not available"]); -} catch (ValueError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } rewind( $fp ); @@ -47,7 +47,7 @@ unlink( $file ); ?> --EXPECT-- -- Testing vfprintf() function with wrong variable types as argument -- -vfprintf(): Argument #2 ($format) must be of type string, array given -vfprintf(): Argument #3 ($values) must be of type array, string given -Unknown format specifier "y" +TypeError: vfprintf(): Argument #2 ($format) must be of type string, array given +TypeError: vfprintf(): Argument #3 ($values) must be of type array, string given +ValueError: Unknown format specifier "y" string(0) "" diff --git a/ext/standard/tests/strings/vfprintf_error4.phpt b/ext/standard/tests/strings/vfprintf_error4.phpt index 7c4578ee4090..7daf4709a249 100644 --- a/ext/standard/tests/strings/vfprintf_error4.phpt +++ b/ext/standard/tests/strings/vfprintf_error4.phpt @@ -13,13 +13,13 @@ $fp = fopen( $file, "a+" ); echo "\n-- Testing vfprintf() function with other strangeties --\n"; try { var_dump( vfprintf( 'foo', 'bar', array( 'baz' ) ) ); -} catch (TypeError $e) { - echo $e->getMessage(), "\n"; +} catch (Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( vfprintf( $fp, 'Foo %$c-0202Sd', array( 2 ) ) ); -} catch(\ValueError $e) { - print('Error found: '.$e->getMessage().".\n"); +} catch(\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } // Close handle fclose( $fp ); @@ -34,5 +34,5 @@ unlink( $file ); ?> --EXPECT-- -- Testing vfprintf() function with other strangeties -- -vfprintf(): Argument #1 ($stream) must be of type resource, string given -Error found: Argument number specifier must be greater than zero and less than 2147483647. +TypeError: vfprintf(): Argument #1 ($stream) must be of type resource, string given +ValueError: Argument number specifier must be greater than zero and less than 2147483647 diff --git a/ext/standard/tests/strings/vfprintf_variation1.phpt b/ext/standard/tests/strings/vfprintf_variation1.phpt index 36d983817024..834635afa47c 100644 --- a/ext/standard/tests/strings/vfprintf_variation1.phpt +++ b/ext/standard/tests/strings/vfprintf_variation1.phpt @@ -33,8 +33,8 @@ function writeAndDump($fp, $format, $args) $content = stream_get_contents( $fp ); var_dump( $content ); var_dump( $length ); - } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -60,7 +60,7 @@ unlink( $file ); ?> --EXPECT-- *** Testing vfprintf() : variation functionality *** -vfprintf(): Argument #3 ($values) must be of type array, null given +TypeError: vfprintf(): Argument #3 ($values) must be of type array, null given string(17) "Foo is 30 and bar" int(17) string(14) "Foobar testing" diff --git a/ext/standard/tests/strings/vprintf_variation2.phpt b/ext/standard/tests/strings/vprintf_variation2.phpt index f6d92e577402..8d5fc637d461 100644 --- a/ext/standard/tests/strings/vprintf_variation2.phpt +++ b/ext/standard/tests/strings/vprintf_variation2.phpt @@ -83,10 +83,10 @@ foreach($values as $value) { $result = vprintf($format,$value); echo "\n"; var_dump($result); - } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; - } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + } catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; + } catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } $counter++; }; @@ -99,70 +99,70 @@ fclose($file_handle); *** Testing vprintf() : with unexpected values for args argument *** -- Iteration 1 -- -vprintf(): Argument #2 ($values) must be of type array, int given +TypeError: vprintf(): Argument #2 ($values) must be of type array, int given -- Iteration 2 -- -vprintf(): Argument #2 ($values) must be of type array, int given +TypeError: vprintf(): Argument #2 ($values) must be of type array, int given -- Iteration 3 -- -vprintf(): Argument #2 ($values) must be of type array, int given +TypeError: vprintf(): Argument #2 ($values) must be of type array, int given -- Iteration 4 -- -vprintf(): Argument #2 ($values) must be of type array, int given +TypeError: vprintf(): Argument #2 ($values) must be of type array, int given -- Iteration 5 -- -vprintf(): Argument #2 ($values) must be of type array, float given +TypeError: vprintf(): Argument #2 ($values) must be of type array, float given -- Iteration 6 -- -vprintf(): Argument #2 ($values) must be of type array, float given +TypeError: vprintf(): Argument #2 ($values) must be of type array, float given -- Iteration 7 -- -vprintf(): Argument #2 ($values) must be of type array, float given +TypeError: vprintf(): Argument #2 ($values) must be of type array, float given -- Iteration 8 -- -vprintf(): Argument #2 ($values) must be of type array, float given +TypeError: vprintf(): Argument #2 ($values) must be of type array, float given -- Iteration 9 -- -vprintf(): Argument #2 ($values) must be of type array, float given +TypeError: vprintf(): Argument #2 ($values) must be of type array, float given -- Iteration 10 -- -vprintf(): Argument #2 ($values) must be of type array, null given +TypeError: vprintf(): Argument #2 ($values) must be of type array, null given -- Iteration 11 -- -vprintf(): Argument #2 ($values) must be of type array, null given +TypeError: vprintf(): Argument #2 ($values) must be of type array, null given -- Iteration 12 -- -vprintf(): Argument #2 ($values) must be of type array, true given +TypeError: vprintf(): Argument #2 ($values) must be of type array, true given -- Iteration 13 -- -vprintf(): Argument #2 ($values) must be of type array, false given +TypeError: vprintf(): Argument #2 ($values) must be of type array, false given -- Iteration 14 -- -vprintf(): Argument #2 ($values) must be of type array, true given +TypeError: vprintf(): Argument #2 ($values) must be of type array, true given -- Iteration 15 -- -vprintf(): Argument #2 ($values) must be of type array, false given +TypeError: vprintf(): Argument #2 ($values) must be of type array, false given -- Iteration 16 -- -vprintf(): Argument #2 ($values) must be of type array, string given +TypeError: vprintf(): Argument #2 ($values) must be of type array, string given -- Iteration 17 -- -vprintf(): Argument #2 ($values) must be of type array, string given +TypeError: vprintf(): Argument #2 ($values) must be of type array, string given -- Iteration 18 -- -vprintf(): Argument #2 ($values) must be of type array, string given +TypeError: vprintf(): Argument #2 ($values) must be of type array, string given -- Iteration 19 -- -vprintf(): Argument #2 ($values) must be of type array, string given +TypeError: vprintf(): Argument #2 ($values) must be of type array, string given -- Iteration 20 -- -vprintf(): Argument #2 ($values) must be of type array, sample given +TypeError: vprintf(): Argument #2 ($values) must be of type array, sample given -- Iteration 21 -- -vprintf(): Argument #2 ($values) must be of type array, null given +TypeError: vprintf(): Argument #2 ($values) must be of type array, null given -- Iteration 22 -- -vprintf(): Argument #2 ($values) must be of type array, null given +TypeError: vprintf(): Argument #2 ($values) must be of type array, null given -- Iteration 23 -- -vprintf(): Argument #2 ($values) must be of type array, resource given +TypeError: vprintf(): Argument #2 ($values) must be of type array, resource given diff --git a/ext/standard/tests/strings/wordwrap.phpt b/ext/standard/tests/strings/wordwrap.phpt index efa12bef18dd..a256dda9e7e3 100644 --- a/ext/standard/tests/strings/wordwrap.phpt +++ b/ext/standard/tests/strings/wordwrap.phpt @@ -29,8 +29,8 @@ var_dump("123|==1234567890|==123" === wordwrap("123 1234567890 123", 10, "|==", try { wordwrap(chr(0), 0, ""); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- @@ -53,4 +53,4 @@ bool(true) bool(true) bool(true) bool(true) -wordwrap(): Argument #3 ($break) must not be empty +ValueError: wordwrap(): Argument #3 ($break) must not be empty diff --git a/ext/standard/tests/strings/wordwrap_error.phpt b/ext/standard/tests/strings/wordwrap_error.phpt index b93bb80565b8..72d5b4570c61 100644 --- a/ext/standard/tests/strings/wordwrap_error.phpt +++ b/ext/standard/tests/strings/wordwrap_error.phpt @@ -24,8 +24,8 @@ $cut = true; try { wordwrap($str, $width, $break, $cut); -} catch (\ValueError $e) { - echo $e->getMessage() . "\n"; +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- width = -10 & cut = false --\n"; @@ -47,7 +47,7 @@ var_dump( wordwrap($str, $width, $break, $cut) ); -- width = 0 & cut = false -- string(39) "testing
\nwordwrap
\nfunction" -- width = 0 & cut = true -- -wordwrap(): Argument #4 ($cut_long_words) cannot be true when argument #2 ($width) is 0 +ValueError: wordwrap(): Argument #4 ($cut_long_words) cannot be true when argument #2 ($width) is 0 -- width = -10 & cut = false -- string(39) "testing
\nwordwrap
\nfunction" -- width = -10 & cut = true -- diff --git a/ext/standard/tests/time/bug60222.phpt b/ext/standard/tests/time/bug60222.phpt index 0256e2de1d5c..22ae73ad086a 100644 --- a/ext/standard/tests/time/bug60222.phpt +++ b/ext/standard/tests/time/bug60222.phpt @@ -4,16 +4,16 @@ Bug #60222 (time_nanosleep() does validate input params) getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { time_nanosleep(0, -1); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + } catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -time_nanosleep(): Argument #1 ($seconds) must be greater than or equal to 0 -time_nanosleep(): Argument #2 ($nanoseconds) must be greater than or equal to 0 +ValueError: time_nanosleep(): Argument #1 ($seconds) must be greater than or equal to 0 +ValueError: time_nanosleep(): Argument #2 ($nanoseconds) must be greater than or equal to 0 diff --git a/ext/standard/tests/url/parse_url_error_002.phpt b/ext/standard/tests/url/parse_url_error_002.phpt index 8747e568e939..31baa446c511 100644 --- a/ext/standard/tests/url/parse_url_error_002.phpt +++ b/ext/standard/tests/url/parse_url_error_002.phpt @@ -11,8 +11,8 @@ var_dump(parse_url($url, -1)); echo "\n\n--> Above range:\n"; try { parse_url($url, 99); -} catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Done" @@ -40,5 +40,5 @@ echo "Done" --> Above range: -parse_url(): Argument #2 ($component) must be a valid URL component identifier, 99 given +ValueError: parse_url(): Argument #2 ($component) must be a valid URL component identifier, 99 given Done diff --git a/ext/standard/tests/versioning/version_compare_invalid_operator.phpt b/ext/standard/tests/versioning/version_compare_invalid_operator.phpt index c4fffab73328..6cd09a2eb0b0 100644 --- a/ext/standard/tests/versioning/version_compare_invalid_operator.phpt +++ b/ext/standard/tests/versioning/version_compare_invalid_operator.phpt @@ -6,9 +6,9 @@ David Stockton - - i3logix PHP Testfest 2017 getMessage() . "\n"; +} catch (Throwable $exception) { + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -version_compare(): Argument #3 ($operator) must be a valid comparison operator +ValueError: version_compare(): Argument #3 ($operator) must be a valid comparison operator From 6072a9eb9a356797c9cd7bde46c554f4e55d92d4 Mon Sep 17 00:00:00 2001 From: NickSdot Date: Sat, 22 Aug 2026 01:04:43 +0700 Subject: [PATCH 2/3] fix: kept sibling catch types --- ext/standard/tests/strings/chunk_split_variation5.phpt | 4 ++-- ext/standard/tests/strings/chunk_split_variation8.phpt | 4 ++-- ext/standard/tests/strings/vprintf_variation2.phpt | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ext/standard/tests/strings/chunk_split_variation5.phpt b/ext/standard/tests/strings/chunk_split_variation5.phpt index e51e7d617a34..d4ada8ba14f9 100644 --- a/ext/standard/tests/strings/chunk_split_variation5.phpt +++ b/ext/standard/tests/strings/chunk_split_variation5.phpt @@ -34,9 +34,9 @@ for($count = 0; $count < count($values); $count++) { echo "-- Iteration $count --\n"; try { var_dump( chunk_split($str, $values[$count], $ending) ); - } catch (Throwable $e) { + } catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; - } catch (\Throwable $e) { + } catch (\ValueError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } } diff --git a/ext/standard/tests/strings/chunk_split_variation8.phpt b/ext/standard/tests/strings/chunk_split_variation8.phpt index d808ec1bcee1..00d58c6b87e5 100644 --- a/ext/standard/tests/strings/chunk_split_variation8.phpt +++ b/ext/standard/tests/strings/chunk_split_variation8.phpt @@ -42,9 +42,9 @@ for($count = 0; $count < count($values); $count++) { echo "-- Iteration ".($count+1). " --\n"; try { var_dump( chunk_split($heredoc_str, $values[$count], $ending) ); - } catch (Throwable $e) { + } catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; - } catch (\Throwable $e) { + } catch (\ValueError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } } diff --git a/ext/standard/tests/strings/vprintf_variation2.phpt b/ext/standard/tests/strings/vprintf_variation2.phpt index 8d5fc637d461..5509d29832e3 100644 --- a/ext/standard/tests/strings/vprintf_variation2.phpt +++ b/ext/standard/tests/strings/vprintf_variation2.phpt @@ -83,9 +83,9 @@ foreach($values as $value) { $result = vprintf($format,$value); echo "\n"; var_dump($result); - } catch (\Throwable $e) { + } catch (\TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; - } catch (\Throwable $e) { + } catch (\ValueError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } $counter++; From f9206bf941f32eae1dfced2b7be2da6b0c94fa3b Mon Sep 17 00:00:00 2001 From: NickSdot Date: Sat, 22 Aug 2026 01:04:43 +0700 Subject: [PATCH 3/3] fix: removed extra line --- ext/standard/tests/general_functions/bug31190.phpt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ext/standard/tests/general_functions/bug31190.phpt b/ext/standard/tests/general_functions/bug31190.phpt index 1a277f15c6e1..a0008c9143e5 100644 --- a/ext/standard/tests/general_functions/bug31190.phpt +++ b/ext/standard/tests/general_functions/bug31190.phpt @@ -4,7 +4,7 @@ Bug #31190 (exception in call_user_func_array()) --EXPECT-- Exception: Hello World! - Exception: Hello World!